invoiceninja/public/js/grapesjs.min.js
2018-01-30 20:58:55 +02:00

30 lines
878 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.grapesjs=e():t.grapesjs=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t["default"]}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=59)}([function(t,e,n){(function(r){var i,o;!function(s){var a="object"==typeof self&&self.self===self&&self||"object"==typeof r&&r.global===r&&r;i=[n(1),n(9),e],o=function(t,e,n){a.Backbone=s(a,n,t,e)}.apply(e,i),!(void 0!==o&&(t.exports=o))}(function(t,e,n,r){var i=t.Backbone,o=Array.prototype.slice;e.VERSION="1.3.3",e.$=r,e.noConflict=function(){return t.Backbone=i,this},e.emulateHTTP=!1,e.emulateJSON=!1;var s=function(t,e,r){switch(t){case 1:return function(){return n[e](this[r])};case 2:return function(t){return n[e](this[r],t)};case 3:return function(t,i){return n[e](this[r],l(t,this),i)};case 4:return function(t,i,o){return n[e](this[r],l(t,this),i,o)};default:return function(){var t=o.call(arguments);return t.unshift(this[r]),n[e].apply(n,t)}}},a=function(t,e,r){n.each(e,function(e,i){n[i]&&(t.prototype[i]=s(e,i,r))})},l=function(t,e){return n.isFunction(t)?t:n.isObject(t)&&!e._isModel(t)?c(t):n.isString(t)?function(e){return e.get(t)}:t},c=function(t){var e=n.matches(t);return function(t){return e(t.attributes)}},u=e.Events={},h=/\s+/,f=function(t,e,r,i,o){var s,a=0;if(r&&"object"==typeof r){void 0!==i&&"context"in o&&void 0===o.context&&(o.context=i);for(s=n.keys(r);a<s.length;a++)e=f(t,e,s[a],r[s[a]],o)}else if(r&&h.test(r))for(s=r.split(h);a<s.length;a++)e=t(e,s[a],i,o);else e=t(e,r,i,o);return e};u.on=function(t,e,n){return d(this,t,e,n)};var d=function(t,e,n,r,i){if(t._events=f(p,t._events||{},e,n,{context:r,ctx:t,listening:i}),i){var o=t._listeners||(t._listeners={});o[i.id]=i}return t};u.listenTo=function(t,e,r){if(!t)return this;var i=t._listenId||(t._listenId=n.uniqueId("l")),o=this._listeningTo||(this._listeningTo={}),s=o[i];if(!s){var a=this._listenId||(this._listenId=n.uniqueId("l"));s=o[i]={obj:t,objId:i,id:a,listeningTo:o,count:0}}return d(t,e,r,this,s),this};var p=function(t,e,n,r){if(n){var i=t[e]||(t[e]=[]),o=r.context,s=r.ctx,a=r.listening;a&&a.count++,i.push({callback:n,context:o,ctx:o||s,listening:a})}return t};u.off=function(t,e,n){return this._events?(this._events=f(g,this._events,t,e,{context:n,listeners:this._listeners}),this):this},u.stopListening=function(t,e,r){var i=this._listeningTo;if(!i)return this;for(var o=t?[t._listenId]:n.keys(i),s=0;s<o.length;s++){var a=i[o[s]];if(!a)break;a.obj.off(e,r,this)}return this};var g=function(t,e,r,i){if(t){var o,s=0,a=i.context,l=i.listeners;if(e||r||a){for(var c=e?[e]:n.keys(t);s<c.length;s++){e=c[s];var u=t[e];if(!u)break;for(var h=[],f=0;f<u.length;f++){var d=u[f];r&&r!==d.callback&&r!==d.callback._callback||a&&a!==d.context?h.push(d):(o=d.listening,o&&0===--o.count&&(delete l[o.id],delete o.listeningTo[o.objId]))}h.length?t[e]=h:delete t[e]}return t}for(var p=n.keys(l);s<p.length;s++)o=l[p[s]],delete l[o.id],delete o.listeningTo[o.objId]}};u.once=function(t,e,r){var i=f(v,{},t,e,n.bind(this.off,this));return"string"==typeof t&&null==r&&(e=void 0),this.on(i,e,r)},u.listenToOnce=function(t,e,r){var i=f(v,{},e,r,n.bind(this.stopListening,this,t));return this.listenTo(t,i)};var v=function(t,e,r,i){if(r){var o=t[e]=n.once(function(){i(e,o),r.apply(this,arguments)});o._callback=r}return t};u.trigger=function(t){if(!this._events)return this;for(var e=Math.max(0,arguments.length-1),n=Array(e),r=0;r<e;r++)n[r]=arguments[r+1];return f(m,this._events,t,void 0,n),this};var m=function(t,e,n,r){if(t){var i=t[e],o=t.all;i&&o&&(o=o.slice()),i&&y(i,r),o&&y(o,[e].concat(r))}return t},y=function(t,e){var n,r=-1,i=t.length,o=e[0],s=e[1],a=e[2];switch(e.length){case 0:for(;++r<i;)(n=t[r]).callback.call(n.ctx);return;case 1:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o);return;case 2:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,s);return;case 3:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,s,a);return;default:for(;++r<i;)(n=t[r]).callback.apply(n.ctx,e);return}};u.bind=u.on,u.unbind=u.off,n.extend(e,u);var b=e.Model=function(t,e){var r=t||{};e||(e={}),this.cid=n.uniqueId(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(r=this.parse(r,e)||{});var i=n.result(this,"defaults");r=n.defaults(n.extend({},i,r),i),this.set(r,e),this.changed={},this.initialize.apply(this,arguments)};n.extend(b.prototype,u,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",initialize:function(){},toJSON:function(t){return n.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return n.escape(this.get(t))},has:function(t){return null!=this.get(t)},matches:function(t){return!!n.iteratee(t,this)(this.attributes)},set:function(t,e,r){if(null==t)return this;var i;if("object"==typeof t?(i=t,r=e):(i={})[t]=e,r||(r={}),!this._validate(i,r))return!1;var o=r.unset,s=r.silent,a=[],l=this._changing;this._changing=!0,l||(this._previousAttributes=n.clone(this.attributes),this.changed={});var c=this.attributes,u=this.changed,h=this._previousAttributes;for(var f in i)e=i[f],n.isEqual(c[f],e)||a.push(f),n.isEqual(h[f],e)?delete u[f]:u[f]=e,o?delete c[f]:c[f]=e;if(this.idAttribute in i&&(this.id=this.get(this.idAttribute)),!s){a.length&&(this._pending=r);for(var d=0;d<a.length;d++)this.trigger("change:"+a[d],this,c[a[d]],r)}if(l)return this;if(!s)for(;this._pending;)r=this._pending,this._pending=!1,this.trigger("change",this,r);return this._pending=!1,this._changing=!1,this},unset:function(t,e){return this.set(t,void 0,n.extend({},e,{unset:!0}))},clear:function(t){var e={};for(var r in this.attributes)e[r]=void 0;return this.set(e,n.extend({},t,{unset:!0}))},hasChanged:function(t){return null==t?!n.isEmpty(this.changed):n.has(this.changed,t)},changedAttributes:function(t){if(!t)return!!this.hasChanged()&&n.clone(this.changed);var e=this._changing?this._previousAttributes:this.attributes,r={};for(var i in t){var o=t[i];n.isEqual(e[i],o)||(r[i]=o)}return!!n.size(r)&&r},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return n.clone(this._previousAttributes)},fetch:function(t){t=n.extend({parse:!0},t);var e=this,r=t.success;return t.success=function(n){var i=t.parse?e.parse(n,t):n;return!!e.set(i,t)&&(r&&r.call(t.context,e,n,t),void e.trigger("sync",e,n,t))},$(this,t),this.sync("read",this,t)},save:function(t,e,r){var i;null==t||"object"==typeof t?(i=t,r=e):(i={})[t]=e,r=n.extend({validate:!0,parse:!0},r);var o=r.wait;if(i&&!o){if(!this.set(i,r))return!1}else if(!this._validate(i,r))return!1;var s=this,a=r.success,l=this.attributes;r.success=function(t){s.attributes=l;var e=r.parse?s.parse(t,r):t;return o&&(e=n.extend({},i,e)),!(e&&!s.set(e,r))&&(a&&a.call(r.context,s,t,r),void s.trigger("sync",s,t,r))},$(this,r),i&&o&&(this.attributes=n.extend({},l,i));var c=this.isNew()?"create":r.patch?"patch":"update";"patch"!==c||r.attrs||(r.attrs=i);var u=this.sync(c,this,r);return this.attributes=l,u},destroy:function(t){t=t?n.clone(t):{};var e=this,r=t.success,i=t.wait,o=function(){e.stopListening(),e.trigger("destroy",e,e.collection,t)};t.success=function(n){i&&o(),r&&r.call(t.context,e,n,t),e.isNew()||e.trigger("sync",e,n,t)};var s=!1;return this.isNew()?n.defer(t.success):($(this,t),s=this.sync("delete",this,t)),i||o(),s},url:function(){var t=n.result(this,"urlRoot")||n.result(this.collection,"url")||z();if(this.isNew())return t;var e=this.get(this.idAttribute);return t.replace(/[^\/]$/,"$&/")+encodeURIComponent(e)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},n.extend({},t,{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=n.extend({},this.attributes,t);var r=this.validationError=this.validate(t,e)||null;return!r||(this.trigger("invalid",this,r,n.extend(e,{validationError:r})),!1)}});var w={keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1};a(b,w,"attributes");var x=e.Collection=function(t,e){e||(e={}),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,n.extend({silent:!0},e))},_={add:!0,remove:!0,merge:!0},C={add:!0,remove:!1},k=function(t,e,n){n=Math.min(Math.max(n,0),t.length);var r,i=Array(t.length-n),o=e.length;for(r=0;r<i.length;r++)i[r]=t[r+n];for(r=0;r<o;r++)t[r+n]=e[r];for(r=0;r<i.length;r++)t[r+o+n]=i[r]};n.extend(x.prototype,u,{model:b,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,n.extend({merge:!1},e,C))},remove:function(t,e){e=n.extend({},e);var r=!n.isArray(t);t=r?[t]:t.slice();var i=this._removeModels(t,e);return!e.silent&&i.length&&(e.changes={added:[],merged:[],removed:i},this.trigger("update",this,e)),r?i[0]:i},set:function(t,e){if(null!=t){e=n.extend({},_,e),e.parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);var r=!n.isArray(t);t=r?[t]:t.slice();var i=e.at;null!=i&&(i=+i),i>this.length&&(i=this.length),i<0&&(i+=this.length+1);var o,s,a=[],l=[],c=[],u=[],h={},f=e.add,d=e.merge,p=e.remove,g=!1,v=this.comparator&&null==i&&e.sort!==!1,m=n.isString(this.comparator)?this.comparator:null;for(s=0;s<t.length;s++){o=t[s];var y=this.get(o);if(y){if(d&&o!==y){var b=this._isModel(o)?o.attributes:o;e.parse&&(b=y.parse(b,e)),y.set(b,e),c.push(y),v&&!g&&(g=y.hasChanged(m))}h[y.cid]||(h[y.cid]=!0,a.push(y)),t[s]=y}else f&&(o=t[s]=this._prepareModel(o,e),o&&(l.push(o),this._addReference(o,e),h[o.cid]=!0,a.push(o)))}if(p){for(s=0;s<this.length;s++)o=this.models[s],h[o.cid]||u.push(o);u.length&&this._removeModels(u,e)}var w=!1,x=!v&&f&&p;if(a.length&&x?(w=this.length!==a.length||n.some(this.models,function(t,e){return t!==a[e]}),this.models.length=0,k(this.models,a,0),this.length=this.models.length):l.length&&(v&&(g=!0),k(this.models,l,null==i?this.length:i),this.length=this.models.length),g&&this.sort({silent:!0}),!e.silent){for(s=0;s<l.length;s++)null!=i&&(e.index=i+s),o=l[s],o.trigger("add",o,this,e);(g||w)&&this.trigger("sort",this,e),(l.length||u.length||c.length)&&(e.changes={added:l,removed:u,merged:c},this.trigger("update",this,e))}return r?t[0]:t}},reset:function(t,e){e=e?n.clone(e):{};for(var r=0;r<this.models.length;r++)this._removeReference(this.models[r],e);return e.previousModels=this.models,this._reset(),t=this.add(t,n.extend({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},push:function(t,e){return this.add(t,n.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t)},unshift:function(t,e){return this.add(t,n.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t)},slice:function(){return o.apply(this.models,arguments)},get:function(t){if(null!=t)return this._byId[t]||this._byId[this.modelId(t.attributes||t)]||t.cid&&this._byId[t.cid]},has:function(t){return null!=this.get(t)},at:function(t){return t<0&&(t+=this.length),this.models[t]},where:function(t,e){return this[e?"find":"filter"](t)},findWhere:function(t){return this.where(t,!0)},sort:function(t){var e=this.comparator;if(!e)throw new Error("Cannot sort a set without a comparator");t||(t={});var r=e.length;return n.isFunction(e)&&(e=n.bind(e,this)),1===r||n.isString(e)?this.models=this.sortBy(e):this.models.sort(e),t.silent||this.trigger("sort",this,t),this},pluck:function(t){return this.map(t+"")},fetch:function(t){t=n.extend({parse:!0},t);var e=t.success,r=this;return t.success=function(n){var i=t.reset?"reset":"set";r[i](n,t),e&&e.call(t.context,r,n,t),r.trigger("sync",r,n,t)},$(this,t),this.sync("read",this,t)},create:function(t,e){e=e?n.clone(e):{};var r=e.wait;if(t=this._prepareModel(t,e),!t)return!1;r||this.add(t,e);var i=this,o=e.success;return e.success=function(t,e,n){r&&i.add(t,n),o&&o.call(n.context,t,e,n)},t.save(null,e),t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t){return t[this.model.prototype.idAttribute||"id"]},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){if(this._isModel(t))return t.collection||(t.collection=this),t;e=e?n.clone(e):{},e.collection=this;var r=new this.model(t,e);return r.validationError?(this.trigger("invalid",this,r.validationError,e),!1):r},_removeModels:function(t,e){for(var n=[],r=0;r<t.length;r++){var i=this.get(t[r]);if(i){var o=this.indexOf(i);this.models.splice(o,1),this.length--,delete this._byId[i.cid];var s=this.modelId(i.attributes);null!=s&&delete this._byId[s],e.silent||(e.index=o,i.trigger("remove",i,this,e)),n.push(i),this._removeReference(i,e)}}return n},_isModel:function(t){return t instanceof b},_addReference:function(t,e){this._byId[t.cid]=t;var n=this.modelId(t.attributes);null!=n&&(this._byId[n]=t),t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){delete this._byId[t.cid];var n=this.modelId(t.attributes);null!=n&&delete this._byId[n],this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,n,r){if(e){if(("add"===t||"remove"===t)&&n!==this)return;if("destroy"===t&&this.remove(e,r),"change"===t){var i=this.modelId(e.previousAttributes()),o=this.modelId(e.attributes);i!==o&&(null!=i&&delete this._byId[i],null!=o&&(this._byId[o]=e))}}this.trigger.apply(this,arguments)}});var S={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};a(x,S,"models");var T=e.View=function(t){this.cid=n.uniqueId("view"),n.extend(this,n.pick(t,A)),this._ensureElement(),this.initialize.apply(this,arguments)},E=/^(\S+)\s*(.*)$/,A=["model","collection","el","id","attributes","className","tagName","events"];n.extend(T.prototype,u,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove()},setElement:function(t){return this.undelegateEvents(),this._setElement(t),this.delegateEvents(),this},_setElement:function(t){this.$el=t instanceof e.$?t:e.$(t),this.el=this.$el[0]},delegateEvents:function(t){if(t||(t=n.result(this,"events")),!t)return this;this.undelegateEvents();for(var e in t){var r=t[e];if(n.isFunction(r)||(r=this[r]),r){var i=e.match(E);this.delegate(i[1],i[2],n.bind(r,this))}}return this},delegate:function(t,e,n){return this.$el.on(t+".delegateEvents"+this.cid,e,n),this},undelegateEvents:function(){return this.$el&&this.$el.off(".delegateEvents"+this.cid),this},undelegate:function(t,e,n){return this.$el.off(t+".delegateEvents"+this.cid,e,n),this},_createElement:function(t){return document.createElement(t)},_ensureElement:function(){if(this.el)this.setElement(n.result(this,"el"));else{var t=n.extend({},n.result(this,"attributes"));this.id&&(t.id=n.result(this,"id")),this.className&&(t["class"]=n.result(this,"className")),this.setElement(this._createElement(n.result(this,"tagName"))),this._setAttributes(t)}},_setAttributes:function(t){this.$el.attr(t)}}),e.sync=function(t,r,i){var o=O[t];n.defaults(i||(i={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var s={type:o,dataType:"json"};if(i.url||(s.url=n.result(r,"url")||z()),null!=i.data||!r||"create"!==t&&"update"!==t&&"patch"!==t||(s.contentType="application/json",s.data=JSON.stringify(i.attrs||r.toJSON(i))),i.emulateJSON&&(s.contentType="application/x-www-form-urlencoded",s.data=s.data?{model:s.data}:{}),i.emulateHTTP&&("PUT"===o||"DELETE"===o||"PATCH"===o)){s.type="POST",i.emulateJSON&&(s.data._method=o);var a=i.beforeSend;i.beforeSend=function(t){if(t.setRequestHeader("X-HTTP-Method-Override",o),a)return a.apply(this,arguments)}}"GET"===s.type||i.emulateJSON||(s.processData=!1);var l=i.error;i.error=function(t,e,n){i.textStatus=e,i.errorThrown=n,l&&l.call(i.context,t,e,n)};var c=i.xhr=e.ajax(n.extend(s,i));return r.trigger("request",r,c,i),c};var O={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var M=e.Router=function(t){t||(t={}),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},L=/\((.*?)\)/g,P=/(\(\?)?:\w+/g,j=/\*\w+/g,D=/[\-{}\[\]+?.,\\\^$|#\s]/g;n.extend(M.prototype,u,{initialize:function(){},route:function(t,r,i){n.isRegExp(t)||(t=this._routeToRegExp(t)),n.isFunction(r)&&(i=r,r=""),i||(i=this[r]);var o=this;return e.history.route(t,function(n){var s=o._extractParameters(t,n);o.execute(i,s,r)!==!1&&(o.trigger.apply(o,["route:"+r].concat(s)),o.trigger("route",r,s),e.history.trigger("route",o,r,s))}),this},execute:function(t,e,n){t&&t.apply(this,e)},navigate:function(t,n){return e.history.navigate(t,n),this},_bindRoutes:function(){if(this.routes){this.routes=n.result(this,"routes");for(var t,e=n.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(D,"\\$&").replace(L,"(?:$1)?").replace(P,function(t,e){return e?t:"([^/?]+)"}).replace(j,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return n.map(r,function(t,e){return e===r.length-1?t||null:t?decodeURIComponent(t):null})}});var N=e.History=function(){this.handlers=[],this.checkUrl=n.bind(this.checkUrl,this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},I=/^[#\/]|\s+$/g,R=/^\/+|\/+$/g,B=/#.*$/;N.started=!1,n.extend(N.prototype,u,{interval:50,atRoot:function(){var t=this.location.pathname.replace(/[^\/]$/,"$&/");return t===this.root&&!this.getSearch()},matchRoot:function(){var t=this.decodeFragment(this.location.pathname),e=t.slice(0,this.root.length-1)+"/";return e===this.root},decodeFragment:function(t){return decodeURI(t.replace(/%25/g,"%2525"))},getSearch:function(){var t=this.location.href.replace(/#.*/,"").match(/\?.+/);return t?t[0]:""},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getPath:function(){var t=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return"/"===t.charAt(0)?t.slice(1):t},getFragment:function(t){return null==t&&(t=this._usePushState||!this._wantsHashChange?this.getPath():this.getHash()),t.replace(I,"")},start:function(t){if(N.started)throw new Error("Backbone.history has already been started");if(N.started=!0,this.options=n.extend({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=this.options.hashChange!==!1,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(R,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||"/";return this.location.replace(e+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var r=document.body,i=r.insertBefore(this.iframe,r.firstChild).contentWindow;i.document.open(),i.document.close(),i.location.hash="#"+this.fragment}var o=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};if(this._usePushState?o("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?o("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&t("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),N.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();return e===this.fragment&&this.iframe&&(e=this.getHash(this.iframe.contentWindow)),e!==this.fragment&&(this.iframe&&this.navigate(e),void this.loadUrl())},loadUrl:function(t){return!!this.matchRoot()&&(t=this.fragment=this.getFragment(t),n.some(this.handlers,function(e){if(e.route.test(t))return e.callback(t),!0}))},navigate:function(t,e){if(!N.started)return!1;e&&e!==!0||(e={trigger:!!e}),t=this.getFragment(t||"");var n=this.root;""!==t&&"?"!==t.charAt(0)||(n=n.slice(0,-1)||"/");var r=n+t;if(t=this.decodeFragment(t.replace(B,"")),this.fragment!==t){if(this.fragment=t,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var i=this.iframe.contentWindow;e.replace||(i.document.open(),i.document.close()),this._updateHash(i.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,n){if(n){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else t.hash="#"+e}}),e.history=new N;var F=function(t,e){var r,i=this;return r=t&&n.has(t,"constructor")?t.constructor:function(){return i.apply(this,arguments)},n.extend(r,i,e),r.prototype=n.create(i.prototype,t),r.prototype.constructor=r,r.__super__=i.prototype,r};b.extend=x.extend=M.extend=T.extend=N.extend=F;var z=function(){throw new Error('A "url" property or function must be specified')},$=function(t,e){var n=e.error;e.error=function(r){n&&n.call(e.context,t,r,e),t.trigger("error",t,r,e)}};return e})}).call(e,n(16))},function(t,e,n){var r,i;(function(){function n(t){function e(e,n,r,i,o,s){for(;o>=0&&o<s;o+=t){var a=i?i[o]:o;r=n(r,e[a],a,e)}return r}return function(n,r,i,o){r=C(r,o,4);var s=!M(n)&&_.keys(n),a=(s||n).length,l=t>0?0:a-1;return arguments.length<3&&(i=n[s?s[l]:l],l+=t),e(n,r,i,s,l,a)}}function o(t){return function(e,n,r){n=k(n,r);for(var i=O(e),o=t>0?0:i-1;o>=0&&o<i;o+=t)if(n(e[o],o,e))return o;return-1}}function s(t,e,n){return function(r,i,o){var s=0,a=O(r);if("number"==typeof o)t>0?s=o>=0?o:Math.max(o+a,s):a=o>=0?Math.min(o+1,a):o+a+1;else if(n&&o&&a)return o=n(r,i),r[o]===i?o:-1;if(i!==i)return o=e(p.call(r,s,a),_.isNaN),o>=0?o+s:-1;for(o=t>0?s:a-1;o>=0&&o<a;o+=t)if(r[o]===i)return o;return-1}}function a(t,e){var n=N.length,r=t.constructor,i=_.isFunction(r)&&r.prototype||h,o="constructor";for(_.has(t,o)&&!_.contains(e,o)&&e.push(o);n--;)o=N[n],o in t&&t[o]!==i[o]&&!_.contains(e,o)&&e.push(o)}var l=this,c=l._,u=Array.prototype,h=Object.prototype,f=Function.prototype,d=u.push,p=u.slice,g=h.toString,v=h.hasOwnProperty,m=Array.isArray,y=Object.keys,b=f.bind,w=Object.create,x=function(){},_=function(t){return t instanceof _?t:this instanceof _?void(this._wrapped=t):new _(t)};"undefined"!=typeof t&&t.exports&&(e=t.exports=_),e._=_,_.VERSION="1.8.3";var C=function(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return function(){return t.apply(e,arguments)}},k=function(t,e,n){return null==t?_.identity:_.isFunction(t)?C(t,e,n):_.isObject(t)?_.matcher(t):_.property(t)};_.iteratee=function(t,e){return k(t,e,1/0)};var S=function(t,e){return function(n){var r=arguments.length;if(r<2||null==n)return n;for(var i=1;i<r;i++)for(var o=arguments[i],s=t(o),a=s.length,l=0;l<a;l++){var c=s[l];e&&void 0!==n[c]||(n[c]=o[c])}return n}},T=function(t){if(!_.isObject(t))return{};if(w)return w(t);x.prototype=t;var e=new x;return x.prototype=null,e},E=function(t){return function(e){return null==e?void 0:e[t]}},A=Math.pow(2,53)-1,O=E("length"),M=function(t){var e=O(t);return"number"==typeof e&&e>=0&&e<=A};_.each=_.forEach=function(t,e,n){e=C(e,n);var r,i;if(M(t))for(r=0,i=t.length;r<i;r++)e(t[r],r,t);else{var o=_.keys(t);for(r=0,i=o.length;r<i;r++)e(t[o[r]],o[r],t)}return t},_.map=_.collect=function(t,e,n){e=k(e,n);for(var r=!M(t)&&_.keys(t),i=(r||t).length,o=Array(i),s=0;s<i;s++){var a=r?r[s]:s;o[s]=e(t[a],a,t)}return o},_.reduce=_.foldl=_.inject=n(1),_.reduceRight=_.foldr=n(-1),_.find=_.detect=function(t,e,n){var r;if(r=M(t)?_.findIndex(t,e,n):_.findKey(t,e,n),void 0!==r&&r!==-1)return t[r]},_.filter=_.select=function(t,e,n){var r=[];return e=k(e,n),_.each(t,function(t,n,i){e(t,n,i)&&r.push(t)}),r},_.reject=function(t,e,n){return _.filter(t,_.negate(k(e)),n)},_.every=_.all=function(t,e,n){e=k(e,n);for(var r=!M(t)&&_.keys(t),i=(r||t).length,o=0;o<i;o++){var s=r?r[o]:o;if(!e(t[s],s,t))return!1}return!0},_.some=_.any=function(t,e,n){e=k(e,n);for(var r=!M(t)&&_.keys(t),i=(r||t).length,o=0;o<i;o++){var s=r?r[o]:o;if(e(t[s],s,t))return!0}return!1},_.contains=_.includes=_.include=function(t,e,n,r){return M(t)||(t=_.values(t)),("number"!=typeof n||r)&&(n=0),_.indexOf(t,e,n)>=0},_.invoke=function(t,e){var n=p.call(arguments,2),r=_.isFunction(e);return _.map(t,function(t){var i=r?e:t[e];return null==i?i:i.apply(t,n)})},_.pluck=function(t,e){return _.map(t,_.property(e))},_.where=function(t,e){return _.filter(t,_.matcher(e))},_.findWhere=function(t,e){return _.find(t,_.matcher(e))},_.max=function(t,e,n){var r,i,o=-(1/0),s=-(1/0);if(null==e&&null!=t){t=M(t)?t:_.values(t);for(var a=0,l=t.length;a<l;a++)r=t[a],r>o&&(o=r)}else e=k(e,n),_.each(t,function(t,n,r){i=e(t,n,r),(i>s||i===-(1/0)&&o===-(1/0))&&(o=t,s=i)});return o},_.min=function(t,e,n){var r,i,o=1/0,s=1/0;if(null==e&&null!=t){t=M(t)?t:_.values(t);for(var a=0,l=t.length;a<l;a++)r=t[a],r<o&&(o=r)}else e=k(e,n),_.each(t,function(t,n,r){i=e(t,n,r),(i<s||i===1/0&&o===1/0)&&(o=t,s=i)});return o},_.shuffle=function(t){for(var e,n=M(t)?t:_.values(t),r=n.length,i=Array(r),o=0;o<r;o++)e=_.random(0,o),e!==o&&(i[o]=i[e]),i[e]=n[o];return i},_.sample=function(t,e,n){return null==e||n?(M(t)||(t=_.values(t)),t[_.random(t.length-1)]):_.shuffle(t).slice(0,Math.max(0,e))},_.sortBy=function(t,e,n){return e=k(e,n),_.pluck(_.map(t,function(t,n,r){return{value:t,index:n,criteria:e(t,n,r)}}).sort(function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index-e.index}),"value")};var L=function(t){return function(e,n,r){var i={};return n=k(n,r),_.each(e,function(r,o){var s=n(r,o,e);t(i,r,s)}),i}};_.groupBy=L(function(t,e,n){_.has(t,n)?t[n].push(e):t[n]=[e]}),_.indexBy=L(function(t,e,n){t[n]=e}),_.countBy=L(function(t,e,n){_.has(t,n)?t[n]++:t[n]=1}),_.toArray=function(t){return t?_.isArray(t)?p.call(t):M(t)?_.map(t,_.identity):_.values(t):[]},_.size=function(t){return null==t?0:M(t)?t.length:_.keys(t).length},_.partition=function(t,e,n){e=k(e,n);var r=[],i=[];return _.each(t,function(t,n,o){(e(t,n,o)?r:i).push(t)}),[r,i]},_.first=_.head=_.take=function(t,e,n){if(null!=t)return null==e||n?t[0]:_.initial(t,t.length-e)},_.initial=function(t,e,n){return p.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))},_.last=function(t,e,n){if(null!=t)return null==e||n?t[t.length-1]:_.rest(t,Math.max(0,t.length-e))},_.rest=_.tail=_.drop=function(t,e,n){return p.call(t,null==e||n?1:e)},_.compact=function(t){return _.filter(t,_.identity)};var P=function(t,e,n,r){for(var i=[],o=0,s=r||0,a=O(t);s<a;s++){var l=t[s];if(M(l)&&(_.isArray(l)||_.isArguments(l))){e||(l=P(l,e,n));var c=0,u=l.length;for(i.length+=u;c<u;)i[o++]=l[c++]}else n||(i[o++]=l)}return i};_.flatten=function(t,e){return P(t,e,!1)},_.without=function(t){return _.difference(t,p.call(arguments,1))},_.uniq=_.unique=function(t,e,n,r){_.isBoolean(e)||(r=n,n=e,e=!1),null!=n&&(n=k(n,r));for(var i=[],o=[],s=0,a=O(t);s<a;s++){var l=t[s],c=n?n(l,s,t):l;e?(s&&o===c||i.push(l),o=c):n?_.contains(o,c)||(o.push(c),i.push(l)):_.contains(i,l)||i.push(l)}return i},_.union=function(){return _.uniq(P(arguments,!0,!0))},_.intersection=function(t){for(var e=[],n=arguments.length,r=0,i=O(t);r<i;r++){var o=t[r];if(!_.contains(e,o)){for(var s=1;s<n&&_.contains(arguments[s],o);s++);s===n&&e.push(o)}}return e},_.difference=function(t){var e=P(arguments,!0,!0,1);return _.filter(t,function(t){return!_.contains(e,t)})},_.zip=function(){return _.unzip(arguments)},_.unzip=function(t){for(var e=t&&_.max(t,O).length||0,n=Array(e),r=0;r<e;r++)n[r]=_.pluck(t,r);return n},_.object=function(t,e){for(var n={},r=0,i=O(t);r<i;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n},_.findIndex=o(1),_.findLastIndex=o(-1),_.sortedIndex=function(t,e,n,r){n=k(n,r,1);for(var i=n(e),o=0,s=O(t);o<s;){var a=Math.floor((o+s)/2);n(t[a])<i?o=a+1:s=a}return o},_.indexOf=s(1,_.findIndex,_.sortedIndex),_.lastIndexOf=s(-1,_.findLastIndex),_.range=function(t,e,n){null==e&&(e=t||0,t=0),n=n||1;for(var r=Math.max(Math.ceil((e-t)/n),0),i=Array(r),o=0;o<r;o++,t+=n)i[o]=t;return i};var j=function(t,e,n,r,i){if(!(r instanceof e))return t.apply(n,i);var o=T(t.prototype),s=t.apply(o,i);return _.isObject(s)?s:o};_.bind=function(t,e){if(b&&t.bind===b)return b.apply(t,p.call(arguments,1));if(!_.isFunction(t))throw new TypeError("Bind must be called on a function");var n=p.call(arguments,2),r=function(){return j(t,r,e,this,n.concat(p.call(arguments)))};return r},_.partial=function(t){var e=p.call(arguments,1),n=function(){for(var r=0,i=e.length,o=Array(i),s=0;s<i;s++)o[s]=e[s]===_?arguments[r++]:e[s];for(;r<arguments.length;)o.push(arguments[r++]);return j(t,n,this,this,o)};return n},_.bindAll=function(t){var e,n,r=arguments.length;if(r<=1)throw new Error("bindAll must be passed function names");for(e=1;e<r;e++)n=arguments[e],t[n]=_.bind(t[n],t);return t},_.memoize=function(t,e){var n=function(r){var i=n.cache,o=""+(e?e.apply(this,arguments):r);return _.has(i,o)||(i[o]=t.apply(this,arguments)),i[o]};return n.cache={},n},_.delay=function(t,e){var n=p.call(arguments,2);return setTimeout(function(){return t.apply(null,n)},e)},_.defer=_.partial(_.delay,_,1),_.throttle=function(t,e,n){var r,i,o,s=null,a=0;n||(n={});var l=function(){a=n.leading===!1?0:_.now(),s=null,o=t.apply(r,i),s||(r=i=null)};return function(){var c=_.now();a||n.leading!==!1||(a=c);var u=e-(c-a);return r=this,i=arguments,u<=0||u>e?(s&&(clearTimeout(s),s=null),a=c,o=t.apply(r,i),s||(r=i=null)):s||n.trailing===!1||(s=setTimeout(l,u)),o}},_.debounce=function(t,e,n){var r,i,o,s,a,l=function(){var c=_.now()-s;c<e&&c>=0?r=setTimeout(l,e-c):(r=null,n||(a=t.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,s=_.now();var c=n&&!r;return r||(r=setTimeout(l,e)),c&&(a=t.apply(o,i),o=i=null),a}},_.wrap=function(t,e){return _.partial(e,t)},_.negate=function(t){return function(){return!t.apply(this,arguments)}},_.compose=function(){var t=arguments,e=t.length-1;
return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},_.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},_.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},_.once=_.partial(_.before,2);var D=!{toString:null}.propertyIsEnumerable("toString"),N=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];_.keys=function(t){if(!_.isObject(t))return[];if(y)return y(t);var e=[];for(var n in t)_.has(t,n)&&e.push(n);return D&&a(t,e),e},_.allKeys=function(t){if(!_.isObject(t))return[];var e=[];for(var n in t)e.push(n);return D&&a(t,e),e},_.values=function(t){for(var e=_.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=t[e[i]];return r},_.mapObject=function(t,e,n){e=k(e,n);for(var r,i=_.keys(t),o=i.length,s={},a=0;a<o;a++)r=i[a],s[r]=e(t[r],r,t);return s},_.pairs=function(t){for(var e=_.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=[e[i],t[e[i]]];return r},_.invert=function(t){for(var e={},n=_.keys(t),r=0,i=n.length;r<i;r++)e[t[n[r]]]=n[r];return e},_.functions=_.methods=function(t){var e=[];for(var n in t)_.isFunction(t[n])&&e.push(n);return e.sort()},_.extend=S(_.allKeys),_.extendOwn=_.assign=S(_.keys),_.findKey=function(t,e,n){e=k(e,n);for(var r,i=_.keys(t),o=0,s=i.length;o<s;o++)if(r=i[o],e(t[r],r,t))return r},_.pick=function(t,e,n){var r,i,o={},s=t;if(null==s)return o;_.isFunction(e)?(i=_.allKeys(s),r=C(e,n)):(i=P(arguments,!1,!1,1),r=function(t,e,n){return e in n},s=Object(s));for(var a=0,l=i.length;a<l;a++){var c=i[a],u=s[c];r(u,c,s)&&(o[c]=u)}return o},_.omit=function(t,e,n){if(_.isFunction(e))e=_.negate(e);else{var r=_.map(P(arguments,!1,!1,1),String);e=function(t,e){return!_.contains(r,e)}}return _.pick(t,e,n)},_.defaults=S(_.allKeys,!0),_.create=function(t,e){var n=T(t);return e&&_.extendOwn(n,e),n},_.clone=function(t){return _.isObject(t)?_.isArray(t)?t.slice():_.extend({},t):t},_.tap=function(t,e){return e(t),t},_.isMatch=function(t,e){var n=_.keys(e),r=n.length;if(null==t)return!r;for(var i=Object(t),o=0;o<r;o++){var s=n[o];if(e[s]!==i[s]||!(s in i))return!1}return!0};var I=function(t,e,n,r){if(t===e)return 0!==t||1/t===1/e;if(null==t||null==e)return t===e;t instanceof _&&(t=t._wrapped),e instanceof _&&(e=e._wrapped);var i=g.call(t);if(i!==g.call(e))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!==+t?+e!==+e:0===+t?1/+t===1/e:+t===+e;case"[object Date]":case"[object Boolean]":return+t===+e}var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var s=t.constructor,a=e.constructor;if(s!==a&&!(_.isFunction(s)&&s instanceof s&&_.isFunction(a)&&a instanceof a)&&"constructor"in t&&"constructor"in e)return!1}n=n||[],r=r||[];for(var l=n.length;l--;)if(n[l]===t)return r[l]===e;if(n.push(t),r.push(e),o){if(l=t.length,l!==e.length)return!1;for(;l--;)if(!I(t[l],e[l],n,r))return!1}else{var c,u=_.keys(t);if(l=u.length,_.keys(e).length!==l)return!1;for(;l--;)if(c=u[l],!_.has(e,c)||!I(t[c],e[c],n,r))return!1}return n.pop(),r.pop(),!0};_.isEqual=function(t,e){return I(t,e)},_.isEmpty=function(t){return null==t||(M(t)&&(_.isArray(t)||_.isString(t)||_.isArguments(t))?0===t.length:0===_.keys(t).length)},_.isElement=function(t){return!(!t||1!==t.nodeType)},_.isArray=m||function(t){return"[object Array]"===g.call(t)},_.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},_.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(t){_["is"+t]=function(e){return g.call(e)==="[object "+t+"]"}}),_.isArguments(arguments)||(_.isArguments=function(t){return _.has(t,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(_.isFunction=function(t){return"function"==typeof t||!1}),_.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},_.isNaN=function(t){return _.isNumber(t)&&t!==+t},_.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"===g.call(t)},_.isNull=function(t){return null===t},_.isUndefined=function(t){return void 0===t},_.has=function(t,e){return null!=t&&v.call(t,e)},_.noConflict=function(){return l._=c,this},_.identity=function(t){return t},_.constant=function(t){return function(){return t}},_.noop=function(){},_.property=E,_.propertyOf=function(t){return null==t?function(){}:function(e){return t[e]}},_.matcher=_.matches=function(t){return t=_.extendOwn({},t),function(e){return _.isMatch(e,t)}},_.times=function(t,e,n){var r=Array(Math.max(0,t));e=C(e,n,1);for(var i=0;i<t;i++)r[i]=e(i);return r},_.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},_.now=Date.now||function(){return(new Date).getTime()};var R={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},B=_.invert(R),F=function(t){var e=function(e){return t[e]},n="(?:"+_.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};_.escape=F(R),_.unescape=F(B),_.result=function(t,e,n){var r=null==t?void 0:t[e];return void 0===r&&(r=n),_.isFunction(r)?r.call(t):r};var z=0;_.uniqueId=function(t){var e=++z+"";return t?t+e:e},_.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var $=/(.)^/,V={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},H=/\\|'|\r|\n|\u2028|\u2029/g,U=function(t){return"\\"+V[t]};_.template=function(t,e,n){!e&&n&&(e=n),e=_.defaults({},e,_.templateSettings);var r=RegExp([(e.escape||$).source,(e.interpolate||$).source,(e.evaluate||$).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,function(e,n,r,s,a){return o+=t.slice(i,a).replace(H,U),i=a+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":s&&(o+="';\n"+s+"\n__p+='"),e}),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var s=new Function(e.variable||"obj","_",o)}catch(a){throw a.source=o,a}var l=function(t){return s.call(this,t,_)},c=e.variable||"obj";return l.source="function("+c+"){\n"+o+"}",l},_.chain=function(t){var e=_(t);return e._chain=!0,e};var q=function(t,e){return t._chain?_(e).chain():e};_.mixin=function(t){_.each(_.functions(t),function(e){var n=_[e]=t[e];_.prototype[e]=function(){var t=[this._wrapped];return d.apply(t,arguments),q(this,n.apply(_,t))}})},_.mixin(_),_.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=u[t];_.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],q(this,n)}}),_.each(["concat","join","slice"],function(t){var e=u[t];_.prototype[t]=function(){return q(this,e.apply(this._wrapped,arguments))}}),_.prototype.value=function(){return this._wrapped},_.prototype.valueOf=_.prototype.toJSON=_.prototype.value,_.prototype.toString=function(){return""+this._wrapped},r=[],i=function(){return _}.apply(e,r),!(void 0!==i&&(t.exports=i))}).call(this)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getUnitFromValue=e.normalizeFloat=e.shallowDiff=e.camelCase=e.matches=e.upFirst=e.hasDnd=e.off=e.on=void 0;var r=n(1),i=window.Element.prototype,o=i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector,s=function(t,e){var n={},i=(0,r.keys)(e);for(var o in t)if(t.hasOwnProperty(o)){var s=t[o],a=e[o];i.indexOf(o)>=0?s!==a&&(n[o]=a):n[o]=null}for(var l in e)e.hasOwnProperty(l)&&(0,r.isUndefined)(t[l])&&(n[l]=e[l]);return n},a=function(t,e,n){e=e.split(/\s+/),t=t instanceof Array?t:[t];for(var r=function(r){t.forEach(function(t){return t.addEventListener(e[r],n)})},i=0;i<e.length;++i)r(i)},l=function(t,e,n){e=e.split(/\s+/),t=t instanceof Array?t:[t];for(var r=function(r){t.forEach(function(t){return t.removeEventListener(e[r],n)})},i=0;i<e.length;++i)r(i)},c=function(t){return t.replace(parseFloat(t),"")},u=function(t){return t[0].toUpperCase()+t.toLowerCase().slice(1)},h=function(t){var e=t.split("-");return e[0].toLowerCase()+e.slice(1).map(u)},f=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=0;if(isNaN(t))return n;if(t=parseFloat(t),Math.floor(t)!==t){var i=e.toString().split(".")[1];r=i?i.length:0}return r?parseFloat(t.toFixed(r)):t},d=function(t){return"draggable"in document.createElement("i")&&(t?t.get("Config").nativeDnD:1)};e.on=a,e.off=l,e.hasDnd=d,e.upFirst=u,e.matches=o,e.camelCase=h,e.shallowDiff=s,e.normalizeFloat=f,e.getUnitFromValue=c},function(t,e,n){"use strict";(function(e){var r=n(1),i=n(51);t.exports=e.View.extend({className:function(){return this.getClasses()},tagName:function(){return this.model.get("tagName")},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.model,n=t.config||{};this.opts=t,this.config=n,this.em=n.em||"",this.pfx=n.stylePrefix||"",this.ppfx=n.pStylePrefix||"",this.attr=e.get("attributes"),this.classe=this.attr["class"]||[];var r=this.$el,i=e.get("classes");this.listenTo(e,"destroy remove",this.remove),this.listenTo(e,"change:style",this.updateStyle),this.listenTo(e,"change:attributes",this.updateAttributes),this.listenTo(e,"change:highlightable",this.updateHighlight),this.listenTo(e,"change:status",this.updateStatus),this.listenTo(e,"change:state",this.updateState),this.listenTo(e,"change:script",this.render),this.listenTo(e,"change",this.handleChange),this.listenTo(i,"add remove change",this.updateClasses),r.data("model",e),r.data("collection",e.get("components")),e.view=this,i.length&&this.importClasses(),this.init()},remove:function(){e.View.prototype.remove.apply(this);var t=this.childrenView;t&&t.stopListening()},init:function(){},handleChange:function(){var t=this.model;t.emitUpdate();for(var e in t.changed)t.emitUpdate(e)},importClasses:function(){var t=this.config.em.get("SelectorManager");t&&this.model.get("classes").each(function(e){t.add(e.get("name"))})},updateState:function(t){var e="hc-state",n=this.model.get("state");n?this.$el.addClass(e):this.$el.removeClass(e)},updateStatus:function(t){var e=this.el,n=this.model.get("status"),r=this.pfx,i=this.ppfx,o=r+"selected",s=o+"-parent",a=i+"freezed",l=e.getAttribute("class")||"",c="";switch(n){case"selected":c=l+" "+o;break;case"selected-parent":c=l+" "+s;break;case"freezed":c=l+" "+a;break;default:this.$el.removeClass(o+" "+s+" "+a)}c=c.trim(),c&&e.setAttribute("class",c)},updateHighlight:function(){var t=this.model.get("highlightable");this.setAttribute("data-highlightable",t?1:"")},updateStyle:function(){var t=this.em,e=this.model;t&&t.get("avoidInlineStyle")?(this.el.id=e.getId(),e.setStyle(e.getStyle())):this.setAttribute("style",e.styleToString())},updateClasses:function(){var t=this.model.get("classes").pluck("name").join(" ");this.setAttribute("class",t),this.updateStatus()},setAttribute:function(t,e){var n=this.$el;e?n.attr(t,e):n.removeAttr(t)},getClasses:function(){var t=this.model.get("attributes"),e=t["class"]||[];return e=(0,r.isArray)(e)?e:[e],e.length?e.join(" "):null},updateAttributes:function(){var t=this.model,e={},n=t.get("attributes"),r=t.get("src");for(var i in n)e[i]=n[i];r&&(e.src=r),this.$el.attr(e),this.updateHighlight(),this.updateStyle()},updateContent:function(){this.getChildrenContainer().innerHTML=this.model.get("content")},prevDef:function(t){t.preventDefault()},updateScript:function(){if(this.model.get("script")){var t=this.em;if(t){var e=t.get("Canvas");e.getCanvasView().updateScript(this)}}},getChildrenContainer:function(){var t=this.el;return"function"==typeof this.getChildrenSelector?t=this.el.querySelector(this.getChildrenSelector()):"function"==typeof this.getTemplate,t},renderChildren:function(){var t=this.getChildrenContainer(),e=new i({collection:this.model.get("components"),config:this.config,componentTypes:this.opts.componentTypes});e.render(t),this.childrenView=e;for(var n=Array.prototype.slice.call(e.el.childNodes),r=0,o=n.length;r<o;r++)t.appendChild(n.shift());if(t!==this.el){var s=function a(e){var n=Array.prototype.slice.call(e.children);n.forEach(function(e){e.style["pointer-events"]="none",t!==e&&a(e)})};s(this.el)}},renderAttributes:function(){this.updateAttributes(),this.updateClasses()},render:function(){return this.renderAttributes(),this.updateContent(),this.renderChildren(),this.updateScript(),this.onRender(),this},onRender:function(){}})}).call(e,n(0))},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o=n(1),s=n(2),a=n(47),l=r(a),c=n(0),u=n(50),h=n(7),f=n(10),d=n(150),p={},g=0,v=function(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},m=c.Model.extend(l["default"]).extend({defaults:{tagName:"div",type:"",name:"",removable:!0,draggable:!0,droppable:!0,badgable:!0,stylable:!0,"stylable-require":"",unstylable:"",highlightable:!0,copyable:!0,resizable:!1,editable:!1,layerable:!0,selectable:!0,hoverable:!0,"void":!1,state:"",status:"",content:"",icon:"",style:"",attributes:"",classes:"",script:"",traits:["id","title"],propagate:"",toolbar:null},initialize:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.em,s=this.parent(),a=s&&s.attributes;if(a&&a.propagate){var l={},c=a.propagate;c.forEach(function(t){return l[t]=s.get(t)}),l.propagate=c,l=i({},l,e),this.set(l)}var u=this.get("propagate");u&&this.set("propagate",(0,o.isArray)(u)?u:[u]),n&&n.config&&n.config.voidElements.indexOf(this.get("tagName"))>=0&&this.set("void",!0),n.em=r,this.opt=n,this.em=r,this.config=n.config||{},this.ccid=m.createId(this),this.set("attributes",this.get("attributes")||{}),this.on("remove",this.handleRemove),this.listenTo(this,"change:script",this.scriptUpdated),this.listenTo(this,"change:traits",this.traitsUpdated),this.listenTo(this,"change:tagName",this.tagUpdated),this.listenTo(this,"change:attributes",this.attrUpdated),this.initClasses(),this.loadTraits(),this.initComponents(),this.initToolbar(),this.set("status",""),this.listenTo(this.get("classes"),"add remove change",function(){return t.emitUpdate("classes")}),this.init()},handleRemove:function(t){var e=this.em;e&&e.trigger("component:remove",t)},is:function(t){return!(this.get("type")!=t)},find:function(t){var e=[];return this.view.$el.find(t).each(function(t,n,r){var i=r.eq(n),o=i.data("model");o&&e.push(o)}),e},closest:function(t){var e=this.view.$el.closest(t);return e.length&&e.data("model")},tagUpdated:function(){var t=this.collection,e=t.indexOf(this);t.remove(this),t.add(this,{at:e})},attrUpdated:function(){var t=this,e=i({},this.previous("attributes")),n=i({},this.get("attributes")),r=(0,s.shallowDiff)(e,n);(0,o.keys)(r).forEach(function(e){return t.trigger("change:attributes:"+e)})},setAttributes:function(t){t=i({},t);var e=t["class"];e&&this.setClass(e),delete t["class"];var n=t.style;n&&this.setStyle(n),delete t.style,this.set("attributes",t)},addAttributes:function(t){var e=i({},this.getAttributes(),t);this.setAttributes(e)},getStyle:function(){var t=this.em;if(t&&t.getConfig("avoidInlineStyle")){var e=this.get("state"),n=t.get("CssComposer"),r=n.getIdRule(this.getId(),{state:e});if(this.rule=r,r)return r.getStyle()}return l["default"].getStyle.call(this)},setStyle:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em;if(r&&r.getConfig("avoidInlineStyle")){e=(0,o.isString)(e)?this.parseStyle(e):e;var a=this.get("state"),c=r.get("CssComposer"),u=this.getStyle();this.rule=c.setIdRule(this.getId(),e,i({},n,{state:a}));var h=(0,s.shallowDiff)(u,e);(0,o.keys)(h).forEach(function(e){return t.trigger("change:style:"+e)})}else e=l["default"].setStyle.apply(this,arguments);return e},getAttributes:function(){var t=[],e=i({},this.get("attributes"));return this.get("classes").each(function(e){return t.push(e.get("name"))}),t.length&&(e["class"]=t.join(" ")),(0,o.isEmpty)(this.getStyle())||(0,o.has)(e,"id")||(e.id=this.getId()),e},addClass:function(t){var e=this.em.get("SelectorManager").addClass(t);return this.get("classes").add(e)},setClass:function(t){return this.get("classes").reset(),this.addClass(t)},removeClass:function(t){var e=[];t=(0,o.isArray)(t)?t:[t];var n=this.get("classes"),r=h.TYPE_CLASS;return t.forEach(function(t){var i=t.split(" ");i.forEach(function(t){var i=n.where({name:t,type:r})[0];i&&e.push(n.remove(i))})}),e},initClasses:function(){var t=this.normalizeClasses(this.get("classes")||[]);return this.set("classes",new f(t)),this},initComponents:function(){var t=new u(null,this.opt);return t.parent=this,!this.opt.avoidChildren&&t.reset(this.get("components")),this.set("components",t),this},init:function(){},append:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.components().add(t,e);return(0,o.isArray)(n)?n:[n]},components:function(t){var e=this.get("components");return(0,o.isUndefined)(t)?e:(e.reset(),void(t&&this.append(t)))},parent:function(){var t=this.collection;return t&&t.parent},scriptUpdated:function(){this.set("scriptUpdated",1)},traitsUpdated:function(){var t=0,e=i({},this.get("attributes")),n=this.get("traits");return n instanceof d?(n.each(function(n){if(t=1,!n.get("changeProp")){var r=n.getInitValue();r&&(e[n.get("name")]=r)}}),void(t&&this.set("attributes",e))):void this.loadTraits()},initToolbar:function(){var t=this;if(!t.get("toolbar")){var e=[];t.collection&&e.push({attributes:{"class":"fa fa-arrow-up"},command:"select-parent"}),t.get("draggable")&&e.push({attributes:{"class":"fa fa-arrows",draggable:!0},command:"tlb-move"}),t.get("copyable")&&e.push({attributes:{"class":"fa fa-clone"},command:"tlb-clone"}),t.get("removable")&&e.push({attributes:{"class":"fa fa-trash-o"},command:"tlb-delete"}),t.set("toolbar",e)}},loadTraits:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new d([],this.opt);return n.setTarget(this),t=t||this.get("traits"),t.length&&n.add(t),this.set("traits",n,e),this},normalizeClasses:function(t){var e=[],n=this.em;if(n){var r=n.get("SelectorManager");if(r)return t.forEach(function(t){var n="";n="string"==typeof t?t:t.name;var i=r.add(n);e.push(i)}),e}},clone:function(){var t=this.em,e=this.getStyle(),n=i({},this.attributes),r=i({},this.opt);return n.attributes=i({},n.attributes),delete n.attributes.id,n.components=[],n.classes=[],n.traits=[],this.get("components").each(function(t,e){n.components[e]=t.clone()}),this.get("traits").each(function(t,e){n.traits[e]=t.clone()}),this.get("classes").each(function(t,e){n.classes[e]=t.get("name")}),n.status="",n.view="",r.collection=null,t&&t.getConfig("avoidInlineStyle")&&!(0,o.isEmpty)(e)&&(n.style=e),new this.constructor(n,r)},getName:function(){var t=this.get("name")||this.get("custom-name"),e=this.get("tagName");e="div"==e?"box":e;var n=this.get("type")||e;return n=n.charAt(0).toUpperCase()+n.slice(1),t||n},getIcon:function(){var t=this.get("icon");return t?t+" ":""},toHTML:function(t){var e=this,n=[],r=e.get("tagName"),i=e.get("void"),s=this.getAttrToHTML();for(var a in s){var l=s[a];(0,o.isUndefined)(l)||n.push(a+'="'+l+'"')}var c=n.length?" "+n.join(" "):"",u="<"+r+c+(i?"/":"")+">"+e.get("content");return e.get("components").each(function(t){return u+=t.toHTML()}),!i&&(u+="</"+r+">"),u},getAttrToHTML:function(){var t=this.getAttributes();return delete t.style,t},toJSON:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=c.Model.prototype.toJSON.apply(this,e),i=this.getScriptString();return r.attributes=this.getAttributes(),delete r.attributes["class"],delete r.toolbar,i&&(r.script=i),r},getId:function(){var t=this.get("attributes")||{};return t.id||this.ccid||this.cid},getEl:function(){return this.view&&this.view.el},getScriptString:function(t){var e=this,n=t||this.get("script");if(!n)return n;if("function"==typeof n){var r=n.toString().trim();r=r.replace(/^function[\s\w]*\(\)\s?\{/,"").replace(/\}$/,""),n=r.trim()}var i=this.em.getConfig(),o=v(i.tagVarStart||"{[ "),s=v(i.tagVarEnd||" ]}"),a=new RegExp(o+"([\\w\\d-]*)"+s,"g");return n=n.replace(a,function(t,n){return e.scriptUpdated(),e.attributes[n]||""})},emitUpdate:function(t){var e=this.em,n="component:update"+(t?":"+t:"");e&&e.trigger(n,this)}},{isComponent:function(t){return{tagName:t.tagName?t.tagName.toLowerCase():""}},createId:function(t){g++;var e=g.toString().length+2,n=(Math.random()+1.1).toString(36).slice(-e),r="i"+n;return p[r]=t,r},getList:function(){return p}});t.exports=m},function(t,e,n){"use strict";(function(e){function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var i=n(1),o=n(2),s="data-clear-style";t.exports=e.View.extend({template:function(t){var e=this.pfx;return'\n <div class="'+e+'label">\n '+this.templateLabel(t)+'\n </div>\n <div class="'+this.ppfx+'fields">\n '+this.templateInput(t)+"\n </div>\n "},templateLabel:function(t){var e=this.pfx,n=t.get("icon"),r=t.get("info");return'\n <span class="'+e+"icon "+n+'" title="'+r+'">\n '+t.get("name")+'\n </span>\n <b class="'+e+'clear" '+s+">&Cross;</b>\n "},templateInput:function(t){return'\n <div class="'+this.ppfx+'field">\n <input placeholder="'+t.getDefaultValue()+'"/>\n </div>\n '},events:r({change:"inputValueChanged"},"click ["+s+"]","clear"),initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,i.bindAll)(this,"targetUpdated"),this.config=t.config||{};var e=this.config.em;this.em=e,this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.target=t.target||{},this.propTarget=t.propTarget||{},this.onChange=t.onChange,this.onInputRender=t.onInputRender||{},this.customValue=t.customValue||{};var n=this.model;this.property=n.get("property"),this.input=null;var r=this.pfx;this.inputHolderId="#"+r+"input-holder",this.sector=n.collection&&n.collection.sector,n.view=this,n.get("value")||n.set("value",n.getDefaultValue()),e&&e.on("update:component:style:"+this.property,this.targetUpdated),this.listenTo(this.propTarget,"update",this.targetUpdated),this.listenTo(n,"destroy remove",this.remove),this.listenTo(n,"change:value",this.modelValueChanged),this.listenTo(n,"targetUpdated",this.targetUpdated),this.listenTo(n,"change:visible",this.updateVisibility),this.listenTo(n,"change:status",this.updateStatus);var o=this.init&&this.init.bind(this);o&&o()},updateStatus:function(){var t=this.model.get("status"),e=this.pfx,n=this.ppfx,r=this.config,i=n+"four-color",o=n+"color-warn",s=this.$el.children("."+e+"label"),a=this.getClearEl().style;switch(s.removeClass(i+" "+o),a.display="none",t){case"updated":s.addClass(i),r.clearProperties&&(a.display="inline");break;case"computed":s.addClass(o)}},clear:function(){var t=this.getTargetModel();t.removeStyle(this.model.get("property")),this.targetUpdated()},getClearEl:function(){return this.el.querySelector("["+s+"]")},getTarget:function(){return this.getTargetModel()},getTargetModel:function(){return this.propTarget&&this.propTarget.model},getHelperModel:function(){return this.propTarget&&this.propTarget.helper},inputValueChanged:function(t){t&&t.stopPropagation(),this.model.setValue(this.getInputValue(),1,{fromInput:1}),this.elementUpdated()},elementUpdated:function(){this.setStatus("updated")},setStatus:function(t){this.model.set("status",t);var e=this.model.parent;e&&e.set("status",t)},targetUpdated:function(){if(this.checkVisibility()){var t=this.config,e=t.em,n=this.model,r="",i="",o=this.getTargetValue({ignoreDefault:1}),s=n.getDefaultValue(),a=this.getComputedValue();o?(r=o,t.highlightChanged&&(i="updated")):a&&t.showComputed&&a!=s?(r=a,t.highlightComputed&&(i="computed")):(r=s,i=""),n.setValue(r,0,{fromTarget:1}),this.setStatus(i),e&&(e.trigger("styleManager:change",this),e.trigger("styleManager:change:"+n.get("property"),this))}},checkVisibility:function(){var t=1;return this.config.hideNotStylable&&(this.isTargetStylable()&&this.isComponentStylable()?this.show():(this.hide(),t=0),this.sector&&this.sector.trigger("updateVisibility")),t},getTargetValue:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.model,r=this.getTargetModel(),i=this.customValue;if(!r)return t;if(t=r.getStyle()[n.get("property")],t||e.ignoreDefault||(t=n.getDefaultValue()),"function"==typeof i&&!e.ignoreCustomValue){var o=n.collection.indexOf(n),s=i(this,o);s&&(t=s)}return t},getComputedValue:function(){var t=this.propTarget,e=t.computed||{},n=t.computedDefault||{},r=this.config.avoidComputed||[],i=this.model.get("property"),s=r.indexOf(i)<0,a=e[i],l=n[(0,o.camelCase)(i)];return e&&s&&l!==a&&a},getInputValue:function(){var t=this.getInputEl();return t?t.value:""},modelValueChanged:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.config.em,i=this.model,o=i.getFullValue(),s=this.getTarget(),a=this.onChange;n.fromInput||this.setValue(o),s&&this.isTargetStylable()&&this.isComponentStylable()&&(n.fromTarget||(a&&!n.fromParent?a(s,this,n):this.updateTargetStyle(o,null,n)),r&&(r.trigger("component:update",s),r.trigger("component:styleUpdate",s),r.trigger("component:styleUpdate:"+i.get("property"),s)))},updateTargetStyle:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e||this.model.get("property"),i=this.getTarget(),o=i.getStyle();t?o[r]=t:delete o[r],i.setStyle(o,n);var s=this.getHelperModel();s&&s.setStyle(o,n)},isTargetStylable:function(t){var e=t||this.getTarget(),n=this.model,r=n.get("property"),o=n.get("toRequire"),s=e.get("unstylable"),a=e.get("stylable-require"),l=e.get("stylable");return(0,i.isArray)(l)&&(l=l.indexOf(r)>=0),(0,i.isArray)(s)&&(l=s.indexOf(r)<0),o&&(l=a&&a.indexOf(r)>=0||!t),l},isComponentStylable:function(){var t=this.em,e=t&&t.get("selectedComponent");return!e||this.isTargetStylable(e)},setRawValue:function(t){this.setValue(this.model.parseValue(t))},setValue:function(t){var e=this.model,n=t||e.getDefaultValue(),r=this.getInputEl();r&&(r.value=n)},getInputEl:function(){return this.input||(this.input=this.el.querySelector("input")),this.input},updateVisibility:function(){this.el.style.display=this.model.get("visible")?"block":"none"},show:function(){this.model.set("visible",1)},hide:function(){this.model.set("visible",0)},cleanValue:function(){this.setValue("")},render:function(){var t=this.pfx,e=this.model,n=this.el;n.innerHTML=this.template(e),n.className=t+"property "+t+e.get("type"),this.updateStatus();var r=this.onRender&&this.onRender.bind(this);r&&r(),this.setValue(e.get("value"),{targetUpdate:1})}})}).call(e,n(0))},function(t,e,n){!function(e,n){t.exports=n()}(this,function(){"use strict";function t(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}function e(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function n(t,n){return e(t).appendChild(n)}function r(t,e,n,r){var i=document.createElement(t);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof e)i.appendChild(document.createTextNode(e));else if(e)for(var o=0;o<e.length;++o)i.appendChild(e[o]);return i}function i(t,e,n,i){var o=r(t,e,n,i);return o.setAttribute("role","presentation"),o}function o(t,e){if(3==e.nodeType&&(e=e.parentNode),t.contains)return t.contains(e);do if(11==e.nodeType&&(e=e.host),e==t)return!0;while(e=e.parentNode)}function s(){var t;try{t=document.activeElement}catch(e){t=document.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function a(e,n){var r=e.className;t(n).test(r)||(e.className+=(r?" ":"")+n)}function l(e,n){for(var r=e.split(" "),i=0;i<r.length;i++)r[i]&&!t(r[i]).test(n)&&(n+=" "+r[i]);return n}function c(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e)}}function u(t,e,n){e||(e={});for(var r in t)!t.hasOwnProperty(r)||n===!1&&e.hasOwnProperty(r)||(e[r]=t[r]);return e}function h(t,e,n,r,i){null==e&&(e=t.search(/[^\s\u00a0]/),e==-1&&(e=t.length));for(var o=r||0,s=i||0;;){var a=t.indexOf("\t",o);if(a<0||a>=e)return s+(e-o);s+=a-o,s+=n-s%n,o=a+1}}function f(t,e){for(var n=0;n<t.length;++n)if(t[n]==e)return n;return-1}function d(t,e,n){for(var r=0,i=0;;){var o=t.indexOf("\t",r);o==-1&&(o=t.length);var s=o-r;if(o==t.length||i+s>=e)return r+Math.min(s,e-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=e)return r}}function p(t){for(;Ys.length<=t;)Ys.push(g(Ys)+" ");return Ys[t]}function g(t){return t[t.length-1]}function v(t,e){for(var n=[],r=0;r<t.length;r++)n[r]=e(t[r],r);return n}function m(t,e,n){for(var r=0,i=n(e);r<t.length&&n(t[r])<=i;)r++;t.splice(r,0,e)}function y(){}function b(t,e){var n;return Object.create?n=Object.create(t):(y.prototype=t,n=new y),e&&u(e,n),n}function w(t){return/\w/.test(t)||t>"€"&&(t.toUpperCase()!=t.toLowerCase()||Ks.test(t))}function x(t,e){return e?!!(e.source.indexOf("\\w")>-1&&w(t))||e.test(t):w(t)}function _(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}function C(t){return t.charCodeAt(0)>=768&&Xs.test(t)}function k(t,e,n){for(;(n<0?e>0:e<t.length)&&C(t.charAt(e));)e+=n;return e}function S(t,e,n){for(var r=e>n?-1:1;;){if(e==n)return e;var i=(e+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==e)return t(o)?e:n;t(o)?n=o:e=o+r}}function T(t,e,n){var o=this;this.input=n,o.scrollbarFiller=r("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=r("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=i("div",null,"CodeMirror-code"),o.selectionDiv=r("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=r("div",null,"CodeMirror-cursors"),o.measure=r("div",null,"CodeMirror-measure"),o.lineMeasure=r("div",null,"CodeMirror-measure"),o.lineSpace=i("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var s=i("div",[o.lineSpace],"CodeMirror-lines");o.mover=r("div",[s],null,"position: relative"),o.sizer=r("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=r("div",null,null,"position: absolute; height: "+Hs+"px; width: 1px;"),o.gutters=r("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=r("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=r("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),bs&&ws<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),xs||gs&&Ms||(o.scroller.draggable=!0),t&&(t.appendChild?t.appendChild(o.wrapper):t(o.wrapper)),o.viewFrom=o.viewTo=e.first,o.reportedViewFrom=o.reportedViewTo=e.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,n.init(o)}function E(t,e){if(e-=t.first,e<0||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(e<o){n=i;break}e-=o}return n.lines[e]}function A(t,e,n){var r=[],i=e.line;return t.iter(e.line,n.line+1,function(t){var o=t.text;i==n.line&&(o=o.slice(0,n.ch)),i==e.line&&(o=o.slice(e.ch)),r.push(o),++i}),r}function O(t,e,n){var r=[];return t.iter(e,n,function(t){r.push(t.text)}),r}function M(t,e){
var n=e-t.height;if(n)for(var r=t;r;r=r.parent)r.height+=n}function L(t){if(null==t.parent)return null;for(var e=t.parent,n=f(e.lines,t),r=e.parent;r;e=r,r=r.parent)for(var i=0;r.children[i]!=e;++i)n+=r.children[i].chunkSize();return n+e.first}function P(t,e){var n=t.first;t:do{for(var r=0;r<t.children.length;++r){var i=t.children[r],o=i.height;if(e<o){t=i;continue t}e-=o,n+=i.chunkSize()}return n}while(!t.lines);for(var s=0;s<t.lines.length;++s){var a=t.lines[s],l=a.height;if(e<l)break;e-=l}return n+s}function j(t,e){return e>=t.first&&e<t.first+t.size}function D(t,e){return String(t.lineNumberFormatter(e+t.firstLineNumber))}function N(t,e,n){return void 0===n&&(n=null),this instanceof N?(this.line=t,this.ch=e,void(this.sticky=n)):new N(t,e,n)}function I(t,e){return t.line-e.line||t.ch-e.ch}function R(t,e){return t.sticky==e.sticky&&0==I(t,e)}function B(t){return N(t.line,t.ch)}function F(t,e){return I(t,e)<0?e:t}function z(t,e){return I(t,e)<0?t:e}function $(t,e){return Math.max(t.first,Math.min(e,t.first+t.size-1))}function V(t,e){if(e.line<t.first)return N(t.first,0);var n=t.first+t.size-1;return e.line>n?N(n,E(t,n).text.length):H(e,E(t,e.line).text.length)}function H(t,e){var n=t.ch;return null==n||n>e?N(t.line,e):n<0?N(t.line,0):t}function U(t,e){for(var n=[],r=0;r<e.length;r++)n[r]=V(t,e[r]);return n}function q(){Js=!0}function W(){Zs=!0}function G(t,e,n){this.marker=t,this.from=e,this.to=n}function Y(t,e){if(t)for(var n=0;n<t.length;++n){var r=t[n];if(r.marker==e)return r}}function K(t,e){for(var n,r=0;r<t.length;++r)t[r]!=e&&(n||(n=[])).push(t[r]);return n}function X(t,e){t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e],e.marker.attachLine(t)}function J(t,e,n){var r;if(t)for(var i=0;i<t.length;++i){var o=t[i],s=o.marker,a=null==o.from||(s.inclusiveLeft?o.from<=e:o.from<e);if(a||o.from==e&&"bookmark"==s.type&&(!n||!o.marker.insertLeft)){var l=null==o.to||(s.inclusiveRight?o.to>=e:o.to>e);(r||(r=[])).push(new G(s,o.from,l?null:o.to))}}return r}function Z(t,e,n){var r;if(t)for(var i=0;i<t.length;++i){var o=t[i],s=o.marker,a=null==o.to||(s.inclusiveRight?o.to>=e:o.to>e);if(a||o.from==e&&"bookmark"==s.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(s.inclusiveLeft?o.from<=e:o.from<e);(r||(r=[])).push(new G(s,l?null:o.from-e,null==o.to?null:o.to-e))}}return r}function Q(t,e){if(e.full)return null;var n=j(t,e.from.line)&&E(t,e.from.line).markedSpans,r=j(t,e.to.line)&&E(t,e.to.line).markedSpans;if(!n&&!r)return null;var i=e.from.ch,o=e.to.ch,s=0==I(e.from,e.to),a=J(n,i,s),l=Z(r,o,s),c=1==e.text.length,u=g(e.text).length+(c?i:0);if(a)for(var h=0;h<a.length;++h){var f=a[h];if(null==f.to){var d=Y(l,f.marker);d?c&&(f.to=null==d.to?null:d.to+u):f.to=i}}if(l)for(var p=0;p<l.length;++p){var v=l[p];if(null!=v.to&&(v.to+=u),null==v.from){var m=Y(a,v.marker);m||(v.from=u,c&&(a||(a=[])).push(v))}else v.from+=u,c&&(a||(a=[])).push(v)}a&&(a=tt(a)),l&&l!=a&&(l=tt(l));var y=[a];if(!c){var b,w=e.text.length-2;if(w>0&&a)for(var x=0;x<a.length;++x)null==a[x].to&&(b||(b=[])).push(new G(a[x].marker,null,null));for(var _=0;_<w;++_)y.push(b);y.push(l)}return y}function tt(t){for(var e=0;e<t.length;++e){var n=t[e];null!=n.from&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&t.splice(e--,1)}return t.length?t:null}function et(t,e,n){var r=null;if(t.iter(e.line,n.line+1,function(t){if(t.markedSpans)for(var e=0;e<t.markedSpans.length;++e){var n=t.markedSpans[e].marker;!n.readOnly||r&&f(r,n)!=-1||(r||(r=[])).push(n)}}),!r)return null;for(var i=[{from:e,to:n}],o=0;o<r.length;++o)for(var s=r[o],a=s.find(0),l=0;l<i.length;++l){var c=i[l];if(!(I(c.to,a.from)<0||I(c.from,a.to)>0)){var u=[l,1],h=I(c.from,a.from),d=I(c.to,a.to);(h<0||!s.inclusiveLeft&&!h)&&u.push({from:c.from,to:a.from}),(d>0||!s.inclusiveRight&&!d)&&u.push({from:a.to,to:c.to}),i.splice.apply(i,u),l+=u.length-3}}return i}function nt(t){var e=t.markedSpans;if(e){for(var n=0;n<e.length;++n)e[n].marker.detachLine(t);t.markedSpans=null}}function rt(t,e){if(e){for(var n=0;n<e.length;++n)e[n].marker.attachLine(t);t.markedSpans=e}}function it(t){return t.inclusiveLeft?-1:0}function ot(t){return t.inclusiveRight?1:0}function st(t,e){var n=t.lines.length-e.lines.length;if(0!=n)return n;var r=t.find(),i=e.find(),o=I(r.from,i.from)||it(t)-it(e);if(o)return-o;var s=I(r.to,i.to)||ot(t)-ot(e);return s?s:e.id-t.id}function at(t,e){var n,r=Zs&&t.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)i=r[o],i.marker.collapsed&&null==(e?i.from:i.to)&&(!n||st(n,i.marker)<0)&&(n=i.marker);return n}function lt(t){return at(t,!0)}function ct(t){return at(t,!1)}function ut(t,e,n,r,i){var o=E(t,e),s=Zs&&o.markedSpans;if(s)for(var a=0;a<s.length;++a){var l=s[a];if(l.marker.collapsed){var c=l.marker.find(0),u=I(c.from,n)||it(l.marker)-it(i),h=I(c.to,r)||ot(l.marker)-ot(i);if(!(u>=0&&h<=0||u<=0&&h>=0)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?I(c.to,n)>=0:I(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?I(c.from,r)<=0:I(c.from,r)<0)))return!0}}}function ht(t){for(var e;e=lt(t);)t=e.find(-1,!0).line;return t}function ft(t){for(var e;e=ct(t);)t=e.find(1,!0).line;return t}function dt(t){for(var e,n;e=ct(t);)t=e.find(1,!0).line,(n||(n=[])).push(t);return n}function pt(t,e){var n=E(t,e),r=ht(n);return n==r?e:L(r)}function gt(t,e){if(e>t.lastLine())return e;var n,r=E(t,e);if(!vt(t,r))return e;for(;n=ct(r);)r=n.find(1,!0).line;return L(r)+1}function vt(t,e){var n=Zs&&e.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&mt(t,e,r))return!0}}function mt(t,e,n){if(null==n.to){var r=n.marker.find(1,!0);return mt(t,r.line,Y(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==e.text.length)return!0;for(var i=void 0,o=0;o<e.markedSpans.length;++o)if(i=e.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&mt(t,e,i))return!0}function yt(t){t=ht(t);for(var e=0,n=t.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==t)break;e+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var s=0;s<o.children.length;++s){var a=o.children[s];if(a==n)break;e+=a.height}return e}function bt(t){if(0==t.height)return 0;for(var e,n=t.text.length,r=t;e=lt(r);){var i=e.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=t;e=ct(r);){var o=e.find(0,!0);n-=r.text.length-o.from.ch,r=o.to.line,n+=r.text.length-o.to.ch}return n}function wt(t){var e=t.display,n=t.doc;e.maxLine=E(n,n.first),e.maxLineLength=bt(e.maxLine),e.maxLineChanged=!0,n.iter(function(t){var n=bt(t);n>e.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)})}function xt(t,e,n,r){if(!t)return r(e,n,"ltr",0);for(var i=!1,o=0;o<t.length;++o){var s=t[o];(s.from<n&&s.to>e||e==n&&s.to==e)&&(r(Math.max(s.from,e),Math.min(s.to,n),1==s.level?"rtl":"ltr",o),i=!0)}i||r(e,n,"ltr")}function _t(t,e,n){var r;Qs=null;for(var i=0;i<t.length;++i){var o=t[i];if(o.from<e&&o.to>e)return i;o.to==e&&(o.from!=o.to&&"before"==n?r=i:Qs=i),o.from==e&&(o.from!=o.to&&"before"!=n?r=i:Qs=i)}return null!=r?r:Qs}function Ct(t,e){var n=t.order;return null==n&&(n=t.order=ta(t.text,e)),n}function kt(t,e){return t._handlers&&t._handlers[e]||ea}function St(t,e,n){if(t.removeEventListener)t.removeEventListener(e,n,!1);else if(t.detachEvent)t.detachEvent("on"+e,n);else{var r=t._handlers,i=r&&r[e];if(i){var o=f(i,n);o>-1&&(r[e]=i.slice(0,o).concat(i.slice(o+1)))}}}function Tt(t,e){var n=kt(t,e);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Et(t,e,n){return"string"==typeof e&&(e={type:e,preventDefault:function(){this.defaultPrevented=!0}}),Tt(t,n||e.type,t,e),jt(e)||e.codemirrorIgnore}function At(t){var e=t._handlers&&t._handlers.cursorActivity;if(e)for(var n=t.curOp.cursorActivityHandlers||(t.curOp.cursorActivityHandlers=[]),r=0;r<e.length;++r)f(n,e[r])==-1&&n.push(e[r])}function Ot(t,e){return kt(t,e).length>0}function Mt(t){t.prototype.on=function(t,e){na(this,t,e)},t.prototype.off=function(t,e){St(this,t,e)}}function Lt(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function Pt(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function jt(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function Dt(t){Lt(t),Pt(t)}function Nt(t){return t.target||t.srcElement}function It(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),Ls&&t.ctrlKey&&1==e&&(e=3),e}function Rt(t){if(null==$s){var e=r("span","");n(t,r("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&($s=e.offsetWidth<=1&&e.offsetHeight>2&&!(bs&&ws<8))}var i=$s?r("span",""):r("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function Bt(t){if(null!=Vs)return Vs;var r=n(t,document.createTextNode("AخA")),i=Ns(r,0,1).getBoundingClientRect(),o=Ns(r,1,2).getBoundingClientRect();return e(t),!(!i||i.left==i.right)&&(Vs=o.right-i.right<3)}function Ft(t){if(null!=aa)return aa;var e=n(t,r("span","x")),i=e.getBoundingClientRect(),o=Ns(e,0,1).getBoundingClientRect();return aa=Math.abs(i.left-o.left)>1}function zt(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),la[t]=e}function $t(t,e){ca[t]=e}function Vt(t){if("string"==typeof t&&ca.hasOwnProperty(t))t=ca[t];else if(t&&"string"==typeof t.name&&ca.hasOwnProperty(t.name)){var e=ca[t.name];"string"==typeof e&&(e={name:e}),t=b(e,t),t.name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Vt("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Vt("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Ht(t,e){e=Vt(e);var n=la[e.name];if(!n)return Ht(t,"text/plain");var r=n(t,e);if(ua.hasOwnProperty(e.name)){var i=ua[e.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=e.name,e.helperType&&(r.helperType=e.helperType),e.modeProps)for(var s in e.modeProps)r[s]=e.modeProps[s];return r}function Ut(t,e){var n=ua.hasOwnProperty(t)?ua[t]:ua[t]={};u(e,n)}function qt(t,e){if(e===!0)return e;if(t.copyState)return t.copyState(e);var n={};for(var r in e){var i=e[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Wt(t,e){for(var n;t.innerMode&&(n=t.innerMode(e),n&&n.mode!=t);)e=n.state,t=n.mode;return n||{mode:t,state:e}}function Gt(t,e,n){return!t.startState||t.startState(e,n)}function Yt(t,e,n,r){var i=[t.state.modeGen],o={};ne(t,e.text,t.doc.mode,n,function(t,e){return i.push(t,e)},o,r);for(var s=n.state,a=function(r){n.baseTokens=i;var a=t.state.overlays[r],l=1,c=0;n.state=!0,ne(t,e.text,a.mode,n,function(t,e){for(var n=l;c<t;){var r=i[l];r>t&&i.splice(l,1,t,i[l+1],r),l+=2,c=Math.min(t,r)}if(e)if(a.opaque)i.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;n<l;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+e}},o),n.state=s,n.baseTokens=null,n.baseTokenPos=1},l=0;l<t.state.overlays.length;++l)a(l);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Kt(t,e,n){if(!e.styles||e.styles[0]!=t.state.modeGen){var r=Xt(t,L(e)),i=e.text.length>t.options.maxHighlightLength&&qt(t.doc.mode,r.state),o=Yt(t,e,r);i&&(r.state=i),e.stateAfter=r.save(!i),e.styles=o.styles,o.classes?e.styleClasses=o.classes:e.styleClasses&&(e.styleClasses=null),n===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return e.styles}function Xt(t,e,n){var r=t.doc,i=t.display;if(!r.mode.startState)return new da(r,(!0),e);var o=re(t,e,n),s=o>r.first&&E(r,o-1).stateAfter,a=s?da.fromSaved(r,s,o):new da(r,Gt(r.mode),o);return r.iter(o,e,function(n){Jt(t,n.text,a);var r=a.line;n.stateAfter=r==e-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?a.save():null,a.nextLine()}),n&&(r.modeFrontier=a.line),a}function Jt(t,e,n,r){var i=t.doc.mode,o=new ha(e,t.options.tabSize,n);for(o.start=o.pos=r||0,""==e&&Zt(i,n.state);!o.eol();)Qt(i,o,n.state),o.start=o.pos}function Zt(t,e){if(t.blankLine)return t.blankLine(e);if(t.innerMode){var n=Wt(t,e);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Qt(t,e,n,r){for(var i=0;i<10;i++){r&&(r[0]=Wt(t,n).mode);var o=t.token(e,n);if(e.pos>e.start)return o}throw new Error("Mode "+t.name+" failed to advance stream.")}function te(t,e,n,r){var i,o=t.doc,s=o.mode;e=V(o,e);var a,l=E(o,e.line),c=Xt(t,e.line,n),u=new ha(l.text,t.options.tabSize,c);for(r&&(a=[]);(r||u.pos<e.ch)&&!u.eol();)u.start=u.pos,i=Qt(s,u,c.state),r&&a.push(new pa(u,i,qt(o.mode,c.state)));return r?a:new pa(u,i,c.state)}function ee(t,e){if(t)for(;;){var n=t.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;t=t.slice(0,n.index)+t.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==e[r]?e[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(e[r])||(e[r]+=" "+n[2])}return t}function ne(t,e,n,r,i,o,s){var a=n.flattenSpans;null==a&&(a=t.options.flattenSpans);var l,c=0,u=null,h=new ha(e,t.options.tabSize,r),f=t.options.addModeClass&&[null];for(""==e&&ee(Zt(n,r.state),o);!h.eol();){if(h.pos>t.options.maxHighlightLength?(a=!1,s&&Jt(t,e,r,h.pos),h.pos=e.length,l=null):l=ee(Qt(n,h,r.state,f),o),f){var d=f[0].name;d&&(l="m-"+(l?d+" "+l:d))}if(!a||u!=l){for(;c<h.start;)c=Math.min(h.start,c+5e3),i(c,u);u=l}h.start=h.pos}for(;c<h.pos;){var p=Math.min(h.pos,c+5e3);i(p,u),c=p}}function re(t,e,n){for(var r,i,o=t.doc,s=n?-1:e-(t.doc.mode.innerMode?1e3:100),a=e;a>s;--a){if(a<=o.first)return o.first;var l=E(o,a-1),c=l.stateAfter;if(c&&(!n||a+(c instanceof fa?c.lookAhead:0)<=o.modeFrontier))return a;var u=h(l.text,null,t.options.tabSize);(null==i||r>u)&&(i=a-1,r=u)}return i}function ie(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontier<e-10)){for(var n=t.first,r=e-1;r>n;r--){var i=E(t,r).stateAfter;if(i&&(!(i instanceof fa)||r+i.lookAhead<e)){n=r+1;break}}t.highlightFrontier=Math.min(t.highlightFrontier,n)}}function oe(t,e,n,r){t.text=e,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),nt(t),rt(t,n);var i=r?r(t):1;i!=t.height&&M(t,i)}function se(t){t.parent=null,nt(t)}function ae(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?ya:ma;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function le(t,e){var n=i("span",null,null,xs?"padding-right: .1px":null),r={pre:i("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:(bs||xs)&&t.getOption("lineWrapping")};e.measure={};for(var o=0;o<=(e.rest?e.rest.length:0);o++){var s=o?e.rest[o-1]:e.line,a=void 0;r.pos=0,r.addToken=ue,Bt(t.display.measure)&&(a=Ct(s,t.doc.direction))&&(r.addToken=fe(r.addToken,a)),r.map=[];var c=e!=t.display.externalMeasured&&L(s);pe(s,r,Kt(t,s,c)),s.styleClasses&&(s.styleClasses.bgClass&&(r.bgClass=l(s.styleClasses.bgClass,r.bgClass||"")),s.styleClasses.textClass&&(r.textClass=l(s.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Rt(t.display.measure))),0==o?(e.measure.map=r.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(r.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(xs){var u=r.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Tt(t,"renderLine",t,e.line,r.pre),r.pre.className&&(r.textClass=l(r.pre.className,r.textClass||"")),r}function ce(t){var e=r("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function ue(t,e,n,i,o,s,a){if(e){var l,c=t.splitSpaces?he(e,t.trailingSpace):e,u=t.cm.state.specialChars,h=!1;if(u.test(e)){l=document.createDocumentFragment();for(var f=0;;){u.lastIndex=f;var d=u.exec(e),g=d?d.index-f:e.length-f;if(g){var v=document.createTextNode(c.slice(f,f+g));bs&&ws<9?l.appendChild(r("span",[v])):l.appendChild(v),t.map.push(t.pos,t.pos+g,v),t.col+=g,t.pos+=g}if(!d)break;f+=g+1;var m=void 0;if("\t"==d[0]){var y=t.cm.options.tabSize,b=y-t.col%y;m=l.appendChild(r("span",p(b),"cm-tab")),m.setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),t.col+=b}else"\r"==d[0]||"\n"==d[0]?(m=l.appendChild(r("span","\r"==d[0]?"␍":"␤","cm-invalidchar")),m.setAttribute("cm-text",d[0]),t.col+=1):(m=t.cm.options.specialCharPlaceholder(d[0]),m.setAttribute("cm-text",d[0]),bs&&ws<9?l.appendChild(r("span",[m])):l.appendChild(m),t.col+=1);t.map.push(t.pos,t.pos+1,m),t.pos++}}else t.col+=e.length,l=document.createTextNode(c),t.map.push(t.pos,t.pos+e.length,l),bs&&ws<9&&(h=!0),t.pos+=e.length;if(t.trailingSpace=32==c.charCodeAt(e.length-1),n||i||o||h||a){var w=n||"";i&&(w+=i),o&&(w+=o);var x=r("span",[l],w,a);return s&&(x.title=s),t.content.appendChild(x)}t.content.appendChild(l)}}function he(t,e){if(t.length>1&&!/ /.test(t))return t;for(var n=e,r="",i=0;i<t.length;i++){var o=t.charAt(i);" "!=o||!n||i!=t.length-1&&32!=t.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}function fe(t,e){return function(n,r,i,o,s,a,l){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var h=void 0,f=0;f<e.length&&(h=e[f],!(h.to>c&&h.from<=c));f++);if(h.to>=u)return t(n,r,i,o,s,a,l);t(n,r.slice(0,h.to-c),i,o,null,a,l),o=null,r=r.slice(h.to-c),c=h.to}}}function de(t,e,n,r){var i=!r&&n.widgetNode;i&&t.map.push(t.pos,t.pos+e,i),!r&&t.cm.display.input.needsContentAttribute&&(i||(i=t.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(t.cm.display.input.setUneditable(i),t.content.appendChild(i)),t.pos+=e,t.trailingSpace=!1}function pe(t,e,n){var r=t.markedSpans,i=t.text,o=0;if(r)for(var s,a,l,c,u,h,f,d=i.length,p=0,g=1,v="",m=0;;){if(m==p){l=c=u=h=a="",f=null,m=1/0;for(var y=[],b=void 0,w=0;w<r.length;++w){var x=r[w],_=x.marker;"bookmark"==_.type&&x.from==p&&_.widgetNode?y.push(_):x.from<=p&&(null==x.to||x.to>p||_.collapsed&&x.to==p&&x.from==p)?(null!=x.to&&x.to!=p&&m>x.to&&(m=x.to,c=""),_.className&&(l+=" "+_.className),_.css&&(a=(a?a+";":"")+_.css),_.startStyle&&x.from==p&&(u+=" "+_.startStyle),_.endStyle&&x.to==m&&(b||(b=[])).push(_.endStyle,x.to),_.title&&!h&&(h=_.title),_.collapsed&&(!f||st(f.marker,_)<0)&&(f=x)):x.from>p&&m>x.from&&(m=x.from)}if(b)for(var C=0;C<b.length;C+=2)b[C+1]==m&&(c+=" "+b[C]);if(!f||f.from==p)for(var k=0;k<y.length;++k)de(e,0,y[k]);if(f&&(f.from||0)==p){if(de(e,(null==f.to?d+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}}if(p>=d)break;for(var S=Math.min(d,m);;){if(v){var T=p+v.length;if(!f){var E=T>S?v.slice(0,S-p):v;e.addToken(e,E,s?s+l:l,u,p+E.length==m?c:"",h,a)}if(T>=S){v=v.slice(S-p),p=S;break}p=T,u=""}v=i.slice(o,o=n[g++]),s=ae(n[g++],e.cm.options)}}else for(var A=1;A<n.length;A+=2)e.addToken(e,i.slice(o,o=n[A]),ae(n[A+1],e.cm.options))}function ge(t,e,n){this.line=e,this.rest=dt(e),this.size=this.rest?L(g(this.rest))-n+1:1,this.node=this.text=null,this.hidden=vt(t,e)}function ve(t,e,n){for(var r,i=[],o=e;o<n;o=r){var s=new ge(t.doc,E(t.doc,o),o);r=o+s.size,i.push(s)}return i}function me(t){ba?ba.ops.push(t):t.ownsGroup=ba={ops:[t],delayedCallbacks:[]}}function ye(t){var e=t.delayedCallbacks,n=0;do{for(;n<e.length;n++)e[n].call(null);for(var r=0;r<t.ops.length;r++){var i=t.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<e.length)}function be(t,e){var n=t.ownsGroup;if(n)try{ye(n)}finally{ba=null,e(n)}}function we(t,e){var n=kt(t,e);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);ba?r=ba.delayedCallbacks:wa?r=wa:(r=wa=[],setTimeout(xe,0));for(var o=function(t){r.push(function(){return n[t].apply(null,i)})},s=0;s<n.length;++s)o(s)}}function xe(){var t=wa;wa=null;for(var e=0;e<t.length;++e)t[e]()}function _e(t,e,n,r){for(var i=0;i<e.changes.length;i++){var o=e.changes[i];"text"==o?Te(t,e):"gutter"==o?Ae(t,e,n,r):"class"==o?Ee(t,e):"widget"==o&&Oe(t,e,r)}e.changes=null}function Ce(t){return t.node==t.text&&(t.node=r("div",null,null,"position: relative"),t.text.parentNode&&t.text.parentNode.replaceChild(t.node,t.text),t.node.appendChild(t.text),bs&&ws<8&&(t.node.style.zIndex=2)),t.node}function ke(t,e){var n=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),e.background)n?e.background.className=n:(e.background.parentNode.removeChild(e.background),e.background=null);else if(n){var i=Ce(e);e.background=i.insertBefore(r("div",null,n),i.firstChild),t.display.input.setUneditable(e.background)}}function Se(t,e){var n=t.display.externalMeasured;return n&&n.line==e.line?(t.display.externalMeasured=null,e.measure=n.measure,n.built):le(t,e)}function Te(t,e){var n=e.text.className,r=Se(t,e);e.text==e.node&&(e.node=r.pre),e.text.parentNode.replaceChild(r.pre,e.text),e.text=r.pre,r.bgClass!=e.bgClass||r.textClass!=e.textClass?(e.bgClass=r.bgClass,e.textClass=r.textClass,Ee(t,e)):n&&(e.text.className=n)}function Ee(t,e){ke(t,e),e.line.wrapClass?Ce(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var n=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=n||""}function Ae(t,e,n,i){if(e.gutter&&(e.node.removeChild(e.gutter),e.gutter=null),e.gutterBackground&&(e.node.removeChild(e.gutterBackground),e.gutterBackground=null),e.line.gutterClass){var o=Ce(e);e.gutterBackground=r("div",null,"CodeMirror-gutter-background "+e.line.gutterClass,"left: "+(t.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),t.display.input.setUneditable(e.gutterBackground),o.insertBefore(e.gutterBackground,e.text)}var s=e.line.gutterMarkers;if(t.options.lineNumbers||s){var a=Ce(e),l=e.gutter=r("div",null,"CodeMirror-gutter-wrapper","left: "+(t.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(t.display.input.setUneditable(l),a.insertBefore(l,e.text),e.line.gutterClass&&(l.className+=" "+e.line.gutterClass),!t.options.lineNumbers||s&&s["CodeMirror-linenumbers"]||(e.lineNumber=l.appendChild(r("div",D(t.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+t.display.lineNumInnerWidth+"px"))),s)for(var c=0;c<t.options.gutters.length;++c){var u=t.options.gutters[c],h=s.hasOwnProperty(u)&&s[u];h&&l.appendChild(r("div",[h],"CodeMirror-gutter-elt","left: "+i.gutterLeft[u]+"px; width: "+i.gutterWidth[u]+"px"))}}}function Oe(t,e,n){e.alignable&&(e.alignable=null);for(var r=e.node.firstChild,i=void 0;r;r=i)i=r.nextSibling,"CodeMirror-linewidget"==r.className&&e.node.removeChild(r);Le(t,e,n)}function Me(t,e,n,r){var i=Se(t,e);return e.text=e.node=i.pre,i.bgClass&&(e.bgClass=i.bgClass),i.textClass&&(e.textClass=i.textClass),Ee(t,e),Ae(t,e,n,r),Le(t,e,r),e.node}function Le(t,e,n){if(Pe(t,e.line,e,n,!0),e.rest)for(var r=0;r<e.rest.length;r++)Pe(t,e.rest[r],e,n,!1)}function Pe(t,e,n,i,o){if(e.widgets)for(var s=Ce(n),a=0,l=e.widgets;a<l.length;++a){var c=l[a],u=r("div",[c.node],"CodeMirror-linewidget");c.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),je(c,u,n,i),t.display.input.setUneditable(u),o&&c.above?s.insertBefore(u,n.gutter||n.text):s.appendChild(u),we(c,"redraw")}}function je(t,e,n,r){if(t.noHScroll){(n.alignable||(n.alignable=[])).push(e);var i=r.wrapperWidth;e.style.left=r.fixedPos+"px",t.coverGutter||(i-=r.gutterTotalWidth,e.style.paddingLeft=r.gutterTotalWidth+"px"),e.style.width=i+"px"}t.coverGutter&&(e.style.zIndex=5,e.style.position="relative",t.noHScroll||(e.style.marginLeft=-r.gutterTotalWidth+"px"))}function De(t){if(null!=t.height)return t.height;var e=t.doc.cm;if(!e)return 0;if(!o(document.body,t.node)){var i="position: relative;";t.coverGutter&&(i+="margin-left: -"+e.display.gutters.offsetWidth+"px;"),t.noHScroll&&(i+="width: "+e.display.wrapper.clientWidth+"px;"),n(e.display.measure,r("div",[t.node],null,i))}return t.height=t.node.parentNode.offsetHeight}function Ne(t,e){for(var n=Nt(e);n!=t.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==t.sizer&&n!=t.mover)return!0}function Ie(t){return t.lineSpace.offsetTop}function Re(t){return t.mover.offsetHeight-t.lineSpace.offsetHeight}function Be(t){if(t.cachedPaddingH)return t.cachedPaddingH;var e=n(t.measure,r("pre","x")),i=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,o={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return isNaN(o.left)||isNaN(o.right)||(t.cachedPaddingH=o),o}function Fe(t){return Hs-t.display.nativeBarWidth}function ze(t){return t.display.scroller.clientWidth-Fe(t)-t.display.barWidth}function $e(t){return t.display.scroller.clientHeight-Fe(t)-t.display.barHeight}function Ve(t,e,n){var r=t.options.lineWrapping,i=r&&ze(t);if(!e.measure.heights||r&&e.measure.width!=i){var o=e.measure.heights=[];if(r){e.measure.width=i;for(var s=e.text.firstChild.getClientRects(),a=0;a<s.length-1;a++){var l=s[a],c=s[a+1];Math.abs(l.bottom-c.bottom)>2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function He(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};for(var r=0;r<t.rest.length;r++)if(t.rest[r]==e)return{map:t.measure.maps[r],cache:t.measure.caches[r]};for(var i=0;i<t.rest.length;i++)if(L(t.rest[i])>n)return{map:t.measure.maps[i],cache:t.measure.caches[i],before:!0}}function Ue(t,e){e=ht(e);var r=L(e),i=t.display.externalMeasured=new ge(t.doc,e,r);i.lineN=r;var o=i.built=le(t,i);return i.text=o.pre,n(t.display.lineMeasure,o.pre),i}function qe(t,e,n,r){return Ye(t,Ge(t,e),n,r)}function We(t,e){if(e>=t.display.viewFrom&&e<t.display.viewTo)return t.display.view[Tn(t,e)];var n=t.display.externalMeasured;return n&&e>=n.lineN&&e<n.lineN+n.size?n:void 0}function Ge(t,e){var n=L(e),r=We(t,n);r&&!r.text?r=null:r&&r.changes&&(_e(t,r,n,xn(t)),t.curOp.forceUpdate=!0),r||(r=Ue(t,e));var i=He(r,e,n);return{line:e,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Ye(t,e,n,r,i){e.before&&(n=-1);var o,s=n+(r||"");return e.cache.hasOwnProperty(s)?o=e.cache[s]:(e.rect||(e.rect=e.view.text.getBoundingClientRect()),e.hasHeights||(Ve(t,e.view,e.rect),e.hasHeights=!0),o=Je(t,e,n,r),o.bogus||(e.cache[s]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function Ke(t,e,n){for(var r,i,o,s,a,l,c=0;c<t.length;c+=3)if(a=t[c],l=t[c+1],e<a?(i=0,o=1,s="left"):e<l?(i=e-a,o=i+1):(c==t.length-3||e==l&&t[c+3]>e)&&(o=l-a,i=o-1,e>=l&&(s="right")),null!=i){if(r=t[c+2],a==l&&n==(r.insertLeft?"left":"right")&&(s=n),"left"==n&&0==i)for(;c&&t[c-2]==t[c-3]&&t[c-1].insertLeft;)r=t[(c-=3)+2],s="left";if("right"==n&&i==l-a)for(;c<t.length-3&&t[c+3]==t[c+4]&&!t[c+5].insertLeft;)r=t[(c+=3)+2],s="right";break}return{node:r,start:i,end:o,collapse:s,coverStart:a,coverEnd:l}}function Xe(t,e){var n=xa;if("left"==e)for(var r=0;r<t.length&&(n=t[r]).left==n.right;r++);else for(var i=t.length-1;i>=0&&(n=t[i]).left==n.right;i--);return n}function Je(t,e,n,r){var i,o=Ke(e.map,n,r),s=o.node,a=o.start,l=o.end,c=o.collapse;if(3==s.nodeType){for(var u=0;u<4;u++){for(;a&&C(e.line.text.charAt(o.coverStart+a));)--a;for(;o.coverStart+l<o.coverEnd&&C(e.line.text.charAt(o.coverStart+l));)++l;if(i=bs&&ws<9&&0==a&&l==o.coverEnd-o.coverStart?s.parentNode.getBoundingClientRect():Xe(Ns(s,a,l).getClientRects(),r),i.left||i.right||0==a)break;l=a,a-=1,c="right"}bs&&ws<11&&(i=Ze(t.display.measure,i))}else{a>0&&(c=r="right");var h;i=t.options.lineWrapping&&(h=s.getClientRects()).length>1?h["right"==r?h.length-1:0]:s.getBoundingClientRect()}if(bs&&ws<9&&!a&&(!i||!i.left&&!i.right)){var f=s.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+wn(t.display),top:f.top,bottom:f.bottom}:xa}for(var d=i.top-e.rect.top,p=i.bottom-e.rect.top,g=(d+p)/2,v=e.view.measure.heights,m=0;m<v.length-1&&!(g<v[m]);m++);var y=m?v[m-1]:0,b=v[m],w={left:("right"==c?i.right:i.left)-e.rect.left,right:("left"==c?i.left:i.right)-e.rect.left,top:y,bottom:b};return i.left||i.right||(w.bogus=!0),t.options.singleCursorHeightPerLine||(w.rtop=d,w.rbottom=p),w}function Ze(t,e){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Ft(t))return e;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:e.left*n,right:e.right*n,top:e.top*r,bottom:e.bottom*r}}function Qe(t){if(t.measure&&(t.measure.cache={},t.measure.heights=null,t.rest))for(var e=0;e<t.rest.length;e++)t.measure.caches[e]={}}function tn(t){t.display.externalMeasure=null,e(t.display.lineMeasure);for(var n=0;n<t.display.view.length;n++)Qe(t.display.view[n])}function en(t){tn(t),t.display.cachedCharWidth=t.display.cachedTextHeight=t.display.cachedPaddingH=null,t.options.lineWrapping||(t.display.maxLineChanged=!0),t.display.lineNumChars=null}function nn(){return Cs&&Os?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function rn(){return Cs&&Os?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function on(t){var e=0;if(t.widgets)for(var n=0;n<t.widgets.length;++n)t.widgets[n].above&&(e+=De(t.widgets[n]));return e}function sn(t,e,n,r,i){if(!i){var o=on(e);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var s=yt(e);if("local"==r?s+=Ie(t.display):s-=t.display.viewOffset,"page"==r||"window"==r){var a=t.display.lineSpace.getBoundingClientRect();s+=a.top+("window"==r?0:rn());var l=a.left+("window"==r?0:nn());n.left+=l,n.right+=l}return n.top+=s,n.bottom+=s,n}function an(t,e,n){if("div"==n)return e;var r=e.left,i=e.top;if("page"==n)r-=nn(),i-=rn();else if("local"==n||!n){var o=t.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var s=t.display.lineSpace.getBoundingClientRect();return{left:r-s.left,top:i-s.top}}function ln(t,e,n,r,i){return r||(r=E(t.doc,e.line)),sn(t,r,qe(t,r,e.ch,i),n)}function cn(t,e,n,r,i,o){function s(e,s){var a=Ye(t,i,e,s?"right":"left",o);return s?a.left=a.right:a.right=a.left,sn(t,r,a,n)}function a(t,e,n){var r=l[e],i=1==r.level;return s(n?t-1:t,i!=n)}r=r||E(t.doc,e.line),i||(i=Ge(t,r));var l=Ct(r,t.doc.direction),c=e.ch,u=e.sticky;if(c>=r.text.length?(c=r.text.length,u="before"):c<=0&&(c=0,u="after"),!l)return s("before"==u?c-1:c,"before"==u);var h=_t(l,c,u),f=Qs,d=a(c,h,"before"==u);return null!=f&&(d.other=a(c,f,"before"!=u)),d}function un(t,e){var n=0;e=V(t.doc,e),t.options.lineWrapping||(n=wn(t.display)*e.ch);var r=E(t.doc,e.line),i=yt(r)+Ie(t.display);return{left:n,right:n,top:i,bottom:i+r.height}}function hn(t,e,n,r,i){var o=N(t,e,n);return o.xRel=i,r&&(o.outside=!0),o}function fn(t,e,n){var r=t.doc;if(n+=t.display.viewOffset,n<0)return hn(r.first,0,null,!0,-1);var i=P(r,n),o=r.first+r.size-1;if(i>o)return hn(r.first+r.size-1,E(r,o).text.length,null,!0,1);e<0&&(e=0);for(var s=E(r,i);;){var a=vn(t,s,i,e,n),l=ct(s),c=l&&l.find(0,!0);if(!l||!(a.ch>c.from.ch||a.ch==c.from.ch&&a.xRel>0))return a;i=L(s=c.to.line)}}function dn(t,e,n,r){r-=on(e);var i=e.text.length,o=S(function(e){return Ye(t,n,e-1).bottom<=r},i,0);return i=S(function(e){return Ye(t,n,e).top>r},o,i),{begin:o,end:i}}function pn(t,e,n,r){n||(n=Ge(t,e));var i=sn(t,e,Ye(t,n,r),"line").top;return dn(t,e,n,i)}function gn(t,e,n,r){return!(t.bottom<=n)&&(t.top>n||(r?t.left:t.right)>e)}function vn(t,e,n,r,i){i-=yt(e);var o=Ge(t,e),s=on(e),a=0,l=e.text.length,c=!0,u=Ct(e,t.doc.direction);if(u){var h=(t.options.lineWrapping?yn:mn)(t,e,n,o,u,r,i);c=1!=h.level,a=c?h.from:h.to-1,l=c?h.to:h.from-1}var f,d,p=null,g=null,v=S(function(e){var n=Ye(t,o,e);return n.top+=s,n.bottom+=s,!!gn(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=e,g=n),!0)},a,l),m=!1;if(g){var y=r-g.left<g.right-r,b=y==c;v=p+(b?0:1),d=b?"after":"before",f=y?g.left:g.right}else{c||v!=l&&v!=a||v++,d=0==v?"after":v==e.text.length?"before":Ye(t,o,v-(c?1:0)).bottom+s<=i==c?"after":"before";var w=cn(t,N(n,v,d),"line",e,o);f=w.left,m=i<w.top||i>=w.bottom}return v=k(e.text,v,1),hn(n,v,d,m,r-f)}function mn(t,e,n,r,i,o,s){var a=S(function(a){
var l=i[a],c=1!=l.level;return gn(cn(t,N(n,c?l.to:l.from,c?"before":"after"),"line",e,r),o,s,!0)},0,i.length-1),l=i[a];if(a>0){var c=1!=l.level,u=cn(t,N(n,c?l.from:l.to,c?"after":"before"),"line",e,r);gn(u,o,s,!0)&&u.top>s&&(l=i[a-1])}return l}function yn(t,e,n,r,i,o,s){var a=dn(t,e,r,s),l=a.begin,c=a.end;/\s/.test(e.text.charAt(c-1))&&c--;for(var u=null,h=null,f=0;f<i.length;f++){var d=i[f];if(!(d.from>=c||d.to<=l)){var p=1!=d.level,g=Ye(t,r,p?Math.min(c,d.to)-1:Math.max(l,d.from)).right,v=g<o?o-g+1e9:g-o;(!u||h>v)&&(u=d,h=v)}}return u||(u=i[i.length-1]),u.from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function bn(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==va){va=r("pre");for(var i=0;i<49;++i)va.appendChild(document.createTextNode("x")),va.appendChild(r("br"));va.appendChild(document.createTextNode("x"))}n(t.measure,va);var o=va.offsetHeight/50;return o>3&&(t.cachedTextHeight=o),e(t.measure),o||1}function wn(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=r("span","xxxxxxxxxx"),i=r("pre",[e]);n(t.measure,i);var o=e.getBoundingClientRect(),s=(o.right-o.left)/10;return s>2&&(t.cachedCharWidth=s),s||10}function xn(t){for(var e=t.display,n={},r={},i=e.gutters.clientLeft,o=e.gutters.firstChild,s=0;o;o=o.nextSibling,++s)n[t.options.gutters[s]]=o.offsetLeft+o.clientLeft+i,r[t.options.gutters[s]]=o.clientWidth;return{fixedPos:_n(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:e.wrapper.clientWidth}}function _n(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function Cn(t){var e=bn(t.display),n=t.options.lineWrapping,r=n&&Math.max(5,t.display.scroller.clientWidth/wn(t.display)-3);return function(i){if(vt(t.doc,i))return 0;var o=0;if(i.widgets)for(var s=0;s<i.widgets.length;s++)i.widgets[s].height&&(o+=i.widgets[s].height);return n?o+(Math.ceil(i.text.length/r)||1)*e:o+e}}function kn(t){var e=t.doc,n=Cn(t);e.iter(function(t){var e=n(t);e!=t.height&&M(t,e)})}function Sn(t,e,n,r){var i=t.display;if(!n&&"true"==Nt(e).getAttribute("cm-not-content"))return null;var o,s,a=i.lineSpace.getBoundingClientRect();try{o=e.clientX-a.left,s=e.clientY-a.top}catch(e){return null}var l,c=fn(t,o,s);if(r&&1==c.xRel&&(l=E(t.doc,c.line).text).length==c.ch){var u=h(l,l.length,t.options.tabSize)-l.length;c=N(c.line,Math.max(0,Math.round((o-Be(t.display).left)/wn(t.display))-u))}return c}function Tn(t,e){if(e>=t.display.viewTo)return null;if(e-=t.display.viewFrom,e<0)return null;for(var n=t.display.view,r=0;r<n.length;r++)if(e-=n[r].size,e<0)return r}function En(t){t.display.input.showSelection(t.display.input.prepareSelection())}function An(t,e){void 0===e&&(e=!0);for(var n=t.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),s=0;s<n.sel.ranges.length;s++)if(e||s!=n.sel.primIndex){var a=n.sel.ranges[s];if(!(a.from().line>=t.display.viewTo||a.to().line<t.display.viewFrom)){var l=a.empty();(l||t.options.showCursorWhenSelecting)&&On(t,a.head,i),l||Ln(t,a,o)}}return r}function On(t,e,n){var i=cn(t,e,"div",null,null,!t.options.singleCursorHeightPerLine),o=n.appendChild(r("div"," ","CodeMirror-cursor"));if(o.style.left=i.left+"px",o.style.top=i.top+"px",o.style.height=Math.max(0,i.bottom-i.top)*t.options.cursorHeight+"px",i.other){var s=n.appendChild(r("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=i.other.left+"px",s.style.top=i.other.top+"px",s.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function Mn(t,e){return t.top-e.top||t.left-e.left}function Ln(t,e,n){function i(t,e,n,i){e<0&&(e=0),e=Math.round(e),i=Math.round(i),l.appendChild(r("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px;\n top: "+e+"px; width: "+(null==n?h-t:n)+"px;\n height: "+(i-e)+"px"))}function o(e,n,r){function o(n,r){return ln(t,N(e,n),"div",d,r)}function s(e,n,r){var i=pn(t,d,null,e),s="ltr"==n==("after"==r)?"left":"right",a="after"==r?i.begin:i.end-(/\s/.test(d.text.charAt(i.end-1))?2:1);return o(a,s)[s]}var l,c,d=E(a,e),p=d.text.length,g=Ct(d,a.direction);return xt(g,n||0,null==r?p:r,function(t,e,a,d){var v="ltr"==a,m=o(t,v?"left":"right"),y=o(e-1,v?"right":"left"),b=null==n&&0==t,w=null==r&&e==p,x=0==d,_=!g||d==g.length-1;if(y.top-m.top<=3){var C=(f?b:w)&&x,k=(f?w:b)&&_,S=C?u:(v?m:y).left,T=k?h:(v?y:m).right;i(S,m.top,T-S,m.bottom)}else{var E,A,O,M;v?(E=f&&b&&x?u:m.left,A=f?h:s(t,a,"before"),O=f?u:s(e,a,"after"),M=f&&w&&_?h:y.right):(E=f?s(t,a,"before"):u,A=!f&&b&&x?h:m.right,O=!f&&w&&_?u:y.left,M=f?s(e,a,"after"):h),i(E,m.top,A-E,m.bottom),m.bottom<y.top&&i(u,m.bottom,null,y.top),i(O,y.top,M-O,y.bottom)}(!l||Mn(m,l)<0)&&(l=m),Mn(y,l)<0&&(l=y),(!c||Mn(m,c)<0)&&(c=m),Mn(y,c)<0&&(c=y)}),{start:l,end:c}}var s=t.display,a=t.doc,l=document.createDocumentFragment(),c=Be(t.display),u=c.left,h=Math.max(s.sizerWidth,ze(t)-s.sizer.offsetLeft)-c.right,f="ltr"==a.direction,d=e.from(),p=e.to();if(d.line==p.line)o(d.line,d.ch,p.ch);else{var g=E(a,d.line),v=E(a,p.line),m=ht(g)==ht(v),y=o(d.line,d.ch,m?g.text.length+1:null).end,b=o(p.line,m?0:null,p.ch).start;m&&(y.top<b.top-2?(i(y.right,y.top,null,y.bottom),i(u,b.top,b.left,b.bottom)):i(y.right,y.top,b.left-y.right,y.bottom)),y.bottom<b.top&&i(u,y.bottom,null,b.top)}n.appendChild(l)}function Pn(t){if(t.state.focused){var e=t.display;clearInterval(e.blinker);var n=!0;e.cursorDiv.style.visibility="",t.options.cursorBlinkRate>0?e.blinker=setInterval(function(){return e.cursorDiv.style.visibility=(n=!n)?"":"hidden"},t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function jn(t){t.state.focused||(t.display.input.focus(),Nn(t))}function Dn(t){t.state.delayingBlurEvent=!0,setTimeout(function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,In(t))},100)}function Nn(t,e){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(Tt(t,"focus",t,e),t.state.focused=!0,a(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),xs&&setTimeout(function(){return t.display.input.reset(!0)},20)),t.display.input.receivedFocus()),Pn(t))}function In(t,e){t.state.delayingBlurEvent||(t.state.focused&&(Tt(t,"blur",t,e),t.state.focused=!1,Bs(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout(function(){t.state.focused||(t.display.shift=!1)},150))}function Rn(t){for(var e=t.display,n=e.lineDiv.offsetTop,r=0;r<e.view.length;r++){var i=e.view[r],o=void 0;if(!i.hidden){if(bs&&ws<8){var s=i.node.offsetTop+i.node.offsetHeight;o=s-n,n=s}else{var a=i.node.getBoundingClientRect();o=a.bottom-a.top}var l=i.line.height-o;if(o<2&&(o=bn(e)),(l>.005||l<-.005)&&(M(i.line,o),Bn(i.line),i.rest))for(var c=0;c<i.rest.length;c++)Bn(i.rest[c])}}}function Bn(t){if(t.widgets)for(var e=0;e<t.widgets.length;++e)t.widgets[e].height=t.widgets[e].node.parentNode.offsetHeight}function Fn(t,e,n){var r=n&&null!=n.top?Math.max(0,n.top):t.scroller.scrollTop;r=Math.floor(r-Ie(t));var i=n&&null!=n.bottom?n.bottom:r+t.wrapper.clientHeight,o=P(e,r),s=P(e,i);if(n&&n.ensure){var a=n.ensure.from.line,l=n.ensure.to.line;a<o?(o=a,s=P(e,yt(E(e,a))+t.wrapper.clientHeight)):Math.min(l,e.lastLine())>=s&&(o=P(e,yt(E(e,l))-t.wrapper.clientHeight),s=l)}return{from:o,to:Math.max(s,o+1)}}function zn(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var r=_n(e)-e.scroller.scrollLeft+t.doc.scrollLeft,i=e.gutters.offsetWidth,o=r+"px",s=0;s<n.length;s++)if(!n[s].hidden){t.options.fixedGutter&&(n[s].gutter&&(n[s].gutter.style.left=o),n[s].gutterBackground&&(n[s].gutterBackground.style.left=o));var a=n[s].alignable;if(a)for(var l=0;l<a.length;l++)a[l].style.left=o}t.options.fixedGutter&&(e.gutters.style.left=r+i+"px")}}function $n(t){if(!t.options.lineNumbers)return!1;var e=t.doc,n=D(t.options,e.first+e.size-1),i=t.display;if(n.length!=i.lineNumChars){var o=i.measure.appendChild(r("div",[r("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=o.firstChild.offsetWidth,a=o.offsetWidth-s;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(s,i.lineGutter.offsetWidth-a)+1,i.lineNumWidth=i.lineNumInnerWidth+a,i.lineNumChars=i.lineNumInnerWidth?n.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",Pr(t),!0}return!1}function Vn(t,e){if(!Et(t,"scrollCursorIntoView")){var n=t.display,i=n.sizer.getBoundingClientRect(),o=null;if(e.top+i.top<0?o=!0:e.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!Es){var s=r("div","",null,"position: absolute;\n top: "+(e.top-n.viewOffset-Ie(t.display))+"px;\n height: "+(e.bottom-e.top+Fe(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(s),s.scrollIntoView(o),t.display.lineSpace.removeChild(s)}}}function Hn(t,e,n,r){null==r&&(r=0);var i;t.options.lineWrapping||e!=n||(e=e.ch?N(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e,n="before"==e.sticky?N(e.line,e.ch+1,"before"):e);for(var o=0;o<5;o++){var s=!1,a=cn(t,e),l=n&&n!=e?cn(t,n):a;i={left:Math.min(a.left,l.left),top:Math.min(a.top,l.top)-r,right:Math.max(a.left,l.left),bottom:Math.max(a.bottom,l.bottom)+r};var c=qn(t,i),u=t.doc.scrollTop,h=t.doc.scrollLeft;if(null!=c.scrollTop&&(Zn(t,c.scrollTop),Math.abs(t.doc.scrollTop-u)>1&&(s=!0)),null!=c.scrollLeft&&(tr(t,c.scrollLeft),Math.abs(t.doc.scrollLeft-h)>1&&(s=!0)),!s)break}return i}function Un(t,e){var n=qn(t,e);null!=n.scrollTop&&Zn(t,n.scrollTop),null!=n.scrollLeft&&tr(t,n.scrollLeft)}function qn(t,e){var n=t.display,r=bn(t.display);e.top<0&&(e.top=0);var i=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,o=$e(t),s={};e.bottom-e.top>o&&(e.bottom=e.top+o);var a=t.doc.height+Re(n),l=e.top<r,c=e.bottom>a-r;if(e.top<i)s.scrollTop=l?0:e.top;else if(e.bottom>i+o){var u=Math.min(e.top,(c?a:e.bottom)-o);u!=i&&(s.scrollTop=u)}var h=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft,f=ze(t)-(t.options.fixedGutter?n.gutters.offsetWidth:0),d=e.right-e.left>f;return d&&(e.right=e.left+f),e.left<10?s.scrollLeft=0:e.left<h?s.scrollLeft=Math.max(0,e.left-(d?0:10)):e.right>f+h-3&&(s.scrollLeft=e.right+(d?0:10)-f),s}function Wn(t,e){null!=e&&(Xn(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function Gn(t){Xn(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function Yn(t,e,n){null==e&&null==n||Xn(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function Kn(t,e){Xn(t),t.curOp.scrollToPos=e}function Xn(t){var e=t.curOp.scrollToPos;if(e){t.curOp.scrollToPos=null;var n=un(t,e.from),r=un(t,e.to);Jn(t,n,r,e.margin)}}function Jn(t,e,n,r){var i=qn(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-r,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+r});Yn(t,i.scrollLeft,i.scrollTop)}function Zn(t,e){Math.abs(t.doc.scrollTop-e)<2||(gs||Mr(t,{top:e}),Qn(t,e,!0),gs&&Mr(t),Cr(t,100))}function Qn(t,e,n){e=Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function tr(t,e,n,r){e=Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!r||(t.doc.scrollLeft=e,zn(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function er(t){var e=t.display,n=e.gutters.offsetWidth,r=Math.round(t.doc.height+Re(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Fe(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}function nr(t,e){e||(e=er(t));var n=t.display.barWidth,r=t.display.barHeight;rr(t,e);for(var i=0;i<4&&n!=t.display.barWidth||r!=t.display.barHeight;i++)n!=t.display.barWidth&&t.options.lineWrapping&&Rn(t),rr(t,er(t)),n=t.display.barWidth,r=t.display.barHeight}function rr(t,e){var n=t.display,r=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}function ir(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&Bs(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new ka[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),na(e,"mousedown",function(){t.state.focused&&setTimeout(function(){return t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?tr(t,e):Zn(t,e)},t),t.display.scrollbars.addClass&&a(t.display.wrapper,t.display.scrollbars.addClass)}function or(t){t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Sa},me(t.curOp)}function sr(t){var e=t.curOp;be(e,function(t){for(var e=0;e<t.ops.length;e++)t.ops[e].cm.curOp=null;ar(t)})}function ar(t){for(var e=t.ops,n=0;n<e.length;n++)lr(e[n]);for(var r=0;r<e.length;r++)cr(e[r]);for(var i=0;i<e.length;i++)ur(e[i]);for(var o=0;o<e.length;o++)hr(e[o]);for(var s=0;s<e.length;s++)fr(e[s])}function lr(t){var e=t.cm,n=e.display;Sr(e),t.updateMaxLine&&wt(e),t.mustUpdate=t.viewChanged||t.forceUpdate||null!=t.scrollTop||t.scrollToPos&&(t.scrollToPos.from.line<n.viewFrom||t.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new Ta(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function cr(t){t.updatedDisplay=t.mustUpdate&&Ar(t.cm,t.update)}function ur(t){var e=t.cm,n=e.display;t.updatedDisplay&&Rn(e),t.barMeasure=er(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=qe(e,n.maxLine,n.maxLine.text.length).left+3,e.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+Fe(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-ze(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function hr(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft<e.doc.scrollLeft&&tr(e,Math.min(e.display.scroller.scrollLeft,t.maxScrollLeft),!0),e.display.maxLineChanged=!1);var n=t.focus&&t.focus==s();t.preparedSelection&&e.display.input.showSelection(t.preparedSelection,n),(t.updatedDisplay||t.startHeight!=e.doc.height)&&nr(e,t.barMeasure),t.updatedDisplay&&jr(e,t.barMeasure),t.selectionChanged&&Pn(e),e.state.focused&&t.updateInput&&e.display.input.reset(t.typing),n&&jn(t.cm)}function fr(t){var e=t.cm,n=e.display,r=e.doc;if(t.updatedDisplay&&Or(e,t.update),null==n.wheelStartX||null==t.scrollTop&&null==t.scrollLeft&&!t.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=t.scrollTop&&Qn(e,t.scrollTop,t.forceScroll),null!=t.scrollLeft&&tr(e,t.scrollLeft,!0,!0),t.scrollToPos){var i=Hn(e,V(r,t.scrollToPos.from),V(r,t.scrollToPos.to),t.scrollToPos.margin);Vn(e,i)}var o=t.maybeHiddenMarkers,s=t.maybeUnhiddenMarkers;if(o)for(var a=0;a<o.length;++a)o[a].lines.length||Tt(o[a],"hide");if(s)for(var l=0;l<s.length;++l)s[l].lines.length&&Tt(s[l],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=e.display.scroller.scrollTop),t.changeObjs&&Tt(e,"changes",e,t.changeObjs),t.update&&t.update.finish()}function dr(t,e){if(t.curOp)return e();or(t);try{return e()}finally{sr(t)}}function pr(t,e){return function(){if(t.curOp)return e.apply(t,arguments);or(t);try{return e.apply(t,arguments)}finally{sr(t)}}}function gr(t){return function(){if(this.curOp)return t.apply(this,arguments);or(this);try{return t.apply(this,arguments)}finally{sr(this)}}}function vr(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);or(e);try{return t.apply(this,arguments)}finally{sr(e)}}}function mr(t,e,n,r){null==e&&(e=t.doc.first),null==n&&(n=t.doc.first+t.doc.size),r||(r=0);var i=t.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>e)&&(i.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=i.viewTo)Zs&&pt(t.doc,e)<i.viewTo&&br(t);else if(n<=i.viewFrom)Zs&&gt(t.doc,n+r)>i.viewFrom?br(t):(i.viewFrom+=r,i.viewTo+=r);else if(e<=i.viewFrom&&n>=i.viewTo)br(t);else if(e<=i.viewFrom){var o=wr(t,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):br(t)}else if(n>=i.viewTo){var s=wr(t,e,e,-1);s?(i.view=i.view.slice(0,s.index),i.viewTo=s.lineN):br(t)}else{var a=wr(t,e,e,-1),l=wr(t,n,n+r,1);a&&l?(i.view=i.view.slice(0,a.index).concat(ve(t,a.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):br(t)}var c=i.externalMeasured;c&&(n<c.lineN?c.lineN+=r:e<c.lineN+c.size&&(i.externalMeasured=null))}function yr(t,e,n){t.curOp.viewChanged=!0;var r=t.display,i=t.display.externalMeasured;if(i&&e>=i.lineN&&e<i.lineN+i.size&&(r.externalMeasured=null),!(e<r.viewFrom||e>=r.viewTo)){var o=r.view[Tn(t,e)];if(null!=o.node){var s=o.changes||(o.changes=[]);f(s,n)==-1&&s.push(n)}}}function br(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function wr(t,e,n,r){var i,o=Tn(t,e),s=t.display.view;if(!Zs||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var a=t.display.viewFrom,l=0;l<o;l++)a+=s[l].size;if(a!=e){if(r>0){if(o==s.length-1)return null;i=a+s[o].size-e,o++}else i=a-e;e+=i,n+=i}for(;pt(t.doc,n)!=n;){if(o==(r<0?0:s.length-1))return null;n+=r*s[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function xr(t,e,n){var r=t.display,i=r.view;0==i.length||e>=r.viewTo||n<=r.viewFrom?(r.view=ve(t,e,n),r.viewFrom=e):(r.viewFrom>e?r.view=ve(t,e,r.viewFrom).concat(r.view):r.viewFrom<e&&(r.view=r.view.slice(Tn(t,e))),r.viewFrom=e,r.viewTo<n?r.view=r.view.concat(ve(t,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Tn(t,n)))),r.viewTo=n}function _r(t){for(var e=t.display.view,n=0,r=0;r<e.length;r++){var i=e[r];i.hidden||i.node&&!i.changes||++n}return n}function Cr(t,e){t.doc.highlightFrontier<t.display.viewTo&&t.state.highlight.set(e,c(kr,t))}function kr(t){var e=t.doc;if(!(e.highlightFrontier>=t.display.viewTo)){var n=+new Date+t.options.workTime,r=Xt(t,e.highlightFrontier),i=[];e.iter(r.line,Math.min(e.first+e.size,t.display.viewTo+500),function(o){if(r.line>=t.display.viewFrom){var s=o.styles,a=o.text.length>t.options.maxHighlightLength?qt(e.mode,r.state):null,l=Yt(t,o,r,!0);a&&(r.state=a),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var h=!s||s.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),f=0;!h&&f<s.length;++f)h=s[f]!=o.styles[f];h&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=t.options.maxHighlightLength&&Jt(t,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return Cr(t,t.options.workDelay),!0}),e.highlightFrontier=r.line,e.modeFrontier=Math.max(e.modeFrontier,r.line),i.length&&dr(t,function(){for(var e=0;e<i.length;e++)yr(t,i[e],"text")})}}function Sr(t){var e=t.display;!e.scrollbarsClipped&&e.scroller.offsetWidth&&(e.nativeBarWidth=e.scroller.offsetWidth-e.scroller.clientWidth,e.heightForcer.style.height=Fe(t)+"px",e.sizer.style.marginBottom=-e.nativeBarWidth+"px",e.sizer.style.borderRightWidth=Fe(t)+"px",e.scrollbarsClipped=!0)}function Tr(t){if(t.hasFocus())return null;var e=s();if(!e||!o(t.display.lineDiv,e))return null;var n={activeElt:e};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&o(t.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function Er(t){if(t&&t.activeElt&&t.activeElt!=s()&&(t.activeElt.focus(),t.anchorNode&&o(document.body,t.anchorNode)&&o(document.body,t.focusNode))){var e=window.getSelection(),n=document.createRange();n.setEnd(t.anchorNode,t.anchorOffset),n.collapse(!1),e.removeAllRanges(),e.addRange(n),e.extend(t.focusNode,t.focusOffset)}}function Ar(t,n){var r=t.display,i=t.doc;if(n.editorIsHidden)return br(t),!1;if(!n.force&&n.visible.from>=r.viewFrom&&n.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==_r(t))return!1;$n(t)&&(br(t),n.dims=xn(t));var o=i.first+i.size,s=Math.max(n.visible.from-t.options.viewportMargin,i.first),a=Math.min(o,n.visible.to+t.options.viewportMargin);r.viewFrom<s&&s-r.viewFrom<20&&(s=Math.max(i.first,r.viewFrom)),r.viewTo>a&&r.viewTo-a<20&&(a=Math.min(o,r.viewTo)),Zs&&(s=pt(t.doc,s),a=gt(t.doc,a));var l=s!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=n.wrapperHeight||r.lastWrapWidth!=n.wrapperWidth;xr(t,s,a),r.viewOffset=yt(E(t.doc,r.viewFrom)),t.display.mover.style.top=r.viewOffset+"px";var c=_r(t);if(!l&&0==c&&!n.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var u=Tr(t);return c>4&&(r.lineDiv.style.display="none"),Lr(t,r.updateLineNumbers,n.dims),c>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,Er(u),e(r.cursorDiv),e(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,l&&(r.lastWrapHeight=n.wrapperHeight,r.lastWrapWidth=n.wrapperWidth,Cr(t,400)),r.updateLineNumbers=null,!0}function Or(t,e){for(var n=e.viewport,r=!0;(r&&t.options.lineWrapping&&e.oldDisplayWidth!=ze(t)||(n&&null!=n.top&&(n={top:Math.min(t.doc.height+Re(t.display)-$e(t),n.top)}),e.visible=Fn(t.display,t.doc,n),!(e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)))&&Ar(t,e);r=!1){Rn(t);var i=er(t);En(t),nr(t,i),jr(t,i),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function Mr(t,e){var n=new Ta(t,e);if(Ar(t,n)){Rn(t),Or(t,n);var r=er(t);En(t),nr(t,r),jr(t,r),n.finish()}}function Lr(t,n,r){function i(e){var n=e.nextSibling;return xs&&Ls&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var o=t.display,s=t.options.lineNumbers,a=o.lineDiv,l=a.firstChild,c=o.view,u=o.viewFrom,h=0;h<c.length;h++){var d=c[h];if(d.hidden);else if(d.node&&d.node.parentNode==a){for(;l!=d.node;)l=i(l);var p=s&&null!=n&&n<=u&&d.lineNumber;d.changes&&(f(d.changes,"gutter")>-1&&(p=!1),_e(t,d,u,r)),p&&(e(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(D(t.options,u)))),l=d.node.nextSibling}else{var g=Me(t,d,u,r);a.insertBefore(g,l)}u+=d.size}for(;l;)l=i(l)}function Pr(t){var e=t.display.gutters.offsetWidth;t.display.sizer.style.marginLeft=e+"px"}function jr(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+Fe(t)+"px"}function Dr(t){var n=t.display.gutters,i=t.options.gutters;e(n);for(var o=0;o<i.length;++o){var s=i[o],a=n.appendChild(r("div",null,"CodeMirror-gutter "+s));"CodeMirror-linenumbers"==s&&(t.display.lineGutter=a,a.style.width=(t.display.lineNumWidth||1)+"px")}n.style.display=o?"":"none",Pr(t)}function Nr(t){var e=f(t.gutters,"CodeMirror-linenumbers");e==-1&&t.lineNumbers?t.gutters=t.gutters.concat(["CodeMirror-linenumbers"]):e>-1&&!t.lineNumbers&&(t.gutters=t.gutters.slice(0),t.gutters.splice(e,1))}function Ir(t){var e=t.wheelDeltaX,n=t.wheelDeltaY;return null==e&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(e=t.detail),null==n&&t.detail&&t.axis==t.VERTICAL_AXIS?n=t.detail:null==n&&(n=t.wheelDelta),{x:e,y:n}}function Rr(t){var e=Ir(t);return e.x*=Aa,e.y*=Aa,e}function Br(t,e){var n=Ir(e),r=n.x,i=n.y,o=t.display,s=o.scroller,a=s.scrollWidth>s.clientWidth,l=s.scrollHeight>s.clientHeight;if(r&&a||i&&l){if(i&&Ls&&xs)t:for(var c=e.target,u=o.view;c!=s;c=c.parentNode)for(var h=0;h<u.length;h++)if(u[h].node==c){t.display.currentWheelTarget=c;break t}if(r&&!gs&&!ks&&null!=Aa)return i&&l&&Zn(t,Math.max(0,s.scrollTop+i*Aa)),tr(t,Math.max(0,s.scrollLeft+r*Aa)),(!i||i&&l)&&Lt(e),void(o.wheelStartX=null);if(i&&null!=Aa){var f=i*Aa,d=t.doc.scrollTop,p=d+o.wrapper.clientHeight;f<0?d=Math.max(0,d+f-50):p=Math.min(t.doc.height,p+f+50),Mr(t,{top:d,bottom:p})}Ea<20&&(null==o.wheelStartX?(o.wheelStartX=s.scrollLeft,o.wheelStartY=s.scrollTop,o.wheelDX=r,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var t=s.scrollLeft-o.wheelStartX,e=s.scrollTop-o.wheelStartY,n=e&&o.wheelDY&&e/o.wheelDY||t&&o.wheelDX&&t/o.wheelDX;o.wheelStartX=o.wheelStartY=null,n&&(Aa=(Aa*Ea+n)/(Ea+1),++Ea)}},200)):(o.wheelDX+=r,o.wheelDY+=i))}}function Fr(t,e){var n=t[e];t.sort(function(t,e){return I(t.from(),e.from())}),e=f(t,n);for(var r=1;r<t.length;r++){var i=t[r],o=t[r-1];if(I(o.to(),i.from())>=0){var s=z(o.from(),i.from()),a=F(o.to(),i.to()),l=o.empty()?i.from()==i.head:o.from()==o.head;r<=e&&--e,t.splice(--r,2,new Ma(l?a:s,l?s:a))}}return new Oa(t,e)}function zr(t,e){return new Oa([new Ma(t,e||t)],0)}function $r(t){return t.text?N(t.from.line+t.text.length-1,g(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function Vr(t,e){if(I(t,e.from)<0)return t;if(I(t,e.to)<=0)return $r(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,r=t.ch;return t.line==e.to.line&&(r+=$r(e).ch-e.to.ch),N(n,r)}function Hr(t,e){for(var n=[],r=0;r<t.sel.ranges.length;r++){var i=t.sel.ranges[r];n.push(new Ma(Vr(i.anchor,e),Vr(i.head,e)))}return Fr(n,t.sel.primIndex)}function Ur(t,e,n){return t.line==e.line?N(n.line,t.ch-e.ch+n.ch):N(n.line+(t.line-e.line),t.ch)}function qr(t,e,n){for(var r=[],i=N(t.first,0),o=i,s=0;s<e.length;s++){var a=e[s],l=Ur(a.from,i,o),c=Ur($r(a),i,o);if(i=a.to,o=c,"around"==n){var u=t.sel.ranges[s],h=I(u.head,u.anchor)<0;r[s]=new Ma(h?c:l,h?l:c)}else r[s]=new Ma(l,l)}return new Oa(r,t.sel.primIndex)}function Wr(t){t.doc.mode=Ht(t.options,t.doc.modeOption),Gr(t)}function Gr(t){t.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),t.doc.modeFrontier=t.doc.highlightFrontier=t.doc.first,Cr(t,100),t.state.modeGen++,t.curOp&&mr(t)}function Yr(t,e){return 0==e.from.ch&&0==e.to.ch&&""==g(e.text)&&(!t.cm||t.cm.options.wholeLineUpdateBefore)}function Kr(t,e,n,r){function i(t){return n?n[t]:null}function o(t,n,i){oe(t,n,i,r),we(t,"change",t,e)}function s(t,e){for(var n=[],o=t;o<e;++o)n.push(new ga(c[o],i(o),r));return n}var a=e.from,l=e.to,c=e.text,u=E(t,a.line),h=E(t,l.line),f=g(c),d=i(c.length-1),p=l.line-a.line;if(e.full)t.insert(0,s(0,c.length)),t.remove(c.length,t.size-c.length);else if(Yr(t,e)){var v=s(0,c.length-1);o(h,h.text,d),p&&t.remove(a.line,p),v.length&&t.insert(a.line,v)}else if(u==h)if(1==c.length)o(u,u.text.slice(0,a.ch)+f+u.text.slice(l.ch),d);else{var m=s(1,c.length-1);m.push(new ga(f+u.text.slice(l.ch),d,r)),o(u,u.text.slice(0,a.ch)+c[0],i(0)),t.insert(a.line+1,m)}else if(1==c.length)o(u,u.text.slice(0,a.ch)+c[0]+h.text.slice(l.ch),i(0)),t.remove(a.line+1,p);else{o(u,u.text.slice(0,a.ch)+c[0],i(0)),o(h,f+h.text.slice(l.ch),d);var y=s(1,c.length-1);p>1&&t.remove(a.line+1,p-1),t.insert(a.line+1,y)}we(t,"change",t,e)}function Xr(t,e,n){function r(t,i,o){if(t.linked)for(var s=0;s<t.linked.length;++s){var a=t.linked[s];if(a.doc!=i){var l=o&&a.sharedHist;n&&!l||(e(a.doc,l),r(a.doc,t,l))}}}r(t,null,!0)}function Jr(t,e){if(e.cm)throw new Error("This document is already in use.");t.doc=e,e.cm=t,kn(t),Wr(t),Zr(t),t.options.lineWrapping||wt(t),t.options.mode=e.modeOption,mr(t)}function Zr(t){("rtl"==t.doc.direction?a:Bs)(t.display.lineDiv,"CodeMirror-rtl")}function Qr(t){dr(t,function(){Zr(t),mr(t)})}function ti(t){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=t||1}function ei(t,e){var n={from:B(e.from),to:$r(e),text:A(t,e.from,e.to)};return li(t,n,e.from.line,e.to.line+1),Xr(t,function(t){return li(t,n,e.from.line,e.to.line+1)},!0),n}function ni(t){for(;t.length;){var e=g(t);if(!e.ranges)break;t.pop()}}function ri(t,e){return e?(ni(t.done),g(t.done)):t.done.length&&!g(t.done).ranges?g(t.done):t.done.length>1&&!t.done[t.done.length-2].ranges?(t.done.pop(),g(t.done)):void 0}function ii(t,e,n,r){var i=t.history;i.undone.length=0;var o,s,a=+new Date;if((i.lastOp==r||i.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&t.cm&&i.lastModTime>a-t.cm.options.historyEventDelay||"*"==e.origin.charAt(0)))&&(o=ri(i,i.lastOp==r)))s=g(o.changes),0==I(e.from,e.to)&&0==I(e.from,s.to)?s.to=$r(e):o.changes.push(ei(t,e));else{var l=g(i.done);for(l&&l.ranges||ai(t.sel,i.done),o={changes:[ei(t,e)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=e.origin,s||Tt(t,"historyAdded")}function oi(t,e,n,r){var i=e.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function si(t,e,n,r){var i=t.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||oi(t,o,g(i.done),e))?i.done[i.done.length-1]=e:ai(e,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&ni(i.undone)}function ai(t,e){var n=g(e);n&&n.ranges&&n.equals(t)||e.push(t)}function li(t,e,n,r){var i=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,r),function(n){n.markedSpans&&((i||(i=e["spans_"+t.id]={}))[o]=n.markedSpans),++o})}function ci(t){if(!t)return null;for(var e,n=0;n<t.length;++n)t[n].marker.explicitlyCleared?e||(e=t.slice(0,n)):e&&e.push(t[n]);return e?e.length?e:null:t}function ui(t,e){var n=e["spans_"+t.id];if(!n)return null;for(var r=[],i=0;i<e.text.length;++i)r.push(ci(n[i]));return r}function hi(t,e){var n=ui(t,e),r=Q(t,e);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],s=r[i];if(o&&s)t:for(var a=0;a<s.length;++a){for(var l=s[a],c=0;c<o.length;++c)if(o[c].marker==l.marker)continue t;o.push(l)}else s&&(n[i]=s)}return n}function fi(t,e,n){for(var r=[],i=0;i<t.length;++i){var o=t[i];if(o.ranges)r.push(n?Oa.prototype.deepCopy.call(o):o);else{var s=o.changes,a=[];r.push({changes:a});for(var l=0;l<s.length;++l){var c=s[l],u=void 0;if(a.push({from:c.from,to:c.to,text:c.text}),e)for(var h in c)(u=h.match(/^spans_(\d+)$/))&&f(e,Number(u[1]))>-1&&(g(a)[h]=c[h],delete c[h])}}}return r}function di(t,e,n,r){if(r){var i=t.anchor;if(n){var o=I(e,i)<0;o!=I(n,i)<0?(i=e,e=n):o!=I(e,n)<0&&(e=n)}return new Ma(i,e)}return new Ma(n||e,e)}function pi(t,e,n,r,i){null==i&&(i=t.cm&&(t.cm.display.shift||t.extend)),wi(t,new Oa([di(t.sel.primary(),e,n,i)],0),r)}function gi(t,e,n){for(var r=[],i=t.cm&&(t.cm.display.shift||t.extend),o=0;o<t.sel.ranges.length;o++)r[o]=di(t.sel.ranges[o],e[o],null,i);var s=Fr(r,t.sel.primIndex);wi(t,s,n)}function vi(t,e,n,r){var i=t.sel.ranges.slice(0);i[e]=n,wi(t,Fr(i,t.sel.primIndex),r)}function mi(t,e,n,r){
wi(t,zr(e,n),r)}function yi(t,e,n){var r={ranges:e.ranges,update:function(e){var n=this;this.ranges=[];for(var r=0;r<e.length;r++)n.ranges[r]=new Ma(V(t,e[r].anchor),V(t,e[r].head))},origin:n&&n.origin};return Tt(t,"beforeSelectionChange",t,r),t.cm&&Tt(t.cm,"beforeSelectionChange",t.cm,r),r.ranges!=e.ranges?Fr(r.ranges,r.ranges.length-1):e}function bi(t,e,n){var r=t.history.done,i=g(r);i&&i.ranges?(r[r.length-1]=e,xi(t,e,n)):wi(t,e,n)}function wi(t,e,n){xi(t,e,n),si(t,t.sel,t.cm?t.cm.curOp.id:NaN,n)}function xi(t,e,n){(Ot(t,"beforeSelectionChange")||t.cm&&Ot(t.cm,"beforeSelectionChange"))&&(e=yi(t,e,n));var r=n&&n.bias||(I(e.primary().head,t.sel.primary().head)<0?-1:1);_i(t,ki(t,e,r,!0)),n&&n.scroll===!1||!t.cm||Gn(t.cm)}function _i(t,e){e.equals(t.sel)||(t.sel=e,t.cm&&(t.cm.curOp.updateInput=t.cm.curOp.selectionChanged=!0,At(t.cm)),we(t,"cursorActivity",t))}function Ci(t){_i(t,ki(t,t.sel,null,!1))}function ki(t,e,n,r){for(var i,o=0;o<e.ranges.length;o++){var s=e.ranges[o],a=e.ranges.length==t.sel.ranges.length&&t.sel.ranges[o],l=Ti(t,s.anchor,a&&a.anchor,n,r),c=Ti(t,s.head,a&&a.head,n,r);(i||l!=s.anchor||c!=s.head)&&(i||(i=e.ranges.slice(0,o)),i[o]=new Ma(l,c))}return i?Fr(i,e.primIndex):e}function Si(t,e,n,r,i){var o=E(t,e.line);if(o.markedSpans)for(var s=0;s<o.markedSpans.length;++s){var a=o.markedSpans[s],l=a.marker;if((null==a.from||(l.inclusiveLeft?a.from<=e.ch:a.from<e.ch))&&(null==a.to||(l.inclusiveRight?a.to>=e.ch:a.to>e.ch))){if(i&&(Tt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--s;continue}break}if(!l.atomic)continue;if(n){var c=l.find(r<0?1:-1),u=void 0;if((r<0?l.inclusiveRight:l.inclusiveLeft)&&(c=Ei(t,c,-r,c&&c.line==e.line?o:null)),c&&c.line==e.line&&(u=I(c,n))&&(r<0?u<0:u>0))return Si(t,c,e,r,i)}var h=l.find(r<0?-1:1);return(r<0?l.inclusiveLeft:l.inclusiveRight)&&(h=Ei(t,h,r,h.line==e.line?o:null)),h?Si(t,h,e,r,i):null}}return e}function Ti(t,e,n,r,i){var o=r||1,s=Si(t,e,n,o,i)||!i&&Si(t,e,n,o,!0)||Si(t,e,n,-o,i)||!i&&Si(t,e,n,-o,!0);return s?s:(t.cantEdit=!0,N(t.first,0))}function Ei(t,e,n,r){return n<0&&0==e.ch?e.line>t.first?V(t,N(e.line-1)):null:n>0&&e.ch==(r||E(t,e.line)).text.length?e.line<t.first+t.size-1?N(e.line+1,0):null:new N(e.line,e.ch+n)}function Ai(t){t.setSelection(N(t.firstLine(),0),N(t.lastLine()),qs)}function Oi(t,e,n){var r={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(e,n,i,o){e&&(r.from=V(t,e)),n&&(r.to=V(t,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),Tt(t,"beforeChange",t,r),t.cm&&Tt(t.cm,"beforeChange",t.cm,r),r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Mi(t,e,n){if(t.cm){if(!t.cm.curOp)return pr(t.cm,Mi)(t,e,n);if(t.cm.state.suppressEdits)return}if(!(Ot(t,"beforeChange")||t.cm&&Ot(t.cm,"beforeChange"))||(e=Oi(t,e,!0))){var r=Js&&!n&&et(t,e.from,e.to);if(r)for(var i=r.length-1;i>=0;--i)Li(t,{from:r[i].from,to:r[i].to,text:i?[""]:e.text,origin:e.origin});else Li(t,e)}}function Li(t,e){if(1!=e.text.length||""!=e.text[0]||0!=I(e.from,e.to)){var n=Hr(t,e);ii(t,e,n,t.cm?t.cm.curOp.id:NaN),Di(t,e,n,Q(t,e));var r=[];Xr(t,function(t,n){n||f(r,t.history)!=-1||(Fi(t.history,e),r.push(t.history)),Di(t,e,null,Q(t,e))})}}function Pi(t,e,n){if(!t.cm||!t.cm.state.suppressEdits||n){for(var r,i=t.history,o=t.sel,s="undo"==e?i.done:i.undone,a="undo"==e?i.undone:i.done,l=0;l<s.length&&(r=s[l],n?!r.ranges||r.equals(t.sel):r.ranges);l++);if(l!=s.length){for(i.lastOrigin=i.lastSelOrigin=null;r=s.pop(),r.ranges;){if(ai(r,a),n&&!r.equals(t.sel))return void wi(t,r,{clearRedo:!1});o=r}var c=[];ai(o,a),a.push({changes:c,generation:i.generation}),i.generation=r.generation||++i.maxGeneration;for(var u=Ot(t,"beforeChange")||t.cm&&Ot(t.cm,"beforeChange"),h=function(n){var i=r.changes[n];if(i.origin=e,u&&!Oi(t,i,!1))return s.length=0,{};c.push(ei(t,i));var o=n?Hr(t,i):g(s);Di(t,i,o,hi(t,i)),!n&&t.cm&&t.cm.scrollIntoView({from:i.from,to:$r(i)});var a=[];Xr(t,function(t,e){e||f(a,t.history)!=-1||(Fi(t.history,i),a.push(t.history)),Di(t,i,null,hi(t,i))})},d=r.changes.length-1;d>=0;--d){var p=h(d);if(p)return p.v}}}}function ji(t,e){if(0!=e&&(t.first+=e,t.sel=new Oa(v(t.sel.ranges,function(t){return new Ma(N(t.anchor.line+e,t.anchor.ch),N(t.head.line+e,t.head.ch))}),t.sel.primIndex),t.cm)){mr(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,r=n.viewFrom;r<n.viewTo;r++)yr(t.cm,r,"gutter")}}function Di(t,e,n,r){if(t.cm&&!t.cm.curOp)return pr(t.cm,Di)(t,e,n,r);if(e.to.line<t.first)return void ji(t,e.text.length-1-(e.to.line-e.from.line));if(!(e.from.line>t.lastLine())){if(e.from.line<t.first){var i=e.text.length-1-(t.first-e.from.line);ji(t,i),e={from:N(t.first,0),to:N(e.to.line+i,e.to.ch),text:[g(e.text)],origin:e.origin}}var o=t.lastLine();e.to.line>o&&(e={from:e.from,to:N(o,E(t,o).text.length),text:[e.text[0]],origin:e.origin}),e.removed=A(t,e.from,e.to),n||(n=Hr(t,e)),t.cm?Ni(t.cm,e,r):Kr(t,e,r),xi(t,n,qs)}}function Ni(t,e,n){var r=t.doc,i=t.display,o=e.from,s=e.to,a=!1,l=o.line;t.options.lineWrapping||(l=L(ht(E(r,o.line))),r.iter(l,s.line+1,function(t){if(t==i.maxLine)return a=!0,!0})),r.sel.contains(e.from,e.to)>-1&&At(t),Kr(r,e,n,Cn(t)),t.options.lineWrapping||(r.iter(l,o.line+e.text.length,function(t){var e=bt(t);e>i.maxLineLength&&(i.maxLine=t,i.maxLineLength=e,i.maxLineChanged=!0,a=!1)}),a&&(t.curOp.updateMaxLine=!0)),ie(r,o.line),Cr(t,400);var c=e.text.length-(s.line-o.line)-1;e.full?mr(t):o.line!=s.line||1!=e.text.length||Yr(t.doc,e)?mr(t,o.line,s.line+1,c):yr(t,o.line,"text");var u=Ot(t,"changes"),h=Ot(t,"change");if(h||u){var f={from:o,to:s,text:e.text,removed:e.removed,origin:e.origin};h&&we(t,"change",t,f),u&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(f)}t.display.selForContextMenu=null}function Ii(t,e,n,r,i){if(r||(r=n),I(r,n)<0){var o;o=[r,n],n=o[0],r=o[1],o}"string"==typeof e&&(e=t.splitLines(e)),Mi(t,{from:n,to:r,text:e,origin:i})}function Ri(t,e,n,r){n<t.line?t.line+=r:e<t.line&&(t.line=e,t.ch=0)}function Bi(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i],s=!0;if(o.ranges){o.copied||(o=t[i]=o.deepCopy(),o.copied=!0);for(var a=0;a<o.ranges.length;a++)Ri(o.ranges[a].anchor,e,n,r),Ri(o.ranges[a].head,e,n,r)}else{for(var l=0;l<o.changes.length;++l){var c=o.changes[l];if(n<c.from.line)c.from=N(c.from.line+r,c.from.ch),c.to=N(c.to.line+r,c.to.ch);else if(e<=c.to.line){s=!1;break}}s||(t.splice(0,i+1),i=0)}}}function Fi(t,e){var n=e.from.line,r=e.to.line,i=e.text.length-(r-n)-1;Bi(t.done,n,r,i),Bi(t.undone,n,r,i)}function zi(t,e,n,r){var i=e,o=e;return"number"==typeof e?o=E(t,$(t,e)):i=L(e),null==i?null:(r(o,i)&&t.cm&&yr(t.cm,i,n),o)}function $i(t){var e=this;this.lines=t,this.parent=null;for(var n=0,r=0;r<t.length;++r)t[r].parent=e,n+=t[r].height;this.height=n}function Vi(t){var e=this;this.children=t;for(var n=0,r=0,i=0;i<t.length;++i){var o=t[i];n+=o.chunkSize(),r+=o.height,o.parent=e}this.size=n,this.height=r,this.parent=null}function Hi(t,e,n){yt(e)<(t.curOp&&t.curOp.scrollTop||t.doc.scrollTop)&&Wn(t,n)}function Ui(t,e,n,r){var i=new La(t,n,r),o=t.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),zi(t,e,"widget",function(e){var n=e.widgets||(e.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=e,o&&!vt(t,e)){var r=yt(e)<t.scrollTop;M(e,e.height+De(i)),r&&Wn(o,i.height),o.curOp.forceUpdate=!0}return!0}),we(o,"lineWidgetAdded",o,i,"number"==typeof e?e:L(e)),i}function qi(t,e,n,r,o){if(r&&r.shared)return Wi(t,e,n,r,o);if(t.cm&&!t.cm.curOp)return pr(t.cm,qi)(t,e,n,r,o);var s=new ja(t,o),a=I(e,n);if(r&&u(r,s,!1),a>0||0==a&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=i("span",[s.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(ut(t,e.line,e,n,s)||e.line!=n.line&&ut(t,n.line,e,n,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");W()}s.addToHistory&&ii(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var l,c=e.line,h=t.cm;if(t.iter(c,n.line+1,function(t){h&&s.collapsed&&!h.options.lineWrapping&&ht(t)==h.display.maxLine&&(l=!0),s.collapsed&&c!=e.line&&M(t,0),X(t,new G(s,c==e.line?e.ch:null,c==n.line?n.ch:null)),++c}),s.collapsed&&t.iter(e.line,n.line+1,function(e){vt(t,e)&&M(e,0)}),s.clearOnEnter&&na(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(q(),(t.history.done.length||t.history.undone.length)&&t.clearHistory()),s.collapsed&&(s.id=++Pa,s.atomic=!0),h){if(l&&(h.curOp.updateMaxLine=!0),s.collapsed)mr(h,e.line,n.line+1);else if(s.className||s.title||s.startStyle||s.endStyle||s.css)for(var f=e.line;f<=n.line;f++)yr(h,f,"text");s.atomic&&Ci(h.doc),we(h,"markerAdded",h,s)}return s}function Wi(t,e,n,r,i){r=u(r),r.shared=!1;var o=[qi(t,e,n,r,i)],s=o[0],a=r.widgetNode;return Xr(t,function(t){a&&(r.widgetNode=a.cloneNode(!0)),o.push(qi(t,V(t,e),V(t,n),r,i));for(var l=0;l<t.linked.length;++l)if(t.linked[l].isParent)return;s=g(o)}),new Da(o,s)}function Gi(t){return t.findMarks(N(t.first,0),t.clipPos(N(t.lastLine())),function(t){return t.parent})}function Yi(t,e){for(var n=0;n<e.length;n++){var r=e[n],i=r.find(),o=t.clipPos(i.from),s=t.clipPos(i.to);if(I(o,s)){var a=qi(t,o,s,r.primary,r.primary.type);r.markers.push(a),a.parent=r}}}function Ki(t){for(var e=function(e){var n=t[e],r=[n.primary.doc];Xr(n.primary.doc,function(t){return r.push(t)});for(var i=0;i<n.markers.length;i++){var o=n.markers[i];f(r,o.doc)==-1&&(o.parent=null,n.markers.splice(i--,1))}},n=0;n<t.length;n++)e(n)}function Xi(t){var e=this;if(Qi(e),!Et(e,t)&&!Ne(e.display,t)){Lt(t),bs&&(Ra=+new Date);var n=Sn(e,t,!0),r=t.dataTransfer.files;if(n&&!e.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),s=0,a=function(t,r){if(!e.options.allowDropFileTypes||f(e.options.allowDropFileTypes,t.type)!=-1){var a=new FileReader;a.onload=pr(e,function(){var t=a.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(t)&&(t=""),o[r]=t,++s==i){n=V(e.doc,n);var l={from:n,to:n,text:e.doc.splitLines(o.join(e.doc.lineSeparator())),origin:"paste"};Mi(e.doc,l),bi(e.doc,zr(n,$r(l)))}}),a.readAsText(t)}},l=0;l<i;++l)a(r[l],l);else{if(e.state.draggingText&&e.doc.sel.contains(n)>-1)return e.state.draggingText(t),void setTimeout(function(){return e.display.input.focus()},20);try{var c=t.dataTransfer.getData("Text");if(c){var u;if(e.state.draggingText&&!e.state.draggingText.copy&&(u=e.listSelections()),xi(e.doc,zr(n,n)),u)for(var h=0;h<u.length;++h)Ii(e.doc,"",u[h].anchor,u[h].head,"drag");e.replaceSelection(c,"around","paste"),e.display.input.focus()}}catch(t){}}}}function Ji(t,e){if(bs&&(!t.state.draggingText||+new Date-Ra<100))return void Dt(e);if(!Et(t,e)&&!Ne(t.display,e)&&(e.dataTransfer.setData("Text",t.getSelection()),e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setDragImage&&!Ss)){var n=r("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",ks&&(n.width=n.height=1,t.display.wrapper.appendChild(n),n._top=n.offsetTop),e.dataTransfer.setDragImage(n,0,0),ks&&n.parentNode.removeChild(n)}}function Zi(t,e){var i=Sn(t,e);if(i){var o=document.createDocumentFragment();On(t,i,o),t.display.dragCursor||(t.display.dragCursor=r("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),n(t.display.dragCursor,o)}}function Qi(t){t.display.dragCursor&&(t.display.lineSpace.removeChild(t.display.dragCursor),t.display.dragCursor=null)}function to(t){if(document.getElementsByClassName)for(var e=document.getElementsByClassName("CodeMirror"),n=0;n<e.length;n++){var r=e[n].CodeMirror;r&&t(r)}}function eo(){Ba||(no(),Ba=!0)}function no(){var t;na(window,"resize",function(){null==t&&(t=setTimeout(function(){t=null,to(ro)},100))}),na(window,"blur",function(){return to(In)})}function ro(t){var e=t.display;e.lastWrapHeight==e.wrapper.clientHeight&&e.lastWrapWidth==e.wrapper.clientWidth||(e.cachedCharWidth=e.cachedTextHeight=e.cachedPaddingH=null,e.scrollbarsClipped=!1,t.setSize())}function io(t){var e=t.split(/-(?!$)/);t=e[e.length-1];for(var n,r,i,o,s=0;s<e.length-1;s++){var a=e[s];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))n=!0;else if(/^(c|ctrl|control)$/i.test(a))r=!0;else{if(!/^s(hift)?$/i.test(a))throw new Error("Unrecognized modifier name: "+a);i=!0}}return n&&(t="Alt-"+t),r&&(t="Ctrl-"+t),o&&(t="Cmd-"+t),i&&(t="Shift-"+t),t}function oo(t){var e={};for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete t[n];continue}for(var i=v(n.split(" "),io),o=0;o<i.length;o++){var s=void 0,a=void 0;o==i.length-1?(a=i.join(" "),s=r):(a=i.slice(0,o+1).join(" "),s="...");var l=e[a];if(l){if(l!=s)throw new Error("Inconsistent bindings for "+a)}else e[a]=s}delete t[n]}for(var c in e)t[c]=e[c];return t}function so(t,e,n,r){e=uo(e);var i=e.call?e.call(t,r):e[t];if(i===!1)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(e.fallthrough){if("[object Array]"!=Object.prototype.toString.call(e.fallthrough))return so(t,e.fallthrough,n,r);for(var o=0;o<e.fallthrough.length;o++){var s=so(t,e.fallthrough[o],n,r);if(s)return s}}}function ao(t){var e="string"==typeof t?t:Fa[t.keyCode];return"Ctrl"==e||"Alt"==e||"Shift"==e||"Mod"==e}function lo(t,e,n){var r=t;return e.altKey&&"Alt"!=r&&(t="Alt-"+t),(Is?e.metaKey:e.ctrlKey)&&"Ctrl"!=r&&(t="Ctrl-"+t),(Is?e.ctrlKey:e.metaKey)&&"Cmd"!=r&&(t="Cmd-"+t),!n&&e.shiftKey&&"Shift"!=r&&(t="Shift-"+t),t}function co(t,e){if(ks&&34==t.keyCode&&t["char"])return!1;var n=Fa[t.keyCode];return null!=n&&!t.altGraphKey&&lo(n,t,e)}function uo(t){return"string"==typeof t?Ha[t]:t}function ho(t,e){for(var n=t.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=e(n[i]);r.length&&I(o.from,g(r).to)<=0;){var s=r.pop();if(I(s.from,o.from)<0){o.from=s.from;break}}r.push(o)}dr(t,function(){for(var e=r.length-1;e>=0;e--)Ii(t.doc,"",r[e].from,r[e].to,"+delete");Gn(t)})}function fo(t,e,n){var r=k(t.text,e+n,n);return r<0||r>t.text.length?null:r}function po(t,e,n){var r=fo(t,e.ch,n);return null==r?null:new N(e.line,r,n<0?"after":"before")}function go(t,e,n,r,i){if(t){var o=Ct(n,e.doc.direction);if(o){var s,a=i<0?g(o):o[0],l=i<0==(1==a.level),c=l?"after":"before";if(a.level>0||"rtl"==e.doc.direction){var u=Ge(e,n);s=i<0?n.text.length-1:0;var h=Ye(e,u,s).top;s=S(function(t){return Ye(e,u,t).top==h},i<0==(1==a.level)?a.from:a.to-1,s),"before"==c&&(s=fo(n,s,1))}else s=i<0?a.to:a.from;return new N(r,s,c)}}return new N(r,i<0?n.text.length:0,i<0?"before":"after")}function vo(t,e,n,r){var i=Ct(e,t.doc.direction);if(!i)return po(e,n,r);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=_t(i,n.ch,n.sticky),s=i[o];if("ltr"==t.doc.direction&&s.level%2==0&&(r>0?s.to>n.ch:s.from<n.ch))return po(e,n,r);var a,l=function(t,n){return fo(e,t instanceof N?t.ch:t,n)},c=function(n){return t.options.lineWrapping?(a=a||Ge(t,e),pn(t,e,a,n)):{begin:0,end:e.text.length}},u=c("before"==n.sticky?l(n,-1):n.ch);if("rtl"==t.doc.direction||1==s.level){var h=1==s.level==r<0,f=l(n,h?1:-1);if(null!=f&&(h?f<=s.to&&f<=u.end:f>=s.from&&f>=u.begin)){var d=h?"before":"after";return new N(n.line,f,d)}}var p=function(t,e,r){for(var o=function(t,e){return e?new N(n.line,l(t,1),"before"):new N(n.line,t,"after")};t>=0&&t<i.length;t+=e){var s=i[t],a=e>0==(1!=s.level),c=a?r.begin:l(r.end,-1);if(s.from<=c&&c<s.to)return o(c,a);if(c=a?s.from:l(s.to,-1),r.begin<=c&&c<r.end)return o(c,a)}},g=p(o+r,r,u);if(g)return g;var v=r>0?u.end:l(u.begin,-1);return null==v||r>0&&v==e.text.length||!(g=p(r>0?0:i.length-1,r,c(v)))?null:g}function mo(t,e){var n=E(t.doc,e),r=ht(n);return r!=n&&(e=L(r)),go(!0,t,r,e,1)}function yo(t,e){var n=E(t.doc,e),r=ft(n);return r!=n&&(e=L(r)),go(!0,t,n,e,-1)}function bo(t,e){var n=mo(t,e.line),r=E(t.doc,n.line),i=Ct(r,t.doc.direction);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),s=e.line==n.line&&e.ch<=o&&e.ch;return N(n.line,s?0:o,n.sticky)}return n}function wo(t,e,n){if("string"==typeof e&&(e=Ua[e],!e))return!1;t.display.input.ensurePolled();var r=t.display.shift,i=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),n&&(t.display.shift=!1),i=e(t)!=Us}finally{t.display.shift=r,t.state.suppressEdits=!1}return i}function xo(t,e,n){for(var r=0;r<t.state.keyMaps.length;r++){var i=so(e,t.state.keyMaps[r],n,t);if(i)return i}return t.options.extraKeys&&so(e,t.options.extraKeys,n,t)||so(e,t.options.keyMap,n,t)}function _o(t,e,n,r){var i=t.state.keySeq;if(i){if(ao(e))return"handled";qa.set(50,function(){t.state.keySeq==i&&(t.state.keySeq=null,t.display.input.reset())}),e=i+" "+e}var o=xo(t,e,r);return"multi"==o&&(t.state.keySeq=e),"handled"==o&&we(t,"keyHandled",t,e,n),"handled"!=o&&"multi"!=o||(Lt(n),Pn(t)),i&&!o&&/\'$/.test(e)?(Lt(n),!0):!!o}function Co(t,e){var n=co(e,!0);return!!n&&(e.shiftKey&&!t.state.keySeq?_o(t,"Shift-"+n,e,function(e){return wo(t,e,!0)})||_o(t,n,e,function(e){if("string"==typeof e?/^go[A-Z]/.test(e):e.motion)return wo(t,e)}):_o(t,n,e,function(e){return wo(t,e)}))}function ko(t,e,n){return _o(t,"'"+n+"'",e,function(e){return wo(t,e,!0)})}function So(t){var e=this;if(e.curOp.focus=s(),!Et(e,t)){bs&&ws<11&&27==t.keyCode&&(t.returnValue=!1);var n=t.keyCode;e.display.shift=16==n||t.shiftKey;var r=Co(e,t);ks&&(Wa=r?n:null,!r&&88==n&&!sa&&(Ls?t.metaKey:t.ctrlKey)&&e.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)||To(e)}}function To(t){function e(t){18!=t.keyCode&&t.altKey||(Bs(n,"CodeMirror-crosshair"),St(document,"keyup",e),St(document,"mouseover",e))}var n=t.display.lineDiv;a(n,"CodeMirror-crosshair"),na(document,"keyup",e),na(document,"mouseover",e)}function Eo(t){16==t.keyCode&&(this.doc.sel.shift=!1),Et(this,t)}function Ao(t){var e=this;if(!(Ne(e.display,t)||Et(e,t)||t.ctrlKey&&!t.altKey||Ls&&t.metaKey)){var n=t.keyCode,r=t.charCode;if(ks&&n==Wa)return Wa=null,void Lt(t);if(!ks||t.which&&!(t.which<10)||!Co(e,t)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(ko(e,t,i)||e.display.input.onKeyPress(t))}}}function Oo(t,e){var n=+new Date;return Xa&&Xa.compare(n,t,e)?(Ka=Xa=null,"triple"):Ka&&Ka.compare(n,t,e)?(Xa=new Ya(n,t,e),Ka=null,"double"):(Ka=new Ya(n,t,e),Xa=null,"single")}function Mo(t){var e=this,n=e.display;if(!(Et(e,t)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=t.shiftKey,Ne(n,t))return void(xs||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100)));if(!Fo(e,t)){var r=Sn(e,t),i=It(t),o=r?Oo(r,i):"single";window.focus(),1==i&&e.state.selectingText&&e.state.selectingText(t),r&&Lo(e,i,r,o,t)||(1==i?r?jo(e,r,o,t):Nt(t)==n.scroller&&Lt(t):2==i?(r&&pi(e.doc,r),setTimeout(function(){return n.input.focus()},20)):3==i&&(Rs?zo(e,t):Dn(e)))}}}function Lo(t,e,n,r,i){var o="Click";return"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o),o=(1==e?"Left":2==e?"Middle":"Right")+o,_o(t,lo(o,i),i,function(e){if("string"==typeof e&&(e=Ua[e]),!e)return!1;var r=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),r=e(t,n)!=Us}finally{t.state.suppressEdits=!1}return r})}function Po(t,e,n){var r=t.getOption("configureMouse"),i=r?r(t,e,n):{};if(null==i.unit){var o=Ps?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==e?"char":"double"==e?"word":"line"}return(null==i.extend||t.doc.extend)&&(i.extend=t.doc.extend||n.shiftKey),null==i.addNew&&(i.addNew=Ls?n.metaKey:n.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(Ls?n.altKey:n.ctrlKey)),i}function jo(t,e,n,r){bs?setTimeout(c(jn,t),0):t.curOp.focus=s();var i,o=Po(t,n,r),a=t.doc.sel;t.options.dragDrop&&ra&&!t.isReadOnly()&&"single"==n&&(i=a.contains(e))>-1&&(I((i=a.ranges[i]).from(),e)<0||e.xRel>0)&&(I(i.to(),e)>0||e.xRel<0)?Do(t,r,e,o):Io(t,r,e,o)}function Do(t,e,n,r){var i=t.display,o=!1,s=pr(t,function(e){xs&&(i.scroller.draggable=!1),t.state.draggingText=!1,St(document,"mouseup",s),St(document,"mousemove",a),St(i.scroller,"dragstart",l),St(i.scroller,"drop",s),o||(Lt(e),r.addNew||pi(t.doc,n,null,null,r.extend),xs||bs&&9==ws?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())}),a=function(t){o=o||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},l=function(){return o=!0};xs&&(i.scroller.draggable=!0),t.state.draggingText=s,s.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),na(document,"mouseup",s),na(document,"mousemove",a),na(i.scroller,"dragstart",l),na(i.scroller,"drop",s),Dn(t),setTimeout(function(){return i.input.focus()},20)}function No(t,e,n){if("char"==n)return new Ma(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new Ma(N(e.line,0),V(t.doc,N(e.line+1,0)));var r=n(t,e);return new Ma(r.from,r.to)}function Io(t,e,n,r){function i(e){if(0!=I(m,e))if(m=e,"rectangle"==r.unit){for(var i=[],o=t.options.tabSize,s=h(E(c,n.line).text,n.ch,o),a=h(E(c,e.line).text,e.ch,o),l=Math.min(s,a),g=Math.max(s,a),v=Math.min(n.line,e.line),y=Math.min(t.lastLine(),Math.max(n.line,e.line));v<=y;v++){var b=E(c,v).text,w=d(b,l,o);l==g?i.push(new Ma(N(v,w),N(v,w))):b.length>w&&i.push(new Ma(N(v,w),N(v,d(b,g,o))))}i.length||i.push(new Ma(n,n)),wi(c,Fr(p.ranges.slice(0,f).concat(i),f),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var x,_=u,C=No(t,e,r.unit),k=_.anchor;I(C.anchor,k)>0?(x=C.head,k=z(_.from(),C.anchor)):(x=C.anchor,k=F(_.to(),C.head));var S=p.ranges.slice(0);S[f]=Ro(t,new Ma(V(c,k),x)),wi(c,Fr(S,f),Ws)}}function o(e){var n=++b,a=Sn(t,e,!0,"rectangle"==r.unit);if(a)if(0!=I(a,m)){t.curOp.focus=s(),i(a);var u=Fn(l,c);(a.line>=u.to||a.line<u.from)&&setTimeout(pr(t,function(){b==n&&o(e)}),150)}else{var h=e.clientY<y.top?-20:e.clientY>y.bottom?20:0;h&&setTimeout(pr(t,function(){b==n&&(l.scroller.scrollTop+=h,o(e))}),50)}}function a(e){t.state.selectingText=!1,b=1/0,Lt(e),l.input.focus(),St(document,"mousemove",w),St(document,"mouseup",x),c.history.lastSelOrigin=null}var l=t.display,c=t.doc;Lt(e);var u,f,p=c.sel,g=p.ranges;if(r.addNew&&!r.extend?(f=c.sel.contains(n),u=f>-1?g[f]:new Ma(n,n)):(u=c.sel.primary(),f=c.sel.primIndex),"rectangle"==r.unit)r.addNew||(u=new Ma(n,n)),n=Sn(t,e,!0,!0),f=-1;else{var v=No(t,n,r.unit);u=r.extend?di(u,v.anchor,v.head,r.extend):v}r.addNew?f==-1?(f=g.length,wi(c,Fr(g.concat([u]),f),{scroll:!1,origin:"*mouse"})):g.length>1&&g[f].empty()&&"char"==r.unit&&!r.extend?(wi(c,Fr(g.slice(0,f).concat(g.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),p=c.sel):vi(c,f,u,Ws):(f=0,wi(c,new Oa([u],0),Ws),p=c.sel);var m=n,y=l.wrapper.getBoundingClientRect(),b=0,w=pr(t,function(t){It(t)?o(t):a(t)}),x=pr(t,a);t.state.selectingText=x,na(document,"mousemove",w),na(document,"mouseup",x)}function Ro(t,e){var n=e.anchor,r=e.head,i=E(t.doc,n.line);if(0==I(n,r)&&n.sticky==r.sticky)return e;var o=Ct(i);if(!o)return e;var s=_t(o,n.ch,n.sticky),a=o[s];if(a.from!=n.ch&&a.to!=n.ch)return e;var l=s+(a.from==n.ch==(1!=a.level)?0:1);if(0==l||l==o.length)return e;var c;if(r.line!=n.line)c=(r.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var u=_t(o,r.ch,r.sticky),h=u-s||(r.ch-n.ch)*(1==a.level?-1:1);c=u==l-1||u==l?h<0:h>0}var f=o[l+(c?-1:0)],d=c==(1==f.level),p=d?f.from:f.to,g=d?"after":"before";return n.ch==p&&n.sticky==g?e:new Ma(new N(n.line,p,g),r)}function Bo(t,e,n,r){var i,o;if(e.touches)i=e.touches[0].clientX,o=e.touches[0].clientY;else try{i=e.clientX,o=e.clientY}catch(e){return!1}if(i>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;r&&Lt(e);var s=t.display,a=s.lineDiv.getBoundingClientRect();if(o>a.bottom||!Ot(t,n))return jt(e);o-=a.top-s.viewOffset;for(var l=0;l<t.options.gutters.length;++l){var c=s.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=i){var u=P(t.doc,o),h=t.options.gutters[l];return Tt(t,n,t,u,h,e),jt(e)}}}function Fo(t,e){return Bo(t,e,"gutterClick",!0)}function zo(t,e){Ne(t.display,e)||$o(t,e)||Et(t,e,"contextmenu")||t.display.input.onContextMenu(e)}function $o(t,e){return!!Ot(t,"gutterContextMenu")&&Bo(t,e,"gutterContextMenu",!1)}function Vo(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),en(t)}function Ho(t){function e(e,r,i,o){t.defaults[e]=r,i&&(n[e]=o?function(t,e,n){n!=Ja&&i(t,e,n)}:i)}var n=t.optionHandlers;t.defineOption=e,t.Init=Ja,e("value","",function(t,e){return t.setValue(e)},!0),e("mode",null,function(t,e){t.doc.modeOption=e,Wr(t)},!0),e("indentUnit",2,Wr,!0),e("indentWithTabs",!1),e("smartIndent",!0),e("tabSize",4,function(t){Gr(t),en(t),mr(t)},!0),e("lineSeparator",null,function(t,e){if(t.doc.lineSep=e,e){var n=[],r=t.doc.first;t.doc.iter(function(t){for(var i=0;;){var o=t.text.indexOf(e,i);if(o==-1)break;i=o+e.length,n.push(N(r,o))}r++});for(var i=n.length-1;i>=0;i--)Ii(t.doc,e,n[i],N(n[i].line,n[i].ch+e.length))}}),e("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=Ja&&t.refresh()}),e("specialCharPlaceholder",ce,function(t){return t.refresh()},!0),e("electricChars",!0),e("inputStyle",Ms?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),e("spellcheck",!1,function(t,e){return t.getInputField().spellcheck=e},!0),e("rtlMoveVisually",!js),e("wholeLineUpdateBefore",!0),e("theme","default",function(t){Vo(t),Uo(t)},!0),e("keyMap","default",function(t,e,n){var r=uo(e),i=n!=Ja&&uo(n);i&&i.detach&&i.detach(t,r),r.attach&&r.attach(t,i||null)}),e("extraKeys",null),e("configureMouse",null),e("lineWrapping",!1,Wo,!0),e("gutters",[],function(t){Nr(t.options),Uo(t)},!0),e("fixedGutter",!0,function(t,e){t.display.gutters.style.left=e?_n(t.display)+"px":"0",t.refresh()},!0),e("coverGutterNextToScrollbar",!1,function(t){return nr(t)},!0),e("scrollbarStyle","native",function(t){ir(t),nr(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)},!0),e("lineNumbers",!1,function(t){Nr(t.options),Uo(t)},!0),e("firstLineNumber",1,Uo,!0),e("lineNumberFormatter",function(t){return t},Uo,!0),e("showCursorWhenSelecting",!1,En,!0),e("resetSelectionOnContextMenu",!0),e("lineWiseCopyCut",!0),e("pasteLinesPerSelection",!0),e("readOnly",!1,function(t,e){"nocursor"==e&&(In(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)}),e("disableInput",!1,function(t,e){e||t.display.input.reset()},!0),e("dragDrop",!0,qo),e("allowDropFileTypes",null),e("cursorBlinkRate",530),e("cursorScrollMargin",0),e("cursorHeight",1,En,!0),e("singleCursorHeightPerLine",!0,En,!0),e("workTime",100),e("workDelay",100),e("flattenSpans",!0,Gr,!0),e("addModeClass",!1,Gr,!0),e("pollInterval",100),e("undoDepth",200,function(t,e){return t.doc.history.undoDepth=e}),e("historyEventDelay",1250),e("viewportMargin",10,function(t){return t.refresh()},!0),e("maxHighlightLength",1e4,Gr,!0),e("moveInputWithCursor",!0,function(t,e){e||t.display.input.resetPosition()}),e("tabindex",null,function(t,e){return t.display.input.getField().tabIndex=e||""}),e("autofocus",null),e("direction","ltr",function(t,e){return t.doc.setDirection(e)},!0)}function Uo(t){Dr(t),mr(t),zn(t)}function qo(t,e,n){var r=n&&n!=Ja;if(!e!=!r){var i=t.display.dragFunctions,o=e?na:St;o(t.display.scroller,"dragstart",i.start),o(t.display.scroller,"dragenter",i.enter),o(t.display.scroller,"dragover",i.over),o(t.display.scroller,"dragleave",i.leave),o(t.display.scroller,"drop",i.drop)}}function Wo(t){t.options.lineWrapping?(a(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(Bs(t.display.wrapper,"CodeMirror-wrap"),wt(t)),kn(t),mr(t),en(t),setTimeout(function(){return nr(t)},100)}function Go(t,e){var n=this;if(!(this instanceof Go))return new Go(t,e);this.options=e=e?u(e):{},u(Za,e,!1),Nr(e);var r=e.value;"string"==typeof r&&(r=new Ia(r,e.mode,null,e.lineSeparator,e.direction)),this.doc=r;var i=new Go.inputStyles[e.inputStyle](this),o=this.display=new T(t,r,i);o.wrapper.CodeMirror=this,Dr(this),Vo(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ir(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 zs,keySeq:null,specialChars:null},e.autofocus&&!Ms&&o.input.focus(),bs&&ws<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Yo(this),eo(),or(this),this.curOp.forceUpdate=!0,Jr(this,r),e.autofocus&&!Ms||this.hasFocus()?setTimeout(c(Nn,this),20):In(this);for(var s in Qa)Qa.hasOwnProperty(s)&&Qa[s](n,e[s],Ja);$n(this),e.finishInit&&e.finishInit(this);for(var a=0;a<tl.length;++a)tl[a](n);sr(this),xs&&e.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function Yo(t){function e(){i.activeTouch&&(o=setTimeout(function(){return i.activeTouch=null},1e3),s=i.activeTouch,s.end=+new Date)}function n(t){if(1!=t.touches.length)return!1;var e=t.touches[0];return e.radiusX<=1&&e.radiusY<=1}function r(t,e){if(null==e.left)return!0;var n=e.left-t.left,r=e.top-t.top;return n*n+r*r>400}var i=t.display;na(i.scroller,"mousedown",pr(t,Mo)),bs&&ws<11?na(i.scroller,"dblclick",pr(t,function(e){if(!Et(t,e)){var n=Sn(t,e);if(n&&!Fo(t,e)&&!Ne(t.display,e)){Lt(e);var r=t.findWordAt(n);pi(t.doc,r.anchor,r.head)}}})):na(i.scroller,"dblclick",function(e){return Et(t,e)||Lt(e)}),Rs||na(i.scroller,"contextmenu",function(e){return zo(t,e)});var o,s={end:0};na(i.scroller,"touchstart",function(e){if(!Et(t,e)&&!n(e)&&!Fo(t,e)){i.input.ensurePolled(),clearTimeout(o);var r=+new Date;i.activeTouch={start:r,moved:!1,prev:r-s.end<=300?s:null},1==e.touches.length&&(i.activeTouch.left=e.touches[0].pageX,i.activeTouch.top=e.touches[0].pageY)}}),na(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),na(i.scroller,"touchend",function(n){var o=i.activeTouch;if(o&&!Ne(i,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var s,a=t.coordsChar(i.activeTouch,"page");s=!o.prev||r(o,o.prev)?new Ma(a,a):!o.prev.prev||r(o,o.prev.prev)?t.findWordAt(a):new Ma(N(a.line,0),V(t.doc,N(a.line+1,0))),t.setSelection(s.anchor,s.head),t.focus(),Lt(n)}e()}),na(i.scroller,"touchcancel",e),na(i.scroller,"scroll",function(){i.scroller.clientHeight&&(Zn(t,i.scroller.scrollTop),tr(t,i.scroller.scrollLeft,!0),Tt(t,"scroll",t))}),na(i.scroller,"mousewheel",function(e){return Br(t,e)}),na(i.scroller,"DOMMouseScroll",function(e){return Br(t,e)}),na(i.wrapper,"scroll",function(){return i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(e){Et(t,e)||Dt(e)},over:function(e){Et(t,e)||(Zi(t,e),Dt(e))},start:function(e){return Ji(t,e)},drop:pr(t,Xi),leave:function(e){Et(t,e)||Qi(t)}};var a=i.input.getField();na(a,"keyup",function(e){return Eo.call(t,e)}),na(a,"keydown",pr(t,So)),na(a,"keypress",pr(t,Ao)),na(a,"focus",function(e){return Nn(t,e)}),na(a,"blur",function(e){return In(t,e)})}function Ko(t,e,n,r){var i,o=t.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=Xt(t,e).state:n="prev");var s=t.options.tabSize,a=E(o,e),l=h(a.text,null,s);a.stateAfter&&(a.stateAfter=null);var c,u=a.text.match(/^\s*/)[0];if(r||/\S/.test(a.text)){if("smart"==n&&(c=o.mode.indent(i,a.text.slice(u.length),a.text),c==Us||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=e>o.first?h(E(o,e-1).text,null,s):0:"add"==n?c=l+t.options.indentUnit:"subtract"==n?c=l-t.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var f="",d=0;if(t.options.indentWithTabs)for(var g=Math.floor(c/s);g;--g)d+=s,f+="\t";if(d<c&&(f+=p(c-d)),f!=u)return Ii(o,f,N(e,0),N(e,u.length),"+input"),a.stateAfter=null,!0;for(var v=0;v<o.sel.ranges.length;v++){var m=o.sel.ranges[v];if(m.head.line==e&&m.head.ch<u.length){var y=N(e,u.length);vi(o,v,new Ma(y,y));break}}}function Xo(t){el=t}function Jo(t,e,n,r,i){var o=t.doc;t.display.shift=!1,r||(r=o.sel);var s=t.state.pasteIncoming||"paste"==i,a=ia(e),l=null;
if(s&&r.ranges.length>1)if(el&&el.text.join("\n")==e){if(r.ranges.length%el.text.length==0){l=[];for(var c=0;c<el.text.length;c++)l.push(o.splitLines(el.text[c]))}}else a.length==r.ranges.length&&t.options.pasteLinesPerSelection&&(l=v(a,function(t){return[t]}));for(var u,h=r.ranges.length-1;h>=0;h--){var f=r.ranges[h],d=f.from(),p=f.to();f.empty()&&(n&&n>0?d=N(d.line,d.ch-n):t.state.overwrite&&!s?p=N(p.line,Math.min(E(o,p.line).text.length,p.ch+g(a).length)):el&&el.lineWise&&el.text.join("\n")==e&&(d=p=N(d.line,0))),u=t.curOp.updateInput;var m={from:d,to:p,text:l?l[h%l.length]:a,origin:i||(s?"paste":t.state.cutIncoming?"cut":"+input")};Mi(t.doc,m),we(t,"inputRead",t,m)}e&&!s&&Qo(t,e),Gn(t),t.curOp.updateInput=u,t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=!1}function Zo(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||dr(e,function(){return Jo(e,n,0,null,"paste")}),!0}function Qo(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=t.getModeAt(i.head),s=!1;if(o.electricChars){for(var a=0;a<o.electricChars.length;a++)if(e.indexOf(o.electricChars.charAt(a))>-1){s=Ko(t,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(E(t.doc,i.head.line).text.slice(0,i.head.ch))&&(s=Ko(t,i.head.line,"smart"));s&&we(t,"electricInput",t,i.head.line)}}}function ts(t){for(var e=[],n=[],r=0;r<t.doc.sel.ranges.length;r++){var i=t.doc.sel.ranges[r].head.line,o={anchor:N(i,0),head:N(i+1,0)};n.push(o),e.push(t.getRange(o.anchor,o.head))}return{text:e,ranges:n}}function es(t,e){t.setAttribute("autocorrect","off"),t.setAttribute("autocapitalize","off"),t.setAttribute("spellcheck",!!e)}function ns(){var t=r("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),e=r("div",[t],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return xs?t.style.width="1000px":t.setAttribute("wrap","off"),As&&(t.style.border="1px solid black"),es(t),e}function rs(t,e,n,r,i){function o(){var r=e.line+n;return!(r<t.first||r>=t.first+t.size)&&(e=new N(r,e.ch,e.sticky),c=E(t,r))}function s(r){var s;if(s=i?vo(t.cm,c,e,n):po(c,e,n),null==s){if(r||!o())return!1;e=go(i,t.cm,c,e.line,n)}else e=s;return!0}var a=e,l=n,c=E(t,e.line);if("char"==r)s();else if("column"==r)s(!0);else if("word"==r||"group"==r)for(var u=null,h="group"==r,f=t.cm&&t.cm.getHelper(e,"wordChars"),d=!0;!(n<0)||s(!d);d=!1){var p=c.text.charAt(e.ch)||"\n",g=x(p,f)?"w":h&&"\n"==p?"n":!h||/\s/.test(p)?null:"p";if(!h||d||g||(g="s"),u&&u!=g){n<0&&(n=1,s(),e.sticky="after");break}if(g&&(u=g),n>0&&!s(!d))break}var v=Ti(t,e,a,l,!0);return R(a,v)&&(v.hitSide=!0),v}function is(t,e,n,r){var i,o=t.doc,s=e.left;if("page"==r){var a=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),l=Math.max(a-.5*bn(t.display),3);i=(n>0?e.bottom:e.top)+n*l}else"line"==r&&(i=n>0?e.bottom+3:e.top-3);for(var c;c=fn(t,s,i),c.outside;){if(n<0?i<=0:i>=o.height){c.hitSide=!0;break}i+=5*n}return c}function os(t,e){var n=We(t,e.line);if(!n||n.hidden)return null;var r=E(t.doc,e.line),i=He(n,r,e.line),o=Ct(r,t.doc.direction),s="left";if(o){var a=_t(o,e.ch);s=a%2?"right":"left"}var l=Ke(i.map,e.ch,s);return l.offset="right"==l.collapse?l.end:l.start,l}function ss(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}function as(t,e){return e&&(t.bad=!0),t}function ls(t,e,n,r,i){function o(t){return function(e){return e.id==t}}function s(){u&&(c+=h,u=!1)}function a(t){t&&(s(),c+=t)}function l(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(null!=n)return void a(n||e.textContent.replace(/\u200b/g,""));var c,f=e.getAttribute("cm-marker");if(f){var d=t.findMarks(N(r,0),N(i+1,0),o(+f));return void(d.length&&(c=d[0].find(0))&&a(A(t.doc,c.from,c.to).join(h)))}if("false"==e.getAttribute("contenteditable"))return;var p=/^(pre|div|p)$/i.test(e.nodeName);p&&s();for(var g=0;g<e.childNodes.length;g++)l(e.childNodes[g]);p&&(u=!0)}else 3==e.nodeType&&a(e.nodeValue)}for(var c="",u=!1,h=t.doc.lineSeparator();l(e),e!=n;)e=e.nextSibling;return c}function cs(t,e,n){var r;if(e==t.display.lineDiv){if(r=t.display.lineDiv.childNodes[n],!r)return as(t.clipPos(N(t.display.viewTo-1)),!0);e=null,n=0}else for(r=e;;r=r.parentNode){if(!r||r==t.display.lineDiv)return null;if(r.parentNode&&r.parentNode==t.display.lineDiv)break}for(var i=0;i<t.display.view.length;i++){var o=t.display.view[i];if(o.node==r)return us(o,e,n)}}function us(t,e,n){function r(e,n,r){for(var i=-1;i<(h?h.length:0);i++)for(var o=i<0?u.map:h[i],s=0;s<o.length;s+=3){var a=o[s+2];if(a==e||a==n){var l=L(i<0?t.line:t.rest[i]),c=o[s]+r;return(r<0||a!=e)&&(c=o[s+(r?1:0)]),N(l,c)}}}var i=t.text.firstChild,s=!1;if(!e||!o(i,e))return as(N(L(t.line),0),!0);if(e==i&&(s=!0,e=i.childNodes[n],n=0,!e)){var a=t.rest?g(t.rest):t.line;return as(N(L(a),a.text.length),s)}var l=3==e.nodeType?e:null,c=e;for(l||1!=e.childNodes.length||3!=e.firstChild.nodeType||(l=e.firstChild,n&&(n=l.nodeValue.length));c.parentNode!=i;)c=c.parentNode;var u=t.measure,h=u.maps,f=r(l,c,n);if(f)return as(f,s);for(var d=c.nextSibling,p=l?l.nodeValue.length-n:0;d;d=d.nextSibling){if(f=r(d,d.firstChild,0))return as(N(f.line,f.ch-p),s);p+=d.textContent.length}for(var v=c.previousSibling,m=n;v;v=v.previousSibling){if(f=r(v,v.firstChild,-1))return as(N(f.line,f.ch+m),s);m+=v.textContent.length}}function hs(t,e){function n(){t.value=c.getValue()}if(e=e?u(e):{},e.value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var r=s();e.autofocus=r==t||null!=t.getAttribute("autofocus")&&r==document.body}var i;if(t.form&&(na(t.form,"submit",n),!e.leaveSubmitMethodAlone)){var o=t.form;i=o.submit;try{var a=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=a}}catch(l){}}e.finishInit=function(e){e.save=n,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,n(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(St(t.form,"submit",n),"function"==typeof t.form.submit&&(t.form.submit=i))}},t.style.display="none";var c=Go(function(e){return t.parentNode.insertBefore(e,t.nextSibling)},e);return c}function fs(t){t.off=St,t.on=na,t.wheelEventPixels=Rr,t.Doc=Ia,t.splitLines=ia,t.countColumn=h,t.findColumn=d,t.isWordChar=w,t.Pass=Us,t.signal=Tt,t.Line=ga,t.changeEnd=$r,t.scrollbarModel=ka,t.Pos=N,t.cmpPos=I,t.modes=la,t.mimeModes=ca,t.resolveMode=Vt,t.getMode=Ht,t.modeExtensions=ua,t.extendMode=Ut,t.copyState=qt,t.startState=Gt,t.innerMode=Wt,t.commands=Ua,t.keyMap=Ha,t.keyName=co,t.isModifierKey=ao,t.lookupKey=so,t.normalizeKeyMap=oo,t.StringStream=ha,t.SharedTextMarker=Da,t.TextMarker=ja,t.LineWidget=La,t.e_preventDefault=Lt,t.e_stopPropagation=Pt,t.e_stop=Dt,t.addClass=a,t.contains=o,t.rmClass=Bs,t.keyNames=Fa}var ds=navigator.userAgent,ps=navigator.platform,gs=/gecko\/\d/i.test(ds),vs=/MSIE \d/.test(ds),ms=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ds),ys=/Edge\/(\d+)/.exec(ds),bs=vs||ms||ys,ws=bs&&(vs?document.documentMode||6:+(ys||ms)[1]),xs=!ys&&/WebKit\//.test(ds),_s=xs&&/Qt\/\d+\.\d+/.test(ds),Cs=!ys&&/Chrome\//.test(ds),ks=/Opera\//.test(ds),Ss=/Apple Computer/.test(navigator.vendor),Ts=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ds),Es=/PhantomJS/.test(ds),As=!ys&&/AppleWebKit/.test(ds)&&/Mobile\/\w+/.test(ds),Os=/Android/.test(ds),Ms=As||Os||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ds),Ls=As||/Mac/.test(ps),Ps=/\bCrOS\b/.test(ds),js=/win/i.test(ps),Ds=ks&&ds.match(/Version\/(\d*\.\d*)/);Ds&&(Ds=Number(Ds[1])),Ds&&Ds>=15&&(ks=!1,xs=!0);var Ns,Is=Ls&&(_s||ks&&(null==Ds||Ds<12.11)),Rs=gs||bs&&ws>=9,Bs=function(e,n){var r=e.className,i=t(n).exec(r);if(i){var o=r.slice(i.index+i[0].length);e.className=r.slice(0,i.index)+(o?i[1]+o:"")}};Ns=document.createRange?function(t,e,n,r){var i=document.createRange();return i.setEnd(r||t,n),i.setStart(t,e),i}:function(t,e,n){var r=document.body.createTextRange();try{r.moveToElementText(t.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",e),r};var Fs=function(t){t.select()};As?Fs=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:bs&&(Fs=function(t){try{t.select()}catch(e){}});var zs=function(){this.id=null};zs.prototype.set=function(t,e){clearTimeout(this.id),this.id=setTimeout(e,t)};var $s,Vs,Hs=30,Us={toString:function(){return"CodeMirror.Pass"}},qs={scroll:!1},Ws={origin:"*mouse"},Gs={origin:"+move"},Ys=[""],Ks=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Xs=/[\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]/,Js=!1,Zs=!1,Qs=null,ta=function(){function t(t){return t<=247?n.charAt(t):1424<=t&&t<=1524?"R":1536<=t&&t<=1785?r.charAt(t-1536):1774<=t&&t<=2220?"r":8192<=t&&t<=8203?"w":8204==t?"b":"L"}function e(t,e,n){this.level=t,this.from=e,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,s=/[LRr]/,a=/[Lb1n]/,l=/[1n]/;return function(n,r){var c="ltr"==r?"L":"R";if(0==n.length||"ltr"==r&&!i.test(n))return!1;for(var u=n.length,h=[],f=0;f<u;++f)h.push(t(n.charCodeAt(f)));for(var d=0,p=c;d<u;++d){var v=h[d];"m"==v?h[d]=p:p=v}for(var m=0,y=c;m<u;++m){var b=h[m];"1"==b&&"r"==y?h[m]="n":s.test(b)&&(y=b,"r"==b&&(h[m]="R"))}for(var w=1,x=h[0];w<u-1;++w){var _=h[w];"+"==_&&"1"==x&&"1"==h[w+1]?h[w]="1":","!=_||x!=h[w+1]||"1"!=x&&"n"!=x||(h[w]=x),x=_}for(var C=0;C<u;++C){var k=h[C];if(","==k)h[C]="N";else if("%"==k){var S=void 0;for(S=C+1;S<u&&"%"==h[S];++S);for(var T=C&&"!"==h[C-1]||S<u&&"1"==h[S]?"1":"N",E=C;E<S;++E)h[E]=T;C=S-1}}for(var A=0,O=c;A<u;++A){var M=h[A];"L"==O&&"1"==M?h[A]="L":s.test(M)&&(O=M)}for(var L=0;L<u;++L)if(o.test(h[L])){var P=void 0;for(P=L+1;P<u&&o.test(h[P]);++P);for(var j="L"==(L?h[L-1]:c),D="L"==(P<u?h[P]:c),N=j==D?j?"L":"R":c,I=L;I<P;++I)h[I]=N;L=P-1}for(var R,B=[],F=0;F<u;)if(a.test(h[F])){var z=F;for(++F;F<u&&a.test(h[F]);++F);B.push(new e(0,z,F))}else{var $=F,V=B.length;for(++F;F<u&&"L"!=h[F];++F);for(var H=$;H<F;)if(l.test(h[H])){$<H&&B.splice(V,0,new e(1,$,H));var U=H;for(++H;H<F&&l.test(h[H]);++H);B.splice(V,0,new e(2,U,H)),$=H}else++H;$<F&&B.splice(V,0,new e(1,$,F))}return"ltr"==r&&(1==B[0].level&&(R=n.match(/^\s+/))&&(B[0].from=R[0].length,B.unshift(new e(0,0,R[0].length))),1==g(B).level&&(R=n.match(/\s+$/))&&(g(B).to-=R[0].length,B.push(new e(0,u-R[0].length,u)))),"rtl"==r?B.reverse():B}}(),ea=[],na=function(t,e,n){if(t.addEventListener)t.addEventListener(e,n,!1);else if(t.attachEvent)t.attachEvent("on"+e,n);else{var r=t._handlers||(t._handlers={});r[e]=(r[e]||ea).concat(n)}},ra=function(){if(bs&&ws<9)return!1;var t=r("div");return"draggable"in t||"dragDrop"in t}(),ia=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],r=t.length;e<=r;){var i=t.indexOf("\n",e);i==-1&&(i=t.length);var o=t.slice(e,"\r"==t.charAt(i-1)?i-1:i),s=o.indexOf("\r");s!=-1?(n.push(o.slice(0,s)),e+=s+1):(n.push(o),e=i+1)}return n}:function(t){return t.split(/\r\n?|\n/)},oa=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(e){return!1}}:function(t){var e;try{e=t.ownerDocument.selection.createRange()}catch(n){}return!(!e||e.parentElement()!=t)&&0!=e.compareEndPoints("StartToEnd",e)},sa=function(){var t=r("div");return"oncopy"in t||(t.setAttribute("oncopy","return;"),"function"==typeof t.oncopy)}(),aa=null,la={},ca={},ua={},ha=function(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};ha.prototype.eol=function(){return this.pos>=this.string.length},ha.prototype.sol=function(){return this.pos==this.lineStart},ha.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ha.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},ha.prototype.eat=function(t){var e,n=this.string.charAt(this.pos);if(e="string"==typeof t?n==t:n&&(t.test?t.test(n):t(n)))return++this.pos,n},ha.prototype.eatWhile=function(t){for(var e=this.pos;this.eat(t););return this.pos>e},ha.prototype.eatSpace=function(){for(var t=this,e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++t.pos;return this.pos>e},ha.prototype.skipToEnd=function(){this.pos=this.string.length},ha.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},ha.prototype.backUp=function(t){this.pos-=t},ha.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=h(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?h(this.string,this.lineStart,this.tabSize):0)},ha.prototype.indentation=function(){return h(this.string,null,this.tabSize)-(this.lineStart?h(this.string,this.lineStart,this.tabSize):0)},ha.prototype.match=function(t,e,n){if("string"!=typeof t){var r=this.string.slice(this.pos).match(t);return r&&r.index>0?null:(r&&e!==!1&&(this.pos+=r[0].length),r)}var i=function(t){return n?t.toLowerCase():t},o=this.string.substr(this.pos,t.length);if(i(o)==i(t))return e!==!1&&(this.pos+=t.length),!0},ha.prototype.current=function(){return this.string.slice(this.start,this.pos)},ha.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},ha.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},ha.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var fa=function(t,e){this.state=t,this.lookAhead=e},da=function(t,e,n,r){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};da.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},da.prototype.baseToken=function(t){var e=this;if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=t;)e.baseTokenPos+=2;var n=this.baseTokens[this.baseTokenPos+1];return{type:n&&n.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},da.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},da.fromSaved=function(t,e,n){return e instanceof fa?new da(t,qt(t.mode,e.state),n,e.lookAhead):new da(t,qt(t.mode,e),n)},da.prototype.save=function(t){var e=t!==!1?qt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new fa(e,this.maxLookAhead):e};var pa=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n},ga=function(t,e,n){this.text=t,rt(this,e),this.height=n?n(this):1};ga.prototype.lineNo=function(){return L(this)},Mt(ga);var va,ma={},ya={},ba=null,wa=null,xa={left:0,right:0,top:0,bottom:0},_a=function(t,e,n){this.cm=n;var i=this.vert=r("div",[r("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=r("div",[r("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");t(i),t(o),na(i,"scroll",function(){i.clientHeight&&e(i.scrollTop,"vertical")}),na(o,"scroll",function(){o.clientWidth&&e(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,bs&&ws<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};_a.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,r=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?r+"px":"0";var i=t.viewHeight-(e?r:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:e?r:0}},_a.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},_a.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},_a.prototype.zeroWidthHack=function(){var t=Ls&&!Ts?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new zs,this.disableVert=new zs},_a.prototype.enableZeroWidthBar=function(t,e,n){function r(){var i=t.getBoundingClientRect(),o="vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=t?t.style.pointerEvents="none":e.set(1e3,r)}t.style.pointerEvents="auto",e.set(1e3,r)},_a.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var Ca=function(){};Ca.prototype.update=function(){return{bottom:0,right:0}},Ca.prototype.setScrollLeft=function(){},Ca.prototype.setScrollTop=function(){},Ca.prototype.clear=function(){};var ka={"native":_a,"null":Ca},Sa=0,Ta=function(t,e,n){var r=t.display;this.viewport=e,this.visible=Fn(r,t.doc,e),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=ze(t),this.force=n,this.dims=xn(t),this.events=[]};Ta.prototype.signal=function(t,e){Ot(t,e)&&this.events.push(arguments)},Ta.prototype.finish=function(){for(var t=this,e=0;e<this.events.length;e++)Tt.apply(null,t.events[e])};var Ea=0,Aa=null;bs?Aa=-.53:gs?Aa=15:Cs?Aa=-.7:Ss&&(Aa=-1/3);var Oa=function(t,e){this.ranges=t,this.primIndex=e};Oa.prototype.primary=function(){return this.ranges[this.primIndex]},Oa.prototype.equals=function(t){var e=this;if(t==this)return!0;if(t.primIndex!=this.primIndex||t.ranges.length!=this.ranges.length)return!1;for(var n=0;n<this.ranges.length;n++){var r=e.ranges[n],i=t.ranges[n];if(!R(r.anchor,i.anchor)||!R(r.head,i.head))return!1}return!0},Oa.prototype.deepCopy=function(){for(var t=this,e=[],n=0;n<this.ranges.length;n++)e[n]=new Ma(B(t.ranges[n].anchor),B(t.ranges[n].head));return new Oa(e,this.primIndex)},Oa.prototype.somethingSelected=function(){for(var t=this,e=0;e<this.ranges.length;e++)if(!t.ranges[e].empty())return!0;return!1},Oa.prototype.contains=function(t,e){var n=this;e||(e=t);for(var r=0;r<this.ranges.length;r++){var i=n.ranges[r];if(I(e,i.from())>=0&&I(t,i.to())<=0)return r}return-1};var Ma=function(t,e){this.anchor=t,this.head=e};Ma.prototype.from=function(){return z(this.anchor,this.head)},Ma.prototype.to=function(){return F(this.anchor,this.head)},Ma.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},$i.prototype={chunkSize:function(){return this.lines.length},removeInner:function(t,e){for(var n=this,r=t,i=t+e;r<i;++r){var o=n.lines[r];n.height-=o.height,se(o),we(o,"delete")}this.lines.splice(t,e)},collapse:function(t){t.push.apply(t,this.lines)},insertInner:function(t,e,n){var r=this;this.height+=n,this.lines=this.lines.slice(0,t).concat(e).concat(this.lines.slice(t));for(var i=0;i<e.length;++i)e[i].parent=r},iterN:function(t,e,n){for(var r=this,i=t+e;t<i;++t)if(n(r.lines[t]))return!0}},Vi.prototype={chunkSize:function(){return this.size},removeInner:function(t,e){var n=this;this.size-=e;for(var r=0;r<this.children.length;++r){var i=n.children[r],o=i.chunkSize();if(t<o){var s=Math.min(e,o-t),a=i.height;if(i.removeInner(t,s),n.height-=a-i.height,o==s&&(n.children.splice(r--,1),i.parent=null),0==(e-=s))break;t=0}else t-=o}if(this.size-e<25&&(this.children.length>1||!(this.children[0]instanceof $i))){var l=[];this.collapse(l),this.children=[new $i(l)],this.children[0].parent=this}},collapse:function(t){for(var e=this,n=0;n<this.children.length;++n)e.children[n].collapse(t)},insertInner:function(t,e,n){var r=this;this.size+=e.length,this.height+=n;for(var i=0;i<this.children.length;++i){var o=r.children[i],s=o.chunkSize();if(t<=s){if(o.insertInner(t,e,n),o.lines&&o.lines.length>50){for(var a=o.lines.length%25+25,l=a;l<o.lines.length;){var c=new $i(o.lines.slice(l,l+=25));o.height-=c.height,r.children.splice(++i,0,c),c.parent=r}o.lines=o.lines.slice(0,a),r.maybeSpill()}break}t-=s}},maybeSpill:function(){if(!(this.children.length<=10)){var t=this;do{var e=t.children.splice(t.children.length-5,5),n=new Vi(e);if(t.parent){t.size-=n.size,t.height-=n.height;var r=f(t.parent.children,t);t.parent.children.splice(r+1,0,n)}else{var i=new Vi(t.children);i.parent=t,t.children=[i,n],t=i}n.parent=t.parent}while(t.children.length>10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var r=this,i=0;i<this.children.length;++i){var o=r.children[i],s=o.chunkSize();if(t<s){var a=Math.min(e,s-t);if(o.iterN(t,a,n))return!0;if(0==(e-=a))break;t=0}else t-=s}}};var La=function(t,e,n){var r=this;if(n)for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i]);this.doc=t,this.node=e};La.prototype.clear=function(){var t=this,e=this.doc.cm,n=this.line.widgets,r=this.line,i=L(r);if(null!=i&&n){for(var o=0;o<n.length;++o)n[o]==t&&n.splice(o--,1);n.length||(r.widgets=null);var s=De(this);M(r,Math.max(0,r.height-s)),e&&(dr(e,function(){Hi(e,r,-s),yr(e,i,"widget")}),we(e,"lineWidgetCleared",e,this,i))}},La.prototype.changed=function(){var t=this,e=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=De(this)-e;i&&(M(r,r.height+i),n&&dr(n,function(){n.curOp.forceUpdate=!0,Hi(n,r,i),we(n,"lineWidgetChanged",n,t,L(r))}))},Mt(La);var Pa=0,ja=function(t,e){this.lines=[],this.type=e,this.doc=t,this.id=++Pa};ja.prototype.clear=function(){var t=this;if(!this.explicitlyCleared){var e=this.doc.cm,n=e&&!e.curOp;if(n&&or(e),Ot(this,"clear")){var r=this.find();r&&we(this,"clear",r.from,r.to)}for(var i=null,o=null,s=0;s<this.lines.length;++s){var a=t.lines[s],l=Y(a.markedSpans,t);e&&!t.collapsed?yr(e,L(a),"text"):e&&(null!=l.to&&(o=L(a)),null!=l.from&&(i=L(a))),a.markedSpans=K(a.markedSpans,l),null==l.from&&t.collapsed&&!vt(t.doc,a)&&e&&M(a,bn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var u=ht(t.lines[c]),h=bt(u);h>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=h,e.display.maxLineChanged=!0)}null!=i&&e&&this.collapsed&&mr(e,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ci(e.doc)),e&&we(e,"markerCleared",e,this,i,o),n&&sr(e),this.parent&&this.parent.clear()}},ja.prototype.find=function(t,e){var n=this;null==t&&"bookmark"==this.type&&(t=1);for(var r,i,o=0;o<this.lines.length;++o){var s=n.lines[o],a=Y(s.markedSpans,n);if(null!=a.from&&(r=N(e?s:L(s),a.from),t==-1))return r;if(null!=a.to&&(i=N(e?s:L(s),a.to),1==t))return i}return r&&{from:r,to:i}},ja.prototype.changed=function(){var t=this,e=this.find(-1,!0),n=this,r=this.doc.cm;e&&r&&dr(r,function(){var i=e.line,o=L(e.line),s=We(r,o);if(s&&(Qe(s),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!vt(n.doc,i)&&null!=n.height){var a=n.height;n.height=null;var l=De(n)-a;l&&M(i,i.height+l)}we(r,"markerChanged",r,t)})},ja.prototype.attachLine=function(t){if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;e.maybeHiddenMarkers&&f(e.maybeHiddenMarkers,this)!=-1||(e.maybeUnhiddenMarkers||(e.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(t)},ja.prototype.detachLine=function(t){if(this.lines.splice(f(this.lines,t),1),!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;(e.maybeHiddenMarkers||(e.maybeHiddenMarkers=[])).push(this)}},Mt(ja);var Da=function(t,e){var n=this;this.markers=t,this.primary=e;for(var r=0;r<t.length;++r)t[r].parent=n};Da.prototype.clear=function(){var t=this;if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)t.markers[e].clear();we(this,"clear")}},Da.prototype.find=function(t,e){return this.primary.find(t,e)},Mt(Da);var Na=0,Ia=function(t,e,n,r,i){if(!(this instanceof Ia))return new Ia(t,e,n,r,i);null==n&&(n=0),Vi.call(this,[new $i([new ga("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=N(n,0);this.sel=zr(o),this.history=new ti(null),this.id=++Na,this.modeOption=e,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof t&&(t=this.splitLines(t)),Kr(this,{from:o,to:o,text:t}),wi(this,zr(o),qs)};Ia.prototype=b(Vi.prototype,{constructor:Ia,iter:function(t,e,n){n?this.iterN(t-this.first,e-t,n):this.iterN(this.first,this.first+this.size,t)},insert:function(t,e){for(var n=0,r=0;r<e.length;++r)n+=e[r].height;this.insertInner(t-this.first,e,n)},remove:function(t,e){this.removeInner(t-this.first,e)},getValue:function(t){var e=O(this,this.first,this.first+this.size);return t===!1?e:e.join(t||this.lineSeparator())},setValue:vr(function(t){var e=N(this.first,0),n=this.first+this.size-1;Mi(this,{from:e,to:N(n,E(this,n).text.length),text:this.splitLines(t),origin:"setValue",full:!0},!0),this.cm&&Yn(this.cm,0,0),wi(this,zr(e),qs)}),replaceRange:function(t,e,n,r){e=V(this,e),n=n?V(this,n):e,Ii(this,t,e,n,r)},getRange:function(t,e,n){var r=A(this,V(this,t),V(this,e));return n===!1?r:r.join(n||this.lineSeparator())},getLine:function(t){var e=this.getLineHandle(t);return e&&e.text},getLineHandle:function(t){if(j(this,t))return E(this,t)},getLineNumber:function(t){return L(t)},getLineHandleVisualStart:function(t){return"number"==typeof t&&(t=E(this,t)),ht(t)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(t){return V(this,t)},getCursor:function(t){var e,n=this.sel.primary();return e=null==t||"head"==t?n.head:"anchor"==t?n.anchor:"end"==t||"to"==t||t===!1?n.to():n.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:vr(function(t,e,n){mi(this,V(this,"number"==typeof t?N(t,e||0):t),null,n)}),setSelection:vr(function(t,e,n){mi(this,V(this,t),V(this,e||t),n)}),extendSelection:vr(function(t,e,n){pi(this,V(this,t),e&&V(this,e),n)}),extendSelections:vr(function(t,e){gi(this,U(this,t),e)}),extendSelectionsBy:vr(function(t,e){var n=v(this.sel.ranges,t);gi(this,U(this,n),e)}),setSelections:vr(function(t,e,n){var r=this;if(t.length){for(var i=[],o=0;o<t.length;o++)i[o]=new Ma(V(r,t[o].anchor),V(r,t[o].head));null==e&&(e=Math.min(t.length-1,this.sel.primIndex)),wi(this,Fr(i,e),n)}}),addSelection:vr(function(t,e,n){var r=this.sel.ranges.slice(0);r.push(new Ma(V(this,t),V(this,e||t))),wi(this,Fr(r,r.length-1),n)}),getSelection:function(t){for(var e,n=this,r=this.sel.ranges,i=0;i<r.length;i++){var o=A(n,r[i].from(),r[i].to());e=e?e.concat(o):o}return t===!1?e:e.join(t||this.lineSeparator())},getSelections:function(t){for(var e=this,n=[],r=this.sel.ranges,i=0;i<r.length;i++){var o=A(e,r[i].from(),r[i].to());t!==!1&&(o=o.join(t||e.lineSeparator())),n[i]=o}return n},replaceSelection:function(t,e,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=t;this.replaceSelections(r,e,n||"+input")},replaceSelections:vr(function(t,e,n){for(var r=this,i=[],o=this.sel,s=0;s<o.ranges.length;s++){var a=o.ranges[s];i[s]={from:a.from(),to:a.to(),text:r.splitLines(t[s]),origin:n}}for(var l=e&&"end"!=e&&qr(this,i,e),c=i.length-1;c>=0;c--)Mi(r,i[c]);l?bi(this,l):this.cm&&Gn(this.cm)}),undo:vr(function(){Pi(this,"undo")}),redo:vr(function(){Pi(this,"redo")}),undoSelection:vr(function(){Pi(this,"undo",!0)}),redoSelection:vr(function(){Pi(this,"redo",!0)}),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,r=0;r<t.done.length;r++)t.done[r].ranges||++e;for(var i=0;i<t.undone.length;i++)t.undone[i].ranges||++n;return{undo:e,redo:n}},clearHistory:function(){this.history=new ti(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(t){return t&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(t){return this.history.generation==(t||this.cleanGeneration)},getHistory:function(){return{done:fi(this.history.done),undone:fi(this.history.undone)}},setHistory:function(t){var e=this.history=new ti(this.history.maxGeneration);e.done=fi(t.done.slice(0),null,!0),e.undone=fi(t.undone.slice(0),null,!0)},setGutterMarker:vr(function(t,e,n){return zi(this,t,"gutter",function(t){var r=t.gutterMarkers||(t.gutterMarkers={});return r[e]=n,!n&&_(r)&&(t.gutterMarkers=null),!0})}),clearGutter:vr(function(t){var e=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[t]&&zi(e,n,"gutter",function(){return n.gutterMarkers[t]=null,_(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(t){var e;if("number"==typeof t){if(!j(this,t))return null;if(e=t,t=E(this,t),!t)return null}else if(e=L(t),null==e)return null;return{line:e,handle:t,text:t.text,gutterMarkers:t.gutterMarkers,textClass:t.textClass,bgClass:t.bgClass,wrapClass:t.wrapClass,widgets:t.widgets}},addLineClass:vr(function(e,n,r){return zi(this,e,"gutter"==n?"gutter":"class",function(e){var i="text"==n?"textClass":"background"==n?"bgClass":"gutter"==n?"gutterClass":"wrapClass";if(e[i]){if(t(r).test(e[i]))return!1;e[i]+=" "+r}else e[i]=r;return!0})}),
removeLineClass:vr(function(e,n,r){return zi(this,e,"gutter"==n?"gutter":"class",function(e){var i="text"==n?"textClass":"background"==n?"bgClass":"gutter"==n?"gutterClass":"wrapClass",o=e[i];if(!o)return!1;if(null==r)e[i]=null;else{var s=o.match(t(r));if(!s)return!1;var a=s.index+s[0].length;e[i]=o.slice(0,s.index)+(s.index&&a!=o.length?" ":"")+o.slice(a)||null}return!0})}),addLineWidget:vr(function(t,e,n){return Ui(this,t,e,n)}),removeLineWidget:function(t){t.clear()},markText:function(t,e,n){return qi(this,V(this,t),V(this,e),n,n&&n.type||"range")},setBookmark:function(t,e){var n={replacedWith:e&&(null==e.nodeType?e.widget:e),insertLeft:e&&e.insertLeft,clearWhenEmpty:!1,shared:e&&e.shared,handleMouseEvents:e&&e.handleMouseEvents};return t=V(this,t),qi(this,t,t,n,"bookmark")},findMarksAt:function(t){t=V(this,t);var e=[],n=E(this,t.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=t.ch)&&(null==i.to||i.to>=t.ch)&&e.push(i.marker.parent||i.marker)}return e},findMarks:function(t,e,n){t=V(this,t),e=V(this,e);var r=[],i=t.line;return this.iter(t.line,e.line+1,function(o){var s=o.markedSpans;if(s)for(var a=0;a<s.length;a++){var l=s[a];null!=l.to&&i==t.line&&t.ch>=l.to||null==l.from&&i!=t.line||null!=l.from&&i==e.line&&l.from>=e.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i}),r},getAllMarks:function(){var t=[];return this.iter(function(e){var n=e.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&t.push(n[r].marker)}),t},posFromIndex:function(t){var e,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+r;return o>t?(e=t,!0):(t-=o,void++n)}),V(this,N(n,e))},indexFromPos:function(t){t=V(this,t);var e=t.ch;if(t.line<this.first||t.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,t.line,function(t){e+=t.text.length+n}),e},copy:function(t){var e=new Ia(O(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return e.scrollTop=this.scrollTop,e.scrollLeft=this.scrollLeft,e.sel=this.sel,e.extend=!1,t&&(e.history.undoDepth=this.history.undoDepth,e.setHistory(this.getHistory())),e},linkedDoc:function(t){t||(t={});var e=this.first,n=this.first+this.size;null!=t.from&&t.from>e&&(e=t.from),null!=t.to&&t.to<n&&(n=t.to);var r=new Ia(O(this,e,n),t.mode||this.modeOption,e,this.lineSep,this.direction);return t.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:t.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:t.sharedHist}],Yi(r,Gi(this)),r},unlinkDoc:function(t){var e=this;if(t instanceof Go&&(t=t.doc),this.linked)for(var n=0;n<this.linked.length;++n){var r=e.linked[n];if(r.doc==t){e.linked.splice(n,1),t.unlinkDoc(e),Ki(Gi(e));break}}if(t.history==this.history){var i=[t.id];Xr(t,function(t){return i.push(t.id)},!0),t.history=new ti(null),t.history.done=fi(this.history.done,i),t.history.undone=fi(this.history.undone,i)}},iterLinkedDocs:function(t){Xr(this,t)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(t){return this.lineSep?t.split(this.lineSep):ia(t)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:vr(function(t){"rtl"!=t&&(t="ltr"),t!=this.direction&&(this.direction=t,this.iter(function(t){return t.order=null}),this.cm&&Qr(this.cm))})}),Ia.prototype.eachLine=Ia.prototype.iter;for(var Ra=0,Ba=!1,Fa={3:"Enter",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:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},za=0;za<10;za++)Fa[za+48]=Fa[za+96]=String(za);for(var $a=65;$a<=90;$a++)Fa[$a]=String.fromCharCode($a);for(var Va=1;Va<=12;Va++)Fa[Va+111]=Fa[Va+63235]="F"+Va;var Ha={};Ha.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"},Ha.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"},Ha.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ha.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"]},Ha["default"]=Ls?Ha.macDefault:Ha.pcDefault;var Ua={selectAll:Ai,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),qs)},killLine:function(t){return ho(t,function(e){if(e.empty()){var n=E(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line<t.lastLine()?{from:e.head,to:N(e.head.line+1,0)}:{from:e.head,to:N(e.head.line,n)}}return{from:e.from(),to:e.to()}})},deleteLine:function(t){return ho(t,function(e){return{from:N(e.from().line,0),to:V(t.doc,N(e.to().line+1,0))}})},delLineLeft:function(t){return ho(t,function(t){return{from:N(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(t){return ho(t,function(e){var n=t.charCoords(e.head,"div").top+5,r=t.coordsChar({left:0,top:n},"div");return{from:r,to:e.from()}})},delWrappedLineRight:function(t){return ho(t,function(e){var n=t.charCoords(e.head,"div").top+5,r=t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div");return{from:e.from(),to:r}})},undo:function(t){return t.undo()},redo:function(t){return t.redo()},undoSelection:function(t){return t.undoSelection()},redoSelection:function(t){return t.redoSelection()},goDocStart:function(t){return t.extendSelection(N(t.firstLine(),0))},goDocEnd:function(t){return t.extendSelection(N(t.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy(function(e){return mo(t,e.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy(function(e){return bo(t,e.head)},{origin:"+move",bias:1})},goLineEnd:function(t){return t.extendSelectionsBy(function(e){return yo(t,e.head.line)},{origin:"+move",bias:-1})},goLineRight:function(t){return t.extendSelectionsBy(function(e){var n=t.cursorCoords(e.head,"div").top+5;return t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div")},Gs)},goLineLeft:function(t){return t.extendSelectionsBy(function(e){var n=t.cursorCoords(e.head,"div").top+5;return t.coordsChar({left:0,top:n},"div")},Gs)},goLineLeftSmart:function(t){return t.extendSelectionsBy(function(e){var n=t.cursorCoords(e.head,"div").top+5,r=t.coordsChar({left:0,top:n},"div");return r.ch<t.getLine(r.line).search(/\S/)?bo(t,e.head):r},Gs)},goLineUp:function(t){return t.moveV(-1,"line")},goLineDown:function(t){return t.moveV(1,"line")},goPageUp:function(t){return t.moveV(-1,"page")},goPageDown:function(t){return t.moveV(1,"page")},goCharLeft:function(t){return t.moveH(-1,"char")},goCharRight:function(t){return t.moveH(1,"char")},goColumnLeft:function(t){return t.moveH(-1,"column")},goColumnRight:function(t){return t.moveH(1,"column")},goWordLeft:function(t){return t.moveH(-1,"word")},goGroupRight:function(t){return t.moveH(1,"group")},goGroupLeft:function(t){return t.moveH(-1,"group")},goWordRight:function(t){return t.moveH(1,"word")},delCharBefore:function(t){return t.deleteH(-1,"char")},delCharAfter:function(t){return t.deleteH(1,"char")},delWordBefore:function(t){return t.deleteH(-1,"word")},delWordAfter:function(t){return t.deleteH(1,"word")},delGroupBefore:function(t){return t.deleteH(-1,"group")},delGroupAfter:function(t){return t.deleteH(1,"group")},indentAuto:function(t){return t.indentSelection("smart")},indentMore:function(t){return t.indentSelection("add")},indentLess:function(t){return t.indentSelection("subtract")},insertTab:function(t){return t.replaceSelection("\t")},insertSoftTab:function(t){for(var e=[],n=t.listSelections(),r=t.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),s=h(t.getLine(o.line),o.ch,r);e.push(p(r-s%r))}t.replaceSelections(e)},defaultTab:function(t){t.somethingSelected()?t.indentSelection("add"):t.execCommand("insertTab")},transposeChars:function(t){return dr(t,function(){for(var e=t.listSelections(),n=[],r=0;r<e.length;r++)if(e[r].empty()){var i=e[r].head,o=E(t.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new N(i.line,i.ch-1)),i.ch>0)i=new N(i.line,i.ch+1),t.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),N(i.line,i.ch-2),i,"+transpose");else if(i.line>t.doc.first){var s=E(t.doc,i.line-1).text;s&&(i=new N(i.line,1),t.replaceRange(o.charAt(0)+t.doc.lineSeparator()+s.charAt(s.length-1),N(i.line-1,s.length-1),i,"+transpose"))}n.push(new Ma(i,i))}t.setSelections(n)})},newlineAndIndent:function(t){return dr(t,function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var r=0;r<e.length;r++)t.indentLine(e[r].from().line,null,!0);Gn(t)})},openLine:function(t){return t.replaceSelection("\n","start")},toggleOverwrite:function(t){return t.toggleOverwrite()}},qa=new zs,Wa=null,Ga=400,Ya=function(t,e,n){this.time=t,this.pos=e,this.button=n};Ya.prototype.compare=function(t,e,n){return this.time+Ga>t&&0==I(e,this.pos)&&n==this.button};var Ka,Xa,Ja={toString:function(){return"CodeMirror.Init"}},Za={},Qa={};Go.defaults=Za,Go.optionHandlers=Qa;var tl=[];Go.defineInitHook=function(t){return tl.push(t)};var el=null,nl=function(t){var e=t.optionHandlers,n=t.helpers={};t.prototype={constructor:t,focus:function(){window.focus(),this.display.input.focus()},setOption:function(t,n){var r=this.options,i=r[t];r[t]==n&&"mode"!=t||(r[t]=n,e.hasOwnProperty(t)&&pr(this,e[t])(this,n,i),Tt(this,"optionChange",this,t))},getOption:function(t){return this.options[t]},getDoc:function(){return this.doc},addKeyMap:function(t,e){this.state.keyMaps[e?"push":"unshift"](uo(t))},removeKeyMap:function(t){for(var e=this.state.keyMaps,n=0;n<e.length;++n)if(e[n]==t||e[n].name==t)return e.splice(n,1),!0},addOverlay:gr(function(e,n){var r=e.token?e:t.getMode(this.options,e);if(r.startState)throw new Error("Overlays may not be stateful.");m(this.state.overlays,{mode:r,modeSpec:e,opaque:n&&n.opaque,priority:n&&n.priority||0},function(t){return t.priority}),this.state.modeGen++,mr(this)}),removeOverlay:gr(function(t){for(var e=this,n=this.state.overlays,r=0;r<n.length;++r){var i=n[r].modeSpec;if(i==t||"string"==typeof t&&i.name==t)return n.splice(r,1),e.state.modeGen++,void mr(e)}}),indentLine:gr(function(t,e,n){"string"!=typeof e&&"number"!=typeof e&&(e=null==e?this.options.smartIndent?"smart":"prev":e?"add":"subtract"),j(this.doc,t)&&Ko(this,t,e,n)}),indentSelection:gr(function(t){for(var e=this,n=this.doc.sel.ranges,r=-1,i=0;i<n.length;i++){var o=n[i];if(o.empty())o.head.line>r&&(Ko(e,o.head.line,t,!0),r=o.head.line,i==e.doc.sel.primIndex&&Gn(e));else{var s=o.from(),a=o.to(),l=Math.max(r,s.line);r=Math.min(e.lastLine(),a.line-(a.ch?0:1))+1;for(var c=l;c<r;++c)Ko(e,c,t);var u=e.doc.sel.ranges;0==s.ch&&n.length==u.length&&u[i].from().ch>0&&vi(e.doc,i,new Ma(s,u[i].to()),qs)}}}),getTokenAt:function(t,e){return te(this,t,e)},getLineTokens:function(t,e){return te(this,N(t),e,!0)},getTokenTypeAt:function(t){t=V(this.doc,t);var e,n=Kt(this,E(this.doc,t.line)),r=0,i=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var s=r+i>>1;if((s?n[2*s-1]:0)>=o)i=s;else{if(!(n[2*s+1]<o)){e=n[2*s+2];break}r=s+1}}var a=e?e.indexOf("overlay "):-1;return a<0?e:0==a?null:e.slice(0,a-1)},getModeAt:function(e){var n=this.doc.mode;return n.innerMode?t.innerMode(n,this.getTokenAt(e).state).mode:n},getHelper:function(t,e){return this.getHelpers(t,e)[0]},getHelpers:function(t,e){var r=this,i=[];if(!n.hasOwnProperty(e))return i;var o=n[e],s=this.getModeAt(t);if("string"==typeof s[e])o[s[e]]&&i.push(o[s[e]]);else if(s[e])for(var a=0;a<s[e].length;a++){var l=o[s[e][a]];l&&i.push(l)}else s.helperType&&o[s.helperType]?i.push(o[s.helperType]):o[s.name]&&i.push(o[s.name]);for(var c=0;c<o._global.length;c++){var u=o._global[c];u.pred(s,r)&&f(i,u.val)==-1&&i.push(u.val)}return i},getStateAfter:function(t,e){var n=this.doc;return t=$(n,null==t?n.first+n.size-1:t),Xt(this,t+1,e).state},cursorCoords:function(t,e){var n,r=this.doc.sel.primary();return n=null==t?r.head:"object"==typeof t?V(this.doc,t):t?r.from():r.to(),cn(this,n,e||"page")},charCoords:function(t,e){return ln(this,V(this.doc,t),e||"page")},coordsChar:function(t,e){return t=an(this,t,e||"page"),fn(this,t.left,t.top)},lineAtHeight:function(t,e){return t=an(this,{top:t,left:0},e||"page").top,P(this.doc,t+this.display.viewOffset)},heightAtLine:function(t,e,n){var r,i=!1;if("number"==typeof t){var o=this.doc.first+this.doc.size-1;t<this.doc.first?t=this.doc.first:t>o&&(t=o,i=!0),r=E(this.doc,t)}else r=t;return sn(this,r,{top:0,left:0},e||"page",n||i).top+(i?this.doc.height-yt(r):0)},defaultTextHeight:function(){return bn(this.display)},defaultCharWidth:function(){return wn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,r,i){var o=this.display;t=cn(this,V(this.doc,t));var s=t.bottom,a=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),o.sizer.appendChild(e),"over"==r)s=t.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||t.bottom+e.offsetHeight>l)&&t.top>e.offsetHeight?s=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=l&&(s=t.bottom),a+e.offsetWidth>c&&(a=c-e.offsetWidth)}e.style.top=s+"px",e.style.left=e.style.right="","right"==i?(a=o.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==i?a=0:"middle"==i&&(a=(o.sizer.clientWidth-e.offsetWidth)/2),e.style.left=a+"px"),n&&Un(this,{left:a,top:s,right:a+e.offsetWidth,bottom:s+e.offsetHeight})},triggerOnKeyDown:gr(So),triggerOnKeyPress:gr(Ao),triggerOnKeyUp:Eo,triggerOnMouseDown:gr(Mo),execCommand:function(t){if(Ua.hasOwnProperty(t))return Ua[t].call(null,this)},triggerElectric:gr(function(t){Qo(this,t)}),findPosH:function(t,e,n,r){var i=this,o=1;e<0&&(o=-1,e=-e);for(var s=V(this.doc,t),a=0;a<e&&(s=rs(i.doc,s,o,n,r),!s.hitSide);++a);return s},moveH:gr(function(t,e){var n=this;this.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?rs(n.doc,r.head,t,e,n.options.rtlMoveVisually):t<0?r.from():r.to()},Gs)}),deleteH:gr(function(t,e){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):ho(this,function(n){var i=rs(r,n.head,t,e,!1);return t<0?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(t,e,n,r){var i=this,o=1,s=r;e<0&&(o=-1,e=-e);for(var a=V(this.doc,t),l=0;l<e;++l){var c=cn(i,a,"div");if(null==s?s=c.left:c.left=s,a=is(i,c,o,n),a.hitSide)break}return a},moveV:gr(function(t,e){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(s){if(o)return t<0?s.from():s.to();var a=cn(n,s.head,"div");null!=s.goalColumn&&(a.left=s.goalColumn),i.push(a.left);var l=is(n,a,t,e);return"page"==e&&s==r.sel.primary()&&Wn(n,ln(n,l,"div").top-a.top),l},Gs),i.length)for(var s=0;s<r.sel.ranges.length;s++)r.sel.ranges[s].goalColumn=i[s]}),findWordAt:function(t){var e=this.doc,n=E(e,t.line).text,r=t.ch,i=t.ch;if(n){var o=this.getHelper(t,"wordChars");"before"!=t.sticky&&i!=n.length||!r?++i:--r;for(var s=n.charAt(r),a=x(s,o)?function(t){return x(t,o)}:/\s/.test(s)?function(t){return/\s/.test(t)}:function(t){return!/\s/.test(t)&&!x(t)};r>0&&a(n.charAt(r-1));)--r;for(;i<n.length&&a(n.charAt(i));)++i}return new Ma(N(t.line,r),N(t.line,i))},toggleOverwrite:function(t){null!=t&&t==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?a(this.display.cursorDiv,"CodeMirror-overwrite"):Bs(this.display.cursorDiv,"CodeMirror-overwrite"),Tt(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==s()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:gr(function(t,e){Yn(this,t,e)}),getScrollInfo:function(){var t=this.display.scroller;return{left:t.scrollLeft,top:t.scrollTop,height:t.scrollHeight-Fe(this)-this.display.barHeight,width:t.scrollWidth-Fe(this)-this.display.barWidth,clientHeight:$e(this),clientWidth:ze(this)}},scrollIntoView:gr(function(t,e){null==t?(t={from:this.doc.sel.primary().head,to:null},null==e&&(e=this.options.cursorScrollMargin)):"number"==typeof t?t={from:N(t,0),to:null}:null==t.from&&(t={from:t,to:null}),t.to||(t.to=t.from),t.margin=e||0,null!=t.from.line?Kn(this,t):Jn(this,t.from,t.to,t.margin)}),setSize:gr(function(t,e){var n=this,r=function(t){return"number"==typeof t||/^\d+$/.test(String(t))?t+"px":t};null!=t&&(this.display.wrapper.style.width=r(t)),null!=e&&(this.display.wrapper.style.height=r(e)),this.options.lineWrapping&&tn(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(t){if(t.widgets)for(var e=0;e<t.widgets.length;e++)if(t.widgets[e].noHScroll){yr(n,i,"widget");break}++i}),this.curOp.forceUpdate=!0,Tt(this,"refresh",this)}),operation:function(t){return dr(this,t)},startOperation:function(){return or(this)},endOperation:function(){return sr(this)},refresh:gr(function(){var t=this.display.cachedTextHeight;mr(this),this.curOp.forceUpdate=!0,en(this),Yn(this,this.doc.scrollLeft,this.doc.scrollTop),Pr(this),(null==t||Math.abs(t-bn(this.display))>.5)&&kn(this),Tt(this,"refresh",this)}),swapDoc:gr(function(t){var e=this.doc;return e.cm=null,Jr(this,t),en(this),this.display.input.reset(),Yn(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,we(this,"swapDoc",this,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}},Mt(t),t.registerHelper=function(e,r,i){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][r]=i},t.registerGlobalHelper=function(e,r,i,o){t.registerHelper(e,r,o),n[e]._global.push({pred:i,val:o})}},rl=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new zs,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};rl.prototype.init=function(t){function e(t){if(!Et(i,t)){if(i.somethingSelected())Xo({lineWise:!1,text:i.getSelections()}),"cut"==t.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var e=ts(i);Xo({lineWise:!0,text:e.text}),"cut"==t.type&&i.operation(function(){i.setSelections(e.ranges,0,qs),i.replaceSelection("",null,"cut")})}if(t.clipboardData){t.clipboardData.clearData();var n=el.text.join("\n");if(t.clipboardData.setData("Text",n),t.clipboardData.getData("Text")==n)return void t.preventDefault()}var s=ns(),a=s.firstChild;i.display.lineSpace.insertBefore(s,i.display.lineSpace.firstChild),a.value=el.text.join("\n");var l=document.activeElement;Fs(a),setTimeout(function(){i.display.lineSpace.removeChild(s),l.focus(),l==o&&r.showPrimarySelection()},50)}}var n=this,r=this,i=r.cm,o=r.div=t.lineDiv;es(o,i.options.spellcheck),na(o,"paste",function(t){Et(i,t)||Zo(t,i)||ws<=11&&setTimeout(pr(i,function(){return n.updateFromDOM()}),20)}),na(o,"compositionstart",function(t){n.composing={data:t.data,done:!1}}),na(o,"compositionupdate",function(t){n.composing||(n.composing={data:t.data,done:!1})}),na(o,"compositionend",function(t){n.composing&&(t.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),na(o,"touchstart",function(){return r.forceCompositionEnd()}),na(o,"input",function(){n.composing||n.readFromDOMSoon()}),na(o,"copy",e),na(o,"cut",e)},rl.prototype.prepareSelection=function(){var t=An(this.cm,!1);return t.focus=this.cm.state.focused,t},rl.prototype.showSelection=function(t,e){t&&this.cm.display.view.length&&((t.focus||e)&&this.showPrimarySelection(),this.showMultipleSelections(t))},rl.prototype.showPrimarySelection=function(){var t=window.getSelection(),e=this.cm,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(e.display.viewTo==e.display.viewFrom||r.line>=e.display.viewTo||i.line<e.display.viewFrom)return void t.removeAllRanges();var o=cs(e,t.anchorNode,t.anchorOffset),s=cs(e,t.focusNode,t.focusOffset);if(!o||o.bad||!s||s.bad||0!=I(z(o,s),r)||0!=I(F(o,s),i)){var a=e.display.view,l=r.line>=e.display.viewFrom&&os(e,r)||{node:a[0].measure.map[2],offset:0},c=i.line<e.display.viewTo&&os(e,i);if(!c){var u=a[a.length-1].measure,h=u.maps?u.maps[u.maps.length-1]:u.map;c={node:h[h.length-1],offset:h[h.length-2]-h[h.length-3]}}if(!l||!c)return void t.removeAllRanges();var f,d=t.rangeCount&&t.getRangeAt(0);try{f=Ns(l.node,l.offset,c.offset,c.node)}catch(p){}f&&(!gs&&e.state.focused?(t.collapse(l.node,l.offset),f.collapsed||(t.removeAllRanges(),t.addRange(f))):(t.removeAllRanges(),t.addRange(f)),d&&null==t.anchorNode?t.addRange(d):gs&&this.startGracePeriod()),this.rememberSelection()}},rl.prototype.startGracePeriod=function(){var t=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){t.gracePeriod=!1,t.selectionChanged()&&t.cm.operation(function(){return t.cm.curOp.selectionChanged=!0})},20)},rl.prototype.showMultipleSelections=function(t){n(this.cm.display.cursorDiv,t.cursors),n(this.cm.display.selectionDiv,t.selection)},rl.prototype.rememberSelection=function(){var t=window.getSelection();this.lastAnchorNode=t.anchorNode,this.lastAnchorOffset=t.anchorOffset,this.lastFocusNode=t.focusNode,this.lastFocusOffset=t.focusOffset},rl.prototype.selectionInEditor=function(){var t=window.getSelection();if(!t.rangeCount)return!1;var e=t.getRangeAt(0).commonAncestorContainer;return o(this.div,e)},rl.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},rl.prototype.blur=function(){this.div.blur()},rl.prototype.getField=function(){return this.div},rl.prototype.supportsTouch=function(){return!0},rl.prototype.receivedFocus=function(){function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}var e=this;this.selectionInEditor()?this.pollSelection():dr(this.cm,function(){return e.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,t)},rl.prototype.selectionChanged=function(){var t=window.getSelection();return t.anchorNode!=this.lastAnchorNode||t.anchorOffset!=this.lastAnchorOffset||t.focusNode!=this.lastFocusNode||t.focusOffset!=this.lastFocusOffset},rl.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var t=window.getSelection(),e=this.cm;if(Os&&Cs&&this.cm.options.gutters.length&&ss(t.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=cs(e,t.anchorNode,t.anchorOffset),r=cs(e,t.focusNode,t.focusOffset);n&&r&&dr(e,function(){wi(e.doc,zr(n,r),qs),(n.bad||r.bad)&&(e.curOp.selectionChanged=!0)})}}},rl.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var t=this.cm,e=t.display,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(0==r.ch&&r.line>t.firstLine()&&(r=N(r.line-1,E(t.doc,r.line-1).length)),i.ch==E(t.doc,i.line).text.length&&i.line<t.lastLine()&&(i=N(i.line+1,0)),r.line<e.viewFrom||i.line>e.viewTo-1)return!1;var o,s,a;r.line==e.viewFrom||0==(o=Tn(t,r.line))?(s=L(e.view[0].line),a=e.view[0].node):(s=L(e.view[o].line),a=e.view[o-1].node.nextSibling);var l,c,u=Tn(t,i.line);if(u==e.view.length-1?(l=e.viewTo-1,c=e.lineDiv.lastChild):(l=L(e.view[u+1].line)-1,c=e.view[u+1].node.previousSibling),!a)return!1;for(var h=t.doc.splitLines(ls(t,a,c,s,l)),f=A(t.doc,N(s,0),N(l,E(t.doc,l).text.length));h.length>1&&f.length>1;)if(g(h)==g(f))h.pop(),f.pop(),l--;else{if(h[0]!=f[0])break;h.shift(),f.shift(),s++}for(var d=0,p=0,v=h[0],m=f[0],y=Math.min(v.length,m.length);d<y&&v.charCodeAt(d)==m.charCodeAt(d);)++d;for(var b=g(h),w=g(f),x=Math.min(b.length-(1==h.length?d:0),w.length-(1==f.length?d:0));p<x&&b.charCodeAt(b.length-p-1)==w.charCodeAt(w.length-p-1);)++p;if(1==h.length&&1==f.length&&s==r.line)for(;d&&d>r.ch&&b.charCodeAt(b.length-p-1)==w.charCodeAt(w.length-p-1);)d--,p++;h[h.length-1]=b.slice(0,b.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(d).replace(/\u200b+$/,"");var _=N(s,d),C=N(l,f.length?g(f).length-p:0);return h.length>1||h[0]||I(_,C)?(Ii(t.doc,h,_,C,"+input"),!0):void 0},rl.prototype.ensurePolled=function(){this.forceCompositionEnd()},rl.prototype.reset=function(){this.forceCompositionEnd()},rl.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},rl.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()},80))},rl.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||dr(this.cm,function(){return mr(t.cm)})},rl.prototype.setUneditable=function(t){t.contentEditable="false"},rl.prototype.onKeyPress=function(t){0!=t.charCode&&(t.preventDefault(),this.cm.isReadOnly()||pr(this.cm,Jo)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},rl.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},rl.prototype.onContextMenu=function(){},rl.prototype.resetPosition=function(){},rl.prototype.needsContentAttribute=!0;var il=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new zs,this.hasSelection=!1,this.composing=null};il.prototype.init=function(t){function e(t){if(!Et(i,t)){if(i.somethingSelected())Xo({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var e=ts(i);Xo({lineWise:!0,text:e.text}),"cut"==t.type?i.setSelections(e.ranges,null,qs):(r.prevInput="",s.value=e.text.join("\n"),Fs(s))}"cut"==t.type&&(i.state.cutIncoming=!0)}}var n=this,r=this,i=this.cm,o=this.wrapper=ns(),s=this.textarea=o.firstChild;t.wrapper.insertBefore(o,t.wrapper.firstChild),As&&(s.style.width="0px"),na(s,"input",function(){bs&&ws>=9&&n.hasSelection&&(n.hasSelection=null),r.poll()}),na(s,"paste",function(t){Et(i,t)||Zo(t,i)||(i.state.pasteIncoming=!0,r.fastPoll())}),na(s,"cut",e),na(s,"copy",e),na(t.scroller,"paste",function(e){Ne(t,e)||Et(i,e)||(i.state.pasteIncoming=!0,r.focus())}),na(t.lineSpace,"selectstart",function(e){Ne(t,e)||Lt(e)}),na(s,"compositionstart",function(){var t=i.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:t,range:i.markText(t,i.getCursor("to"),{className:"CodeMirror-composing"})}}),na(s,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},il.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,r=An(t);if(t.options.moveInputWithCursor){var i=cn(t,n.sel.primary().head,"div"),o=e.wrapper.getBoundingClientRect(),s=e.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,i.top+s.top-o.top)),r.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,i.left+s.left-o.left))}return r},il.prototype.showSelection=function(t){var e=this.cm,r=e.display;n(r.cursorDiv,t.cursors),n(r.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},il.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&Fs(this.textarea),bs&&ws>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",bs&&ws>=9&&(this.hasSelection=null))}},il.prototype.getField=function(){return this.textarea},il.prototype.supportsTouch=function(){return!1},il.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!Ms||s()!=this.textarea))try{this.textarea.focus()}catch(t){}},il.prototype.blur=function(){this.textarea.blur()},il.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},il.prototype.receivedFocus=function(){this.slowPoll()},il.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){t.poll(),t.cm.state.focused&&t.slowPoll()})},il.prototype.fastPoll=function(){function t(){var r=n.poll();r||e?(n.pollingFast=!1,n.slowPoll()):(e=!0,n.polling.set(60,t))}var e=!1,n=this;n.pollingFast=!0,n.polling.set(20,t)},il.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||oa(n)&&!r&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var i=n.value;if(i==r&&!e.somethingSelected())return!1;if(bs&&ws>=9&&this.hasSelection===i||Ls&&/[\uf700-\uf7ff]/.test(i))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var s=0,a=Math.min(r.length,i.length);s<a&&r.charCodeAt(s)==i.charCodeAt(s);)++s;return dr(e,function(){Jo(e,i.slice(s),r.length-s,null,t.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=i,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},il.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},il.prototype.onKeyPress=function(){bs&&ws>=9&&(this.hasSelection=null),this.fastPoll()},il.prototype.onContextMenu=function(t){function e(){if(null!=s.selectionStart){var t=i.somethingSelected(),e=""+(t?s.value:"");s.value="⇚",s.value=e,r.prevInput=t?"":"",s.selectionStart=1,s.selectionEnd=e.length,o.selForContextMenu=i.doc.sel}}function n(){if(r.contextMenuPending=!1,r.wrapper.style.cssText=h,s.style.cssText=u,bs&&ws<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=l),null!=s.selectionStart){(!bs||bs&&ws<9)&&e();var t=0,n=function(){
o.selForContextMenu==i.doc.sel&&0==s.selectionStart&&s.selectionEnd>0&&""==r.prevInput?pr(i,Ai)(i):t++<10?o.detectingSelectAll=setTimeout(n,500):(o.selForContextMenu=null,o.input.reset())};o.detectingSelectAll=setTimeout(n,200)}}var r=this,i=r.cm,o=i.display,s=r.textarea,a=Sn(i,t),l=o.scroller.scrollTop;if(a&&!ks){var c=i.options.resetSelectionOnContextMenu;c&&i.doc.sel.contains(a)==-1&&pr(i,wi)(i.doc,zr(a),qs);var u=s.style.cssText,h=r.wrapper.style.cssText;r.wrapper.style.cssText="position: absolute";var f=r.wrapper.getBoundingClientRect();s.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-f.top-5)+"px; left: "+(t.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(bs?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var d;if(xs&&(d=window.scrollY),o.input.focus(),xs&&window.scrollTo(null,d),o.input.reset(),i.somethingSelected()||(s.value=r.prevInput=" "),r.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),bs&&ws>=9&&e(),Rs){Dt(t);var p=function(){St(window,"mouseup",p),setTimeout(n,20)};na(window,"mouseup",p)}else setTimeout(n,50)}},il.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t},il.prototype.setUneditable=function(){},il.prototype.needsContentAttribute=!1,Ho(Go),nl(Go);var ol="iter insert remove copy getEditor constructor".split(" ");for(var sl in Ia.prototype)Ia.prototype.hasOwnProperty(sl)&&f(ol,sl)<0&&(Go.prototype[sl]=function(t){return function(){return t.apply(this.doc,arguments)}}(Ia.prototype[sl]));return Mt(Ia),Go.inputStyles={textarea:il,contenteditable:rl},Go.defineMode=function(t){Go.defaults.mode||"null"==t||(Go.defaults.mode=t),zt.apply(this,arguments)},Go.defineMIME=$t,Go.defineMode("null",function(){return{token:function(t){return t.skipToEnd()}}}),Go.defineMIME("text/plain","null"),Go.defineExtension=function(t,e){Go.prototype[t]=e},Go.defineDocExtension=function(t,e){Ia.prototype[t]=e},Go.fromTextArea=hs,fs(Go),Go.version="5.31.0",Go})},function(t,e,n){"use strict";var r=n(0),i=1,o=2,s=r.Model.extend({idAttribute:"name",defaults:{name:"",label:"",type:i,active:!0,"private":!1,"protected":!1},initialize:function(){var t=this.get("name"),e=this.get("label");t?e||this.set("label",t):this.set("name",e),this.set("name",s.escapeName(this.get("name")))},getFullName:function(){var t="";switch(this.get("type")){case i:t=".";break;case o:t="#"}return t+this.get("name")}},{TYPE_CLASS:i,TYPE_ID:o,escapeName:function(t){return(""+t).trim().replace(/([^a-z0-9\w-]+)/gi,"-")}});t.exports=s},function(t,e,n){"use strict";var r=(n(1),n(0)),i=r.$;t.exports=r.View.extend({events:{change:"onChange"},attributes:function(){return this.model.get("attributes")},initialize:function(t){var e=this.model,n=(e.get("name"),e.target);this.config=t.config||{},this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.target=n,this.className=this.pfx+"trait",this.labelClass=this.ppfx+"label",this.fieldClass=this.ppfx+"field "+this.ppfx+"field-"+e.get("type"),this.inputhClass=this.ppfx+"input-holder",e.off("change:value",this.onValueChange),this.listenTo(e,"change:value",this.onValueChange),this.tmpl='<div class="'+this.fieldClass+'"><div class="'+this.inputhClass+'"></div></div>'},onChange:function(){this.model.set("value",this.getInputEl().value)},getValueForTarget:function(){return this.model.get("value")},setInputValue:function(t){this.getInputEl().value=t},onValueChange:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.model;this.target,r.get("name");if(n.fromTarget)this.setInputValue(r.get("value"));else{var i=this.getValueForTarget();r.setTargetValue(i)}},renderLabel:function(){this.$el.html('<div class="'+this.labelClass+'">'+this.getLabel()+"</div>")},getLabel:function(){var t=this.model,e=t.get("label")||t.get("name");return e.charAt(0).toUpperCase()+e.slice(1).replace(/-/g," ")},getInputEl:function(){if(!this.$input){var t=this.model,e=this.target,n=t.get("name"),r=t.get("placeholder")||t.get("default")||"",o=t.get("type")||"text",s=e.get("attributes"),a=t.get("min"),l=t.get("max"),c=t.get("changeProp")?e.get(n):t.get("value")||s[n],u=i('<input type="'+o+'" placeholder="'+r+'">');c&&u.prop("value",c),a&&u.prop("min",a),l&&u.prop("max",l),this.$input=u}return this.$input.get(0)},getModelValue:function(){var t,e=this.model,n=this.target,r=e.get("name");if(e.get("changeProp"))t=n.get(r);else{var i=n.get("attributes");t=e.get("value")||i[r]}return t},renderField:function(){if(!this.$input){this.$el.append(this.tmpl);var t=this.getInputEl(),e=this.el.querySelector("."+this.inputhClass);e.insertBefore(t,e.childNodes[0])}},render:function(){return this.renderLabel(),this.renderField(),this.el.className=this.className,this}})},function(t,e,n){"use strict";var r,i;!function(o,s){r=s,i="function"==typeof r?r.call(e,n,e,t):r,!(void 0!==i&&(t.exports=i))}(this,function(){function t(t,e){e=e||E;var n=R.test(t)?e.getElementsByClassName(t.slice(1)):F.test(t)?e.getElementsByTagName(t):e.querySelectorAll(t);return n}function e(t){if(!T){T=E.implementation.createHTMLDocument();var e=T.createElement("base");e.href=E.location.href,T.head.appendChild(e)}return T.body.innerHTML=t,T.body.childNodes}function n(t){"loading"!==E.readyState?t():E.addEventListener("DOMContentLoaded",t)}function r(r,i){if(!r)return this;if(r.cash&&r!==A)return r;var o,s=r,a=0;if(N(r))s=I.test(r)?E.getElementById(r.slice(1)):B.test(r)?e(r):t(r,i);else if(D(r))return n(r),this;if(!s)return this;if(s.nodeType||s===A)this[0]=s,this.length=1;else for(o=this.length=s.length;a<o;a++)this[a]=s[a];return this}function i(t,e){return new r(t,e)}function o(t,e){for(var n=t.length,r=0;r<n&&e.call(t[r],t[r],r,t)!==!1;r++);}function s(t,e){var n=t&&(t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector);return!!n&&n.call(t,e)}function a(t){return N(t)?s:t.cash?function(e){return t.is(e)}:function(t,e){return t===e}}function l(t){return i(M.call(t).filter(function(t,e,n){return n.indexOf(t)===e}))}function c(t){return t[$]=t[$]||{}}function u(t,e,n){return c(t)[e]=n}function h(t,e){var n=c(t);return void 0===n[e]&&(n[e]=t.dataset?t.dataset[e]:i(t).attr("data-"+e)),n[e]}function f(t,e){var n=c(t);n?delete n[e]:t.dataset?delete t.dataset[e]:i(t).removeAttr("data-"+name)}function d(t){return N(t)&&t.match(V)}function p(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.className)}function g(t,e,n){t.classList?t.classList.add(e):n.indexOf(" "+e+" ")&&(t.className+=" "+e)}function v(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(e,"")}function m(t,e){return parseInt(A.getComputedStyle(t[0],null)[e],10)||0}function y(t,e,n){var r=h(t,"_cashEvents")||u(t,"_cashEvents",{});r[e]=r[e]||[],r[e].push(n),t.addEventListener(e,n)}function b(t,e,n){var r,i=h(t,"_cashEvents"),s=i&&i[e];s&&(n?(t.removeEventListener(e,n),r=s.indexOf(n),r>=0&&s.splice(r,1)):(o(s,function(n){t.removeEventListener(e,n)}),s=[]))}function w(t,e){return"&"+encodeURIComponent(t)+"="+encodeURIComponent(e).replace(/%20/g,"+")}function x(t){var e=[];return o(t.options,function(t){t.selected&&e.push(t.value)}),e.length?e:null}function _(t){var e=t.selectedIndex;return e>=0?t.options[e].value:null}function C(t){var e=t.type;if(!e)return null;switch(e.toLowerCase()){case"select-one":return _(t);case"select-multiple":return x(t);case"radio":return t.checked?t.value:null;case"checkbox":return t.checked?t.value:null;default:return t.value?t.value:null}}function k(t,e,n){if(n){var r=t.childNodes[0];t.insertBefore(e,r)}else t.appendChild(e)}function S(t,e,n){var r=N(e);return!r&&e.length?void o(e,function(e){return S(t,e,n)}):void o(t,r?function(t){return t.insertAdjacentHTML(n?"afterbegin":"beforeend",e)}:function(t,r){return k(t,0===r?e:e.cloneNode(!0),n)})}var T,E=document,A=window,O=Array.prototype,M=O.slice,L=O.filter,P=O.push,j=function(){},D=function(t){return typeof t==typeof j&&t.call},N=function(t){return"string"==typeof t},I=/^#[\w-]*$/,R=/^\.[\w-]*$/,B=/<.+>/,F=/^\w+$/,z=i.fn=i.prototype=r.prototype={cash:!0,length:0,push:P,splice:O.splice,map:O.map,init:r};Object.defineProperty(z,"constructor",{value:i}),i.parseHTML=e,i.noop=j,i.isFunction=D,i.isString=N,i.extend=z.extend=function(t){t=t||{};var e=M.call(arguments),n=e.length,r=1;for(1===e.length&&(t=this,r=0);r<n;r++)if(e[r])for(var i in e[r])e[r].hasOwnProperty(i)&&(t[i]=e[r][i]);return t},i.extend({merge:function(t,e){for(var n=+e.length,r=t.length,i=0;i<n;r++,i++)t[r]=e[i];return t.length=r,t},each:o,matches:s,unique:l,isArray:Array.isArray,isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)}});var $=i.uid="_cash"+Date.now();z.extend({data:function(t,e){if(N(t))return void 0===e?h(this[0],t):this.each(function(n){return u(n,t,e)});for(var n in t)this.data(n,t[n]);return this},removeData:function(t){return this.each(function(e){return f(e,t)})}});var V=/\S+/g;z.extend({addClass:function(t){var e=d(t);return e?this.each(function(t){var n=" "+t.className+" ";o(e,function(e){g(t,e,n)})}):this},attr:function(t,e){if(t){if(N(t))return void 0===e?this[0]?this[0].getAttribute?this[0].getAttribute(t):this[0][t]:void 0:this.each(function(n){n.setAttribute?n.setAttribute(t,e):n[t]=e});for(var n in t)this.attr(n,t[n]);return this}},hasClass:function(t){var e=!1,n=d(t);return n&&n.length&&this.each(function(t){return e=p(t,n[0]),!e}),e},prop:function(t,e){if(N(t))return void 0===e?this[0][t]:this.each(function(n){n[t]=e});for(var n in t)this.prop(n,t[n]);return this},removeAttr:function(t){return this.each(function(e){e.removeAttribute?e.removeAttribute(t):delete e[t]})},removeClass:function(t){if(!arguments.length)return this.attr("class","");var e=d(t);return e?this.each(function(t){o(e,function(e){v(t,e)})}):this},removeProp:function(t){return this.each(function(e){delete e[t]})},toggleClass:function(t,e){if(void 0!==e)return this[e?"addClass":"removeClass"](t);var n=d(t);return n?this.each(function(t){var e=" "+t.className+" ";o(n,function(n){p(t,n)?v(t,n):g(t,n,e)})}):this}}),z.extend({add:function(t,e){return l(i.merge(this,i(t,e)))},each:function(t){return o(this,t),this},eq:function(t){return i(this.get(t))},filter:function(t){if(!t)return this;var e=D(t)?t:a(t);return i(L.call(this,function(n){return e(n,t)}))},first:function(){return this.eq(0)},get:function(t){return void 0===t?M.call(this):t<0?this[t+this.length]:this[t]},index:function(t){var e=t?i(t)[0]:this[0],n=t?this:i(e).parent().children();return M.call(n).indexOf(e)},last:function(){return this.eq(-1)}});var H=function(){var t=/(?:^\w|[A-Z]|\b\w)/g,e=/[\s-_]+/g;return function(n){return n.replace(t,function(t,e){return t[0===e?"toLowerCase":"toUpperCase"]()}).replace(e,"")}}(),U=function(){var t={},e=document,n=e.createElement("div"),r=n.style;return function(e){if(e=H(e),t[e])return t[e];var n=e.charAt(0).toUpperCase()+e.slice(1),i=["webkit","moz","ms","o"],s=(e+" "+i.join(n+" ")+n).split(" ");return o(s,function(n){if(n in r)return t[n]=e=t[e]=n,!1}),t[e]}}();i.prefixedProp=U,i.camelCase=H,z.extend({css:function(t,e){if(N(t))return t=U(t),arguments.length>1?this.each(function(n){return n.style[t]=e}):A.getComputedStyle(this[0])[t];for(var n in t)this.css(n,t[n]);return this}}),o(["Width","Height"],function(t){var e=t.toLowerCase();z[e]=function(){return this[0].getBoundingClientRect()[e]},z["inner"+t]=function(){return this[0]["client"+t]},z["outer"+t]=function(e){return this[0]["offset"+t]+(e?m(this,"margin"+("Width"===t?"Left":"Top"))+m(this,"margin"+("Width"===t?"Right":"Bottom")):0)}}),z.extend({off:function(t,e){return this.each(function(n){return b(n,t,e)})},on:function(t,e,r,i){var o;if(!N(t)){for(var a in t)this.on(a,e,t[a]);return this}return D(e)&&(r=e,e=null),"ready"===t?(n(r),this):(e&&(o=r,r=function(t){for(var n=t.target;!s(n,e);){if(n===this)return n=!1;n=n.parentNode}n&&o.call(n,t)}),this.each(function(e){var n=r;i&&(n=function(){r.apply(this,arguments),b(e,t,n)}),y(e,t,n)}))},one:function(t,e,n){return this.on(t,e,n,!0)},ready:n,trigger:function(t,e){var n=E.createEvent("HTMLEvents");return n.data=e,n.initEvent(t,!0,!1),this.each(function(t){return t.dispatchEvent(n)})}}),z.extend({serialize:function(){var t="";return o(this[0].elements||this,function(e){if(!e.disabled&&"FIELDSET"!==e.tagName){var n=e.name;switch(e.type.toLowerCase()){case"file":case"reset":case"submit":case"button":break;case"select-multiple":var r=C(e);null!==r&&o(r,function(e){t+=w(n,e)});break;default:var i=C(e);null!==i&&(t+=w(n,i))}}}),t.substr(1)},val:function(t){return void 0===t?C(this[0]):this.each(function(e){return e.value=t})}}),z.extend({after:function(t){return i(t).insertAfter(this),this},append:function(t){return S(this,t),this},appendTo:function(t){return S(i(t),this),this},before:function(t){return i(t).insertBefore(this),this},clone:function(){return i(this.map(function(t){return t.cloneNode(!0)}))},empty:function(){return this.html(""),this},html:function(t){if(void 0===t)return this[0].innerHTML;var e=t.nodeType?t[0].outerHTML:t;return this.each(function(t){return t.innerHTML=e})},insertAfter:function(t){var e=this;return i(t).each(function(t,n){var r=t.parentNode,i=t.nextSibling;e.each(function(t){r.insertBefore(0===n?t:t.cloneNode(!0),i)})}),this},insertBefore:function(t){var e=this;return i(t).each(function(t,n){var r=t.parentNode;e.each(function(e){r.insertBefore(0===n?e:e.cloneNode(!0),t)})}),this},prepend:function(t){return S(this,t,!0),this},prependTo:function(t){return S(i(t),this,!0),this},remove:function(){return this.each(function(t){return t.parentNode.removeChild(t)})},text:function(t){return void 0===t?this[0].textContent:this.each(function(e){return e.textContent=t})}});var q=E.documentElement;return z.extend({position:function(){var t=this[0];return{left:t.offsetLeft,top:t.offsetTop}},offset:function(){var t=this[0].getBoundingClientRect();return{top:t.top+A.pageYOffset-q.clientTop,left:t.left+A.pageXOffset-q.clientLeft}},offsetParent:function(){return i(this[0].offsetParent)}}),z.extend({children:function(t){var e=[];return this.each(function(t){P.apply(e,t.children)}),e=l(e),t?e.filter(function(e){return s(e,t)}):e},closest:function(t){return!t||this.length<1?i():this.is(t)?this.filter(t):this.parent().closest(t)},is:function(t){if(!t)return!1;var e=!1,n=a(t);return this.each(function(r){return e=n(r,t),!e}),e},find:function(e){if(!e||e.nodeType)return i(e&&this.has(e).length?e:null);var n=[];return this.each(function(r){P.apply(n,t(e,r))}),l(n)},has:function(e){var n=N(e)?function(n){return 0!==t(e,n).length}:function(t){return t.contains(e)};return this.filter(n)},next:function(){return i(this[0].nextElementSibling)},not:function(t){if(!t)return this;var e=a(t);return this.filter(function(n){return!e(n,t)})},parent:function(){var t=[];return this.each(function(e){e&&e.parentNode&&t.push(e.parentNode)}),l(t)},parents:function(t){var e,n=[];return this.each(function(r){for(e=r;e&&e.parentNode&&e!==E.body.parentNode;)e=e.parentNode,(!t||t&&s(e,t))&&n.push(e)}),l(n)},prev:function(){return i(this[0].previousElementSibling)},siblings:function(){var t=this.parent().children(),e=this[0];return t.filter(function(t){return t!==e})}}),i})},function(t,e,n){"use strict";var r=n(1),i=n(7);t.exports=n(0).Collection.extend({model:i,getStyleable:function(){return(0,r.filter)(this.models,function(t){return t.get("active")&&!t.get("private")})},getValid:function(){return(0,r.filter)(this.models,function(t){return!t.get("private")})},getFullString:function(t){var e=[],n=t||this;return n.forEach(function(t){return e.push(t.getFullName())}),e.join("").trim()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o=n(32),s=r(o),a=n(12);t.exports=n(0).Collection.extend(s["default"]).extend({types:[{id:"stack",model:n(119),view:n(34),isType:function(t){if(t&&"stack"==t.type)return t}},{id:"composite",model:n(33),view:n(17),isType:function(t){if(t&&"composite"==t.type)return t}},{id:"file",model:a,view:n(40),isType:function(t){if(t&&"file"==t.type)return t}},{id:"color",model:a,view:n(38),isType:function(t){if(t&&"color"==t.type)return t}},{id:"select",model:n(41),view:n(37),isType:function(t){if(t&&"select"==t.type)return t}},{id:"radio",model:n(41),view:n(36),isType:function(t){if(t&&"radio"==t.type)return t}},{id:"slider",model:n(125),view:n(126),isType:function(t){if(t&&"slider"==t.type)return t}},{id:"integer",model:n(42),view:n(14),isType:function(t){if(t&&"integer"==t.type)return t}},{id:"base",model:a,view:n(5),isType:function(t){return t.type="base",t}}],deepClone:function(){var t=this.clone();return t.reset(t.map(function(t){var e=t.clone();return e.typeView=t.typeView,e})),t},parseValue:function(t){var e=this,n=[],r=t.split(" ");return r.forEach(function(t,r){var o=e.at(r);n.push(i({},o.attributes,{value:t}))}),n},getFullValue:function(){var t="";return this.each(function(e){return t+=e.getFullValue()+" "}),t.trim()}})},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};t.exports=n(0).Model.extend({defaults:{name:"",property:"",type:"",defaults:"",info:"",value:"",icon:"",functionName:"",status:"",visible:!0,fixedValues:["initial","inherit"],toRequire:0},initialize:function(t){var e=this.get("name"),n=this.get("property");e||this.set("name",n.charAt(0).toUpperCase()+n.slice(1).replace(/-/g," "));var r=this.init&&this.init.bind(this);r&&r()},setValue:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.parseValue(t);this.set(i,r({},n,{avoidStore:1})),e&&(this.set("value","",n),this.set(i,n))},setValueFromInput:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.setValue(t,e,r({},n,{fromInput:1}))},parseValue:function(t){var e={value:t};if(!this.get("functionName"))return e;var n=[],r=""+t,i=r.indexOf("(")+1,o=r.lastIndexOf(")");return n.push(i),o>=0&&n.push(o),e.value=String.prototype.substring.apply(r,n),e},getDefaultValue:function(){return this.get("defaults")},getFullValue:function(t){var e=this.get("functionName"),n=t||this.get("value");return e&&(n=e+"("+n+")"),n}})},function(t,e,n){"use strict";(function(e){n(5),n(14),n(36),n(37),n(38),n(40),n(17),n(34);t.exports=e.View.extend({initialize:function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix||"",this.target=t.target||{},this.propTarget=t.propTarget||{},this.onChange=t.onChange,this.onInputRender=t.onInputRender||{},this.customValue=t.customValue||{};var e=this.collection;this.listenTo(e,"add",this.addTo),this.listenTo(e,"reset",this.render)},addTo:function(t){this.add(t)},add:function(t,e){var n=new t.typeView({model:t,name:t.get("name"),id:this.pfx+t.get("property"),target:this.target,propTarget:this.propTarget,onChange:this.onChange,onInputRender:this.onInputRender,config:this.config});"composite"!=t.get("type")&&(n.customValue=this.customValue),n.render();var r=n.el;e?e.appendChild(r):this.el.appendChild(r)},render:function(){var t=this,e=document.createDocumentFragment();return this.collection.each(function(n){return t.add(n,e)}),this.$el.append(e),this.$el.attr("class",this.pfx+"properties"),this}})}).call(e,n(0))},function(t,e,n){"use strict";(function(e){var r=(n(18),e.$);t.exports=n(5).extend({templateInput:function(){return""},init:function(){var t=this.model;this.listenTo(t,"change:unit",this.modelValueChanged),this.listenTo(t,"el:change",this.elementUpdated)},setValue:function(t){this.inputInst.setValue(t,{silent:1})},onRender:function(){var t=this.ppfx;if(!this.input){var e=this.model.input;e.ppfx=t,e.render();var n=this.el.querySelector("."+t+"fields");n.appendChild(e.el),this.$input=e.inputEl,this.unit=e.unitEl,this.$unit=r(this.unit),this.input=this.$input.get(0),this.inputInst=e}}})}).call(e,n(0))},function(t,e,n){"use strict";var r=(n(0),n(3));t.exports=r.extend({tagName:"img",events:{dblclick:"openModal",click:"initResize"},initialize:function(t){var e=this.model;r.prototype.initialize.apply(this,arguments),this.listenTo(e,"change:src",this.updateSrc),this.listenTo(e,"dblclick active",this.openModal),this.classEmpty=this.ppfx+"plh-image";var n=this.config;n.modal&&(this.modal=n.modal),n.am&&(this.am=n.am),this.fetchFile()},fetchFile:function(){var t=this.model,e=t.get("file");if(e){var n=this.em.get("AssetManager").FileUploader();n.uploadFile({dataTransfer:{files:[e]}},function(e){var n=e&&e.data&&e.data[0],r=n&&n.src;r&&t.set({src:r})}),t.set("file","")}},updateSrc:function(){var t=this.model.get("src"),e=this.$el;e.attr("src",t),e[t?"removeClass":"addClass"](this.classEmpty)},openModal:function(t){var e=this.opts.config.em,n=e?e.get("Editor"):"";n&&this.model.get("editable")&&n.runCommand("open-assets",{target:this.model,onSelect:function(){n.Modal.close(),n.AssetManager.setTarget(null)}})},render:function(){this.updateAttributes(),this.updateClasses();var t=this.$el.attr("class")||"";return this.model.get("src")||this.$el.attr("class",(t+" "+this.classEmpty).trim()),this.$el.attr("onmousedown","return false"),this}})},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(r){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";(function(e){var r=n(5),i=e.$;t.exports=r.extend({templateInput:function(){var t=this.pfx;return'\n <div class="'+t+"field "+t+'composite">\n <span id="'+t+'input-holder"></span>\n </div>\n '},inputValueChanged:function(){if(!this.model.get("detached")){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];r.prototype.inputValueChanged.apply(this,e)}},onRender:function(){var t=this.model,e=t.get("properties")||[];if(e.length&&(this.$input||(this.$input=i('<input type="hidden" value="0">'),this.input=this.$input.get(0)),this.props||(this.props=t.get("properties")),!this.$props)){this.props.each(function(e,n){e&&"composite"==e.get("type")&&this.props.remove(e),e.parent=t},this);var r=n(13),o=new r(this.getPropsConfig());this.$props=o.render().$el,this.$el.find("#"+this.pfx+"input-holder").append(this.$props)}},getPropsConfig:function(t){var e=this,n=this.model,r={config:this.config,collection:this.props,target:this.target,propTarget:this.propTarget,onChange:function(t,e,r){n.set("value",n.getFullValue(),r)},customValue:function(t,n){return e.valueOnIndex(n,t)}};return n.get("detached")&&delete r.onChange,r},valueOnIndex:function(t,e){var n=void 0,r=this.getTargetValue({ignoreDefault:1});if(r){var i=r.split(" ");n=i[t]}else n=e&&e.getTargetValue({ignoreCustomValue:1,ignoreDefault:1});return e&&(n=e.model.parseValue(n).value),n}})}).call(e,n(0))},function(t,e,n){"use strict";(function(e){var r=n(1),i=n(2),o=n(35),s=n(0);s.$;t.exports=o.extend({events:{"change input":"handleChange","change select":"handleUnitChange","click [data-arrow-up]":"upArrowClick","click [data-arrow-down]":"downArrowClick","mousedown [data-arrows]":"downIncrement"},template:function(){var t=this.ppfx;return'\n <span class="'+t+'input-holder"></span>\n <span class="'+t+'field-units"></span>\n <div class="'+t+'field-arrows" data-arrows>\n <div class="'+t+'field-arrow-u" data-arrow-up></div>\n <div class="'+t+'field-arrow-d" data-arrow-down></div>\n </div>\n '},inputClass:function(){var t=this.ppfx;return this.opts.contClass||t+"field "+t+"field-integer"},initialize:function(){arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o.prototype.initialize.apply(this,arguments),(0,r.bindAll)(this,"moveIncrement","upIncrement"),this.doc=document,this.listenTo(this.model,"change:unit",this.handleModelChange)},setValue:function(t,e){var n=e||{},r=this.validateInputValue(t,{deepCheck:1}),i={value:r.value};(r.unit||r.force)&&(i.unit=r.unit),this.model.set(i,n),n.silent&&this.handleModelChange()},handleChange:function(t){t.stopPropagation(),this.setValue(this.getInputEl().value),this.elementUpdated()},handleUnitChange:function(t){t.stopPropagation();var e=this.getUnitEl().value;this.model.set("unit",e),this.elementUpdated()},elementUpdated:function(){this.model.trigger("el:change")},handleModelChange:function(){var t=this.model;this.getInputEl().value=t.get("value");var e=this.getUnitEl();e&&(e.value=t.get("unit")||"")},getUnitEl:function(){if(!this.unitEl){var t=this.model,e=t.get("units")||[];if(e.length){var n=[];e.forEach(function(e){var r=e==t.get("unit")?"selected":"";n.push("<option "+r+">"+e+"</option>")});var r=document.createElement("div");r.innerHTML='<select class="'+this.ppfx+'input-unit">'+n.join("")+"</select>",this.unitEl=r.firstChild}}return this.unitEl},upArrowClick:function(){var t=this.model,e=t.get("step"),n=parseInt(t.get("value"),10);n=this.normalizeValue(n+e);var r=this.validateInputValue(n);t.set("value",r.value),this.elementUpdated()},downArrowClick:function(){var t=this.model,e=t.get("step"),n=parseInt(t.get("value"),10),r=this.normalizeValue(n-e),i=this.validateInputValue(r);t.set("value",i.value),this.elementUpdated()},downIncrement:function(t){t.preventDefault(),this.moved=0;var e=this.model.get("value");e=this.normalizeValue(e),this.current={y:t.pageY,val:e},(0,i.on)(this.doc,"mousemove",this.moveIncrement),(0,i.on)(this.doc,"mouseup",this.upIncrement)},moveIncrement:function(t){this.moved=1;var e=this.model,n=e.get("step"),r=this.current,i=this.normalizeValue(r.val+(r.y-t.pageY)*n);return this.prValue=this.validateInputValue(i).value,e.set("value",this.prValue,{avoidStore:1}),!1},upIncrement:function(){var t=this.model,e=t.get("step");if((0,i.off)(this.doc,"mouseup",this.upIncrement),(0,i.off)(this.doc,"mousemove",this.moveIncrement),this.prValue&&this.moved){var n=this.prValue-e;t.set("value",n,{avoidStore:1}).set("value",n+e),this.elementUpdated()}},normalizeValue:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.model,r=n.get("step"),i=0;if(isNaN(t))return e;if(t=parseFloat(t),Math.floor(t)!==t){var o=r.toString().split(".")[1];i=o?o.length:0}return i?parseFloat(t.toFixed(i)):t},validateInputValue:function(t,n){var r=0,i=n||{},o=this.model,s=""!==t?t:o.get("defaults"),a=o.get("units")||[],l=o.get("unit")||a.length&&a[0]||"",c=o.get("max"),u=o.get("min");if(i.deepCheck){var h=o.get("fixedValues")||[];if(s){var f=new RegExp("^"+h.join("|"),"g");if(h.length&&f.test(s))s=s.match(f)[0],l="",r=1;else{var d=s+"";s+="",s=parseFloat(s.replace(",",".")),s=isNaN(s)?o.get("defaults"):s;var p=d.replace(s,"");e.indexOf(a,p)>=0&&(l=p)}}}return"undefined"!=typeof c&&""!==c&&(s=s>c?c:s),"undefined"!=typeof u&&""!==u&&(s=s<u?u:s),{force:r,value:s,unit:l}},render:function(){o.prototype.render.call(this);var t=this.getUnitEl();return t&&this.$el.find("."+this.ppfx+"field-units").get(0).appendChild(t),this}})}).call(e,n(1))},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(4);t.exports=i.extend({defaults:r({},i.prototype.defaults,{type:"tbody",tagName:"tbody",draggable:["table"],droppable:["tr"],columns:1,rows:1}),initialize:function(t,e){i.prototype.initialize.apply(this,arguments);var n=this.get("components"),r=this.get("columns"),o=this.get("rows");if(!n.length){for(var s=[];o--;){for(var a=[],l=r;l--;)a.push({type:"cell",classes:["cell"]});s.push({type:"row",classes:["row"],components:a})}n.add(s)}}},{isComponent:function(t){var e="";return"TBODY"==t.tagName&&(e={type:"tbody"}),e}})},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(4);t.exports=i.extend({defaults:r({},i.prototype.defaults,{type:"image",tagName:"img",src:"","void":1,droppable:0,editable:1,highlightable:0,resizable:1,traits:["alt"],file:""}),initialize:function(t,e){i.prototype.initialize.apply(this,arguments);var n=this.get("attributes");n.src&&this.set("src",n.src)},initToolbar:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];i.prototype.initToolbar.apply(this,e);var r=this.em;if(r){var o=r.get("Commands"),s="image-editor";if(o.has(s)){var a=this.get("toolbar");a.push({attributes:{"class":"fa fa-pencil"},command:s}),this.set("toolbar",a)}}},getAttrToHTML:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=i.prototype.getAttrToHTML.apply(this,e);delete r.onmousedown;var o=this.get("src");return o&&(r.src=o),r},parseUri:function(t){var e=document.createElement("a");e.href=t;for(var n={},r=e.search.substring(1).split("&"),i=0;i<r.length;i++){var o=r[i].split("="),s=decodeURIComponent(o[0]);s&&(n[s]=decodeURIComponent(o[1]))}return{hostname:e.hostname,pathname:e.pathname,protocol:e.protocol,search:e.search,hash:e.hash,port:e.port,query:n}}},{isComponent:function(t){var e="";return"IMG"==t.tagName&&(e={type:"image"}),e}})},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=n(1),s=n(2),a=n(187),l=n(189),c=(n(23),n(0).$),u=void 0;t.exports={init:function(t){(0,o.bindAll)(this,"onHover","onOut","onClick","onKeyPress","onFrameScroll")},enable:function(){this.frameOff=this.canvasOff=this.adjScroll=null;this.config.em.get("Config");this.startSelectComponent();var t=this.config.em;u=1,t.on("component:update",this.updateAttached,this),t.on("change:canvasOffset",this.updateAttached,this)},startSelectComponent:function(){this.toggleSelectComponent(1)},stopSelectComponent:function(){this.toggleSelectComponent()},toggleSelectComponent:function(t){var e=this.em,n=t?"on":"off",r={on:s.on,off:s.off},i=this.getCanvasBody(),o=this.getContentWindow();r[n](i,"mouseover",this.onHover),r[n](i,"mouseout",this.onOut),r[n](i,"click",this.onClick),r[n](o,"scroll",this.onFrameScroll),r[n](o,"keydown",this.onKeyPress),e[n]("change:selectedComponent",this.onSelect,this)},onKeyPress:function(t){var e=t.which||t.keyCode,n=this.editorModel.get("selectedComponent"),r="BODY"!==this.frameEl.contentDocument.activeElement.tagName;if((8==e||46==e)&&(r||t.preventDefault(),n&&!r)){if(!n.get("removable"))return;n.set("status",""),n.destroy(),this.hideBadge(),this.clean(),this.hideHighlighter(),this.editorModel.set("selectedComponent",null)}},onHover:function(t){t.stopPropagation();var e=t.target,n=c(e).data("model");if(this.adjScroll||(this.adjScroll=1,this.onFrameScroll(t),this.updateAttached()),n&&!n.get("hoverable")){for(var r=n&&n.parent();r&&!r.get("hoverable");)r=r.parent();r&&(e=r.view.el)}var i=this.getElementPos(e);this.updateBadge(e,i),this.updateHighlighter(e,i),this.showElementOffset(e,i)},onOut:function(t){t.stopPropagation(),this.hideBadge(),this.hideHighlighter(),this.hideElementOffset()},showElementOffset:function(t,e){var n=c(t),r=n.data("model");r&&"selected"==r.get("status")||!u||this.editor.runCommand("show-offset",{el:t,elPos:e})},hideElementOffset:function(t,e){this.editor.stopCommand("show-offset")},showFixedElementOffset:function(t,e){this.editor.runCommand("show-offset",{el:t,elPos:e,state:"Fixed"})},hideFixedElementOffset:function(t,e){this.editor&&this.editor.stopCommand("show-offset",{state:"Fixed"})},hideHighlighter:function(){this.canvas.getHighlighter().style.display="none";
},onClick:function(t){t.stopPropagation();var e=c(t.target).data("model"),n=this.editor;if(e)if(e.get("selectable"))n.select(e);else{for(var r=e.parent();r&&!r.get("selectable");)r=r.parent();r&&n.select(r)}},updateBadge:function(t,e){var n=c(t),r=this.canvas,i=r.getConfig(),o=i.customBadgeLabel;this.cacheEl=t;var s=n.data("model");if(s&&s.get("badgable")){var a=this.getBadge(),l=s.getIcon()+s.getName();l=o?o(s):l,a.innerHTML=l;var u=a.style,h="px";u.display="block";var f=r.getCanvasView().getPosition(),d=a?a.offsetHeight:0,p=a?a.offsetWidth:0,g=e.top-d<f.top?f.top:e.top-d,v=e.left+p<f.left?f.left:e.left;u.top=g+h,u.left=v+h}},updateHighlighter:function(t,e){var n=c(t),r=n.data("model");if(r&&r.get("hoverable")&&"selected"!=r.get("status")){var i=this.canvas.getHighlighter(),o=i.style,s="px";o.left=e.left+s,o.top=e.top+s,o.height=e.height+s,o.width=e.width+s,o.display="block"}},onSelect:function(){var t=this.editor,e=this.em.getSelected();if(this.updateToolbar(e),e){var n=e.view.el;this.showFixedElementOffset(n),this.hideElementOffset(),this.hideHighlighter(),this.initResize(n)}else t.stopCommand("resize")},initResize:function(t){var e,n=this.em,o=n?n.get("Editor"):"",a=n?n.get("Config"):"",l=a.stylePrefix||"",c=l+"resizing",h=n.get("selectedComponent"),f=h.get("resizable"),d={},p=function(t,e,n){var r=n.docs;r&&r.forEach(function(e){var n=e.body,r=n.className||"";n.className=("add"==t?r+" "+c:r.replace(c,"")).trim()})};o&&f&&(d={onStart:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.el,o=r.config,a=r.resizer,l=o.keyHeight,c=o.keyWidth,f=o.currentUnit;p("add",t,r),e=n.get("StyleManager").getModelToStyle(h);var d=getComputedStyle(i),g=e.getStyle(),v=g[c]||d[c],m=g[l]||d[l];a.startDim.w=parseFloat(v),a.startDim.h=parseFloat(m),u=0,f&&(o.unitHeight=(0,s.getUnitFromValue)(m),o.unitWidth=(0,s.getUnitFromValue)(v))},onMove:function(){o.trigger("change:canvasOffset")},onEnd:function(t,e){p("remove",t,e),o.trigger("change:canvasOffset"),u=1},updateTarget:function(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e){var o=i.store,s=i.selectedHandler,a=i.config,l=a.keyHeight,c=a.keyWidth,u=["tc","bc"].indexOf(s)>=0,h=["cl","cr"].indexOf(s)>=0,f=e.getStyle();u||(f[c]=r.w+a.unitWidth),h||(f[l]=r.h+a.unitHeight),e.setStyle(f,{avoidStore:1});var d="update:component:style";n&&n.trigger(d+":"+l+" "+d+":"+c),o&&e.trigger("change:style",e,f,{})}}},"object"==("undefined"==typeof f?"undefined":i(f))&&(d=r({},d,f)),o.runCommand("resize",{el:t,options:d}))},updateToolbar:function(t){var e=this.config.em,n=t==e?e.get("selectedComponent"):t,r=this.canvas.getToolbarEl(),i=r.style;if(!n)return void(i.opacity=0);var o=n.get("toolbar"),s=(this.ppfx,e.get("Config").showToolbar);if(s&&o&&o.length){if(i.opacity="",i.display="",!this.toolbar){r.innerHTML="",this.toolbar=new l(o);var c=new a({collection:this.toolbar,editor:this.editor});r.appendChild(c.render().el)}this.toolbar.reset(o);var u=n.view;u&&this.updateToolbarPos(u.el)}else i.display="none"},updateToolbarPos:function(t,e){var n="px",r=this.canvas.getToolbarEl(),i=r.style,o=i.display;i.display="block";var s=this.canvas.getTargetToElementDim(r,t,{elPos:e,event:"toolbarPosUpdate"}),a=s.left+s.elementWidth-s.targetWidth;i.top=s.top+n,i.left=(a<0?0:a)+n,i.display=o},getCanvasPosition:function(){return this.canvas.getCanvasView().getPosition()},clean:function(){this.selEl&&this.selEl.removeClass(this.hoverClass)},getBadge:function(){return this.canvas.getBadgeEl()},onFrameScroll:function(t){var e=this.cacheEl;if(e){var n=this.getElementPos(e);this.updateBadge(e,n);var r=this.em.get("selectedComponent");r&&this.updateToolbarPos(r.view.el)}},updateAttached:function(t){var e=this.em.getSelected();if(e){var n=e.view;this.updateToolbarPos(n.el),this.showFixedElementOffset(n.el)}},getElementPos:function(t,e){return this.canvas.getCanvasView().getElementPos(t)},hideBadge:function(){this.getBadge().style.display="none"},cleanPrevious:function(t){t&&t.set({status:"",state:""})},getContentWindow:function(){return this.frameEl.contentWindow},run:function(t){this.editor=t&&t.get("Editor"),this.enable(),this.onSelect()},stop:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.em;this.stopSelectComponent(),!n.preserveSelected&&r.setSelected(null),this.clean(),this.hideBadge(),this.hideFixedElementOffset(),this.canvas.getToolbarEl().style.display="none",r.off("component:update",this.updateAttached,this),r.off("change:canvasOffset",this.updateAttached,this),r.off("change:selectedComponent",this.updateToolbar,this)}}},function(t,e,n){"use strict";(function(e,r){var i=n(54),o=e.$;t.exports=r.extend({},i,{init:function(t){r.bindAll(this,"startDraw","draw","endDraw","rollback"),this.config=t||{},this.hType=this.config.newFixedH?"height":"min-height",this.allowDraw=1},enable:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];i.enable.apply(this,e),this.$wr.css("cursor","crosshair"),this.allowDraw&&this.$wr.on("mousedown",this.startDraw),this.ghost=this.canvas.getGhostEl()},startDraw:function(t){t.preventDefault(),this.stopSelectPosition(),this.ghost.style.display="block",this.frameOff=this.getOffsetDim(),this.startPos={top:t.pageY+this.frameOff.top,left:t.pageX+this.frameOff.left},this.isDragged=!1,this.tempComponent={style:{}},this.beforeDraw(this.tempComponent),this.updateSize(this.startPos.top,this.startPos.left,0,0),this.toggleEvents(1)},toggleEvents:function(t){var e=t?"on":"off";this.$wr[e]("mousemove",this.draw),this.$wr[e]("mouseup",this.endDraw),this.$canvas[e]("mousemove",this.draw),o(document)[e]("mouseup",this.endDraw),o(document)[e]("keypress",this.rollback)},draw:function(t){this.isDragged=!0,this.updateComponentSize(t)},endDraw:function(t){this.toggleEvents();var e={};if(this.isDragged){this.updateComponentSize(t),this.setRequirements(this.tempComponent);var n=this.sorter.lastPos;e=this.create(this.sorter.target,this.tempComponent,n.index,n.method),this.sorter.prevTarget=null}this.ghost.style.display="none",this.startSelectPosition(),this.afterDraw(e)},create:function(t,e,n,r,i){n="after"===r?n+1:n;var s=i||{},a=o(t),l=a.data("model"),c=a.data("collection"),u=l?l.get("droppable"):1;if(s.at=n,c&&u)return c.add(e,s)},setRequirements:function(t){var e=this.config,n=t.style;n.width.replace(/\D/g,"")<e.minComponentW&&(n.width=e.minComponentW+"px"),n[this.hType].replace(/\D/g,"")<e.minComponentH&&(n[this.hType]=e.minComponentH+"px"),e.newFixedH&&(n.overflow="auto"),this.absoluteMode?n.position="absolute":(delete n.left,delete n.top);var r=this.sorter.lastPos;return this.nearFloat(r.index,r.method,this.sorter.lastDims)&&(n["float"]="left"),this.config.firstCentered&&this.getCanvasWrapper()==this.sorter.target&&(n.margin="0 auto"),t},updateComponentSize:function(t){var e=t.pageY+this.frameOff.top,n=t.pageX+this.frameOff.left,r=this.startPos,i=r.top,o=r.left,s=e-i,a=n-o;n<o&&(o=n,a=r.left-n),e<i&&(i=e,s=r.top-e),this.updateSize(i,o,a,s)},updateSize:function(t,e,n,r){var i="px",o=this.ghost.style,s=this.tempComponent.style;o.top=s.top=t+i,o.left=s.left=e+i,o.width=s.width=n+i,o[this.hType]=s[this.hType]=r+i},rollback:function(t,e){var n=t.which||t.keyCode;(n==this.config.ESCAPE_KEY||e)&&(this.isDragged=!1,this.endDraw())},beforeDraw:function(t){t.editable=!1},afterDraw:function(t){},run:function(t,e,n){this.editor=t,this.sender=e,this.$wr=this.$wrapper,this.enable()},stop:function(){this.stopSelectPosition(),this.$wrapper.css("cursor",""),this.$wrapper.unbind()}})}).call(e,n(0),n(1))},function(t,e,n){!function(e){function n(t,e){for(var n=t.length;n--;)if(t[n]===e)return n;return-1}function r(t,e){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function i(t){for(w in _)_[w]=t[A[w]]}function o(t){var e,r,o,s,a,c;if(e=t.keyCode,n(E,e)==-1&&E.push(e),93!=e&&224!=e||(e=91),e in _){_[e]=!0;for(o in k)k[o]==e&&(l[o]=!0)}else if(i(t),l.filter.call(this,t)&&e in x)for(c=p(),s=0;s<x[e].length;s++)if(r=x[e][s],r.scope==c||"all"==r.scope){a=r.mods.length>0;for(o in _)(!_[o]&&n(r.mods,+o)>-1||_[o]&&n(r.mods,+o)==-1)&&(a=!1);(0!=r.mods.length||_[16]||_[18]||_[17]||_[91])&&!a||r.method(t,r)===!1&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}function s(t){var e,r=t.keyCode,i=n(E,r);if(i>=0&&E.splice(i,1),93!=r&&224!=r||(r=91),r in _){_[r]=!1;for(e in k)k[e]==r&&(l[e]=!1)}}function a(){for(w in _)_[w]=!1;for(w in k)l[w]=!1}function l(t,e,n){var r,i;r=v(t),void 0===n&&(n=e,e="all");for(var o=0;o<r.length;o++)i=[],t=r[o].split("+"),t.length>1&&(i=m(t),t=[t[t.length-1]]),t=t[0],t=T(t),t in x||(x[t]=[]),x[t].push({shortcut:r[o],scope:e,method:n,key:r[o],mods:i})}function c(t,e){var n,i,o,s,a,l=[];for(n=v(t),s=0;s<n.length;s++){if(i=n[s].split("+"),i.length>1&&(l=m(i),t=i[i.length-1]),t=T(t),void 0===e&&(e=p()),!x[t])return;for(o=0;o<x[t].length;o++)a=x[t][o],a.scope===e&&r(a.mods,l)&&(x[t][o]={})}}function u(t){return"string"==typeof t&&(t=T(t)),n(E,t)!=-1}function h(){return E.slice(0)}function f(t){var e=(t.target||t.srcElement).tagName;return!("INPUT"==e||"SELECT"==e||"TEXTAREA"==e)}function d(t){C=t||"all"}function p(){return C||"all"}function g(t){var e,n,r;for(e in x)for(n=x[e],r=0;r<n.length;)n[r].scope===t?n.splice(r,1):r++}function v(t){var e;return t=t.replace(/\s/g,""),e=t.split(","),""==e[e.length-1]&&(e[e.length-2]+=","),e}function m(t){for(var e=t.slice(0,t.length-1),n=0;n<e.length;n++)e[n]=k[e[n]];return e}function y(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on"+e,function(){n(window.event)})}function b(){var t=e.key;return e.key=O,t}var w,x={},_={16:!1,18:!1,17:!1,91:!1},C="all",k={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,command:91},S={backspace:8,tab:9,clear:12,enter:13,"return":13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,"delete":46,home:36,end:35,pageup:33,pagedown:34,",":188,".":190,"/":191,"`":192,"-":189,"=":187,";":186,"'":222,"[":219,"]":221,"\\":220},T=function(t){return S[t]||t.toUpperCase().charCodeAt(0)},E=[];for(w=1;w<20;w++)S["f"+w]=111+w;var A={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey"};for(w in k)l[w]=!1;y(document,"keydown",function(t){o(t)}),y(document,"keyup",s),y(window,"focus",a);var O=e.key;e.key=l,e.key.setScope=d,e.key.getScope=p,e.key.deleteScope=g,e.key.filter=f,e.key.isPressed=u,e.key.getPressedKeyCodes=h,e.key.noConflict=b,e.key.unbind=c,t.exports=l}(this)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(75),o=r(i);window.Promise=window.Promise||o["default"],e["default"]="function"==typeof fetch?fetch.bind():function(t,e){return new o["default"](function(n,r){var i=new XMLHttpRequest;i.open(e.method||"get",t),i.withCredentials="include"==e.credentials;for(var s in e.headers||{})i.setRequestHeader(s,e.headers[s]);i.onload=function(t){return n({status:i.status,statusText:i.statusText,text:function(){return o["default"].resolve(i.responseText)}})},i.onerror=r,i.upload&&e.onProgress&&(i.upload.onprogress=e.onProgress),e.body?i.send(e.body):i.send()})}},function(t,e,n){"use strict";t.exports=function(t){var e=t,n="data-gjs-";return{compTypes:"",parseStyle:function(t){for(var e={},n=t.split(";"),r=0,i=n.length;r<i;r++){var o=n[r].trim();if(o){var s=o.split(":");e[s[0].trim()]=s.slice(1).join(":").trim()}}return e},parseClass:function(t){for(var n=[],r=t.split(" "),i=0,o=r.length;i<o;i++){var s=r[i].trim(),a=new RegExp("^"+e.pStylePrefix);s&&!a.test(s)&&n.push(s)}return n},parseNode:function(t){for(var r=[],i=t.childNodes,o=0,s=i.length;o<s;o++){var a=i[o],l=a.attributes||[],c=l.length,u=r[r.length-1],h=a.childNodes.length,f=this.compTypes,d={};if(f){for(var p="",g=0;g<f.length&&!(p=f[g].model.isComponent(a));g++);d=p}d.tagName||(d.tagName=a.tagName?a.tagName.toLowerCase():""),c&&(d.attributes={});for(var v=0;v<c;v++){var m=l[v].nodeName,y=l[v].nodeValue;if("style"==m)d.style=this.parseStyle(y);else if("class"==m)d.classes=this.parseClass(y);else{if("contenteditable"==m)continue;if(0===m.indexOf(n)){var b=m.replace(n,""),w=y.length,x=y&&y.substr(0,1),_=y&&y.substr(w-1);y="true"===y||y,y="false"!==y&&y;try{y="{"==x&&"}"==_||"["==x&&"]"==_?JSON.parse(y):y}catch(C){}d[b]=y}else d.attributes[m]=y}}if(h&&!d.components){var k=a.childNodes[0];1===h&&3===k.nodeType?(!d.type&&(d.type="text"),d.content=k.nodeValue):d.components=this.parseNode(a)}if("textnode"==d.type){if(u&&"textnode"==u.type){u.content+=d.content;continue}var S=a.nodeValue;if(" "!=S&&!S.trim())continue}var T=d.components;if(!d.type&&T){for(var E=1,A=0,O=0;O<T.length;O++){var M=T[O],L=M.type;if(["text","textnode"].indexOf(L)<0&&e.textTags.indexOf(M.tagName)<0){E=0;break}"textnode"==L&&(A=1)}E&&A&&(d.type="text")}(d.tagName||"textnode"==d.type)&&r.push(d)}return r},parse:function(t,n){var r=e.em&&e.em.get("Config")||{},i={html:"",css:""},o=document.createElement("div");o.innerHTML=t;var s=o.querySelectorAll("script"),a=s.length;if(!r.allowScripts)for(;a--;)s[a].parentNode.removeChild(s[a]);if(n){for(var l="",c=o.querySelectorAll("style"),u=c.length;u--;)l=c[u].innerHTML+l,c[u].parentNode.removeChild(c[u]);l&&(i.css=n.parse(l))}var h=this.parseNode(o);return 1==h.length&&(h=h[0]),i.html=h,i}}}},function(t,e,n){!function(t){t(n(6))}(function(t){"use strict";function e(t){for(var e={},n=0;n<t.length;++n)e[t[n].toLowerCase()]=!0;return e}function n(t,e){for(var n,r=!1;null!=(n=t.next());){if(r&&"/"==n){e.tokenize=null;break}r="*"==n}return["comment","comment"]}t.defineMode("css",function(e,n){function r(t,e){return p=e,t}function i(t,e){var n=t.next();if(m[n]){var i=m[n](t,e);if(i!==!1)return i}return"@"==n?(t.eatWhile(/[\w\\\-]/),r("def",t.current())):"="==n||("~"==n||"|"==n)&&t.eat("=")?r(null,"compare"):'"'==n||"'"==n?(e.tokenize=o(n),e.tokenize(t,e)):"#"==n?(t.eatWhile(/[\w\\\-]/),r("atom","hash")):"!"==n?(t.match(/^\s*\w*/),r("keyword","important")):/\d/.test(n)||"."==n&&t.eat(/\d/)?(t.eatWhile(/[\w.%]/),r("number","unit")):"-"!==n?/[,+>*\/]/.test(n)?r(null,"select-op"):"."==n&&t.match(/^-?[_a-z][_a-z0-9-]*/i)?r("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?r(null,n):"u"==n&&t.match(/rl(-prefix)?\(/)||"d"==n&&t.match("omain(")||"r"==n&&t.match("egexp(")?(t.backUp(1),e.tokenize=s,r("property","word")):/[\w\\\-]/.test(n)?(t.eatWhile(/[\w\\\-]/),r("property","word")):r(null,null):/[\d.]/.test(t.peek())?(t.eatWhile(/[\w.%]/),r("number","unit")):t.match(/^-[\w\\\-]+/)?(t.eatWhile(/[\w\\\-]/),t.match(/^\s*:/,!1)?r("variable-2","variable-definition"):r("variable-2","variable")):t.match(/^\w+-/)?r("meta","meta"):void 0}function o(t){return function(e,n){for(var i,o=!1;null!=(i=e.next());){if(i==t&&!o){")"==t&&e.backUp(1);break}o=!o&&"\\"==i}return(i==t||!o&&")"!=t)&&(n.tokenize=null),r("string","string")}}function s(t,e){return t.next(),t.match(/\s*[\"\')]/,!1)?e.tokenize=null:e.tokenize=o(")"),r(null,"(")}function a(t,e,n){this.type=t,this.indent=e,this.prev=n}function l(t,e,n,r){return t.context=new a(n,e.indentation()+(r===!1?0:v),t.context),n}function c(t){return t.context.prev&&(t.context=t.context.prev),t.context.type}function u(t,e,n){return L[n.context.type](t,e,n)}function h(t,e,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return u(t,e,n)}function f(t){var e=t.current().toLowerCase();g=E.hasOwnProperty(e)?"atom":T.hasOwnProperty(e)?"keyword":"variable"}var d=n.inline;n.propertyKeywords||(n=t.resolveMode("text/css"));var p,g,v=e.indentUnit,m=n.tokenHooks,y=n.documentTypes||{},b=n.mediaTypes||{},w=n.mediaFeatures||{},x=n.mediaValueKeywords||{},_=n.propertyKeywords||{},C=n.nonStandardPropertyKeywords||{},k=n.fontProperties||{},S=n.counterDescriptors||{},T=n.colorKeywords||{},E=n.valueKeywords||{},A=n.allowNested,O=n.lineComment,M=n.supportsAtComponent===!0,L={};return L.top=function(t,e,n){if("{"==t)return l(n,e,"block");if("}"==t&&n.context.prev)return c(n);if(M&&/@component/.test(t))return l(n,e,"atComponentBlock");if(/^@(-moz-)?document$/.test(t))return l(n,e,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/.test(t))return l(n,e,"atBlock");if(/^@(font-face|counter-style)/.test(t))return n.stateArg=t,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(t))return"keyframes";if(t&&"@"==t.charAt(0))return l(n,e,"at");if("hash"==t)g="builtin";else if("word"==t)g="tag";else{if("variable-definition"==t)return"maybeprop";if("interpolation"==t)return l(n,e,"interpolation");if(":"==t)return"pseudo";if(A&&"("==t)return l(n,e,"parens")}return n.context.type},L.block=function(t,e,n){if("word"==t){var r=e.current().toLowerCase();return _.hasOwnProperty(r)?(g="property","maybeprop"):C.hasOwnProperty(r)?(g="string-2","maybeprop"):A?(g=e.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(g+=" error","maybeprop")}return"meta"==t?"block":A||"hash"!=t&&"qualifier"!=t?L.top(t,e,n):(g="error","block")},L.maybeprop=function(t,e,n){return":"==t?l(n,e,"prop"):u(t,e,n)},L.prop=function(t,e,n){if(";"==t)return c(n);if("{"==t&&A)return l(n,e,"propBlock");if("}"==t||"{"==t)return h(t,e,n);if("("==t)return l(n,e,"parens");if("hash"!=t||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(e.current())){if("word"==t)f(e);else if("interpolation"==t)return l(n,e,"interpolation")}else g+=" error";return"prop"},L.propBlock=function(t,e,n){return"}"==t?c(n):"word"==t?(g="property","maybeprop"):n.context.type},L.parens=function(t,e,n){return"{"==t||"}"==t?h(t,e,n):")"==t?c(n):"("==t?l(n,e,"parens"):"interpolation"==t?l(n,e,"interpolation"):("word"==t&&f(e),"parens")},L.pseudo=function(t,e,n){return"meta"==t?"pseudo":"word"==t?(g="variable-3",n.context.type):u(t,e,n)},L.documentTypes=function(t,e,n){return"word"==t&&y.hasOwnProperty(e.current())?(g="tag",n.context.type):L.atBlock(t,e,n)},L.atBlock=function(t,e,n){if("("==t)return l(n,e,"atBlock_parens");if("}"==t||";"==t)return h(t,e,n);if("{"==t)return c(n)&&l(n,e,A?"block":"top");if("interpolation"==t)return l(n,e,"interpolation");if("word"==t){var r=e.current().toLowerCase();g="only"==r||"not"==r||"and"==r||"or"==r?"keyword":b.hasOwnProperty(r)?"attribute":w.hasOwnProperty(r)?"property":x.hasOwnProperty(r)?"keyword":_.hasOwnProperty(r)?"property":C.hasOwnProperty(r)?"string-2":E.hasOwnProperty(r)?"atom":T.hasOwnProperty(r)?"keyword":"error"}return n.context.type},L.atComponentBlock=function(t,e,n){return"}"==t?h(t,e,n):"{"==t?c(n)&&l(n,e,A?"block":"top",!1):("word"==t&&(g="error"),n.context.type)},L.atBlock_parens=function(t,e,n){return")"==t?c(n):"{"==t||"}"==t?h(t,e,n,2):L.atBlock(t,e,n)},L.restricted_atBlock_before=function(t,e,n){return"{"==t?l(n,e,"restricted_atBlock"):"word"==t&&"@counter-style"==n.stateArg?(g="variable","restricted_atBlock_before"):u(t,e,n)},L.restricted_atBlock=function(t,e,n){return"}"==t?(n.stateArg=null,c(n)):"word"==t?(g="@font-face"==n.stateArg&&!k.hasOwnProperty(e.current().toLowerCase())||"@counter-style"==n.stateArg&&!S.hasOwnProperty(e.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},L.keyframes=function(t,e,n){return"word"==t?(g="variable","keyframes"):"{"==t?l(n,e,"top"):u(t,e,n)},L.at=function(t,e,n){return";"==t?c(n):"{"==t||"}"==t?h(t,e,n):("word"==t?g="tag":"hash"==t&&(g="builtin"),"at")},L.interpolation=function(t,e,n){return"}"==t?c(n):"{"==t||";"==t?h(t,e,n):("word"==t?g="variable":"variable"!=t&&"("!=t&&")"!=t&&(g="error"),"interpolation")},{startState:function(t){return{tokenize:null,state:d?"block":"top",stateArg:null,context:new a(d?"block":"top",t||0,null)}},token:function(t,e){if(!e.tokenize&&t.eatSpace())return null;var n=(e.tokenize||i)(t,e);return n&&"object"==typeof n&&(p=n[1],n=n[0]),g=n,"comment"!=p&&(e.state=L[e.state](p,t,e)),g},indent:function(t,e){var n=t.context,r=e&&e.charAt(0),i=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(i=Math.max(0,n.indent-v)):(n=n.prev,i=n.indent)),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:O,fold:"brace"}});var r=["domain","regexp","url","url-prefix"],i=e(r),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],s=e(o),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],l=e(a),c=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],u=e(c),h=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],f=e(h),d=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],p=e(d),g=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],v=e(g),m=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],y=e(m),b=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],w=e(b),x=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],_=e(x),C=r.concat(o).concat(a).concat(c).concat(h).concat(d).concat(b).concat(x);
t.registerHelper("hintWords","css",C),t.defineMIME("text/css",{documentTypes:i,mediaTypes:s,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,fontProperties:v,counterDescriptors:y,colorKeywords:w,valueKeywords:_,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=n,n(t,e))}},name:"css"}),t.defineMIME("text/x-scss",{mediaTypes:s,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,colorKeywords:w,valueKeywords:_,fontProperties:v,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=n,n(t,e)):["operator","operator"]},":":function(t){return!!t.match(/\s*\{/,!1)&&[null,null]},$:function(t){return t.match(/^[\w-]+/),t.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(t){return!!t.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),t.defineMIME("text/x-less",{mediaTypes:s,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,colorKeywords:w,valueKeywords:_,fontProperties:v,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=n,n(t,e)):["operator","operator"]},"@":function(t){return t.eat("{")?[null,"interpolation"]:!t.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)&&(t.eatWhile(/[\w\\\-]/),t.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),t.defineMIME("text/x-gss",{documentTypes:i,mediaTypes:s,mediaFeatures:l,propertyKeywords:f,nonStandardPropertyKeywords:p,fontProperties:v,counterDescriptors:y,colorKeywords:w,valueKeywords:_,supportsAtComponent:!0,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=n,n(t,e))}},name:"css",helperType:"gss"})})},function(t,e,n){"use strict";var r=n(0),i=n(28);t.exports=r.Model.extend({defaults:{id:"",content:"",visible:!0,buttons:[],attributes:{}},initialize:function(t){this.btn=this.get("buttons")||[],this.buttons=new i(this.btn),this.set("buttons",this.buttons)}})},function(t,e,n){"use strict";var r=n(0),i=n(109);t.exports=r.Collection.extend({model:i,deactivateAllExceptOne:function(t,e){this.forEach(function(n,r){n!==t&&(n.set("active",!1),e&&n.get("buttons").length&&n.get("buttons").deactivateAllExceptOne(t,e))})},deactivateAll:function(t){var e=t||"";this.forEach(function(t,n){t.get("context")==e&&(t.set("active",!1),t.get("buttons").length&&t.get("buttons").deactivateAll(e))})},disableAllButtons:function(t){var e=t||"";this.forEach(function(t,n){t.get("context")==e&&(t.set("disable",!0),t.get("buttons").length&&t.get("buttons").disableAllButtons(e))})},disableAllButtonsExceptOne:function(t,e){this.forEach(function(n,r){n!==t&&(n.set("disable",!0),e&&n.get("buttons").length&&n.get("buttons").disableAllButtonsExceptOne(t,e))})}})},function(t,e,n){"use strict";var r=n(0),i=n(30);t.exports=r.View.extend({initialize:function(t){var e=t.config||{};this.config=e,this.pfx=e.stylePrefix||"",this.ppfx=e.pStylePrefix||"",this.buttons=this.model.get("buttons"),this.className=this.pfx+"panel",this.id=this.pfx+this.model.get("id"),this.listenTo(this.model,"change:appendContent",this.appendContent),this.listenTo(this.model,"change:content",this.updateContent)},appendContent:function(){this.$el.append(this.model.get("appendContent"))},updateContent:function(){this.$el.html(this.model.get("content"))},attributes:function(){return this.model.get("attributes")},initResize:function(){var t=this.config.em,e=t?t.get("Editor"):"",n=this.model.get("resizable");if(e&&n){var r,i,o,s=n===!0?[1,1,1,1]:n,a=s.length,l=0;2==a?(r=s[0],o=s[0],i=s[1],l=s[1]):4==a&&(r=s[0],i=s[1],o=s[2],l=s[3]);var c=e.Utils.Resizer.init({tc:r,cr:i,bc:o,cl:l,tl:0,tr:0,bl:0,br:0,appendTo:this.el,prefix:e.getConfig().stylePrefix,posFetcher:function(t){var e=t.getBoundingClientRect();return{left:0,top:0,width:e.width,height:e.height}}});c.blur=function(){},c.focus(this.el)}},render:function(){var t=this.$el,e=this.ppfx;if(t.attr("class",this.className+" "+e+"one-bg"),this.id&&t.attr("id",this.id),this.buttons.length){var n=new i({collection:this.buttons,config:this.config});t.append(n.render().el)}return t.append(this.model.get("content")),this}})},function(t,e,n){"use strict";(function(e){var r=n(0),i=n(111);t.exports=r.View.extend({initialize:function(t){this.opt=t||{},this.config=this.opt.config||{},this.pfx=this.config.stylePrefix||"",this.parentM=this.opt.parentM||null,this.listenTo(this.collection,"add",this.addTo),this.listenTo(this.collection,"reset",this.render),this.className=this.pfx+"buttons"},addTo:function(t){this.addToCollection(t)},addToCollection:function(t,e){var n=e||null,r=i,o=new r({model:t,config:this.config,parentM:this.parentM}),s=o.render().el;return n?n.appendChild(s):this.$el.append(s),s},render:function(){var t=document.createDocumentFragment();return this.$el.empty(),this.collection.each(function(e){this.addToCollection(e,t)},this),this.$el.append(t),this.$el.attr("class",e.result(this,"className")),this}})}).call(e,n(1))},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};t.exports=function(){var t,e,i={},o=n(116),s=n(117),a=n(11),l=n(128),c=void 0;return{name:"StyleManager",getConfig:function(){return i},init:function(n){i=n||{};for(var r in o)r in i||(i[r]=o[r]);var u=i.pStylePrefix;return u&&(i.stylePrefix=u+i.stylePrefix),c=new a,t=new s(i.sectors,i),e=new l({collection:t,target:i.em,config:i}),this},addSector:function(e,n){var r=this.getSector(e);return r||(n.id=e,r=t.add(n)),r},getSector:function(e){var n=t.where({id:e});return n.length?n[0]:null},removeSector:function(t){return this.getSectors().remove(this.getSector(t))},getSectors:function(){return t},addProperty:function(t,e){var n=null,r=this.getSector(t);return r&&(n=r.get("properties").add(e)),n},getProperty:function(t,e){var n=null,r=this.getSector(t);return r&&(n=r.get("properties").where({property:e}),n=1==n.length?n[0]:n),n},removeProperty:function(t,e){var n=this.getProperties(t);return n&&n.remove(this.getProperty(t,e))},getProperties:function(t){var e=null,n=this.getSector(t);return n&&(e=n.get("properties")),e},getModelToStyle:function(t){var e=i.em,n=t.get("classes"),r=t.getId();if(e){var o=e.getConfig(),s=e.get("UndoManager"),a=e.get("CssComposer"),l=o.devicePreviewMode?"":t.get("state"),c=n.getStyleable(),u=c.length,h={state:l},f=void 0;if(u){var d=e.getCurrentMedia();f=a.get(c,l,d),f||(s.stop(),f=a.add(c,l,d),f.setStyle(t.getStyle()),t.setStyle({}),s.start())}else o.avoidInlineStyle&&(f=a.getIdRule(r,h),!f&&(f=a.setIdRule(r,{},h)));f&&(t=f)}return t},addType:function(t,e){c.addType(t,e)},getType:function(t){return c.getType(t)},getTypes:function(){return c.getTypes()},createType:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.model,o=void 0===n?{}:n,s=e.view,a=void 0===s?{}:s,l=this.getType(t);if(l)return new l.view(r({model:new l.model(o),config:i},a))},render:function(){return e.render().el}}}},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var n=t.Model,r=t.View;e["default"]={types:[],initialize:function(t,e){var n=this;this.model=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=void 0,i=void 0,o=void 0;if(t&&t.type){var s=n.getBaseType();o=n.getType(t.type),r=o?o.model:s.model,i=o?o.view:s.view}else{var a=n.recognizeType(t);o=a.type,r=o.model,i=o.view,t=a.attributes}var l=new r(t,e);return l.typeView=i,l};var r=this.init&&this.init.bind(this);r&&r()},recognizeType:function(t){for(var e=this.getTypes(),n=0;n<e.length;n++){var r=e[n],i=r.isType(t);if(i="boolean"==typeof i&&i?{type:r.id}:i)return{type:r,attributes:i}}return{type:this.getBaseType(),attributes:t}},getBaseType:function(){var t=this.getTypes();return t[t.length-1]},getTypes:function(){return this.types},getType:function(t){for(var e=this.getTypes(),n=0;n<e.length;n++){var r=e[n];if(r.id===t)return r}},addType:function(t,e){var i=this.getType(t),o=this.getBaseType(),s=i?i.model:o.model,a=i?i.view:o.view,l=e.model,c=e.view,u=e.isType;l=l instanceof n?l:s.extend(l||{}),c=c instanceof r?c:a.extend(c||{}),i?(i.model=l,i.view=c,i.isType=u||i.isType):(e.id=t,e.model=l,e.view=c,e.isType=u||function(e){if(e&&e.type==t)return!0},this.getTypes().unshift(e))}}}).call(e,n(0))},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(12);t.exports=i.extend({defaults:r({},i.prototype.defaults,{detached:0,properties:[],separator:" "}),init:function(){var t=this.get("properties")||[],e=n(11);this.set("properties",new e(t)),this.listenTo(this,"change:value",this.updateValues)},updateValues:function(){var t=this.get("value").split(this.get("separator"));this.get("properties").each(function(e,n){var r=t.length;t[n]||t[n%r+(1!=r&&r%2?1:0)]})},getDefaultValue:function(t){var e=this.get("defaults");if(e&&!t)return e;e="";var n=this.get("properties");return n.each(function(t,n){return e+=t.getDefaultValue()+" "}),e.trim()},getFullValue:function(){return this.get("detached")?"":this.get("properties").getFullValue()}})},function(t,e,n){"use strict";var r=n(17),i=n(123);t.exports=r.extend({templateInput:function(){var t=this.pfx;this.ppfx;return'\n <div class="'+t+"field "+t+'stack">\n <button type="button" id="'+t+'add" data-add-layer>+</button>\n <div data-layers-wrapper></div>\n </div>\n '},init:function(){var t=this.model;this.pfx;t.set("stackIndex",null),this.events["click [data-add-layer]"]="addLayer",this.listenTo(t,"change:stackIndex",this.indexChanged),this.listenTo(t,"updateValue",this.inputValueChanged),this.delegateEvents()},targetUpdated:function(){if(this.model.get("detached"))this.checkVisibility();else{for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];r.prototype.targetUpdated.apply(this,e)}this.refreshLayers()},getLayers:function(){return this.model.get("layers")},indexChanged:function(t){var e=this.model;this.getLayers().active(e.get("stackIndex"))},addLayer:function(){var t=this.model,e=this.getLayers(),n=t.get("properties").deepClone();n.each(function(t){return t.set("value","")});var r=e.add({properties:n});this.inputValueChanged(),t.set("stackIndex",e.indexOf(r))},inputValueChanged:function(){var t=this.model;this.elementUpdated(),t.get("detached")?t.get("properties").each(function(t){return t.trigger("change:value")}):t.set("value",this.getLayerValues())},setValue:function(){},getLayerValues:function(){return this.getLayers().getFullValue()},refreshLayers:function(){var t=[],e=this.model,n=this.getLayers(),r=e.get("detached");if(r){var i=this.getTarget(),o=i?i.getStyle():{};t=n.getLayersFromStyle(o)}else{var s=this.getTargetValue();s=s==e.getDefaultValue()?"":s,t=n.getLayersFromValue(s)}n.reset(),n.add(t),e.set({stackIndex:null},{silent:!0})},onRender:function(){var t=this,e=this.model,r=this.el.querySelector("[data-layers-wrapper]"),o=n(13),s={target:this.target,propTarget:this.propTarget,onChange:function(n,r,i){var o=r.model;if(e.get("detached")){var s=o.get("property"),a=t.getLayers().getPropertyValues(s);r.updateTargetStyle(a,null,i)}else e.set("value",e.getFullValue(),i)}},a=new i({collection:this.getLayers(),stackModel:e,preview:e.get("preview"),config:this.config,propsConfig:s}).render().el;new o({target:this.target,collection:this.model.get("properties"),stackModel:e,config:this.config,onChange:s.onChange,propTarget:s.propTarget,customValue:s.customValue}).render(),r.appendChild(a)}})},function(t,e,n){"use strict";(function(e){var n=e.$;t.exports=e.View.extend({events:{change:"handleChange"},template:function(){return'<span class="'+this.holderClass()+'"></span>'},inputClass:function(){return this.ppfx+"field"},holderClass:function(){return this.ppfx+"input-holder"},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.ppfx||"";this.opts=t,this.ppfx=e,this.em=t.target||{},this.listenTo(this.model,"change:value",this.handleModelChange)},elementUpdated:function(){this.model.trigger("el:change")},setValue:function(t){var e=this.model,n=t||e.get("defaults"),r=this.getInputEl();r&&(r.value=n)},handleModelChange:function(t,e,n){this.setValue(e,n)},handleChange:function(t){t.stopPropagation(),this.model.set("value",this.getInputEl().value),this.elementUpdated()},getInputEl:function(){if(!this.inputEl){var t=this.model.get("defaults");this.inputEl=n('<input type="text" placeholder="'+t+'">')}return this.inputEl.get(0)},render:function(){var t=this.$el;return t.addClass(this.inputClass()),t.html(this.template()),t.find("."+this.holderClass()).append(this.getInputEl()),this}})}).call(e,n(0))},function(t,e,n){"use strict";t.exports=n(5).extend({templateInput:function(){var t=(this.pfx,this.ppfx);return'\n <div class="'+t+"field "+t+'field-radio">\n </div>\n '},onRender:function(){var t=this.pfx,e=this.ppfx,n=e+"radio-item-label",r=this.model,i=r.get("property"),o=r.get("list")||r.get("options")||[];if(!this.input&&o&&o.length){var s="";o.forEach(function(r){var o=r.className?r.className+" "+t+"icon "+n:"",a=i+"-"+r.value,l=r.name||r.value,c=r.title?'title="'+r.title+'"':"";s+='\n <div class="'+e+'radio-item">\n <input type="radio" class="'+t+'radio" id="'+a+'" name="'+i+'" value="'+r.value+'"/>\n <label class="'+(o||n)+'" '+c+' for="'+a+'">'+(o?"":l)+"</label>\n </div>\n "});var a=this.el.querySelector("."+e+"field");a.innerHTML='<div class="'+e+'radio-items">'+s+"</div>",this.input=a.firstChild}},getInputValue:function(){var t=this.getCheckedEl();return t?t.value:""},getCheckedEl:function(){var t=this.getInputEl();return t?t.querySelector("input:checked"):""},setValue:function(t){var e=this.model,n=t||e.get("value")||e.getDefaultValue(),r=this.getInputEl(),i=r?r.querySelector('[value="'+n+'"]'):"";if(i)i.checked=!0;else{var o=this.getCheckedEl();o&&(o.checked=!1)}}})},function(t,e,n){"use strict";(function(e){e.$;t.exports=n(5).extend({templateInput:function(){var t=this.pfx,e=this.ppfx;return'\n <div class="'+e+"field "+e+'select">\n <span id="'+t+'input-holder"></span>\n <div class="'+e+'sel-arrow">\n <div class="'+e+'d-s-arrow"></div>\n </div>\n </div>\n '},onRender:function(){var t=this.pfx,e=this.model,n=e.get("list")||e.get("options")||[];if(!this.input){var r="";n.forEach(function(t){var e=t.name||t.value,n=t.style?t.style.replace(/"/g,"&quot;"):"",i=n?'style="'+n+'"':"",o=t.value.replace(/"/g,"&quot;");r+='<option value="'+o+'" '+i+">"+e+"</option>"});var i=this.el.querySelector("#"+t+"input-holder");i.innerHTML="<select>"+r+"</select>",this.input=i.firstChild}}})}).call(e,n(0))},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(39);t.exports=n(14).extend({setValue:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=r({},e,{silent:1}),this.inputInst.setValue(t,e)},onRender:function(){if(!this.input){var t=this.ppfx,e=new i({target:this.target,model:this.model,ppfx:t}),n=e.render();this.el.querySelector("."+t+"fields").appendChild(n.el),this.$input=n.inputEl,this.$color=n.colorEl,this.input=this.$input.get(0),this.inputInst=n}}})},function(t,e,n){"use strict";(function(e){var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};n(122);var i=n(35),o=e.$;t.exports=i.extend({template:function(){var t=this.ppfx;return'\n <div class="'+this.holderClass()+'"></div>\n <div class="'+t+'field-colorp">\n <div class="'+t+'field-colorp-c" data-colorp-c>\n <div class="'+t+'checker-bg"></div>\n </div>\n </div>\n '},inputClass:function(){var t=this.ppfx;return t+"field "+t+"field-color"},holderClass:function(){return this.ppfx+"input-holder"},setValue:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.model,r=t||n.get("defaults"),i=this.getInputEl(),o=this.getColorEl(),s="none"!=r?r:"";i.value=r,o.get(0).style.backgroundColor=s,e.fromTarget&&(o.spectrum("set",s),this.noneColor="none"==r)},getColorEl:function(){if(!this.colorEl){var t=this,e=this.ppfx,n=this.model,i=o('<div class="'+this.ppfx+'field-color-picker"></div>'),s=i.get(0).style,a=this.em&&this.em.config?this.em.config.el:"",l=this.em&&this.em.getConfig&&this.em.getConfig("colorPicker")||{},c=function(t){var e=1==t.getAlpha()?t.toHexString():t.toRgbString();return e.replace(/ /g,"")},u=0,h=void 0;this.$el.find("[data-colorp-c]").append(i),i.spectrum(r({containerClassName:e+"one-bg "+e+"two-color",appendTo:a||"body",maxSelectionSize:8,showPalette:!0,showAlpha:!0,chooseText:"Ok",cancelText:"",palette:[]},l,{move:function(t){var e=c(t);s.backgroundColor=e,n.setValueFromInput(e,0)},change:function(e){u=1;var r=c(e);s.backgroundColor=r,n.setValueFromInput(r),t.noneColor=0},show:function(t){u=0,h=c(t)},hide:function(e){!u&&h&&(t.noneColor&&(h=""),s.backgroundColor=h,i.spectrum("set",h),n.setValueFromInput(h,0))}})),this.colorEl=i}return this.colorEl},render:function(){return i.prototype.render.call(this),this.getColorEl(),this}})}).call(e,n(0))},function(t,e,n){"use strict";(function(e){var r=n(5),i=e.$;t.exports=r.extend({templateInput:function(){var t=this.pfx,e=(this.ppfx,this.config.assetsLabel||"Images");return'\n <div class="'+t+"field "+t+"file\">\n <div id='"+t+"input-holder'>\n <div class=\""+t+'btn-c">\n <button class="'+t+'btn" id="'+t+'images" type="button">\n '+e+'\n </button>\n </div>\n <div style="clear:both;"></div>\n </div>\n <div id="'+t+'preview-box">\n <div id="'+t+'preview-file"></div>\n <div id="'+t+'close">&Cross;</div>\n </div>\n </div>\n '},init:function(){var t=this.em;this.modal=t.get("Modal"),this.am=t.get("AssetManager"),this.events["click #"+this.pfx+"close"]="removeFile",this.events["click #"+this.pfx+"images"]="openAssetManager",this.delegateEvents()},onRender:function(){if(!this.$input){var t=this.model.getDefaultValue();this.$input=i('<input placeholder="'+t+'">')}this.$preview||(this.$preview=this.$el.find("#"+this.pfx+"preview-file")),this.$previewBox||(this.$previewBox=this.$el.find("#"+this.pfx+"preview-box")),this.setValue(this.componentValue,0)},setValue:function(t,e){r.prototype.setValue.apply(this,arguments),this.setPreviewView(t&&t!=this.model.getDefaultValue()),this.setPreview(t)},setPreviewView:function(t){var e=this.$previewBox;e&&e[t?"addClass":"removeClass"](this.pfx+"show")},spreadUrl:function(t){this.model.set("value",t),this.setPreviewView(1)},setPreview:function(t){var e=this.$preview;t=t&&t.indexOf("url(")<0?"url("+t+")":t,e&&e.css("background-image",t)},cleanValue:function(){this.setPreviewView(0),this.model.set({value:""},{silent:!0})},removeFile:function(){this.model.set("value",this.model.getDefaultValue());for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];r.prototype.cleanValue.apply(this,e),this.setPreviewView(0)},openAssetManager:function(t){var e=this,n=this.em,r=n?n.get("Editor"):"";r&&(this.modal.setTitle("Select image"),this.modal.setContent(this.am.getContainer()),this.am.setTarget(null),r.runCommand("open-assets",{target:this.model,onSelect:function(t){e.modal.close(),e.spreadUrl(t.get("src"))}}))}})}).call(e,n(0))},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(12);t.exports=i.extend({defaults:r({},i.prototype.defaults,{options:[]})})},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(12),o=n(18);t.exports=i.extend({defaults:r({},i.prototype.defaults,{units:[],unit:"",step:1,min:"",max:""}),init:function(){var t=this.get("unit"),e=this.get("units");this.input=new o({model:this}),e.length&&!t&&this.set("unit",e[0])},parseValue:function(t){var e=i.prototype.parseValue.apply(this,arguments),n=this.input.validateInputValue(e.value,{deepCheck:1}),r=n.value,o=n.unit;return e.value=r,e.unit=o,e},getFullValue:function(){var t=this.get("value")+this.get("unit");return i.prototype.getFullValue.apply(this,[t])}})},function(t,e,n){"use strict";t.exports=n(44).extend({events:{"click [data-toggle=asset-remove]":"onRemove",click:"onClick",dblclick:"onDblClick"},getPreview:function(){var t=this.pfx,e=this.model.get("src");return'\n <div class="'+t+'preview" style="background-image: url(\''+e+'\');"></div>\n <div class="'+t+"preview-bg "+this.ppfx+'checker-bg"></div>\n '},getInfo:function(){var t=this.pfx,e=this.model,n=e.get("name"),r=e.get("width"),i=e.get("height"),o=e.get("unitDim"),s=r&&i?r+"x"+i+o:"";return n=n||e.getFilename(),'\n <div class="'+t+'name">'+n+'</div>\n <div class="'+t+'dimensions">'+s+"</div>\n "},init:function(t){var e=this.pfx;this.className+=" "+e+"asset-image"},onClick:function r(){var r=this.config.onClick,t=this.model;this.collection.trigger("deselectAll"),this.$el.addClass(this.pfx+"highlight"),"function"==typeof r?r(t):this.updateTarget(this.collection.target)},onDblClick:function i(){var t=this.em,i=this.config.onDblClick,e=this.model;"function"==typeof i?i(e):(this.updateTarget(this.collection.target),t&&t.get("Modal").close());var n=this.collection.onSelect;"function"==typeof n&&n(this.model)},onRemove:function(t){t.stopImmediatePropagation(),this.model.collection.remove(this.model)}})},function(t,e,n){"use strict";(function(e,n){t.exports=e.View.extend({initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=t,this.collection=t.collection;var e=t.config||{};this.config=e,this.pfx=e.stylePrefix||"",this.ppfx=e.pStylePrefix||"",this.em=e.em,this.className=this.pfx+"asset",this.listenTo(this.model,"destroy remove",this.remove),this.model.view=this;var n=this.init&&this.init.bind(this);n&&n(t)},template:function(){var t=this.pfx;return'\n <div class="'+t+'preview-cont">\n '+this.getPreview()+'\n </div>\n <div class="'+t+'meta">\n '+this.getInfo()+'\n </div>\n <div class="'+t+'close" data-toggle="asset-remove">\n &Cross;\n </div>\n '},updateTarget:function(t){t&&t.set&&(t.set("attributes",n.clone(t.get("attributes"))),t.set("src",this.model.get("src")))},getPreview:function(){return""},getInfo:function(){return""},render:function(){var t=this.el;return t.innerHTML=this.template(this,this.model),t.className=this.className,this}})}).call(e,n(0),n(1))},function(t,e,n){"use strict";(function(e,r){function i(t){return t&&t.__esModule?t:{"default":t}}var o=n(24),s=i(o);t.exports=e.View.extend({template:r.template('\n <form>\n <div id="<%= pfx %>title"><%= title %></div>\n <input type="file" id="<%= uploadId %>" name="file" accept="image/*" <%= disabled ? \'disabled\' : \'\' %> multiple/>\n <div style="clear:both;"></div>\n </form>\n '),events:{},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=t;var e=t.config||{};this.config=e,this.pfx=e.stylePrefix||"",this.ppfx=e.pStylePrefix||"",this.target=this.options.globalCollection||{},this.uploadId=this.pfx+"uploadFile",this.disabled=void 0!==e.disableUpload?e.disableUpload:!e.upload&&!e.embedAsBase64,this.events["change #"+this.uploadId]="uploadFile";var n=e.uploadFile;n?this.uploadFile=n.bind(this):e.embedAsBase64&&(this.uploadFile=this.constructor.embedAsBase64),this.delegateEvents()},onUploadStart:function(){var t=this.config.em;t&&t.trigger("asset:upload:start")},onUploadEnd:function(t){var e=this.config.em;e&&e.trigger("asset:upload:end",t)},onUploadError:function(t){var e=this.config.em;this.onUploadEnd(t),e&&e.trigger("asset:upload:error",t)},onUploadResponse:function(t,e){var n=this.config.em,r=this.config,i=this.target,o="string"==typeof t?JSON.parse(t):t;n&&n.trigger("asset:upload:response",o),r.autoAdd&&i&&i.add(o.data,{at:0}),this.onUploadEnd(t),e&&e(o)},uploadFile:function(t,e){for(var n=this,r=t.dataTransfer?t.dataTransfer.files:t.target.files,i=new FormData,o=this.config,a=o.params,l=0;l<r.length;l++)i.append(o.uploadName+"[]",r[l]);for(var c in a)i.append(c,a[c]);var u=(this.target,o.upload),h=o.headers,f="X-Requested-With";if("undefined"==typeof h[f]&&(h[f]="XMLHttpRequest"),u)return this.onUploadStart(),(0,s["default"])(u,{method:"post",credentials:"include",headers:h,body:i}).then(function(t){return 1==(t.status/200|0)?t.text():t.text().then(function(t){return Promise.reject(t)})}).then(function(t){return n.onUploadResponse(t,e)})["catch"](function(t){return n.onUploadError(t)})},initDrop:function(){var t=this;if(!this.uploadForm&&(this.uploadForm=this.$el.find("form").get(0),"draggable"in this.uploadForm)){this.uploadFile;this.uploadForm.ondragover=function(){return this.className=t.pfx+"hover",!1},this.uploadForm.ondragleave=function(){return this.className="",!1},this.uploadForm.ondrop=function(e){this.className="",e.preventDefault(),t.uploadFile(e)}}},initDropzone:function(t){var e=this,n=0,r=this.config,i=t.model,o=t.el,s=i.get("Editor"),a=(i.get("Config").el,i.get("Canvas").getBody()),l=this.ppfx,c=l+"dropzone-active",u=l+"dropzone",h=function(){o.className=o.className.replace(c,"").trim(),n=0},f=function(){return n||(o.className+=" "+c,n=1),!1},d=function(){return h(),!1},p=function(t){if(h(),t.preventDefault(),t.stopPropagation(),e.uploadFile(t),r.openAssetsOnDrop&&s){var n=s.getSelected();s.runCommand("open-assets",{target:n,onSelect:function(){s.Modal.close(),s.AssetManager.setTarget(null)}})}return!1};t.$el.append('<div class="'+u+'">'+r.dropzoneContent+"</div>"),h(),"draggable"in o&&[o,a].forEach(function(t){t.ondragover=f,t.ondragleave=d,t.ondrop=p})},render:function(){return this.$el.html(this.template({title:this.config.uploadText,uploadId:this.uploadId,disabled:this.disabled,pfx:this.pfx})),this.initDrop(),this.$el.attr("class",this.pfx+"file-uploader"),this}},{embedAsBase64:function(t,e){var n=this,r=t.dataTransfer?t.dataTransfer.files:t.target.files,i={data:[]};if(!FileReader)return void this.onUploadError(new Error("Unsupported platform, FileReader is not defined"));var o=[],s=/^(.+)\/(.+)$/,a=function(t){var e=new Promise(function(e,n){var r=new FileReader;r.addEventListener("load",function(i){var o=void 0,a=t.name,l=s.exec(t.type);if(o=l?l[1]:t.type,"image"===o){var c={src:r.result,name:a,type:o,height:0,width:0},u=new Image;u.addEventListener("error",function(t){n(t)}),u.addEventListener("load",function(){c.height=u.height,c.width=u.width,e(c)}),u.src=c.src}else e(o?{src:r.result,name:a,type:o}:r.result)}),r.addEventListener("error",function(t){n(t)}),r.addEventListener("abort",function(t){n("Aborted")}),r.readAsDataURL(t)});o.push(e)},l=!0,c=!1,u=void 0;try{for(var h,f=r[Symbol.iterator]();!(l=(h=f.next()).done);l=!0){var d=h.value;a(d)}}catch(p){c=!0,u=p}finally{try{!l&&f["return"]&&f["return"]()}finally{if(c)throw u}}Promise.all(o).then(function(t){i.data=t,n.onUploadResponse(i,e)},function(t){n.onUploadError(t)})}})}).call(e,n(0),n(1))},function(t,e,n){"use strict";(function(e){function r(t){return t&&t.__esModule?t:{"default":t}}var i=n(47),o=r(i),s=n(0),a=n(10);t.exports=s.Model.extend(o["default"]).extend({defaults:{selectors:{},selectorsAdd:"",style:{},mediaText:"",state:"",stylable:!0,atRuleType:"",singleAtRule:0,important:0},initialize:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.config=t||{};var n=e.em,r=this.config.selectors||[];if(this.em=n,n){var i=n.get("SelectorManager"),o=[];r.forEach(function(t){o.push(i.add(t))}),r=o}this.set("selectors",new a(r))},getAtRule:function(){var t=this.get("atRuleType"),e=this.get("mediaText"),n=t?"@"+t:e?"@media":"";return n+(e&&n?" "+e:"")},selectorsToString:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=[],n=this.get("state"),r=this.get("selectorsAdd"),i=this.get("selectors").getFullString(),o=n?":"+n:"";return i&&e.push(""+i+o),r&&!t.skipAdd&&e.push(r),e.join(", ")},getDeclaration:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="",n=this.selectorsToString(),r=this.styleToString(t),i=this.get("singleAtRule");return(n||i)&&r&&(e=i?r:n+"{"+r+"}"),e},toCSS:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="",n=this.getAtRule(),r=this.getDeclaration(t);return r&&(e=r),n&&e&&(e=n+"{"+e+"}"),e},compare:function(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=n||"",s=r||"",a=i.selectorsAdd||"",l=i.atRuleType||"";t instanceof Array||t.models||(t=[t]);var c=e.map(t.models||t,function(t){return t.get("name")}),u=e.map(this.get("selectors").models,function(t){return t.get("name")}),h=!1;if(c.length!==u.length)return h;for(var f=0;f<c.length;f++){for(var d=0,p=0;p<u.length;p++)c[f]===u[p]&&(d=1);if(0===d)return h}return this.get("state")===o&&this.get("mediaText")===s&&this.get("selectorsAdd")===a&&this.get("atRuleType")===l||h}})}).call(e,n(1))},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o=n(1),s=n(2),a=n(25),l=r(a),c=(0,l["default"])().parseStyle;e["default"]={parseStyle:c,extendStyle:function(t){return i({},this.getStyle(),t)},getStyle:function(){return i({},this.get("style"))},setStyle:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,o.isString)(e)&&(e=c(e));var r=this.getStyle(),a=i({},e);this.set("style",a,n);var l=(0,s.shallowDiff)(r,a);return(0,o.keys)(l).forEach(function(e){return t.trigger("change:style:"+e)}),a},addStyle:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"string"==typeof t?t={prop:e}:n=e||{},t=this.extendStyle(t),this.setStyle(t,n)},removeStyle:function(t){var e=this.getStyle();delete e[t],this.setStyle(e)},styleToString:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=[],n=this.getStyle();for(var r in n){var i=t.important,s=(0,o.isArray)(i)?i.indexOf(r)>=0:i,a=""+n[r]+(s?" !important":"");e.push(r+":"+a+";")}return e.join("")}}},function(t,e,n){"use strict";t.exports=n(0).View.extend({tagName:"style",initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=t.config||{};var e=this.model,n="change:style change:state change:mediaText";this.listenTo(e,n,this.render),this.listenTo(e,"destroy remove",this.remove),this.listenTo(e.get("selectors"),"change",this.render)},render:function(){var t=this.model,e=t.get("important");return this.el.innerHTML=this.model.toCSS({important:e}),this}})},function(t,e,n){"use strict";var r=n(0);t.exports=r.View.extend({itemView:"",itemsView:"",itemType:"type",initialize:function(t,e){this.config=e||{}},addTo:function(t){this.add(t)},add:function(t,e){var n=e||null,r=this.itemView,i=t.get(this.itemType);this.itemsView&&this.itemsView[i]&&(r=this.itemsView[i]);var o=new r({model:t,config:this.config},this.config),s=o.render().el;
n?n.appendChild(s):this.$el.append(s)},render:function(){var t=document.createDocumentFragment();return this.$el.empty(),this.collection.length&&this.collection.each(function(e){this.add(e,t)},this),this.$el.append(t),this}})},function(t,e,n){"use strict";var r=n(1),i=n(0);t.exports=i.Collection.extend({initialize:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.listenTo(this,"add",this.onAdd),this.config=e.config,this.em=e.em,this.model=function(t,n){var r,i=e.componentTypes;n.em=e.em,n.config=e.config,n.componentTypes=i;for(var o=0;o<i.length;o++){var s=i[o].id;if(s==t.type){r=i[o].model;break}}return r||(r=i[i.length-1].model),new r(t,n)}},add:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof t){var n=this.em.get("Parser").parseHtml(t);t=n.html;var r=this.em.get("CssComposer");if(n.css&&r){var o=e.avoidUpdateStyle;r.addCollection(n.css,{extend:1,avoidUpdateStyle:o})}}return i.Collection.prototype.add.apply(this,[t,e])},onAdd:function(t,e,n){var i=this.em,o=t.getStyle(),s=i&&i.getConfig("avoidInlineStyle");if(!(0,r.isEmpty)(o)&&!s&&i&&i.get&&i.getConfig("forceClass")){var a=t.cid;i.get("CssComposer").setClassRule(a,o);t.setStyle({}),t.addClass(a)}}})},function(t,e,n){"use strict";(function(e){var r=n(1);t.exports=e.View.extend({initialize:function(t){this.opts=t||{},this.config=t.config||{};var e=this.collection;this.listenTo(e,"add",this.addTo),this.listenTo(e,"reset",this.resetChildren)},addTo:function(t){var e=this.config.em,n=this.collection.indexOf(t);this.addToCollection(t,null,n),e&&!t.opt.temporary&&(e.trigger("add:component",t),e.trigger("component:add",t))},addToCollection:function(t,e,i){this.compView||(this.compView=n(3));for(var o=e||null,s=this.compView,a=this.opts.componentTypes,l=t.get("type"),c=0;c<a.length;c++){var u=a[c].id;if(u==l){s=a[c].view;break}}var h=new s({model:t,config:this.config,componentTypes:a}),f=h.render().el;if("textnode"==h.model.get("type")&&(f=document.createTextNode(h.model.get("content"))),o)o.appendChild(f);else{var d=this.parentEl,p=d.childNodes;if((0,r.isUndefined)(i))d.appendChild(f);else{var g=p.length==i;g&&i--,g||!p.length?d.appendChild(f):d.insertBefore(f,p[i])}}return f},resetChildren:function(){var t=this;this.parentEl.innerHTML="",this.collection.each(function(e){return t.addToCollection(e)})},render:function(t){var e=this,n=this.el,r=document.createDocumentFragment();return this.parentEl=t||this.el,this.collection.each(function(t){return e.addToCollection(t,r)}),n.innerHTML="",n.appendChild(r),this}})}).call(e,n(0))},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(4);t.exports=i.extend({defaults:r({},i.prototype.defaults,{type:"text",droppable:!1,editable:!0})})},function(t,e,n){"use strict";var r=n(2),i=n(3);t.exports=i.extend({events:{dblclick:"enableEditing"},initialize:function(t){i.prototype.initialize.apply(this,arguments),this.disableEditing=this.disableEditing.bind(this);var e=this.model,n=this.em;this.listenTo(e,"focus active",this.enableEditing),this.listenTo(e,"change:content",this.updateContent),this.rte=n&&n.get("RichTextEditor")},enableEditing:function(){var t=this.rte;if(!this.rteEnabled&&this.model.get("editable")){if(t)try{this.activeRte=t.enable(this,this.activeRte)}catch(e){}this.rteEnabled=1,this.toggleEvents(1)}},disableEditing:function(){var t=this.model,e=t.get("editable"),n=this.rte;if(n&&e){try{n.disable(this,this.activeRte)}catch(r){}var i=this.getChildrenContainer().innerHTML,o=t.get("components");if(o.length&&o.reset(),t.set("content",""),n.customRte)t.set("content",i);else{var s=function a(t){t.set({editable:0,highlightable:0,removable:0,draggable:0,copyable:0,toolbar:""}),t.get("components").each(function(t){return a(t)})};t.trigger("change:content",t),o.add(i),o.each(function(t){return s(t)}),o.trigger("resetNavigator")}}this.rteEnabled=0,this.toggleEvents()},disablePropagation:function(t){t.stopPropagation()},toggleEvents:function(t){var e=t?"on":"off",n={on:r.on,off:r.off},i=[this.el.ownerDocument,document];n.off(i,"mousedown",this.disableEditing),n[e](i,"mousedown",this.disableEditing),this.$el.off("mousedown",this.disablePropagation),this.$el[e]("mousedown",this.disablePropagation)}})},function(t,e,n){"use strict";(function(e){var n=e.$;t.exports={startSelectPosition:function(t,e){this.isPointed=!1;var n=this.editorModel.get("Utils");n&&!this.sorter&&(this.sorter=new n.Sorter({container:this.getCanvasBody(),placer:this.canvas.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:this.ppfx,direction:"a",document:e,wmargin:1,nested:1,em:this.editorModel,canvasRelative:1})),this.sorter.startSort(t)},getOffsetDim:function(){var t=this.offset(this.canvas.getFrameEl()),e=this.offset(this.canvas.getElement()),n=t.top-e.top,r=t.left-e.left;return{top:n,left:r}},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?n(this.outsideElem):!this.posIsLastEl&&this.cDim[this.posIndex]?n(this.cDim[this.posIndex][5]).parent():n(this.outsideElem),this.posTargetModel=this.posTargetEl.data("model"),this.posTargetCollection=this.posTargetEl.data("model-comp"))},enable:function(){this.startSelectPosition()},nearFloat:function(t,e,n){var r=t||0,i=e||"before",o=n.length,s=0!==o&&"after"==i&&r==o;return 0!==o&&(!s&&!n[r][4]||n[r-1]&&!n[r-1][4]||s&&!n[r-1][4])?1:0},run:function(){this.enable()},stop:function(){this.stopSelectPosition(),this.$wrapper.css("cursor",""),this.$wrapper.unbind()}}}).call(e,n(0))},function(t,e,n){"use strict";(function(e){var r=(n(0),n(22));t.exports=e.extend({},r,{init:function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];r.init.apply(this,n),e.bindAll(this,"insertComponent"),this.allowDraw=0},run:function(t,e,n){this.em=t,this.sender=e,this.opt=n||{},this.$wr=this.$wrapper,this.enable()},enable:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];r.enable.apply(this,e),this.$wr.on("click",this.insertComponent)},insertComponent:function(){this.$wr.off("click",this.insertComponent),this.stopSelectPosition();var t=this.buildContent();this.beforeInsert(t);var e=this.sorter.lastPos.index,n=this.create(this.sorter.target,t,e,null,{silent:!1});this.opt.terminateAfterInsert&&this.sender?this.sender.set("active",!1):this.enable(),n&&this.afterInsert(n,this)},beforeInsert:function(t){},afterInsert:function(t){},buildContent:function(){return this.opt.content||{}}})}).call(e,n(1))},function(t,e,n){"use strict";var r=n(1),i=n(3),o=void 0;t.exports=n(0).View.extend({events:{"mousedown [data-toggle-move]":"startSort","click [data-toggle-visible]":"toggleVisibility","click [data-toggle-select]":"handleSelect","click [data-toggle-open]":"toggleOpening","dblclick input":"handleEdit","focusout input":"handleEditEnd"},template:function(t){var e=this.pfx,n=this.ppfx,r=this.config.hidable,i=this.countChildren(t),o=i?"":e+"no-chld",s=this.level+1;return"\n "+(r?'<i id="'+e+'btn-eye" class="'+e+"btn fa fa-eye "+(this.isVisible()?"":"fa-eye-slash")+'" data-toggle-visible></i>':"")+'\n\n <div class="'+e+"title-c "+n+'one-bg">\n <div class="'+e+"title "+o+'" style="padding-left: '+(30+10*s)+'px" data-toggle-select>\n <div class="'+e+'title-inn">\n <i id="'+e+'caret" class="fa fa-chevron-right '+this.caretCls+'" data-toggle-open></i>\n '+t.getIcon()+'\n <input class="'+n+"no-app "+this.inputNameCls+'" value="'+t.getName()+'" readonly>\n </div>\n </div>\n </div>\n <div id="'+e+'counter">'+(i?i:"")+'</div>\n <div id="'+e+'move" data-toggle-move>\n <i class="fa fa-arrows"></i>\n </div>\n <div class="'+e+'children"></div>\n '},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opt=t,this.level=t.level,this.config=t.config,this.em=t.config.em,this.ppfx=this.em.get("Config").stylePrefix,this.sorter=t.sorter||"",this.pfx=this.config.stylePrefix;var e=this.pfx,n=this.ppfx,r=this.model,i=r.get("components");r.set("open",!1),this.listenTo(i,"remove add change reset",this.checkChildren),this.listenTo(r,"destroy remove",this.remove),this.listenTo(r,"change:status",this.updateStatus),this.listenTo(r,"change:open",this.updateOpening),this.listenTo(r,"change:style:display",this.updateVisibility),this.className=e+"item no-select",this.editBtnCls=e+"nav-item-edit",this.inputNameCls=n+"nav-comp-name",this.caretCls=n+"nav-item-caret",this.titleCls=e+"title",this.$el.data("model",r),this.$el.data("collection",i)},getVisibilityEl:function(){return this.eyeEl||(this.eyeEl=this.$el.children("#"+this.pfx+"btn-eye")),this.eyeEl},updateVisibility:function(){var t=this.pfx,e=this.model,n=t+"hide",r="fa-eye-slash",i="none"==e.getStyle().display,o=i?"addClass":"removeClass";this.$el[o](n),this.getVisibilityEl()[o](r)},toggleVisibility:function(t){t&&t.stopPropagation();var e=this.model,n=e.getStyle(),r="none"==n.display;r?delete n.display:n.display="none",e.setStyle(n)},handleEdit:function(t){t.stopPropagation();var e=this.getInputName();e.readOnly=!1,e.focus()},handleEditEnd:function(t){t.stopPropagation();var e=this.getInputName();e.readOnly=!0,this.model.set("custom-name",e.value)},getInputName:function(){return this.inputName||(this.inputName=this.el.querySelector("."+this.inputNameCls)),this.inputName},updateOpening:function(){var t=this.opt.opened||{},e=this.model,n="fa-chevron-down";e.get("open")?(this.$el.addClass("open"),this.getCaret().addClass(n),t[e.cid]=e):(this.$el.removeClass("open"),this.getCaret().removeClass(n),delete t[e.cid])},toggleOpening:function(t){t.stopPropagation(),this.model.get("components").length&&this.model.set("open",!this.model.get("open"))},handleSelect:function(t){t.stopPropagation(),this.em&&this.em.setSelected(this.model,{fromLayers:1})},startSort:function(t){t.stopPropagation(),0===t.button&&this.sorter&&this.sorter.startSort(t.target)},freeze:function(){this.$el.addClass(this.pfx+"opac50"),this.model.set("open",0)},unfreeze:function(){this.$el.removeClass(this.pfx+"opac50")},updateStatus:function(t){i.prototype.updateStatus.apply(this,arguments)},isVisible:function(){var t=this.model.get("style"),e=t.display;if(!e||"none"!=e)return 1},checkChildren:function(){var t=this.model,e=this.countChildren(t),n=this.pfx,r=n+"no-chld",i=this.$el.children("."+n+"title-c").children("."+n+"title");this.$counter||(this.$counter=this.$el.children("#"+n+"counter")),e?(i.removeClass(r),this.$counter.html(e)):(i.addClass(r),this.$counter.empty(),t.set("open",0))},countChildren:function(t){var e=0;return t.get("components").each(function(t){var n=this.opt.isCountable,r=this.config.hideTextnode;n&&!n(t,r)||e++},this),e},getCaret:function(){if(!this.caret){var t=this.pfx;this.caret=this.$el.children("."+t+"title-c").find("#"+t+"caret")}return this.caret},render:function(){var t=this.model,e=this.pfx,i=this.isVisible(),s=this.$el,a=this.level+1;s.html(this.template(t)),(0,r.isUndefined)(o)&&(o=n(57));var l=new o({collection:t.get("components"),config:this.config,sorter:this.sorter,opened:this.opt.opened,parent:t,level:a}).render().$el;return s.find("."+e+"children").append(l),t.get("draggable")&&this.config.sortable||s.children("#"+e+"move").remove(),!i&&(this.className+=" "+e+"hide"),s.attr("class",this.className),this.updateOpening(),this.updateStatus(),this.updateVisibility(),this}})},function(t,e,n){"use strict";var r=n(0),i=n(56);t.exports=r.View.extend({initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opt=t;var e=t.config||{};if(this.level=t.level,this.config=e,this.preview=t.preview,this.ppfx=e.pStylePrefix||"",this.pfx=e.stylePrefix||"",this.parent=t.parent,this.listenTo(this.collection,"add",this.addTo),this.listenTo(this.collection,"reset resetNavigator",this.render),this.className=this.pfx+"items",e.sortable&&!this.opt.sorter){var n=this.pfx,r=e.em.get("Utils");this.opt.sorter=new r.Sorter({container:e.sortContainer||this.el,containerSel:"."+n+"items",itemSel:"."+n+"item",ppfx:this.ppfx,ignoreViewChildren:1,avoidSelectOnEnd:1,pfx:n,nested:1})}this.sorter=this.opt.sorter||"",this.$el.data("collection",this.collection),this.parent&&this.$el.data("model",this.parent)},addTo:function(t){var e=this.collection.indexOf(t);this.addToCollection(t,null,e)},addToCollection:function(t,e,n){var r=this.level,o=e||null,s=i;if(this.isCountable(t,this.config.hideTextnode)){var a=new s({level:r,model:t,config:this.config,sorter:this.sorter,isCountable:this.isCountable,opened:this.opt.opened}),l=a.render().el;if(o)o.appendChild(l);else if("undefined"!=typeof n){var c="before";this.$el.children().length==n&&(n--,c="after"),n<0?this.$el.append(l):this.$el.children().eq(n)[c](l)}else this.$el.append(l);return l}},isCountable:function(t,e){var n=t.get("type"),r=t.get("tagName");return!(("textnode"==n||"br"==r)&&e||!t.get("layerable"))},render:function(){var t=this,e=document.createDocumentFragment();return this.el.innerHTML="",this.collection.each(function(n){return t.addToCollection(n,e)}),this.el.appendChild(e),this.$el.attr("class",this.className),this}})},function(t,e,n){"use strict";var r=n(0);t.exports=r.Model.extend({defaults:{id:"",label:"",open:!0,attributes:{}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o=n(9),s=r(o),a=n(60),l=r(a),c=n(219),u=r(c),h=n(221),f=r(h);(0,f["default"])(),t.exports=function(){var t=new u["default"],e=[],n={autorender:1,plugins:[],pluginsOpts:{}};return{$:s["default"],editors:e,plugins:t,version:"0.13.8",init:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=r.container;if(!o)throw new Error("'container' is required");r=i({},n,r);var s=o instanceof window.HTMLElement;r.el=s?o:document.querySelector(o);var a=new l["default"](r).init();return r.plugins.forEach(function(e){var n=t.get(e);n&&n(a,r.pluginsOpts[e]||{})}),a.getModel().loadOnStart(),r.autorender&&a.render(),e.push(a),a}}}()},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}var i=n(9),o=r(i);t.exports=function(t){var e=t||{},r=n(61),i=n(62),s=n(218);for(var a in r)a in e||(e[a]=r[a]);e.pStylePrefix=e.stylePrefix;var l=new i(e),c=new s({model:l,config:e});return{$:o["default"],editor:l,DomComponents:l.get("DomComponents"),CssComposer:l.get("CssComposer"),StorageManager:l.get("StorageManager"),AssetManager:l.get("AssetManager"),BlockManager:l.get("BlockManager"),TraitManager:l.get("TraitManager"),SelectorManager:l.get("SelectorManager"),CodeManager:l.get("CodeManager"),Commands:l.get("Commands"),Keymaps:l.get("Keymaps"),Modal:l.get("Modal"),Panels:l.get("Panels"),StyleManager:l.get("StyleManager"),Canvas:l.get("Canvas"),UndoManager:l.get("UndoManager"),DeviceManager:l.get("DeviceManager"),RichTextEditor:l.get("RichTextEditor"),Utils:l.get("Utils"),Config:l.get("Config"),init:function(){return l.init(this),this},getConfig:function(t){return l.getConfig(t)},getHtml:function(t){return l.getHtml(t)},getCss:function(t){return l.getCss(t)},getJs:function(){return l.getJs()},getComponents:function(){return l.get("DomComponents").getComponents()},setComponents:function(t){return l.setComponents(t),this},addComponents:function(t,e){return this.getComponents().add(t,e)},getStyle:function(){return l.get("CssComposer").getAll()},setStyle:function(t){return l.setStyle(t),this},getSelected:function(){return l.getSelected()},getSelectedToStyle:function(){var t=l.getSelected();if(t)return this.StyleManager.getModelToStyle(t)},select:function(t){return l.setSelected(t),this},setDevice:function(t){return l.set("device",t),this},getDevice:function(){return l.get("device")},runCommand:function(t,e){var n,r=l.get("Commands").get(t);return r&&(n=r.run(this,this,e),this.trigger("run:"+t)),n},stopCommand:function(t,e){var n,r=l.get("Commands").get(t);return r&&(n=r.stop(this,this,e),this.trigger("stop:"+t)),n},store:function(t){return l.store(t)},load:function(t){return l.load(t)},getContainer:function(){return e.el},refresh:function(){l.refreshCanvas()},setCustomRte:function(t){this.RichTextEditor.customRte=t},on:function(t,e){return l.on(t,e)},off:function(t,e){return l.off(t,e)},trigger:function(t){return l.trigger.apply(l,arguments)},getEl:function(){return c.el},getModel:function(){return l},render:function(){var t=this;return l.on("loaded",function(){t.UndoManager.clear(),l.get("modules").forEach(function(t){t.postRender&&t.postRender(c)})}),c.render(),c.el}}}},function(t,e,n){"use strict";t.exports={stylePrefix:"gjs-",components:"",style:"",fromElement:0,noticeOnUnload:!0,showOffsets:!1,showOffsetsSelected:!1,forceClass:!0,height:"900px",width:"100%",protectedCss:"* { box-sizing: border-box; } body {margin: 0;}",canvasCss:"",defaultCommand:"select-comp",showToolbar:1,allowScripts:0,showDevices:1,devicePreviewMode:0,mediaCondition:"max-width",tagVarStart:"{[ ",tagVarEnd:" ]}",jsInHtml:!0,nativeDnD:1,exportWrapper:0,wrappesIsBody:1,avoidInlineStyle:0,clearStyles:0,el:"",undoManager:{},assetManager:{},canvas:{},layers:{},storageManager:{},rte:{},domComponents:{},modal:{},codeManager:{},panels:{},commands:{},cssComposer:{},selectorManager:{},deviceManager:{devices:[{name:"Desktop",width:""},{name:"Tablet",width:"768px",widthMedia:"992px"},{name:"Mobile landscape",width:"568px",widthMedia:"768px"},{name:"Mobile portrait",width:"320px",widthMedia:"480px"}]},styleManager:{sectors:[{name:"General",open:!1,buildProps:["float","display","position","top","right","left","bottom"]},{name:"Dimension",open:!1,buildProps:["width","height","max-width","min-height","margin","padding"]},{name:"Typography",open:!1,buildProps:["font-family","font-size","font-weight","letter-spacing","color","line-height","text-align","text-shadow"],properties:[{property:"text-align",list:[{value:"left",className:"fa fa-align-left"},{value:"center",className:"fa fa-align-center"},{value:"right",className:"fa fa-align-right"},{value:"justify",className:"fa fa-align-justify"}]}]},{name:"Decorations",open:!1,buildProps:["border-radius-c","background-color","border-radius","border","box-shadow","background"]},{name:"Extra",open:!1,buildProps:["transition","perspective","transform"]}]},blockManager:{},textViewCode:"Code"}},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(1),o=[n(63),n(67),n(68),n(71),n(79),n(84),n(87),n(91),n(95),n(107),n(113),n(31),n(130),n(136),n(141),n(148),n(176),n(183),n(209)],s=n(0),a=void 0;n(217)({Backbone:s,$:s.$});var l=s.$;t.exports=s.Model.extend({defaults:{clipboard:null,designerMode:!1,selectedComponent:null,previousModel:null,changesCount:0,storables:[],modules:[],toLoad:[],opened:{},device:""},initialize:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=e,this.set("Config",e),this.set("modules",[]),this.set("toLoad",[]),e.el&&e.fromElement&&(this.config.components=e.el.innerHTML),o.forEach(function(e){return t.loadModule(e)}),this.on("change:selectedComponent",this.componentSelected,this),this.on("change:changesCount",this.updateChanges,this)},getConfig:function(t){var e=this.config;return(0,i.isUndefined)(t)?e:e[t]},loadOnStart:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=this.get("StorageManager");this.get("toLoad").forEach(function(t){t.onLoad()});var r=function(){var n=t.get("modules");n.forEach(function(e){return e.postLoad&&e.postLoad(t)}),e&&e()};n&&n.getConfig().autoload?this.load(r):r()},updateChanges:function(){var t=this.get("StorageManager"),e=this.get("changesCount");this.config.noticeOnUnload&&e?window.onbeforeunload=function(t){return 1}:window.onbeforeunload=null,t.isAutosave()&&e>=t.getStepsBeforeSave()&&this.store()},loadModule:function(t){var e=this.config,n=new t,i=n.name.charAt(0).toLowerCase()+n.name.slice(1),o=e[i]||e[n.name]||{};o.pStylePrefix=e.pStylePrefix||"";var s=this.get("StorageManager");if(n.storageKey&&n.store&&n.load&&s){o.stm=s;var a=this.get("storables");a.push(n),this.set("storables",a)}return o.em=this,n.init(r({},o)),!n["private"]&&this.set(n.name,n),n.onLoad&&this.get("toLoad").push(n),this.get("modules").push(n),this},init:function(t){this.set("Editor",t)},getEditor:function(){return this.get("Editor")},handleUpdates:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.temporary||(a&&clearInterval(a),a=setTimeout(function(){r.avoidStore||n.set("changesCount",n.get("changesCount")+1,r)},0))},componentSelected:function(t,e,n){this.get("selectedComponent")?(this.trigger("select-comp",[t,e,n]),this.trigger("component:selected",arguments)):this.trigger("deselect-comp")},getSelected:function(){return this.get("selectedComponent")},setSelected:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t;t instanceof window.HTMLElement&&(n=l(t).data("model")),n&&!n.get("selectable")||this.set("selectedComponent",n,e)},setComponents:function(t){return this.get("DomComponents").setComponents(t)},getComponents:function(){var t=this.get("DomComponents"),e=this.get("CodeManager");if(t&&e){var n=t.getComponents();return e.getCode(n,"json")}},setStyle:function(t){for(var e=this.get("CssComposer").getAll(),n=0,r=e.length;n<r;n++)e.pop();return e.add(t),this},getStyle:function(){return this.get("CssComposer").getAll()},getHtml:function(){var t=this.config,e=t.exportWrapper,n=t.wrappesIsBody,r=t.jsInHtml?this.getJs():"",i=this.get("DomComponents").getComponent(),o=this.get("CodeManager").getCode(i,"html",{exportWrapper:e,wrappesIsBody:n});return o+=r?"<script>"+r+"</script>":""},getCss:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.config,n=e.wrappesIsBody,r=t.avoidProtected,i=this.get("CssComposer"),o=this.get("DomComponents").getComponent(),s=r?"":e.protectedCss;return s+this.get("CodeManager").getCode(o,"css",{cssc:i,wrappesIsBody:n})},getJs:function(){var t=this.get("DomComponents").getWrapper();return this.get("CodeManager").getCode(t,"js").trim()},store:function c(t){var e=this,n=this.get("StorageManager"),c={};if(n)return this.get("storables").forEach(function(t){var e=t.store(1);for(var n in e)c[n]=e[n]}),n.store(c,function(){t&&t(),e.set("changesCount",0),e.trigger("storage:store",c)}),c},load:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.getCacheLoad(1,function(n){t.get("storables").forEach(function(t){return t.load(n)}),e&&e(n)})},getCacheLoad:function(t,e){var n=this,r=t?1:0;if(this.cacheLoad&&!r)return this.cacheLoad;var i=this.get("StorageManager"),o=[];return i?(this.get("storables").forEach(function(t){var e=t.storageKey;e="function"==typeof e?e():e;var n=e instanceof Array?e:[e];n.forEach(function(t){o.push(t)})}),void i.load(o,function(t){n.cacheLoad=t,e&&e(t),n.trigger("storage:load",t)})):{}},getDeviceModel:function(){var t=this.get("device");return this.get("DeviceManager").get(t)},runDefault:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.get("Commands").get(this.config.defaultCommand);e&&!this.defaultRunning&&(e.stop(this,this,t),e.run(this,this,t),this.defaultRunning=1)},stopDefault:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.get("Commands").get(this.config.defaultCommand);e&&(e.stop(this,this,t),this.defaultRunning=0)},refreshCanvas:function(){this.set("canvasOffset",this.get("Canvas").getOffset())},clearSelection:function(t){var e=t||window;e.getSelection().removeAllRanges()},getCurrentMedia:function(){var t=this.config,e=this.getDeviceModel(),n=t.mediaCondition,r=t.devicePreviewMode,i=e&&e.get("widthMedia");return e&&i&&!r?"("+n+": "+i+")":""},data:function(t,e,n){var r="_gjs-data";return t[r]||(t[r]={}),(0,i.isUndefined)(n)?t[r][e]:void(t[r][e]=n)}})},function(t,e,n){"use strict";t.exports=function(){var t=n(64),e=n(65),r=n(66);return{name:"Utils",init:function(){return this},Sorter:t,Resizer:e,Dragger:r}}},function(t,e,n){"use strict";(function(e,r){var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o=n(1),s=n(2),a=e.$;t.exports=e.View.extend({initialize:function(t){this.opt=t||{},r.bindAll(this,"startSort","onMove","endMove","rollback","udpateOffset","moveDragHelper");var e=t||{};this.elT=0,this.elL=0,this.borderOffset=e.borderOffset||10;var n=e.container;this.el="string"==typeof n?document.querySelector(n):n,this.$el=a(this.el),this.containerSel=e.containerSel||"div",this.itemSel=e.itemSel||"div",this.draggable=e.draggable||!0,this.nested=e.nested||0,this.pfx=e.pfx||"",this.ppfx=e.ppfx||"",this.freezeClass=e.freezeClass||this.pfx+"freezed",this.onStart=e.onStart||"",this.onEndMove=e.onEndMove||"",this.direction=e.direction||"v",this.onMoveClb=e.onMove||"",this.relative=e.relative||0,this.ignoreViewChildren=e.ignoreViewChildren||0,this.ignoreModels=e.ignoreModels||0,this.plh=e.placer||"",this.wmargin=e.wmargin||0,this.offTop=e.offsetTop||0,this.offLeft=e.offsetLeft||0,this.document=e.document||document,this.$document=a(this.document),this.dropContent=null,this.em=e.em||"",this.dragHelper=null,this.canvasRelative=e.canvasRelative||0,this.selectOnEnd=!e.avoidSelectOnEnd,this.em&&this.em.on&&(this.em.on("change:canvasOffset",this.udpateOffset),this.udpateOffset())},getContainerEl:function(){if(!this.el){var t=this.opt.container;this.el="string"==typeof t?document.querySelector(t):t,this.$el=a(this.el)}return this.el},getDocuments:function(){var t=this.em,e=t&&t.get("Canvas").getBody().ownerDocument,n=[document];return e&&n.push(e),n},udpateOffset:function(){var t=this.em.get("canvasOffset");this.offTop=t.top,this.offLeft=t.left},setDropContent:function(t){this.dropContent=t},toggleSortCursor:function(t){var e=this.em;document.body,this.ppfx||this.pfx,e?e.get("Canvas").getBody():"";t?e&&e.get("Canvas").startAutoscroll():e&&e.get("Canvas").stopAutoscroll()},setDragHelper:function(t,e){for(var n=e||"",r=t.cloneNode(1),i=t.getBoundingClientRect(),o=getComputedStyle(t),s="",l=0;l<o.length;l++){var c=o[l];s+=c+":"+o.getPropertyValue(c)+";"}document.body.appendChild(r),r.className+=" "+this.pfx+"bdrag",r.setAttribute("style",s),this.dragHelper=r,r.style.width=i.width+"px",r.style.height=i.height+"px",n&&this.moveDragHelper(n),this.em&&a(this.em.get("Canvas").getBody().ownerDocument).off("mousemove",this.moveDragHelper).on("mousemove",this.moveDragHelper),a(document).off("mousemove",this.moveDragHelper).on("mousemove",this.moveDragHelper)},moveDragHelper:function(t){var e=t.target.ownerDocument;if(this.dragHelper&&e){var n=t.pageY,r=t.pageX,i=0,o=0,s=e.defaultView||e.parentWindow,a=s.frameElement,l=this.dragHelper.style;if(a){var c=a.getBoundingClientRect();i=c.top+document.documentElement.scrollTop,o=c.left+document.documentElement.scrollLeft,n=t.clientY,r=t.clientX}l.top=n+i+"px",l.left=r+o+"px"}},matches:function(t,e,n){return s.matches.call(t,e)},closest:function(t,e){if(t){for(var n=t.parentNode;n&&1===n.nodeType;){if(this.matches(n,e))return n;n=n.parentNode}return null}},offset:function(t){var e=t.getBoundingClientRect();return{top:e.top+document.body.scrollTop,left:e.left+document.body.scrollLeft}},createPlaceholder:function(){var t=this.pfx,e=document.createElement("div"),n=document.createElement("div");return e.className=t+"placeholder",e.style.display="none",e.style["pointer-events"]="none",n.className=t+"placeholder-int",e.appendChild(n),e},startSort:function(t){var e=this.em,n=this.itemSel,r=this.containerSel,i=this.getContainerEl(),o=this.getDocuments(),a=this.onStart,l=void 0,c=this.plh;this.dropModel=null,this.moved=0,t&&!this.matches(t,n+", "+r)&&(t=this.closest(t,n)),this.eV=t,c||(c=this.createPlaceholder(),i.appendChild(c),this.plh=c),t&&(l=this.getSourceModel(t),l&&l.set&&l.set("status","freezed")),(0,s.on)(i,"mousemove dragover",this.onMove),(0,s.on)(o,"mouseup dragend",this.endMove),(0,s.on)(o,"keydown",this.rollback),a&&a(),e&&e.clearSelection(),this.toggleSortCursor(1),e&&e.trigger("sorter:drag:start",t,l)},getTargetModel:function(t){var e=t||this.target;return a(e).data("model")},getSourceModel:function(t){var e=t||this.eV,n=this.dropContent,r=this.dropModel,i=this.em;if(n&&i){if(!r){var o=i.get("DomComponents").getComponents(),s={avoidStore:1,avoidChildren:1,avoidUpdateStyle:1,temporary:1},l=o.add(n,s);r=o.remove(l,s),this.dropModel=r instanceof Array?r[0]:r}return r}if(e)return a(e).data("model")},selectTargetModel:function(t){if(!(t instanceof e.Collection)){var n=this.targetModel;n&&n.set("status",""),t&&t.set&&(t.set("status","selected-parent"),this.targetModel=t)}},onMove:function(t){var e=this.em;this.moved=1;var n=this.plh,r=n.style.display;r&&"none"!==r||(n.style.display="block");var i=this.offset(this.el);this.elT=this.wmargin?Math.abs(i.top):i.top,this.elL=this.wmargin?Math.abs(i.left):i.left;var o=t.pageY-this.elT+this.el.scrollTop,s=t.pageX-this.elL+this.el.scrollLeft;if(this.canvasRelative&&e){var l=e.get("Canvas").getMouseRelativeCanvas(t);s=l.x,o=l.y}this.rX=s,this.rY=o,this.eventMove=t;var c=this.dimsFromTarget(t.target,s,o),u=this.target,h=this.getTargetModel(u);this.selectTargetModel(h),this.lastDims=c;var f=this.findPosition(c,s,o);this.lastPos&&this.lastPos.index==f.index&&this.lastPos.method==f.method||(this.movePlaceholder(this.plh,c,f,this.prevTargetDim),this.$plh||(this.$plh=a(this.plh)),this.canvasRelative||(this.offTop&&this.$plh.css("top","+="+this.offTop+"px"),this.offLeft&&this.$plh.css("left","+="+this.offLeft+"px")),this.lastPos=f),"function"==typeof this.onMoveClb&&this.onMoveClb(t),e&&e.trigger("sorter:drag",{target:u,targetModel:h,dims:c,pos:f,x:s,y:o})},isInFlow:function(t,e){if(!t)return!1;e=e||document.body;var n,r=t;return n=r.offsetHeight,!!this.styleInFlow(r,e)},styleInFlow:function(t,e){var n=t.style,r=a(t);if(!(n.overflow&&"visible"!==n.overflow||"none"!==r.css("float")||e&&"flex"==a(e).css("display"))){switch(n.position){case"static":case"relative":case"":break;default:return}switch(t.tagName){case"TR":case"TBODY":case"THEAD":case"TFOOT":return!0}switch(r.css("display")){case"block":case"list-item":case"table":case"flex":return!0}}},validTarget:function(t){var n=this.getSourceModel(),r=n&&n.view&&n.view.el,i=this.getTargetModel(t);t=i&&i.view&&i.view.el;var s={valid:!0,src:r,srcModel:n,trg:t,trgModel:i};if(!r||!t)return s.valid=!1,s;var a=i.get("droppable");a=a instanceof e.Collection?1:a,a=a instanceof Array?a.join(", "):a,s.dropInfo=a,a=(0,o.isString)(a)?this.matches(r,a):a,s.droppable=a;var l=n.get("draggable");return l=l instanceof Array?l.join(", "):l,s.dragInfo=l,l=(0,o.isString)(l)?this.matches(t,l):l,s.draggable=l,a&&l||(s.valid=!1),s},dimsFromTarget:function(t,e,n){var r=this.em,i=[];if(!t)return i;if(this.matches(t,this.itemSel+", "+this.containerSel)||(t=this.closest(t,this.itemSel)),this.draggable instanceof Array&&(t=this.closest(t,this.draggable.join(","))),!t)return i;if(this.prevTarget&&this.prevTarget!=t&&(this.prevTarget=null),!this.prevTarget){this.targetP=this.closest(t,this.containerSel);var o=this.validTarget(t);if(r&&r.trigger("sorter:drag:validation",o),!o.valid&&this.targetP)return this.dimsFromTarget(this.targetP,e,n);this.prevTarget=t,this.prevTargetDim=this.getDim(t),this.cacheDimsP=this.getChildrenDim(this.targetP),this.cacheDims=this.getChildrenDim(t)}if(this.prevTarget==t&&(i=this.cacheDims),
this.target=this.prevTarget,this.nearBorders(this.prevTargetDim,e,n)||!this.nested&&!this.cacheDims.length){var s=this.targetP;s&&this.validTarget(s).valid&&(i=this.cacheDimsP,this.target=s)}return this.lastPos=null,i},getTargetFromEl:function(t){var e=t,n=void 0,r=this.targetPrev,i=this.em,o=this.containerSel,s=this.itemSel;if(this.matches(e,s+", "+o)||(e=this.closest(e,s)),this.draggable instanceof Array&&(e=this.closest(e,this.draggable.join(","))),r&&r!=e&&(this.targetPrev=""),!this.targetPrev){n=this.closest(e,o);var a=this.validTarget(e);if(i&&i.trigger("sorter:drag:validation",a),!a.valid&&n)return this.getTargetFromEl(n);this.targetPrev=e}return this.nearElBorders(e)&&(n=this.closest(e,o),n&&this.validTarget(n).valid&&(e=n)),e},nearElBorders:function(t){var e=10,n=t.getBoundingClientRect(),r=t.ownerDocument.body,i=this.getCurrentPos(),o=i.x,s=i.y,a=n.top+r.scrollTop,l=n.left+r.scrollLeft,c=n.width,u=n.height;if(s<a+e||s>a+u-e||o<l+e||o>l+c-e)return 1},getCurrentPos:function(){var t=this.eventMove,e=t.pageX||0,n=t.pageY||0;return{x:e,y:n}},getDim:function(t){var e,n,r,i;if(this.canvasRelative&&this.em){var o=this.em.get("Canvas").getElementPos(t),s=window.getComputedStyle(t),a=parseFloat(s.marginTop),l=parseFloat(s.marginBottom),c=parseFloat(s.marginRight),u=parseFloat(s.marginLeft);e=o.top-a,n=o.left-u,r=o.height+a+l,i=o.width+u+c}else{var h=this.offset(t);e=this.relative?t.offsetTop:h.top-(this.wmargin?-1:1)*this.elT,n=this.relative?t.offsetLeft:h.left-(this.wmargin?-1:1)*this.elL,r=t.offsetHeight,i=t.offsetWidth}return[e,n,r,i]},getChildrenDim:function(t){var e=[];if(!t)return e;var n=this.getTargetModel(t);n&&n.view&&!this.ignoreViewChildren&&(t=n.view.getChildrenContainer());for(var r=t.children,i=0,o=r.length;i<o;i++){var s=r[i];if(this.matches(s,this.itemSel)){var a=this.getDim(s),l=this.direction;l="v"==l||"h"!=l&&this.isInFlow(s,t),a.push(l),a.push(s),e.push(a)}}return e},nearBorders:function(t,e,n){var r=0,i=this.borderOffset,o=e||0,s=n||0,a=t[0],l=t[1],c=t[2],u=t[3];return(a+i>s||s>a+c-i||l+i>o||o>l+u-i)&&(r=1),!!r},findPosition:function(t,e,n){for(var r={index:0,method:"before"},i=0,o=0,s=0,a=0,l=0,c=0,u=0,h=0,f=0,d=t.length;f<d;f++)if(h=t[f],s=h[1]+h[3],u=h[0]+h[2],l=h[1]+h[3]/2,c=h[0]+h[2]/2,!(o&&h[1]>o||a&&c>=a||i&&s<i))if(r.index=f,h[4]){if(n<c){r.method="before";break}r.method="after"}else n<u&&(a=u),e<l?(o=l,r.method="before"):(i=l,r.method="after");return r},movePlaceholder:function(t,e,n,r){var i=0,o=0,s=0,a=0,l=0,c="px",u=5,h="#62c462",f=3,d=n.method,p=e[n.index];if(t.style.borderColor="transparent "+h,t.style.borderWidth=f+c+" "+(f+2)+c,t.style.margin="-"+f+"px 0 0",p)p[4]?(a=p[3]+c,l="auto",o="before"==d?p[0]-i:p[0]+p[2]-i,s=p[1]):(a="auto",l=p[2]-2*i+c,o=p[0]+i,s="before"==d?p[1]-i:p[1]+p[3]-i,t.style.borderColor=h+" transparent",t.style.borderWidth=f+2+c+" "+f+c,t.style.margin="0 0 0 -"+f+"px");else{if(!this.nested)return void(t.style.display="none");r&&(o=r[0]+u,s=r[1]+u,a=parseInt(r[3])-2*u+c,l="auto")}t.style.top=o+c,t.style.left=s+c,a&&(t.style.width=a),l&&(t.style.height=l)},endMove:function(t){var e,n=this.getDocuments(),r=this.getContainerEl();(0,s.off)(r,"mousemove dragover",this.onMove),(0,s.off)(n,"mouseup dragend",this.endMove),(0,s.off)(n,"keydown",this.rollback),this.plh.style.display="none";var i=(new RegExp("(?:^|\\s)"+this.freezeClass+"(?!\\S)","gi"),this.eV);if(i){var o=this.getSourceModel();o&&o.set&&(o.set("status",""),o.set("status","selected"))}this.moved&&(e=this.move(this.target,i,this.lastPos)),this.plh&&(this.plh.style.display="none"),"function"==typeof this.onEndMove&&this.onEndMove(e);var a=this.dragHelper;a&&(a.parentNode.removeChild(a),this.dragHelper=null),this.selectTargetModel(),this.toggleSortCursor()},move:function(t,n,r){var o=this.em;o&&o.trigger("component:dragEnd:before",t,n,r);var s,l,c,u=[],h=r.index,f=this.validTarget(t),d=a(t).data("collection"),p=f.srcModel,g=f.droppable,v=f.draggable,m=f.dropInfo,y=f.dragInfo,b=this.dropContent;if(g=f.trgModel instanceof e.Collection?1:g,d&&g&&v){h="after"===r.method?h+1:h;var w={at:h,noIncrement:1};b?(s=b,w.silent=!1,w.avoidUpdateStyle=1):(l=d.add({},i({},w,{avoidStore:1})),p&&(s=p.collection.remove(p))),c=d.add(s,w),b?this.dropContent=null:d.remove(l,{avoidStore:1}),this.prevTarget=null}else d||u.push("Target collection not found"),g||u.push("Target is not droppable, accepts ["+m+"]"),v||u.push("Component not draggable, acceptable by ["+y+"]");return o&&o.trigger("component:dragEnd",d,s,u),o&&o.trigger("sorter:drag:end",d,s,u),c},rollback:function(t){(0,s.off)(this.getDocuments(),"keydown",this.rollback);var e=t.which||t.keyCode;27==e&&(this.moved=0,this.endMove())}})}).call(e,n(0),n(1))},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(1),s=n(2),a={mousePosFetcher:null,updateTarget:null,ratioDefault:0,posFetcher:null,onStart:null,onMove:null,onEnd:null,step:1,minDim:32,maxDim:"",unitHeight:"px",unitWidth:"px",keyHeight:"height",keyWidth:"width",currentUnit:1,tl:1,tc:1,tr:1,cl:1,cr:1,bl:1,bc:1,br:1},l=function(t,e){var n=e.prefix||"",r=document.createElement("i");return r.className=n+"resizer-h "+n+"resizer-h-"+t,r.setAttribute("data-"+n+"handler",t),r},c=function(t,e){var n=e||window,r=t.getBoundingClientRect();return{left:r.left+n.pageXOffset,top:r.top+n.pageYOffset,width:r.width,height:r.height}},u=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(this,t),this.setOptions(e),(0,o.bindAll)(this,"handleKeyDown","handleMouseDown","move","stop"),this}return i(t,[{key:"getConfig",value:function(){return this.opts}},{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opts=(0,o.defaults)(t,a),this.setup()}},{key:"setup",value:function(){var t=this.opts,e=t.prefix||"",n=t.appendTo||document.body,r=this.container;for(r||(r=document.createElement("div"),r.className=e+"resizer-c",n.appendChild(r),this.container=r);r.firstChild;)r.removeChild(r.firstChild);var i={};["tl","tc","tr","cl","cr","bl","bc","br"].forEach(function(e){return i[e]=t[e]?l(e,t):""});for(var o in i){var s=i[o];s&&r.appendChild(s)}this.handlers=i,this.mousePosFetcher=t.mousePosFetcher,this.updateTarget=t.updateTarget,this.posFetcher=t.posFetcher,this.onStart=t.onStart,this.onMove=t.onMove,this.onEnd=t.onEnd}},{key:"isHandler",value:function(t){var e=this.handlers;for(var n in e)if(e[n]===t)return!0;return!1}},{key:"getFocusedEl",value:function(){return this.el}},{key:"getDocumentEl",value:function(){return[this.el.ownerDocument,document]}},{key:"getElementPos",value:function(t){var e=this.posFetcher||"";return e?e(t):c(t)}},{key:"focus",value:function(t){if(!t||t!==this.el){this.el=t;var e="px",n=this.getElementPos(t),r=this.container,i=r.style;i.left=n.left+e,i.top=n.top+e,i.width=n.width+e,i.height=n.height+e,r.style.display="block",(0,s.on)(this.getDocumentEl(),"mousedown",this.handleMouseDown)}}},{key:"blur",value:function(){this.container.style.display="none",this.el&&((0,s.off)(this.getDocumentEl(),"mousedown",this.handleMouseDown),this.el=null)}},{key:"start",value:function(t){if(0===t.button){t.preventDefault(),t.stopPropagation();var e=this.el,n=this,r=this.opts||{},i="data-"+r.prefix+"handler",a=this.getElementPos(e);this.handlerAttr=t.target.getAttribute(i),this.clickedHandler=t.target,this.startDim={t:a.top,l:a.left,w:a.width,h:a.height},this.rectDim={t:a.top,l:a.left,w:a.width,h:a.height},this.startPos={x:t.clientX,y:t.clientY};var l=this.getDocumentEl();(0,s.on)(l,"mousemove",this.move),(0,s.on)(l,"keydown",this.handleKeyDown),(0,s.on)(l,"mouseup",this.stop),(0,o.isFunction)(this.onStart)&&this.onStart(t,{docs:l,config:r,el:e,resizer:n}),this.move(t)}}},{key:"move",value:function(t){var e=this.onMove,n=this.mousePosFetcher,r=n?n(t):{x:t.clientX,y:t.clientY};this.currentPos=r,this.delta={x:r.x-this.startPos.x,y:r.y-this.startPos.y},this.keys={shift:t.shiftKey,ctrl:t.ctrlKey,alt:t.altKey},this.rectDim=this.calc(this),this.updateRect(0),e&&e(t),0===t.which&&this.stop(t)}},{key:"stop",value:function(t){var e=this.opts,n=this.getDocumentEl();(0,s.off)(n,"mousemove",this.move),(0,s.off)(n,"keydown",this.handleKeyDown),(0,s.off)(n,"mouseup",this.stop),this.updateRect(1),(0,o.isFunction)(this.onEnd)&&this.onEnd(t,{docs:n,config:e})}},{key:"updateRect",value:function(t){var e=this.el,n=this,r=this.opts,i=this.rectDim,s=this.container.style,a=this.updateTarget,l=this.getSelectedHandler(),c=r.unitHeight,u=r.unitWidth;if((0,o.isFunction)(a))a(e,i,{store:t,selectedHandler:l,resizer:n,config:r});else{var h=e.style;h.width=i.w+u,h.height=i.h+c}var f="px",d=this.getElementPos(e);s.left=d.left+f,s.top=d.top+f,s.width=d.width+f,s.height=d.height+f}},{key:"getSelectedHandler",value:function(){var t=this.handlers;if(this.selectedHandler)for(var e in t)if(t[e]===this.selectedHandler)return e}},{key:"handleKeyDown",value:function(t){27===t.keyCode&&(this.rectDim=this.startDim,this.stop(t))}},{key:"handleMouseDown",value:function(t){var e=t.target;this.isHandler(e)?(this.selectedHandler=e,this.start(t)):e!==this.el&&(this.selectedHandler="",this.blur())}},{key:"calc",value:function(t){var e=void 0,n=this.opts||{},r=n.step,i=this.startDim,o=n.minDim,a=n.maxDim,l=t.delta.x,c=t.delta.y,u=i.w,h=i.h,f={t:0,l:0,w:u,h:h};if(t){var d=t.handlerAttr;~d.indexOf("r")&&(e=(0,s.normalizeFloat)(u+l*r,r),e=Math.max(o,e),a&&(e=Math.min(a,e)),f.w=e),~d.indexOf("b")&&(e=(0,s.normalizeFloat)(h+c*r,r),e=Math.max(o,e),a&&(e=Math.min(a,e)),f.h=e),~d.indexOf("l")&&(e=(0,s.normalizeFloat)(u-l*r,r),e=Math.max(o,e),a&&(e=Math.min(a,e)),f.w=e),~d.indexOf("t")&&(e=(0,s.normalizeFloat)(h-c*r,r),e=Math.max(o,e),a&&(e=Math.min(a,e)),f.h=e);var p=n.ratioDefault?!t.keys.shift:t.keys.shift;if(d.indexOf("c")<0&&p){var g=i.w/i.h;f.w/f.h>g?f.h=Math.round(f.w/g):f.w=Math.round(f.h*g)}return~d.indexOf("l")&&(f.l=i.w-f.w),~d.indexOf("t")&&(f.t=i.h-f.h),f}}}]),t}();t.exports={init:function(t){return new u(t)}}},function(t,e,n){"use strict";(function(e){var n=e.$,r=function(t,e){var n=e||window,r=t.getBoundingClientRect();return{left:r.left+n.pageXOffset,top:r.top+n.pageYOffset,width:r.width,height:r.height}};t.exports={setKey:function(t,e){},getElementRect:function(t){var e=this.opts.posFetcher||"";return e?e(t,{avoidFrameOffset:1}):r(t)},init:function(t){return this.setOptions(t),this.handleMouseDown=this.handleMouseDown.bind(this),this.drag=this.drag.bind(this),this.move=this.move.bind(this),this.stop=this.stop.bind(this),this.setKey("up, right, down, left",this.handleKey),this},setOptions:function(t){this.opts=t||{}},focus:function(t){if(!t||t!==this.el){this.getDocumentEl(t),this.blur(),this.el=t,this.handlers=this.opts.dragHandlers||[t];var e=this.getElementRect(t);this.elRect=e,this.startTop=e.top,this.startLeft=e.left,this.getDocumentEl().on("mousedown",this.handleMouseDown)}},blur:function(){this.getDocumentEl().off("mousedown",this.handleMouseDown),this.el=null},start:function(t){this.startPos=this.getMousePos(t);var e=this.getDocumentEl();e.on("mousemove",this.drag),e.on("mouseup",this.stop);var n=this.opts.onStart;"function"==typeof n&&n(t,{docs:e,el:this.el,start:this.startPos,elRect:this.elRect}),this.drag(t)},stop:function(t){var e=this.getDocumentEl();e.off("mousemove",this.drag),e.off("mouseup",this.stop),this.lockedAxis=null;var n=this.opts.onEnd;"function"==typeof n&&n(t,{docs:e,delta:this.delta,end:{x:this.startLeft+this.delta.x,y:this.startTop+this.delta.y}})},handleMouseDown:function(t){var e=t.target;this.isHandler(e)&&this.start(t)},isHandler:function(t){var e=this.handlers;for(var n in e)if(e[n]===t)return!0;return!1},handleKey:function(t,e){switch(e.shortcut){case"up":this.move(0,-1);break;case"right":this.move(1,0);break;case"down":this.move(0,1);break;case"left":this.move(-1,0)}},getDocumentEl:function(t){var t=t||this.el;if(!this.$doc){var e=[document];t&&e.push(t.ownerDocument),this.$doc=n(e)}return this.$doc},getMousePos:function(t){var e=this.opts.mousePosFetcher;return e?e(t):{x:t.clientX,y:t.clientY}},drag:function(t){var e=this.lockedAxis,n=this.getMousePos(t),r={x:n.x-this.startPos.x,y:n.y-this.startPos.y};if(t.shiftKey){if(!e){var i=r.x,o=r.y,s=Math.abs(i),a=Math.abs(o);o>=s||o<=-s?e="x":(i>a||i<-a)&&(e="y")}}else e=null;"x"===e&&(r.x=this.startPos.x),"y"===e&&(r.y=this.startPos.y),this.lockedAxis=e,this.delta=r,this.move(r.x,r.y);var l=this.opts.onDrag;"function"==typeof l&&l(t,{delta:r,current:{x:this.startLeft+r.x,y:this.startTop+r.y},lockedAxis:e}),0===t.which&&this.stop(t)},move:function(t,e){this.moveX(t),this.moveY(e)},moveX:function(t){var e=this.el,n=(this.opts,this.startLeft+t),r=this.opts.setX;"function"==typeof r?r(n,{el:e,start:this.startLeft,delta:t}):e.style.left=n+"px"},moveY:function(t){var e=this.el,n=(this.opts,this.startTop+t),r=this.opts.setY;"function"==typeof r?r(n,{el:e,start:this.startTop,delta:t}):e.style.top=n+"px"}}}).call(e,n(0))},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o=n(1),s=n(23);t.exports=function(){var t=void 0,e=void 0,n={},a={defaults:{"core:undo":{keys:"⌘+z, ctrl+z",handler:"core:undo"},"core:redo":{keys:"⌘+shift+z, ctrl+shift+z",handler:"core:redo"},"core:copy":{keys:"⌘+c, ctrl+c",handler:"core:copy"},"core:paste":{keys:"⌘+v, ctrl+v",handler:"core:paste"}}};return{keymaster:s,name:"Keymaps",getConfig:function(){return e},init:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e=i({},a,n),t=e.em,this.em=t,this},onLoad:function(){var t=e.defaults;for(var n in t){var r=t[n];this.add(n,r.keys,r.handler)}},add:function(t,e,i){var a=this.em,l=a.get("Commands"),c=a.getEditor(),u={id:t,keys:e,handler:i},h=n[t];return h&&this.remove(t),n[t]=u,s(e,function(e,n){i=(0,o.isString)(i)?l.get(i):i,"object"==("undefined"==typeof i?"undefined":r(i))?i.run(c):i(c);var s=[t,n.shortcut,e];a.trigger.apply(a,["keymap:emit"].concat(s)),a.trigger.apply(a,["keymap:emit:"+t].concat(s))}),a.trigger("keymap:add",u),u},get:function(t){return n[t]},getAll:function(){return n},remove:function(t){var e=this.em,r=this.get(t);if(r)return delete n[t],s.unbind(r.keys),e&&e.trigger("keymap:remove",r),r}}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o=n(69),s=r(o);t.exports=function(){var t=void 0,e=void 0,n=void 0,r=void 0,o={};return{name:"UndoManager",init:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n=i({},a,o),t=n.em,this.em=t,e=new s["default"]({track:!0,register:[]}),e.changeUndoType("change",{condition:!1}),e.changeUndoType("add",{on:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!n.avoidStore)return{object:e,before:void 0,after:t,options:i({},n)}}}),e.changeUndoType("remove",{on:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!n.avoidStore)return{object:e,before:t,after:void 0,options:i({},n)}}});var l={on:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!r&&(r=t.previousAttributes()),!n.avoidStore){var i={object:t,before:r,after:t.toJSON()};return r=null,i}},undo:function(t,e,n,r){t.set(e)},redo:function(t,e,n,r){t.set(n)}},c=["style","attributes","content","src"];return c.forEach(function(t){return e.addUndoType("change:"+t,l)}),e.on("undo redo",function(){return t.trigger("change:selectedComponent change:canvasOffset")}),["undo","redo"].forEach(function(n){return e.on(n,function(){return t.trigger(n)})}),this},getConfig:function(){return n},add:function(t){return e.register(t),this},remove:function(t){return e.unregister(t),this},removeAll:function(){return e.unregisterAll(),this},start:function(){return e.startTracking(),this},stop:function(){return e.stopTracking(),this},undo:function(){return t.get("Canvas").isInputFocused()||e.undo(1),this},undoAll:function(){return e.undoAll(),this},redo:function(){return t.get("Canvas").isInputFocused()||e.redo(1),this},redoAll:function(){return e.redoAll(),this},hasUndo:function(){return e.isAvailable("undo")},hasRedo:function(){return e.isAvailable("redo")},getStack:function(){return e.stack},clear:function(){return e.clear(),this},getInstance:function(){return e}}}},function(t,e,n){var r,i,o;!function(s){i=[n(1),n(70)],r=s,o="function"==typeof r?r.apply(e,i):r,!(void 0!==o&&(t.exports=o))}(function(t,e){function n(t,e,n){return n.length<=4?t.call(e,n[0],n[1],n[2],n[3]):t.apply(e,n)}function r(t,e){return d.call(t,e)}function i(e,n){return null!=e&&(t.isArray(n)||(n=r(arguments,1)),t.all(n,function(t){return t in e}))}function o(){this.registeredObjects=[],this.cidIndexes=[]}function s(e,n,r,i){for(var o,s=0,a=n.length;s<a;s++)if(o=n[s]){if("on"===e){if(!i.objectRegistry.register(o))continue}else if(!i.objectRegistry.unregister(o))continue;t.isFunction(o[e])&&o[e]("all",r,i)}}function a(e,n){var r=n.type,i=n.undoTypes,o=!i[r]||i[r][e];t.isFunction(o)&&o(n.object,n.before,n.after,n.options)}function l(e,n,r,i,o){if(!(r.isCurrentlyUndoRedoing||"undo"===e&&r.pointer===-1||"redo"===e&&r.pointer===r.length-1)){r.isCurrentlyUndoRedoing=!0;var s,a,l="undo"===e;for(o?a=l&&r.pointer===r.length-1||!l&&r.pointer===-1?t.clone(r.models):d.apply(r.models,l?[0,r.pointer]:[r.pointer,r.length-1]):(s=r.at(l?r.pointer:r.pointer+1),a=i?r.where({magicFusionIndex:s.get("magicFusionIndex")}):[s]),r.pointer+=(l?-1:1)*a.length;s=l?a.pop():a.shift();)s[e]();r.isCurrentlyUndoRedoing=!1,n.trigger(e,n)}}function c(t,e){var r=t.condition,i=typeof r;return"function"===i?!!n(r,t,e):"boolean"!==i||r}function u(t,e,r,o){if(t.track&&!t.isCurrentlyUndoRedoing&&e in o&&c(o[e],r)){var s,a=n(o[e].on,o[e],r);if(i(a,"object","before","after")){if(a.type=e,a.magicFusionIndex=p(),a.undoTypes=o,t.pointer<t.length-1)for(var s=t.length-t.pointer-1;s--;)t.pop();t.pointer=t.length,t.add(a),t.length>t.maximumStackLength&&(t.shift(),t.pointer--)}}}function h(){}function f(e,n,r,o){if("object"==typeof n)return t.each(n,function(t,n){2===e?f(e,t,r,o):f(e,n,t,r)});switch(e){case 0:i(r,"undo","redo","on")&&t.all(t.pick(r,"undo","redo","on"),t.isFunction)&&(o[n]=r);break;case 1:o[n]&&t.isObject(r)&&(o[n]=t.extend({},o[n],r));break;case 2:delete o[n]}return this}var d=Array.prototype.slice,p=function(){function e(){r++,n=!0,t.defer(function(){n=!1})}var n=!1,r=-1;return function(){return n||e(),r}}();o.prototype={isRegistered:function(e){return e&&e.cid?this.registeredObjects[e.cid]:t.contains(this.registeredObjects,e)},register:function(t){return!this.isRegistered(t)&&(t&&t.cid?(this.registeredObjects[t.cid]=t,this.cidIndexes.push(t.cid)):this.registeredObjects.push(t),!0)},unregister:function(e){if(this.isRegistered(e)){if(e&&e.cid)delete this.registeredObjects[e.cid],this.cidIndexes.splice(t.indexOf(this.cidIndexes,e.cid),1);else{var n=t.indexOf(this.registeredObjects,e);this.registeredObjects.splice(n,1)}return!0}return!1},get:function(){return t.map(this.cidIndexes,function(t){return this.registeredObjects[t]},this).concat(this.registeredObjects)}};var g={add:{undo:function(t,e,n,r){t.remove(n,r)},redo:function(t,e,n,r){r.index&&(r.at=r.index),t.add(n,r)},on:function(e,n,r){return{object:n,before:void 0,after:e,options:t.clone(r)}}},remove:{undo:function(t,e,n,r){"index"in r&&(r.at=r.index),t.add(e,r)},redo:function(t,e,n,r){t.remove(e,r)},on:function(e,n,r){return{object:n,before:e,after:void 0,options:t.clone(r)}}},change:{undo:function(e,n,r,i){t.isEmpty(n)?t.each(t.keys(r),e.unset,e):(e.set(n),i&&i.unsetData&&i.unsetData.before&&i.unsetData.before.length&&t.each(i.unsetData.before,e.unset,e))},redo:function(e,n,r,i){t.isEmpty(r)?t.each(t.keys(n),e.unset,e):(e.set(r),i&&i.unsetData&&i.unsetData.after&&i.unsetData.after.length&&t.each(i.unsetData.after,e.unset,e))},on:function(e,n){var r=e.changedAttributes(),i=t.keys(r),o=t.pick(e.previousAttributes(),i),s=t.keys(o),a=(n||(n={})).unsetData={after:[],before:[]};return i.length!=s.length&&(i.length>s.length?t.each(i,function(t){t in o||a.before.push(t)},this):t.each(s,function(t){t in r||a.after.push(t)})),{object:e,before:o,after:r,options:t.clone(n)}}},reset:{undo:function(t,e,n){t.reset(e)},redo:function(t,e,n){t.reset(n)},on:function(e,n){return{object:e,before:n.previousModels,after:t.clone(e.models)}}}};h.prototype=g;var v=e.Model.extend({defaults:{type:null,object:null,before:null,after:null,magicFusionIndex:null},undo:function(t){a("undo",this.attributes)},redo:function(t){a("redo",this.attributes)}}),m=e.Collection.extend({model:v,pointer:-1,track:!1,isCurrentlyUndoRedoing:!1,maximumStackLength:1/0,setMaxLength:function(t){this.maximumStackLength=t}}),y=e.Model.extend({defaults:{maximumStackLength:1/0,track:!1},initialize:function(e){this.stack=new m,this.objectRegistry=new o,this.undoTypes=new h,this.stack.setMaxLength(this.get("maximumStackLength")),this.on("change:maximumStackLength",function(t,e){this.stack.setMaxLength(e)},this),e&&e.track&&this.startTracking(),e&&e.register&&(t.isArray(e.register)||t.isArguments(e.register)?n(this.register,this,e.register):this.register(e.register))},startTracking:function(){this.set("track",!0),this.stack.track=!0},stopTracking:function(){this.set("track",!1),this.stack.track=!1},isTracking:function(){return this.get("track")},_addToStack:function(t){u(this.stack,t,r(arguments,1),this.undoTypes)},register:function(){s("on",arguments,this._addToStack,this)},unregister:function(){s("off",arguments,this._addToStack,this)},unregisterAll:function(){n(this.unregister,this,this.objectRegistry.get())},undo:function(t){l("undo",this,this.stack,t)},undoAll:function(){l("undo",this,this.stack,!1,!0)},redo:function(t){l("redo",this,this.stack,t)},redoAll:function(){l("redo",this,this.stack,!1,!0)},isAvailable:function(t){var e=this.stack,n=e.length;switch(t){case"undo":return n>0&&e.pointer>-1;case"redo":return n>0&&e.pointer<n-1;default:return!1}},merge:function(e){for(var n,i=t.isArray(e)?e:r(arguments);n=i.pop();)n instanceof y&&n.stack instanceof m&&(n.stack=this.stack)},addUndoType:function(t,e){f(0,t,e,this.undoTypes)},changeUndoType:function(t,e){f(1,t,e,this.undoTypes)},removeUndoType:function(t){f(2,t,void 0,this.undoTypes)},clear:function(){this.stack.reset(),this.stack.pointer=-1}});return t.extend(y,{defaults:function(e){t.extend(y.prototype.defaults,e)},addUndoType:function(t,e){f(0,t,e,g)},changeUndoType:function(t,e){f(1,t,e,g)},removeUndoType:function(t){f(2,t,void 0,g)}}),e.UndoManager=y})},function(t,e,n){(function(r){var i,o;!function(s){var a="object"==typeof self&&self.self==self&&self||"object"==typeof r&&r.global==r&&r;i=[n(1),n(9),e],o=function(t,e,n){a.Backbone=s(a,n,t,e)}.apply(e,i),!(void 0!==o&&(t.exports=o))}(function(t,e,n,r){var i=t.Backbone,o=[].slice;e.VERSION="1.2.1",e.$=r,e.noConflict=function(){return t.Backbone=i,this},e.emulateHTTP=!1,e.emulateJSON=!1;var s=function(t,e,r){switch(t){case 1:return function(){return n[e](this[r])};case 2:return function(t){return n[e](this[r],t)};case 3:return function(t,i){return n[e](this[r],t,i)};case 4:return function(t,i,o){return n[e](this[r],t,i,o)};default:return function(){var t=o.call(arguments);return t.unshift(this[r]),n[e].apply(n,t)}}},a=function(t,e,r){n.each(e,function(e,i){n[i]&&(t.prototype[i]=s(e,i,r))})},l=e.Events={},c=/\s+/,u=function(t,e,r,i,o){var s,a=0;if(r&&"object"==typeof r){void 0!==i&&"context"in o&&void 0===o.context&&(o.context=i);for(s=n.keys(r);a<s.length;a++)e=t(e,s[a],r[s[a]],o)}else if(r&&c.test(r))for(s=r.split(c);a<s.length;a++)e=t(e,s[a],i,o);else e=t(e,r,i,o);return e};l.on=function(t,e,n){return h(this,t,e,n)};var h=function(t,e,n,r,i){if(t._events=u(f,t._events||{},e,n,{context:r,ctx:t,listening:i}),i){var o=t._listeners||(t._listeners={});o[i.id]=i}return t};l.listenTo=function(t,e,r){if(!t)return this;var i=t._listenId||(t._listenId=n.uniqueId("l")),o=this._listeningTo||(this._listeningTo={}),s=o[i];if(!s){var a=this._listenId||(this._listenId=n.uniqueId("l"));s=o[i]={obj:t,objId:i,id:a,listeningTo:o,count:0}}return h(t,e,r,this,s),this};var f=function(t,e,n,r){if(n){var i=t[e]||(t[e]=[]),o=r.context,s=r.ctx,a=r.listening;a&&a.count++,i.push({callback:n,context:o,ctx:o||s,listening:a})}return t};l.off=function(t,e,n){return this._events?(this._events=u(d,this._events,t,e,{context:n,listeners:this._listeners}),this):this},l.stopListening=function(t,e,r){var i=this._listeningTo;if(!i)return this;for(var o=t?[t._listenId]:n.keys(i),s=0;s<o.length;s++){var a=i[o[s]];if(!a)break;a.obj.off(e,r,this)}return n.isEmpty(i)&&(this._listeningTo=void 0),this};var d=function(t,e,r,i){if(t){var o,s=0,a=i.context,l=i.listeners;if(e||r||a){for(var c=e?[e]:n.keys(t);s<c.length;s++){e=c[s];var u=t[e];if(!u)break;for(var h=[],f=0;f<u.length;f++){var d=u[f];r&&r!==d.callback&&r!==d.callback._callback||a&&a!==d.context?h.push(d):(o=d.listening,o&&0===--o.count&&(delete l[o.id],delete o.listeningTo[o.objId]))}h.length?t[e]=h:delete t[e]}return n.size(t)?t:void 0}for(var p=n.keys(l);s<p.length;s++)o=l[p[s]],delete l[o.id],delete o.listeningTo[o.objId]}};l.once=function(t,e,r){var i=u(p,{},t,e,n.bind(this.off,this));return this.on(i,void 0,r)},l.listenToOnce=function(t,e,r){var i=u(p,{},e,r,n.bind(this.stopListening,this,t));return this.listenTo(t,i)};var p=function(t,e,r,i){if(r){var o=t[e]=n.once(function(){i(e,o),r.apply(this,arguments)});o._callback=r}return t};l.trigger=function(t){if(!this._events)return this;for(var e=Math.max(0,arguments.length-1),n=Array(e),r=0;r<e;r++)n[r]=arguments[r+1];return u(g,this._events,t,void 0,n),this};var g=function(t,e,n,r){if(t){var i=t[e],o=t.all;i&&o&&(o=o.slice()),i&&v(i,r),o&&v(o,[e].concat(r))}return t},v=function(t,e){var n,r=-1,i=t.length,o=e[0],s=e[1],a=e[2];switch(e.length){case 0:for(;++r<i;)(n=t[r]).callback.call(n.ctx);return;case 1:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o);return;case 2:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,s);return;case 3:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,s,a);return;default:for(;++r<i;)(n=t[r]).callback.apply(n.ctx,e);return}};l.bind=l.on,l.unbind=l.off,n.extend(e,l);var m=e.Model=function(t,e){var r=t||{};e||(e={}),this.cid=n.uniqueId(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(r=this.parse(r,e)||{}),r=n.defaults({},r,n.result(this,"defaults")),this.set(r,e),this.changed={},this.initialize.apply(this,arguments)};n.extend(m.prototype,l,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",initialize:function(){},toJSON:function(t){return n.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return n.escape(this.get(t))},has:function(t){return null!=this.get(t)},matches:function(t){return!!n.iteratee(t,this)(this.attributes)},set:function(t,e,r){if(null==t)return this;var i;if("object"==typeof t?(i=t,r=e):(i={})[t]=e,r||(r={}),!this._validate(i,r))return!1;var o=r.unset,s=r.silent,a=[],l=this._changing;this._changing=!0,l||(this._previousAttributes=n.clone(this.attributes),this.changed={});var c=this.attributes,u=this.changed,h=this._previousAttributes;this.idAttribute in i&&(this.id=i[this.idAttribute]);for(var f in i)e=i[f],n.isEqual(c[f],e)||a.push(f),n.isEqual(h[f],e)?delete u[f]:u[f]=e,o?delete c[f]:c[f]=e;if(!s){a.length&&(this._pending=r);for(var d=0;d<a.length;d++)this.trigger("change:"+a[d],this,c[a[d]],r)}if(l)return this;if(!s)for(;this._pending;)r=this._pending,this._pending=!1,this.trigger("change",this,r);return this._pending=!1,this._changing=!1,this},unset:function(t,e){return this.set(t,void 0,n.extend({},e,{unset:!0}))},clear:function(t){var e={};for(var r in this.attributes)e[r]=void 0;return this.set(e,n.extend({},t,{unset:!0}))},hasChanged:function(t){return null==t?!n.isEmpty(this.changed):n.has(this.changed,t)},changedAttributes:function(t){if(!t)return!!this.hasChanged()&&n.clone(this.changed);var e=this._changing?this._previousAttributes:this.attributes,r={};for(var i in t){var o=t[i];n.isEqual(e[i],o)||(r[i]=o)}return!!n.size(r)&&r},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return n.clone(this._previousAttributes)},fetch:function(t){t=n.extend({parse:!0},t);var e=this,r=t.success;return t.success=function(n){var i=t.parse?e.parse(n,t):n;return!!e.set(i,t)&&(r&&r.call(t.context,e,n,t),void e.trigger("sync",e,n,t))},F(this,t),this.sync("read",this,t)},save:function(t,e,r){var i;null==t||"object"==typeof t?(i=t,r=e):(i={})[t]=e,r=n.extend({validate:!0,parse:!0},r);var o=r.wait;if(i&&!o){if(!this.set(i,r))return!1}else if(!this._validate(i,r))return!1;var s=this,a=r.success,l=this.attributes;r.success=function(t){s.attributes=l;var e=r.parse?s.parse(t,r):t;return o&&(e=n.extend({},i,e)),!(e&&!s.set(e,r))&&(a&&a.call(r.context,s,t,r),void s.trigger("sync",s,t,r))},F(this,r),i&&o&&(this.attributes=n.extend({},l,i));var c=this.isNew()?"create":r.patch?"patch":"update";"patch"!==c||r.attrs||(r.attrs=i);var u=this.sync(c,this,r);return this.attributes=l,u},destroy:function(t){t=t?n.clone(t):{};var e=this,r=t.success,i=t.wait,o=function(){e.stopListening(),e.trigger("destroy",e,e.collection,t)};t.success=function(n){i&&o(),r&&r.call(t.context,e,n,t),e.isNew()||e.trigger("sync",e,n,t)};var s=!1;return this.isNew()?n.defer(t.success):(F(this,t),s=this.sync("delete",this,t)),i||o(),s},url:function(){var t=n.result(this,"urlRoot")||n.result(this.collection,"url")||B();if(this.isNew())return t;var e=this.get(this.idAttribute);return t.replace(/[^\/]$/,"$&/")+encodeURIComponent(e)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},n.defaults({validate:!0},t))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=n.extend({},this.attributes,t);var r=this.validationError=this.validate(t,e)||null;return!r||(this.trigger("invalid",this,r,n.extend(e,{validationError:r})),!1)}});var y={keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1};a(m,y,"attributes");var b=e.Collection=function(t,e){e||(e={}),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,n.extend({silent:!0},e))},w={add:!0,remove:!0,merge:!0},x={add:!0,remove:!1};n.extend(b.prototype,l,{model:m,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,n.extend({merge:!1},e,x))},remove:function(t,e){e=n.extend({},e);var r=!n.isArray(t);t=r?[t]:n.clone(t);var i=this._removeModels(t,e);return!e.silent&&i&&this.trigger("update",this,e),r?i[0]:i},set:function(t,e){e=n.defaults({},e,w),e.parse&&!this._isModel(t)&&(t=this.parse(t,e));var r=!n.isArray(t);t=r?t?[t]:[]:t.slice();var i,o,s,a,l,c=e.at;null!=c&&(c=+c),c<0&&(c+=this.length+1);for(var u=this.comparator&&null==c&&e.sort!==!1,h=n.isString(this.comparator)?this.comparator:null,f=[],d=[],p={},g=e.add,v=e.merge,m=e.remove,y=!(u||!g||!m)&&[],b=!1,x=0;x<t.length;x++){if(s=t[x],a=this.get(s))m&&(p[a.cid]=!0),v&&s!==a&&(s=this._isModel(s)?s.attributes:s,e.parse&&(s=a.parse(s,e)),a.set(s,e),u&&!l&&a.hasChanged(h)&&(l=!0)),
t[x]=a;else if(g){if(o=t[x]=this._prepareModel(s,e),!o)continue;f.push(o),this._addReference(o,e)}o=a||o,o&&(i=this.modelId(o.attributes),!y||!o.isNew()&&p[i]||(y.push(o),b=b||!this.models[x]||o.cid!==this.models[x].cid),p[i]=!0)}if(m){for(var x=0;x<this.length;x++)p[(o=this.models[x]).cid]||d.push(o);d.length&&this._removeModels(d,e)}if(f.length||b)if(u&&(l=!0),this.length+=f.length,null!=c)for(var x=0;x<f.length;x++)this.models.splice(c+x,0,f[x]);else{y&&(this.models.length=0);for(var _=y||f,x=0;x<_.length;x++)this.models.push(_[x])}if(l&&this.sort({silent:!0}),!e.silent){for(var C=null!=c?n.clone(e):e,x=0;x<f.length;x++)null!=c&&(C.index=c+x),(o=f[x]).trigger("add",o,this,C);(l||b)&&this.trigger("sort",this,e),(f.length||d.length)&&this.trigger("update",this,e)}return r?t[0]:t},reset:function(t,e){e=e?n.clone(e):{};for(var r=0;r<this.models.length;r++)this._removeReference(this.models[r],e);return e.previousModels=this.models,this._reset(),t=this.add(t,n.extend({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},push:function(t,e){return this.add(t,n.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t)},unshift:function(t,e){return this.add(t,n.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t)},slice:function(){return o.apply(this.models,arguments)},get:function(t){if(null!=t){var e=this.modelId(this._isModel(t)?t.attributes:t);return this._byId[t]||this._byId[e]||this._byId[t.cid]}},at:function(t){return t<0&&(t+=this.length),this.models[t]},where:function(t,e){var r=n.matches(t);return this[e?"find":"filter"](function(t){return r(t.attributes)})},findWhere:function(t){return this.where(t,!0)},sort:function(t){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return t||(t={}),n.isString(this.comparator)||1===this.comparator.length?this.models=this.sortBy(this.comparator,this):this.models.sort(n.bind(this.comparator,this)),t.silent||this.trigger("sort",this,t),this},pluck:function(t){return n.invoke(this.models,"get",t)},fetch:function(t){t=n.extend({parse:!0},t);var e=t.success,r=this;return t.success=function(n){var i=t.reset?"reset":"set";r[i](n,t),e&&e.call(t.context,r,n,t),r.trigger("sync",r,n,t)},F(this,t),this.sync("read",this,t)},create:function(t,e){e=e?n.clone(e):{};var r=e.wait;if(t=this._prepareModel(t,e),!t)return!1;r||this.add(t,e);var i=this,o=e.success;return e.success=function(t,e,n){r&&i.add(t,n),o&&o.call(n.context,t,e,n)},t.save(null,e),t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t){return t[this.model.prototype.idAttribute||"id"]},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){if(this._isModel(t))return t.collection||(t.collection=this),t;e=e?n.clone(e):{},e.collection=this;var r=new this.model(t,e);return r.validationError?(this.trigger("invalid",this,r.validationError,e),!1):r},_removeModels:function(t,e){for(var n=[],r=0;r<t.length;r++){var i=this.get(t[r]);if(i){var o=this.indexOf(i);this.models.splice(o,1),this.length--,e.silent||(e.index=o,i.trigger("remove",i,this,e)),n.push(i),this._removeReference(i,e)}}return!!n.length&&n},_isModel:function(t){return t instanceof m},_addReference:function(t,e){this._byId[t.cid]=t;var n=this.modelId(t.attributes);null!=n&&(this._byId[n]=t),t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){delete this._byId[t.cid];var n=this.modelId(t.attributes);null!=n&&delete this._byId[n],this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,n,r){if("add"!==t&&"remove"!==t||n===this){if("destroy"===t&&this.remove(e,r),"change"===t){var i=this.modelId(e.previousAttributes()),o=this.modelId(e.attributes);i!==o&&(null!=i&&delete this._byId[i],null!=o&&(this._byId[o]=e))}this.trigger.apply(this,arguments)}}});var _={forEach:3,each:3,map:3,collect:3,reduce:4,foldl:4,inject:4,reduceRight:4,foldr:4,find:3,detect:3,filter:3,select:3,reject:3,every:3,all:3,some:3,any:3,include:2,contains:2,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};a(b,_,"models");var C=["groupBy","countBy","sortBy","indexBy"];n.each(C,function(t){n[t]&&(b.prototype[t]=function(e,r){var i=n.isFunction(e)?e:function(t){return t.get(e)};return n[t](this.models,i,r)})});var k=e.View=function(t){this.cid=n.uniqueId("view"),n.extend(this,n.pick(t,T)),this._ensureElement(),this.initialize.apply(this,arguments)},S=/^(\S+)\s*(.*)$/,T=["model","collection","el","id","attributes","className","tagName","events"];n.extend(k.prototype,l,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove()},setElement:function(t){return this.undelegateEvents(),this._setElement(t),this.delegateEvents(),this},_setElement:function(t){this.$el=t instanceof e.$?t:e.$(t),this.el=this.$el[0]},delegateEvents:function(t){if(t||(t=n.result(this,"events")),!t)return this;this.undelegateEvents();for(var e in t){var r=t[e];if(n.isFunction(r)||(r=this[r]),r){var i=e.match(S);this.delegate(i[1],i[2],n.bind(r,this))}}return this},delegate:function(t,e,n){return this.$el.on(t+".delegateEvents"+this.cid,e,n),this},undelegateEvents:function(){return this.$el&&this.$el.off(".delegateEvents"+this.cid),this},undelegate:function(t,e,n){return this.$el.off(t+".delegateEvents"+this.cid,e,n),this},_createElement:function(t){return document.createElement(t)},_ensureElement:function(){if(this.el)this.setElement(n.result(this,"el"));else{var t=n.extend({},n.result(this,"attributes"));this.id&&(t.id=n.result(this,"id")),this.className&&(t["class"]=n.result(this,"className")),this.setElement(this._createElement(n.result(this,"tagName"))),this._setAttributes(t)}},_setAttributes:function(t){this.$el.attr(t)}}),e.sync=function(t,r,i){var o=E[t];n.defaults(i||(i={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var s={type:o,dataType:"json"};if(i.url||(s.url=n.result(r,"url")||B()),null!=i.data||!r||"create"!==t&&"update"!==t&&"patch"!==t||(s.contentType="application/json",s.data=JSON.stringify(i.attrs||r.toJSON(i))),i.emulateJSON&&(s.contentType="application/x-www-form-urlencoded",s.data=s.data?{model:s.data}:{}),i.emulateHTTP&&("PUT"===o||"DELETE"===o||"PATCH"===o)){s.type="POST",i.emulateJSON&&(s.data._method=o);var a=i.beforeSend;i.beforeSend=function(t){if(t.setRequestHeader("X-HTTP-Method-Override",o),a)return a.apply(this,arguments)}}"GET"===s.type||i.emulateJSON||(s.processData=!1);var l=i.error;i.error=function(t,e,n){i.textStatus=e,i.errorThrown=n,l&&l.call(i.context,t,e,n)};var c=i.xhr=e.ajax(n.extend(s,i));return r.trigger("request",r,c,i),c};var E={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var A=e.Router=function(t){t||(t={}),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},O=/\((.*?)\)/g,M=/(\(\?)?:\w+/g,L=/\*\w+/g,P=/[\-{}\[\]+?.,\\\^$|#\s]/g;n.extend(A.prototype,l,{initialize:function(){},route:function(t,r,i){n.isRegExp(t)||(t=this._routeToRegExp(t)),n.isFunction(r)&&(i=r,r=""),i||(i=this[r]);var o=this;return e.history.route(t,function(n){var s=o._extractParameters(t,n);o.execute(i,s,r)!==!1&&(o.trigger.apply(o,["route:"+r].concat(s)),o.trigger("route",r,s),e.history.trigger("route",o,r,s))}),this},execute:function(t,e,n){t&&t.apply(this,e)},navigate:function(t,n){return e.history.navigate(t,n),this},_bindRoutes:function(){if(this.routes){this.routes=n.result(this,"routes");for(var t,e=n.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(P,"\\$&").replace(O,"(?:$1)?").replace(M,function(t,e){return e?t:"([^/?]+)"}).replace(L,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return n.map(r,function(t,e){return e===r.length-1?t||null:t?decodeURIComponent(t):null})}});var j=e.History=function(){this.handlers=[],n.bindAll(this,"checkUrl"),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},D=/^[#\/]|\s+$/g,N=/^\/+|\/+$/g,I=/#.*$/;j.started=!1,n.extend(j.prototype,l,{interval:50,atRoot:function(){var t=this.location.pathname.replace(/[^\/]$/,"$&/");return t===this.root&&!this.getSearch()},matchRoot:function(){var t=this.decodeFragment(this.location.pathname),e=t.slice(0,this.root.length-1)+"/";return e===this.root},decodeFragment:function(t){return decodeURI(t.replace(/%25/g,"%2525"))},getSearch:function(){var t=this.location.href.replace(/#.*/,"").match(/\?.+/);return t?t[0]:""},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getPath:function(){var t=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return"/"===t.charAt(0)?t.slice(1):t},getFragment:function(t){return null==t&&(t=this._usePushState||!this._wantsHashChange?this.getPath():this.getHash()),t.replace(D,"")},start:function(t){if(j.started)throw new Error("Backbone.history has already been started");if(j.started=!0,this.options=n.extend({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=this.options.hashChange!==!1,this._hasHashChange="onhashchange"in window,this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(N,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||"/";return this.location.replace(e+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var r=document.body,i=r.insertBefore(this.iframe,r.firstChild).contentWindow;i.document.open(),i.document.close(),i.location.hash="#"+this.fragment}var o=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};if(this._usePushState?o("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?o("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&t("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),j.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();return e===this.fragment&&this.iframe&&(e=this.getHash(this.iframe.contentWindow)),e!==this.fragment&&(this.iframe&&this.navigate(e),void this.loadUrl())},loadUrl:function(t){return!!this.matchRoot()&&(t=this.fragment=this.getFragment(t),n.any(this.handlers,function(e){if(e.route.test(t))return e.callback(t),!0}))},navigate:function(t,e){if(!j.started)return!1;e&&e!==!0||(e={trigger:!!e}),t=this.getFragment(t||"");var n=this.root;""!==t&&"?"!==t.charAt(0)||(n=n.slice(0,-1)||"/");var r=n+t;if(t=this.decodeFragment(t.replace(I,"")),this.fragment!==t){if(this.fragment=t,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var i=this.iframe.contentWindow;e.replace||(i.document.open(),i.document.close()),this._updateHash(i.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,n){if(n){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else t.hash="#"+e}}),e.history=new j;var R=function(t,e){var r,i=this;r=t&&n.has(t,"constructor")?t.constructor:function(){return i.apply(this,arguments)},n.extend(r,i,e);var o=function(){this.constructor=r};return o.prototype=i.prototype,r.prototype=new o,t&&n.extend(r.prototype,t),r.__super__=i.prototype,r};m.extend=b.extend=A.extend=k.extend=j.extend=R;var B=function(){throw new Error('A "url" property or function must be specified')},F=function(t,e){var n=e.error;e.error=function(r){n&&n.call(e.context,t,r,e),t.trigger("error",t,r,e)}};return e})}).call(e,n(16))},function(t,e,n){"use strict";t.exports=function(){var t={},e=n(72),r=n(73),i=n(74),o={},s={};return{name:"StorageManager",init:function(n){t=n||{};for(var o in e)o in t||(t[o]=e[o]);return s.remote=new i(t),s.local=new r(t),t.currentStorage=t.type,this.loadDefaultProviders().setCurrent(t.type),this},isAutosave:function(){return!!t.autosave},setAutosave:function(e){return t.autosave=!!e,this},getStepsBeforeSave:function(){return t.stepsBeforeSave},setStepsBeforeSave:function(e){return t.stepsBeforeSave=e,this},add:function(t,e){return o[t]=e,this},get:function(t){return o[t]||null},getStorages:function(){return o},getCurrent:function(){return t.currentStorage},setCurrent:function(e){return t.currentStorage=e,this},store:function(e,n){var r=this.get(this.getCurrent()),i={};for(var o in e)i[t.id+o]=e[o];return r?r.store(i,n):null},load:function(e,n){var r=this.get(this.getCurrent()),i=[],o={};"string"==typeof e&&(e=[e]);for(var s=0,a=e.length;s<a;s++)i.push(t.id+e[s]);r&&r.load(i,function(e){var r=new RegExp("^"+t.id);for(var i in e){var s=i.replace(r,"");o[s]=e[i]}n&&n(o)})},loadDefaultProviders:function(){for(var t in s)this.add(t,s[t]);return this},getConfig:function(){return t}}}},function(t,e,n){"use strict";t.exports={id:"gjs-",autosave:1,autoload:1,type:"local",stepsBeforeSave:1,storeComponents:1,storeStyles:1,storeHtml:1,storeCss:1,checkLocal:1,params:{},headers:{},urlStore:"",urlLoad:"",beforeSend:function(t,e){},onComplete:function(t,e){},contentTypeJson:!1}},function(t,e,n){"use strict";var r=n(0);t.exports=r.Model.extend({defaults:{checkLocal:!0},store:function(t,e){this.checkStorageEnvironment();for(var n in t)localStorage.setItem(n,t[n]);"function"==typeof e&&e()},load:function(t,e){this.checkStorageEnvironment();for(var n={},r=0,i=t.length;r<i;r++){var o=localStorage.getItem(t[r]);o&&(n[t[r]]=o)}return"function"==typeof e&&e(n),n},remove:function(t){this.checkStorageEnvironment();for(var e=0,n=t.length;e<n;e++)localStorage.removeItem(t[e])},checkStorageEnvironment:function(){this.get("checkLocal")&&!localStorage}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}var i=n(24),o=r(i),s=n(1);t.exports=n(0).Model.extend({fetch:o["default"],defaults:{urlStore:"",urlLoad:"",params:{},beforeSend:function(){},onComplete:function(){},contentTypeJson:!1},onStart:function(){var t=this.get("em"),e=this.get("beforeSend");e&&e(),t&&t.trigger("storage:start")},onError:function(t){var e=this.get("em");e&&e.trigger("storage:error",t),this.onEnd(t)},onEnd:function(t){var e=this.get("em");e&&e.trigger("storage:end",t)},onResponse:function(t,e){var n=this.get("em"),r=this.get("onComplete"),i=this.get("contentTypeJson"),o=t&&"string"==typeof t,s=i&&o?JSON.parse(t):t;r&&r(s),e&&e(s),n&&n.trigger("storage:response",s),this.onEnd(t)},store:function(t,e){var n={};for(var r in t)n[r]=t[r];this.request(this.get("urlStore"),{body:n},e)},load:function(t,e){this.request(this.get("urlLoad"),{method:"get"},e)},request:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=this.get("contentTypeJson"),o=this.get("headers")||{},a=this.get("params"),l="X-Requested-With",c="Content-Type",u=n.body||{},h=void 0,f=void 0;for(var d in a)u[d]=a[d];if((0,s.isUndefined)(o[l])&&(o[l]="XMLHttpRequest"),(0,s.isUndefined)(o[c])&&i&&(o[c]="application/json; charset=utf-8"),i)f=JSON.stringify(u);else{f=new FormData;for(var p in u)f.append(p,u[p])}h={method:n.method||"post",credentials:"include",headers:o},"post"===h.method&&(h.body=f),this.onStart(),this.fetch(t,h).then(function(t){return 1==(t.status/200|0)?t.text():t.text().then(function(t){return Promise.reject(t)})}).then(function(t){return e.onResponse(t,r)})["catch"](function(t){return e.onError(t)})}})},function(t,e,n){(function(e){!function(n){function r(){}function i(t,e){return function(){t.apply(e,arguments)}}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],h(t,this)}function s(t,e){for(;3===t._state;)t=t._value;return 0===t._state?void t._deferreds.push(e):(t._handled=!0,void o._immediateFn(function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null===n)return void(1===t._state?a:l)(e.promise,t._value);var r;try{r=n(t._value)}catch(i){return void l(e.promise,i)}a(e.promise,r)}))}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void h(i(n,e),t)}t._state=1,t._value=e,c(t)}catch(r){l(t,r)}}function l(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn(function(){t._handled||o._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e<n;e++)s(t,t._deferreds[e]);t._deferreds=null}function u(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function h(t,e){var n=!1;try{t(function(t){n||(n=!0,a(e,t))},function(t){n||(n=!0,l(e,t))})}catch(r){if(n)return;n=!0,l(e,r)}}var f=setTimeout;o.prototype["catch"]=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return s(this,new u(t,e,n)),n},o.all=function(t){var e=Array.prototype.slice.call(t);return new o(function(t,n){function r(o,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var a=s.then;if("function"==typeof a)return void a.call(s,function(t){r(o,t)},n)}e[o]=s,0===--i&&t(e)}catch(l){n(l)}}if(0===e.length)return t([]);for(var i=e.length,o=0;o<e.length;o++)r(o,e[o])})},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o(function(e){e(t)})},o.reject=function(t){return new o(function(e,n){n(t)})},o.race=function(t){return new o(function(e,n){for(var r=0,i=t.length;r<i;r++)t[r].then(e,n)})},o._immediateFn="function"==typeof e&&function(t){e(t)}||function(t){f(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console},o._setImmediateFn=function(t){o._immediateFn=t},o._setUnhandledRejectionFn=function(t){o._unhandledRejectionFn=t},"undefined"!=typeof t&&t.exports?t.exports=o:n.Promise||(n.Promise=o)}(this)}).call(e,n(76).setImmediate)},function(t,e,n){function r(t,e){this._id=t,this._clearFn=e}var i=Function.prototype.apply;e.setTimeout=function(){return new r(i.call(setTimeout,window,arguments),clearTimeout)},e.setInterval=function(){return new r(i.call(setInterval,window,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(window,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(77),e.setImmediate=setImmediate,e.clearImmediate=clearImmediate},function(t,e,n){(function(t,e){!function(t,n){"use strict";function r(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var r={callback:t,args:e};return g[p]=r,d(p),p++}function i(t){delete g[t]}function o(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(n,r)}}function s(t){if(v)setTimeout(s,0,t);else{var e=g[t];if(e){v=!0;try{o(e)}finally{i(t),v=!1}}}}function a(){d=function(t){e.nextTick(function(){s(t)})}}function l(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}function c(){var e="setImmediate$"+Math.random()+"$",n=function(n){n.source===t&&"string"==typeof n.data&&0===n.data.indexOf(e)&&s(+n.data.slice(e.length))};t.addEventListener?t.addEventListener("message",n,!1):t.attachEvent("onmessage",n),d=function(n){t.postMessage(e+n,"*")}}function u(){var t=new MessageChannel;t.port1.onmessage=function(t){var e=t.data;s(e)},d=function(e){t.port2.postMessage(e)}}function h(){var t=m.documentElement;d=function(e){var n=m.createElement("script");n.onreadystatechange=function(){s(e),n.onreadystatechange=null,t.removeChild(n),n=null},t.appendChild(n)}}function f(){d=function(t){setTimeout(s,0,t)}}if(!t.setImmediate){var d,p=1,g={},v=!1,m=t.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(t);y=y&&y.setTimeout?y:t,"[object process]"==={}.toString.call(t.process)?a():l()?c():t.MessageChannel?u():m&&"onreadystatechange"in m.createElement("script")?h():f(),y.setImmediate=r,y.clearImmediate=i}}("undefined"==typeof self?"undefined"==typeof t?this:t:self)}).call(e,n(16),n(78))},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(t){if(u===setTimeout)return setTimeout(t,0);if((u===n||!u)&&setTimeout)return u=setTimeout,setTimeout(t,0);try{return u(t,0)}catch(e){try{return u.call(null,t,0)}catch(e){return u.call(this,t,0)}}}function o(t){if(h===clearTimeout)return clearTimeout(t);if((h===r||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(t);try{return h(t)}catch(e){try{return h.call(null,t)}catch(e){return h.call(this,t)}}}function s(){g&&d&&(g=!1,d.length?p=d.concat(p):v=-1,p.length&&a())}function a(){if(!g){var t=i(s);g=!0;for(var e=p.length;e;){for(d=p,p=[];++v<e;)d&&d[v].run();v=-1,e=p.length}d=null,g=!1,o(t)}}function l(t,e){this.fun=t,this.array=e}function c(){}var u,h,f=t.exports={};!function(){try{u="function"==typeof setTimeout?setTimeout:n}catch(t){u=n}try{h="function"==typeof clearTimeout?clearTimeout:r}catch(t){h=r}}();var d,p=[],g=!1,v=-1;f.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];p.push(new l(t,e)),1!==p.length||g||i(a)},l.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=c,f.addListener=c,f.once=c,f.off=c,f.removeListener=c,f.removeAllListeners=c,f.emit=c,f.prependListener=c,f.prependOnceListener=c,f.listeners=function(t){return[]},f.binding=function(t){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(t){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(t,e,n){"use strict";t.exports=function(){var t,e,r={},i=n(80),o=n(81),s=n(83);return{name:"DeviceManager",init:function(n){r=n||{};for(var a in i)a in r||(r[a]=i[a]);return t=new o(r.devices),e=new s({collection:t,config:r}),this},add:function(e,n,r){var i=r||{};return i.name=e,i.width=n,t.add(i)},get:function(e){return t.get(e)},getAll:function(){return t},render:function(){return e.render().el}}}},function(t,e,n){"use strict";t.exports={devices:[],deviceLabel:"Device"}},function(t,e,n){"use strict";var r=n(0),i=n(82);t.exports=r.Collection.extend({model:i})},function(t,e,n){"use strict";var r=n(0);t.exports=r.Model.extend({idAttribute:"name",defaults:{name:"",width:"",height:"",widthMedia:null},initialize:function(){null==this.get("widthMedia")&&this.set("widthMedia",this.get("width"))}})},function(t,e,n){"use strict";(function(e){var r=n(0);t.exports=r.View.extend({template:e.template('\n <div class="<%= ppfx %>device-label"><%= deviceLabel %></div>\n <div class="<%= ppfx %>field <%= ppfx %>select">\n <span id="<%= ppfx %>input-holder">\n <select class="<%= ppfx %>devices"></select>\n </span>\n <div class="<%= ppfx %>sel-arrow">\n <div class="<%= ppfx %>d-s-arrow"></div>\n </div>\n </div>\n <button style="display:none" class="<%= ppfx %>add-trasp">+</button>'),events:{change:"updateDevice"},initialize:function(t){this.config=t.config||{},this.em=this.config.em,this.ppfx=this.config.pStylePrefix||"",this.events["click ."+this.ppfx+"add-trasp"]=this.startAdd,this.listenTo(this.em,"change:device",this.updateSelect),this.delegateEvents()},startAdd:function(){},updateDevice:function(){var t=this.em;if(t){var e=this.devicesEl,n=e?e.val():"";t.set("device",n)}},updateSelect:function(){var t=this.em,e=this.devicesEl;if(t&&t.getDeviceModel&&e){var n=t.getDeviceModel(),r=n?n.get("name"):"";e.val(r)}},getOptions:function(){var t="";return this.collection.each(function(e){var n=e.get("name");t+='<option value="'+n+'">'+n+"</option>"}),t},render:function(){var t=this.ppfx;return this.$el.html(this.template({ppfx:t,deviceLabel:this.config.deviceLabel})),this.devicesEl=this.$el.find("."+t+"devices"),this.devicesEl.append(this.getOptions()),this.el.className=t+"devices-c",this}})}).call(e,n(1))},function(t,e,n){"use strict";t.exports=function(){var t,e,r={},i=n(85),o=n(86),s=n(25);return{compTypes:"",name:"Parser",init:function(n){r=n||{};for(var a in i)a in r||(r[a]=i[a]);return t=new s(r),e=new o(r),this},parseHtml:function(n){return t.compTypes=this.compTypes,t.parse(n,e)},parseCss:function(t){return e.parse(t)}}}},function(t,e,n){"use strict";t.exports={textTags:["br","b","i","u","a","ul","ol"]}},function(t,e,n){"use strict";var r=n(1),i={4:"media",5:"font-face",6:"page",7:"keyframes",11:"counter-style",12:"supports",13:"document",14:"font-feature-values",15:"viewport"},o=(0,r.keys)(i),s=["5","6","11","15"];t.exports=function(t){return{parseSelector:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=[],n=[],r=t.split(","),i=0,o=r.length;i<o;i++){var s=r[i].trim();if(/^(\.{1}[\w\-]+)+(:{1,2}[\w\-()]+)?$/gi.test(s)){var a=s.split(".").filter(Boolean);n.push(a)}else e.push(s)}return{result:n,add:e}},parseStyle:function(t){for(var e=t.style,n={},r=0,i=e.length;r<i;r++){var o=e[r],s=e.getPropertyValue(o),a=e.getPropertyPriority(o);n[o]=""+s+(a?" !"+a:"")}return n},parseCondition:function(t){var e=t.conditionText||t.media&&t.media.mediaText||t.name||t.selectorText||"";return e.trim()},parseNode:function(t){for(var e=[],n=t.cssRules||[],r=0,a=n.length;r<a;r++){var l=n[r],c=l.type.toString(),u=0,h="",f="",d=l.selectorText||l.keyText,p=s.indexOf(c)>=0;if(p)u=1,h=i[c],f=this.parseCondition(l);else if(o.indexOf(c)>=0){var g=this.parseNode(l);f=this.parseCondition(l);for(var v=0,m=g.length;v<m;v++){var y=g[v];f&&(y.mediaText=f),y.atRuleType=i[c]}e=e.concat(g)}if(d||p){var b=this.parseStyle(l),w=this.parseSelector(d),x=w.add;d=w.result;for(var _=void 0,C=0,k=d.length;C<k;C++){var S=d[C],T={};u&&(T.singleAtRule=u),h&&(T.atRuleType=h);var E=S[S.length-1].split(/:(.+)/);E[1]&&(S[S.length-1]=E[0],T.state=E[1],E.splice(E.length-1,1)),T.selectors=S,T.style=b,_=T,e.push(T)}if(x.length){var A=x.join(", ");if(_)_.selectorsAdd=A;else{var O={selectors:[],selectorsAdd:A,style:b};u&&(O.singleAtRule=u),h&&(O.atRuleType=h),f&&(O.mediaText=f),e.push(O)}}}}return e},parse:function(t){var e=document.createElement("style");e.innerHTML=t,document.head.appendChild(e);var n=e.sheet;document.head.removeChild(e);var r=this.parseNode(n);return 1==r.length?r[0]:r}}}},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=n(1);t.exports=function(t){var e,o,s=t||{},a=n(88),l=n(7),c=n(10),u=n(89);return{Selector:l,Selectors:c,name:"SelectorManager",init:function(t){s=t||{};for(var n in a)n in s||(s[n]=a[n]);var r=s.em,i=s.pStylePrefix;return i&&(s.stylePrefix=i+s.stylePrefix),o=new u({collection:new c([],{em:r,config:s}),config:s}),e=new c(s.selectors),e.on("add",function(t){return r.trigger("selector:add",t)}),this},add:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"object"==("undefined"==typeof t?"undefined":r(t))?n=t:n.name=t,n.label&&!n.name&&(n.name=l.escapeName(n.label));var i=n.name,o=i?this.get(i,n.type):e.where(n)[0];return o?o:e.add(n)},addClass:function(t){var n=[];return(0,i.isString)(t)&&(t=t.trim().split(" ")),t.forEach(function(t){return n.push(e.add({name:t}))}),n},get:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.TYPE_CLASS;return e.where({name:t,type:n})[0]},getAll:function(){return e},render:function(t){if(t){var e=new u({collection:new c(t),config:s});return e.render().el}return o.render().el}}}},function(t,e,n){"use strict";t.exports={stylePrefix:"clm-",selectors:[],label:"Classes",statesLabel:"- State -",selectedLabel:"Selected",states:[{name:"hover",label:"Hover"},{name:"active",label:"Click"},{name:"nth-of-type(2n)",label:"Even/Odd"}]}},function(t,e,n){"use strict";(function(e){var r=n(0),i=n(90);t.exports=r.View.extend({template:e.template('\n <div id="<%= pfx %>up">\n <div id="<%= pfx %>label"><%= label %></div>\n <div id="<%= pfx %>status-c">\n <span id="<%= pfx %>input-c">\n <div class="<%= ppfx %>field <%= ppfx %>select">\n <span id="<%= ppfx %>input-holder">\n <select id="<%= pfx %>states">\n <option value=""><%= statesLabel %></option>\n </select>\n </span>\n <div class="<%= ppfx %>sel-arrow">\n <div class="<%= ppfx %>d-s-arrow"></div>\n </div>\n </div>\n </span>\n </div>\n </div>\n <div id="<%= pfx %>tags-field" class="<%= ppfx %>field">\n <div id="<%= pfx %>tags-c"></div>\n <input id="<%= pfx %>new" />\n <span id="<%= pfx %>add-tag" class="fa fa-plus"></span>\n </div>\n <div id="<%= pfx %>sel-help">\n <div id="<%= pfx %>label"><%= selectedLabel %></div>\n <div id="<%= pfx %>sel"></div>\n <div style="clear:both"></div>\n </div>'),events:{},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=t.config||{},this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.className=this.pfx+"tags",this.addBtnId=this.pfx+"add-tag",this.newInputId=this.pfx+"new",this.stateInputId=this.pfx+"states",this.stateInputC=this.pfx+"input-c",this.states=this.config.states||[],this.events["click #"+this.addBtnId]="startNewTag",this.events["blur #"+this.newInputId]="endNewTag",this.events["keyup #"+this.newInputId]="onInputKeyUp",this.events["change #"+this.stateInputId]="stateChanged",this.target=this.config.em,this.em=this.target,this.listenTo(this.target,"change:selectedComponent",this.componentChanged),this.listenTo(this.target,"component:update:classes",this.updateSelector),this.listenTo(this.collection,"add",this.addNew),this.listenTo(this.collection,"reset",this.renderClasses),this.listenTo(this.collection,"remove",this.tagRemoved),this.delegateEvents()},tagRemoved:function(t){this.updateStateVis()},getStateOptions:function(){for(var t="",e=0;e<this.states.length;e++)t+='<option value="'+this.states[e].name+'">'+this.states[e].label+"</option>";
return t},addNew:function(t){this.addToClasses(t)},startNewTag:function(t){this.$addBtn.get(0).style.display="none",this.$input.show().focus()},endNewTag:function(t){this.$addBtn.get(0).style.display="",this.$input.hide().val("")},onInputKeyUp:function(t){13===t.keyCode?this.addNewTag(this.$input.val()):27===t.keyCode&&this.endNewTag()},componentChanged:function(t){this.compTarget=this.target.get("selectedComponent");var e=this.compTarget,n=[];e&&(this.getStates().val(e.get("state")),n=e.get("classes").getValid()),this.collection.reset(n),this.updateStateVis()},updateStateVis:function(){var t=this.em,e=t&&t.getConfig("avoidInlineStyle");this.collection.length||e?this.getStatesC().css("display","block"):this.getStatesC().css("display","none"),this.updateSelector()},updateSelector:function(){var t=this.target.getSelected();if(this.compTarget=t,t&&t.get){var e=t.get("state"),n=this.collection,r=n.getFullString(n.getStyleable());r=r||"#"+t.getId(),r+=e?":"+e:"";var i=this.el.querySelector("#"+this.pfx+"sel");i&&(i.innerHTML=r)}},stateChanged:function(t){this.compTarget&&(this.compTarget.set("state",this.$states.val()),this.updateSelector())},addNewTag:function(t){var e=this.target,n=this.compTarget;if(t.trim()){if(e){var r=e.get("SelectorManager"),i=r.add({label:t});if(n){var o=n.get("classes");o.length;o.add(i);o.length;this.collection.add(i),this.updateStateVis()}}this.endNewTag()}},addToClasses:function(t,e){var n=e||null,r=new i({model:t,config:this.config,coll:this.collection}),o=r.render().el;return n?n.appendChild(o):this.getClasses().append(o),o},renderClasses:function(){var t=document.createDocumentFragment();return this.collection.each(function(e){this.addToClasses(e,t)},this),this.getClasses()&&this.getClasses().empty().append(t),this},getClasses:function(){return this.$classes||(this.$classes=this.$el.find("#"+this.pfx+"tags-c")),this.$classes},getStates:function(){return this.$states||(this.$states=this.$el.find("#"+this.stateInputId)),this.$states},getStatesC:function(){return this.$statesC||(this.$statesC=this.$el.find("#"+this.stateInputC)),this.$statesC},render:function(){var t=this.config;return this.$el.html(this.template({selectedLabel:t.selectedLabel,statesLabel:t.statesLabel,label:t.label,pfx:this.pfx,ppfx:this.ppfx})),this.$input=this.$el.find("input#"+this.newInputId),this.$addBtn=this.$el.find("#"+this.addBtnId),this.$classes=this.$el.find("#"+this.pfx+"tags-c"),this.$states=this.$el.find("#"+this.stateInputId),this.$statesC=this.$el.find("#"+this.stateInputC),this.$states.append(this.getStateOptions()),this.renderClasses(),this.$el.attr("class",this.className),this}})}).call(e,n(1))},function(t,e,n){"use strict";var r=n(7),i="contentEditable";t.exports=n(0).View.extend({template:function(){var t=this.pfx,e=(this.ppfx,this.model.get("label")||"");return'\n <span id="'+t+'checkbox" class="fa" data-tag-status></span>\n <span id="'+t+'tag-label" data-tag-name>'+e+'</span>\n <span id="'+t+'close" data-tag-remove>\n &Cross;\n </span>\n '},events:{"click [data-tag-remove]":"removeTag","click [data-tag-status]":"changeStatus","dblclick [data-tag-name]":"startEditTag","focusout [data-tag-name]":"endEditTag"},initialize:function(t){this.config=t.config||{},this.coll=t.coll||null,this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.target=this.config.em,this.listenTo(this.model,"change:active",this.updateStatus)},getInputEl:function(){return this.inputEl||(this.inputEl=this.el.querySelector("[data-tag-name]")),this.inputEl},startEditTag:function(){var t=this.getInputEl();t[i]=!0,t.focus()},endEditTag:function(){var t=this.model,e=this.getInputEl(),n=e.textContent,o=r.escapeName(n),s=this.target,a=s&&s.get("SelectorManager");e[i]=!1,a&&(a.get(o)?e.innerText=t.get("label"):t.set({name:o,label:n}))},changeStatus:function(){this.model.set("active",!this.model.get("active"))},removeTag:function(t){var e=this,n=this.target,r=this.model,i=this.coll,o=(this.el,n&&n.get("selectedComponent"));o&&o.get&o.get("classes").remove(r),i&&i.remove(r),setTimeout(function(){return e.remove()},0)},updateStatus:function(){var t="fa-check-square-o",e="fa-square-o";this.$chk||(this.$chk=this.$el.find("#"+this.pfx+"checkbox")),this.model.get("active")?(this.$chk.removeClass(e).addClass(t),this.$el.removeClass("opac50")):(this.$chk.removeClass(t).addClass(e),this.$el.addClass("opac50"))},render:function(){var t=this.pfx,e=this.ppfx;return this.$el.html(this.template()),this.$el.attr("class",t+"tag "+e+"three-bg"),this.updateStatus(),this}})},function(t,e,n){"use strict";t.exports=function(){var t,e,r={},i=n(92),o=n(93),s=n(94);return{name:"Modal",init:function(n){r=n||{};for(var a in i)a in r||(r[a]=i[a]);var l=r.pStylePrefix;return l&&(r.stylePrefix=l+r.stylePrefix),t=new o(r),e=new s({model:t,config:r}),this},postRender:function(t){this.render().appendTo(t.el)},open:function(){return e.show(),this},close:function(){return e.hide(),this},isOpen:function(){return!!t.get("open")},setTitle:function(e){return t.set("title",e),this},getTitle:function(){return t.get("title")},setContent:function(e){return t.set("content"," "),t.set("content",e),this},getContent:function(){return t.get("content")},getContentEl:function(){return e.getContent().get(0)},getModel:function(){return t},render:function(){return e.render().$el}}}},function(t,e,n){"use strict";t.exports={stylePrefix:"mdl-",title:"",content:"",backdrop:!0}},function(t,e,n){"use strict";var r=n(0);t.exports=r.Model.extend({defaults:{title:"",content:"",open:!1}})},function(t,e,n){"use strict";t.exports=n(0).View.extend({template:function(t){var e=t.pfx,n=t.ppfx,r=t.content,i=t.title;return'<div class="'+e+"dialog "+n+'one-bg">\n <div class="'+e+'header">\n <div class="'+e+'title">'+i+'</div>\n <div class="'+e+'btn-close">&Cross;</div>\n </div>\n <div class="'+e+'content">\n <div id="'+e+'c">'+r+'</div>\n <div style="clear:both"></div>\n </div>\n </div>\n <div class="'+e+'backlayer"></div>\n <div class="'+e+'collector" style="display: none"></div>'},events:{},initialize:function(t){var e=this.model,n=t.config||{},r=n.stylePrefix||"",i=n.backdrop;this.config=n,this.pfx=r,this.ppfx=n.pStylePrefix||"",this.listenTo(e,"change:open",this.updateOpen),this.listenTo(e,"change:title",this.updateTitle),this.listenTo(e,"change:content",this.updateContent),this.events["click ."+r+"btn-close"]="hide",i&&(this.events["click ."+r+"backlayer"]="hide"),this.delegateEvents()},getCollector:function(){return this.$collector||(this.$collector=this.$el.find("."+this.pfx+"collector")),this.$collector},getContent:function(){var t=this.pfx;return this.$content||(this.$content=this.$el.find("."+t+"content #"+t+"c")),this.$content},getTitle:function(){return this.$title||(this.$title=this.$el.find("."+this.pfx+"title")),this.$title.get(0)},updateContent:function(){var t=this.getContent(),e=t.children(),n=this.getCollector(),r=this.model.get("content");e.length&&n.append(e),t.empty().append(r)},updateTitle:function(){var t=this.getTitle();t&&(t.innerHTML=this.model.get("title"))},updateOpen:function(){this.el.style.display=this.model.get("open")?"":"none"},hide:function(){this.model.set("open",0)},show:function(){this.model.set("open",1)},render:function(){var t=this.$el,e=this.pfx,n=(this.ppfx,this.model.toJSON());return n.pfx=this.pfx,n.ppfx=this.ppfx,t.html(this.template(n)),t.attr("class",e+"container"),this.updateOpen(),this}})},function(t,e,n){"use strict";t.exports=function(){var t={},e=n(96),r=n(97),i=n(98),o=n(99),s=n(100),a=n(101),l=n(106),c={},u={},h={},f={};return{getConfig:function(){return t},config:t,EditorView:l,name:"CodeManager",init:function(n){t=n||{};for(var l in e)l in t||(t[l]=e[l]);var c=t.pStylePrefix;return c&&(t.stylePrefix=c+t.stylePrefix),u.html=new r,u.css=new i,u.json=new o,u.js=new s,f.CodeMirror=new a,this.loadDefaultGenerators().loadDefaultViewers(),this},addGenerator:function(t,e){return c[t]=e,this},getGenerator:function(t){return c[t]||null},getGenerators:function(){return c},addViewer:function(t,e){return h[t]=e,this},getViewer:function(t){return h[t]||null},getViewers:function(){return h},updateViewer:function(t,e){t.setContent(e)},getCode:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.em=t.em;var i=this.getGenerator(n);return i?i.build(e,r):""},loadDefaultGenerators:function(){for(var t in u)this.addGenerator(t,u[t]);return this},loadDefaultViewers:function(){for(var t in f)this.addViewer(t,f[t]);return this}}}},function(t,e,n){"use strict";t.exports={stylePrefix:"cm-",inlineCss:!1}},function(t,e,n){"use strict";var r=n(0);t.exports=r.Model.extend({build:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.get("components");return e.exportWrapper?e.wrappesIsBody?"<body>"+this.buildModels(n)+"</body>":t.toHTML():this.buildModels(n)},buildModels:function(t){var e="";return t.each(function(t){e+=t.toHTML()}),e}})},function(t,e,n){"use strict";t.exports=n(0).Model.extend({initialize:function(){this.compCls=[],this.ids=[]},buildFromModel:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="",i=this.em,o=i&&i.getConfig("avoidInlineStyle"),s=t.styleToString(),a=t.get("classes"),l=n.wrappesIsBody,c=t.get("wrapper");if(this.ids.push("#"+t.getId()),a.each(function(t){return e.compCls.push(t.getFullName())}),(!o||c)&&s){var u="#"+t.getId();u=l&&c?"body":u,r=u+"{"+s+"}"}var h=t.components();return h.each(function(t){return r+=e.buildFromModel(t,n)}),r},build:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.cssc,i=n.em||"";this.em=i,this.compCls=[],this.ids=[];var o=this.buildFromModel(t,n);return r&&!function(){var t=r.getAll(),n={},s=[];t.each(function(t){var r=t.getAtRule();if(r){var i=n[r];return void(i?i.push(t):n[r]=[t])}o+=e.buildFromRule(t,s)});for(var a in n){var l="",c=n[a];c.forEach(function(t){return l+=e.buildFromRule(t,s)}),l&&(o+=a+"{"+l+"}")}i&&i.getConfig("clearStyles")&&t.remove(s)}(),o},buildFromRule:function(t,e){var n=this,r="",i=t.selectorsToString({skipAdd:1}),o=t.get("selectorsAdd"),s=t.get("singleAtRule"),a=void 0;if(t.get("selectors").each(function(t){var e=t.getFullName();(n.compCls.indexOf(e)>=0||n.ids.indexOf(e)>=0)&&(a=1)}),i&&a||o||s){var l=t.getDeclaration();l&&(r+=l)}else e.push(t);return r}})},function(t,e,n){"use strict";(function(e){var r=n(0);t.exports=r.Model.extend({build:function(t){var n=t.toJSON();return this.beforeEach(n),e.each(n,function(t,e){var i=n[e];if(i instanceof r.Model)n[e]=this.build(i);else if(i instanceof r.Collection){var o=i;n[e]=[],o.length&&o.each(function(t,r){n[e][r]=this.build(t)},this)}},this),n},beforeEach:function(t){delete t.status}})}).call(e,n(1))},function(t,e,n){"use strict";(function(e){var r=n(0);t.exports=r.Model.extend({mapModel:function(t){var n="",r=t.get("script"),i=t.get("type"),o=t.get("components"),s=t.getId();if(r){var a=t.get("attributes");a=e.extend({},a,{id:s}),t.set("attributes",a);var l=t.getScriptString();if(t.get("scriptUpdated"))this.mapJs[i+"-"+s]={ids:[s],code:l};else{var c=this.mapJs[i];c?c.ids.push(s):this.mapJs[i]={ids:[s],code:l}}}return o.each(function(t){n+=this.mapModel(t)},this),n},build:function(t){this.mapJs={},this.mapModel(t);var e="";for(var n in this.mapJs){var r=this.mapJs[n],i="#"+r.ids.join(", #");e+="\n var items = document.querySelectorAll('"+i+"');\n for (var i = 0, len = items.length; i < len; i++) {\n (function(){"+r.code+"}.bind(items[i]))();\n }"}return e}})}).call(e,n(1))},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(0),o=n(6);n(102),n(26),n(105);t.exports=i.Model.extend({defaults:{input:"",label:"",codeName:"",theme:"",readOnly:!0,lineNumbers:!0},init:function(t){return this.editor=o.fromTextArea(t,r({dragDrop:!1,lineWrapping:!0,mode:this.get("codeName")},this.attributes)),this},setContent:function(t){this.editor&&(this.editor.setValue(t),this.editor.autoFormatRange&&(o.commands.selectAll(this.editor),this.editor.autoFormatRange(this.editor.getCursor(!0),this.editor.getCursor(!1)),o.commands.goDocStart(this.editor)))}})},function(t,e,n){!function(t){t(n(6),n(103),n(104),n(26))}(function(t){"use strict";function e(t,e,n){var r=t.current(),i=r.search(e);return i>-1?t.backUp(r.length-i):r.match(/<\/?$/)&&(t.backUp(r.length),t.match(e,!1)||t.match(r)),n}function n(t){var e=l[t];return e?e:l[t]=new RegExp("\\s+"+t+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")}function r(t,e){var r=t.match(n(e));return r?/^\s*(.*?)\s*$/.exec(r[2])[1]:""}function i(t,e){return new RegExp((e?"^":"")+"</s*"+t+"s*>","i")}function o(t,e){for(var n in t)for(var r=e[n]||(e[n]=[]),i=t[n],o=i.length-1;o>=0;o--)r.unshift(i[o])}function s(t,e){for(var n=0;n<t.length;n++){var i=t[n];if(!i[0]||i[1].test(r(e,i[0])))return i[2]}}var a={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"]]},l={};t.defineMode("htmlmixed",function(n,r){function l(r,o){var a,h=c.token(r,o.htmlState),f=/\btag\b/.test(h);if(f&&!/[<>\s\/]/.test(r.current())&&(a=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&u.hasOwnProperty(a))o.inTag=a+" ";else if(o.inTag&&f&&/>$/.test(r.current())){var d=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var p=">"==r.current()&&s(u[d[1]],d[2]),g=t.getMode(n,p),v=i(d[1],!0),m=i(d[1],!1);o.token=function(t,n){return t.match(v,!1)?(n.token=l,n.localState=n.localMode=null,null):e(t,m,n.localMode.token(t,n.localState))},o.localMode=g,o.localState=t.startState(g,c.indent(o.htmlState,""))}else o.inTag&&(o.inTag+=r.current(),r.eol()&&(o.inTag+=" "));return h}var c=t.getMode(n,{name:"xml",htmlMode:!0,multilineTagIndentFactor:r.multilineTagIndentFactor,multilineTagIndentPastTag:r.multilineTagIndentPastTag}),u={},h=r&&r.tags,f=r&&r.scriptTypes;if(o(a,u),h&&o(h,u),f)for(var d=f.length-1;d>=0;d--)u.script.unshift(["type",f[d].matches,f[d].mode]);return{startState:function(){var e=t.startState(c);return{token:l,inTag:null,localMode:null,localState:null,htmlState:e}},copyState:function(e){var n;return e.localState&&(n=t.copyState(e.localMode,e.localState)),{token:e.token,inTag:e.inTag,localMode:e.localMode,localState:n,htmlState:t.copyState(c,e.htmlState)}},token:function(t,e){return e.token(t,e)},indent:function(e,n,r){return!e.localMode||/^\s*<\//.test(n)?c.indent(e.htmlState,n):e.localMode.indent?e.localMode.indent(e.localState,n,r):t.Pass},innerMode:function(t){return{state:t.localState||t.htmlState,mode:t.localMode||c}}}},"xml","javascript","css"),t.defineMIME("text/html","htmlmixed")})},function(t,e,n){!function(t){t(n(6))}(function(t){"use strict";var e={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};t.defineMode("xml",function(r,i){function o(t,e){function n(n){return e.tokenize=n,n(t,e)}var r=t.next();if("<"==r)return t.eat("!")?t.eat("[")?t.match("CDATA[")?n(l("atom","]]>")):null:t.match("--")?n(l("comment","-->")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),n(c(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=l("meta","?>"),"meta"):(T=t.eat("/")?"closeTag":"openTag",e.tokenize=s,"tag bracket");if("&"==r){var i;return i=t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"),i?"atom":"error"}return t.eatWhile(/[^&<]/),null}function s(t,e){var n=t.next();if(">"==n||"/"==n&&t.eat(">"))return e.tokenize=o,T=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return T="equals",null;if("<"==n){e.tokenize=o,e.state=d,e.tagName=e.tagStart=null;var r=e.tokenize(t,e);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(e.tokenize=a(n),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function a(t){var e=function(e,n){for(;!e.eol();)if(e.next()==t){n.tokenize=s;break}return"string"};return e.isInAttribute=!0,e}function l(t,e){return function(n,r){for(;!n.eol();){if(n.match(e)){r.tokenize=o;break}n.next()}return t}}function c(t){return function(e,n){for(var r;null!=(r=e.next());){if("<"==r)return n.tokenize=c(t+1),n.tokenize(e,n);if(">"==r){if(1==t){n.tokenize=o;break}return n.tokenize=c(t-1),n.tokenize(e,n)}}return"meta"}}function u(t,e,n){this.prev=t.context,this.tagName=e,this.indent=t.indented,this.startOfLine=n,(C.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function h(t){t.context&&(t.context=t.context.prev)}function f(t,e){for(var n;;){if(!t.context)return;if(n=t.context.tagName,!C.contextGrabbers.hasOwnProperty(n)||!C.contextGrabbers[n].hasOwnProperty(e))return;h(t)}}function d(t,e,n){return"openTag"==t?(n.tagStart=e.column(),p):"closeTag"==t?g:d}function p(t,e,n){return"word"==t?(n.tagName=e.current(),E="tag",y):(E="error",p)}function g(t,e,n){if("word"==t){var r=e.current();return n.context&&n.context.tagName!=r&&C.implicitlyClosed.hasOwnProperty(n.context.tagName)&&h(n),n.context&&n.context.tagName==r||C.matchClosing===!1?(E="tag",v):(E="tag error",m)}return E="error",m}function v(t,e,n){return"endTag"!=t?(E="error",v):(h(n),d)}function m(t,e,n){return E="error",v(t,e,n)}function y(t,e,n){if("word"==t)return E="attribute",b;if("endTag"==t||"selfcloseTag"==t){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||C.autoSelfClosers.hasOwnProperty(r)?f(n,r):(f(n,r),n.context=new u(n,r,i==n.indented)),d}return E="error",y}function b(t,e,n){return"equals"==t?w:(C.allowMissing||(E="error"),y(t,e,n))}function w(t,e,n){return"string"==t?x:"word"==t&&C.allowUnquoted?(E="string",y):(E="error",y(t,e,n))}function x(t,e,n){return"string"==t?x:y(t,e,n)}var _=r.indentUnit,C={},k=i.htmlMode?e:n;for(var S in k)C[S]=k[S];for(var S in i)C[S]=i[S];var T,E;return o.isInText=!0,{startState:function(t){var e={tokenize:o,state:d,indented:t||0,tagName:null,tagStart:null,context:null};return null!=t&&(e.baseIndent=t),e},token:function(t,e){if(!e.tagName&&t.sol()&&(e.indented=t.indentation()),t.eatSpace())return null;T=null;var n=e.tokenize(t,e);return(n||T)&&"comment"!=n&&(E=null,e.state=e.state(T||n,t,e),E&&(n="error"==E?n+" error":E)),n},indent:function(e,n,r){var i=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+_;if(i&&i.noIndent)return t.Pass;if(e.tokenize!=s&&e.tokenize!=o)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return C.multilineTagIndentPastTag!==!1?e.tagStart+e.tagName.length+2:e.tagStart+_*(C.multilineTagIndentFactor||1);if(C.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var a=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(a&&a[1])for(;i;){if(i.tagName==a[2]){i=i.prev;break}if(!C.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(a)for(;i;){var l=C.contextGrabbers[i.tagName];if(!l||!l.hasOwnProperty(a[2]))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+_:e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:C.htmlMode?"html":"xml",helperType:C.htmlMode?"html":"xml",skipAttribute:function(t){t.state==w&&(t.state=y)}}}),t.defineMIME("text/xml","xml"),t.defineMIME("application/xml","xml"),t.mimeModes.hasOwnProperty("text/html")||t.defineMIME("text/html",{name:"xml",htmlMode:!0})})},function(t,e,n){!function(t){t(n(6))}(function(t){"use strict";t.defineMode("javascript",function(e,n){function r(t){for(var e,n=!1,r=!1;null!=(e=t.next());){if(!n){if("/"==e&&!r)return;"["==e?r=!0:r&&"]"==e&&(r=!1)}n=!n&&"\\"==e}}function i(t,e,n){return St=t,Tt=n,e}function o(t,e){var n=t.next();if('"'==n||"'"==n)return e.tokenize=s(n),e.tokenize(t,e);if("."==n&&t.match(/^\d+(?:[eE][+\-]?\d+)?/))return i("number","number");if("."==n&&t.match(".."))return i("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return i(n);if("="==n&&t.eat(">"))return i("=>","operator");if("0"==n&&t.eat(/x/i))return t.eatWhile(/[\da-f]/i),i("number","number");if("0"==n&&t.eat(/o/i))return t.eatWhile(/[0-7]/i),i("number","number");if("0"==n&&t.eat(/b/i))return t.eatWhile(/[01]/i),i("number","number");if(/\d/.test(n))return t.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),i("number","number");if("/"==n)return t.eat("*")?(e.tokenize=a,a(t,e)):t.eat("/")?(t.skipToEnd(),i("comment","comment")):kt(t,e,1)?(r(t),t.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),i("regexp","string-2")):(t.eat("="),i("operator","operator",t.current()));if("`"==n)return e.tokenize=l,l(t,e);if("#"==n)return t.skipToEnd(),i("error","error");if(Dt.test(n))return">"==n&&e.lexical&&">"==e.lexical.type||(t.eat("=")?"!"!=n&&"="!=n||t.eat("="):/[<>*+\-]/.test(n)&&(t.eat(n),">"==n&&t.eat(n))),i("operator","operator",t.current());if(Pt.test(n)){t.eatWhile(Pt);var o=t.current();if("."!=e.lastType){if(jt.propertyIsEnumerable(o)){var c=jt[o];return i(c.type,c.style,o)}if("async"==o&&t.match(/^\s*[\(\w]/,!1))return i("async","keyword",o)}return i("variable","variable",o)}}function s(t){return function(e,n){var r,s=!1;if(Ot&&"@"==e.peek()&&e.match(Nt))return n.tokenize=o,i("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=t||s);)s=!s&&"\\"==r;return s||(n.tokenize=o),i("string","string")}}function a(t,e){for(var n,r=!1;n=t.next();){if("/"==n&&r){e.tokenize=o;break}r="*"==n}return i("comment","comment")}function l(t,e){for(var n,r=!1;null!=(n=t.next());){if(!r&&("`"==n||"$"==n&&t.eat("{"))){e.tokenize=o;break}r=!r&&"\\"==n}return i("quasi","string-2",t.current())}function c(t,e){e.fatArrowAt&&(e.fatArrowAt=null);var n=t.string.indexOf("=>",t.start);if(!(n<0)){if(Lt){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(t.string.slice(t.start,n));r&&(n=r.index)}for(var i=0,o=!1,s=n-1;s>=0;--s){var a=t.string.charAt(s),l=It.indexOf(a);if(l>=0&&l<3){if(!i){++s;break}if(0==--i){"("==a&&(o=!0);break}}else if(l>=3&&l<6)++i;else if(Pt.test(a))o=!0;else{if(/["'\/]/.test(a))return;if(o&&!i){++s;break}}}o&&!i&&(e.fatArrowAt=s)}}function u(t,e,n,r,i,o){this.indented=t,this.column=e,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function h(t,e){for(var n=t.localVars;n;n=n.next)if(n.name==e)return!0;for(var r=t.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==e)return!0}function f(t,e,n,r,i){var o=t.cc;for(Bt.state=t,Bt.stream=i,Bt.marked=null,Bt.cc=o,Bt.style=e,t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);;){var s=o.length?o.pop():Mt?_:x;if(s(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return Bt.marked?Bt.marked:"variable"==n&&h(t,r)?"variable-2":e}}}function d(){for(var t=arguments.length-1;t>=0;t--)Bt.cc.push(arguments[t])}function p(){return d.apply(null,arguments),!0}function g(t){function e(e){for(var n=e;n;n=n.next)if(n.name==t)return!0;return!1}var r=Bt.state;if(Bt.marked="def",r.context){if(e(r.localVars))return;r.localVars={name:t,next:r.localVars}}else{if(e(r.globalVars))return;n.globalVars&&(r.globalVars={name:t,next:r.globalVars})}}function v(){Bt.state.context={prev:Bt.state.context,vars:Bt.state.localVars},Bt.state.localVars=Ft}function m(){Bt.state.localVars=Bt.state.context.vars,Bt.state.context=Bt.state.context.prev}function y(t,e){var n=function(){var n=Bt.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new u(r,Bt.stream.column(),t,null,n.lexical,e)};return n.lex=!0,n}function b(){var t=Bt.state;t.lexical.prev&&(")"==t.lexical.type&&(t.indented=t.lexical.indented),t.lexical=t.lexical.prev)}function w(t){function e(n){return n==t?p():";"==t?d():p(e)}return e}function x(t,e){return"var"==t?p(y("vardef",e.length),J,w(";"),b):"keyword a"==t?p(y("form"),k,x,b):"keyword b"==t?p(y("form"),x,b):"keyword d"==t?Bt.stream.match(/^\s*$/,!1)?p():p(y("stat"),T,w(";"),b):"debugger"==t?p(w(";")):"{"==t?p(y("}"),H,b):";"==t?p():"if"==t?("else"==Bt.state.lexical.info&&Bt.state.cc[Bt.state.cc.length-1]==b&&Bt.state.cc.pop()(),p(y("form"),k,x,b,nt)):"function"==t?p(lt):"for"==t?p(y("form"),rt,x,b):"variable"==t?Lt&&"type"==e?(Bt.marked="keyword",p(q,w("operator"),q,w(";"))):Lt&&"declare"==e?(Bt.marked="keyword",p(x)):p(y("stat"),I):"switch"==t?p(y("form"),k,w("{"),y("}","switch"),H,b,b):"case"==t?p(_,w(":")):"default"==t?p(w(":")):"catch"==t?p(y("form"),v,w("("),ct,w(")"),x,b,m):"class"==t?p(y("form"),ht,b):"export"==t?p(y("stat"),gt,b):"import"==t?p(y("stat"),mt,b):"module"==t?p(y("form"),Z,w("{"),y("}"),H,b,b):"async"==t?p(x):"@"==e?p(_,x):d(y("stat"),_,w(";"),b)}function _(t){return S(t,!1)}function C(t){return S(t,!0)}function k(t){return"("!=t?d():p(y(")"),_,w(")"),b)}function S(t,e){if(Bt.state.fatArrowAt==Bt.stream.start){var n=e?P:L;if("("==t)return p(v,y(")"),$(ct,")"),b,w("=>"),n,m);if("variable"==t)return d(v,Z,w("=>"),n,m)}var r=e?A:E;return Rt.hasOwnProperty(t)?p(r):"function"==t?p(lt,r):"class"==t?p(y("form"),ut,b):"keyword c"==t||"async"==t?p(e?C:_):"("==t?p(y(")"),T,w(")"),b,r):"operator"==t||"spread"==t?p(e?C:_):"["==t?p(y("]"),_t,b,r):"{"==t?V(B,"}",null,r):"quasi"==t?d(O,r):"new"==t?p(j(e)):p()}function T(t){return t.match(/[;\}\)\],]/)?d():d(_)}function E(t,e){return","==t?p(_):A(t,e,!1)}function A(t,e,n){var r=0==n?E:A,i=0==n?_:C;return"=>"==t?p(v,n?P:L,m):"operator"==t?/\+\+|--/.test(e)||Lt&&"!"==e?p(r):"?"==e?p(_,w(":"),i):p(i):"quasi"==t?d(O,r):";"!=t?"("==t?V(C,")","call",r):"."==t?p(R,r):"["==t?p(y("]"),T,w("]"),b,r):Lt&&"as"==e?(Bt.marked="keyword",p(q,r)):"regexp"==t?(Bt.state.lastType=Bt.marked="operator",Bt.stream.backUp(Bt.stream.pos-Bt.stream.start-1),p(i)):void 0:void 0}function O(t,e){return"quasi"!=t?d():"${"!=e.slice(e.length-2)?p(O):p(_,M)}function M(t){if("}"==t)return Bt.marked="string-2",Bt.state.tokenize=l,p(O)}function L(t){return c(Bt.stream,Bt.state),d("{"==t?x:_)}function P(t){return c(Bt.stream,Bt.state),d("{"==t?x:C)}function j(t){return function(e){return"."==e?p(t?N:D):"variable"==e&&Lt?p(X,t?A:E):d(t?C:_)}}function D(t,e){if("target"==e)return Bt.marked="keyword",p(E)}function N(t,e){if("target"==e)return Bt.marked="keyword",p(A)}function I(t){return":"==t?p(b,x):d(E,w(";"),b)}function R(t){if("variable"==t)return Bt.marked="property",p()}function B(t,e){if("async"==t)return Bt.marked="property",p(B);if("variable"==t||"keyword"==Bt.style){if(Bt.marked="property","get"==e||"set"==e)return p(F);var n;return Lt&&Bt.state.fatArrowAt==Bt.stream.start&&(n=Bt.stream.match(/^\s*:\s*/,!1))&&(Bt.state.fatArrowAt=Bt.stream.pos+n[0].length),p(z)}return"number"==t||"string"==t?(Bt.marked=Ot?"property":Bt.style+" property",p(z)):"jsonld-keyword"==t?p(z):"modifier"==t?p(B):"["==t?p(_,w("]"),z):"spread"==t?p(C,z):"*"==e?(Bt.marked="keyword",p(B)):":"==t?d(z):void 0}function F(t){return"variable"!=t?d(z):(Bt.marked="property",p(lt))}function z(t){return":"==t?p(C):"("==t?d(lt):void 0}function $(t,e,n){function r(i,o){if(n?n.indexOf(i)>-1:","==i){var s=Bt.state.lexical;return"call"==s.info&&(s.pos=(s.pos||0)+1),p(function(n,r){return n==e||r==e?d():d(t)},r)}return i==e||o==e?p():p(w(e))}return function(n,i){return n==e||i==e?p():d(t,r)}}function V(t,e,n){for(var r=3;r<arguments.length;r++)Bt.cc.push(arguments[r]);return p(y(e,n),$(t,e),b)}function H(t){return"}"==t?p():d(x,H)}function U(t,e){if(Lt){if(":"==t)return p(q);if("?"==e)return p(U)}}function q(t,e){return"variable"==t||"void"==e?"keyof"==e?(Bt.marked="keyword",p(q)):(Bt.marked="type",p(K)):"string"==t||"number"==t||"atom"==t?p(K):"["==t?p(y("]"),$(q,"]",","),b,K):"{"==t?p(y("}"),$(G,"}",",;"),b,K):"("==t?p($(Y,")"),W):void 0}function W(t){if("=>"==t)return p(q)}function G(t,e){return"variable"==t||"keyword"==Bt.style?(Bt.marked="property",p(G)):"?"==e?p(G):":"==t?p(q):"["==t?p(_,U,w("]"),G):void 0}function Y(t){return"variable"==t?p(Y):":"==t?p(q):void 0}function K(t,e){return"<"==e?p(y(">"),$(q,">"),b,K):"|"==e||"."==t?p(q):"["==t?p(w("]"),K):"extends"==e?p(q):void 0}function X(t,e){if("<"==e)return p(y(">"),$(q,">"),b,K)}function J(){return d(Z,U,tt,et)}function Z(t,e){return"modifier"==t?p(Z):"variable"==t?(g(e),p()):"spread"==t?p(Z):"["==t?V(Z,"]"):"{"==t?V(Q,"}"):void 0}function Q(t,e){return"variable"!=t||Bt.stream.match(/^\s*:/,!1)?("variable"==t&&(Bt.marked="property"),"spread"==t?p(Z):"}"==t?d():p(w(":"),Z,tt)):(g(e),p(tt))}function tt(t,e){if("="==e)return p(C)}function et(t){if(","==t)return p(J)}function nt(t,e){if("keyword b"==t&&"else"==e)return p(y("form","else"),x,b)}function rt(t){if("("==t)return p(y(")"),it,w(")"),b)}function it(t){return"var"==t?p(J,w(";"),st):";"==t?p(st):"variable"==t?p(ot):d(_,w(";"),st)}function ot(t,e){return"in"==e||"of"==e?(Bt.marked="keyword",p(_)):p(E,st)}function st(t,e){return";"==t?p(at):"in"==e||"of"==e?(Bt.marked="keyword",p(_)):d(_,w(";"),at)}function at(t){")"!=t&&p(_)}function lt(t,e){return"*"==e?(Bt.marked="keyword",p(lt)):"variable"==t?(g(e),p(lt)):"("==t?p(v,y(")"),$(ct,")"),b,U,x,m):Lt&&"<"==e?p(y(">"),$(q,">"),b,lt):void 0}function ct(t,e){return"@"==e&&p(_,ct),"spread"==t||"modifier"==t?p(ct):d(Z,U,tt)}function ut(t,e){return"variable"==t?ht(t,e):ft(t,e)}function ht(t,e){if("variable"==t)return g(e),p(ft)}function ft(t,e){return"<"==e?p(y(">"),$(q,">"),b,ft):"extends"==e||"implements"==e||Lt&&","==t?p(Lt?q:_,ft):"{"==t?p(y("}"),dt,b):void 0}function dt(t,e){return"modifier"==t||"async"==t||"variable"==t&&("static"==e||"get"==e||"set"==e)&&Bt.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(Bt.marked="keyword",p(dt)):"variable"==t||"keyword"==Bt.style?(Bt.marked="property",p(Lt?pt:lt,dt)):"["==t?p(_,w("]"),Lt?pt:lt,dt):"*"==e?(Bt.marked="keyword",p(dt)):";"==t?p(dt):"}"==t?p():"@"==e?p(_,dt):void 0}function pt(t,e){return"?"==e?p(pt):":"==t?p(q,tt):"="==e?p(C):d(lt)}function gt(t,e){return"*"==e?(Bt.marked="keyword",p(xt,w(";"))):"default"==e?(Bt.marked="keyword",p(_,w(";"))):"{"==t?p($(vt,"}"),xt,w(";")):d(x)}function vt(t,e){return"as"==e?(Bt.marked="keyword",p(w("variable"))):"variable"==t?d(C,vt):void 0}function mt(t){return"string"==t?p():d(yt,bt,xt)}function yt(t,e){return"{"==t?V(yt,"}"):("variable"==t&&g(e),"*"==e&&(Bt.marked="keyword"),p(wt))}function bt(t){if(","==t)return p(yt,bt)}function wt(t,e){if("as"==e)return Bt.marked="keyword",p(yt)}function xt(t,e){if("from"==e)return Bt.marked="keyword",p(_)}function _t(t){return"]"==t?p():d($(C,"]"))}function Ct(t,e){return"operator"==t.lastType||","==t.lastType||Dt.test(e.charAt(0))||/[,.]/.test(e.charAt(0))}function kt(t,e,n){return e.tokenize==o&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(e.lastType)||"quasi"==e.lastType&&/\{\s*$/.test(t.string.slice(0,t.pos-(n||0)))}var St,Tt,Et=e.indentUnit,At=n.statementIndent,Ot=n.jsonld,Mt=n.json||Ot,Lt=n.typescript,Pt=n.wordCharacters||/[\w$\xa1-\uffff]/,jt=function(){function t(t){return{type:t,style:"keyword"}}var e=t("keyword a"),n=t("keyword b"),r=t("keyword c"),i=t("keyword d"),o=t("operator"),s={type:"atom",style:"atom"},a={"if":t("if"),"while":e,"with":e,
"else":n,"do":n,"try":n,"finally":n,"return":i,"break":i,"continue":i,"new":t("new"),"delete":r,"void":r,"throw":r,"debugger":t("debugger"),"var":t("var"),"const":t("var"),"let":t("var"),"function":t("function"),"catch":t("catch"),"for":t("for"),"switch":t("switch"),"case":t("case"),"default":t("default"),"in":o,"typeof":o,"instanceof":o,"true":s,"false":s,"null":s,undefined:s,NaN:s,Infinity:s,"this":t("this"),"class":t("class"),"super":t("atom"),"yield":r,"export":t("export"),"import":t("import"),"extends":r,await:r};if(Lt){var l={type:"variable",style:"type"},c={"interface":t("class"),"implements":r,namespace:r,module:t("module"),"enum":t("module"),"public":t("modifier"),"private":t("modifier"),"protected":t("modifier"),"abstract":t("modifier"),readonly:t("modifier"),string:l,number:l,"boolean":l,any:l};for(var u in c)a[u]=c[u]}return a}(),Dt=/[+\-*&%=<>!?|~^@]/,Nt=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,It="([{}])",Rt={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},Bt={state:null,column:null,marked:null,cc:null},Ft={name:"this",next:{name:"arguments"}};return b.lex=!0,{startState:function(t){var e={tokenize:o,lastType:"sof",cc:[],lexical:new u((t||0)-Et,0,"block",(!1)),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:t||0};return n.globalVars&&"object"==typeof n.globalVars&&(e.globalVars=n.globalVars),e},token:function(t,e){if(t.sol()&&(e.lexical.hasOwnProperty("align")||(e.lexical.align=!1),e.indented=t.indentation(),c(t,e)),e.tokenize!=a&&t.eatSpace())return null;var n=e.tokenize(t,e);return"comment"==St?n:(e.lastType="operator"!=St||"++"!=Tt&&"--"!=Tt?St:"incdec",f(e,n,St,Tt,t))},indent:function(e,r){if(e.tokenize==a)return t.Pass;if(e.tokenize!=o)return 0;var i,s=r&&r.charAt(0),l=e.lexical;if(!/^\s*else\b/.test(r))for(var c=e.cc.length-1;c>=0;--c){var u=e.cc[c];if(u==b)l=l.prev;else if(u!=nt)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(i=e.cc[e.cc.length-1])&&(i==E||i==A)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;At&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var h=l.type,f=s==h;return"vardef"==h?l.indented+("operator"==e.lastType||","==e.lastType?l.info+1:0):"form"==h&&"{"==s?l.indented:"form"==h?l.indented+Et:"stat"==h?l.indented+(Ct(e,r)?At||Et:0):"switch"!=l.info||f||0==n.doubleIndentSwitch?l.align?l.column+(f?0:1):l.indented+(f?0:Et):l.indented+(/^(?:case|default)\b/.test(r)?Et:2*Et)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Mt?null:"/*",blockCommentEnd:Mt?null:"*/",blockCommentContinue:Mt?null:" * ",lineComment:Mt?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Mt?"json":"javascript",jsonldMode:Ot,jsonMode:Mt,expressionAllowed:kt,skipExpression:function(t){var e=t.cc[t.cc.length-1];e!=_&&e!=C||t.cc.pop()}}}),t.registerHelper("wordChars","javascript",/[\w$]/),t.defineMIME("text/javascript","javascript"),t.defineMIME("text/ecmascript","javascript"),t.defineMIME("application/javascript","javascript"),t.defineMIME("application/x-javascript","javascript"),t.defineMIME("application/ecmascript","javascript"),t.defineMIME("application/json",{name:"javascript",json:!0}),t.defineMIME("application/x-json",{name:"javascript",json:!0}),t.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),t.defineMIME("text/typescript",{name:"javascript",typescript:!0}),t.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},function(t,e,n){!function(t){t(n(6))}(function(t){t.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(t,e){return/^[;{}]$/.test(e)}}),t.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(t,e,n,r){return this.jsonMode?/^[\[,{]$/.test(e)||/^}/.test(n):(";"!=e||!r.lexical||")"!=r.lexical.type)&&(/^[;{}]$/.test(e)&&!/^;/.test(n))}});var e=/^(a|abbr|acronym|area|base|bdo|big|br|button|caption|cite|code|col|colgroup|dd|del|dfn|em|frame|hr|iframe|img|input|ins|kbd|label|legend|link|map|object|optgroup|option|param|q|samp|script|select|small|span|strong|sub|sup|textarea|tt|var)$/;t.extendMode("xml",{commentStart:"<!--",commentEnd:"-->",newlineAfterToken:function(t,n,r,i){var o=!1;return"html"==this.configuration&&(o=!!i.context&&e.test(i.context.tagName)),!o&&("tag"==t&&/>$/.test(n)&&i.context||/^</.test(r))}}),t.defineExtension("commentRange",function(e,n,r){var i=this,o=t.innerMode(i.getMode(),i.getTokenAt(n).state).mode;i.operation(function(){if(e)i.replaceRange(o.commentEnd,r),i.replaceRange(o.commentStart,n),n.line==r.line&&n.ch==r.ch&&i.setCursor(n.line,n.ch+o.commentStart.length);else{var t=i.getRange(n,r),s=t.indexOf(o.commentStart),a=t.lastIndexOf(o.commentEnd);s>-1&&a>-1&&a>s&&(t=t.substr(0,s)+t.substring(s+o.commentStart.length,a)+t.substr(a+o.commentEnd.length)),i.replaceRange(t,n,r)}})}),t.defineExtension("autoIndentRange",function(t,e){var n=this;this.operation(function(){for(var r=t.line;r<=e.line;r++)n.indentLine(r,"smart")})}),t.defineExtension("autoFormatRange",function(e,n){function r(){c+="\n",h=!0,++u}for(var i=this,o=i.getMode(),s=i.getRange(e,n).split("\n"),a=t.copyState(o,i.getTokenAt(e).state),l=i.getOption("tabSize"),c="",u=0,h=0===e.ch,f=0;f<s.length;++f){for(var d=new t.StringStream(s[f],l);!d.eol();){var p=t.innerMode(o,a),g=o.token(d,a),v=d.current();d.start=d.pos,h&&!/\S/.test(v)||(c+=v,h=!1),!h&&p.mode.newlineAfterToken&&p.mode.newlineAfterToken(g,v,d.string.slice(d.pos)||s[f+1]||"",p.state)&&r()}!d.pos&&o.blankLine&&o.blankLine(a),!h&&f<s.length-1&&r()}i.operation(function(){i.replaceRange(c,e,n);for(var t=e.line+1,r=e.line+u;t<=r;++t)i.indentLine(t,"smart");i.setSelection(e,i.getCursor(!1))})})})},function(t,e,n){"use strict";(function(e){var r=n(0);t.exports=r.View.extend({template:e.template('\n <div class="<%= pfx %>editor" id="<%= pfx %><%= codeName %>">\n \t<div id="<%= pfx %>title"><%= label %></div>\n \t<div id="<%= pfx %>code"></div>\n </div>'),initialize:function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix},render:function(){var t=this.model.toJSON();return t.pfx=this.pfx,this.$el.html(this.template(t)),this.$el.attr("class",this.pfx+"editor-c"),this.$el.find("#"+this.pfx+"code").append(this.model.get("input")),this}})}).call(e,n(1))},function(t,e,n){"use strict";t.exports=function(){var t,e,r={},i=n(108),o=n(27),s=n(110),a=(n(29),n(112));return{name:"Panels",init:function(n){r=n||{};for(var o in i)o in r||(r[o]=i[o]);var l=r.pStylePrefix;return l&&(r.stylePrefix=l+r.stylePrefix),t=new s(r.defaults),e=new a({collection:t,config:r}),this},getPanels:function(){return t},getPanelsEl:function(){return e.el},addPanel:function(e){return t.add(e)},removePanel:function(e){return t.remove(e)},getPanel:function(e){var n=t.where({id:e});return n.length?n[0]:null},addButton:function(t,e){var n=this.getPanel(t);return n?n.get("buttons").add(e):null},removeButton:function(t,e){var n=this.getPanel(t);return n&&n.get("buttons").remove(e)},getButton:function(t,e){var n=this.getPanel(t);if(n){var r=n.get("buttons").where({id:e});return r.length?r[0]:null}return null},render:function(){return e.render().el},active:function(){this.getPanels().each(function(t){t.get("buttons").each(function(t){t.get("active")&&t.trigger("updateActive")})})},disableButtons:function(){this.getPanels().each(function(t){t.get("buttons").each(function(t){t.get("disable")&&t.trigger("change:disable")})})},Panel:o}}},function(t,e,n){"use strict";var r="sw-visibility",i="export-template",o="open-sm",s="open-tm",a="open-layers",l="open-blocks",c="fullscreen",u="preview";t.exports={stylePrefix:"pn-",defaults:[{id:"commands",buttons:[{}]},{id:"options",buttons:[{active:!0,id:r,className:"fa fa-square-o",command:r,context:r,attributes:{title:"View components"}},{id:u,className:"fa fa-eye",command:u,context:u,attributes:{title:"Preview"}},{id:c,className:"fa fa-arrows-alt",command:c,context:c,attributes:{title:"Fullscreen"}},{id:i,className:"fa fa-code",command:i,attributes:{title:"View code"}}]},{id:"views",buttons:[{id:o,className:"fa fa-paint-brush",command:o,active:!0,attributes:{title:"Open Style Manager"}},{id:s,className:"fa fa-cog",command:s,attributes:{title:"Settings"}},{id:a,className:"fa fa-bars",command:a,attributes:{title:"Open Layer Manager"}},{id:l,className:"fa fa-th-large",command:l,attributes:{title:"Open Blocks"}}]}],em:null,delayBtnsShow:300}},function(t,e,n){"use strict";var r=n(0);t.exports=r.Model.extend({defaults:{id:"",className:"",command:"",context:"",buttons:[],attributes:{},options:{},active:!1,dragDrop:!1,runDefaultCommand:!0,stopDefaultCommand:!1,disable:!1},initialize:function(t){if(this.get("buttons").length){var e=n(28);this.set("buttons",new e(this.get("buttons")))}}})},function(t,e,n){"use strict";var r=n(0),i=n(27);t.exports=r.Collection.extend({model:i})},function(t,e,n){"use strict";(function(e,r){var i=n(1),o=e.$;t.exports=e.View.extend({tagName:"span",initialize:function(t){r.bindAll(this,"startTimer","stopTimer","showButtons","hideButtons","closeOnKeyPress","onDrop","initSorter","stopDrag");var e=this.model.get("className");this.config=t.config||{},this.em=this.config.em||{};var n=this.config.stylePrefix||"",i=this.config.pStylePrefix||"";this.pfx=n,this.ppfx=this.config.pStylePrefix||"",this.id=n+this.model.get("id"),this.activeCls=n+"active "+i+"four-color",this.disableCls=n+"active",this.btnsVisCls=n+"visible",this.parentM=t.parentM||null,this.className=n+"btn"+(e?" "+e:""),this.listenTo(this.model,"change:active updateActive",this.updateActive),this.listenTo(this.model,"checkActive",this.checkActive),this.listenTo(this.model,"change:bntsVis",this.updateBtnsVis),this.listenTo(this.model,"change:attributes",this.updateAttributes),this.listenTo(this.model,"change:className",this.updateClassName),this.listenTo(this.model,"change:disable",this.updateDisable),this.model.get("buttons").length&&(this.$el.on("mousedown",this.startTimer),this.$el.append(o("<div>",{"class":n+"arrow-rd"}))),this.em&&this.em.get&&(this.commands=this.em.get("Commands")),this.events={},this.model.get("dragDrop")?(this.events.mousedown="initDrag",this.em.on("loaded",this.initSorter)):this.events.click="clicked",this.delegateEvents()},initSorter:function(){if(this.em.Canvas){var t=this.em.Canvas;this.canvasEl=t.getBody(),this.sorter=new this.em.Utils.Sorter({container:this.canvasEl,placer:t.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:this.ppfx,onMove:this.onDrag,onEndMove:this.onDrop,document:t.getFrameEl().contentDocument,direction:"a",wmargin:1,nested:1});var e=t.getOffset();this.sorter.offTop=e.top,this.sorter.offLeft=e.left}},initDrag:function(){this.model.collection.deactivateAll(this.model.get("context")),this.sorter.startSort(this.el),this.sorter.setDropContent(this.model.get("options").content),this.canvasEl.style.cursor="grabbing",o(document).on("mouseup",this.stopDrag)},stopDrag:function(){o(document).off("mouseup",this.stopDrag),this.sorter.endMove()},onDrag:function(t){},onDrop:function(t){this.canvasEl.style.cursor="default"},updateClassName:function(){var t=this.model.get("className");this.$el.attr("class",this.pfx+"btn"+(t?" "+t:""))},updateAttributes:function(){this.$el.attr(this.model.get("attributes"))},updateBtnsVis:function(){this.$buttons&&(this.model.get("bntsVis")?this.$buttons.addClass(this.btnsVisCls):this.$buttons.removeClass(this.btnsVisCls))},startTimer:function(){this.timeout=setTimeout(this.showButtons,this.config.delayBtnsShow),o(document).on("mouseup",this.stopTimer)},stopTimer:function(){o(document).off("mouseup",this.stopTimer),this.timeout&&clearTimeout(this.timeout)},showButtons:function(){clearTimeout(this.timeout),this.model.set("bntsVis",!0),o(document).on("mousedown",this.hideButtons),o(document).on("keypress",this.closeOnKeyPress)},hideButtons:function(t){t&&o(t.target).trigger("click"),this.model.set("bntsVis",!1),o(document).off("mousedown",this.hideButtons),o(document).off("keypress",this.closeOnKeyPress)},closeOnKeyPress:function(t){var e=t.which||t.keyCode;27==e&&this.hideButtons()},updateActive:function(){var t=this.model,e=t.get("context"),n=this.parentM,r={},o=this.em&&this.em.get?this.em.get("Editor"):null,s=t.get("command");this.commands&&(0,i.isString)(s)?r=this.commands.get(s)||{}:(0,i.isFunction)(s)?r={run:s}:null!==s&&(0,i.isObject)(s)&&(r=s),t.get("active")?(t.collection.deactivateAll(e),t.set("active",!0,{silent:!0}).trigger("checkActive"),n&&n.set("active",!0,{silent:!0}).trigger("checkActive"),r.run&&(r.run(o,t,t.get("options")),o.trigger("run:"+s)),!r.stop&&t.set("active",!1)):(this.$el.removeClass(this.activeCls),t.collection.deactivateAll(e),n&&n.set("active",!1,{silent:!0}).trigger("checkActive"),r.stop&&(r.stop(o,t,t.get("options")),o.trigger("stop:"+s)))},updateDisable:function(){this.model.get("disable")?this.$el.addClass(this.disableCls):this.$el.removeClass(this.disableCls)},checkActive:function(){this.model.get("active")?this.$el.addClass(this.activeCls):this.$el.removeClass(this.activeCls)},clicked:function(t){this.model.get("bntsVis")||this.model.get("disable")||this.toogleActive()},toogleActive:function(){this.parentM&&this.swapParent();var t=this.model.get("active");this.model.set("active",!t);this.em.get("Commands").get("select-comp");t?this.model.get("runDefaultCommand")&&this.em.runDefault():this.model.get("stopDefaultCommand")&&this.em.stopDefault()},swapParent:function(){this.parentM.collection.deactivateAll(this.model.get("context")),this.parentM.set("attributes",this.model.get("attributes")),this.parentM.set("options",this.model.get("options")),this.parentM.set("command",this.model.get("command")),this.parentM.set("className",this.model.get("className")),this.parentM.set("active",!0,{silent:!0}).trigger("checkActive")},render:function(){if(this.updateAttributes(),this.$el.attr("class",this.className),this.model.get("buttons").length){var t=n(30),e=new t({collection:this.model.get("buttons"),config:this.config,parentM:this.model});this.$buttons=e.render().$el,this.$buttons.append(o("<div>",{"class":this.pfx+"arrow-l"})),this.$el.append(this.$buttons)}return this}})}).call(e,n(0),n(1))},function(t,e,n){"use strict";var r=n(0),i=n(29);t.exports=r.View.extend({initialize:function(t){this.opt=t||{},this.config=this.opt.config||{},this.pfx=this.config.stylePrefix||"",this.listenTo(this.collection,"add",this.addTo),this.listenTo(this.collection,"reset",this.render),this.className=this.pfx+"panels"},addTo:function(t){this.addToCollection(t)},addToCollection:function(t,e){var n=e||null,r=new i({model:t,config:this.config}),o=r.render().el,s=t.get("appendTo");if(s){var a=document.querySelector(s);a.appendChild(o)}else n?n.appendChild(o):this.$el.append(o);return r.initResize(),o},render:function(){var t=document.createDocumentFragment();return this.$el.empty(),this.collection.each(function(e){this.addToCollection(e,t)},this),this.$el.append(t),this.$el.attr("class",this.className),this}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}var i=n(114),o=r(i),s=n(2);t.exports=function(){var t={},e=n(115),r=void 0,i=void 0,a=void 0,l=void 0,c=function(){var t=r.style,e="-100px";t.top=e,t.left=e,t.display="none"};return{customRte:null,name:"RichTextEditor",init:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=n;for(var o in e)o in t||(t[o]=e[o]);var a=t.pStylePrefix;return a&&(t.stylePrefix=a+t.stylePrefix),this.pfx=t.stylePrefix,i=t.actions||[],r=document.createElement("div"),r.className=a+"rte-toolbar "+a+"one-bg",l=this.initRte(document.createElement("div")),(0,s.on)(r,"mousedown",function(t){return t.stopPropagation()}),this},postRender:function(t){var e=t.model.get("Canvas");r.style.pointerEvents="all",c(),e.getToolsEl().appendChild(r)},initRte:function(e){var n=this.pfx,i=r,s=this.actionbar,a=this.actions||t.actions,c={actionbar:n+"actionbar",button:n+"action",active:n+"active"},u=new o["default"]({el:e,classes:c,actions:a,actionbar:s,actionbarContainer:i});return l&&l.setEl(e),u.actionbar&&(this.actionbar=u.actionbar),u.actions&&(this.actions=u.actions),u},add:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.name=t,l.addAction(e,{sync:1})},get:function(t){var e=void 0;return l.getActions().forEach(function(n){n.name==t&&(e=n)}),e},getAll:function(){return l.getActions()},remove:function(t){var e=this.getAll(),n=this.get(t);if(n){var r=n.btn,i=e.indexOf(n);r.parentNode.removeChild(r),e.splice(i,1)}return n},getToolbarEl:function(){return r},udpatePosition:function(){var e="px",n=t.em.get("Canvas"),i=n.getTargetToElementDim(r,a,{event:"rteToolbarPosUpdate"});t.adjustToolbar&&i.top<=i.canvasTop&&(i.top=i.elementTop+i.elementHeight);var o=r.style;o.top=i.top+e,o.left=i.left+e},enable:function(e,n){a=e.el;var i=t.em,o=e.getChildrenContainer(),s=this.customRte;if(r.style.display="",n=s?s.enable(o,n):this.initRte(o).enable(),i){setTimeout(this.udpatePosition.bind(this),0);var l="change:canvasOffset canvasScroll";i.off(l,this.udpatePosition,this),i.on(l,this.udpatePosition,this),i.trigger("rte:enable",e,n)}return n},disable:function(e,n){var r=t.em,i=this.customRte,o=e.getChildrenContainer();i?i.disable(o,n):n&&n.disable(),c(),r&&r.trigger("rte:disable",e,n)}}}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=n(2),a="_rte",l={bold:{name:"bold",icon:"<b>B</b>",attributes:{title:"Bold"},result:function(t){return t.exec("bold")}},italic:{name:"italic",icon:"<i>I</i>",attributes:{title:"Italic"},result:function(t){return t.exec("italic")}},underline:{name:"underline",icon:"<u>U</u>",attributes:{title:"Underline"},result:function(t){return t.exec("underline")}},strikethrough:{name:"strikethrough",icon:"<strike>S</strike>",attributes:{title:"Strike-through"},result:function(t){return t.exec("strikeThrough")}},link:{icon:'<span style="transform:rotate(45deg)">&supdsub;</span>',name:"link",attributes:{style:"font-size:1.4rem;padding:0 4px 2px;",title:"Link"},result:function(t){return t.insertHTML('<a class="link" href="">'+t.selection()+"</a>")}}},c=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,t);var o=n.el;if(o[a])return o[a];o[a]=this,this.setEl(o),this.updateActiveActions=this.updateActiveActions.bind(this);var s=n.actions||[];s.forEach(function(t,e){"string"==typeof t?t=l[t]:l[t.name]&&(t=i({},l[t.name],t)),s[e]=t});var c=s.length?s:Object.keys(l).map(function(t){return l[t]});n.classes=i({actionbar:"actionbar",button:"action",active:"active"},n.classes);var u=n.classes,h=n.actionbar;if(this.actionbar=h,this.settings=n,this.classes=u,this.actions=c,!h){var f=n.actionbarContainer;h=document.createElement("div"),h.className=u.actionbar,f.appendChild(h),this.actionbar=h,c.forEach(function(t){return e.addAction(t)})}return n.styleWithCSS&&this.exec("styleWithCSS"),this.syncActions(),this}return o(t,[{key:"setEl",value:function(t){this.el=t,this.doc=t.ownerDocument}},{key:"updateActiveActions",value:function(){var t=this;this.getActions().forEach(function(e){var n=e.btn,r=e.update,i=t.classes.active,o=e.name,s=t.doc;n.className=n.className.replace(i,"").trim(),s.queryCommandState(o)&&(n.className+=" "+i),r&&r(t,e)})}},{key:"enable",value:function(){return this.enabled?this:(this.actionbarEl().style.display="",this.el.contentEditable=!0,(0,s.on)(this.el,"mouseup keyup",this.updateActiveActions),this.syncActions(),this.updateActiveActions(),this.el.focus(),this.enabled=1,this)}},{key:"disable",value:function(){return this.actionbarEl().style.display="none",this.el.contentEditable=!1,(0,s.off)(this.el,"mouseup keyup",this.updateActiveActions),this.enabled=0,this}},{key:"syncActions",value:function(){var t=this;this.getActions().forEach(function(e){var n=e.event||"click";e.btn["on"+n]=function(n){e.result(t,e),t.updateActiveActions()}})}},{key:"addAction",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.sync,r=document.createElement("span"),i=t.icon,o=t.attributes||{};r.className=this.classes.button,t.btn=r;for(var s in o)r.setAttribute(s,o[s]);"string"==typeof i?r.innerHTML=i:r.appendChild(i),this.actionbarEl().appendChild(r),n&&(this.actions.push(t),this.syncActions())}},{key:"getActions",value:function(){return this.actions}},{key:"selection",value:function(){return this.doc.getSelection()}},{key:"exec",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.doc.execCommand(t,!1,e)}},{key:"actionbarEl",value:function(){return this.actionbar}},{key:"insertHTML",value:function(t){var e=void 0,n=this.doc,r=n.getSelection();if(r&&r.rangeCount){var i=n.createElement("div"),o=r.getRangeAt(0);o.deleteContents(),i.innerHTML=t,Array.prototype.slice.call(i.childNodes).forEach(function(t){o.insertNode(t),e=t}),r.removeAllRanges(),r.addRange(o),this.el.focus()}}}]),t}();e["default"]=c},function(t,e,n){"use strict";t.exports={stylePrefix:"rte-",adjustToolbar:1,actions:["bold","italic","underline","strikethrough","link"]}},function(t,e,n){"use strict";t.exports={stylePrefix:"sm-",sectors:[],textNoElement:"Select an element before using Style Manager",hideNotStylable:!0,highlightChanged:!0,highlightComputed:!0,showComputed:!0,clearProperties:0,avoidComputed:["width","height"]}},function(t,e,n){"use strict";var r=n(118);t.exports=n(0).Collection.extend({model:r})},function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(11),s=n(127);t.exports=i.Model.extend({defaults:{id:"",name:"",open:!0,buildProps:"",extendBuilded:1,properties:[]},initialize:function(t){var e=t||{},n=[],r=this.buildProperties(e.buildProps);!this.get("id")&&this.set("id",this.get("name")),n=r?this.extendProperties(r):this.get("properties");var i=new o(n);i.sector=this,this.set("properties",i)},extendProperties:function(t,e,n){for(var i=t.length,o=e||this.get("properties"),s=this.get("extendBuilded"),a=[],l=0,c=o.length;l<c;l++){for(var u=o[l],h=0,f=0;f<i;f++){var d=t[f];if(u.property!=d.property&&u.id!=d.property);else{var p=u.properties;p&&p.length&&(u.properties=this.extendProperties(d.properties,p,1)),t[f]=s?(0,r.extend)(d,u):u,a[f]=t[f],h=1}}h||(t.push(u),a.push(u))}return n?a:t},buildProperties:function(t){var e,n=t||[];if(n.length)return this.propFactory||(this.propFactory=new s),e=this.propFactory.build(n)}})},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(33),o=n(120);t.exports=i.extend({defaults:r({},i.prototype.defaults,{layers:[],preview:0}),init:function(){i.prototype.init.apply(this,arguments);var t=this.get("layers"),e=new o(t);e.properties=this.get("properties"),this.set("layers",e)},getFullValue:function(){return this.get("detached")?"":this.get("layers").getFullValue()}})},function(t,e,n){"use strict";(function(e){var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(121);t.exports=e.Collection.extend({model:i,initialize:function(){this.idx=1,this.on("add",this.onAdd),this.on("reset",this.onReset)},onAdd:function(t,e,n){n.noIncrement||t.set("index",this.idx++)},onReset:function(){this.idx=1},getLayersFromValue:function(t){var e=this,n=[];t.replace(/\(([\w\s,.]*)\)/g,function(e){var n=e.replace(/,\s*/g,",");t=t.replace(e,n)});var r=t?t.split(", "):[];return r.forEach(function(t){n.push({properties:e.properties.parseValue(t)})}),n},getLayersFromStyle:function(t){var e=[],n=this.properties;n.pluck("property");return n.each(function(n){var i=t[n.get("property")],o=i?i.split(", "):[];o.forEach(function(t,i){t=n.parseValue(t.trim()).value;var o=e[i],s=r({},n.attributes,{value:t});o?o.properties.push(s):e[i]={properties:[s]}})}),e.forEach(function(t){var e=t.properties.map(function(t){return t.property});n.each(function(n){var i=n.get("property");e.indexOf(i)<0&&t.properties.push(r({},n.attributes))})}),e},active:function(t){this.each(function(t){return t.set("active",0)});var e=this.at(t);e&&e.set("active",1)},getFullValue:function(){var t=[];return this.each(function(e){return t.push(e.getFullValue())}),t.join(", ")},getPropertyValues:function(t){var e=[];return this.each(function(n){var r=n.getPropertyValue(t);r&&e.push(r)}),e.join(", ")}})}).call(e,n(0))},function(t,e,n){"use strict";(function(e){t.exports=e.Model.extend({defaults:{index:"",value:"",values:{},active:!1,preview:!1,properties:[]},initialize:function(){var t=n(11),e=this.get("properties"),r=this.get("value");if(this.set("properties",e instanceof t?e:new t(e)),!r){var i="",o=this.get("values");for(var s in o)i+=" "+o[s];this.set("value",i.trim())}},getPropertyValue:function(t){var e="";return this.get("properties").each(function(n){n.get("property")==t&&(e=n.getFullValue())}),e},getFullValue:function(){var t=[];return this.get("properties").each(function(e){return t.push(e.getFullValue())}),t.join(" ")}})}).call(e,n(0))},function(t,e,n){"use strict";(function(t){var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(e){e(t.$)}(function(t,n){function r(e,n,r,i){for(var o=[],s=0;s<e.length;s++){var a=e[s];if(a){var l=lt(a),c=l.toHsl().l<.5?"sp-thumb-el sp-thumb-dark":"sp-thumb-el sp-thumb-light";c+=lt.equals(n,a)?" sp-thumb-active":"";var u=l.toString(i.preferredFormat||"rgb"),h=X?"background-color:"+l.toRgbString():"filter:"+l.toFilter();o.push('<span title="'+u+'" data-color="'+l.toRgbString()+'" class="'+c+'"><span class="sp-thumb-inner" style="'+h+';"></span></span>')}else{var f="sp-clear-display";o.push(t("<div />").append(t('<span data-color="" style="background-color:transparent;" class="'+f+'"></span>').attr("title",i.noColorSelectedText)).html())}}return"<div class='sp-cf "+r+"'>"+o.join("")+"</div>"}function i(){for(var t=0;t<Y.length;t++)Y[t]&&Y[t].hide()}function o(e,n){var r=t.extend({},G,e);return r.callbacks={move:u(r.move,n),change:u(r.change,n),show:u(r.show,n),hide:u(r.hide,n),beforeShow:u(r.beforeShow,n)},r}function s(e,s){function l(){if($.showPaletteOnly&&($.showPalette=!0),Ft.text($.showPaletteOnly?$.togglePaletteMoreText:$.togglePaletteLessText),$.palette){pt=$.palette.slice(0),gt=t.isArray(pt[0])?pt:[pt],vt={};for(var e=0;e<gt.length;e++)for(var n=0;n<gt[e].length;n++){var r=lt(gt[e][n]).toRgbString();vt[r]=!0}}kt.toggleClass("sp-flat",V),kt.toggleClass("sp-input-disabled",!$.showInput),kt.toggleClass("sp-alpha-enabled",$.showAlpha),kt.toggleClass("sp-clear-enabled",Jt),kt.toggleClass("sp-buttons-disabled",!$.showButtons),kt.toggleClass("sp-palette-buttons-disabled",!$.togglePaletteOnly),kt.toggleClass("sp-palette-disabled",!$.showPalette),kt.toggleClass("sp-palette-only",$.showPaletteOnly),kt.toggleClass("sp-initial-disabled",!$.showInitial),kt.addClass($.className).addClass($.containerClassName),N()}function u(){function e(e){return e.data&&e.data.ignore?(A(t(e.target).closest(".sp-thumb-el").data("color")),L()):(A(t(e.target).closest(".sp-thumb-el").data("color")),L(),D(!0),$.hideAfterPaletteSelect&&T()),!1}if(K&&kt.find("*:not(input)").attr("unselectable","on"),l(),Vt&&_t.after(Ht).hide(),Jt||Rt.hide(),V)_t.after(kt).hide();else{var n="parent"===$.appendTo?_t.parent():t($.appendTo);1!==n.length&&(n=t("body")),n.append(kt)}p(),Ut.bind("click.spectrum touchstart.spectrum",function(e){Ct||_(),e.stopPropagation(),t(e.target).is("input")||e.preventDefault()}),(_t.is(":disabled")||$.disabled===!0)&&F(),kt.click(c),jt.change(x),jt.bind("paste",function(){setTimeout(x,1)}),jt.keydown(function(t){13==t.keyCode&&x()}),It.text($.cancelText),It.bind("click.spectrum",function(t){t.stopPropagation(),t.preventDefault(),E(),T()}),Rt.attr("title",$.clearText),Rt.bind("click.spectrum",function(t){t.stopPropagation(),t.preventDefault(),Xt=!0,L(),V&&D(!0)}),Bt.text($.chooseText),Bt.bind("click.spectrum",function(t){t.stopPropagation(),t.preventDefault(),K&&jt.is(":focus")&&jt.trigger("change"),M()&&(D(!0),T())}),Ft.text($.showPaletteOnly?$.togglePaletteMoreText:$.togglePaletteLessText),Ft.bind("click.spectrum",function(t){t.stopPropagation(),t.preventDefault(),$.showPaletteOnly=!$.showPaletteOnly,$.showPaletteOnly||V||kt.css("left","-="+(St.outerWidth(!0)+5)),l()}),h(Lt,function(t,e,n){dt=t/st,Xt=!1,n.shiftKey&&(dt=Math.round(10*dt)/10),L()},b,w),h(At,function(t,e){ut=parseFloat(e/it),Xt=!1,$.showAlpha||(dt=1),L()},b,w),h(Tt,function(t,e,n){if(n.shiftKey){if(!wt){var r=ht*et,i=nt-ft*nt,o=Math.abs(t-r)>Math.abs(e-i);wt=o?"x":"y"}}else wt=null;var s=!wt||"x"===wt,a=!wt||"y"===wt;s&&(ht=parseFloat(t/et)),a&&(ft=parseFloat((nt-e)/nt)),Xt=!1,$.showAlpha||(dt=1),L()},b,w),Wt?(A(Wt),P(),Yt=$.preferredFormat||lt(Wt).format,g(Wt)):P(),V&&C();var r=K?"mousedown.spectrum":"click.spectrum touchstart.spectrum";Dt.delegate(".sp-thumb-el",r,e),Nt.delegate(".sp-thumb-el:nth-child(1)",r,{ignore:!0},e)}function p(){if(U&&window.localStorage){try{var e=window.localStorage[U].split(",#");e.length>1&&(delete window.localStorage[U],t.each(e,function(t,e){g(e)}))}catch(n){}try{mt=window.localStorage[U].split(";")}catch(n){}}}function g(e){if(H){var n=lt(e).toRgbString();if(!vt[n]&&t.inArray(n,mt)===-1)for(mt.push(n);mt.length>yt;)mt.shift();if(U&&window.localStorage)try{window.localStorage[U]=mt.join(";")}catch(r){}}}function v(){var t=[];if($.showPalette)for(var e=0;e<mt.length;e++){var n=lt(mt[e]).toRgbString();vt[n]||t.push(mt[e])}return t.reverse().slice(0,$.maxSelectionSize)}function m(){var e=O(),n=t.map(gt,function(t,n){return r(t,e,"sp-palette-row sp-palette-row-"+n,$)});p(),mt&&n.push(r(v(),e,"sp-palette-row sp-palette-row-selection",$)),Dt.html(n.join(""))}function y(){if($.showInitial){var t=Gt,e=O();Nt.html(r([t,e],e,"sp-palette-row-initial",$))}}function b(){(nt<=0||et<=0||it<=0)&&N(),tt=!0,kt.addClass(bt),wt=null,_t.trigger("dragstart.spectrum",[O()])}function w(){tt=!1,kt.removeClass(bt),_t.trigger("dragstop.spectrum",[O()])}function x(){var t=jt.val();if(null!==t&&""!==t||!Jt){var e=lt(t);e.isValid()?(A(e),D(!0)):jt.addClass("sp-validation-error")}else A(null),D(!0)}function _(){Q?T():C()}function C(){var e=t.Event("beforeShow.spectrum");if(Q)return void N();if(_t.trigger(e,[O()]),W.beforeShow(O())!==!1&&!e.isDefaultPrevented()){i(),Q=!0;var n=t(xt);n.bind("keydown.spectrum",k),n.bind("click.spectrum",S),t(window).bind("resize.spectrum",G),Ht.addClass("sp-active"),kt.removeClass("sp-hidden"),N(),P(),Gt=O(),y(),W.show(Gt),_t.trigger("show.spectrum",[Gt])}}function k(t){27===t.keyCode&&T()}function S(t){2!=t.button&&(tt||(Kt?D(!0):E(),T()))}function T(){Q&&!V&&(Q=!1,t(xt).unbind("keydown.spectrum",k),t(xt).unbind("click.spectrum",S),t(window).unbind("resize.spectrum",G),Ht.removeClass("sp-active"),kt.addClass("sp-hidden"),W.hide(O()),_t.trigger("hide.spectrum",[O()]))}function E(){A(Gt,!0)}function A(t,e){if(lt.equals(t,O()))return void P();var n,r;!t&&Jt?Xt=!0:(Xt=!1,n=lt(t),r=n.toHsv(),ut=r.h%360/360,ht=r.s,ft=r.v,dt=r.a),P(),n&&n.isValid()&&!e&&(Yt=$.preferredFormat||n.getFormat())}function O(t){return t=t||{},Jt&&Xt?null:lt.fromRatio({h:ut,s:ht,v:ft,a:Math.round(100*dt)/100},{format:t.format||Yt})}function M(){return!jt.hasClass("sp-validation-error")}function L(){P(),W.move(O()),_t.trigger("move.spectrum",[O()])}function P(){jt.removeClass("sp-validation-error"),j();var t=lt.fromRatio({h:ut,s:1,v:1});Tt.css("background-color",t.toHexString());var e=Yt;dt<1&&(0!==dt||"name"!==e)&&("hex"!==e&&"hex3"!==e&&"hex6"!==e&&"name"!==e||(e="rgb"));
var n=O({format:e}),r="";if(qt.removeClass("sp-clear-display"),qt.css("background-color","transparent"),!n&&Jt)qt.addClass("sp-clear-display");else{var i=n.toHexString(),o=n.toRgbString();if(X||1===n.alpha?qt.css("background-color",o):(qt.css("background-color","transparent"),qt.css("filter",n.toFilter())),$.showAlpha){var s=n.toRgb();s.a=0;var a=lt(s).toRgbString(),l="linear-gradient(left, "+a+", "+i+")";K?Mt.css("filter",lt(a).toFilter({gradientType:1},i)):(Mt.css("background","-webkit-"+l),Mt.css("background","-moz-"+l),Mt.css("background","-ms-"+l),Mt.css("background","linear-gradient(to right, "+a+", "+i+")"))}r=n.toString(e)}$.showInput&&jt.val(r),$.showPalette&&m(),y()}function j(){var t=ht,e=ft;if(Jt&&Xt)Pt.hide(),Ot.hide(),Et.hide();else{Pt.show(),Ot.show(),Et.show();var n=t*et,r=nt-e*nt;n=Math.max(-rt,Math.min(et-rt,n-rt)),r=Math.max(-rt,Math.min(nt-rt,r-rt)),Et.css({top:r+"px",left:n+"px"});var i=dt*st;Pt.css({left:i-at/2+"px"});var o=ut*it;Ot.css({top:o-ct+"px"})}}function D(t){var e=O(),n="",r=!lt.equals(e,Gt);e&&(n=e.toString(Yt),g(e)),zt&&_t.val(n),t&&r&&(W.change(e),_t.trigger("change",[e]))}function N(){Q&&(et=Tt.width(),nt=Tt.height(),rt=Et.height(),ot=At.width(),it=At.height(),ct=Ot.height(),st=Lt.width(),at=Pt.width(),V||(kt.css("position","absolute"),$.offset?kt.offset($.offset):kt.offset(a(kt,Ut))),j(),$.showPalette&&m(),_t.trigger("reflow.spectrum"))}function I(){_t.show(),Ut.unbind("click.spectrum touchstart.spectrum"),kt.remove(),Ht.remove(),Y[Zt.id]=null}function R(e,r){return e===n?t.extend({},$):r===n?$[e]:($[e]=r,"preferredFormat"===e&&(Yt=$.preferredFormat),void l())}function B(){Ct=!1,_t.attr("disabled",!1),Ut.removeClass("sp-disabled")}function F(){T(),Ct=!0,_t.attr("disabled",!0),Ut.addClass("sp-disabled")}function z(t){$.offset=t,N()}var $=o(s,e),V=$.flat,H=$.showSelectionPalette,U=$.localStorageKey,q=$.theme,W=$.callbacks,G=f(N,10),Q=!1,tt=!1,et=0,nt=0,rt=0,it=0,ot=0,st=0,at=0,ct=0,ut=0,ht=0,ft=0,dt=1,pt=[],gt=[],vt={},mt=$.selectionPalette.slice(0),yt=$.maxSelectionSize,bt="sp-dragging",wt=null,xt=e.ownerDocument,_t=(xt.body,t(e)),Ct=!1,kt=t(Z,xt).addClass(q),St=kt.find(".sp-picker-container"),Tt=kt.find(".sp-color"),Et=kt.find(".sp-dragger"),At=kt.find(".sp-hue"),Ot=kt.find(".sp-slider"),Mt=kt.find(".sp-alpha-inner"),Lt=kt.find(".sp-alpha"),Pt=kt.find(".sp-alpha-handle"),jt=kt.find(".sp-input"),Dt=kt.find(".sp-palette"),Nt=kt.find(".sp-initial"),It=kt.find(".sp-cancel"),Rt=kt.find(".sp-clear"),Bt=kt.find(".sp-choose"),Ft=kt.find(".sp-palette-toggle"),zt=_t.is("input"),$t=zt&&"color"===_t.attr("type")&&d(),Vt=zt&&!V,Ht=Vt?t(J).addClass(q).addClass($.className).addClass($.replacerClassName):t([]),Ut=Vt?Ht:_t,qt=Ht.find(".sp-preview-inner"),Wt=$.color||zt&&_t.val(),Gt=!1,Yt=$.preferredFormat,Kt=!$.showButtons||$.clickoutFiresChange,Xt=!Wt,Jt=$.allowEmpty&&!$t;u();var Zt={show:C,hide:T,toggle:_,reflow:N,option:R,enable:B,disable:F,offset:z,set:function(t){A(t),D()},get:O,destroy:I,container:kt};return Zt.id=Y.push(Zt)-1,Zt}function a(e,n){var r=0,i=e.outerWidth(),o=e.outerHeight(),s=n.outerHeight(),a=e[0].ownerDocument,l=a.documentElement,c=l.clientWidth,u=l.clientHeight,h=t(a).scrollLeft(),f=t(a).scrollTop(),d=c+h,p=u+f,g=n.offset();return g.top+=s,g.left-=Math.min(g.left,g.left+i>d&&d>i?Math.abs(g.left+i-d):0),g.top-=Math.min(g.top,g.top+o>p&&p>o?Math.abs(o+s-r):r),g}function l(){}function c(t){t.stopPropagation()}function u(t,e){var n=Array.prototype.slice,r=n.call(arguments,2);return function(){return t.apply(e,r.concat(n.call(arguments)))}}function h(e,n,r,i){function o(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.returnValue=!1}function s(t){if(u){if(K&&c.documentMode<9&&!t.button)return l();var r=t.originalEvent&&t.originalEvent.touches&&t.originalEvent.touches[0],i=r&&r.pageX||t.pageX,s=r&&r.pageY||t.pageY,a=Math.max(0,Math.min(i-h.left,d)),g=Math.max(0,Math.min(s-h.top,f));p&&o(t),n.apply(e,[a,g,t])}}function a(n){var i=n.which?3==n.which:2==n.button;i||u||r.apply(e,arguments)!==!1&&(u=!0,f=t(e).height(),d=t(e).width(),h=t(e).offset(),t(c).bind(g),t(c.body).addClass("sp-dragging"),s(n),o(n))}function l(){u&&(t(c).unbind(g),t(c.body).removeClass("sp-dragging"),setTimeout(function(){i.apply(e,arguments)},0)),u=!1}n=n||function(){},r=r||function(){},i=i||function(){};var c=document,u=!1,h={},f=0,d=0,p="ontouchstart"in window,g={};g.selectstart=o,g.dragstart=o,g["touchmove mousemove"]=s,g["touchend mouseup"]=l,t(e).bind("touchstart mousedown",a)}function f(t,e,n){var r;return function(){var i=this,o=arguments,s=function(){r=null,t.apply(i,o)};n&&clearTimeout(r),!n&&r||(r=setTimeout(s,e))}}function d(){return t.fn.spectrum.inputTypeColorSupport()}function p(t){var n={r:0,g:0,b:0},r=1,i=!1,o=!1;return"string"==typeof t&&(t=W(t)),"object"==("undefined"==typeof t?"undefined":e(t))&&(t.hasOwnProperty("r")&&t.hasOwnProperty("g")&&t.hasOwnProperty("b")?(n=g(t.r,t.g,t.b),i=!0,o="%"===String(t.r).substr(-1)?"prgb":"rgb"):t.hasOwnProperty("h")&&t.hasOwnProperty("s")&&t.hasOwnProperty("v")?(t.s=H(t.s),t.v=H(t.v),n=b(t.h,t.s,t.v),i=!0,o="hsv"):t.hasOwnProperty("h")&&t.hasOwnProperty("s")&&t.hasOwnProperty("l")&&(t.s=H(t.s),t.l=H(t.l),n=m(t.h,t.s,t.l),i=!0,o="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=I(r),{ok:i,format:t.format||o,r:ot(255,st(n.r,0)),g:ot(255,st(n.g,0)),b:ot(255,st(n.b,0)),a:r}}function g(t,e,n){return{r:255*R(t,255),g:255*R(e,255),b:255*R(n,255)}}function v(t,e,n){t=R(t,255),e=R(e,255),n=R(n,255);var r,i,o=st(t,e,n),s=ot(t,e,n),a=(o+s)/2;if(o==s)r=i=0;else{var l=o-s;switch(i=a>.5?l/(2-o-s):l/(o+s),o){case t:r=(e-n)/l+(e<n?6:0);break;case e:r=(n-t)/l+2;break;case n:r=(t-e)/l+4}r/=6}return{h:r,s:i,l:a}}function m(t,e,n){function r(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}var i,o,s;if(t=R(t,360),e=R(e,100),n=R(n,100),0===e)i=o=s=n;else{var a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=r(l,a,t+1/3),o=r(l,a,t),s=r(l,a,t-1/3)}return{r:255*i,g:255*o,b:255*s}}function y(t,e,n){t=R(t,255),e=R(e,255),n=R(n,255);var r,i,o=st(t,e,n),s=ot(t,e,n),a=o,l=o-s;if(i=0===o?0:l/o,o==s)r=0;else{switch(o){case t:r=(e-n)/l+(e<n?6:0);break;case e:r=(n-t)/l+2;break;case n:r=(t-e)/l+4}r/=6}return{h:r,s:i,v:a}}function b(t,e,n){t=6*R(t,360),e=R(e,100),n=R(n,100);var r=rt.floor(t),i=t-r,o=n*(1-e),s=n*(1-i*e),a=n*(1-(1-i)*e),l=r%6,c=[n,s,o,o,a,n][l],u=[a,n,n,s,o,o][l],h=[o,o,a,n,n,s][l];return{r:255*c,g:255*u,b:255*h}}function w(t,e,n,r){var i=[V(it(t).toString(16)),V(it(e).toString(16)),V(it(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function x(t,e,n,r){var i=[V(U(r)),V(it(t).toString(16)),V(it(e).toString(16)),V(it(n).toString(16))];return i.join("")}function _(t,e){e=0===e?0:e||10;var n=lt(t).toHsl();return n.s-=e/100,n.s=B(n.s),lt(n)}function C(t,e){e=0===e?0:e||10;var n=lt(t).toHsl();return n.s+=e/100,n.s=B(n.s),lt(n)}function k(t){return lt(t).desaturate(100)}function S(t,e){e=0===e?0:e||10;var n=lt(t).toHsl();return n.l+=e/100,n.l=B(n.l),lt(n)}function T(t,e){e=0===e?0:e||10;var n=lt(t).toRgb();return n.r=st(0,ot(255,n.r-it(255*-(e/100)))),n.g=st(0,ot(255,n.g-it(255*-(e/100)))),n.b=st(0,ot(255,n.b-it(255*-(e/100)))),lt(n)}function E(t,e){e=0===e?0:e||10;var n=lt(t).toHsl();return n.l-=e/100,n.l=B(n.l),lt(n)}function A(t,e){var n=lt(t).toHsl(),r=(it(n.h)+e)%360;return n.h=r<0?360+r:r,lt(n)}function O(t){var e=lt(t).toHsl();return e.h=(e.h+180)%360,lt(e)}function M(t){var e=lt(t).toHsl(),n=e.h;return[lt(t),lt({h:(n+120)%360,s:e.s,l:e.l}),lt({h:(n+240)%360,s:e.s,l:e.l})]}function L(t){var e=lt(t).toHsl(),n=e.h;return[lt(t),lt({h:(n+90)%360,s:e.s,l:e.l}),lt({h:(n+180)%360,s:e.s,l:e.l}),lt({h:(n+270)%360,s:e.s,l:e.l})]}function P(t){var e=lt(t).toHsl(),n=e.h;return[lt(t),lt({h:(n+72)%360,s:e.s,l:e.l}),lt({h:(n+216)%360,s:e.s,l:e.l})]}function j(t,e,n){e=e||6,n=n||30;var r=lt(t).toHsl(),i=360/n,o=[lt(t)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(lt(r));return o}function D(t,e){e=e||6;for(var n=lt(t).toHsv(),r=n.h,i=n.s,o=n.v,s=[],a=1/e;e--;)s.push(lt({h:r,s:i,v:o})),o=(o+a)%1;return s}function N(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}function I(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function R(t,e){z(t)&&(t="100%");var n=$(t);return t=ot(e,st(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),rt.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function B(t){return ot(1,st(0,t))}function F(t){return parseInt(t,16)}function z(t){return"string"==typeof t&&t.indexOf(".")!=-1&&1===parseFloat(t)}function $(t){return"string"==typeof t&&t.indexOf("%")!=-1}function V(t){return 1==t.length?"0"+t:""+t}function H(t){return t<=1&&(t=100*t+"%"),t}function U(t){return Math.round(255*parseFloat(t)).toString(16)}function q(t){return F(t)/255}function W(t){t=t.replace(tt,"").replace(et,"").toLowerCase();var e=!1;if(ct[t])t=ct[t],e=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=ht.rgb.exec(t))?{r:n[1],g:n[2],b:n[3]}:(n=ht.rgba.exec(t))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=ht.hsl.exec(t))?{h:n[1],s:n[2],l:n[3]}:(n=ht.hsla.exec(t))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=ht.hsv.exec(t))?{h:n[1],s:n[2],v:n[3]}:(n=ht.hsva.exec(t))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=ht.hex8.exec(t))?{a:q(n[1]),r:F(n[2]),g:F(n[3]),b:F(n[4]),format:e?"name":"hex8"}:(n=ht.hex6.exec(t))?{r:F(n[1]),g:F(n[2]),b:F(n[3]),format:e?"name":"hex"}:!!(n=ht.hex3.exec(t))&&{r:F(n[1]+""+n[1]),g:F(n[2]+""+n[2]),b:F(n[3]+""+n[3]),format:e?"name":"hex"}}var G={beforeShow:l,move:l,change:l,show:l,hide:l,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},Y=[],K=!!/msie/i.exec(window.navigator.userAgent),X=function(){function t(t,e){return!!~(""+t).indexOf(e)}var e=document.createElement("div"),n=e.style;return n.cssText="background-color:rgba(0,0,0,.5)",t(n.backgroundColor,"rgba")||t(n.backgroundColor,"hsla")}(),J=["<div class='sp-replacer'>","<div class='sp-preview'><div class='sp-preview-inner'></div></div>","<div class='sp-dd'>&#9660;</div>","</div>"].join(""),Z=function(){var t="";if(K)for(var e=1;e<=6;e++)t+="<div class='sp-"+e+"'></div>";return["<div class='sp-container sp-hidden'>","<div class='sp-palette-container'>","<div class='sp-palette sp-thumb sp-cf'></div>","<div class='sp-palette-button-container sp-cf'>","<button type='button' class='sp-palette-toggle'></button>","</div>","</div>","<div class='sp-picker-container'>","<div class='sp-top sp-cf'>","<div class='sp-fill'></div>","<div class='sp-top-inner'>","<div class='sp-color'>","<div class='sp-sat'>","<div class='sp-val'>","<div class='sp-dragger'></div>","</div>","</div>","</div>","<div class='sp-clear sp-clear-display'>","</div>","<div class='sp-hue'>","<div class='sp-slider'></div>",t,"</div>","</div>","<div class='sp-alpha'><div class='sp-alpha-inner'><div class='sp-alpha-handle'></div></div></div>","</div>","<div class='sp-input-container sp-cf'>","<input class='sp-input' type='text' spellcheck='false' />","</div>","<div class='sp-initial sp-thumb sp-cf'></div>","<div class='sp-button-container sp-cf'>","<a class='sp-cancel' href='#'></a>","<button type='button' class='sp-choose'></button>","</div>","</div>","</div>"].join("")}(),Q="spectrum.id";t.fn.spectrum=function(e,n){if("string"==typeof e){var r=this,i=Array.prototype.slice.call(arguments,1);return this.each(function(){var n=Y[t(this).data(Q)];if(n){var o=n[e];if(!o)throw new Error("Spectrum: no such method: '"+e+"'");"get"==e?r=n.get():"container"==e?r=n.container:"option"==e?r=n.option.apply(n,i):"destroy"==e?(n.destroy(),t(this).removeData(Q)):o.apply(n,i)}}),r}return this.spectrum("destroy").each(function(){var n=t.extend({},e,t(this).data()),r=s(this,n);t(this).data(Q,r.id)})},t.fn.spectrum.load=!0,t.fn.spectrum.loadOpts={},t.fn.spectrum.draggable=h,t.fn.spectrum.defaults=G,t.fn.spectrum.inputTypeColorSupport=function ft(){if("undefined"==typeof ft._cachedResult){var e=t("<input type='color'/>")[0];ft._cachedResult="color"===e.type&&""!==e.value}return ft._cachedResult},t.spectrum={},t.spectrum.localization={},t.spectrum.palettes={},t.fn.spectrum.processNativeColorInputs=function(){var e=t("input[type=color]");e.length&&!d()&&e.spectrum({preferredFormat:"hex6"})};var tt=/^[\s,#]+/,et=/\s+$/,nt=0,rt=Math,it=rt.round,ot=rt.min,st=rt.max,at=rt.random,lt=function dt(t,e){if(t=t?t:"",e=e||{},t instanceof dt)return t;if(!(this instanceof dt))return new dt(t,e);var n=p(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=it(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=it(this._r)),this._g<1&&(this._g=it(this._g)),this._b<1&&(this._b=it(this._b)),this._ok=n.ok,this._tc_id=nt++};lt.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},setAlpha:function(t){return this._a=I(t),this._roundA=it(100*this._a)/100,this},toHsv:function(){var t=y(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=y(this._r,this._g,this._b),e=it(360*t.h),n=it(100*t.s),r=it(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=v(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=v(this._r,this._g,this._b),e=it(360*t.h),n=it(100*t.s),r=it(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return w(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(){return x(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:it(this._r),g:it(this._g),b:it(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+it(this._r)+", "+it(this._g)+", "+it(this._b)+")":"rgba("+it(this._r)+", "+it(this._g)+", "+it(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:it(100*R(this._r,255))+"%",g:it(100*R(this._g,255))+"%",b:it(100*R(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+it(100*R(this._r,255))+"%, "+it(100*R(this._g,255))+"%, "+it(100*R(this._b,255))+"%)":"rgba("+it(100*R(this._r,255))+"%, "+it(100*R(this._g,255))+"%, "+it(100*R(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(ut[w(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+x(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=lt(t);n=i.toHex8String()}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0,i=!e&&r&&("hex"===t||"hex6"===t||"hex3"===t||"name"===t);return i?"name"===t&&0===this._a?this.toName():this.toRgbString():("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(S,arguments)},brighten:function(){return this._applyModification(T,arguments)},darken:function(){return this._applyModification(E,arguments)},desaturate:function(){return this._applyModification(_,arguments)},saturate:function(){return this._applyModification(C,arguments)},greyscale:function(){return this._applyModification(k,arguments)},spin:function(){return this._applyModification(A,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(j,arguments)},complement:function(){return this._applyCombination(O,arguments)},monochromatic:function(){return this._applyCombination(D,arguments)},splitcomplement:function(){return this._applyCombination(P,arguments)},triad:function(){return this._applyCombination(M,arguments)},tetrad:function(){return this._applyCombination(L,arguments)}},lt.fromRatio=function(t,n){if("object"==("undefined"==typeof t?"undefined":e(t))){var r={};for(var i in t)t.hasOwnProperty(i)&&("a"===i?r[i]=t[i]:r[i]=H(t[i]));t=r}return lt(t,n)},lt.equals=function(t,e){return!(!t||!e)&&lt(t).toRgbString()==lt(e).toRgbString()},lt.random=function(){return lt.fromRatio({r:at(),g:at(),b:at()})},lt.mix=function(t,e,n){n=0===n?0:n||50;var r,i=lt(t).toRgb(),o=lt(e).toRgb(),s=n/100,a=2*s-1,l=o.a-i.a;r=a*l==-1?a:(a+l)/(1+a*l),r=(r+1)/2;var c=1-r,u={r:o.r*r+i.r*c,g:o.g*r+i.g*c,b:o.b*r+i.b*c,a:o.a*s+i.a*(1-s)};return lt(u)},lt.readability=function(t,e){var n=lt(t),r=lt(e),i=n.toRgb(),o=r.toRgb(),s=n.getBrightness(),a=r.getBrightness(),l=Math.max(i.r,o.r)-Math.min(i.r,o.r)+Math.max(i.g,o.g)-Math.min(i.g,o.g)+Math.max(i.b,o.b)-Math.min(i.b,o.b);return{brightness:Math.abs(s-a),color:l}},lt.isReadable=function(t,e){var n=lt.readability(t,e);return n.brightness>125&&n.color>500},lt.mostReadable=function(t,e){for(var n=null,r=0,i=!1,o=0;o<e.length;o++){var s=lt.readability(t,e[o]),a=s.brightness>125&&s.color>500,l=3*(s.brightness/125)+s.color/500;(a&&!i||a&&i&&l>r||!a&&!i&&l>r)&&(i=a,r=l,n=lt(e[o]))}return n};var ct=lt.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"},ut=lt.hexNames=N(ct),ht=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",n="(?:"+e+")|(?:"+t+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",i="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+i),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=lt,t(function(){t.fn.spectrum.load&&t.fn.spectrum.processNativeColorInputs()})})}).call(e,n(0))},function(t,e,n){"use strict";var r=n(0),i=n(124);t.exports=r.View.extend({initialize:function(t){this.config=t.config||{},this.stackModel=t.stackModel,this.preview=t.preview,this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.propsConfig=t.propsConfig;var e=this.pfx,n=this.ppfx,r=this.collection;this.className=e+"layers "+n+"field",this.listenTo(r,"add",this.addTo),this.listenTo(r,"deselectAll",this.deselectAll),this.listenTo(r,"reset",this.render);var i=this.config.em||"",o=i?i.get("Utils"):"";this.sorter=o?new o.Sorter({container:this.el,ignoreViewChildren:1,containerSel:"."+e+"layers",itemSel:"."+e+"layer",pfx:this.config.pStylePrefix}):"",r.view=this,this.$el.data("model",r),this.$el.data("collection",r)},addTo:function(t){var e=this.collection.indexOf(t);this.addToCollection(t,null,e)},addToCollection:function(t,e,n){var r=e||null,o=this.stackModel,s=this.config,a=this.sorter,l=this.propsConfig;"undefined"!=typeof this.preview&&t.set("preview",this.preview);var c=new i({model:t,config:s,sorter:a,stackModel:o,propsConfig:l}),u=c.render().el;if(r)r.appendChild(u);else if("undefined"!=typeof n){var h="before";this.$el.children().length==n&&(n--,h="after"),n<0?this.$el.append(u):this.$el.children().eq(n)[h](u)}else this.$el.append(u);return u},deselectAll:function(){this.$el.find("."+this.pfx+"layer").removeClass(this.pfx+"active")},render:function(){var t=document.createDocumentFragment();return this.$el.empty(),this.collection.each(function(e){this.addToCollection(e,t)},this),this.$el.append(t),this.$el.attr("class",this.className),this.sorter&&(this.sorter.plh=null),this}})},function(t,e,n){"use strict";(function(e){t.exports=e.View.extend({events:{click:"active","click [data-close-layer]":"remove","mousedown [data-move-layer]":"initSorter"},template:function(t){var e=this.pfx,n="Layer "+t.get("index");return'\n <div id="'+e+'move" data-move-layer>\n <i class="fa fa-arrows"></i>\n </div>\n <div id="'+e+'label">'+n+'</div>\n <div id="'+e+'preview-box">\n \t<div id="'+e+'preview" data-preview></div>\n </div>\n <div id="'+e+'close-layer" class="'+e+'btn-close" data-close-layer>\n &Cross;\n </div>\n <div id="'+e+'inputs" data-properties></div>\n <div style="clear:both"></div>\n '},initialize:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.model;this.stackModel=t.stackModel||{},this.config=t.config||{},this.pfx=this.config.stylePrefix||"",this.sorter=t.sorter||null,this.propsConfig=t.propsConfig||{},this.customPreview=t.onPreview,this.listenTo(e,"destroy remove",this.remove),this.listenTo(e,"change:active",this.updateVisibility),this.listenTo(e.get("properties"),"change",this.updatePreview),e.get("preview")||this.$el.addClass(this.pfx+"no-preview"),e.view=this,e.set({droppable:0,draggable:1}),this.$el.data("model",e)},initSorter:function(t){this.sorter&&this.sorter.startSort(this.el)},remove:function(t){t&&t.stopPropagation&&t.stopPropagation();var n=this.model,r=n.collection,i=this.stackModel;e.View.prototype.remove.apply(this,arguments),r.contains(n)&&r.remove(n),i&&i.set&&(i.set({stackIndex:null},{silent:!0}),i.trigger("updateValue"))},onPreview:function(t){var e=t.split(" "),n=3,r=[];return this.model.get("properties").each(function(t,i){var o=e[i]||"";if(o&&"integer"==t.get("type")){var s=parseInt(o,10),a=o.replace(s,"");s=isNaN(s)?0:s,s=s>n?n:s,s=s<-n?-n:s,o=s+a}r.push(o)}),r.join(" ")},updatePreview:function(){var t=this.stackModel,e=this.customPreview,n=this.getPreviewEl(),r=this.model.getFullValue(),i=e?e(r):this.onPreview(r);i&&t&&n&&(n.style[t.get("property")]=i)},getPropertiesWrapper:function(){return this.propsWrapEl||(this.propsWrapEl=this.el.querySelector("[data-properties]")),this.propsWrapEl},getPreviewEl:function(){return this.previewEl||(this.previewEl=this.el.querySelector("[data-preview]")),this.previewEl},active:function(){var t=this.model,e=t.collection;e.active(e.indexOf(t))},updateVisibility:function(){var t=this.pfx,e=this.getPropertiesWrapper(),n=this.model.get("active");e.style.display=n?"":"none",this.$el[n?"addClass":"removeClass"](t+"active")},render:function(){var t=n(13),e=this.propsConfig,r=this.pfx+"layer",i=this.model,o=this.el,s=new t({collection:i.get("properties"),config:this.config,target:e.target,customValue:e.customValue,propTarget:e.propTarget,onChange:e.onChange}).render().el;return o.innerHTML=this.template(i),o.className=r,this.getPropertiesWrapper().appendChild(s),this.updateVisibility(),this.updatePreview(),this}})}).call(e,n(0))},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(42);t.exports=i.extend({defaults:r({},i.prototype.defaults,{showInput:1})})},function(t,e,n){"use strict";var r=n(14);t.exports=r.extend({events:{"change [type=range]":"inputValueChanged","input [type=range]":"inputValueChangedSoft"},templateInput:function(t){var e=this.ppfx;return'\n <div class="'+e+"field "+e+'field-range">\n <input type="range"\n min="'+t.get("min")+'"\n max="'+t.get("max")+'"\n step="'+t.get("step")+'"/>\n </div>\n '},getSliderEl:function(){return this.slider||(this.slider=this.el.querySelector("input[type=range]")),this.slider},inputValueChanged:function(){var t=this.model,e=t.get("step");this.getInputEl().value=this.getSliderEl().value;var n=this.getInputValue()-e;t.set("value",n,{avoidStore:1}).set("value",n+e),this.elementUpdated()},inputValueChangedSoft:function(){this.getInputEl().value=this.getSliderEl().value,this.model.set("value",this.getInputValue(),{avoidStore:1}),this.elementUpdated()},setValue:function(t){this.getSliderEl().value=t,this.inputInst.setValue(t,{silent:1})},onRender:function(){r.prototype.onRender.apply(this,arguments),this.model.get("showInput")||(this.inputInst.el.style.display="none")}})},function(t,e,n){"use strict";n(0);t.exports=function(){return{build:function(t){var e=[];"string"==typeof t&&(t=[t]);for(var n=0,r=t.length;n<r;n++){var i={},o=t[n];switch(i.property=o,o){case"border-radius-c":i.property="border-radius"}switch(o){case"margin-top":case"margin-right":case"margin-bottom":case"margin-left":case"padding-top":case"padding-right":case"padding-bottom":case"padding-left":case"width":case"max-width":case"min-width":case"height":case"max-height":case"min-height":i.fixedValues=["initial","inherit","auto"];break;case"font-size":i.fixedValues=["medium","xx-small","x-small","small","large","x-large","xx-large","smaller","larger","length","initial","inherit"];break;case"letter-spacing":case"line-height":i.fixedValues=["normal","initial","inherit"]}switch(o){case"float":case"position":case"text-align":i.type="radio";break;case"display":case"font-family":case"font-weight":case"border-style":case"box-shadow-type":case"background-repeat":case"background-position":case"background-attachment":case"background-size":case"transition-property":case"transition-timing-function":case"cursor":case"overflow":i.type="select";break;case"top":case"right":case"bottom":case"left":case"margin-top":case"margin-right":case"margin-bottom":case"margin-left":case"padding-top":case"padding-right":case"padding-bottom":case"padding-left":case"min-height":case"min-width":case"max-height":case"max-width":case"width":case"height":case"font-size":case"letter-spacing":case"line-height":case"text-shadow-h":case"text-shadow-v":case"text-shadow-blur":case"border-radius-c":case"border-top-left-radius":case"border-top-right-radius":case"border-bottom-left-radius":case"border-bottom-right-radius":case"border-width":case"box-shadow-h":case"box-shadow-v":case"box-shadow-blur":case"box-shadow-spread":case"transition-duration":case"perspective":case"transform-rotate-x":case"transform-rotate-y":case"transform-rotate-z":case"transform-scale-x":case"transform-scale-y":case"transform-scale-z":i.type="integer";break;case"margin":case"padding":case"border-radius":case"border":case"transform":i.type="composite";break;case"color":case"text-shadow-color":case"background-color":case"border-color":case"box-shadow-color":i.type="color";break;case"text-shadow":case"box-shadow":case"background":case"transition":i.type="stack";break;case"background-image":i.type="file"}switch(o){case"float":case"background-color":case"background-image":case"text-shadow":i.defaults="none";break;case"display":i.defaults="block";break;case"position":i.defaults="static";break;case"top":case"right":case"bottom":case"left":case"margin-top":case"margin-right":case"margin-bottom":case"margin-left":case"padding-top":case"padding-right":case"padding-bottom":case"padding-left":case"text-shadow-h":case"text-shadow-v":case"text-shadow-blur":case"border-radius-c":case"border-top-left-radius":case"border-top-right-radius":case"border-bottom-left-radius":case"border-bottom-right-radius":case"box-shadow-h":case"box-shadow-v":case"box-shadow-spread":case"perspective":case"transform-rotate-x":case"transform-rotate-y":case"transform-rotate-z":i.defaults=0;break;case"transform-scale-x":case"transform-scale-y":case"transform-scale-z":i.defaults=1;break;case"box-shadow-blur":i.defaults="5px";break;case"min-height":case"min-width":case"max-height":case"max-width":case"width":case"height":case"background-size":case"cursor":i.defaults="auto";break;case"font-family":i.defaults="Arial, Helvetica, sans-serif";break;case"font-size":case"border-width":i.defaults="medium";break;case"font-weight":i.defaults="400";break;case"letter-spacing":case"line-height":i.defaults="normal";break;case"color":case"text-shadow-color":case"border-color":case"box-shadow-color":i.defaults="black";break;case"text-align":i.defaults="left";break;case"border-style":i.defaults="solid";break;case"box-shadow-type":i.defaults="";break;case"background-repeat":i.defaults="repeat";break;case"background-position":i.defaults="left top";break;case"background-attachment":i.defaults="scroll";break;case"transition-property":i.defaults="width";break;case"transition-duration":i.defaults="2";
break;case"transition-timing-function":i.defaults="ease";break;case"overflow":i.defaults="visible"}switch(o){case"top":case"right":case"bottom":case"left":case"margin-top":case"margin-right":case"margin-bottom":case"margin-left":case"padding-top":case"padding-right":case"padding-bottom":case"padding-left":case"min-height":case"min-width":case"max-height":case"max-width":case"width":case"height":case"text-shadow-h":case"text-shadow-v":case"text-shadow-blur":case"border-radius-c":case"border-top-left-radius":case"border-top-right-radius":case"border-bottom-left-radius":case"border-bottom-right-radius":case"box-shadow-h":case"box-shadow-v":i.units=["px","%"];break;case"font-size":case"letter-spacing":case"line-height":i.units=["px","em","rem","%"];break;case"border-width":i.units=["px","em"];break;case"box-shadow-blur":case"box-shadow-spread":case"perspective":i.units=["px"];break;case"transition-duration":i.units=["s"];break;case"transform-rotate-x":case"transform-rotate-y":case"transform-rotate-z":i.units=["deg"]}switch(o){case"padding-top":case"padding-right":case"padding-bottom":case"padding-left":case"min-height":case"min-width":case"max-height":case"max-width":case"width":case"height":case"font-size":case"text-shadow-blur":case"border-radius-c":case"border-top-left-radius":case"border-top-right-radius":case"border-bottom-left-radius":case"border-bottom-right-radius":case"border-width":case"box-shadow-blur":case"transition-duration":case"perspective":i.min=0}switch(o){case"text-shadow":case"box-shadow":case"background":i.preview=!0}switch(o){case"background":i.detached=!0}switch(o){case"transform-rotate-x":i.functionName="rotateX";break;case"transform-rotate-y":i.functionName="rotateY";break;case"transform-rotate-z":i.functionName="rotateZ";break;case"transform-scale-x":i.functionName="scaleX";break;case"transform-scale-y":i.functionName="scaleY";break;case"transform-scale-z":i.functionName="scaleZ";break;case"background-image":i.functionName="url"}switch(o){case"float":i.list=[{value:"none"},{value:"left"},{value:"right"}];break;case"display":i.list=[{value:"block"},{value:"inline"},{value:"inline-block"},{value:"none"}];break;case"position":i.list=[{value:"static"},{value:"relative"},{value:"absolute"},{value:"fixed"}];break;case"font-family":var s=", sans-serif",a=["Arial, Helvetica"+s,"Arial Black, Gadget"+s,"Brush Script MT"+s,"Comic Sans MS, cursive"+s,"Courier New, Courier, monospace","Georgia, serif","Helvetica, serif","Impact, Charcoal"+s,"Lucida Sans Unicode, Lucida Grande"+s,"Tahoma, Geneva"+s,"Times New Roman, Times, serif","Trebuchet MS, Helvetica"+s,"Verdana, Geneva"+s];i.list=[];for(var l=0,c=a.length;l<c;l++){var u={};u.value=a[l],u.name=a[l].split(",")[0],i.list.push(u)}break;case"font-weight":i.list=[{value:"100",name:"Thin"},{value:"200",name:"Extra-Light"},{value:"300",name:"Light"},{value:"400",name:"Normal"},{value:"500",name:"Medium"},{value:"600",name:"Semi-Bold"},{value:"700",name:"Bold"},{value:"800",name:"Extra-Bold"},{value:"900",name:"Ultra-Bold"}];break;case"text-align":i.list=[{value:"left"},{value:"center"},{value:"right"},{value:"justify"}];break;case"border-style":i.list=[{value:"none"},{value:"solid"},{value:"dotted"},{value:"dashed"},{value:"double"},{value:"groove"},{value:"ridge"},{value:"inset"},{value:"outset"}];break;case"box-shadow-type":i.list=[{value:"",name:"Outside"},{value:"inset",name:"Inside"}];break;case"background-repeat":i.list=[{value:"repeat"},{value:"repeat-x"},{value:"repeat-y"},{value:"no-repeat"}];break;case"background-position":i.list=[{value:"left top"},{value:"left center"},{value:"left bottom"},{value:"right top"},{value:"right center"},{value:"right bottom"},{value:"center top"},{value:"center center"},{value:"center bottom"}];break;case"background-attachment":i.list=[{value:"scroll"},{value:"fixed"},{value:"local"}];break;case"background-size":i.list=[{value:"auto"},{value:"cover"},{value:"contain"}];break;case"transition-property":i.list=[{value:"all"},{value:"width"},{value:"height"},{value:"background-color"},{value:"transform"},{value:"box-shadow"},{value:"opacity"}];break;case"transition-timing-function":i.list=[{value:"linear"},{value:"ease"},{value:"ease-in"},{value:"ease-out"},{value:"ease-in-out"}];break;case"cursor":i.list=[{value:"auto"},{value:"pointer"},{value:"copy"},{value:"crosshair"},{value:"grab"},{value:"grabbing"},{value:"help"},{value:"move"},{value:"text"}];break;case"overflow":i.list=[{value:"visible"},{value:"hidden"},{value:"scroll"},{value:"auto"}]}switch(o){case"margin":i.properties=this.build(["margin-top","margin-right","margin-bottom","margin-left"]);break;case"padding":i.properties=this.build(["padding-top","padding-right","padding-bottom","padding-left"]);break;case"text-shadow":i.properties=this.build(["text-shadow-h","text-shadow-v","text-shadow-blur","text-shadow-color"]);break;case"border":i.properties=this.build(["border-width","border-style","border-color"]);break;case"border-radius":i.properties=this.build(["border-top-left-radius","border-top-right-radius","border-bottom-left-radius","border-bottom-right-radius"]);break;case"box-shadow":i.properties=this.build(["box-shadow-h","box-shadow-v","box-shadow-blur","box-shadow-spread","box-shadow-color","box-shadow-type"]);break;case"background":i.properties=this.build(["background-image","background-repeat","background-position","background-attachment","background-size"]);break;case"transition":i.properties=this.build(["transition-property","transition-duration","transition-timing-function"]);break;case"transform":i.properties=this.build(["transform-rotate-x","transform-rotate-y","transform-rotate-z","transform-scale-x","transform-scale-y","transform-scale-z"])}e.push(i)}return e}}}},function(t,e,n){"use strict";(function(e){var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(1),o=n(129);t.exports=e.View.extend({initialize:function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix||"",this.target=t.target||{};var n={};(0,i.extend)(n,e.Events);var o=document.body,s=document.createElement("el-"+(new Date).getTime());o.appendChild(s),n.computedDefault=r({},window.getComputedStyle(s)),o.removeChild(s),this.propTarget=n;var a=this.collection,l="change:selectedComponent component:update:classes component:update:state change:device";this.listenTo(a,"add",this.addTo),this.listenTo(a,"reset",this.render),this.listenTo(this.target,l,this.targetUpdated)},addTo:function(t){this.addToCollection(t)},targetUpdated:function(){var t=this.target,e=this.propTarget,n=t.getSelected();if(n){var r=t.get("Config"),i=r.devicePreviewMode?"":n.get("state"),o=n.getEl();if(e.helper=null,o){var s=i?":"+i:null;e.computed=window.getComputedStyle(o,s)}var a=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.get("CssComposer"),i="hc-state",o=r.getAll(),s=r.getClassRule(i);s?(o.remove(s),o.add(s)):s=r.setClassRule(i),s.set("important",1),s.setStyle(n),e.helper=s};n=t.get("StyleManager").getModelToStyle(n),i&&a(n.getStyle()),e.model=n,e.trigger("update")}},addToCollection:function(t,e){var n=e||null,r=new o({model:t,id:this.pfx+t.get("name").replace(" ","_").toLowerCase(),name:t.get("name"),properties:t.get("properties"),target:this.target,propTarget:this.propTarget,config:this.config}),i=r.render().el;return n?n.appendChild(i):this.$el.append(i),i},render:function(){var t=document.createDocumentFragment();return this.$el.empty(),this.collection.each(function(e){this.addToCollection(e,t)},this),this.$el.attr("id",this.pfx+"sectors"),this.$el.append(t),this}})}).call(e,n(0))},function(t,e,n){"use strict";(function(e){var r=n(0),i=n(13);t.exports=r.View.extend({template:e.template('\n <div class="<%= pfx %>title" data-sector-title>\n <i id="<%= pfx %>caret" class="fa"></i>\n <%= label %>\n </div>'),events:{"click [data-sector-title]":"toggle"},initialize:function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix||"",this.target=t.target||{},this.propTarget=t.propTarget||{},this.caretR="fa-caret-right",this.caretD="fa-caret-down";var e=this.model;this.listenTo(e,"change:open",this.updateOpen),this.listenTo(e,"updateVisibility",this.updateVisibility),this.listenTo(e,"destroy remove",this.remove)},updateVisibility:function(){var t;this.model.get("properties").each(function(e){e.get("visible")&&(t=1)}),this.el.style.display=t?"block":"none"},updateOpen:function(){this.model.get("open")?this.show():this.hide()},show:function(){this.$el.addClass(this.pfx+"open"),this.getPropertiesEl().style.display="",this.$caret.removeClass(this.caretR).addClass(this.caretD)},hide:function(){this.$el.removeClass(this.pfx+"open"),this.getPropertiesEl().style.display="none",this.$caret.removeClass(this.caretD).addClass(this.caretR)},getPropertiesEl:function(){return this.$el.find("."+this.pfx+"properties").get(0)},toggle:function(t){var e=this.model.get("open")?0:1;this.model.set("open",e)},render:function(){return this.$el.html(this.template({pfx:this.pfx,label:this.model.get("name")})),this.$caret=this.$el.find("#"+this.pfx+"caret"),this.renderProperties(),this.$el.attr("class",this.pfx+"sector no-select"),this.updateOpen(),this},renderProperties:function(){var t=this.model.get("properties");if(t){var e=new i({collection:t,target:this.target,propTarget:this.propTarget,config:this.config});this.$el.append(e.render().el)}}})}).call(e,n(1))},function(t,e,n){"use strict";t.exports=function(){var t={},e=n(131),r=n(132),i=n(135),o=n(45),s=void 0,a=void 0,l=void 0;return{name:"AssetManager",storageKey:"assets",getConfig:function(){return t},init:function(n){var c=this;t=n||{};for(var u in e)u in t||(t[u]=e[u]);var h=t.pStylePrefix,f=t.em;h&&(t.stylePrefix=h+t.stylePrefix),s=new r([]);var d={collection:new r([]),globalCollection:s,config:t};return l=new o(d),d.fu=l,a=new i(d),s.listenTo(s,"add",function(t){c.getAllVisible().add(t),f&&f.trigger("asset:add",t)}),s.listenTo(s,"remove",function(t){c.getAllVisible().remove(t),f&&f.trigger("asset:remove",t)}),this},add:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"undefined"==typeof e.at&&(e.at=0),s.add(t,e)},get:function(t){return s.where({src:t})[0]},getAll:function(){return s},getAllVisible:function(){return a.collection},remove:function(t){var e=this.get(t);return this.getAll().remove(e),this},store:function(e){var n={},r=JSON.stringify(this.getAll().toJSON());return n[this.storageKey]=r,!e&&t.stm&&t.stm.store(n),n},load:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.storageKey,n=t[e]||[];if("string"==typeof n)try{n=JSON.parse(t[e])}catch(r){}return n&&n.length&&this.getAll().reset(n),n},getContainer:function(){return a.el},getAssetsEl:function(){return a.el.querySelector("[data-el=assets]")},render:function(t){var e=t||this.getAll().models;return a.rendered||a.render(),a.collection.reset(e),this.getContainer()},addType:function(t,e){this.getAll().addType(t,e)},getType:function(t){return this.getAll().getType(t)},getTypes:function(){return this.getAll().getTypes()},AssetsView:function(){return a},FileUploader:function(){return l},onLoad:function(){this.getAll().reset(t.assets)},postRender:function(e){t.dropzone&&l.initDropzone(e)},setTarget:function(t){a.collection.target=t},onSelect:function(t){a.collection.onSelect=t},onClick:function(e){t.onClick=e},onDblClick:function(e){t.onDblClick=e}}}},function(t,e,n){"use strict";t.exports={assets:[],noAssets:"",stylePrefix:"am-",upload:0,uploadName:"files",headers:{},params:{},autoAdd:1,uploadText:"Drop files here or click to upload",addBtnText:"Add image",uploadFile:"",handleAdd:"",dropzone:0,openAssetsOnDrop:1,dropzoneContent:"",modalTitle:"Select Image",inputPlaceholder:"http://path/to/the/image.jpg"}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}var i=n(32),o=r(i);t.exports=n(0).Collection.extend(o["default"]).extend({types:[{id:"image",model:n(133),view:n(43),isType:function(t){return"string"==typeof t?{type:"image",src:t}:t}}]})},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(134);t.exports=i.extend({defaults:r({},i.prototype.defaults,{type:"image",unitDim:"px",height:0,width:0})})},function(t,e,n){"use strict";t.exports=n(0).Model.extend({idAttribute:"src",defaults:{type:"",src:""},getFilename:function(){return this.get("src").split("/").pop()},getExtension:function(){return this.getFilename().split(".").pop()}})},function(t,e,n){"use strict";(function(e){n(44),n(43),n(45);t.exports=e.View.extend({events:{submit:"handleSubmit"},template:function(t){var e=t.pfx,n=t.ppfx;return'\n <div class="'+e+'assets-cont">\n <div class="'+e+'assets-header">\n <form class="'+e+'add-asset">\n <div class="'+n+"field "+e+'add-field">\n <input placeholder="'+t.config.inputPlaceholder+'"/>\n </div>\n <button class="'+n+'btn-prim">'+t.config.addBtnText+'</button>\n <div style="clear:both"></div>\n </form>\n <div class="'+e+'dips" style="display:none">\n <button class="fa fa-th <%'+n+'btnt"></button>\n <button class="fa fa-th-list <%'+n+'btnt"></button>\n </div>\n </div>\n <div class="'+e+'assets" data-el="assets"></div>\n <div style="clear:both"></div>\n </div>\n '},initialize:function(t){this.options=t,this.config=t.config,this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"";var e=this.collection;this.listenTo(e,"reset",this.renderAssets),this.listenTo(e,"add",this.addToAsset),this.listenTo(e,"remove",this.removedAsset),this.listenTo(e,"deselectAll",this.deselectAll)},handleSubmit:function(t){t.preventDefault();var e=this.getAddInput(),n=e.value.trim(),r=this.config.handleAdd;n&&(e.value="",this.getAssetsEl().scrollTop=0,r?r(n):this.options.globalCollection.add(n,{at:0}))},getAssetsEl:function(){return this.el.querySelector("."+this.pfx+"assets")},getAddInput:function(){return this.inputUrl&&this.inputUrl.value||(this.inputUrl=this.el.querySelector("."+this.pfx+"add-asset input")),this.inputUrl},removedAsset:function(t){this.collection.length||this.toggleNoAssets()},addToAsset:function(t){1==this.collection.length&&this.toggleNoAssets(1),this.addAsset(t)},addAsset:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e,r=this.collection,i=this.config,o=new t.typeView({model:t,collection:r,config:i}).render().el;if(n)n.appendChild(o);else{var s=this.getAssetsEl();s&&s.insertBefore(o,s.firstChild)}return o},toggleNoAssets:function(t){var e=this.$el.find("."+this.pfx+"assets");if(t)e.empty();else{var n=this.config.noAssets;n&&e.append(n)}},deselectAll:function(){var t=this.pfx;this.$el.find("."+t+"highlight").removeClass(t+"highlight")},renderAssets:function(){var t=this,e=document.createDocumentFragment(),n=this.$el.find("."+this.pfx+"assets");n.empty(),this.toggleNoAssets(this.collection.length),this.collection.each(function(n){return t.addAsset(n,e)}),n.append(e)},render:function(){var t=this.options.fu.render().el;return this.$el.empty(),this.$el.append(t).append(this.template(this)),this.el.className=this.ppfx+"asset-manager",this.renderAssets(),this.rendered=1,this}})}).call(e,n(0))},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};t.exports=function(){var t,e,i=void 0,o={},s=n(137),a=n(46),l=n(138),c=n(139),u=n(10),h=n(7);return{Selectors:u,name:"CssComposer",storageKey:function(){var t=[],e=o.stm&&o.stm.getConfig()||{};return e.storeCss&&t.push("css"),e.storeStyles&&t.push("styles"),t},init:function(n){o=n||{};for(var r in s)r in o||(o[r]=s[r]);var a=o.pStylePrefix;a&&(o.stylePrefix=a+o.stylePrefix);var u=o.em&&o.em.config.style||"";return o.rules=u||o.rules,i=o.em,t=new l([],o),e=new c({collection:t,config:o}),this},onLoad:function(){t.add(o.rules)},postLoad:function(t){var e=this,n="add remove",r=this.getAll();t.stopListening(r,n,this.handleChange),t.listenTo(r,n,this.handleChange),r.each(function(t){return e.handleChange(t)})},handleChange:function(t){var e="change:style",n=i.get("UndoManager");n&&n.add(t);var r=i.handleUpdates.bind(i);i.stopListening(t,e,r),i.listenTo(t,e,r)},load:function(e){var n=e||"";!n&&o.stm&&(n=o.em.getCacheLoad());var r=n.styles||"";if(n.styles)try{r=JSON.parse(n.styles)}catch(i){}else n.css&&(r=o.em.get("Parser").parseCss(n.css));return r&&t.reset(r),r},store:function(e){if(o.stm){var n={},r=this.storageKey();return r.indexOf("css")>=0&&(n.css=o.em.getCss()),r.indexOf("styles")>=0&&(n.styles=JSON.stringify(t)),e||o.stm.store(n),n}},add:function(e,n,r,i){var s=n||"",l=r||"",c=i||{},u=this.get(e,s,l,c);return u?u:(c.state=s,c.mediaText=l,c.selectors="",u=new a(c,o),u.get("selectors").add(e),t.add(u),u)},get:function(e,n,r,i){var o=null;return t.each(function(t){o||t.compare(e,n,r,i)&&(o=t)}),o},getAll:function(){return t},clear:function(){return this.getAll().reset(),this},addCollection:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],i=t instanceof Array?t:[t],s=0,a=i.length;s<a;s++){var l=i[s]||{};if(l.selectors){for(var c=o.em&&o.em.get("SelectorManager"),u=l.selectors,h=u instanceof Array?u:[u],f=[],d=0,p=h.length;d<p;d++){var g=c.add(h[d]);f.push(g)}var v=this.get(f,l.state,l.mediaText,l),m=this.add(f,l.state,l.mediaText,l),y=!v||!e.avoidUpdateStyle,b=l.style||{};if(y){var w=e.extend?r({},m.get("style"),b):b;m.set("style",w)}n.push(m)}}return n},setIdRule:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.state||"",o=n.mediaText||i.getCurrentMedia(),s=i.get("SelectorManager"),a=s.add({name:t,type:h.TYPE_ID}),l=this.add(a,r,o);return l.setStyle(e,n),l},getIdRule:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.state||"",r=e.mediaText||i.getCurrentMedia(),o=i.get("SelectorManager").get(t,h.TYPE_ID);return o&&this.get(o,n,r)},setClassRule:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.state||"",o=n.mediaText||i.getCurrentMedia(),s=i.get("SelectorManager"),a=s.add({name:t,type:h.TYPE_CLASS}),l=this.add(a,r,o);return l.setStyle(e,n),l},getClassRule:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.state||"",r=e.mediaText||i.getCurrentMedia(),o=i.get("SelectorManager").get(t,h.TYPE_CLASS);return o&&this.get(o,n,r)},render:function(){return e.render().el}}}},function(t,e,n){"use strict";t.exports={stylePrefix:"css-",staticRules:"",rules:[]}},function(t,e,n){"use strict";var r=n(0),i=n(46);t.exports=r.Collection.extend({initialize:function(t,e){e&&e.em&&(this.editor=e.em),this.model=function(t,n){var r;return!n.em&&e&&e.em&&(n.em=e.em),r=new i(t,n)}},add:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=this.editor.get("Parser").parseCss(t)),e.em=this.editor,r.Collection.prototype.add.apply(this,[t,e])}})},function(t,e,n){"use strict";var r=n(48),i=n(140);t.exports=n(0).View.extend({initialize:function(t){var e=t.config||{};this.atRules={},this.config=e,this.em=e.em,this.pfx=e.stylePrefix||"",this.className=this.pfx+"rules";var n=this.collection;this.listenTo(n,"add",this.addTo),this.listenTo(n,"reset",this.render)},addTo:function(t){this.addToCollection(t)},addToCollection:function(t,e){var n=e||null,o=this.config,s=void 0,a=void 0,l={model:t,config:o};if("keyframes"==t.get("atRuleType")){var c=t.getAtRule(),u=this.atRules[c];if(!u){var h=document.createElement("style");u=document.createTextNode(""),h.appendChild(document.createTextNode(c+"{")),h.appendChild(u),h.appendChild(document.createTextNode("}")),this.atRules[c]=u,s=h}a=new i(l),u.appendData(a.render().el.textContent)}else a=new r(l),s=a.render().el;return s&&(n?n.appendChild(s):this.$el.append(s)),s},render:function(){var t=this;this.atRules={};var e=this.$el,n=document.createDocumentFragment();return e.empty(),this.collection.each(function(e){return t.addToCollection(e,n)}),e.append(n),e.attr("class",this.className),this}})},function(t,e,n){"use strict";t.exports=n(48).extend({_createElement:function(t){return document.createTextNode("")},render:function(){var t=this.model,e=t.get("important");return this.el.textContent=t.getDeclaration({important:e}),this}})},function(t,e,n){"use strict";var r=n(1);t.exports=function(){var t={},e=n(142),i=n(143),o=void 0;return{TraitsView:i,name:"TraitManager",getConfig:function(){return t},init:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=n,(0,r.defaults)(t,e);var s=t.pStylePrefix;return s&&(t.stylePrefix=""+s+t.stylePrefix),o=new i({collection:[],editor:t.em,config:t}),this},getTraitsViewer:function(){return o},addType:function(t,e){var n=o.itemView;o.itemsView[t]=n.extend(e)},getType:function(t){return o.itemsView[t]}}}},function(t,e,n){"use strict";t.exports={stylePrefix:"trt-",labelContainer:"Component settings",labelPlhText:"eg. Text here",labelPlhHref:"eg. https://google.com",optionsTarget:[{value:"",name:"This window"},{value:"_blank",name:"New window"}]}},function(t,e,n){"use strict";var r=n(49),i=n(8),o=n(144),s=n(145),a=n(146),l=n(147);t.exports=r.extend({itemView:i,itemsView:{text:i,number:a,select:o,checkbox:s,color:l},initialize:function(t){this.config=t.config||{},this.em=t.editor,this.pfx=this.config.stylePrefix||"",this.className=this.pfx+"traits",this.listenTo(this.em,"change:selectedComponent",this.updatedCollection),this.updatedCollection()},updatedCollection:function(){this.el.className=this.className;var t=this.em.get("selectedComponent");t&&(this.collection=t.get("traits"),this.render())}})},function(t,e,n){"use strict";(function(e,r){var i=n(8),o=e.$;t.exports=i.extend({initialize:function(t){i.prototype.initialize.apply(this,arguments);var e=this.ppfx;this.tmpl='<div class="'+this.fieldClass+'"><div class="'+this.inputhClass+'"></div><div class="'+e+'sel-arrow"><div class="'+e+'d-s-arrow"></div></div> </div>'},getInputEl:function(){if(!this.$input){var t=this.model,e=t.get("options")||[],n="<select>";e.length&&r.each(e,function(t){var e,r,i,o="";"string"==typeof t?(e=t,r=t):(e=t.name?t.name:t.value,r=t.value.replace(/"/g,"&quot;"),i=t.style?t.style.replace(/"/g,"&quot;"):"",o+=i?'style="'+i+'"':""),n+='<option value="'+r+'" '+o+">"+e+"</option>"}),n+="</select>",this.input=n,this.$input=o(this.input);var i=this.target,s=t.get("name"),a=t.get("value");if(t.get("changeProp"))a=a||i.get(s);else{var l=i.get("attributes");a=l[s]}a&&this.$input.val(a)}return this.$input.get(0)}})}).call(e,n(0),n(1))},function(t,e,n){"use strict";var r=n(8);t.exports=r.extend({initialize:function(t){r.prototype.initialize.apply(this,arguments);var e=this.ppfx+"chk-icon";this.tmpl='<div class="'+this.fieldClass+'"><label class="'+this.inputhClass+'"><i class="'+e+'"></i></label></div>'},onChange:function(){this.model.set("value",this.getInputEl().checked)},getInputEl:function(){var t;this.$input||(t=1);for(var e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];var o=r.prototype.getInputEl.apply(this,n);if(t){var s=this.model,a=s.get("name"),l=this.target;if(s.get("changeProp"))o.checked=l.get(a);else{var c=l.get("attributes");o.checked=!!c[a]}}return o}})},function(t,e,n){"use strict";var r=n(8),i=n(18);t.exports=r.extend({getValueForTarget:function(){var t=this.model,e=t.get("value"),n=t.get("unit");return e?e+n:""},getInputEl:function(){if(!this.$input){var t=this.getModelValue(),e=new i({contClass:this.ppfx+"field-int",model:this.model,ppfx:this.ppfx});this.input=e.render(),this.$input=this.input.inputEl,this.$unit=this.input.unitEl,this.model.set("value",t),this.$input.val(t)}return this.$input.get(0)},renderField:function(){this.$input||(this.$el.append(this.tmpl),this.getInputEl(),this.$el.find("."+this.inputhClass).prepend(this.input.el))}})},function(t,e,n){"use strict";var r=n(8),i=n(39);t.exports=r.extend({getInputEl:function(){if(!this.$input){var t=this.getModelValue(),e=new i({target:this.config.em,contClass:this.ppfx+"field-color",model:this.model,ppfx:this.ppfx});this.input=e.render(),this.$input=this.input.colorEl,t=t||"",this.model.set("value",t).trigger("change:value"),this.input.setValue(t)}return this.$input.get(0)},renderField:function(){this.$input||(this.getInputEl(),this.$el.append(this.input.el))}})},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};t.exports=function(){var t,e,i={},o=void 0,s=n(149),a=n(4),l=n(3),c=n(50),u=n(51),h=[{id:"cell",model:n(153),view:n(154)},{id:"row",model:n(155),view:n(156)},{id:"table",model:n(157),view:n(158)},{id:"thead",model:n(159),view:n(160)},{id:"tbody",model:n(19),view:n(161)},{id:"tfoot",model:n(162),view:n(163)},{id:"map",model:n(164),view:n(165)},{id:"link",model:n(166),view:n(167)},{id:"video",model:n(168),view:n(169)},{id:"image",model:n(20),view:n(15)},{id:"script",model:n(170),view:n(171)},{id:"svg",model:n(172),view:n(173)},{id:"textnode",model:n(174),view:n(175)},{id:"text",model:n(52),view:n(53)},{id:"default",model:a,view:l}];return{Component:a,Components:c,ComponentsView:u,componentTypes:h,name:"DomComponents",getConfig:function(){return i},storageKey:function(){var t=[],e=i.stm&&i.stm.getConfig()||{};return e.storeHtml&&t.push("html"),e.storeComponents&&t.push("components"),t},init:function(n){i=n||{},o=i.em,o&&(i.components=o.config.components||i.components);for(var c in s)c in i||(i[c]=s[c]);var u=i.pStylePrefix;u&&(i.stylePrefix=u+i.stylePrefix),o&&(i.modal=o.get("Modal")||"",i.am=o.get("AssetManager")||"",o.get("Parser").compTypes=h,o.on("change:selectedComponent",this.componentChanged,this));var f=i.components,d=r({},i.wrapper);return d["custom-name"]=i.wrapperName,d.wrapper=1,f&&f.constructor===Object&&f.wrapper&&(d=r({},f),f=f.components||[],d.components=[],o&&(o.config.components=f,i.components=f)),t=new a(d,{em:o,config:i,componentTypes:h}),t.set({attributes:{id:"wrapper"}}),e=new l({model:t,config:i,componentTypes:h}),this},onLoad:function(){this.setComponents(i.components)},postLoad:function(t){this.handleChanges(this.getWrapper(),null,{avoidStore:1})},handleChanges:function f(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t.components(),s=o.get("UndoManager"),a=o.handleUpdates.bind(o),f=this.handleChanges.bind(this),l=this.handleRemoves.bind(this);s&&s.add(t),s&&i&&s.add(i);var c="change:style change:content change:attributes change:src";[[t,c,a],[i,"add",f],[i,"remove",l],[t.get("classes"),"add remove",a]].forEach(function(t){o.stopListening(t[0],t[1],t[2]),o.listenTo(t[0],t[1],t[2])}),!r.avoidStore&&a("","",r),i.each(function(t){return n.handleChanges(t,e,r)})},handleRemoves:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!n.avoidStore&&o.handleUpdates(t,e,n)},load:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e="";if(!t&&i.stm&&(t=i.em.getCacheLoad()),t.components)try{e=JSON.parse(t.components)}catch(n){}else t.html&&(e=t.html);var r=e&&e.constructor===Object;return(e&&e.length||r)&&(this.clear(),this.getComponents().reset(),r?this.getWrapper().set(e).initComponents().initClasses().loadTraits():this.getComponents().add(e)),e},store:function(t){if(i.stm){var e={},n=this.storageKey();if(n.indexOf("html")>=0&&(e.html=i.em.getHtml()),n.indexOf("components")>=0){var r=i.storeWrapper?this.getWrapper():this.getComponents();e.components=JSON.stringify(r)}return t||i.stm.store(e),e}},getComponent:function(){return t},getWrapper:function(){return this.getComponent()},getComponents:function(){return this.getWrapper().get("components")},addComponent:function(t){return this.getComponents().add(t)},render:function(){return e.render().el},clear:function(){for(var t=this.getComponents(),e=0,n=t.length;e<n;e++)t.pop();return this},setComponents:function(t){this.clear().addComponent(t)},addType:function(t,e){var n=this.getType(t);n?(n.model=e.model,n.view=e.view):(e.id=t,h.unshift(e))},getType:function(t){for(var e=h,n=0;n<e.length;n++){var r=e[n].id;if(r==t)return e[n]}},componentChanged:function(){var t=i.em,e=t.get("selectedComponent"),n=t.previous("selectedComponent");n&&n.set({status:"",state:""}),e&&e.set("status","selected")}}}},function(t,e,n){"use strict";t.exports={stylePrefix:"comp-",wrapperId:"wrapper",wrapperName:"Body",wrapper:{removable:!1,copyable:!1,draggable:!1,components:[],traits:[],stylable:["background","background-color","background-image","background-repeat","background-attachment","background-position","background-size"]},components:[],imageCompClass:"fa fa-picture-o",oAssetsOnCreate:!0,storeWrapper:0,voidElements:["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"]}},function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(151),s=n(152);t.exports=i.Collection.extend({model:o,initialize:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.em=e.em||""},setTarget:function(t){this.target=t},add:function(t,e){var n=this.em;if((0,r.isString)(t)||(0,r.isArray)(t)){var o=n&&n.get&&n.get("TraitManager"),a=o&&o.getConfig(),l=s(a);(0,r.isString)(t)&&(t=[t]);for(var c=0,u=t.length;c<u;c++){var h=t[c],f=(0,r.isString)(h)?l.build(h)[0]:h;f.target=this.target,t[c]=f}}return i.Collection.prototype.add.apply(this,[t,e])}})},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(1);t.exports=n(0).Model.extend({defaults:{type:"text",label:"",name:"",min:"",max:"",unit:"",step:1,value:"",target:"","default":"",placeholder:"",changeProp:0,options:[]},initialize:function(){var t=this.get("target"),e=this.get("name"),n=this.get("changeProp");if(t){this.target=t,this.unset("target");var r=n?"change:"+e:"change:attributes:"+e;this.listenTo(t,r,this.targetUpdated)}},targetUpdated:function(){var t=this.getTargetValue();!(0,i.isUndefined)(t)&&this.set({value:t},{fromTarget:1})},getTargetValue:function(){var t=this.get("name"),e=this.target,n=this.get("changeProp");if(e)return n?e.get(t):e.getAttributes()[t]},setTargetValue:function(t){var e=this.target,n=this.get("name");if(!(0,i.isUndefined)(t))if(this.get("changeProp"))e.set(n,t);else{var o=r({},e.get("attributes"));o[n]=t,e.set("attributes",o)}},setValueFromInput:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={value:t};this.set(i,r({},n,{avoidStore:1})),e&&(this.set("value","",n),this.set(i,n))},getInitValue:function(){var t=this.target,e=this.get("name"),n=void 0;if(t){var r=t.get("attributes");n=this.get("changeProp")?t.get(e):r[e]}return n||this.get("value")||this.get("default")}})},function(t,e,n){"use strict";t.exports=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{build:function(e){var n=[];"string"==typeof e&&(e=[e]);for(var r=0;r<e.length;r++){var i={},o=e[r];switch(i.name=o,o){case"target":i.type="select"}switch(o){case"title":case"alt":case"id":i.placeholder=t.labelPlhText;break;case"href":i.placeholder=t.labelPlhHref}switch(o){case"target":i.options=t.optionsTarget}n.push(i)}return n}}}},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(4);t.exports=i.extend({defaults:r({},i.prototype.defaults,{type:"cell",tagName:"td",
draggable:["tr"]})},{isComponent:function(t){var e="",n=t.tagName;return"TD"!=n&&"TH"!=n||(e={type:"cell",tagName:n.toLowerCase()}),e}})},function(t,e,n){"use strict";var r=(n(0),n(3));t.exports=r.extend({})},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(4);t.exports=i.extend({defaults:r({},i.prototype.defaults,{type:"row",tagName:"tr",draggable:["thead","tbody","tfoot"],droppable:["th","td"]}),initialize:function(t,e){i.prototype.initialize.apply(this,arguments);var n=[],r=this.get("components");r.each(function(t){return t.is("cell")&&n.push(t)}),r.reset(n)}},{isComponent:function(t){var e="";return"TR"==t.tagName&&(e={type:"row"}),e}})},function(t,e,n){"use strict";var r=(n(0),n(3));t.exports=r.extend({})},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(4);t.exports=i.extend({defaults:r({},i.prototype.defaults,{type:"table",tagName:"table",droppable:["tbody","thead","tfoot"]}),initialize:function(t,e){i.prototype.initialize.apply(this,arguments);var n=this.get("components");!n.length&&n.add({type:"tbody"})}},{isComponent:function(t){var e="";return"TABLE"==t.tagName&&(e={type:"table"}),e}})},function(t,e,n){"use strict";var r=(n(0),n(3));t.exports=r.extend({events:{}})},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(19);t.exports=i.extend({defaults:r({},i.prototype.defaults,{type:"thead",tagName:"thead"})},{isComponent:function(t){var e="";return"THEAD"==t.tagName&&(e={type:"thead"}),e}})},function(t,e,n){"use strict";var r=(n(0),n(3));t.exports=r.extend({})},function(t,e,n){"use strict";var r=(n(0),n(3));t.exports=r.extend({})},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(19);t.exports=i.extend({defaults:r({},i.prototype.defaults,{type:"tfoot",tagName:"tfoot"})},{isComponent:function(t){var e="";return"TFOOT"==t.tagName&&(e={type:"tfoot"}),e}})},function(t,e,n){"use strict";var r=(n(0),n(3));t.exports=r.extend({})},function(t,e,n){"use strict";(function(e){var r=n(20),i=n(4);t.exports=r.extend({defaults:e.extend({},r.prototype.defaults,{type:"map","void":0,mapUrl:"https://maps.google.com/maps",tagName:"iframe",mapType:"q",address:"",zoom:"1",attributes:{frameborder:0},toolbar:i.prototype.defaults.toolbar,traits:[{label:"Address",name:"address",placeholder:"eg. London, UK",changeProp:1},{type:"select",label:"Map type",name:"mapType",changeProp:1,options:[{value:"q",name:"Roadmap"},{value:"w",name:"Satellite"}]},{label:"Zoom",name:"zoom",type:"range",min:"1",max:"20",changeProp:1}]}),initialize:function(t,e){this.get("src")?this.parseFromSrc():this.updateSrc(),r.prototype.initialize.apply(this,arguments),this.listenTo(this,"change:address change:zoom change:mapType",this.updateSrc)},updateSrc:function(){this.set("src",this.getMapUrl())},getMapUrl:function(){var t=this,e=t.get("address"),n=t.get("zoom"),r=t.get("mapType");e=e?"&q="+e:"",n=n?"&z="+n:"",r=r?"&t="+r:"";var i=t.get("mapUrl")+"?"+e+n+r;return i+="&output=embed"},parseFromSrc:function(){var t=this.parseUri(this.get("src")),e=t.query;e.q&&this.set("address",e.q),e.z&&this.set("zoom",e.z),e.t&&this.set("mapType",e.t)}},{isComponent:function(t){var e="";return"IFRAME"==t.tagName&&/maps\.google\.com/.test(t.src)&&(e={type:"map",src:t.src}),e}})}).call(e,n(1))},function(t,e,n){"use strict";var r=(n(0),n(15));t.exports=r.extend({tagName:"div",events:{},initialize:function(t){r.prototype.initialize.apply(this,arguments),this.classEmpty=this.ppfx+"plh-map"},updateSrc:function(){this.getIframe().src=this.model.get("src")},getIframe:function(){if(!this.iframe){var t=document.createElement("iframe");t.src=this.model.get("src"),t.frameBorder=0,t.style.height="100%",t.style.width="100%",t.className=this.ppfx+"no-pointer",this.iframe=t}return this.iframe},render:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return r.prototype.render.apply(this,e),this.updateClasses(),this.el.appendChild(this.getIframe()),this}})},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(52);t.exports=i.extend({defaults:r({},i.prototype.defaults,{type:"link",tagName:"a",traits:["title","href","target"]}),getAttrToHTML:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=i.prototype.getAttrToHTML.apply(this,e);return delete r.onmousedown,r}},{isComponent:function(t){var e=void 0;if("A"==t.tagName){e={type:"link",editable:0};var n=t.childNodes,r=n.length;r||delete e.editable;for(var i=0;i<r;i++){var o=n[i];if(3==o.nodeType&&""!=o.textContent.trim()){delete e.editable;break}}}return e}})},function(t,e,n){"use strict";var r=(n(0),n(53));t.exports=r.extend({render:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return r.prototype.render.apply(this,e),this.el.addEventListener("click",this.prevDef,!0),this}})},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(20),o=n(4),s="yt",a="vi";t.exports=i.extend({defaults:r({},i.prototype.defaults,{type:"video",tagName:"video",videoId:"","void":0,provider:"",ytUrl:"https://www.youtube.com/embed/",viUrl:"https://player.vimeo.com/video/",loop:0,muted:0,autoplay:0,controls:1,color:"",sources:[],attributes:{allowfullscreen:"allowfullscreen"},toolbar:o.prototype.defaults.toolbar}),initialize:function(t,e){var n=[],r=this.get("provider");switch(r){case s:n=this.getYoutubeTraits();break;case a:n=this.getVimeoTraits();break;default:n=this.getSourceTraits()}this.get("src")&&this.parseFromSrc(),this.set("traits",n),i.prototype.initialize.apply(this,arguments),this.listenTo(this,"change:provider",this.updateTraits),this.listenTo(this,"change:videoId",this.updateSrc)},initToolbar:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];o.prototype.initToolbar.apply(this,e)},parseFromSrc:function(){var t=this.get("provider"),e=this.parseUri(this.get("src")),n=e.query;switch(t){case s:case a:var r=e.pathname.split("/").pop();this.set("videoId",r),n.autoplay&&this.set("autoplay",1),n.loop&&this.set("loop",1),0===parseInt(n.controls)&&this.set("controls",0),n.color&&this.set("color",n.color)}},updateSrc:function(){var t=this.get("provider");switch(t){case s:this.set("src",this.getYoutubeSrc());break;case a:this.set("src",this.getVimeoSrc())}},getAttrToHTML:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=i.prototype.getAttrToHTML.apply(this,e),o=this.get("provider");switch(o){case s:case a:break;default:this.get("loop")&&(r.loop="loop"),this.get("autoplay")&&(r.autoplay="autoplay"),this.get("controls")&&(r.controls="controls")}return r},updateTraits:function(){var t=this.get("provider"),e=this.getSourceTraits();switch(t){case s:this.set("tagName","iframe"),e=this.getYoutubeTraits();break;case a:this.set("tagName","iframe"),e=this.getVimeoTraits();break;default:this.set("tagName","video")}this.loadTraits(e),this.em.trigger("change:selectedComponent")},getProviderTrait:function(){return{type:"select",label:"Provider",name:"provider",changeProp:1,value:this.get("provider"),options:[{value:"so",name:"HTML5 Source"},{value:s,name:"Youtube"},{value:a,name:"Vimeo"}]}},getSourceTraits:function(){return[this.getProviderTrait(),{label:"Source",name:"src",placeholder:"eg. ./media/video.mp4",changeProp:1},this.getAutoplayTrait(),this.getLoopTrait(),this.getControlsTrait()]},getYoutubeTraits:function(){return[this.getProviderTrait(),{label:"Video ID",name:"videoId",placeholder:"eg. jNQXAC9IVRw",changeProp:1},this.getAutoplayTrait(),this.getLoopTrait(),this.getControlsTrait()]},getVimeoTraits:function(){return[this.getProviderTrait(),{label:"Video ID",name:"videoId",placeholder:"eg. 123456789",changeProp:1},{label:"Color",name:"color",placeholder:"eg. FF0000",changeProp:1},this.getAutoplayTrait(),this.getLoopTrait(),this.getControlsTrait()]},getAutoplayTrait:function(){return{type:"checkbox",label:"Autoplay",name:"autoplay",changeProp:1}},getLoopTrait:function(){return{type:"checkbox",label:"Loop",name:"loop",changeProp:1}},getControlsTrait:function(){return{type:"checkbox",label:"Controls",name:"controls",changeProp:1}},getYoutubeSrc:function(){var t=this.get("ytUrl");return t+=this.get("videoId")+"?",t+=this.get("autoplay")?"&autoplay=1":"",t+=this.get("controls")?"":"&controls=0",t+=this.get("loop")?"&loop=1":""},getVimeoSrc:function(){var t=this.get("viUrl");return t+=this.get("videoId")+"?",t+=this.get("autoplay")?"&autoplay=1":"",t+=this.get("loop")?"&loop=1":"",t+=this.get("controls")?"":"&title=0&portrait=0&badge=0",t+=this.get("color")?"&color="+this.get("color"):""}},{isComponent:function(t){var e="",n=/youtube\.com\/embed/.test(t.src),r=/player\.vimeo\.com\/video/.test(t.src),i=n||r;return("VIDEO"==t.tagName||"IFRAME"==t.tagName&&i)&&(e={type:"video"},t.src&&(e.src=t.src),i&&(n?e.provider=s:r&&(e.provider=a))),e}})},function(t,e,n){"use strict";var r=(n(0),n(15)),i=n(3);t.exports=r.extend({tagName:"div",events:{},initialize:function(t){i.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change:src",this.updateSrc),this.listenTo(this.model,"change:loop change:autoplay change:controls change:color",this.updateVideo),this.listenTo(this.model,"change:provider",this.updateProvider)},updateProvider:function(){var t=this.model.get("provider");this.el.innerHTML="",this.el.appendChild(this.renderByProvider(t))},updateSrc:function(){var t=this.model.get("provider"),e=this.model.get("src");switch(t){case"yt":e=this.model.getYoutubeSrc();break;case"vi":e=this.model.getVimeoSrc()}this.videoEl.src=e},updateVideo:function(){var t=this.model.get("provider"),e=this.videoEl,n=this.model;switch(t){case"yt":case"vi":this.model.trigger("change:videoId");break;default:e.loop=n.get("loop"),e.autoplay=n.get("autoplay"),e.controls=n.get("controls")}},renderByProvider:function(t){var e;switch(t){case"yt":e=this.renderYoutube();break;case"vi":e=this.renderVimeo();break;default:e=this.renderSource()}return this.videoEl=e,e},renderSource:function(){var t=document.createElement("video");return t.src=this.model.get("src"),this.initVideoEl(t),t},renderYoutube:function(){var t=document.createElement("iframe");return t.src=this.model.getYoutubeSrc(),t.frameBorder=0,t.setAttribute("allowfullscreen",!0),this.initVideoEl(t),t},renderVimeo:function(){var t=document.createElement("iframe");return t.src=this.model.getVimeoSrc(),t.frameBorder=0,t.setAttribute("allowfullscreen",!0),this.initVideoEl(t),t},initVideoEl:function(t){t.className=this.ppfx+"no-pointer",t.style.height="100%",t.style.width="100%"},render:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];r.prototype.render.apply(this,e),this.updateClasses();var i=this.model.get("provider");return this.el.appendChild(this.renderByProvider(i)),this}})},function(t,e,n){"use strict";(function(e){var r=n(4);t.exports=r.extend({defaults:e.extend({},r.prototype.defaults,{type:"script",droppable:!1,draggable:!1,layerable:!1})},{isComponent:function(t){if("SCRIPT"==t.tagName){var e={type:"script"};return t.src&&(e.src=t.src,e.onload=t.onload),e}}})}).call(e,n(1))},function(t,e,n){"use strict";var r=(n(0),n(15));t.exports=r.extend({tagName:"script",events:{},render:function(){var t=this.model,e=t.get("src"),n=this.em,r=n&&n.get("scriptCount")?n.get("scriptCount"):0,i="";if(e){var o=t.get("onload"),s="script"+r,a="script"+(r+1);i="var "+s+" = document.createElement('script');\n"+s+".onload = function(){\n"+(o?o+"();\n":"")+"typeof "+a+"Start == 'function' && "+a+"Start();\n};\n"+s+".src = '"+e+"';\nfunction "+s+"Start() { document.body.appendChild("+s+"); };\n"+(r?"":s+"Start();"),n&&n.set("scriptCount",r+1)}else i=t.get("content");return this.el.innerHTML=i,this}})},function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(4);t.exports=i.extend({defaults:r({},i.prototype.defaults,{highlightable:0}),getName:function(){var t=this.get("tagName"),e=this.get("custom-name");return t=t.charAt(0).toUpperCase()+t.slice(1),e||t}},{isComponent:function(t){if(SVGElement&&t instanceof SVGElement){var e=t.tagName,n="svg"==e;return{tagName:e,type:"svg",resizable:n}}}})},function(t,e,n){"use strict";var r=n(3);t.exports=r.extend({_createElement:function(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}})},function(t,e,n){"use strict";(function(e){var r=n(4);t.exports=r.extend({defaults:e.extend({},r.prototype.defaults,{droppable:!1,editable:!0}),toHTML:function(){return this.get("content")}},{isComponent:function(t){var e="";return 3===t.nodeType&&(e={type:"textnode",content:t.textContent}),e}})}).call(e,n(1))},function(t,e,n){"use strict";t.exports=n(0).View.extend({})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}var i=n(2),o=n(177),s=r(o);t.exports=function(){var t,e,r={},o=n(178),a=n(179),l=n(181);return{getCanvasView:function(){return l},name:"Canvas",init:function(e){r=e||{};for(var n in o)n in r||(r[n]=o[n]);var i=r.pStylePrefix;i&&(r.stylePrefix=i+r.stylePrefix),t=new a(e),l=new l({model:t,config:r});var s=r.em.get("DomComponents");return s&&this.setWrapper(s),this.startAutoscroll=this.startAutoscroll.bind(this),this.stopAutoscroll=this.stopAutoscroll.bind(this),this.autoscroll=this.autoscroll.bind(this),this},getConfig:function(){return r},setWrapper:function(e){t.set("wrapper",e)},getElement:function(){return l.el},getFrameEl:function(){return l.frame.el},getBody:function(){return l.frame.el.contentDocument.body},getWrapperEl:function(){return this.getBody().querySelector("#wrapper")},getToolsEl:function(){return l.toolsEl},getHighlighter:function(){return l.hlEl},getBadgeEl:function(){return l.badgeEl},getPlacerEl:function(){return l.placerEl},getGhostEl:function(){return l.ghostEl},getToolbarEl:function(){return l.toolbarEl},getResizerEl:function(){return l.resizerEl},getOffsetViewerEl:function(){return l.offsetEl},getFixedOffsetViewerEl:function(){return l.fixedOffsetEl},render:function(){return l.render().el},getOffset:function(){var t=this.offset(this.getFrameEl()),e=this.offset(this.getElement());return{top:t.top-e.top,left:t.left-e.left}},offset:function(t){return l.offset(t)},setCustomBadgeLabel:function(t){r.customBadgeLabel=t},getElementPos:function(t,e){return l.getElementPos(t,e)},getTargetToElementDim:function(t,e,n){var i=n||{},o=l.getPosition(),s=i.elPos||l.getElementPos(e),a=n.toRight||0,c=i.targetHeight||t.offsetHeight,u=i.targetWidth||t.offsetWidth,h=i.event||null,f=s.top-c,d=s.left;d+=a?s.width:0,d=a?d-u:d;var p=d<o.left?o.left:d,g=f<o.top?o.top:f;g=g>s.top+s.height?s.top+s.height:g;var v={top:g,left:p,elementTop:s.top,elementLeft:s.left,elementWidth:s.width,elementHeight:s.height,targetWidth:t.offsetWidth,targetHeight:t.offsetHeight,canvasTop:o.top,canvasLeft:o.left};return h&&r.em&&r.em.trigger(h,v),v},getMouseRelativePos:function(t,e){var n=e||{},r=0,i=0,o=n.subWinOffset,s=t.target.ownerDocument,a=s.defaultView||s.parentWindow,l=a.frameElement,c=o?a.pageYOffset:0,u=o?a.pageXOffset:0;if(l){var h=l.getBoundingClientRect();r=h.top||0,i=h.left||0}return{y:t.clientY+r-c,x:t.clientX+i-u}},getMouseRelativeCanvas:function(t,e){var n=this.getFrameEl(),r=this.getBody(),i=n.offsetTop||0,o=n.offsetLeft||0,s=r.scrollTop||0,a=r.scrollLeft||0;return{y:t.clientY+i+s,x:t.clientX+o+a}},isInputFocused:function(){return"BODY"!==this.getFrameEl().contentDocument.activeElement.tagName},startAutoscroll:function(){var t=this;this.dragging=1;var n=this.getScrollListeners();e=l.getFrameOffset(1),setTimeout(function(){(0,i.on)(n,"mousemove",t.autoscroll),(0,i.on)(n,"mouseup",t.stopAutoscroll)},0)},autoscroll:function(t){if(t.preventDefault(),this.dragging){var n=this.getFrameEl().contentWindow,r=n.document.body.scrollTop,i=r,o=t.clientY,s=50,a=e.height-s;o<s&&(i-=s-o),o>a&&(i+=o-a),n.scrollTo(0,i)}},stopAutoscroll:function(){this.dragging=0;var t=this.getScrollListeners();(0,i.off)(t,"mousemove",this.autoscroll),(0,i.off)(t,"mouseup",this.stopAutoscroll)},getScrollListeners:function(){return[this.getFrameEl().contentWindow,this.getElement()]},postRender:function(){(0,i.hasDnd)(r.em)&&(this.droppable=new s["default"](r.em))},getFrameWrapperEl:function(){return l.frame.getWrapper()}}}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(2),s=n(1),a=function(){function t(e){r(this,t),this.em=e;var n=e.get("DomComponents").getWrapper().getEl();return this.el=n,this.counter=0,(0,s.bindAll)(this,"handleDragEnter","handleDragOver","handleDrop","handleDragLeave"),(0,o.on)(n,"dragenter",this.handleDragEnter),(0,o.on)(n,"dragover",this.handleDragOver),(0,o.on)(n,"drop",this.handleDrop),(0,o.on)(n,"dragleave",this.handleDragLeave),this}return i(t,[{key:"endDrop",value:function(t,e){var n=this.em;this.counter=0,this.over=0;var r=this.sorter;t&&(r.moved=0),r.endMove(),n.trigger("canvas:dragend",e)}},{key:"handleDragLeave",value:function(t){this.updateCounter(-1,t)}},{key:"updateCounter",value:function(t,e){this.counter+=t,0===this.counter&&this.endDrop(1,e)}},{key:"handleDragEnter",value:function(t){var e=this.em,n=t.dataTransfer;if(this.updateCounter(1,t),!this.over){this.over=1;var r=e.get("Utils"),i=e.get("Canvas");this.sorter=new r.Sorter({em:e,wmargin:1,nested:1,canvasRelative:1,direction:"a",container:i.getBody(),placer:i.getPlacerEl(),eventMoving:"mousemove dragover",containerSel:"*",itemSel:"*",pfx:"gjs-",onStart:function(){return e.stopDefault()},onEndMove:function(t){e.runDefault(),t&&t.get&&t.get("activeOnRender")&&(t.trigger("active"),t.set("activeOnRender",0)),t&&e.trigger("canvas:drop",n,t)},document:i.getFrameEl().contentDocument});var o=e.get("dragContent")||"<br>";this.sorter.setDropContent(o),this.sorter.startSort(),e.trigger("canvas:dragenter",n,o)}}},{key:"handleDragOver",value:function(t){t.preventDefault(),this.em.trigger("canvas:dragover",t)}},{key:"handleDrop",value:function(t){t.preventDefault();var e=t.dataTransfer,n=this.getContentByData(e).content;t.target.style.border="",n?this.sorter.setDropContent(n):this.sorter.moved=0,this.endDrop(0,t)}},{key:"getContentByData",value:function(t){var e=this.em,n=t.types,r=t.files,i=e.get("dragContent"),o=t.getData("text");if(r.length){o=[];for(var s=0;s<r.length;s++){var a=r[s],l=a.type.split("/")[0];"image"==l&&o.push({type:l,file:a,attributes:{alt:a.name}})}}else if(i)o=i;else if(n.indexOf("text/html")>=0)o=t.getData("text/html").replace(/<\/?meta[^>]*>/g,"");else if(n.indexOf("text/uri-list")>=0)o={type:"link",attributes:{href:o},content:o};else if(n.indexOf("text/json")>=0){var c=t.getData("text/json");c&&(o=JSON.parse(c))}var u={content:o};return e.trigger("canvas:dragdata",t,u),u}}]),t}();e["default"]=a},function(t,e,n){"use strict";t.exports={stylePrefix:"cv-",rulers:!1,scripts:[],styles:[],customBadgeLabel:""}},function(t,e,n){"use strict";var r=n(0),i=n(180);t.exports=r.Model.extend({defaults:{frame:"",wrapper:"",rulers:!1},initialize:function(t){var e=this.conf||{};this.set("frame",new i(e.frame))}})},function(t,e,n){"use strict";var r=n(0);t.exports=r.Model.extend({defaults:{wrapper:"",width:"",height:"",attributes:{}}})},function(t,e,n){"use strict";(function(e,r){var i=n(2),o=n(182),s=e.$;t.exports=e.View.extend({initialize:function(t){r.bindAll(this,"renderBody","onFrameScroll","clearOff"),(0,i.on)(window,"scroll resize",this.clearOff),this.config=t.config||{},this.em=this.config.em||{},this.ppfx=this.config.pStylePrefix||"",this.className=this.config.stylePrefix+"canvas",this.listenTo(this.em,"change:canvasOffset",this.clearOff),this.frame=new o({model:this.model.get("frame"),config:this.config})},isElInViewport:function(t){var e=t.getBoundingClientRect(),n=this.getFrameOffset(1),r=e.top,i=e.left;return r>=0&&i>=0&&r<=n.height&&i<=n.width},onFrameScroll:function(){var t="px",e=this.frame.el.contentDocument.body;this.toolsEl.style.top="-"+e.scrollTop+t,this.toolsEl.style.left="-"+e.scrollLeft+t,this.em.trigger("canvasScroll")},renderScripts:function(){var t=this.frame,e=this;t.el.onload=function(){function n(r){if(r.length>0){var i=document.createElement("script");i.type="text/javascript",i.src=r.shift(),i.onerror=i.onload=n.bind(null,r),t.el.contentDocument.head.appendChild(i)}else e.renderBody()}var r=e.config.scripts.slice(0);n(r)}},renderBody:function(){var t=this.model.get("frame").get("wrapper"),e=this.config.em;if(t){var n=this.ppfx,r=s(this.frame.el.contentWindow.document.body),i=e.get("CssComposer"),o=e.get("Config"),a=this.config,l=o.protectedCss,c="";a.styles.forEach(function(t){c+='<link rel="stylesheet" href="'+t+'"/>'});var u="#ffca6f",h="\n * {\n box-sizing: border-box;\n }\n html, body, #wrapper {\n min-height: 100%;\n }\n body {\n margin: 0;\n height: 100%;\n background-color: #fff\n }\n #wrapper {\n overflow: auto;\n overflow-x: hidden;\n }\n ",f="\n "+h+"\n\n ."+n+"dashed *[data-highlightable] {\n outline: 1px dashed rgba(170,170,170,0.7);\n outline-offset: -3px\n }\n\n ."+n+"comp-selected {\n outline: 3px solid #3b97e3 !important;\n }\n\n ."+n+"comp-selected-parent {\n outline: 2px solid "+u+" !important\n }\n\n ."+n+"no-select {\n user-select: none;\n -webkit-user-select:none;\n -moz-user-select: none;\n }\n\n ."+n+"freezed {\n opacity: 0.5;\n pointer-events: none;\n }\n\n ."+n+"no-pointer {\n pointer-events: none;\n }\n\n ."+n+"plh-image {\n background: #f5f5f5;\n border: none;\n height: 50px;\n width: 50px;\n display: block;\n outline: 3px solid #ffca6f;\n cursor: pointer;\n outline-offset: -2px\n }\n\n ."+n+"grabbing {\n cursor: grabbing;\n cursor: -webkit-grabbing;\n }\n\n * ::-webkit-scrollbar-track {\n background: rgba(0, 0, 0, 0.1)\n }\n\n * ::-webkit-scrollbar-thumb {\n background: rgba(255, 255, 255, 0.2)\n }\n\n * ::-webkit-scrollbar {\n width: 10px\n }\n\n "+(o.canvasCss||"")+"\n "+(l||"")+"\n ";c&&r.append(c),r.append("<style>"+f+"</style>"),r.append(t.render()).append(i.render()),r.append(this.getJsContainer()),e.trigger("loaded"),this.frame.el.contentWindow.onscroll=this.onFrameScroll,this.frame.udpateOffset();var d=document,p=this.frame.el.contentDocument,g=function(t){var e=new KeyboardEvent(t.type,t);return e.keyCodeVal=t.keyCode,["keyCode","which"].forEach(function(t){Object.defineProperty(e,t,{get:function(){return this.keyCodeVal}})}),e};p.addEventListener("keydown",function(t){d.dispatchEvent(g(t))}),p.addEventListener("keyup",function(t){d.dispatchEvent(g(t))})}},offset:function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument.body;return{top:e.top+n.scrollTop,left:e.left+n.scrollLeft,width:e.width,height:e.height}},clearOff:function(){this.frmOff=null,this.cvsOff=null},getFrameOffset:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.frmOff&&!t||(this.frmOff=this.offset(this.frame.el)),this.frmOff},getCanvasOffset:function(){return this.cvsOff||(this.cvsOff=this.offset(this.el)),this.cvsOff},getElementPos:function(t,e){var n=e||{},r=this.getFrameOffset(),i=this.getCanvasOffset(),o=this.offset(t),s=n.avoidFrameOffset?0:r.top,a=n.avoidFrameOffset?0:r.left,l=o.top+s-i.top,c=o.left+a-i.left,u=t.offsetHeight||t.clientHeight,h=t.offsetWidth||t.clientWidth;return{top:l,left:c,height:u,width:h}},getPosition:function(){var t=this.frame.el.contentDocument.body,e=this.getFrameOffset(),n=this.getCanvasOffset();return{top:e.top+t.scrollTop-n.top,left:e.left+t.scrollLeft-n.left}},updateScript:function(t){t.scriptContainer||(t.scriptContainer=s("<div>"),this.getJsContainer().append(t.scriptContainer.get(0)));var e=t.model,n=e.getId();t.el.id=n,t.scriptContainer.html("");var r=document.createElement("script");r.innerText="\n setTimeout(function() {\n var item = document.getElementById('"+n+"');\n if (!item) return;\n (function(){\n "+e.getScriptString()+";\n }.bind(item))()\n }, 1);",t.scriptContainer.get(0).appendChild(r)},getJsContainer:function(){return this.jsContainer||(this.jsContainer=s('<div class="'+this.ppfx+'js-cont">').get(0)),this.jsContainer},render:function(){if(this.wrapper=this.model.get("wrapper"),this.wrapper&&"function"==typeof this.wrapper.render){this.model.get("frame").set("wrapper",this.wrapper),this.$el.append(this.frame.render().el);var t=this.frame;0===this.config.scripts.length?t.el.onload=this.renderBody:this.renderScripts()}var e=this.ppfx;this.$el.append('\n <div id="'+e+'tools" style="pointer-events:none">\n <div class="'+e+'highlighter"></div>\n <div class="'+e+'badge"></div>\n <div class="'+e+'placeholder">\n <div class="'+e+'placeholder-int"></div>\n </div>\n <div class="'+e+'ghost"></div>\n <div class="'+e+'toolbar" style="pointer-events:all"></div>\n <div class="'+e+'resizer"></div>\n <div class="'+e+'offset-v"></div>\n <div class="'+e+'offset-fixed-v"></div>\n </div>\n ');var n=this.el,r=n.querySelector("#"+e+"tools");return this.hlEl=n.querySelector("."+e+"highlighter"),this.badgeEl=n.querySelector("."+e+"badge"),this.placerEl=n.querySelector("."+e+"placeholder"),this.ghostEl=n.querySelector("."+e+"ghost"),this.toolbarEl=n.querySelector("."+e+"toolbar"),this.resizerEl=n.querySelector("."+e+"resizer"),this.offsetEl=n.querySelector("."+e+"offset-v"),this.fixedOffsetEl=n.querySelector("."+e+"offset-fixed-v"),this.toolsEl=r,this.el.className=this.className,this}})}).call(e,n(0),n(1))},function(t,e,n){"use strict";var r=n(1),i="transitionend oTransitionEnd transitionend webkitTransitionEnd";t.exports=n(0).View.extend({tagName:"iframe",attributes:{allowfullscreen:"allowfullscreen"},initialize:function(t){(0,r.bindAll)(this,"udpateOffset"),this.config=t.config||{},this.ppfx=this.config.pStylePrefix||"",this.em=this.config.em,this.listenTo(this.em,"change:device",this.updateDim)},updateDim:function(t){var e=this.em,n=e.getDeviceModel(),r=this.el.style,o=r.width||"",s=r.height||"",a=n?n.get("width"):"",l=n?n.get("height"):"",c=o==a&&s==l;r.width=a,r.height=l,this.udpateOffset(),e.stopDefault({preserveSelected:1}),c?this.udpateOffset():this.$el.on(i,this.udpateOffset)},udpateOffset:function(){var t=this.em,e=t.get("Canvas").getOffset();t.set("canvasOffset",e),t.runDefault({preserveSelected:1}),this.$el.off(i,this.udpateOffset)},getBody:function(){this.$el.contents().find("body")},getWrapper:function(){return this.$el.contents().find("body > div")},render:function(){return this.$el.attr({"class":this.ppfx+"frame"}),this}})},function(t,e,n){"use strict";var r=n(1);t.exports=function(){var t=void 0,e={},i={},o={},s=n(184),a=n(185),l=function(t,e){return(0,r.isFunction)(e)&&(e={run:e}),delete e.initialize,i[t]=a.extend(e),this};return{name:"Commands",init:function(r){e=r||{};for(var i in s)i in e||(e[i]=s[i]);t=e.em;var a=e.pStylePrefix;a&&(e.stylePrefix=a+e.stylePrefix);for(var l in e.defaults){var c=e.defaults[l];c.id&&this.add(c.id,c)}var u=n(186);return o["select-comp"]=n(21),o["create-comp"]=n(22),o["delete-comp"]=n(191),o["image-comp"]=n(192),o["move-comp"]=n(193),o["text-comp"]=n(194),o["insert-custom"]=n(55),o["export-template"]=u,o["sw-visibility"]=n(195),o["open-layers"]=n(196),o["open-sm"]=n(199),o["open-tm"]=n(200),o["open-blocks"]=n(201),o["open-assets"]=n(202),o["show-offset"]=n(203),o["select-parent"]=n(204),o.fullscreen=n(205),o.preview=n(206),o.resize=n(207),o.drag=n(208),o["tlb-delete"]={run:function(t){var e=t.getSelected();e&&e.get("removable")&&(t.select(null),e.destroy())}},o["tlb-clone"]={run:function(t){var e=t.getSelected();if(e&&e.get("copyable")){var n=e.collection,r=n.indexOf(e),i=n.add(e.clone(),{at:r+1});e.emitUpdate(),t.trigger("component:clone",i)}}},o["tlb-move"]={run:function(t,e,n){var r=void 0,i=t.getModel(),o=n&&n.event,s=t.getSelected(),a=t.Canvas.getToolbarEl().style,l="dragstart"==o.type,c=function(){a.display="none",i.stopDefault()};if(s&&s.get("draggable")){l?setTimeout(function(){return c},0):c();var u=function(t,e){var n=e.el;n.style.position="absolute",n.style.margin=0},h=function(t,e){i.runDefault(),i.setSelected(s),s.emitUpdate(),r&&r.blur()},f=function(t,e){};if(i.get("designerMode"))r=editor.runCommand("drag",{el:s.view.el,options:{event:o,onStart:u,onDrag:f,onEnd:h}});else{l&&o.dataTransfer.setDragImage(s.view.el,0,0);var d=t.Commands.get("move-comp");d.onEndMoveFromModel=h,d.initSorterFromModel(s)}s.set("status","selected")}}},o["core:undo"]=function(t){return t.UndoManager.undo()},o["core:redo"]=function(t){return t.UndoManager.redo()},o["core:canvas-clear"]=function(t){t.DomComponents.clear(),t.CssComposer.clear()},o["core:copy"]=function(t){var e=t.getModel(),n=t.getSelected();n&&n.get("copyable")&&!t.Canvas.isInputFocused()&&e.set("clipboard",n)},o["core:paste"]=function(t){var e=t.getModel(),n=e.get("clipboard"),r=t.getSelected(),i=r&&r.collection;if(i&&n&&!t.Canvas.isInputFocused()){var o=i.indexOf(r)+1;i.add(n.clone(),{at:o})}},e.em&&(e.model=e.em.get("Canvas")),this.loadDefaultCommands(),this},add:l,get:function(t){var n=i[t];return"function"==typeof n&&(n=new n(e),i[t]=n),n},has:function(t){return!!i[t]},loadDefaultCommands:function(){for(var t in o)this.add(t,o[t]);return this}}}},function(t,e,n){"use strict";t.exports={ESCAPE_KEY:27,stylePrefix:"com-",defaults:[],em:null,firstCentered:!0,newFixedH:!1,minComponentH:50,minComponentW:50}},function(t,e,n){"use strict";(function(e){var n=e.$;t.exports=e.View.extend({initialize:function(t){this.config=t||{},this.editorModel=this.em=this.config.em||{},this.pfx=this.config.stylePrefix,this.ppfx=this.config.pStylePrefix,this.hoverClass=this.pfx+"hover",this.badgeClass=this.pfx+"badge",this.plhClass=this.pfx+"placeholder",this.freezClass=this.ppfx+"freezed",this.canvas=this.em.get&&this.em.get("Canvas"),this.em.get&&this.setElement(this.getCanvas()),this.canvas&&(this.$canvas=this.$el,this.$wrapper=n(this.getCanvasWrapper()),this.frameEl=this.canvas.getFrameEl(),this.canvasTool=this.getCanvasTools(),this.bodyEl=this.getCanvasBody()),this.init(this.config)},onFrameScroll:function(t){},getCanvas:function(){return this.canvas.getElement()},getCanvasBody:function(){return this.canvas.getBody()},getCanvasWrapper:function(){return this.canvas.getWrapperEl()},getCanvasTools:function(){return this.canvas.getToolsEl()},offset:function(t){var e=t.getBoundingClientRect();return{top:e.top+t.ownerDocument.body.scrollTop,left:e.left+t.ownerDocument.body.scrollLeft}},init:function(t){},run:function(t,e){},
stop:function(t,e){}})}).call(e,n(0))},function(t,e,n){"use strict";(function(e){var n=e.$;t.exports={run:function(t,e){arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e&&e.set&&e.set("active",0);var r=t.getConfig(),i=t.Modal,o=r.stylePrefix;if(this.cm=t.CodeManager||null,!this.$editors){var s=this.buildEditor("htmlmixed","hopscotch","HTML"),a=this.buildEditor("css","hopscotch","CSS");this.htmlEditor=s.el,this.cssEditor=a.el;var l=n('<div class="'+o+'export-dl"></div>');l.append(s.$el).append(a.$el),this.$editors=l}i.setTitle(r.textViewCode),i.setContent(this.$editors),i.open(),this.htmlEditor.setContent(t.getHtml()),this.cssEditor.setContent(t.getCss())},stop:function(t){var e=t.Modal;e&&e.close()},buildEditor:function(t,e,n){var r=document.createElement("textarea");!this.codeMirror&&(this.codeMirror=this.cm.getViewer("CodeMirror"));var i=this.codeMirror.clone().set({label:n,codeName:t,theme:e,input:r}),o=new this.cm.EditorView({model:i,config:this.cm.getConfig()}).render().$el;return i.init(r),{el:i,$el:o}}}}).call(e,n(0))},function(t,e,n){"use strict";var r=(n(0),n(49)),i=n(188);t.exports=r.extend({itemView:i,initialize:function(t){this.config={editor:t.editor||""},this.listenTo(this.collection,"reset",this.render)}})},function(t,e,n){"use strict";var r=n(0);t.exports=r.View.extend({events:function(){return this.model.get("events")||{mousedown:"handleClick"}},attributes:function(){return this.model.get("attributes")},initialize:function(t){this.editor=t.config.editor},handleClick:function(t){t.preventDefault(),t.stopPropagation(),this.execCommand(t)},execCommand:function(t){var e={event:t},n=this.model.get("command"),r=this.editor;"function"==typeof n&&n(r,null,e),"string"==typeof n&&r.runCommand(n,e)},render:function(){var t=this.editor.getConfig();return this.el.className+=" "+t.stylePrefix+"toolbar-item",this}})},function(t,e,n){"use strict";var r=n(0),i=n(190);t.exports=r.Collection.extend({model:i})},function(t,e,n){"use strict";var r=n(0);t.exports=r.Model.extend({defaults:{command:"",attributes:{}}})},function(t,e,n){"use strict";(function(e,r){var i=n(21),o=e.$;t.exports=r.extend({},i,{init:function(t){r.bindAll(this,"startDelete","stopDelete","onDelete"),this.hoverClass=this.pfx+"hover-delete",this.badgeClass=this.pfx+"badge-red"},enable:function(){this.$el.find("*").mouseover(this.startDelete).mouseout(this.stopDelete).click(this.onDelete)},startDelete:function(t){t.stopPropagation();var e=o(t.target);e.data("model").get("removable")&&(e.addClass(this.hoverClass),this.attachBadge(e.get(0)))},stopDelete:function(t){t.stopPropagation();var e=o(t.target);e.removeClass(this.hoverClass),this.badge&&this.badge.css({left:-1e3,top:-1e3})},onDelete:function(t){t.stopPropagation();var e=o(t.target);e.data("model").get("removable")&&(e.data("model").destroy(),this.removeBadge(),this.clean())},updateBadgeLabel:function(t){this.badge.html("Remove "+t.getName())}})}).call(e,n(0),n(1))},function(t,e,n){"use strict";(function(e){var r=(n(0),n(55));t.exports=e.extend({},r,{beforeInsert:function(t){t.type="image",t.style={},t.attributes={},t.attributes.onmousedown="return false",this.config.firstCentered&&this.getCanvasWrapper()==this.sorter.target&&(t.style.margin="0 auto")},afterInsert:function(t){t.trigger("dblclick"),this.sender&&this.sender.set("active",!1)}})}).call(e,n(1))},function(t,e,n){"use strict";(function(e,r){var i=n(2),o=n(21),s=n(54),a=e.$;t.exports=r.extend({},s,o,{init:function(t){o.init.apply(this,arguments),r.bindAll(this,"initSorter","rollback","onEndMove"),this.opt=t,this.hoverClass=this.ppfx+"highlighter-warning",this.badgeClass=this.ppfx+"badge-warning",this.noSelClass=this.ppfx+"no-select"},enable:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];o.enable.apply(this,e),this.getBadgeEl().addClass(this.badgeClass),this.getHighlighterEl().addClass(this.hoverClass);var r=this.$wrapper;r.css("cursor","move"),r.on("mousedown",this.initSorter),r.addClass(this.noSelClass)},toggleClipboard:function(){},initSorter:function(t){var e=a(t.target).data("model"),n=e.get("draggable");n&&(this.cacheEl=null,this.startSelectPosition(t.target,this.frameEl.contentDocument),this.sorter.draggable=n,this.sorter.onEndMove=this.onEndMove.bind(this),this.stopSelectComponent(),this.$wrapper.off("mousedown",this.initSorter),(0,i.on)(this.getContentWindow(),"keydown",this.rollback))},initSorterFromModel:function(t){var e=t.get("draggable");if(e){this.cacheEl=null;var n=t.view.el;this.startSelectPosition(n,this.frameEl.contentDocument),this.sorter.draggable=e,this.sorter.onEndMove=this.onEndMoveFromModel.bind(this),this.stopSelectComponent(),(0,i.on)(this.getContentWindow(),"keydown",this.rollback)}},onEndMoveFromModel:function(){(0,i.off)(this.getContentWindow(),"keydown",this.rollback)},onEndMove:function(){this.enable(),(0,i.off)(this.getContentWindow(),"keydown",this.rollback)},onSelect:function(t,e){},rollback:function(t,e){var n=t.which||t.keyCode;(n==this.opt.ESCAPE_KEY||e)&&(this.sorter.moved=!1,this.sorter.endMove())},getBadgeEl:function(){return this.$badge||(this.$badge=a(this.getBadge())),this.$badge},getHighlighterEl:function(){return this.$hl||(this.$hl=a(this.canvas.getHighlighter())),this.$hl},stop:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];o.stop.apply(this,e),this.getBadgeEl().removeClass(this.badgeClass),this.getHighlighterEl().removeClass(this.hoverClass);var r=this.$wrapper;r.css("cursor","").unbind().removeClass(this.noSelClass)}})}).call(e,n(0),n(1))},function(t,e,n){"use strict";(function(e){var r=(n(0),n(22));t.exports=e.extend({},r,{beforeDraw:function(t){t.type="text",t.style||(t.style={}),t.style.padding="10px"},afterDraw:function(t){t&&t.set&&(t.trigger("focus"),this.sender&&this.sender.set("active",!1))}})}).call(e,n(1))},function(t,e,n){"use strict";t.exports={run:function(t){t.Canvas.getBody().className=this.ppfx+"dashed"},stop:function(t){t.Canvas.getBody().className=""}}},function(t,e,n){"use strict";(function(e){var r=n(197),i=e.$;t.exports={run:function(t,e){if(!this.toAppend){var n=t.DomComponents.getComponent().get("components"),o=t.getConfig(),s=o.stylePrefix,a=t.Panels,l=o.layers.stylePrefix||"nv-";o.layers.stylePrefix=o.stylePrefix+l,o.layers.pStylePrefix=o.stylePrefix,o.layers.em=t.editor,o.layers.opened=t.editor.get("opened"),a.getPanel("views-container")?this.panel=a.getPanel("views-container"):this.panel=a.addPanel({id:"views-container"});var c=i('<div class="'+s+'layers"></div>');this.panel.set("appendContent",c).trigger("change:appendContent"),o.layers.sortContainer=c.get(0);var u=(new r).init(n,o.layers);this.$layers=u.render(),c.append(this.$layers),this.toAppend=c}this.toAppend.show()},stop:function(){this.toAppend&&this.toAppend.hide()}}}).call(e,n(0))},function(t,e,n){"use strict";t.exports=function(){var t=void 0,e={},r=n(198),i=n(56),o=n(57);return{init:function(n,s){e=s||e;var a=e.em;for(var l in r)l in e||(e[l]=r[l]);var c=o,u=0,h=s.opened||{},f={level:u,config:e,opened:h};return e.showWrapper&&n.parent?(c=i,f.model=n.parent):f.collection=n,t=new c(f),a&&a.on("change:selectedComponent",this.componentChanged),this.componentChanged(),this},componentChanged:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!r.fromLayers){var i=e.em,o=i.get("opened"),s=i.get("selectedComponent"),a=s&&s.collection?s.collection.parent:null;for(var l in o)o[l].set("open",0);for(;a;)a.set("open",1),o[a.cid]=a,a=a.collection?a.collection.parent:null}},render:function(){return t.render().$el}}}},function(t,e,n){"use strict";t.exports={stylePrefix:"nv-",sortable:1,hidable:1,hideTextnode:1,showWrapper:1}},function(t,e,n){"use strict";var r=(n(31),n(0)),i=r.$;t.exports={run:function(t,e){if(this.sender=e,!this.$cn){var n=t.getConfig(),r=t.Panels;this.$cn=i("<div></div>"),this.$cn2=i("<div></div>"),this.$cn.append(this.$cn2);var o=t.DeviceManager;if(o&&n.showDevices){var s=r.addPanel({id:"devices-c"});s.set("appendContent",o.render()).trigger("change:appendContent")}var a=t.SelectorManager;a&&this.$cn2.append(a.render([])),this.$cn2.append(t.StyleManager.render());var l=t.StyleManager.getConfig(),c=l.stylePrefix;this.$header=i('<div class="'+c+'header">'+l.textNoElement+"</div>"),this.$cn.append(this.$header),r.getPanel("views-container")?this.panel=r.getPanel("views-container"):this.panel=r.addPanel({id:"views-container"}),this.panel.set("appendContent",this.$cn).trigger("change:appendContent"),this.target=t.editor,this.listenTo(this.target,"change:selectedComponent",this.toggleSm)}this.toggleSm()},toggleSm:function(){var t=this.sender;t&&t.get&&!t.get("active")||(this.target.get("selectedComponent")?(this.$cn2.show(),this.$header.hide()):(this.$cn2.hide(),this.$header.show()))},stop:function(){this.$cn2&&this.$cn2.hide(),this.$header&&this.$header.hide()}}},function(t,e,n){"use strict";(function(e){var n=e.$;t.exports={run:function(t,e){var r,i=t.Config,o=i.stylePrefix,s=t.TraitManager;if(!this.obj){var a=s.getTraitsViewer(),l=s.getConfig();this.obj=n("<div></div>").append('<div class="'+o+'traits-label">'+l.labelContainer+"</div>").get(0),this.obj.appendChild(a.render().el);var c=t.Panels;r=c.getPanel("views-container")?c.getPanel("views-container"):c.addPanel({id:"views-container"}),r.set("appendContent",this.obj).trigger("change:appendContent")}this.obj.style.display="block"},stop:function(){this.obj&&(this.obj.style.display="none")}}}).call(e,n(0))},function(t,e,n){"use strict";t.exports={run:function(t,e){var n=t.BlockManager,r=t.Panels;if(!this.blocks){n.render();var i="views-container",o=document.createElement("div"),s=r.getPanel(i)||r.addPanel({id:i});o.appendChild(n.getContainer()),s.set("appendContent",o).trigger("change:appendContent"),this.blocks=o}this.blocks.style.display="block"},stop:function(){var t=this.blocks;t&&(t.style.display="none")}}},function(t,e,n){"use strict";t.exports={run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.Modal,i=t.AssetManager,o=i.getConfig(),s=n.modalTitle||o.modalTitle||"";i.setTarget(n.target),i.onClick(n.onClick),i.onDblClick(n.onDblClick),i.onSelect(n.onSelect),this.rendered||(i.render(i.getAll().filter(function(t){return"image"==t.get("type")})),this.rendered=1),r.setTitle(s),r.setContent(i.getContainer()),r.open()}}},function(t,e,n){"use strict";(function(e){var n=e.$;t.exports={getOffsetMethod:function(t){var e=t||"";return"get"+e+"OffsetViewerEl"},run:function(t,e,r){var i=r||{},o=i.state||"",s=t.getConfig();if(s.showOffsets&&(s.showOffsetsSelected||"Fixed"!=o)){var a=t.Canvas,l=i.el||"",c=i.elPos||a.getElementPos(l),u=window.getComputedStyle(l),h=this.ppfx,f=o+"State",d=this.getOffsetMethod(o),p=a[d]();p.style.display="block";var g=this["marginT"+o],v=this["marginB"+o],m=this["marginL"+o],y=this["marginR"+o],b=this["padT"+o],w=this["padB"+o],x=this["padL"+o],_=this["padR"+o];if(!this[f]){var C=o.toLowerCase(),k=C+"margin-v",S=C+"padding-v",T=n('<div class="'+h+'marginName">').get(0),E=n('<div class="'+h+'paddingName">').get(0),A=h+k+"-el",O=h+S+"-el",M=A+" "+(h+k),L=O+" "+(h+S);g=n('<div class="'+M+'-top"></div>').get(0),v=n('<div class="'+M+'-bottom"></div>').get(0),m=n('<div class="'+M+'-left"></div>').get(0),y=n('<div class="'+M+'-right"></div>').get(0),b=n('<div class="'+L+'-top"></div>').get(0),w=n('<div class="'+L+'-bottom"></div>').get(0),x=n('<div class="'+L+'-left"></div>').get(0),_=n('<div class="'+L+'-right"></div>').get(0),this["marginT"+o]=g,this["marginB"+o]=v,this["marginL"+o]=m,this["marginR"+o]=y,this["padT"+o]=b,this["padB"+o]=w,this["padL"+o]=x,this["padR"+o]=_,T.appendChild(g),T.appendChild(v),T.appendChild(m),T.appendChild(y),E.appendChild(b),E.appendChild(w),E.appendChild(x),E.appendChild(_),p.appendChild(T),p.appendChild(E),this[f]="1"}var P="px",j=u.marginLeft.replace(P,""),D=parseInt(u.marginTop.replace(P,"")),N=parseInt(u.marginBottom.replace(P,"")),I=g.style,R=v.style,B=m.style,F=y.style,z=b.style,$=w.style,V=x.style,H=_.style,U=parseInt(c.left);I.height=u.marginTop,I.width=u.width,I.top=c.top-u.marginTop.replace(P,"")+P,I.left=U+P,R.height=u.marginBottom,R.width=u.width,R.top=c.top+c.height+P,R.left=U+P;var q=c.height+D+N+P,W=c.top-D+P;B.height=q,B.width=u.marginLeft,B.top=W,B.left=U-j+P,F.height=q,F.width=u.marginRight,F.top=W,F.left=U+c.width+P;var G=parseInt(u.paddingTop.replace(P,""));z.height=u.paddingTop,z.width=u.width,z.top=c.top+P,z.left=U+P;var Y=parseInt(u.paddingBottom.replace(P,""));$.height=u.paddingBottom,$.width=u.width,$.top=c.top+c.height-Y+P,$.left=U+P;var K=c.height-Y-G+P,X=c.top+G+P;V.height=K,V.width=u.paddingLeft,V.top=X,V.left=c.left+P;var J=parseInt(u.paddingRight.replace(P,""));H.height=K,H.width=u.paddingRight,H.top=X,H.left=c.left+c.width-J+P}},stop:function(t,e,n){var r=n||{},i=r.state||"",o=this.getOffsetMethod(i),s=t.Canvas,a=s[o]();a.style.display="none"}}}).call(e,n(0))},function(t,e,n){"use strict";t.exports={run:function(t){for(var e=t.getSelected(),n=e&&e.parent();n&&!n.get("selectable");)n=n.parent();n&&t.select(n)}}},function(t,e,n){"use strict";t.exports={isEnabled:function(){var t=document;return t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement?1:0},enable:function(t){var e="";return t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?(e="webkit",t.webkitRequestFullscreen()):t.mozRequestFullScreen?(e="moz",t.mozRequestFullScreen()):t.msRequestFullscreen&&t.msRequestFullscreen(),e},disable:function(){var t=document;t.exitFullscreen?t.exitFullscreen():t.webkitExitFullscreen?t.webkitExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.msExitFullscreen&&t.msExitFullscreen()},fsChanged:function(t,e){var n=(document,(t||"")+"fullscreenchange");this.isEnabled()||(this.stop(null,this.sender),document.removeEventListener(n,this.fsChanged))},run:function(t,e){this.sender=e;var n=this.enable(t.getContainer());this.fsChanged=this.fsChanged.bind(this,n),document.addEventListener(n+"fullscreenchange",this.fsChanged),t&&t.trigger("change:canvasOffset")},stop:function(t,e){e&&e.set&&e.set("active",!1),this.disable(),t&&t.trigger("change:canvasOffset")}}},function(t,e,n){"use strict";(function(e){t.exports={getPanels:function(t){return this.panels||(this.panels=t.Panels.getPanelsEl()),this.panels},tglPointers:function(t,n){var r=t.Canvas.getBody().querySelectorAll("."+this.ppfx+"no-pointer");e.each(r,function(t){t.style.pointerEvents=n?"":"all"})},run:function(t,e){e&&e.set&&e.set("active",!1),t.stopCommand("sw-visibility"),t.getModel().stopDefault();var n=this.getPanels(t),r=t.Canvas.getElement(),i=t.getEl(),o=t.Config.stylePrefix;this.helper||(this.helper=document.createElement("span"),this.helper.className=o+"off-prv fa fa-eye-slash",i.appendChild(this.helper),this.helper.onclick=function(){t.stopCommand("preview")}),this.helper.style.display="inline-block",this.tglPointers(t),n.style.display="none";var s=r.style;s.width="100%",s.height="100%",s.top="0",s.left="0",s.padding="0",s.margin="0",t.trigger("change:canvasOffset")},stop:function(t,e){var n=this.getPanels(t);t.runCommand("sw-visibility"),t.getModel().runDefault(),n.style.display="block";var r=t.Canvas.getElement();r.setAttribute("style",""),this.helper&&(this.helper.style.display="none"),t.trigger("change:canvasOffset"),this.tglPointers(t,1)}}}).call(e,n(1))},function(t,e,n){"use strict";t.exports={run:function(t,e,n){var r=n||{},i=r.el||"",o=t.Canvas,s=this.canvasResizer,a=r.options||{},l=o.getCanvasView();return a.ratioDefault=1,a.appendTo=o.getResizerEl(),a.prefix=t.getConfig().stylePrefix,a.posFetcher=l.getElementPos.bind(l),a.mousePosFetcher=o.getMouseRelativePos,s&&!r.forceNew||(this.canvasResizer=t.Utils.Resizer.init(a),s=this.canvasResizer),s.setOptions(a),s.focus(i),s},stop:function(){var t=this.canvasResizer;t&&t.blur()}}},function(t,e,n){"use strict";t.exports={run:function(t,e,n){var r=n&&n.el||"",i=t.Canvas,o=this.dragger,s=n.options||{},a=i.getCanvasView();return s.prefix=t.getConfig().stylePrefix,s.mousePosFetcher=i.getMouseRelativePos,s.posFetcher=a.getElementPos.bind(a),o||(o=t.Utils.Dragger.init(s),this.dragger=o),o.setOptions(s),o.focus(r),s.event&&o.start(s.event),o},stop:function(){this.canvasResizer&&this.canvasResizer.blur()}}},function(t,e,n){"use strict";t.exports=function(){var t,e,r,i={},o=n(210),s=n(211),a=n(213),l=n(214),c=[];return{name:"BlockManager",init:function(n){i=n||{};var u=i.em;for(var h in o)h in i||(i[h]=o[h]);return t=new s([]),e=new s([]),c=new a,r=new l({collection:e,categories:c},i),t.listenTo(t,"add",function(t){e.add(t),u&&u.trigger("block:add",t)}),t.listenTo(t,"remove",function(t){e.remove(t),u&&u.trigger("block:remove",t)}),t.listenTo(t,"reset",function(t){e.reset(t.models)}),this},getConfig:function(){return i},onLoad:function(){var t=this.getAll();!t.length&&t.reset(i.blocks)},add:function(e,n){var r=n||{};return r.id=e,t.add(r)},get:function(e){return t.get(e)},getAll:function(){return t},getAllVisible:function(){return e},remove:function(e){return t.remove(e)},getCategories:function(){return c},getContainer:function(){return r.el},render:function(t){var e=t||this.getAll().models;r.rendered||(r.render(),r.rendered=1),r.collection.reset(e)}}}},function(t,e,n){"use strict";t.exports={blocks:[],appendTo:""}},function(t,e,n){"use strict";var r=n(0),i=n(212);t.exports=r.Collection.extend({model:i})},function(t,e,n){"use strict";var r=n(0),i=n(58);t.exports=r.Model.extend({defaults:{label:"",content:"",category:"",attributes:{}},initialize:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},this.get("category"));if(t&&"string"==typeof t){new i({id:t,label:t})}}})},function(t,e,n){"use strict";var r=n(0);t.exports=r.Collection.extend({model:n(58)})},function(t,e,n){"use strict";(function(e){var r=n(1),i=n(215),o=n(216);t.exports=n(0).View.extend({initialize:function(t,n){e.bindAll(this,"getSorter","onDrag","onDrop"),this.config=n||{},this.categories=t.categories||"",this.renderedCategories=[];var r=this.config.pStylePrefix||"";this.ppfx=r,this.noCatClass=r+"blocks-no-cat",this.blockContClass=r+"blocks-c",this.catsClass=r+"block-categories";var i=this.collection;this.listenTo(i,"add",this.addTo),this.listenTo(i,"reset",this.render),this.em=this.config.em,this.tac="test-tac",this.grabbingCls=this.ppfx+"grabbing",this.em&&(this.config.getSorter=this.getSorter,this.canvas=this.em.get("Canvas"))},getSorter:function(){if(this.em){if(!this.sorter){var t=this.em.get("Utils"),e=this.canvas;this.sorter=new t.Sorter({container:e.getBody(),placer:e.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:this.ppfx,onStart:this.onDrag,onEndMove:this.onDrop,onMove:this.onMove,document:e.getFrameEl().contentDocument,direction:"a",wmargin:1,nested:1,em:this.em,canvasRelative:1})}return this.sorter}},onDrag:function(t){this.em.stopDefault(),this.em.trigger("block:drag:start",t)},onMove:function(t){this.em.trigger("block:drag:move",t)},onDrop:function(t){var e=this.em;e.runDefault(),t&&t.get&&(t.get("activeOnRender")&&(t.trigger("active"),t.set("activeOnRender",0)),e.trigger("block:drag:stop",t))},addTo:function(t){this.add(t)},add:function(t,e){var n=e||null,s=new i({model:t,attributes:t.get("attributes")},this.config),a=s.render().el,l=t.get("category");if(l&&this.categories){(0,r.isString)(l)?l={id:l,label:l}:(0,r.isObject)(l)&&!l.id&&(l.id=l.label);var c=this.categories.add(l),u=c.get("id"),h=this.renderedCategories[u],f=this.getCategoriesEl();return t.set("category",c),!h&&f&&(h=new o({model:c},this.config).render(),this.renderedCategories[u]=h,f.appendChild(h.el)),void(h&&h.append(a))}n?n.appendChild(a):this.append(a)},getCategoriesEl:function(){return this.catsEl||(this.catsEl=this.el.querySelector("."+this.catsClass)),this.catsEl},getBlocksEl:function(){return this.blocksEl||(this.blocksEl=this.el.querySelector("."+this.noCatClass+" ."+this.blockContClass)),this.blocksEl},append:function(t){var e=this.getBlocksEl();e&&e.appendChild(t)},render:function(){var t=this,e=document.createDocumentFragment();return this.catsEl=null,this.blocksEl=null,this.renderedCategories=[],this.el.innerHTML='\n <div class="'+this.catsClass+'"></div>\n <div class="'+this.noCatClass+'">\n <div class="'+this.blockContClass+'"></div>\n </div>\n ',this.collection.each(function(n){return t.add(n,e)}),this.append(e),this.$el.addClass(this.blockContClass+"s"),this}})}).call(e,n(1))},function(t,e,n){"use strict";(function(e){var r=n(1),i=n(2);t.exports=e.View.extend({events:{mousedown:"startDrag",dragstart:"handleDragStart",dragend:"handleDragEnd"},initialize:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.em=e.em,this.config=e,this.endDrag=this.endDrag.bind(this),this.ppfx=e.pStylePrefix||"",this.listenTo(this.model,"destroy remove",this.remove)},startDrag:function(t){var e=this.config;if(0===t.button&&e.getSorter&&!this.el.draggable){e.em.refreshCanvas();var n=e.getSorter();n.setDragHelper(this.el,t),n.setDropContent(this.model.get("content")),n.startSort(this.el),(0,i.on)(document,"mouseup",this.endDrag)}},handleDragStart:function(t){var e=this.model.get("content"),n=(0,r.isObject)(e),i=n?"text/json":"text",o=n?JSON.stringify(e):e;t.dataTransfer.setData(i,o),this.em.set("dragContent",e)},handleDragEnd:function(){this.em.set("dragContent","")},endDrag:function(t){(0,i.off)(document,"mouseup",this.endDrag);var e=this.config.getSorter();e.moved=0,e.endMove()},render:function(){var t=this.el,e=this.ppfx,n=e+"block",r=this.model.get("label");return t.className+=" "+n+" "+e+"one-bg "+e+"four-color-h",t.innerHTML='<div class="'+n+'-label">'+r+"</div>",(0,i.hasDnd)(this.em)&&t.setAttribute("draggable",!0),this}})}).call(e,n(0))},function(t,e,n){"use strict";(function(e){var r=n(0);t.exports=r.View.extend({template:e.template('\n <div class="<%= pfx %>title">\n <i class="<%= pfx %>caret-icon"></i>\n <%= label %>\n </div>\n <div class="<%= pfx %>blocks-c"></div>\n '),events:{},initialize:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});this.config=t;var e=this.config.pStylePrefix||"";this.pfx=e,this.caretR="fa fa-caret-right",this.caretD="fa fa-caret-down",this.iconClass=e+"caret-icon",this.activeClass=e+"open",this.className=e+"block-category",this.events["click ."+e+"title"]="toggle",this.listenTo(this.model,"change:open",this.updateVisibility),this.delegateEvents()},updateVisibility:function(){this.model.get("open")?this.open():this.close()},open:function(){this.el.className=this.className+" "+this.activeClass,this.getIconEl().className=this.iconClass+" "+this.caretD,this.getBlocksEl().style.display=""},close:function(){this.el.className=this.className,this.getIconEl().className=this.iconClass+" "+this.caretR,this.getBlocksEl().style.display="none"},toggle:function(){var t=this.model;t.set("open",!t.get("open"))},getIconEl:function(){return this.iconEl||(this.iconEl=this.el.querySelector("."+this.iconClass)),this.iconEl},getBlocksEl:function(){return this.blocksEl||(this.blocksEl=this.el.querySelector("."+this.pfx+"blocks-c")),this.blocksEl},append:function(t){this.getBlocksEl().appendChild(t)},render:function(){return this.el.innerHTML=this.template({pfx:this.pfx,label:this.model.get("label")}),this.el.className=this.className,this.$el.css({order:this.model.get("order")}),this.updateVisibility(),this}})}).call(e,n(1))},function(t,e,n){"use strict";var r=n(1);t.exports=function(t){var e=t.$,n=t.Backbone;if(n){var i=n.View.prototype,o={};i.eventNsMap=o,i.delegate=function(t,e,n){var r=".delegateEvents"+this.cid;this.$el.on(t,e,n);var i=o[r];return i||(i=[],o[r]=i),i.push({eventName:t,selector:e,listener:n}),this},i.undelegateEvents=function(){var t=this,e=".delegateEvents"+this.cid;if(this.$el){var n=o[e];n&&n.forEach(function(e){var n=e.eventName;e.selector,e.listener;t.$el.off(n)})}return this},i.undelegate=function(t,e,n){var r=this,i=".delegateEvents"+this.cid,s=o[i];return s&&s.forEach(function(n){var i=n.eventName,o=n.selector;n.listener;i==t&&o==e&&r.$el.off(i)}),this}}if(e&&"jQuery"!==e.prototype.constructor.name){var s=e.fn,a=e.prototype.on,l=e.prototype.off,c=e.prototype.trigger,u=e.prototype.offset,h=function(t){return t.split(/[,\s]+/g)},f=function(t){return t.split(".")};s.on=function(t,e,n,r){var i=this;if("string"==typeof t){var o=h(t);if(1==o.length){t=o[0];var s=f(t);if(0!==t.indexOf(".")&&(t=s[0]),s=s.slice(1),s.length){this.data("_cashNs")||[];this.data("_cashNs",s)}return a.call(this,t,e,n,r)}return o.forEach(function(t){return i.on(t,e,n,r)}),this}return a.call(this,t,e,n,r)},s.off=function(t,e){var n=this;if("string"==typeof t){var r=h(t);if(1==r.length){t=r[0];var i=f(t);return 0!==t.indexOf(".")&&(t=i[0]),i=i.slice(1),i.length,l.call(this,t,e)}return r.forEach(function(t){return n.off(t,e)}),this}return l.call(this,t,e)},s.trigger=function(t,n){var r=this;if(t instanceof e.Event)return this.trigger(t.type,n);if("string"==typeof t){var i=h(t);if(1==i.length){t=i[0];var o=f(t);return 0!==t.indexOf(".")&&(t=o[0]),o=o.slice(1),o.length,c.call(this,t,n)}return i.forEach(function(t){return r.trigger(t,n)}),this}return c.call(this,t,n)},s.hide=function(){return this.css("display","none")},s.show=function(){return this.css("display","block")},s.focus=function(){var t=this.get(0);return t&&t.focus(),this},s.remove=function(){return this.each(function(t){return t.parentNode&&t.parentNode.removeChild(t)})},s.bind=function(t,e){return this.on(t,e)},s.unbind=function(t,e){if((0,r.isObject)(t)){for(var n in t)t.hasOwnProperty(n)&&this.off(n,t[n]);return this}return this.off(t,e)},s.click=function(t){return t?this.on("click",t):this.trigger("click")},s.change=function(t){return t?this.on("change",t):this.trigger("change")},s.keydown=function(t){return t?this.on("keydown",t):this.trigger("keydown")},s.delegate=function(t,e,n,r){return r||(r=n),this.on(e,t,function(t){t.data=n,r(t)})},s.scrollLeft=function(){var t=this.get(0);t=9==t.nodeType?t.defaultView:t;var e=t instanceof Window?t:null;return e?e.pageXOffset:t.scrollLeft||0},s.scrollTop=function(){var t=this.get(0);t=9==t.nodeType?t.defaultView:t;var e=t instanceof Window?t:null;return e?e.pageYOffset:t.scrollTop||0},s.offset=function(t){var e=void 0,n=void 0;return t&&(e=t.top,n=t.left),"undefined"!=typeof e&&this.css("top",e+"px"),"undefined"!=typeof n&&this.css("left",n+"px"),u.call(this)},e.map=function(t,e){for(var n=[],r=0;r<t.length;r++)n.push(e(t[r],r));return n};var d=Array.prototype.indexOf;e.inArray=function(t,e,n){return null==e?-1:d.call(e,t,n)},e.Event=function(t,n){return this instanceof e.Event?(this.type=t,void(this.isDefaultPrevented=function(){return!1})):new e.Event(t,n)}}}},function(t,e,n){"use strict";(function(e){var n=e.$;t.exports=e.View.extend({initialize:function(){var t=this,e=this.model;e.view=this,this.conf=e.config,this.pn=e.get("Panels"),e.on("loaded",function(){t.pn.active(),t.pn.disableButtons(),e.runDefault(),setTimeout(function(){return e.trigger("load")},0)})},render:function(){var t=this.model,e=this.$el,r=this.conf,i=n(r.el||"body "+r.container),o=r.stylePrefix;return e.empty(),r.width&&i.css("width",r.width),r.height&&i.css("height",r.height),e.append(t.get("Canvas").render()),e.append(this.pn.render()),e.attr("class",o+"editor "+o+"one-bg "+o+"two-color"),i.addClass(o+"editor-cont").empty().append(e),this}})}).call(e,n(0))},function(t,e,n){"use strict";t.exports=function(t){var e=t||{},r=n(220);for(var i in r)i in e||(e[i]=r[i]);var o={};return{add:function(t,e){return o[t]?o[t]:(o[t]=e,e)},get:function(t){return o[t]},getAll:function(){return o}}}},function(t,e,n){"use strict";t.exports={plugins:[]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=function(){var t=function(){for(var t=void 0,e=window.navigator.userAgent,n=[["edge",/Edge\/([0-9\._]+)/],["ie",/MSIE\s(7\.0)/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/]],r=0;r<n.length;r++){var i=n[r];if(t=i[1].exec(e))break}return!!t};if(t()){var e=DOMImplementation.prototype.createHTMLDocument;DOMImplementation.prototype.createHTMLDocument=function(t){return t||(t=""),e.apply(document.implementation,[t])}}}}])}),!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("grapesjs")):"function"==typeof define&&define.amd?define(["grapesjs"],e):"object"==typeof exports?exports["grapesjs-blocks-basic"]=e(require("grapesjs")):t["grapesjs-blocks-basic"]=e(t.grapesjs)}(this,function(t){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t["default"]}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(1),o=function(t){return t&&t.__esModule?t:{"default":t}}(i);e["default"]=o["default"].plugins.add("gjs-blocks-basic",function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r({blocks:["column1","column2","column3","column3-7","text","link","image","video","map"],stylePrefix:"",addBasicStyle:!0,labelColumn1:"1 Column",labelColumn2:"2 Columns",labelColumn3:"3 Columns",labelColumn37:"2 Columns 3/7",labelText:"Text",labelLink:"Link",labelImage:"Image",labelVideo:"Video",labelMap:"Map"},e);n(2)["default"](t,i)})},function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e,r=t.BlockManager,i=n.blocks,o=n.stylePrefix,s=n.addBasicStyle,a="\n ."+o+"row {\n display: table;\n padding: 10px;\n width: 100%;\n }\n @media (max-width: 768px) {\n ."+o+"cell, ."+o+"cell30, ."+o+"cell70 {\n width: 100%;\n display: block;\n }\n }",l="\n ."+o+"cell {\n width: 8%;\n display: table-cell;\n height: 75px;\n }",c="\n ."+o+"cell30 {\n width: 30%;\n }",u="\n ."+o+"cell70 {\n width: 70%;\n }";i.indexOf("column1")>=0&&r.add("column1",{label:n.labelColumn1,category:"Basic",attributes:{"class":"gjs-fonts gjs-f-b1"},content:'<div class="'+o+'row" data-gjs-droppable=".'+o+'cell" data-gjs-custom-name="Row">\n <div class="'+o+'cell" data-gjs-draggable=".'+o+'row" data-gjs-custom-name="Cell"></div>\n </div>\n '+(s?"<style>\n "+a+"\n "+l+"\n </style>":"")}),i.indexOf("column2")>=0&&r.add("column2",{label:n.labelColumn2,attributes:{"class":"gjs-fonts gjs-f-b2"},category:"Basic",content:'<div class="'+o+'row" data-gjs-droppable=".'+o+'cell" data-gjs-custom-name="Row">\n <div class="'+o+'cell" data-gjs-draggable=".'+o+'row" data-gjs-custom-name="Cell"></div>\n <div class="'+o+'cell" data-gjs-draggable=".'+o+'row" data-gjs-custom-name="Cell"></div>\n </div>\n '+(s?"<style>\n "+a+"\n "+l+"\n </style>":"")}),i.indexOf("column3")>=0&&r.add("column3",{label:n.labelColumn3,category:"Basic",attributes:{"class":"gjs-fonts gjs-f-b3"},content:'<div class="'+o+'row" data-gjs-droppable=".'+o+'cell" data-gjs-custom-name="Row">\n <div class="'+o+'cell" data-gjs-draggable=".'+o+'row" data-gjs-custom-name="Cell"></div>\n <div class="'+o+'cell" data-gjs-draggable=".'+o+'row" data-gjs-custom-name="Cell"></div>\n <div class="'+o+'cell" data-gjs-draggable=".'+o+'row" data-gjs-custom-name="Cell"></div>\n </div>\n '+(s?"<style>\n "+a+"\n "+l+"\n </style>":"")
}),i.indexOf("column3-7")>=0&&r.add("column3-7",{label:n.labelColumn37,category:"Basic",attributes:{"class":"gjs-fonts gjs-f-b37"},content:'<div class="'+o+'row" data-gjs-droppable=".'+o+'cell" data-gjs-custom-name="Row">\n <div class="'+o+"cell "+o+'cell30" data-gjs-draggable=".'+o+'row" data-gjs-custom-name="Cell"></div>\n <div class="'+o+"cell "+o+'cell70" data-gjs-draggable=".'+o+'row" data-gjs-custom-name="Cell"></div>\n </div>\n '+(s?"<style>\n "+a+"\n "+l+"\n "+c+"\n "+u+"\n </style>":"")}),i.indexOf("text")>=0&&r.add("text",{label:n.labelText,category:"Basic",attributes:{"class":"gjs-fonts gjs-f-text"},content:{type:"text",content:"Insert your text here",style:{padding:"10px"},activeOnRender:1}}),i.indexOf("link")>=0&&r.add("link",{label:n.labelLink,category:"Basic",attributes:{"class":"fa fa-link"},content:{type:"link",content:"Link",style:{color:"#d983a6"}}}),i.indexOf("image")>=0&&r.add("image",{label:n.labelImage,category:"Basic",attributes:{"class":"gjs-fonts gjs-f-image"},content:{style:{color:"black"},type:"image",activeOnRender:1}}),i.indexOf("video")>=0&&r.add("video",{label:n.labelVideo,category:"Basic",attributes:{"class":"fa fa-youtube-play"},content:{type:"video",src:"img/video2.webm",style:{height:"350px",width:"615px"}}}),i.indexOf("map")>=0&&r.add("map",{label:n.labelMap,category:"Basic",attributes:{"class":"fa fa-map-o"},content:{type:"map",style:{height:"350px"}}})}}])}),!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["grapesjs-preset-newsletter"]=e():t["grapesjs-preset-newsletter"]=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t["default"]}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=46)}([function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e,n){"use strict";function r(t){return this instanceof r?(c.call(this,t),u.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",i),void 0):new r(t)}function i(){this.allowHalfOpen||this._writableState.ended||s(o,this)}function o(t){t.end()}var s=n(14),a=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=r;var l=n(9);l.inherits=n(1);var c=n(36),u=n(21);l.inherits(r,c);for(var h=a(u.prototype),f=0;f<h.length;f++){var d=h[f];r.prototype[d]||(r.prototype[d]=u.prototype[d])}Object.defineProperty(r.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),r.prototype._destroy=function(t,e){this.push(null),this.end(),s(e,t)}},function(t,e,n){function r(e,n){return delete t.exports[e],t.exports[e]=n,n}var i=n(30),o=n(56);t.exports={Parser:i,Tokenizer:n(31),ElementType:n(7),DomHandler:o,get FeedHandler(){return r("FeedHandler",n(58))},get Stream(){return r("Stream",n(59))},get WritableStream(){return r("WritableStream",n(35))},get ProxyHandler(){return r("ProxyHandler",n(72))},get DomUtils(){return r("DomUtils",n(4))},get CollectingHandler(){return r("CollectingHandler",n(83))},DefaultHandler:o,get RssHandler(){return r("RssHandler",this.FeedHandler)},parseDOM:function(t,e){var n=new o(e);return new i(n,e).end(t),n.dom},parseFeed:function(e,n){var r=new t.exports.FeedHandler(n);return new i(r,n).end(e),r.dom},createDomStream:function(t,e,n){var r=new o(t,e,n);return new i(r,e)},EVENTS:{attribute:2,cdatastart:0,cdataend:0,text:1,processinginstruction:2,comment:1,commentend:0,closetag:1,opentag:2,opentagname:1,error:1,end:0}}},function(t,e,n){var r=t.exports;[n(73),n(78),n(79),n(80),n(81),n(82)].forEach(function(t){Object.keys(t).forEach(function(e){r[e]=t[e].bind(r)})})},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";(function(t){function r(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(t,e){if(r()<e)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=o.prototype):(null===t&&(t=new o(e)),t.length=e),t}function o(t,e,n){if(!(o.TYPED_ARRAY_SUPPORT||this instanceof o))return new o(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return s(this,t,e,n)}function s(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?f(t,e,n,r):"string"==typeof e?u(t,e,n):d(t,e)}function a(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,e,n,r){return a(e),e<=0?i(t,e):void 0!==n?"string"==typeof r?i(t,e).fill(n,r):i(t,e).fill(n):i(t,e)}function c(t,e){if(a(e),t=i(t,e<0?0:0|p(e)),!o.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function u(t,e,n){if("string"==typeof n&&""!==n||(n="utf8"),!o.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|v(e,n);t=i(t,r);var s=t.write(e,n);return s!==r&&(t=t.slice(0,s)),t}function h(t,e){var n=e.length<0?0:0|p(e.length);t=i(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function f(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r),o.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=o.prototype):t=h(t,e),t}function d(t,e){if(o.isBuffer(e)){var n=0|p(e.length);return t=i(t,n),0===t.length?t:(e.copy(t,0,0,n),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||K(e.length)?i(t,0):h(t,e);if("Buffer"===e.type&&Z(e.data))return h(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function p(t){if(t>=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|t}function g(t){return+t!=t&&(t=0),o.alloc(+t)}function v(t,e){if(o.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return G(t).length;default:if(r)return U(t).length;e=(""+e).toLowerCase(),r=!0}}function m(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return P(this,e,n);case"utf8":case"utf-8":return A(this,e,n);case"ascii":return M(this,e,n);case"latin1":case"binary":return L(this,e,n);case"base64":return E(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function y(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function b(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=o.from(e,r)),o.isBuffer(e))return 0===e.length?-1:w(t,e,n,r,i);if("number"==typeof e)return e&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):w(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function w(t,e,n,r,i){function o(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}var s=1,a=t.length,l=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,l/=2,n/=2}var c;if(i){var u=-1;for(c=n;c<a;c++)if(o(t,c)===o(e,-1===u?0:c-u)){if(-1===u&&(u=c),c-u+1===l)return u*s}else-1!==u&&(c-=c-u),u=-1}else for(n+l>a&&(n=a-l),c=n;c>=0;c--){for(var h=!0,f=0;f<l;f++)if(o(t,c+f)!==o(e,f)){h=!1;break}if(h)return c}return-1}function x(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[n+s]=a}return s}function _(t,e,n,r){return Y(U(e,t.length-n),t,n,r)}function C(t,e,n,r){return Y(q(e),t,n,r)}function k(t,e,n,r){return C(t,e,n,r)}function S(t,e,n,r){return Y(G(e),t,n,r)}function T(t,e,n,r){return Y(W(e,t.length-n),t,n,r)}function E(t,e,n){return 0===e&&n===t.length?X.fromByteArray(t):X.fromByteArray(t.slice(e,n))}function A(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o=t[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a<=n){var l,c,u,h;switch(a){case 1:o<128&&(s=o);break;case 2:l=t[i+1],128==(192&l)&&(h=(31&o)<<6|63&l)>127&&(s=h);break;case 3:l=t[i+1],c=t[i+2],128==(192&l)&&128==(192&c)&&(h=(15&o)<<12|(63&l)<<6|63&c)>2047&&(h<55296||h>57343)&&(s=h);break;case 4:l=t[i+1],c=t[i+2],u=t[i+3],128==(192&l)&&128==(192&c)&&128==(192&u)&&(h=(15&o)<<18|(63&l)<<12|(63&c)<<6|63&u)>65535&&h<1114112&&(s=h)}}null===s?(s=65533,a=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=a}return O(r)}function O(t){var e=t.length;if(e<=Q)return String.fromCharCode.apply(String,t);for(var n="",r=0;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=Q));return n}function M(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function L(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function P(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=H(t[o]);return i}function j(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function D(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,n,r,i,s){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function I(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function R(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function B(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(t,e,n,r,i){return i||B(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),J.write(t,e,n,r,23,4),n+4}function z(t,e,n,r,i){return i||B(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),J.write(t,e,n,r,52,8),n+8}function $(t){if(t=V(t).replace(tt,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function V(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function H(t){return t<16?"0"+t.toString(16):t.toString(16)}function U(t,e){e=e||1/0;for(var n,r=t.length,i=null,o=[],s=0;s<r;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function q(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}function W(t,e){for(var n,r,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=t.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}function G(t){return X.toByteArray($(t))}function Y(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function K(t){return t!==t}var X=n(53),J=n(54),Z=n(29);e.Buffer=o,e.SlowBuffer=g,e.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=r(),o.poolSize=8192,o._augment=function(t){return t.__proto__=o.prototype,t},o.from=function(t,e,n){return s(null,t,e,n)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(t,e,n){return l(null,t,e,n)},o.allocUnsafe=function(t){return c(null,t)},o.allocUnsafeSlow=function(t){return c(null,t)},o.isBuffer=function(t){return!(null==t||!t._isBuffer)},o.compare=function(t,e){if(!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,s=Math.min(n,r);i<s;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},o.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(t,e){if(!Z(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return o.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=o.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var s=t[n];if(!o.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,i),i+=s.length}return r},o.byteLength=v,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},o.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},o.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},o.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?A(this,0,t):m.apply(this,arguments)},o.prototype.equals=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===o.compare(this,t)},o.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},o.prototype.compare=function(t,e,n,r,i){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,i>>>=0,this===t)return 0;for(var s=i-r,a=n-e,l=Math.min(s,a),c=this.slice(r,i),u=t.slice(e,n),h=0;h<l;++h)if(c[h]!==u[h]){s=c[h],a=u[h];break}return s<a?-1:a<s?1:0},o.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},o.prototype.indexOf=function(t,e,n){return b(this,t,e,n,!0)},o.prototype.lastIndexOf=function(t,e,n){return b(this,t,e,n,!1)},o.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return x(this,t,e,n);case"utf8":case"utf-8":return _(this,t,e,n);case"ascii":return C(this,t,e,n);case"latin1":case"binary":return k(this,t,e,n);case"base64":return S(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;o.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);var r;if(o.TYPED_ARRAY_SUPPORT)r=this.subarray(t,e),r.__proto__=o.prototype;else{var i=e-t;r=new o(i,(void 0));for(var s=0;s<i;++s)r[s]=this[s+t]}return r},o.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||D(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},o.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||D(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},o.prototype.readUInt8=function(t,e){return e||D(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,e){return e||D(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,e){return e||D(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUInt32LE=function(t,e){return e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUInt32BE=function(t,e){return e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||D(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*e)),r},o.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||D(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},o.prototype.readInt8=function(t,e){return e||D(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){e||D(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(t,e){e||D(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(t,e){return e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,e){return e||D(t,4,this.length),J.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return e||D(t,4,this.length),J.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return e||D(t,8,this.length),J.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return e||D(t,8,this.length),J.read(this,t,!1,52,8)},o.prototype.writeUIntLE=function(t,e,n,r){t=+t,e|=0,n|=0,r||N(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},o.prototype.writeUIntBE=function(t,e,n,r){t=+t,e|=0,n|=0,r||N(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},o.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,1,255,0),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},o.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},o.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},o.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):R(this,t,e,!0),e+4},o.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},o.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);N(this,t,e,n,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<n&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},o.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);N(this,t,e,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},o.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,1,127,-128),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},o.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},o.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):R(this,t,e,!0),e+4},o.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},o.prototype.writeFloatLE=function(t,e,n){return F(this,t,e,!0,n)},o.prototype.writeFloatBE=function(t,e,n){return F(this,t,e,!1,n)},o.prototype.writeDoubleLE=function(t,e,n){return z(this,t,e,!0,n)},o.prototype.writeDoubleBE=function(t,e,n){return z(this,t,e,!1,n)},o.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,s=r-n;if(this===t&&n<e&&e<r)for(i=s-1;i>=0;--i)t[i+e]=this[i+n];else if(s<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i<s;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+s),e);return s},o.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0);var s;if("number"==typeof t)for(s=e;s<n;++s)this[s]=t;else{var a=o.isBuffer(t)?t:U(new o(t,r).toString()),l=a.length;for(s=0;s<n-e;++s)this[s+e]=a[s%l]}return this};var tt=/[^+\/0-9A-Za-z-_]/g}).call(e,n(0))},function(t,e){t.exports={Text:"text",Directive:"directive",Comment:"comment",Script:"script",Style:"style",Tag:"tag",CDATA:"cdata",Doctype:"doctype",isTag:function(t){return"tag"===t.type||"script"===t.type||"style"===t.type}}},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(t){if(u===setTimeout)return setTimeout(t,0);if((u===n||!u)&&setTimeout)return u=setTimeout,setTimeout(t,0);try{return u(t,0)}catch(e){try{return u.call(null,t,0)}catch(e){return u.call(this,t,0)}}}function o(t){if(h===clearTimeout)return clearTimeout(t);if((h===r||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(t);try{return h(t)}catch(e){try{return h.call(null,t)}catch(e){return h.call(this,t)}}}function s(){g&&d&&(g=!1,d.length?p=d.concat(p):v=-1,p.length&&a())}function a(){if(!g){var t=i(s);g=!0;for(var e=p.length;e;){for(d=p,p=[];++v<e;)d&&d[v].run();v=-1,e=p.length}d=null,g=!1,o(t)}}function l(t,e){this.fun=t,this.array=e}function c(){}var u,h,f=t.exports={};!function(){try{u="function"==typeof setTimeout?setTimeout:n}catch(t){u=n}try{h="function"==typeof clearTimeout?clearTimeout:r}catch(t){h=r}}();var d,p=[],g=!1,v=-1;f.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];p.push(new l(t,e)),1!==p.length||g||i(a)},l.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=c,f.addListener=c,f.once=c,f.off=c,f.removeListener=c,f.removeAllListeners=c,f.emit=c,f.binding=function(t){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(t){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(t,e,n){(function(t){function n(t){return Array.isArray?Array.isArray(t):"[object Array]"===v(t)}function r(t){return"boolean"==typeof t}function i(t){return null===t}function o(t){return null==t}function s(t){return"number"==typeof t}function a(t){return"string"==typeof t}function l(t){return"symbol"==typeof t}function c(t){return void 0===t}function u(t){return"[object RegExp]"===v(t)}function h(t){return"object"==typeof t&&null!==t}function f(t){return"[object Date]"===v(t)}function d(t){return"[object Error]"===v(t)||t instanceof Error}function p(t){return"function"==typeof t}function g(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t}function v(t){return Object.prototype.toString.call(t)}e.isArray=n,e.isBoolean=r,e.isNull=i,e.isNullOrUndefined=o,e.isNumber=s,e.isString=a,e.isSymbol=l,e.isUndefined=c,e.isRegExp=u,e.isObject=h,e.isDate=f,e.isError=d,e.isFunction=p,e.isPrimitive=g,e.isBuffer=t.isBuffer}).call(e,n(6).Buffer)},function(t,e,n){var r=n(12),i=n(23),o={tag:!0,script:!0,style:!0};e.isTag=function(t){return t.type&&(t=t.type),o[t]||!1},e.camelCase=function(t){return t.replace(/[_.-](\w|$)/g,function(t,e){return e.toUpperCase()})},e.cssCase=function(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()},e.domEach=function(t,e){for(var n=0,r=t.length;n<r&&!1!==e.call(t,n,t[n]);)++n;return t},e.cloneDom=function(t,e){return r(i(t,e),e).children};var s=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/;e.isHtml=function(t){if("<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3)return!0;var e=s.exec(t);return!(!e||!e[1])}},function(t,e){t.exports={trueFunc:function(){return!0},falseFunc:function(){return!1}}},function(t,e,n){(function(r){var i=n(3);e=t.exports=function(t,n){var r=e.evaluate(t,n),i=e.evaluate("<root></root>",n)[0];return i.type="root",e.update(r,i),i},e.evaluate=function(t,e){return"string"==typeof t||r.isBuffer(t)?i.parseDOM(t,e):t},e.update=function(t,e){Array.isArray(t)||(t=[t]),e?e.children=t:e=null;for(var n=0;n<t.length;n++){var r=t[n],i=r.parent||r.root,o=i&&i.children;o&&o!==t&&(o.splice(o.indexOf(r),1),r.prev&&(r.prev.next=r.next),r.next&&(r.next.prev=r.prev)),e?(r.prev=t[n-1]||null,r.next=t[n+1]||null):r.prev=r.next=null,e&&"root"===e.type?(r.root=e,r.parent=null):(r.root=null,r.parent=e)}return e}}).call(e,n(6).Buffer)},function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(t){return"function"==typeof t}function i(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!i(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,i,a,l,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var u=new Error('Uncaught, unspecified "error" event. ('+e+")");throw u.context=e,u}if(n=this._events[t],s(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),n.apply(this,a)}else if(o(n))for(a=Array.prototype.slice.call(arguments,1),c=n.slice(),i=c.length,l=0;l<i;l++)c[l].apply(this,a);return!0},n.prototype.addListener=function(t,e){var i;if(!r(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,r(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned&&(i=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&i>0&&this._events[t].length>i&&(this._events[t].warned=!0,"function"==typeof console.trace&&void 0),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),i||(i=!0,e.apply(this,arguments))}if(!r(e))throw TypeError("listener must be a function");var i=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,i,s,a;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],s=n.length,i=-1,n===e||r(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(n)){for(a=s;a-- >0;)if(n[a]===e||n[a].listener&&n[a].listener===e){i=a;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);
return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],r(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(r(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,n){"use strict";(function(e){function n(t,n,r,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,n)});case 3:return e.nextTick(function(){t.call(null,n,r)});case 4:return e.nextTick(function(){t.call(null,n,r,i)});default:for(o=new Array(a-1),s=0;s<o.length;)o[s++]=arguments[s];return e.nextTick(function(){t.apply(null,o)})}}!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports=n:t.exports=e.nextTick}).call(e,n(8))},function(t,e){function n(t,e){for(var n=-1,r=t?t.length:0;++n<r&&!1!==e(t[n],n,t););return t}function r(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function i(t,e){var n=L(t)||u(t)?r(t.length,String):[],i=n.length,o=!!i;for(var s in t)!e&&!S.call(t,s)||o&&("length"==s||a(s,i))||n.push(s);return n}function o(t,e){return t&&M(t,e,m)}function s(t){if(!l(t))return A(t);var e=[];for(var n in Object(t))S.call(t,n)&&"constructor"!=n&&e.push(n);return e}function a(t,e){return!!(e=null==e?b:e)&&("number"==typeof t||C.test(t))&&t>-1&&t%1==0&&t<e}function l(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||k)}function c(t,e){return(L(t)?n:O)(t,"function"==typeof e?e:y)}function u(t){return f(t)&&S.call(t,"callee")&&(!E.call(t,"callee")||T.call(t)==w)}function h(t){return null!=t&&p(t.length)&&!d(t)}function f(t){return v(t)&&h(t)}function d(t){var e=g(t)?T.call(t):"";return e==x||e==_}function p(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=b}function g(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function v(t){return!!t&&"object"==typeof t}function m(t){return h(t)?i(t):s(t)}function y(t){return t}var b=9007199254740991,w="[object Arguments]",x="[object Function]",_="[object GeneratorFunction]",C=/^(?:0|[1-9]\d*)$/,k=Object.prototype,S=k.hasOwnProperty,T=k.toString,E=k.propertyIsEnumerable,A=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object),O=function(t,e){return function(n,r){if(null==n)return n;if(!h(n))return t(n,r);for(var i=n.length,o=e?i:-1,s=Object(n);(e?o--:++o<i)&&!1!==r(s[o],o,s););return n}}(o),M=function(t){return function(e,n,r){for(var i=-1,o=Object(e),s=r(e),a=s.length;a--;){var l=s[t?a:++i];if(!1===n(o[l],l,o))break}return e}}(),L=Array.isArray;t.exports=c},function(t,e,n){var r=n(12),i=n(10).isHtml,o={extend:n(40),bind:n(24),forEach:n(15),defaults:n(41)},s=[n(84),n(94),n(98),n(100),n(102)],a=t.exports=function(t,e,n,s){return this instanceof a?(this.options=o.defaults(s||{},this.options),t?(n&&("string"==typeof n&&(n=r(n,this.options)),this._root=a.call(this,n)),t.cheerio?t:(l(t)&&(t=[t]),Array.isArray(t)?(o.forEach(t,o.bind(function(t,e){this[e]=t},this)),this.length=t.length,this):"string"==typeof t&&i(t)?a.call(this,r(t,this.options).children):(e?"string"==typeof e?i(e)?(e=r(e,this.options),e=a.call(this,e)):(t=[e,t].join(" "),e=this._root):e.cheerio||(e=a.call(this,e)):e=this._root,e?e.find(t):this))):this):new a(t,e,n,s)};o.extend(a,n(25)),a.prototype.cheerio="[cheerio object]",a.prototype.options={withDomLvl1:!0,normalizeWhitespace:!1,xmlMode:!1,decodeEntities:!0},a.prototype.length=0,a.prototype.splice=Array.prototype.splice,a.prototype._make=function(t,e){var n=new this.constructor(t,e,this._root,this.options);return n.prevObject=this,n},a.prototype.toArray=function(){return this.get()},s.forEach(function(t){o.extend(a.prototype,t)});var l=function(t){return t.name||"text"===t.type||"comment"===t.type}},function(t,e){t.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"",backsim:"∽",backsimeq:"⋍",Backslash:"",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"",Bernoullis:"",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"",caps:"∩︀",caret:"",caron:"ˇ",Cayleys:"",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"",dd:"",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:"",emsp14:"",emsp:"",ENG:"Ŋ",eng:"ŋ",ensp:"",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"",Escr:"",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"",exponentiale:"",ExponentialE:"",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"",frown:"⌢",fscr:"𝒻",Fscr:"",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:"",half:"½",hamilt:"",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"",HilbertSpace:"",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"",hyphen:"",Iacute:"Í",iacute:"í",ic:"",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"",Igrave:"Ì",igrave:"ì",ii:"",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"",ImaginaryI:"",imagline:"",imagpart:"",imath:"ı",Im:"",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅","in":"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺","int":"∫",Int:"∬",integers:"",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"",InvisibleTimes:"",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"",lscr:"𝓁",Lscr:"",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"",lsquor:"",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:"",Mellintrf:"",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"",middot:"·",minusb:"⊟",minus:"",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:"",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"",ord:"⩝",order:"",orderof:"",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"",pointint:"⨕",popf:"𝕡",Popf:"",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"",Prime:"″",primes:"",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:"",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"",rationals:"",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"",realine:"",realpart:"",reals:"",Re:"",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"",rscr:"𝓇",Rscr:"",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"",rsquor:"",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"",setmn:"",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"",smashp:"⨳",smeparsl:"⧤",smid:"",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"",ThickSpace:"",ThinSpace:"",thinsp:"",thkap:"≈",thksim:"",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"",Vee:"",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:"",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"",Zscr:"𝒵",zscr:"𝓏",zwj:"",zwnj:""}},function(t,e){t.exports={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}},function(t,e,n){e=t.exports=n(36),e.Stream=e,e.Readable=e,e.Writable=n(21),e.Duplex=n(2),e.Transform=n(39),e.PassThrough=n(66)},function(t,e,n){function r(t,e){for(var n in t)e[n]=t[n]}function i(t,e,n){return s(t,e,n)}var o=n(6),s=o.Buffer;s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?t.exports=o:(r(o,e),e.Buffer=i),r(s,i),i.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return s(t,e,n)},i.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=s(t);return void 0!==e?"string"==typeof n?r.fill(e,n):r.fill(e):r.fill(0),r},i.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return s(t)},i.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return o.SlowBuffer(t)}},function(t,e,n){"use strict";(function(e,r,i){function o(t){var e=this;this.next=null,this.entry=null,this.finish=function(){E(e,t)}}function s(t){return D.from(t)}function a(t){return D.isBuffer(t)||t instanceof N}function l(){}function c(t,e){O=O||n(2),t=t||{},this.objectMode=!!t.objectMode,e instanceof O&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var r=t.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){y(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function u(t){return O=O||n(2),R.call(u,this)||this instanceof O?(this._writableState=new c(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t["final"]&&(this._final=t["final"])),j.call(this),void 0):new u(t)}function h(t,e){var n=new Error("write after end");t.emit("error",n),A(e,n)}function f(t,e,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||e.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(t.emit("error",o),A(r,o),i=!1),i}function d(t,e,n){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=D.from(e,n)),e}function p(t,e,n,r,i,o){if(!n){var s=d(e,r,i);r!==s&&(n=!0,i="buffer",r=s)}var a=e.objectMode?1:r.length;e.length+=a;var l=e.length<e.highWaterMark;if(l||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:i,
isBuf:n,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else g(t,e,!1,a,r,i,o);return l}function g(t,e,n,r,i,o,s){e.writelen=r,e.writecb=s,e.writing=!0,e.sync=!0,n?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function v(t,e,n,r,i){--e.pendingcb,n?(A(i,r),A(S,t,e),t._writableState.errorEmitted=!0,t.emit("error",r)):(i(r),t._writableState.errorEmitted=!0,t.emit("error",r),S(t,e))}function m(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function y(t,e){var n=t._writableState,r=n.sync,i=n.writecb;if(m(n),e)v(t,n,r,e,i);else{var o=_(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||x(t,n),r?M(b,t,n,o,i):b(t,n,o,i)}}function b(t,e,n,r){n||w(t,e),e.pendingcb--,r(),S(t,e)}function w(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function x(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,i=new Array(r),s=e.corkedRequestsFree;s.entry=n;for(var a=0,l=!0;n;)i[a]=n,n.isBuf||(l=!1),n=n.next,a+=1;i.allBuffers=l,g(t,e,!0,e.length,i,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new o(e)}else{for(;n;){var c=n.chunk,u=n.encoding,h=n.callback;if(g(t,e,!1,e.objectMode?1:c.length,c,u,h),n=n.next,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequestCount=0,e.bufferedRequest=n,e.bufferProcessing=!1}function _(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function C(t,e){t._final(function(n){e.pendingcb--,n&&t.emit("error",n),e.prefinished=!0,t.emit("prefinish"),S(t,e)})}function k(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,A(C,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function S(t,e){var n=_(e);return n&&(k(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),n}function T(t,e,n){e.ending=!0,S(t,e),n&&(e.finished?A(n):t.once("finish",n)),e.ended=!0,t.writable=!1}function E(t,e,n){var r=t.entry;for(t.entry=null;r;){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}var A=n(14);t.exports=u;var O,M=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?r:A;u.WritableState=c;var L=n(9);L.inherits=n(1);var P={deprecate:n(65)},j=n(37),D=n(20).Buffer,N=i.Uint8Array||function(){},I=n(38);L.inherits(u,j),c.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(c.prototype,"buffer",{get:P.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}();var R;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(R=Function.prototype[Symbol.hasInstance],Object.defineProperty(u,Symbol.hasInstance,{value:function(t){return!!R.call(this,t)||t&&t._writableState instanceof c}})):R=function(t){return t instanceof this},u.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},u.prototype.write=function(t,e,n){var r=this._writableState,i=!1,o=a(t)&&!r.objectMode;return o&&!D.isBuffer(t)&&(t=s(t)),"function"==typeof e&&(n=e,e=null),o?e="buffer":e||(e=r.defaultEncoding),"function"!=typeof n&&(n=l),r.ended?h(this,n):(o||f(this,r,t,n))&&(r.pendingcb++,i=p(this,r,o,t,e,n)),i},u.prototype.cork=function(){this._writableState.corked++},u.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||x(this,t))},u.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},u.prototype._write=function(t,e,n){n(new Error("_write() is not implemented"))},u.prototype._writev=null,u.prototype.end=function(t,e,n){var r=this._writableState;"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!==t&&void 0!==t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||T(this,r,n)},Object.defineProperty(u.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),u.prototype.destroy=I.destroy,u.prototype._undestroy=I.undestroy,u.prototype._destroy=function(t,e){this.end(),e(t)}}).call(e,n(8),n(63).setImmediate,n(0))},function(t,e,n){function r(t){if(t&&!l(t))throw new Error("Unknown encoding: "+t)}function i(t){return t.toString(this.encoding)}function o(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function s(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}var a=n(6).Buffer,l=a.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},c=e.StringDecoder=function(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),r(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=o;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=s;break;default:return void(this.write=i)}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};c.prototype.write=function(t){for(var e="";this.charLength;){var n=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived<this.charLength)return"";t=t.slice(n,t.length),e=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var r=e.charCodeAt(e.length-1);if(!(r>=55296&&r<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var i=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,i),i-=this.charReceived),e+=t.toString(this.encoding,0,i);var i=e.length-1,r=e.charCodeAt(i);if(r>=55296&&r<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),e.substring(0,i)}return e},c.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var n=t[t.length-e];if(1==e&&n>>5==6){this.charLength=2;break}if(e<=2&&n>>4==14){this.charLength=3;break}if(e<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=e},c.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;e+=r.slice(0,n).toString(i)}return e}},function(t,e,n){function r(t,e){if(t){var n,r="";for(var i in t)n=t[i],r&&(r+=" "),r+=!n&&h[i]?i:i+'="'+(e.decodeEntities?u.encodeXML(n):n)+'"';return r}}function i(t,e){"svg"===t.name&&(e={decodeEntities:e.decodeEntities,xmlMode:!0});var n="<"+t.name,i=r(t.attribs,e);return i&&(n+=" "+i),!e.xmlMode||t.children&&0!==t.children.length?(n+=">",t.children&&(n+=p(t.children,e)),d[t.name]&&!e.xmlMode||(n+="</"+t.name+">")):n+="/>",n}function o(t){return"<"+t.data+">"}function s(t,e){var n=t.data||"";return!e.decodeEntities||t.parent&&t.parent.name in f||(n=u.encodeXML(n)),n}function a(t){return"<![CDATA["+t.children[0].data+"]]>"}function l(t){return"<!--"+t.data+"-->"}var c=n(74),u=n(75),h={__proto__:null,allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,"default":!0,defer:!0,disabled:!0,hidden:!0,ismap:!0,loop:!0,multiple:!0,muted:!0,open:!0,readonly:!0,required:!0,reversed:!0,scoped:!0,seamless:!0,selected:!0,typemustmatch:!0},f={__proto__:null,style:!0,script:!0,xmp:!0,iframe:!0,noembed:!0,noframes:!0,plaintext:!0,noscript:!0},d={__proto__:null,area:!0,base:!0,basefont:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,isindex:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},p=t.exports=function(t,e){Array.isArray(t)||t.cheerio||(t=[t]),e=e||{};for(var n="",r=0;r<t.length;r++){var u=t[r];n+="root"===u.type?p(u.children,e):c.isTag(u)?i(u,e):u.type===c.Directive?o(u):u.type===c.Comment?l(u):u.type===c.CDATA?a(u):s(u,e)}return n}},function(t,e,n){(function(e){function n(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function r(t,e){for(var n=-1,r=t?t.length:0;++n<r&&!1!==e(t[n],n,t););return t}function i(t,e){return!!(t?t.length:0)&&s(t,e,0)>-1}function o(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function s(t,e,n){if(e!==e)return o(t,a,n);for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function a(t){return t!==t}function l(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&r++;return r}function c(t,e){return null==t?void 0:t[e]}function u(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function h(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var s=t[n];s!==e&&s!==H||(t[n]=H,o[i++]=n)}return o}function f(t){return D(t)?Ot(t):{}}function d(t){return!(!D(t)||O(t))&&(j(t)||u(t)?At:pt).test(L(t))}function p(t,e,n,r){for(var i=-1,o=t.length,s=n.length,a=-1,l=e.length,c=Mt(o-s,0),u=Array(l+c),h=!r;++a<l;)u[a]=e[a];for(;++i<s;)(h||i<o)&&(u[n[i]]=t[i]);for(;c--;)u[a++]=t[i++];return u}function g(t,e,n,r){for(var i=-1,o=t.length,s=-1,a=n.length,l=-1,c=e.length,u=Mt(o-a,0),h=Array(u+c),f=!r;++i<u;)h[i]=t[i];for(var d=i;++l<c;)h[d+l]=e[l];for(;++s<a;)(f||i<o)&&(h[d+n[s]]=t[i++]);return h}function v(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function m(t,e,n){function r(){return(this&&this!==wt&&this instanceof r?o:t).apply(i?n:this,arguments)}var i=e&U,o=y(t);return r}function y(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=f(t.prototype),r=t.apply(n,e);return D(r)?r:n}}function b(t,e,r){function i(){for(var s=arguments.length,a=Array(s),l=s,c=k(i);l--;)a[l]=arguments[l];var u=s<3&&a[0]!==c&&a[s-1]!==c?[]:h(a,c);return(s-=u.length)<r?_(t,e,w,i.placeholder,void 0,a,u,void 0,void 0,r-s):n(this&&this!==wt&&this instanceof i?o:t,this,a)}var o=y(t);return i}function w(t,e,n,r,i,o,s,a,c,u){function f(){for(var S=arguments.length,T=Array(S),E=S;E--;)T[E]=arguments[E];if(b)var A=k(f),O=l(T,A);if(r&&(T=p(T,r,i,b)),o&&(T=g(T,o,s,b)),S-=O,b&&S<u){var L=h(T,A);return _(t,e,w,f.placeholder,n,T,L,a,c,u-S)}var P=v?n:this,j=m?P[t]:t;return S=T.length,a?T=M(T,a):x&&S>1&&T.reverse(),d&&c<S&&(T.length=c),this&&this!==wt&&this instanceof f&&(j=C||y(j)),j.apply(P,T)}var d=e&J,v=e&U,m=e&q,b=e&(G|Y),x=e&Z,C=m?void 0:y(t);return f}function x(t,e,r,i){function o(){for(var e=-1,l=arguments.length,c=-1,u=i.length,h=Array(u+l),f=this&&this!==wt&&this instanceof o?a:t;++c<u;)h[c]=i[c];for(;l--;)h[c++]=arguments[++e];return n(f,s?r:this,h)}var s=e&U,a=y(t);return o}function _(t,e,n,r,i,o,s,a,l,c){var u=e&G,h=u?s:void 0,f=u?void 0:s,d=u?o:void 0,p=u?void 0:o;e|=u?K:X,(e&=~(u?X:K))&W||(e&=~(U|q));var g=n(t,e,i,d,h,p,f,a,l,c);return g.placeholder=r,jt(g,t,e)}function C(t,e,n,r,i,o,s,a){var l=e&q;if(!l&&"function"!=typeof t)throw new TypeError(V);var c=r?r.length:0;if(c||(e&=~(K|X),r=i=void 0),s=void 0===s?s:Mt(B(s),0),a=void 0===a?a:B(a),c-=i?i.length:0,e&X){var u=r,h=i;r=i=void 0}var f=[t,e,n,r,i,u,h,o,s,a];if(t=f[0],e=f[1],n=f[2],r=f[3],i=f[4],a=f[9]=null==f[9]?l?0:t.length:Mt(f[9]-c,0),!a&&e&(G|Y)&&(e&=~(G|Y)),e&&e!=U)d=e==G||e==Y?b(t,e,a):e!=K&&e!=(U|K)||i.length?w.apply(void 0,f):x(t,e,n,r);else var d=m(t,e,n);return jt(d,t,e)}function k(t){return t.placeholder}function S(t,e){var n=c(t,e);return d(n)?n:void 0}function T(t){var e=t.match(ut);return e?e[1].split(ht):[]}function E(t,e){var n=e.length,r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(ct,"{\n/* [wrapped with "+e+"] */\n")}function A(t,e){return!!(e=null==e?tt:e)&&("number"==typeof t||vt.test(t))&&t>-1&&t%1==0&&t<e}function O(t){return!!kt&&kt in t}function M(t,e){for(var n=t.length,r=Lt(e.length,n),i=v(t);r--;){var o=e[r];t[r]=A(o,n)?i[o]:void 0}return t}function L(t){if(null!=t){try{return St.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function P(t,e){return r(rt,function(n){var r="_."+n[0];e&n[1]&&!i(t,r)&&t.push(r)}),t.sort()}function j(t){var e=D(t)?Et.call(t):"";return e==it||e==ot}function D(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function N(t){return!!t&&"object"==typeof t}function I(t){return"symbol"==typeof t||N(t)&&Et.call(t)==st}function R(t){return t?(t=F(t))===Q||t===-Q?(t<0?-1:1)*et:t===t?t:0:0===t?t:0}function B(t){var e=R(t),n=e%1;return e===e?n?e-n:e:0}function F(t){if("number"==typeof t)return t;if(I(t))return nt;if(D(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=D(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(lt,"");var n=dt.test(t);return n||gt.test(t)?mt(t.slice(2),n?2:8):ft.test(t)?nt:+t}function z(t){return function(){return t}}function $(t){return t}var V="Expected a function",H="__lodash_placeholder__",U=1,q=2,W=4,G=8,Y=16,K=32,X=64,J=128,Z=512,Q=1/0,tt=9007199254740991,et=1.7976931348623157e308,nt=NaN,rt=[["ary",J],["bind",U],["bindKey",q],["curry",G],["curryRight",Y],["flip",Z],["partial",K],["partialRight",X],["rearg",256]],it="[object Function]",ot="[object GeneratorFunction]",st="[object Symbol]",at=/[\\^$.*+?()[\]{}|]/g,lt=/^\s+|\s+$/g,ct=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ut=/\{\n\/\* \[wrapped with (.+)\] \*/,ht=/,? & /,ft=/^[-+]0x[0-9a-f]+$/i,dt=/^0b[01]+$/i,pt=/^\[object .+?Constructor\]$/,gt=/^0o[0-7]+$/i,vt=/^(?:0|[1-9]\d*)$/,mt=parseInt,yt="object"==typeof e&&e&&e.Object===Object&&e,bt="object"==typeof self&&self&&self.Object===Object&&self,wt=yt||bt||Function("return this")(),xt=Function.prototype,_t=Object.prototype,Ct=wt["__core-js_shared__"],kt=function(){var t=/[^.]+$/.exec(Ct&&Ct.keys&&Ct.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),St=xt.toString,Tt=_t.hasOwnProperty,Et=_t.toString,At=RegExp("^"+St.call(Tt).replace(at,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ot=Object.create,Mt=Math.max,Lt=Math.min,Pt=function(){var t=S(Object,"defineProperty"),e=S.name;return e&&e.length>2?t:void 0}(),jt=Pt?function(t,e,n){var r=e+"";return Pt(t,"toString",{configurable:!0,enumerable:!1,value:z(E(r,P(T(r),n)))})}:$,Dt=function(t,e){return e=Mt(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=Mt(r.length-e,0),s=Array(o);++i<o;)s[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=s,n(t,this,a)}}(function(t,e,n){var r=U;if(n.length){var i=h(n,k(Dt));r|=K}return C(t,r,e,n,i)});Dt.placeholder={},t.exports=Dt}).call(e,n(0))},function(t,e,n){function r(t,e,n){if(e)"string"==typeof e&&(e=o(e,t._root,n));else{if(!t._root||!t._root.children)return"";e=t._root.children}return i(e,n)}var i=n(23),o=n(42),s=n(12),a={merge:n(92),defaults:n(41)};e.load=function(t,r){var i=n(16);r=a.defaults(r||{},i.prototype.options);var o=s(t,r),l=function(t,e,n,s){return this instanceof l?(s=a.defaults(s||{},r),i.call(this,t,e,n||o,s)):new l(t,e,n,s)};return l.prototype=Object.create(i.prototype),l.prototype.constructor=l,l.fn=l.prototype,l.prototype._originalRoot=o,a.merge(l,e),l._root=o,l._options=r,l},e.html=function(t,e){var i=n(16);return"[object Object]"!==Object.prototype.toString.call(t)||e||"length"in t||"type"in t||(e=t,t=void 0),e=a.defaults(e||{},this._options,i.prototype.options),r(this,t,e)},e.xml=function(t){return r(this,t,a.defaults({xmlMode:!0},this._options))},e.text=function(t){t||(t=this.root());for(var n,r="",i=t.length,o=0;o<i;o++)n=t[o],"text"===n.type?r+=n.data:n.children&&"comment"!==n.type&&(r+=e.text(n.children));return r},e.parseHTML=function(t,e,n){var r;return t&&"string"==typeof t?("boolean"==typeof e&&(n=e),r=this.load(t),n||r("script").remove(),r.root()[0].children.slice()):null},e.root=function(){return this(this._root)},e.contains=function(t,e){if(e===t)return!1;for(;e&&e!==e.parent;)if((e=e.parent)===t)return!0;return!1}},function(t,e,n){function r(t){for(var e=0;t&&e<t.length;e++)if(l(t[e]))return t[e]}function i(t,e){var n={name:t,value:e};return function(t){return m(t,n)}}function o(t){return function(e){return!!u(e)&&t(e)}}function s(t,e,n){if(null===n){if(t.length>1&&"scope"!==e)throw new SyntaxError("pseudo-selector :"+e+" requires an argument")}else if(1===t.length)throw new SyntaxError("pseudo-selector :"+e+" doesn't have any arguments")}var a=n(4),l=a.isTag,c=a.getText,u=a.getParent,h=a.getChildren,f=a.getSiblings,d=a.hasAttrib,p=a.getName,g=a.getAttributeValue,v=n(85),m=n(43).rules.equals,y=n(11),b=y.trueFunc,w=y.falseFunc,x={contains:function(t,e){return function(n){return t(n)&&c(n).indexOf(e)>=0}},icontains:function(t,e){var n=e.toLowerCase();return function(e){return t(e)&&c(e).toLowerCase().indexOf(n)>=0}},"nth-child":function(t,e){var n=v(e);return n===w?n:n===b?o(t):function(e){for(var r=f(e),i=0,o=0;i<r.length;i++)if(l(r[i])){if(r[i]===e)break;o++}return n(o)&&t(e)}},"nth-last-child":function(t,e){var n=v(e);return n===w?n:n===b?o(t):function(e){for(var r=f(e),i=0,o=r.length-1;o>=0;o--)if(l(r[o])){if(r[o]===e)break;i++}return n(i)&&t(e)}},"nth-of-type":function(t,e){var n=v(e);return n===w?n:n===b?o(t):function(e){for(var r=f(e),i=0,o=0;o<r.length;o++)if(l(r[o])){if(r[o]===e)break;p(r[o])===p(e)&&i++}return n(i)&&t(e)}},"nth-last-of-type":function(t,e){var n=v(e);return n===w?n:n===b?o(t):function(e){for(var r=f(e),i=0,o=r.length-1;o>=0;o--)if(l(r[o])){if(r[o]===e)break;p(r[o])===p(e)&&i++}return n(i)&&t(e)}},root:function(t){return function(e){return!u(e)&&t(e)}},scope:function(t,e,n,r){return r&&0!==r.length?1===r.length?function(e){return r[0]===e&&t(e)}:function(e){return r.indexOf(e)>=0&&t(e)}:x.root(t)},checkbox:i("type","checkbox"),file:i("type","file"),password:i("type","password"),radio:i("type","radio"),reset:i("type","reset"),image:i("type","image"),submit:i("type","submit")},_={empty:function(t){return!h(t).some(function(t){return l(t)||"text"===t.type})},"first-child":function(t){return r(f(t))===t},"last-child":function(t){for(var e=f(t),n=e.length-1;n>=0;n--){if(e[n]===t)return!0;if(l(e[n]))break}return!1},"first-of-type":function(t){for(var e=f(t),n=0;n<e.length;n++)if(l(e[n])){if(e[n]===t)return!0;if(p(e[n])===p(t))break}return!1},"last-of-type":function(t){for(var e=f(t),n=e.length-1;n>=0;n--)if(l(e[n])){if(e[n]===t)return!0;if(p(e[n])===p(t))break}return!1},"only-of-type":function(t){for(var e=f(t),n=0,r=e.length;n<r;n++)if(l(e[n])){if(e[n]===t)continue;if(p(e[n])===p(t))return!1}return!0},"only-child":function(t){for(var e=f(t),n=0;n<e.length;n++)if(l(e[n])&&e[n]!==t)return!1;return!0},link:function(t){return d(t,"href")},visited:w,selected:function(t){if(d(t,"selected"))return!0;if("option"!==p(t))return!1;var e=u(t);if(!e||"select"!==p(e)||d(e,"multiple"))return!1;for(var n=h(e),r=!1,i=0;i<n.length;i++)if(l(n[i]))if(n[i]===t)r=!0;else{if(!r)return!1;if(d(n[i],"selected"))return!1}return r},disabled:function(t){return d(t,"disabled")},enabled:function(t){return!d(t,"disabled")},checked:function(t){return d(t,"checked")||_.selected(t)},required:function(t){return d(t,"required")},optional:function(t){return!d(t,"required")},parent:function(t){return!_.empty(t)},header:function(t){var e=p(t);return"h1"===e||"h2"===e||"h3"===e||"h4"===e||"h5"===e||"h6"===e},button:function(t){var e=p(t);return"button"===e||"input"===e&&"button"===g(t,"type")},input:function(t){var e=p(t);return"input"===e||"textarea"===e||"select"===e||"button"===e},text:function(t){var e;return"input"===p(t)&&(!(e=g(t,"type"))||"text"===e.toLowerCase())}},C=/^(?:(?:nth|last|first|only)-(?:child|of-type)|root|empty|(?:en|dis)abled|checked|not)$/;t.exports={compile:function(t,e,n,r){var i=e.name,o=e.data;if(n&&n.strict&&!C.test(i))throw SyntaxError(":"+i+" isn't part of CSS3");if("function"==typeof x[i])return s(x[i],i,o),x[i](t,o,n,r);if("function"==typeof _[i]){var a=_[i];return s(a,i,o),t===b?a:function(e){return a(e,o)&&t(e)}}throw new SyntaxError("unmatched pseudo-class :"+i)},filters:x,pseudos:_}},function(t,e,n){"use strict";var r=n(105),i={}.hasOwnProperty,o=n(108),s=n(110);e.Selector=o,e.Property=s,e.extract=function(t){for(var e=0,n=[],r="",i=0,o=t.length;i<o;i++){var s=t.charAt(i);e?("]"!==s&&")"!==s||e--,r+=s):","===s?(n.push(r),r=""):("["!==s&&"("!==s||e++,(r.length||","!==s&&"\n"!==s&&" "!==s)&&(r+=s))}return r.length&&n.push(r),n},e.parseCSS=function(t){for(var e=r.parse(t,{position:!0,comments:!0}),n=void 0!==e.stylesheet&&e.stylesheet.rules?e.stylesheet.rules:[],i=[],o=0,s=n.length;o<s;o++)if("rule"==n[o].type)for(var a=n[o],l=a.selectors,c=0,u=l.length;c<u;c++)i.push([l[c],a.declarations]);return i},e.getPreservedText=function(t,e){for(var n=r.parse(t,{position:!0,comments:!0}),i=void 0!==n.stylesheet&&n.stylesheet.rules?n.stylesheet.rules:[],o=[],s=i.length-1;s>=0;s--)(e.fontFaces&&"font-face"===i[s].type||e.mediaQueries&&"media"===i[s].type)&&o.unshift(r.stringify({stylesheet:{rules:[i[s]]}},{comments:!1,indentation:" "})),i[s].position.start;return 0!==o.length&&"\n"+o.join("\n")+"\n"},e.normalizeLineEndings=function(t){return t.replace(/\r\n/g,"\n").replace(/\n/g,"\r\n")},e.compareFunc=function(t,e){for(var n=Math.min(t.length,e.length),r=0;r<n;r++)if(t[r]!==e[r])return t[r]>e[r]?1:-1;return t.length-e.length},e.compare=function(t,n){return 1==e.compareFunc(t,n)?t:n},e.extend=function(t,e){for(var n in e)i.call(e,n)&&(t[n]=e[n]);return t},e.getDefaultOptions=function(t){var n=e.extend({extraCss:"",insertPreservedExtraCss:!0,applyStyleTags:!0,removeStyleTags:!0,preserveMediaQueries:!0,preserveFontFaces:!0,applyWidthAttributes:!0,applyHeightAttributes:!0,applyAttributesTableElements:!0,url:""},t);return n.webResources=n.webResources||{},n}},function(t,e,n){(function(n){function r(t){return i.bind(null,t)}function i(t){var e=[].slice.call(arguments,1);e.unshift("["+t+"]"),n.stderr.write(e.join(" ")+"\n")}e=t.exports=r}).call(e,n(8))},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){function r(t,e){this._options=e||{},this._cbs=t||{},this._tagname="",this._attribname="",this._attribvalue="",this._attribs=null,this._stack=[],this.startIndex=0,this.endIndex=null,this._lowerCaseTagNames="lowerCaseTags"in this._options?!!this._options.lowerCaseTags:!this._options.xmlMode,this._lowerCaseAttributeNames="lowerCaseAttributeNames"in this._options?!!this._options.lowerCaseAttributeNames:!this._options.xmlMode,this._options.Tokenizer&&(i=this._options.Tokenizer),this._tokenizer=new i(this._options,this),this._cbs.onparserinit&&this._cbs.onparserinit(this)}var i=n(31),o={input:!0,option:!0,optgroup:!0,select:!0,button:!0,datalist:!0,textarea:!0},s={tr:{tr:!0,th:!0,td:!0},th:{th:!0},td:{thead:!0,th:!0,td:!0},body:{head:!0,link:!0,script:!0},li:{li:!0},p:{p:!0},h1:{p:!0},h2:{p:!0},h3:{p:!0},h4:{p:!0},h5:{p:!0},h6:{p:!0},select:o,input:o,output:o,button:o,datalist:o,textarea:o,option:{option:!0},optgroup:{optgroup:!0}},a={__proto__:null,area:!0,base:!0,basefont:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,isindex:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,path:!0,circle:!0,ellipse:!0,line:!0,rect:!0,use:!0,stop:!0,polyline:!0,polygon:!0},l=/\s|\//;n(1)(r,n(13).EventEmitter),r.prototype._updatePosition=function(t){null===this.endIndex?this._tokenizer._sectionStart<=t?this.startIndex=0:this.startIndex=this._tokenizer._sectionStart-t:this.startIndex=this.endIndex+1,this.endIndex=this._tokenizer.getAbsoluteIndex()},r.prototype.ontext=function(t){this._updatePosition(1),this.endIndex--,this._cbs.ontext&&this._cbs.ontext(t)},r.prototype.onopentagname=function(t){if(this._lowerCaseTagNames&&(t=t.toLowerCase()),this._tagname=t,!this._options.xmlMode&&t in s)for(var e;(e=this._stack[this._stack.length-1])in s[t];this.onclosetag(e));!this._options.xmlMode&&t in a||this._stack.push(t),this._cbs.onopentagname&&this._cbs.onopentagname(t),this._cbs.onopentag&&(this._attribs={})},r.prototype.onopentagend=function(){this._updatePosition(1),this._attribs&&(this._cbs.onopentag&&this._cbs.onopentag(this._tagname,this._attribs),this._attribs=null),!this._options.xmlMode&&this._cbs.onclosetag&&this._tagname in a&&this._cbs.onclosetag(this._tagname),this._tagname=""},r.prototype.onclosetag=function(t){if(this._updatePosition(1),this._lowerCaseTagNames&&(t=t.toLowerCase()),!this._stack.length||t in a&&!this._options.xmlMode)this._options.xmlMode||"br"!==t&&"p"!==t||(this.onopentagname(t),this._closeCurrentTag());else{var e=this._stack.lastIndexOf(t);if(-1!==e)if(this._cbs.onclosetag)for(e=this._stack.length-e;e--;)this._cbs.onclosetag(this._stack.pop());else this._stack.length=e;else"p"!==t||this._options.xmlMode||(this.onopentagname(t),this._closeCurrentTag())}},r.prototype.onselfclosingtag=function(){this._options.xmlMode||this._options.recognizeSelfClosing?this._closeCurrentTag():this.onopentagend()},r.prototype._closeCurrentTag=function(){var t=this._tagname;this.onopentagend(),this._stack[this._stack.length-1]===t&&(this._cbs.onclosetag&&this._cbs.onclosetag(t),this._stack.pop())},r.prototype.onattribname=function(t){this._lowerCaseAttributeNames&&(t=t.toLowerCase()),this._attribname=t},r.prototype.onattribdata=function(t){this._attribvalue+=t},r.prototype.onattribend=function(){this._cbs.onattribute&&this._cbs.onattribute(this._attribname,this._attribvalue),this._attribs&&!Object.prototype.hasOwnProperty.call(this._attribs,this._attribname)&&(this._attribs[this._attribname]=this._attribvalue),this._attribname="",this._attribvalue=""},r.prototype._getInstructionName=function(t){var e=t.search(l),n=e<0?t:t.substr(0,e);return this._lowerCaseTagNames&&(n=n.toLowerCase()),n},r.prototype.ondeclaration=function(t){if(this._cbs.onprocessinginstruction){var e=this._getInstructionName(t);this._cbs.onprocessinginstruction("!"+e,"!"+t)}},r.prototype.onprocessinginstruction=function(t){if(this._cbs.onprocessinginstruction){var e=this._getInstructionName(t);this._cbs.onprocessinginstruction("?"+e,"?"+t)}},r.prototype.oncomment=function(t){this._updatePosition(4),this._cbs.oncomment&&this._cbs.oncomment(t),this._cbs.oncommentend&&this._cbs.oncommentend()},r.prototype.oncdata=function(t){this._updatePosition(1),this._options.xmlMode||this._options.recognizeCDATA?(this._cbs.oncdatastart&&this._cbs.oncdatastart(),this._cbs.ontext&&this._cbs.ontext(t),this._cbs.oncdataend&&this._cbs.oncdataend()):this.oncomment("[CDATA["+t+"]]")},r.prototype.onerror=function(t){this._cbs.onerror&&this._cbs.onerror(t)},r.prototype.onend=function(){if(this._cbs.onclosetag)for(var t=this._stack.length;t>0;this._cbs.onclosetag(this._stack[--t]));this._cbs.onend&&this._cbs.onend()},r.prototype.reset=function(){this._cbs.onreset&&this._cbs.onreset(),this._tokenizer.reset(),this._tagname="",this._attribname="",this._attribs=null,this._stack=[],this._cbs.onparserinit&&this._cbs.onparserinit(this)},r.prototype.parseComplete=function(t){this.reset(),this.end(t)},r.prototype.write=function(t){this._tokenizer.write(t)},r.prototype.end=function(t){this._tokenizer.end(t)},r.prototype.pause=function(){this._tokenizer.pause()},r.prototype.resume=function(){this._tokenizer.resume()},r.prototype.parseChunk=r.prototype.write,r.prototype.done=r.prototype.end,t.exports=r},function(t,e,n){function r(t){return" "===t||"\n"===t||"\t"===t||"\f"===t||"\r"===t}function i(t,e,n){var r=t.toLowerCase();return t===r?function(t){t===r?this._state=e:(this._state=n,this._index--)}:function(i){i===r||i===t?this._state=e:(this._state=n,this._index--)}}function o(t,e){var n=t.toLowerCase();return function(r){r===n||r===t?this._state=e:(this._state=p,this._index--)}}function s(t,e){this._state=f,this._buffer="",this._sectionStart=0,this._index=0,this._bufferOffset=0,this._baseState=f,this._special=pt,this._cbs=e,this._running=!0,this._ended=!1,this._xmlMode=!(!t||!t.xmlMode),this._decodeEntities=!(!t||!t.decodeEntities)}t.exports=s;var a=n(32),l=n(17),c=n(33),u=n(18),h=0,f=h++,d=h++,p=h++,g=h++,v=h++,m=h++,y=h++,b=h++,w=h++,x=h++,_=h++,C=h++,k=h++,S=h++,T=h++,E=h++,A=h++,O=h++,M=h++,L=h++,P=h++,j=h++,D=h++,N=h++,I=h++,R=h++,B=h++,F=h++,z=h++,$=h++,V=h++,H=h++,U=h++,q=h++,W=h++,G=h++,Y=h++,K=h++,X=h++,J=h++,Z=h++,Q=h++,tt=h++,et=h++,nt=h++,rt=h++,it=h++,ot=h++,st=h++,at=h++,lt=h++,ct=h++,ut=h++,ht=h++,ft=h++,dt=0,pt=dt++,gt=dt++,vt=dt++;s.prototype._stateText=function(t){"<"===t?(this._index>this._sectionStart&&this._cbs.ontext(this._getSection()),this._state=d,this._sectionStart=this._index):this._decodeEntities&&this._special===pt&&"&"===t&&(this._index>this._sectionStart&&this._cbs.ontext(this._getSection()),this._baseState=f,this._state=lt,this._sectionStart=this._index)},s.prototype._stateBeforeTagName=function(t){"/"===t?this._state=v:"<"===t?(this._cbs.ontext(this._getSection()),this._sectionStart=this._index):">"===t||this._special!==pt||r(t)?this._state=f:"!"===t?(this._state=T,this._sectionStart=this._index+1):"?"===t?(this._state=A,this._sectionStart=this._index+1):(this._state=this._xmlMode||"s"!==t&&"S"!==t?p:V,this._sectionStart=this._index)},s.prototype._stateInTagName=function(t){("/"===t||">"===t||r(t))&&(this._emitToken("onopentagname"),this._state=b,this._index--)},s.prototype._stateBeforeCloseingTagName=function(t){r(t)||(">"===t?this._state=f:this._special!==pt?"s"===t||"S"===t?this._state=H:(this._state=f,this._index--):(this._state=m,this._sectionStart=this._index))},s.prototype._stateInCloseingTagName=function(t){(">"===t||r(t))&&(this._emitToken("onclosetag"),this._state=y,this._index--)},s.prototype._stateAfterCloseingTagName=function(t){">"===t&&(this._state=f,this._sectionStart=this._index+1)},s.prototype._stateBeforeAttributeName=function(t){">"===t?(this._cbs.onopentagend(),this._state=f,this._sectionStart=this._index+1):"/"===t?this._state=g:r(t)||(this._state=w,this._sectionStart=this._index)},s.prototype._stateInSelfClosingTag=function(t){">"===t?(this._cbs.onselfclosingtag(),this._state=f,this._sectionStart=this._index+1):r(t)||(this._state=b,this._index--)},s.prototype._stateInAttributeName=function(t){("="===t||"/"===t||">"===t||r(t))&&(this._cbs.onattribname(this._getSection()),this._sectionStart=-1,this._state=x,this._index--)},s.prototype._stateAfterAttributeName=function(t){"="===t?this._state=_:"/"===t||">"===t?(this._cbs.onattribend(),this._state=b,this._index--):r(t)||(this._cbs.onattribend(),this._state=w,this._sectionStart=this._index)},s.prototype._stateBeforeAttributeValue=function(t){'"'===t?(this._state=C,this._sectionStart=this._index+1):"'"===t?(this._state=k,this._sectionStart=this._index+1):r(t)||(this._state=S,this._sectionStart=this._index,this._index--)},s.prototype._stateInAttributeValueDoubleQuotes=function(t){'"'===t?(this._emitToken("onattribdata"),this._cbs.onattribend(),this._state=b):this._decodeEntities&&"&"===t&&(this._emitToken("onattribdata"),this._baseState=this._state,this._state=lt,this._sectionStart=this._index)},s.prototype._stateInAttributeValueSingleQuotes=function(t){"'"===t?(this._emitToken("onattribdata"),this._cbs.onattribend(),this._state=b):this._decodeEntities&&"&"===t&&(this._emitToken("onattribdata"),this._baseState=this._state,this._state=lt,this._sectionStart=this._index)},s.prototype._stateInAttributeValueNoQuotes=function(t){r(t)||">"===t?(this._emitToken("onattribdata"),
this._cbs.onattribend(),this._state=b,this._index--):this._decodeEntities&&"&"===t&&(this._emitToken("onattribdata"),this._baseState=this._state,this._state=lt,this._sectionStart=this._index)},s.prototype._stateBeforeDeclaration=function(t){this._state="["===t?j:"-"===t?O:E},s.prototype._stateInDeclaration=function(t){">"===t&&(this._cbs.ondeclaration(this._getSection()),this._state=f,this._sectionStart=this._index+1)},s.prototype._stateInProcessingInstruction=function(t){">"===t&&(this._cbs.onprocessinginstruction(this._getSection()),this._state=f,this._sectionStart=this._index+1)},s.prototype._stateBeforeComment=function(t){"-"===t?(this._state=M,this._sectionStart=this._index+1):this._state=E},s.prototype._stateInComment=function(t){"-"===t&&(this._state=L)},s.prototype._stateAfterComment1=function(t){this._state="-"===t?P:M},s.prototype._stateAfterComment2=function(t){">"===t?(this._cbs.oncomment(this._buffer.substring(this._sectionStart,this._index-2)),this._state=f,this._sectionStart=this._index+1):"-"!==t&&(this._state=M)},s.prototype._stateBeforeCdata1=i("C",D,E),s.prototype._stateBeforeCdata2=i("D",N,E),s.prototype._stateBeforeCdata3=i("A",I,E),s.prototype._stateBeforeCdata4=i("T",R,E),s.prototype._stateBeforeCdata5=i("A",B,E),s.prototype._stateBeforeCdata6=function(t){"["===t?(this._state=F,this._sectionStart=this._index+1):(this._state=E,this._index--)},s.prototype._stateInCdata=function(t){"]"===t&&(this._state=z)},s.prototype._stateAfterCdata1=function(t,e){return function(n){n===t&&(this._state=e)}}("]",$),s.prototype._stateAfterCdata2=function(t){">"===t?(this._cbs.oncdata(this._buffer.substring(this._sectionStart,this._index-2)),this._state=f,this._sectionStart=this._index+1):"]"!==t&&(this._state=F)},s.prototype._stateBeforeSpecial=function(t){"c"===t||"C"===t?this._state=U:"t"===t||"T"===t?this._state=tt:(this._state=p,this._index--)},s.prototype._stateBeforeSpecialEnd=function(t){this._special!==gt||"c"!==t&&"C"!==t?this._special!==vt||"t"!==t&&"T"!==t?this._state=f:this._state=it:this._state=K},s.prototype._stateBeforeScript1=o("R",q),s.prototype._stateBeforeScript2=o("I",W),s.prototype._stateBeforeScript3=o("P",G),s.prototype._stateBeforeScript4=o("T",Y),s.prototype._stateBeforeScript5=function(t){("/"===t||">"===t||r(t))&&(this._special=gt),this._state=p,this._index--},s.prototype._stateAfterScript1=i("R",X,f),s.prototype._stateAfterScript2=i("I",J,f),s.prototype._stateAfterScript3=i("P",Z,f),s.prototype._stateAfterScript4=i("T",Q,f),s.prototype._stateAfterScript5=function(t){">"===t||r(t)?(this._special=pt,this._state=m,this._sectionStart=this._index-6,this._index--):this._state=f},s.prototype._stateBeforeStyle1=o("Y",et),s.prototype._stateBeforeStyle2=o("L",nt),s.prototype._stateBeforeStyle3=o("E",rt),s.prototype._stateBeforeStyle4=function(t){("/"===t||">"===t||r(t))&&(this._special=vt),this._state=p,this._index--},s.prototype._stateAfterStyle1=i("Y",ot,f),s.prototype._stateAfterStyle2=i("L",st,f),s.prototype._stateAfterStyle3=i("E",at,f),s.prototype._stateAfterStyle4=function(t){">"===t||r(t)?(this._special=pt,this._state=m,this._sectionStart=this._index-5,this._index--):this._state=f},s.prototype._stateBeforeEntity=i("#",ct,ut),s.prototype._stateBeforeNumericEntity=i("X",ft,ht),s.prototype._parseNamedEntityStrict=function(){if(this._sectionStart+1<this._index){var t=this._buffer.substring(this._sectionStart+1,this._index),e=this._xmlMode?u:l;e.hasOwnProperty(t)&&(this._emitPartial(e[t]),this._sectionStart=this._index+1)}},s.prototype._parseLegacyEntity=function(){var t=this._sectionStart+1,e=this._index-t;for(e>6&&(e=6);e>=2;){var n=this._buffer.substr(t,e);if(c.hasOwnProperty(n))return this._emitPartial(c[n]),void(this._sectionStart+=e+1);e--}},s.prototype._stateInNamedEntity=function(t){";"===t?(this._parseNamedEntityStrict(),this._sectionStart+1<this._index&&!this._xmlMode&&this._parseLegacyEntity(),this._state=this._baseState):(t<"a"||t>"z")&&(t<"A"||t>"Z")&&(t<"0"||t>"9")&&(this._xmlMode||this._sectionStart+1===this._index||(this._baseState!==f?"="!==t&&this._parseNamedEntityStrict():this._parseLegacyEntity()),this._state=this._baseState,this._index--)},s.prototype._decodeNumericEntity=function(t,e){var n=this._sectionStart+t;if(n!==this._index){var r=this._buffer.substring(n,this._index),i=parseInt(r,e);this._emitPartial(a(i)),this._sectionStart=this._index}else this._sectionStart--;this._state=this._baseState},s.prototype._stateInNumericEntity=function(t){";"===t?(this._decodeNumericEntity(2,10),this._sectionStart++):(t<"0"||t>"9")&&(this._xmlMode?this._state=this._baseState:this._decodeNumericEntity(2,10),this._index--)},s.prototype._stateInHexEntity=function(t){";"===t?(this._decodeNumericEntity(3,16),this._sectionStart++):(t<"a"||t>"f")&&(t<"A"||t>"F")&&(t<"0"||t>"9")&&(this._xmlMode?this._state=this._baseState:this._decodeNumericEntity(3,16),this._index--)},s.prototype._cleanup=function(){this._sectionStart<0?(this._buffer="",this._bufferOffset+=this._index,this._index=0):this._running&&(this._state===f?(this._sectionStart!==this._index&&this._cbs.ontext(this._buffer.substr(this._sectionStart)),this._buffer="",this._bufferOffset+=this._index,this._index=0):this._sectionStart===this._index?(this._buffer="",this._bufferOffset+=this._index,this._index=0):(this._buffer=this._buffer.substr(this._sectionStart),this._index-=this._sectionStart,this._bufferOffset+=this._sectionStart),this._sectionStart=0)},s.prototype.write=function(t){this._ended&&this._cbs.onerror(Error(".write() after done!")),this._buffer+=t,this._parse()},s.prototype._parse=function(){for(;this._index<this._buffer.length&&this._running;){var t=this._buffer.charAt(this._index);this._state===f?this._stateText(t):this._state===d?this._stateBeforeTagName(t):this._state===p?this._stateInTagName(t):this._state===v?this._stateBeforeCloseingTagName(t):this._state===m?this._stateInCloseingTagName(t):this._state===y?this._stateAfterCloseingTagName(t):this._state===g?this._stateInSelfClosingTag(t):this._state===b?this._stateBeforeAttributeName(t):this._state===w?this._stateInAttributeName(t):this._state===x?this._stateAfterAttributeName(t):this._state===_?this._stateBeforeAttributeValue(t):this._state===C?this._stateInAttributeValueDoubleQuotes(t):this._state===k?this._stateInAttributeValueSingleQuotes(t):this._state===S?this._stateInAttributeValueNoQuotes(t):this._state===T?this._stateBeforeDeclaration(t):this._state===E?this._stateInDeclaration(t):this._state===A?this._stateInProcessingInstruction(t):this._state===O?this._stateBeforeComment(t):this._state===M?this._stateInComment(t):this._state===L?this._stateAfterComment1(t):this._state===P?this._stateAfterComment2(t):this._state===j?this._stateBeforeCdata1(t):this._state===D?this._stateBeforeCdata2(t):this._state===N?this._stateBeforeCdata3(t):this._state===I?this._stateBeforeCdata4(t):this._state===R?this._stateBeforeCdata5(t):this._state===B?this._stateBeforeCdata6(t):this._state===F?this._stateInCdata(t):this._state===z?this._stateAfterCdata1(t):this._state===$?this._stateAfterCdata2(t):this._state===V?this._stateBeforeSpecial(t):this._state===H?this._stateBeforeSpecialEnd(t):this._state===U?this._stateBeforeScript1(t):this._state===q?this._stateBeforeScript2(t):this._state===W?this._stateBeforeScript3(t):this._state===G?this._stateBeforeScript4(t):this._state===Y?this._stateBeforeScript5(t):this._state===K?this._stateAfterScript1(t):this._state===X?this._stateAfterScript2(t):this._state===J?this._stateAfterScript3(t):this._state===Z?this._stateAfterScript4(t):this._state===Q?this._stateAfterScript5(t):this._state===tt?this._stateBeforeStyle1(t):this._state===et?this._stateBeforeStyle2(t):this._state===nt?this._stateBeforeStyle3(t):this._state===rt?this._stateBeforeStyle4(t):this._state===it?this._stateAfterStyle1(t):this._state===ot?this._stateAfterStyle2(t):this._state===st?this._stateAfterStyle3(t):this._state===at?this._stateAfterStyle4(t):this._state===lt?this._stateBeforeEntity(t):this._state===ct?this._stateBeforeNumericEntity(t):this._state===ut?this._stateInNamedEntity(t):this._state===ht?this._stateInNumericEntity(t):this._state===ft?this._stateInHexEntity(t):this._cbs.onerror(Error("unknown _state"),this._state),this._index++}this._cleanup()},s.prototype.pause=function(){this._running=!1},s.prototype.resume=function(){this._running=!0,this._index<this._buffer.length&&this._parse(),this._ended&&this._finish()},s.prototype.end=function(t){this._ended&&this._cbs.onerror(Error(".end() after done!")),t&&this.write(t),this._ended=!0,this._running&&this._finish()},s.prototype._finish=function(){this._sectionStart<this._index&&this._handleTrailingData(),this._cbs.onend()},s.prototype._handleTrailingData=function(){var t=this._buffer.substr(this._sectionStart);this._state===F||this._state===z||this._state===$?this._cbs.oncdata(t):this._state===M||this._state===L||this._state===P?this._cbs.oncomment(t):this._state!==ut||this._xmlMode?this._state!==ht||this._xmlMode?this._state!==ft||this._xmlMode?this._state!==p&&this._state!==b&&this._state!==_&&this._state!==x&&this._state!==w&&this._state!==k&&this._state!==C&&this._state!==S&&this._state!==m&&this._cbs.ontext(t):(this._decodeNumericEntity(3,16),this._sectionStart<this._index&&(this._state=this._baseState,this._handleTrailingData())):(this._decodeNumericEntity(2,10),this._sectionStart<this._index&&(this._state=this._baseState,this._handleTrailingData())):(this._parseLegacyEntity(),this._sectionStart<this._index&&(this._state=this._baseState,this._handleTrailingData()))},s.prototype.reset=function(){s.call(this,{xmlMode:this._xmlMode,decodeEntities:this._decodeEntities},this._cbs)},s.prototype.getAbsoluteIndex=function(){return this._bufferOffset+this._index},s.prototype._getSection=function(){return this._buffer.substring(this._sectionStart,this._index)},s.prototype._emitToken=function(t){this._cbs[t](this._getSection()),this._sectionStart=-1},s.prototype._emitPartial=function(t){this._baseState!==f?this._cbs.onattribdata(t):this._cbs.ontext(t)}},function(t,e,n){function r(t){if(t>=55296&&t<=57343||t>1114111)return"<22>";t in i&&(t=i[t]);var e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|1023&t),e+=String.fromCharCode(t)}var i=n(55);t.exports=r},function(t,e){t.exports={Aacute:"Á",aacute:"á",Acirc:"Â",acirc:"â",acute:"´",AElig:"Æ",aelig:"æ",Agrave:"À",agrave:"à",amp:"&",AMP:"&",Aring:"Å",aring:"å",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",brvbar:"¦",Ccedil:"Ç",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",Eacute:"É",eacute:"é",Ecirc:"Ê",ecirc:"ê",Egrave:"È",egrave:"è",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",iexcl:"¡",Igrave:"Ì",igrave:"ì",iquest:"¿",Iuml:"Ï",iuml:"ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",Ntilde:"Ñ",ntilde:"ñ",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",Ograve:"Ò",ograve:"ò",ordf:"ª",ordm:"º",Oslash:"Ø",oslash:"ø",Otilde:"Õ",otilde:"õ",Ouml:"Ö",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",THORN:"Þ",thorn:"þ",times:"×",Uacute:"Ú",uacute:"ú",Ucirc:"Û",ucirc:"û",Ugrave:"Ù",ugrave:"ù",uml:"¨",Uuml:"Ü",uuml:"ü",Yacute:"Ý",yacute:"ý",yen:"¥",yuml:"ÿ"}},function(t,e){var n=t.exports={get firstChild(){var t=this.children;return t&&t[0]||null},get lastChild(){var t=this.children;return t&&t[t.length-1]||null},get nodeType(){return i[this.type]||i.element}},r={tagName:"name",childNodes:"children",parentNode:"parent",previousSibling:"prev",nextSibling:"next",nodeValue:"data"},i={element:1,text:3,cdata:4,comment:8};Object.keys(r).forEach(function(t){var e=r[t];Object.defineProperty(n,t,{get:function(){return this[e]||null},set:function(t){return this[e]=t,t}})})},function(t,e,n){function r(t,e){var n=this._parser=new i(t,e),r=this._decoder=new s;o.call(this,{decodeStrings:!1}),this.once("finish",function(){n.end(r.end())})}t.exports=r;var i=n(30),o=n(60).Writable||n(71).Writable,s=n(22).StringDecoder,a=n(6).Buffer;n(1)(r,o),o.prototype._write=function(t,e,n){t instanceof a&&(t=this._decoder.write(t)),this._parser.write(t),n()}},function(t,e,n){"use strict";(function(e,r){function i(t){return R.from(t)}function o(t){return R.isBuffer(t)||t instanceof B}function s(t,e,n){return"function"==typeof t.prependListener?t.prependListener(e,n):void(t._events&&t._events[e]?D(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n))}function a(t,e){j=j||n(2),t=t||{},this.objectMode=!!t.objectMode,e instanceof j&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var r=t.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new H,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(V||(V=n(22).StringDecoder),this.decoder=new V(t.encoding),this.encoding=t.encoding)}function l(t){return j=j||n(2),this instanceof l?(this._readableState=new a(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),I.call(this),void 0):new l(t)}function c(t,e,n,r,o){var s=t._readableState;if(null===e)s.reading=!1,g(t,s);else{var a;o||(a=h(s,e)),a?t.emit("error",a):s.objectMode||e&&e.length>0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===R.prototype||(e=i(e)),r?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):u(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!n?(e=s.decoder.write(e),s.objectMode||0!==e.length?u(t,s,e,!1):y(t,s)):u(t,s,e,!1))):r||(s.reading=!1)}return f(s)}function u(t,e,n,r){e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,r?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&v(t)),y(t,e)}function h(t,e){var n;return o(e)||"string"==typeof e||void 0===e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function f(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}function d(t){return t>=W?t=W:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function p(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=d(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function g(t,e){if(!e.ended){if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,v(t)}}function v(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||($("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?P(m,t):m(t))}function m(t){$("emit readable"),t.emit("readable"),k(t)}function y(t,e){e.readingMore||(e.readingMore=!0,P(b,t,e))}function b(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&($("maybeReadMore read 0"),t.read(0),n!==e.length);)n=e.length;e.readingMore=!1}function w(t){return function(){var e=t._readableState;$("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&N(t,"data")&&(e.flowing=!0,k(t))}}function x(t){$("readable nexttick read 0"),t.read(0)}function _(t,e){e.resumeScheduled||(e.resumeScheduled=!0,P(C,t,e))}function C(t,e){e.reading||($("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),k(t),e.flowing&&!e.reading&&t.read(0)}function k(t){var e=t._readableState;for($("flow",e.flowing);e.flowing&&null!==t.read(););}function S(t,e){if(0===e.length)return null;var n;return e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=T(t,e.buffer,e.decoder),n}function T(t,e,n){var r;return t<e.head.data.length?(r=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):r=t===e.head.data.length?e.shift():n?E(t,e):A(t,e),r}function E(t,e){var n=e.head,r=1,i=n.data;for(t-=i.length;n=n.next;){var o=n.data,s=t>o.length?o.length:t;if(i+=s===o.length?o:o.slice(0,t),0===(t-=s)){s===o.length?(++r,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++r}return e.length-=r,i}function A(t,e){var n=R.allocUnsafe(t),r=e.head,i=1;for(r.data.copy(n),t-=r.data.length;r=r.next;){var o=r.data,s=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,s),0===(t-=s)){s===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++i}return e.length-=i,n}function O(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,P(M,e,t))}function M(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function L(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}var P=n(14);t.exports=l;var j,D=n(29);l.ReadableState=a;var N=(n(13).EventEmitter,function(t,e){return t.listeners(e).length}),I=n(37),R=n(20).Buffer,B=e.Uint8Array||function(){},F=n(9);F.inherits=n(1);var z=n(61),$=void 0;$=z&&z.debuglog?z.debuglog("stream"):function(){};var V,H=n(62),U=n(38);F.inherits(l,I);var q=["error","close","destroy","pause","resume"];Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),l.prototype.destroy=U.destroy,l.prototype._undestroy=U.undestroy,l.prototype._destroy=function(t,e){this.push(null),e(t)},l.prototype.push=function(t,e){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof t&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=R.from(t,e),e=""),n=!0),c(this,t,e,!1,n)},l.prototype.unshift=function(t){return c(this,t,null,!0,!1)},l.prototype.isPaused=function(){return!1===this._readableState.flowing},l.prototype.setEncoding=function(t){return V||(V=n(22).StringDecoder),this._readableState.decoder=new V(t),this._readableState.encoding=t,this};var W=8388608;l.prototype.read=function(t){$("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return $("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?O(this):v(this),null;if(0===(t=p(t,e))&&e.ended)return 0===e.length&&O(this),null;var r=e.needReadable;$("need readable",r),(0===e.length||e.length-t<e.highWaterMark)&&(r=!0,$("length less than watermark",r)),e.ended||e.reading?(r=!1,$("reading or ended",r)):r&&($("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=p(n,e)));var i;return i=t>0?S(t,e):null,null===i?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&O(this)),null!==i&&this.emit("data",i),i},l.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},l.prototype.pipe=function(t,e){function n(t,e){$("onunpipe"),t===f&&e&&!1===e.hasUnpiped&&(e.hasUnpiped=!0,o())}function i(){$("onend"),t.end()}function o(){$("cleanup"),t.removeListener("close",c),t.removeListener("finish",u),t.removeListener("drain",v),t.removeListener("error",l),t.removeListener("unpipe",n),f.removeListener("end",i),f.removeListener("end",h),f.removeListener("data",a),m=!0,!d.awaitDrain||t._writableState&&!t._writableState.needDrain||v()}function a(e){$("ondata"),y=!1,!1!==t.write(e)||y||((1===d.pipesCount&&d.pipes===t||d.pipesCount>1&&-1!==L(d.pipes,t))&&!m&&($("false write response, pause",f._readableState.awaitDrain),f._readableState.awaitDrain++,y=!0),f.pause())}function l(e){$("onerror",e),h(),t.removeListener("error",l),0===N(t,"error")&&t.emit("error",e)}function c(){t.removeListener("finish",u),h()}function u(){$("onfinish"),t.removeListener("close",c),h()}function h(){$("unpipe"),f.unpipe(t)}var f=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=t;break;case 1:d.pipes=[d.pipes,t];break;default:d.pipes.push(t)}d.pipesCount+=1,$("pipe count=%d opts=%j",d.pipesCount,e);var p=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr,g=p?i:h;d.endEmitted?P(g):f.once("end",g),t.on("unpipe",n);var v=w(f);t.on("drain",v);var m=!1,y=!1;return f.on("data",a),s(t,"error",l),t.once("close",c),t.once("finish",u),t.emit("pipe",f),d.flowing||($("pipe resume"),f.resume()),t},l.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n),this);if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,n);return this}var s=L(e.pipes,t);return-1===s?this:(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,n),this)},l.prototype.on=function(t,e){var n=I.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&v(this):P(x,this))}return n},l.prototype.addListener=l.prototype.on,l.prototype.resume=function(){var t=this._readableState;return t.flowing||($("resume"),t.flowing=!0,_(this,t)),this},l.prototype.pause=function(){return $("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&($("pause"),this._readableState.flowing=!1,this.emit("pause")),this},l.prototype.wrap=function(t){var e=this._readableState,n=!1,r=this;t.on("end",function(){if($("wrapped end"),e.decoder&&!e.ended){var t=e.decoder.end();t&&t.length&&r.push(t)}r.push(null)}),t.on("data",function(i){$("wrapped data"),e.decoder&&(i=e.decoder.write(i)),(!e.objectMode||null!==i&&void 0!==i)&&(e.objectMode||i&&i.length)&&(r.push(i)||(n=!0,t.pause()))});for(var i in t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<q.length;o++)t.on(q[o],r.emit.bind(r,q[o]));return r._read=function(e){$("wrapped _read",e),n&&(n=!1,t.resume())},r},l._fromList=S}).call(e,n(0),n(8))},function(t,e,n){t.exports=n(13).EventEmitter},function(t,e,n){"use strict";function r(t,e){var n=this,r=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return r||i?void(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||s(o,this,t)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(s(o,n,t),n._writableState&&(n._writableState.errorEmitted=!0)):e&&e(t)}),void 0)}function i(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(t,e){t.emit("error",e)}var s=n(14);t.exports={destroy:r,undestroy:i}},function(t,e,n){"use strict";function r(t){this.afterTransform=function(e,n){return i(t,e,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function i(t,e,n){var r=t._transformState;r.transforming=!1;var i=r.writecb;if(!i)return t.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!==n&&void 0!==n&&t.push(n),i(e);var o=t._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&t._read(o.highWaterMark)}function o(t){if(!(this instanceof o))return new o(t);a.call(this,t),this._transformState=new r(this);var e=this;this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.once("prefinish",function(){"function"==typeof this._flush?this._flush(function(t,n){s(e,t,n)}):s(e)})}function s(t,e,n){if(e)return t.emit("error",e);null!==n&&void 0!==n&&t.push(n);var r=t._writableState,i=t._transformState;if(r.length)throw new Error("Calling transform done when ws.length != 0");if(i.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}t.exports=o;var a=n(2),l=n(9);l.inherits=n(1),l.inherits(o,a),o.prototype.push=function(t,e){return this._transformState.needTransform=!1,a.prototype.push.call(this,t,e)},o.prototype._transform=function(t,e,n){throw new Error("_transform() is not implemented")},o.prototype._write=function(t,e,n){var r=this._transformState;if(r.writecb=n,r.writechunk=t,r.writeencoding=e,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},o.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},o.prototype._destroy=function(t,e){var n=this;a.prototype._destroy.call(this,t,function(t){e(t),n.emit("close")})}},function(t,e){function n(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function r(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function i(t,e){var n=P(t)||p(t)?r(t.length,String):[],i=n.length,o=!!i;for(var s in t)!e&&!A.call(t,s)||o&&("length"==s||c(s,i))||n.push(s);return n}function o(t,e,n){var r=t[e];A.call(t,e)&&d(r,n)&&(void 0!==n||e in t)||(t[e]=n)}function s(t){if(!b(t))return f(t);var e=h(t),n=[];for(var r in t)("constructor"!=r||!e&&A.call(t,r))&&n.push(r);return n}function a(t,e){return e=L(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=L(r.length-e,0),s=Array(o);++i<o;)s[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=s,n(t,this,a)}}function l(t,e,n,r){n||(n={});for(var i=-1,s=e.length;++i<s;){var a=e[i],l=r?r(n[a],t[a],a,n,t):void 0;o(n,a,void 0===l?t[a]:l)}return n}function c(t,e){return!!(e=null==e?_:e)&&("number"==typeof t||T.test(t))&&t>-1&&t%1==0&&t<e}function u(t,e,n){if(!b(n))return!1;var r=typeof e;return!!("number"==r?g(n)&&c(e,n.length):"string"==r&&e in n)&&d(n[e],t)}function h(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||E)}function f(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}function d(t,e){return t===e||t!==t&&e!==e}function p(t){return v(t)&&A.call(t,"callee")&&(!M.call(t,"callee")||O.call(t)==C)}function g(t){return null!=t&&y(t.length)&&!m(t)}function v(t){return w(t)&&g(t)}function m(t){var e=b(t)?O.call(t):"";return e==k||e==S}function y(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=_}function b(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function w(t){return!!t&&"object"==typeof t}function x(t){return g(t)?i(t,!0):s(t)}var _=9007199254740991,C="[object Arguments]",k="[object Function]",S="[object GeneratorFunction]",T=/^(?:0|[1-9]\d*)$/,E=Object.prototype,A=E.hasOwnProperty,O=E.toString,M=E.propertyIsEnumerable,L=Math.max,P=Array.isArray,j=function(t){return a(function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,s&&u(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var a=n[r];a&&t(e,a,r,o)}return e})}(function(t,e){l(e,x(e),t)});t.exports=j},function(t,e){function n(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function r(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function i(t,e){var n=j(t)||g(t)?r(t.length,String):[],i=n.length,o=!!i;for(var s in t)!e&&!O.call(t,s)||o&&("length"==s||u(s,i))||n.push(s);return n}function o(t,e,n,r){return void 0===t||p(t,A[n])&&!O.call(r,n)?e:t}function s(t,e,n){var r=t[e];O.call(t,e)&&p(r,n)&&(void 0!==n||e in t)||(t[e]=n)}function a(t){if(!w(t))return d(t);var e=f(t),n=[];for(var r in t)("constructor"!=r||!e&&O.call(t,r))&&n.push(r);return n}function l(t,e){return e=P(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=P(r.length-e,0),s=Array(o);++i<o;)s[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=s,n(t,this,a)}}function c(t,e,n,r){n||(n={});for(var i=-1,o=e.length;++i<o;){var a=e[i],l=r?r(n[a],t[a],a,n,t):void 0;s(n,a,void 0===l?t[a]:l)}return n}function u(t,e){return!!(e=null==e?C:e)&&("number"==typeof t||E.test(t))&&t>-1&&t%1==0&&t<e}function h(t,e,n){if(!w(n))return!1;var r=typeof e;return!!("number"==r?v(n)&&u(e,n.length):"string"==r&&e in n)&&p(n[e],t)}function f(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||A)}function d(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}function p(t,e){return t===e||t!==t&&e!==e}function g(t){return m(t)&&O.call(t,"callee")&&(!L.call(t,"callee")||M.call(t)==k)}function v(t){return null!=t&&b(t.length)&&!y(t)}function m(t){return x(t)&&v(t)}function y(t){var e=w(t)?M.call(t):"";return e==S||e==T}function b(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=C}function w(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function x(t){return!!t&&"object"==typeof t}function _(t){return v(t)?i(t,!0):a(t)}var C=9007199254740991,k="[object Arguments]",S="[object Function]",T="[object GeneratorFunction]",E=/^(?:0|[1-9]\d*)$/,A=Object.prototype,O=A.hasOwnProperty,M=A.toString,L=A.propertyIsEnumerable,P=Math.max,j=Array.isArray,D=function(t){return l(function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,s&&h(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var a=n[r];a&&t(e,a,r,o)}return e})}(function(t,e,n,r){c(e,_(e),t,r)}),N=l(function(t){return t.push(void 0,o),n(D,void 0,t)});t.exports=N},function(t,e,n){"use strict";function r(t){return function(e,n,r){return"function"!=typeof e&&(e=p(e,r,n)),n=Array.isArray(n)?h(n):u(n),t(e,n)}}function i(t,e,n){return("function"==typeof e?e:d(e,n))(t)}function o(t,e,n){return v(t,e,n)}t.exports=o;var s=n(26),a=n(4),l=a.findOne,c=a.findAll,u=a.getChildren,h=a.removeSubsets,f=n(11).falseFunc,d=n(88),p=d.compileUnsafe,g=d.compileToken,v=r(function(t,e){return t!==f&&e&&0!==e.length?c(t,e):[]}),m=r(function(t,e){return t!==f&&e&&0!==e.length?l(t,e):null});o.compile=d,o.filters=s.filters,o.pseudos=s.pseudos,o.selectAll=v,o.selectOne=m,o.is=i,o.parse=d,o.iterate=v,o._compileUnsafe=p,o._compileToken=g},function(t,e,n){var r=n(4),i=r.hasAttrib,o=r.getAttributeValue,s=n(11).falseFunc,a=/[-[\]{}()*+?.,\\^$|#\s]/g,l={__proto__:null,equals:function(t,e){var n=e.name,r=e.value;return e.ignoreCase?(r=r.toLowerCase(),function(e){var i=o(e,n);return null!=i&&i.toLowerCase()===r&&t(e)}):function(e){return o(e,n)===r&&t(e)}},hyphen:function(t,e){var n=e.name,r=e.value,i=r.length;return e.ignoreCase?(r=r.toLowerCase(),function(e){var s=o(e,n);return null!=s&&(s.length===i||"-"===s.charAt(i))&&s.substr(0,i).toLowerCase()===r&&t(e)}):function(e){var s=o(e,n);return null!=s&&s.substr(0,i)===r&&(s.length===i||"-"===s.charAt(i))&&t(e)}},element:function(t,e){var n=e.name,r=e.value;if(/\s/.test(r))return s;r=r.replace(a,"\\$&");var i="(?:^|\\s)"+r+"(?:$|\\s)",l=e.ignoreCase?"i":"",c=new RegExp(i,l);return function(e){var r=o(e,n);return null!=r&&c.test(r)&&t(e)}},exists:function(t,e){var n=e.name;return function(e){return i(e,n)&&t(e)}},start:function(t,e){var n=e.name,r=e.value,i=r.length;return 0===i?s:e.ignoreCase?(r=r.toLowerCase(),
function(e){var s=o(e,n);return null!=s&&s.substr(0,i).toLowerCase()===r&&t(e)}):function(e){var s=o(e,n);return null!=s&&s.substr(0,i)===r&&t(e)}},end:function(t,e){var n=e.name,r=e.value,i=-r.length;return 0===i?s:e.ignoreCase?(r=r.toLowerCase(),function(e){var s=o(e,n);return null!=s&&s.substr(i).toLowerCase()===r&&t(e)}):function(e){var s=o(e,n);return null!=s&&s.substr(i)===r&&t(e)}},any:function(t,e){var n=e.name,r=e.value;if(""===r)return s;if(e.ignoreCase){var i=new RegExp(r.replace(a,"\\$&"),"i");return function(e){var r=o(e,n);return null!=r&&i.test(r)&&t(e)}}return function(e){var i=o(e,n);return null!=i&&i.indexOf(r)>=0&&t(e)}},not:function(t,e){var n=e.name,r=e.value;return""===r?function(e){return!!o(e,n)&&t(e)}:e.ignoreCase?(r=r.toLowerCase(),function(e){var i=o(e,n);return null!=i&&i.toLowerCase()!==r&&t(e)}):function(e){return o(e,n)!==r&&t(e)}}};t.exports={compile:function(t,e,n){if(n&&n.strict&&(e.ignoreCase||"not"===e.action))throw SyntaxError("Unsupported attribute selector");return l[e.action](t,e)},rules:l}},function(t,e){t.exports={universal:50,tag:30,attribute:1,pseudo:0,descendant:-1,child:-1,parent:-1,sibling:-1,adjacent:-1}},function(t,e,n){function r(t){function e(t){return t?x[x.length-1-t]:w}function n(t){return t===r(1)}function r(e){return t[m+(e||1)]}function a(){var t=x.pop();return w=x[x.length-1],t}function l(t){return w=t,x.push(w),x.length}function c(t){var e=w;return x[x.length-1]=w=t,e}function u(e){if(1==(e||1))"\n"==t[m]?(b++,v=1):v++,m++;else{var n=t.slice(m,m+e).split("\n");n.length>1&&(b+=n.length-1,v=1),v+=n[n.length-1].length,m+=e}}function h(){_.end={line:b,col:v},i&&s("addToken:",JSON.stringify(_,null,2)),C.push(_),g="",_={}}function f(t){_={type:t,start:{line:b,col:v}}}var d,p,g="",v=0,m=-1,y=0,b=1,w="before-selector",x=[w],_={},C=[],k=["media","keyframes",{name:"-webkit-keyframes",type:"keyframes",prefix:"-webkit-"},{name:"-moz-keyframes",type:"keyframes",prefix:"-moz-"},{name:"-ms-keyframes",type:"keyframes",prefix:"-ms-"},{name:"-o-keyframes",type:"keyframes",prefix:"-o-"},"font-face",{name:"import",state:"before-at-value"},{name:"charset",state:"before-at-value"},"supports","viewport",{name:"namespace",state:"before-at-value"},"document",{name:"-moz-document",type:"document",prefix:"-moz-"},"page"];for(o&&(d=Date.now());p=function(){return u(),t[m]}();)switch(i&&s(p,e()),p){case" ":switch(e()){case"selector":case"value":case"value-paren":case"at-group":case"at-value":case"comment":case"double-string":case"single-string":g+=p}break;case"\n":case"\t":case"\r":case"\f":switch(e()){case"value":case"value-paren":case"at-group":case"comment":case"single-string":case"double-string":case"selector":g+=p;break;case"at-value":"\n"===p&&(_.value=g.trim(),h(),a())}break;case":":switch(e()){case"name":_.name=g.trim(),g="",c("before-value");break;case"before-selector":g+=p,f("selector"),l("selector");break;case"before-value":c("value"),g+=p;break;default:g+=p}break;case";":switch(e()){case"name":case"before-value":case"value":g.trim().length>0&&(_.value=g.trim(),h()),c("before-name");break;case"value-paren":g+=p;break;case"at-value":_.value=g.trim(),h(),a();break;case"before-name":break;default:g+=p}break;case"{":switch(e()){case"selector":if("\\"===r(-1)){g+=p;break}_.text=g.trim(),h(),c("before-name"),y+=1;break;case"at-group":switch(_.name=g.trim(),_.type){case"font-face":case"viewport":case"page":l("before-name");break;default:l("before-selector")}h(),y+=1;break;case"name":case"at-rule":_.name=g.trim(),h(),l("before-name"),y+=1;break;case"comment":case"double-string":case"single-string":g+=p;break;case"before-value":c("value"),g+=p}break;case"}":switch(e()){case"before-name":case"name":case"before-value":case"value":g&&(_.value=g.trim()),_.name&&_.value&&h(),f("end"),h(),a(),"at-group"===e()&&(f("at-group-end"),h(),a()),y>0&&(y-=1);break;case"at-group":case"before-selector":case"selector":if("\\"===r(-1)){g+=p;break}y>0&&"at-group"===e(1)&&(f("at-group-end"),h()),y>1&&a(),y>0&&(y-=1);break;case"double-string":case"single-string":case"comment":g+=p}break;case'"':case"'":switch(e()){case"double-string":'"'===p&&"\\"!==r(-1)&&a();break;case"single-string":"'"===p&&"\\"!==r(-1)&&a();break;case"before-at-value":c("at-value"),l('"'===p?"double-string":"single-string");break;case"before-value":c("value"),l('"'===p?"double-string":"single-string");break;case"comment":break;default:"\\"!==r(-1)&&l('"'===p?"double-string":"single-string")}g+=p;break;case"/":switch(e()){case"comment":case"double-string":case"single-string":g+=p;break;case"before-value":case"selector":case"name":case"value":if(n("*")){var S=function(e){var n=t.slice(m).indexOf(e);return n>0&&n}("*/");S&&u(S+1)}else"before-value"==e()&&c("value"),g+=p;break;default:n("*")?(f("comment"),l("comment"),u()):g+=p}break;case"*":switch(e()){case"comment":n("/")?(_.text=g,u(),h(),a()):g+=p;break;case"before-selector":g+=p,f("selector"),l("selector");break;case"before-value":c("value"),g+=p;break;default:g+=p}break;case"@":switch(e()){case"comment":case"double-string":case"single-string":g+=p;break;case"before-value":c("value"),g+=p;break;default:for(var T,E,A=!1,O=0,M=k.length;!A&&O<M;++O)E=k[O],T=E.name||E,function(e){var n=m+1;return e===t.slice(n,n+e.length)}(T)&&(A=!0,f(T),l(E.state||"at-group"),u(T.length),E.prefix&&(_.prefix=E.prefix),E.type&&(_.type=E.type));A||(g+=p)}break;case"(":switch(e()){case"value":l("value-paren");break;case"before-value":c("value")}g+=p;break;case")":switch(e()){case"value-paren":a();break;case"before-value":c("value")}g+=p;break;default:switch(e()){case"before-selector":f("selector"),l("selector");break;case"before-name":f("property"),c("name");break;case"before-value":c("value");break;case"before-at-value":c("at-value")}g+=p}return o&&s("ran in",Date.now()-d+"ms"),C}var i=!1,o=!1,s=n(28)("lex");t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=grapesjs.plugins.add("gjs-preset-newsletter",function(t,e){var r=e||{},i=t.getConfig(),o=i.stylePrefix,s={editor:t,pfx:o||"",cmdOpenImport:"gjs-open-import-template",cmdTglImages:"gjs-toggle-images",cmtTglImagesLabel:"Toggle Images",cmdBtnMoveLabel:"Move",cmdBtnUndoLabel:"Undo",cmdBtnRedoLabel:"Redo",cmdBtnDesktopLabel:"Desktop",cmdBtnTabletLabel:"Tablet",cmdBtnMobileLabel:"Mobile",modalTitleImport:"Import template",modalTitleExport:"Export template",modalLabelImport:"",modalLabelExport:"",modalBtnImport:"Import",codeViewerTheme:"hopscotch",openBlocksBtnTitle:r.openBlocksBtnTitle||"",openLayersBtnTitle:r.openLayersBtnTitle||"",openSmBtnTitle:r.openSmBtnTitle||"",openTmBtnTitle:r.openTmBtnTitle||"",expTplBtnTitle:r.expTplBtnTitle||"View Code",fullScrBtnTitle:r.fullScrBtnTitle||"FullScreen",swichtVwBtnTitle:r.swichtVwBtnTitle||"View Components",categoryLabel:r.categoryLabel||"",importPlaceholder:"",defaultTemplate:"",inlineCss:1,cellStyle:{padding:0,margin:0,"vertical-align":"top"},tableStyle:{height:"150px",margin:"0 auto 10px auto",padding:"5px 5px 5px 5px",width:"100%"},sect100BlkLabel:"1 Section",sect50BlkLabel:"1/2 Section",sect30BlkLabel:"1/3 Section",sect37BlkLabel:"3/7 Section",buttonBlkLabel:"Button",dividerBlkLabel:"Divider",textBlkLabel:"Text",textSectionBlkLabel:"Text Section",imageBlkLabel:"Image",quoteBlkLabel:"Quote",linkBlkLabel:"Link",linkBlockBlkLabel:"Link Block",gridItemsBlkLabel:"Grid Items",listItemsBlkLabel:"List Items",assetsModalTitle:r.assetsModalTitle||"Select image",styleManagerSectors:[{name:"Dimension",open:!1,buildProps:["width","height","max-width","min-height","margin","padding"],properties:[{property:"margin",properties:[{name:"Top",property:"margin-top"},{name:"Left",property:"margin-left"},{name:"Right",property:"margin-right"},{name:"Bottom",property:"margin-bottom"}]},{property:"padding",properties:[{name:"Top",property:"padding-top"},{name:"Right",property:"padding-right"},{name:"Bottom",property:"padding-bottom"},{name:"Left",property:"padding-left"}]}]},{name:"Typography",open:!1,buildProps:["font-family","font-size","font-weight","letter-spacing","color","line-height","text-align","text-decoration","font-style","vertical-align","text-shadow"],properties:[{name:"Font",property:"font-family"},{name:"Weight",property:"font-weight"},{name:"Font color",property:"color"},{property:"text-align",type:"radio",defaults:"left",list:[{value:"left",name:"Left",className:"fa fa-align-left"},{value:"center",name:"Center",className:"fa fa-align-center"},{value:"right",name:"Right",className:"fa fa-align-right"},{value:"justify",name:"Justify",className:"fa fa-align-justify"}]},{property:"text-decoration",type:"radio",defaults:"none",list:[{value:"none",name:"None",className:"fa fa-times"},{value:"underline",name:"underline",className:"fa fa-underline"},{value:"line-through",name:"Line-through",className:"fa fa-strikethrough"}]},{property:"font-style",type:"radio",defaults:"normal",list:[{value:"normal",name:"Normal",className:"fa fa-font"},{value:"italic",name:"Italic",className:"fa fa-italic"}]},{property:"vertical-align",type:"select",defaults:"baseline",list:[{value:"baseline"},{value:"top"},{value:"middle"},{value:"bottom"}]},{property:"text-shadow",properties:[{name:"X position",property:"text-shadow-h"},{name:"Y position",property:"text-shadow-v"},{name:"Blur",property:"text-shadow-blur"},{name:"Color",property:"text-shadow-color"}]}]},{name:"Decorations",open:!1,buildProps:["background-color","border-collapse","border-radius","border","background"],properties:[{property:"background-color",name:"Background"},{property:"border-radius",properties:[{name:"Top",property:"border-top-left-radius"},{name:"Right",property:"border-top-right-radius"},{name:"Bottom",property:"border-bottom-left-radius"},{name:"Left",property:"border-bottom-right-radius"}]},{property:"border-collapse",type:"radio",defaults:"separate",list:[{value:"separate",name:"No"},{value:"collapse",name:"Yes"}]},{property:"border",properties:[{name:"Width",property:"border-width",defaults:"0"},{name:"Style",property:"border-style"},{name:"Color",property:"border-color"}]},{property:"background",properties:[{name:"Image",property:"background-image"},{name:"Repeat",property:"background-repeat"},{name:"Position",property:"background-position"},{name:"Attachment",property:"background-attachment"},{name:"Size",property:"background-size"}]}]}]};i.devicePreviewMode=1;for(var a in s)a in r||(r[a]=s[a]);n(47)(r),n(113)(r),n(114)(r),n(115)(r),!t.getHtml()&&r.defaultTemplate&&(t.setComponents(r.defaultTemplate),t.editor.initChildrenComp(t.DomComponents.getWrapper())),t.on("change:selectedComponent",function(){var e=t.Panels.getButton("views","open-layers");if((!e||!e.get("active"))&&t.editor.get("selectedComponent")){var n=t.Panels.getButton("views","open-sm");n.set("attributes",{title:s.openSmBtnTitle}),n&&n.set("active",1)}}),t.on("run:open-assets",function(){t.Modal.setTitle(s.assetsModalTitle)}),t.on("load",function(){t.Panels.getButton("options","export-template").set("attributes",{title:s.expTplBtnTitle}),t.Panels.getButton("options","fullscreen").set("attributes",{title:s.fullScrBtnTitle}),t.Panels.getButton("options","sw-visibility").set("attributes",{title:s.swichtVwBtnTitle}),t.Panels.getButton("views","open-sm").set("attributes",{title:s.openSmBtnTitle}),t.Panels.getButton("views","open-tm").set("attributes",{title:s.openTmBtnTitle}),t.Panels.getButton("views","open-layers").set("attributes",{title:s.openLayersBtnTitle});var e=t.Panels.getButton("views","open-blocks");e.set("attributes",{title:s.openBlocksBtnTitle}),e&&e.set("active",1)})})},function(t,e,n){"use strict";var r;void 0!==(r=function(){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.editor,r=e.Commands,i=n(48),o=n(49),s=n(112);r.add(t.cmdOpenImport,i(t)),r.add(t.cmdTglImages,s(t)),e.on("load",function(){r.add("export-template",o(t))}),r.add("undo",{run:function(t,e){e.set("active",0),t.UndoManager.undo(1)}}),r.add("redo",{run:function(t,e){e.set("active",0),t.UndoManager.redo(1)}}),r.add("set-device-desktop",{run:function(t){t.setDevice("Desktop")}}),r.add("set-device-tablet",{run:function(t){t.setDevice("Tablet")}}),r.add("set-device-mobile",{run:function(t){t.setDevice("Mobile portrait")}})}}.call(e,n,e,t))&&(t.exports=r)},function(t,e,n){"use strict";var r;void 0!==(r=function(){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.editor,n=e&&e.CodeManager.getViewer("CodeMirror").clone(),r=document.createElement("button"),i=document.createElement("div"),o=t.pfx||"";return r.innerHTML=t.modalBtnImport,r.className=o+"btn-prim "+o+"btn-import",r.onclick=function(){var t=n.editor.getValue();e.DomComponents.getWrapper().set("content",""),e.setComponents(t),e.Modal.close()},n.set({codeName:"htmlmixed",theme:t.codeViewerTheme,readOnly:0}),{run:function(e,s){var a=e.Modal,l=(a.getContentEl(),n.editor);if(a.setTitle(t.modalTitleImport),!l){var c=document.createElement("textarea");if(t.modalLabelImport){var u=document.createElement("div");u.className=o+"import-label",u.innerHTML=t.modalLabelImport,i.appendChild(u)}i.appendChild(c),i.appendChild(r),n.init(c),l=n.editor}a.setContent(""),a.setContent(i),n.setContent(t.importPlaceholder||""),a.open(),l.refresh(),s&&s.set("active",0)}}}}.call(e,n,e,t))&&(t.exports=r)},function(t,e,n){"use strict";var r;void 0!==(r=function(){var t=n(50);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.editor,r=n&&n.CodeManager.getViewer("CodeMirror").clone(),i=document.createElement("div"),o=e.pfx||"",s=n.Commands;return r.set({codeName:"htmlmixed",theme:e.codeViewerTheme}),s.add(o+"get-inlined-html",{run:function(e){var n=e.getHtml()+"<style>"+e.getCss()+"</style>";return t(n)}}),{run:function(n,s){var a=n.Modal,l=(a.getContentEl(),r.editor);if(a.setTitle(e.modalTitleExport),!l){var c=document.createElement("textarea");if(e.modalLabelExport){var u=document.createElement("div");u.className=o+"export-label",u.innerHTML=e.modalLabelExport,i.appendChild(u)}i.appendChild(c),r.init(c),l=r.editor,l.setOption("lineWrapping",1)}a.setContent(i);var h=n.getHtml()+"<style>"+n.getCss()+"</style>";r.setContent(e.inlineCss?t(h):h),a.open(),l.refresh(),s&&s.set&&s.set("active",0)}}}}.call(e,n,e,t))&&(t.exports=r)},function(t,e,n){"use strict";var r=n(51),i=n(111),o=i(function(t,e){return r(t,{xmlMode:e&&e.xmlMode},s,[e])}),s=function(t,e){return o.juiceDocument(t,e)};o.inlineContent=function(t,e,n){return r(t,{xmlMode:n&&n.xmlMode},o.inlineDocument,[e,n])},t.exports=o},function(t,e,n){"use strict";var r=n(52),i=n(27),o=function(t,e){return e=i.extend({decodeEntities:!1},e||{}),t=l(t),r.load(t,e)},s=function(e){var n=t.exports.codeBlocks;return Object.keys(n).forEach(function(t){var r=new RegExp(n[t].start+"((.|\\s)*?)"+n[t].end,"g");e=e.replace(r,function(e,r){return"<!--"+t+" "+n[t].start+r+n[t].end+" -->"})}),e},a=function(e){var n=t.exports.codeBlocks;return Object.keys(n).forEach(function(t){var r=new RegExp("<!--"+t+" "+n[t].start+"((.|\\s)*?)"+n[t].end+" -->","g");e=e.replace(r,function(e,r){return n[t].start+r+n[t].end})}),e},l=function(t){return s(t)},c=function(t){return a(t)};t.exports=function(t,e,n,r){var i=o(t,e),s=[i];s.push.apply(s,r);var a=n.apply(void 0,s)||i;return e&&e.xmlMode?a.xml():c(a.html())},t.exports.codeBlocks={EJS:{start:"<%",end:"%>"},HBS:{start:"{{",end:"}}"}}},function(t,e,n){e=t.exports=n(16),e.version=n(104).version},function(t,e,n){"use strict";function r(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return 3*t.length/4-r(t)}function o(t){var e,n,i,o,s,a,l=t.length;s=r(t),a=new h(3*l/4-s),i=s>0?l-4:l;var c=0;for(e=0,n=0;e<i;e+=4,n+=3)o=u[t.charCodeAt(e)]<<18|u[t.charCodeAt(e+1)]<<12|u[t.charCodeAt(e+2)]<<6|u[t.charCodeAt(e+3)],a[c++]=o>>16&255,a[c++]=o>>8&255,a[c++]=255&o;return 2===s?(o=u[t.charCodeAt(e)]<<2|u[t.charCodeAt(e+1)]>>4,a[c++]=255&o):1===s&&(o=u[t.charCodeAt(e)]<<10|u[t.charCodeAt(e+1)]<<4|u[t.charCodeAt(e+2)]>>2,a[c++]=o>>8&255,a[c++]=255&o),a}function s(t){return c[t>>18&63]+c[t>>12&63]+c[t>>6&63]+c[63&t]}function a(t,e,n){for(var r,i=[],o=e;o<n;o+=3)r=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(s(r));return i.join("")}function l(t){for(var e,n=t.length,r=n%3,i="",o=[],s=0,l=n-r;s<l;s+=16383)o.push(a(t,s,s+16383>l?l:s+16383));return 1===r?(e=t[n-1],i+=c[e>>2],i+=c[e<<4&63],i+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],i+=c[e>>10],i+=c[e>>4&63],i+=c[e<<2&63],i+="="),o.push(i),o.join("")}e.byteLength=i,e.toByteArray=o,e.fromByteArray=l;for(var c=[],u=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,p=f.length;d<p;++d)c[d]=f[d],u[f.charCodeAt(d)]=d;u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var o,s,a=8*i-r-1,l=(1<<a)-1,c=l>>1,u=-7,h=n?i-1:0,f=n?-1:1,d=t[e+h];for(h+=f,o=d&(1<<-u)-1,d>>=-u,u+=a;u>0;o=256*o+t[e+h],h+=f,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=r;u>0;s=256*s+t[e+h],h+=f,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,r),o-=c}return(d?-1:1)*s*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var s,a,l,c=8*o-i-1,u=(1<<c)-1,h=u>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),e+=s+h>=1?f/l:f*Math.pow(2,1-h),e*l>=2&&(s++,l/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(e*l-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[n+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;t[n+d]=255&s,d+=p,s/=256,c-=8);t[n+d-p]|=128*g}},function(t,e){t.exports={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376}},function(t,e,n){function r(t,e,n){"object"==typeof t?(n=e,e=t,t=null):"function"==typeof e&&(n=e,e=l),this._callback=t,this._options=e||l,this._elementCB=n,this.dom=[],this._done=!1,this._tagStack=[],this._parser=this._parser||null}var i=n(7),o=/\s+/g,s=n(34),a=n(57),l={normalizeWhitespace:!1,withStartIndices:!1};r.prototype.onparserinit=function(t){this._parser=t},r.prototype.onreset=function(){r.call(this,this._callback,this._options,this._elementCB)},r.prototype.onend=function(){this._done||(this._done=!0,this._parser=null,this._handleCallback(null))},r.prototype._handleCallback=r.prototype.onerror=function(t){if("function"==typeof this._callback)this._callback(t,this.dom);else if(t)throw t},r.prototype.onclosetag=function(){var t=this._tagStack.pop();this._elementCB&&this._elementCB(t)},r.prototype._addDomElement=function(t){var e=this._tagStack[this._tagStack.length-1],n=e?e.children:this.dom,r=n[n.length-1];t.next=null,this._options.withStartIndices&&(t.startIndex=this._parser.startIndex),this._options.withDomLvl1&&(t.__proto__="tag"===t.type?a:s),r?(t.prev=r,r.next=t):t.prev=null,n.push(t),t.parent=e||null},r.prototype.onopentag=function(t,e){var n={type:"script"===t?i.Script:"style"===t?i.Style:i.Tag,name:t,attribs:e,children:[]};this._addDomElement(n),this._tagStack.push(n)},r.prototype.ontext=function(t){var e,n=this._options.normalizeWhitespace||this._options.ignoreWhitespace;!this._tagStack.length&&this.dom.length&&(e=this.dom[this.dom.length-1]).type===i.Text?n?e.data=(e.data+t).replace(o," "):e.data+=t:this._tagStack.length&&(e=this._tagStack[this._tagStack.length-1])&&(e=e.children[e.children.length-1])&&e.type===i.Text?n?e.data=(e.data+t).replace(o," "):e.data+=t:(n&&(t=t.replace(o," ")),this._addDomElement({data:t,type:i.Text}))},r.prototype.oncomment=function(t){var e=this._tagStack[this._tagStack.length-1];if(e&&e.type===i.Comment)return void(e.data+=t);var n={data:t,type:i.Comment};this._addDomElement(n),this._tagStack.push(n)},r.prototype.oncdatastart=function(){var t={children:[{data:"",type:i.Text}],type:i.CDATA};this._addDomElement(t),this._tagStack.push(t)},r.prototype.oncommentend=r.prototype.oncdataend=function(){this._tagStack.pop()},r.prototype.onprocessinginstruction=function(t,e){this._addDomElement({name:t,data:e,type:i.Directive})},t.exports=r},function(t,e,n){var r=n(34),i=t.exports=Object.create(r),o={tagName:"name"};Object.keys(o).forEach(function(t){var e=o[t];Object.defineProperty(i,t,{get:function(){return this[e]||null},set:function(t){return this[e]=t,t}})})},function(t,e,n){function r(t,e){this.init(t,e)}function i(t,e){return u.getElementsByTagName(t,e,!0)}function o(t,e){return u.getElementsByTagName(t,e,!0,1)[0]}function s(t,e,n){return u.getText(u.getElementsByTagName(t,e,n,1)).trim()}function a(t,e,n,r,i){var o=s(n,r,i);o&&(t[e]=o)}var l=n(3),c=l.DomHandler,u=l.DomUtils;n(1)(r,c),r.prototype.init=c;var h=function(t){return"rss"===t||"feed"===t||"rdf:RDF"===t};r.prototype.onend=function(){var t,e,n={},r=o(h,this.dom);r&&("feed"===r.name?(e=r.children,n.type="atom",a(n,"id","id",e),a(n,"title","title",e),(t=o("link",e))&&(t=t.attribs)&&(t=t.href)&&(n.link=t),a(n,"description","subtitle",e),(t=s("updated",e))&&(n.updated=new Date(t)),a(n,"author","email",e,!0),n.items=i("entry",e).map(function(t){var e,n={};return t=t.children,a(n,"id","id",t),a(n,"title","title",t),(e=o("link",t))&&(e=e.attribs)&&(e=e.href)&&(n.link=e),(e=s("summary",t)||s("content",t))&&(n.description=e),(e=s("updated",t))&&(n.pubDate=new Date(e)),n})):(e=o("channel",r.children).children,n.type=r.name.substr(0,3),n.id="",a(n,"title","title",e),a(n,"link","link",e),a(n,"description","description",e),(t=s("lastBuildDate",e))&&(n.updated=new Date(t)),a(n,"author","managingEditor",e,!0),n.items=i("item",r.children).map(function(t){var e,n={};return t=t.children,a(n,"id","guid",t),a(n,"title","title",t),a(n,"link","link",t),a(n,"description","description",t),(e=s("pubDate",t))&&(n.pubDate=new Date(e)),n}))),this.dom=n,c.prototype._handleCallback.call(this,r?null:Error("couldn't find root of feed"))},t.exports=r},function(t,e,n){function r(t){o.call(this,new i(this),t)}function i(t){this.scope=t}t.exports=r;var o=n(35);n(1)(r,o),r.prototype.readable=!0;var s=n(3).EVENTS;Object.keys(s).forEach(function(t){if(0===s[t])i.prototype["on"+t]=function(){this.scope.emit(t)};else if(1===s[t])i.prototype["on"+t]=function(e){this.scope.emit(t,e)};else{if(2!==s[t])throw Error("wrong number of arguments!");i.prototype["on"+t]=function(e,n){this.scope.emit(t,e,n)}}})},function(t,e,n){function r(){i.call(this)}t.exports=r;var i=n(13).EventEmitter;n(1)(r,i),r.Readable=n(19),r.Writable=n(67),r.Duplex=n(68),r.Transform=n(69),r.PassThrough=n(70),r.Stream=r,r.prototype.pipe=function(t,e){function n(e){t.writable&&!1===t.write(e)&&c.pause&&c.pause()}function r(){c.readable&&c.resume&&c.resume()}function o(){u||(u=!0,t.end())}function s(){u||(u=!0,"function"==typeof t.destroy&&t.destroy())}function a(t){if(l(),0===i.listenerCount(this,"error"))throw t}function l(){c.removeListener("data",n),t.removeListener("drain",r),c.removeListener("end",o),c.removeListener("close",s),c.removeListener("error",a),t.removeListener("error",a),c.removeListener("end",l),c.removeListener("close",l),t.removeListener("close",l)}var c=this;c.on("data",n),t.on("drain",r),t._isStdio||e&&!1===e.end||(c.on("end",o),c.on("close",s));var u=!1;return c.on("error",a),t.on("error",a),c.on("end",l),c.on("close",l),t.on("close",l),t.emit("pipe",c),t}},function(t,e){},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e,n){t.copy(e,n)}var o=n(20).Buffer;t.exports=function(){function t(){r(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},t.prototype.concat=function(t){if(0===this.length)return o.alloc(0);if(1===this.length)return this.head.data;for(var e=o.allocUnsafe(t>>>0),n=this.head,r=0;n;)i(n.data,e,r),r+=n.data.length,n=n.next;return e},t}()},function(t,e,n){function r(t,e){this._id=t,this._clearFn=e}var i=Function.prototype.apply;e.setTimeout=function(){return new r(i.call(setTimeout,window,arguments),clearTimeout)},e.setInterval=function(){return new r(i.call(setInterval,window,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(window,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(64),e.setImmediate=setImmediate,e.clearImmediate=clearImmediate},function(t,e,n){(function(t,e){!function(t,n){"use strict";function r(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var r={callback:t,args:e};return c[l]=r,a(l),l++}function i(t){delete c[t]}function o(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(n,r)}}function s(t){if(u)setTimeout(s,0,t);else{var e=c[t];if(e){u=!0;try{o(e)}finally{i(t),u=!1}}}}if(!t.setImmediate){var a,l=1,c={},u=!1,h=t.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(t);f=f&&f.setTimeout?f:t,"[object process]"==={}.toString.call(t.process)?function(){a=function(t){e.nextTick(function(){s(t)})}}():function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?function(){var e="setImmediate$"+Math.random()+"$",n=function(n){n.source===t&&"string"==typeof n.data&&0===n.data.indexOf(e)&&s(+n.data.slice(e.length))};t.addEventListener?t.addEventListener("message",n,!1):t.attachEvent("onmessage",n),a=function(n){t.postMessage(e+n,"*")}}():t.MessageChannel?function(){var t=new MessageChannel;t.port1.onmessage=function(t){s(t.data)},a=function(e){t.port2.postMessage(e)}}():h&&"onreadystatechange"in h.createElement("script")?function(){var t=h.documentElement;a=function(e){var n=h.createElement("script");n.onreadystatechange=function(){s(e),n.onreadystatechange=null,t.removeChild(n),n=null},t.appendChild(n)}}():function(){a=function(t){setTimeout(s,0,t)}}(),f.setImmediate=r,f.clearImmediate=i}}("undefined"==typeof self?void 0===t?this:t:self)}).call(e,n(0),n(8))},function(t,e,n){(function(e){function n(t,e){function n(){if(!i){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation"),void 0,i=!0}return t.apply(this,arguments)}if(r("noDeprecation"))return t;var i=!1;return n}function r(t){try{if(!e.localStorage)return!1}catch(t){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=n}).call(e,n(0))},function(t,e,n){"use strict";function r(t){return this instanceof r?void i.call(this,t):new r(t)}t.exports=r;var i=n(39),o=n(9);o.inherits=n(1),o.inherits(r,i),r.prototype._transform=function(t,e,n){n(null,t)}},function(t,e,n){t.exports=n(21)},function(t,e,n){t.exports=n(2)},function(t,e,n){t.exports=n(19).Transform},function(t,e,n){t.exports=n(19).PassThrough},function(t,e){},function(t,e,n){function r(t){this._cbs=t||{}}t.exports=r;var i=n(3).EVENTS;Object.keys(i).forEach(function(t){if(0===i[t])t="on"+t,r.prototype[t]=function(){this._cbs[t]&&this._cbs[t]()};else if(1===i[t])t="on"+t,r.prototype[t]=function(e){this._cbs[t]&&this._cbs[t](e)};else{if(2!==i[t])throw Error("wrong number of arguments");t="on"+t,r.prototype[t]=function(e,n){this._cbs[t]&&this._cbs[t](e,n)}}})},function(t,e,n){function r(t,e){return t.children?t.children.map(function(t){return s(t,e)}).join(""):""}function i(t){return Array.isArray(t)?t.map(i).join(""):a(t)||t.type===o.CDATA?i(t.children):t.type===o.Text?t.data:""}var o=n(7),s=n(23),a=o.isTag;t.exports={getInnerHTML:r,getOuterHTML:s,getText:i}},function(t,e){t.exports={Text:"text",Directive:"directive",Comment:"comment",Script:"script",Style:"style",Tag:"tag",CDATA:"cdata",isTag:function(t){return"tag"===t.type||"script"===t.type||"style"===t.type}}},function(t,e,n){var r=n(76),i=n(77);e.decode=function(t,e){return(!e||e<=0?i.XML:i.HTML)(t)},e.decodeStrict=function(t,e){return(!e||e<=0?i.XML:i.HTMLStrict)(t)},e.encode=function(t,e){return(!e||e<=0?r.XML:r.HTML)(t)},e.encodeXML=r.XML,e.encodeHTML4=e.encodeHTML5=e.encodeHTML=r.HTML,e.decodeXML=e.decodeXMLStrict=i.XML,e.decodeHTML4=e.decodeHTML5=e.decodeHTML=i.HTML,e.decodeHTML4Strict=e.decodeHTML5Strict=e.decodeHTMLStrict=i.HTMLStrict,e.escape=r.escape},function(t,e,n){function r(t){return Object.keys(t).sort().reduce(function(e,n){return e[t[n]]="&"+n+";",e},{})}function i(t){var e=[],n=[];return Object.keys(t).forEach(function(t){1===t.length?e.push("\\"+t):n.push(t)}),n.unshift("["+e.join("")+"]"),new RegExp(n.join("|"),"g")}function o(t){return"&#x"+t.charCodeAt(0).toString(16).toUpperCase()+";"}function s(t){return"&#x"+(1024*(t.charCodeAt(0)-55296)+t.charCodeAt(1)-56320+65536).toString(16).toUpperCase()+";"}function a(t,e){function n(e){return t[e]}return function(t){return t.replace(e,n).replace(p,s).replace(d,o)}}function l(t){return t.replace(g,o).replace(p,s).replace(d,o)}var c=r(n(18)),u=i(c);e.XML=a(c,u);var h=r(n(17)),f=i(h);e.HTML=a(h,f);var d=/[^\0-\x7F]/g,p=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,g=i(c);e.escape=l},function(t,e,n){function r(t){var e=Object.keys(t).join("|"),n=o(t);e+="|#[xX][\\da-fA-F]+|#\\d+";var r=new RegExp("&(?:"+e+");","g");return function(t){return String(t).replace(r,n)}}function i(t,e){return t<e?1:-1}function o(t){return function(e){return"#"===e.charAt(1)?c("X"===e.charAt(2)||"x"===e.charAt(2)?parseInt(e.substr(3),16):parseInt(e.substr(2),10)):t[e.slice(1,-1)]}}var s=n(17),a=n(33),l=n(18),c=n(32),u=r(l),h=r(s),f=function(){function t(t){return";"!==t.substr(-1)&&(t+=";"),u(t)}for(var e=Object.keys(a).sort(i),n=Object.keys(s).sort(i),r=0,l=0;r<n.length;r++)e[l]===n[r]?(n[r]+=";?",l++):n[r]+=";";var c=new RegExp("&(?:"+n.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),u=o(s);return function(e){return String(e).replace(c,t)}}();t.exports={XML:u,HTML:f,HTMLStrict:h}},function(t,e){var n=e.getChildren=function(t){return t.children},r=e.getParent=function(t){return t.parent};e.getSiblings=function(t){var e=r(t);return e?n(e):[t]},e.getAttributeValue=function(t,e){return t.attribs&&t.attribs[e]},e.hasAttrib=function(t,e){return!!t.attribs&&hasOwnProperty.call(t.attribs,e)},e.getName=function(t){return t.name}},function(t,e){e.removeElement=function(t){if(t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t.parent){var e=t.parent.children;e.splice(e.lastIndexOf(t),1)}},e.replaceElement=function(t,e){var n=e.prev=t.prev;n&&(n.next=e);var r=e.next=t.next;r&&(r.prev=e);var i=e.parent=t.parent;if(i){var o=i.children;o[o.lastIndexOf(t)]=e}},e.appendChild=function(t,e){if(e.parent=t,1!==t.children.push(e)){var n=t.children[t.children.length-2];n.next=e,e.prev=n,e.next=null}},e.append=function(t,e){var n=t.parent,r=t.next;if(e.next=r,e.prev=t,t.next=e,e.parent=n,r){if(r.prev=e,n){var i=n.children;i.splice(i.lastIndexOf(r),0,e)}}else n&&n.children.push(e)},e.prepend=function(t,e){var n=t.parent;if(n){var r=n.children;r.splice(r.lastIndexOf(t),0,e)}t.prev&&(t.prev.next=e),e.parent=n,e.prev=t.prev,e.next=t,t.prev=e}},function(t,e,n){
function r(t,e,n,r){return Array.isArray(e)||(e=[e]),"number"==typeof r&&isFinite(r)||(r=1/0),i(t,e,!1!==n,r)}function i(t,e,n,r){for(var o,s=[],a=0,l=e.length;a<l&&!(t(e[a])&&(s.push(e[a]),--r<=0))&&(o=e[a].children,!(n&&o&&o.length>0&&(o=i(t,o,n,r),s=s.concat(o),(r-=o.length)<=0)));a++);return s}function o(t,e){for(var n=0,r=e.length;n<r;n++)if(t(e[n]))return e[n];return null}function s(t,e){for(var n=null,r=0,i=e.length;r<i&&!n;r++)c(e[r])&&(t(e[r])?n=e[r]:e[r].children.length>0&&(n=s(t,e[r].children)));return n}function a(t,e){for(var n=0,r=e.length;n<r;n++)if(c(e[n])&&(t(e[n])||e[n].children.length>0&&a(t,e[n].children)))return!0;return!1}function l(t,e){for(var n=[],r=0,i=e.length;r<i;r++)c(e[r])&&(t(e[r])&&n.push(e[r]),e[r].children.length>0&&(n=n.concat(l(t,e[r].children))));return n}var c=n(7).isTag;t.exports={filter:r,find:i,findOneChild:o,findOne:s,existsOne:a,findAll:l}},function(t,e,n){function r(t,e){return"function"==typeof e?function(n){return n.attribs&&e(n.attribs[t])}:function(n){return n.attribs&&n.attribs[t]===e}}function i(t,e){return function(n){return t(n)||e(n)}}var o=n(7),s=e.isTag=o.isTag;e.testElement=function(t,e){for(var n in t)if(t.hasOwnProperty(n))if("tag_name"===n){if(!s(e)||!t.tag_name(e.name))return!1}else if("tag_type"===n){if(!t.tag_type(e.type))return!1}else if("tag_contains"===n){if(s(e)||!t.tag_contains(e.data))return!1}else if(!e.attribs||!t[n](e.attribs[n]))return!1;return!0};var a={tag_name:function(t){return"function"==typeof t?function(e){return s(e)&&t(e.name)}:"*"===t?s:function(e){return s(e)&&e.name===t}},tag_type:function(t){return"function"==typeof t?function(e){return t(e.type)}:function(e){return e.type===t}},tag_contains:function(t){return"function"==typeof t?function(e){return!s(e)&&t(e.data)}:function(e){return!s(e)&&e.data===t}}};e.getElements=function(t,e,n,o){var s=Object.keys(t).map(function(e){var n=t[e];return e in a?a[e](n):r(e,n)});return 0===s.length?[]:this.filter(s.reduce(i),e,n,o)},e.getElementById=function(t,e,n){return Array.isArray(e)||(e=[e]),this.findOne(r("id",t),e,!1!==n)},e.getElementsByTagName=function(t,e,n,r){return this.filter(a.tag_name(t),e,n,r)},e.getElementsByTagType=function(t,e,n,r){return this.filter(a.tag_type(t),e,n,r)}},function(t,e){e.removeSubsets=function(t){for(var e,n,r,i=t.length;--i>-1;){for(e=n=t[i],t[i]=null,r=!0;n;){if(t.indexOf(n)>-1){r=!1,t.splice(i,1);break}n=n.parent}r&&(t[i]=e)}return t};var n={DISCONNECTED:1,PRECEDING:2,FOLLOWING:4,CONTAINS:8,CONTAINED_BY:16},r=e.compareDocumentPosition=function(t,e){var r,i,o,s,a,l,c=[],u=[];if(t===e)return 0;for(r=t;r;)c.unshift(r),r=r.parent;for(r=e;r;)u.unshift(r),r=r.parent;for(l=0;c[l]===u[l];)l++;return 0===l?n.DISCONNECTED:(i=c[l-1],o=i.children,s=c[l],a=u[l],o.indexOf(s)>o.indexOf(a)?i===e?n.FOLLOWING|n.CONTAINED_BY:n.FOLLOWING:i===t?n.PRECEDING|n.CONTAINS:n.PRECEDING)};e.uniqueSort=function(t){var e,i,o=t.length;for(t=t.slice();--o>-1;)e=t[o],(i=t.indexOf(e))>-1&&i<o&&t.splice(o,1);return t.sort(function(t,e){var i=r(t,e);return i&n.PRECEDING?-1:i&n.FOLLOWING?1:0}),t}},function(t,e,n){function r(t){this._cbs=t||{},this.events=[]}t.exports=r;var i=n(3).EVENTS;Object.keys(i).forEach(function(t){if(0===i[t])t="on"+t,r.prototype[t]=function(){this.events.push([t]),this._cbs[t]&&this._cbs[t]()};else if(1===i[t])t="on"+t,r.prototype[t]=function(e){this.events.push([t,e]),this._cbs[t]&&this._cbs[t](e)};else{if(2!==i[t])throw Error("wrong number of arguments");t="on"+t,r.prototype[t]=function(e,n){this.events.push([t,e,n]),this._cbs[t]&&this._cbs[t](e,n)}}}),r.prototype.onreset=function(){this.events=[],this._cbs.onreset&&this._cbs.onreset()},r.prototype.restart=function(){this._cbs.onreset&&this._cbs.onreset();for(var t=0,e=this.events.length;t<e;t++)if(this._cbs[this.events[t][0]]){var n=this.events[t].length;1===n?this._cbs[this.events[t][0]]():2===n?this._cbs[this.events[t][0]](this.events[t][1]):this._cbs[this.events[t][0]](this.events[t][1],this.events[t][2])}}},function(t,e,n){var r=n(25),i=n(10),o=i.isTag,s=i.domEach,a=Object.prototype.hasOwnProperty,l=i.camelCase,c=i.cssCase,u=/\s+/,h={forEach:n(15),extend:n(40),some:n(93)},f={"null":null,"true":!0,"false":!1},d=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,p=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,g=function(t,e){if(t&&o(t))return t.attribs||(t.attribs={}),e?a.call(t.attribs,e)?d.test(e)?e:t.attribs[e]:"option"===t.name&&"value"===e?r.text(t.children):"input"!==t.name||"radio"!==t.attribs.type&&"checkbox"!==t.attribs.type||"value"!==e?void 0:"on":t.attribs},v=function(t,e,n){null===n?x(t,e):t.attribs[e]=n+""};e.attr=function(t,e){return"object"==typeof t||void 0!==e?"function"==typeof e?s(this,function(n,r){v(r,t,e.call(r,n,r.attribs[t]))}):s(this,function(n,r){o(r)&&("object"==typeof t?h.forEach(t,function(t,e){v(r,e,t)}):v(r,t,e))}):g(this[0],t)};var m=function(t,e){if(t&&o(t))return t.hasOwnProperty(e)?t[e]:d.test(e)?void 0!==g(t,e):g(t,e)},y=function(t,e,n){t[e]=d.test(e)?!!n:n};e.prop=function(t,e){var n,r=0;if("string"==typeof t&&void 0===e){switch(t){case"style":n=this.css(),h.forEach(n,function(t,e){n[r++]=e}),n.length=r;break;case"tagName":case"nodeName":n=this[0].name.toUpperCase();break;default:n=m(this[0],t)}return n}if("object"==typeof t||void 0!==e)return"function"==typeof e?s(this,function(n,r){y(r,t,e.call(r,n,m(r,t)))}):s(this,function(n,r){o(r)&&("object"==typeof t?h.forEach(t,function(t,e){y(r,e,t)}):y(r,t,e))})};var b=function(t,e,n){return t.data||(t.data={}),"object"==typeof e?h.extend(t.data,e):void("string"==typeof e&&void 0!==n?t.data[e]=n:"object"==typeof e&&h.extend(t.data,e))},w=function(t,e){var n,r,i,o,s,u,h,d=1===arguments.length;for(d?(n=Object.keys(t.attribs).filter(function(t){return"data-"===t.slice(0,"data-".length)}),i=n.map(function(t){return l(t.slice("data-".length))})):(n=["data-"+c(e)],i=[e]),u=0,h=n.length;u<h;++u)if(r=n[u],o=i[u],a.call(t.attribs,r)){if(s=t.attribs[r],a.call(f,s))s=f[s];else if(s===String(Number(s)))s=Number(s);else if(p.test(s))try{s=JSON.parse(s)}catch(t){}t.data[o]=s}return d?t.data:s};e.data=function(t,e){var n=this[0];if(n&&o(n))return n.data||(n.data={}),t?"object"==typeof t||void 0!==e?(s(this,function(n,r){b(r,t,e)}),this):a.call(n.data,t)?n.data[t]:w(n,t):w(n)},e.val=function(t){var e=0===arguments.length,n=this[0];if(n)switch(n.name){case"textarea":return this.text(t);case"input":switch(this.attr("type")){case"radio":return e?this.attr("value"):(this.attr("value",t),this);default:return this.attr("value",t)}return;case"select":var r,i=this.find("option:selected");if(void 0===i)return;if(!e){if(!this.attr().hasOwnProperty("multiple")&&"object"==typeof t)return this;"object"!=typeof t&&(t=[t]),this.find("option").removeAttr("selected");for(var o=0;o<t.length;o++)this.find('option[value="'+t[o]+'"]').attr("selected","");return this}return r=i.attr("value"),this.attr().hasOwnProperty("multiple")&&(r=[],s(i,function(t,e){r.push(g(e,"value"))})),r;case"option":return e?this.attr("value"):(this.attr("value",t),this)}};var x=function(t,e){t.attribs&&a.call(t.attribs,e)&&delete t.attribs[e]};e.removeAttr=function(t){return s(this,function(e,n){x(n,t)}),this},e.hasClass=function(t){return h.some(this,function(e){var n,r=e.attribs,i=r&&r["class"],o=-1;if(i)for(;(o=i.indexOf(t,o+1))>-1;)if(n=o+t.length,(0===o||u.test(i[o-1]))&&(n===i.length||u.test(i[n])))return!0})},e.addClass=function(t){if("function"==typeof t)return s(this,function(n,r){var i=r.attribs["class"]||"";e.addClass.call([r],t.call(r,n,i))});if(!t||"string"!=typeof t)return this;for(var n=t.split(u),r=this.length,i=0;i<r;i++)if(o(this[i])){var a,l,c=g(this[i],"class");if(c){l=" "+c+" ",a=n.length;for(var h=0;h<a;h++){var f=n[h]+" ";l.indexOf(" "+f)<0&&(l+=f)}v(this[i],"class",l.trim())}else v(this[i],"class",n.join(" ").trim())}return this};var _=function(t){return t?t.trim().split(u):[]};e.removeClass=function(t){var n,r,i;return"function"==typeof t?s(this,function(n,r){e.removeClass.call([r],t.call(r,n,r.attribs["class"]||""))}):(n=_(t),r=n.length,i=0===arguments.length,s(this,function(t,e){if(o(e))if(i)e.attribs["class"]="";else{for(var s,a,l=_(e.attribs["class"]),c=0;c<r;c++)(s=l.indexOf(n[c]))>=0&&(l.splice(s,1),a=!0,c--);a&&(e.attribs["class"]=l.join(" "))}}))},e.toggleClass=function(t,n){if("function"==typeof t)return s(this,function(r,i){e.toggleClass.call([i],t.call(i,r,i.attribs["class"]||"",n),n)});if(!t||"string"!=typeof t)return this;for(var r,i,a=t.split(u),l=a.length,c="boolean"==typeof n?n?1:-1:0,h=this.length,f=0;f<h;f++)if(o(this[f])){r=_(this[f].attribs["class"]);for(var d=0;d<l;d++)i=r.indexOf(a[d]),c>=0&&i<0?r.push(a[d]):c<=0&&i>=0&&r.splice(i,1);this[f].attribs["class"]=r.join(" ")}return this},e.is=function(t){return!!t&&this.filter(t).length>0}},function(t,e,n){var r=n(86),i=n(87);t.exports=function(t){return i(r(t))},t.exports.parse=r,t.exports.compile=i},function(t,e){function n(t){if("even"===(t=t.trim().toLowerCase()))return[2,0];if("odd"===t)return[2,1];var e=t.match(r);if(!e)throw new SyntaxError("n-th rule couldn't be parsed ('"+t+"')");var n;return e[1]?(n=parseInt(e[1],10),isNaN(n)&&(n="-"===e[1].charAt(0)?-1:1)):n=0,[n,e[3]?parseInt((e[2]||"")+e[3],10):0]}t.exports=n;var r=/^([+\-]?\d*n)?\s*(?:([+\-]?)\s*(\d+))?$/},function(t,e,n){function r(t){var e=t[0],n=t[1]-1;if(n<0&&e<=0)return s;if(-1===e)return function(t){return t<=n};if(0===e)return function(t){return t===n};if(1===e)return n<0?o:function(t){return t>=n};var r=n%e;return r<0&&(r+=e),e>1?function(t){return t>=n&&t%e===r}:(e*=-1,function(t){return t<=n&&t%e===r})}t.exports=r;var i=n(11),o=i.trueFunc,s=i.falseFunc},function(t,e,n){function r(t,e,n){return i(o(t,e,n))}function i(t){return function(e){return g(e)&&t(e)}}function o(t,e,n){return l(d(t,e),e,n)}function s(t){return"pseudo"===t.type&&("scope"===t.name||Array.isArray(t.data)&&t.data.some(function(t){return t.some(s)}))}function a(t,e){var n=!!e&&!!e.length&&e.every(function(t){return t===k||!!S(t)});t.forEach(function(t){if(t.length>0&&c(t[0])&&"descendant"!==t[0].type);else{if(!n||s(t))return;t.unshift(_)}t.unshift(C)})}function l(t,e,n){t=t.filter(function(t){return t.length>0}),t.forEach(m);var r=Array.isArray(n);return n=e&&e.context||n,n&&!r&&(n=[n]),a(t,n),t.map(function(t){return u(t,e,n,r)}).reduce(h,w)}function c(t){return x[t.type]<0}function u(t,e,n,r){var i=r&&"scope"===t[0].name&&"descendant"===t[1].type;return t.reduce(function(t,r,o){return t===w?t:v[r.type](t,r,e,n,i&&1===o)},e&&e.rootFunc||b)}function h(t,e){return e===w||t===b?t:t===w||e===b?e:function(n){return t(n)||e(n)}}function f(t){return t.some(c)}t.exports=r,t.exports.compileUnsafe=o,t.exports.compileToken=l;var d=n(89),p=n(4),g=p.isTag,v=n(90),m=n(91),y=n(11),b=y.trueFunc,w=y.falseFunc,x=n(44),_={type:"descendant"},C={type:"pseudo",name:"scope"},k={},S=p.getParent,T=n(26),E=T.filters,A=p.existsOne,g=p.isTag,O=p.getChildren;E.not=function(t,e,n,r){var i={xmlMode:!(!n||!n.xmlMode),strict:!(!n||!n.strict)};if(i.strict&&(e.length>1||e.some(f)))throw new SyntaxError("complex selectors in :not aren't allowed in strict mode");var o=l(e,i,r);return o===w?t:o===b?w:function(e){return!o(e)&&t(e)}},E.has=function(t,e,n){var r={xmlMode:!(!n||!n.xmlMode),strict:!(!n||!n.strict)},o=e.some(f)?[k]:null,s=l(e,r,o);return s===w?w:s===b?function(e){return O(e).some(g)&&t(e)}:(s=i(s),o?function(e){return t(e)&&(o[0]=e,A(s,O(e)))}:function(e){return t(e)&&A(s,O(e))})},E.matches=function(t,e,n,r){return l(e,{xmlMode:!(!n||!n.xmlMode),strict:!(!n||!n.strict),rootFunc:t},r)}},function(t,e,n){"use strict";function r(t,e,n){var r="0x"+e-65536;return r!==r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)}function i(t){return t.replace(u,r)}function o(t){return" "===t||"\n"===t||"\t"===t||"\f"===t||"\r"===t}function s(t,e){var n=[];if(""!==(t=a(n,t+"",e)))throw new SyntaxError("Unmatched selector: "+t);return n}function a(t,e,n){function r(){var t=e.match(c)[0];return e=e.substr(t.length),i(t)}function s(t){for(;o(e.charAt(t));)t++;e=e.substr(t)}var u,y,b,w,x=[],_=!1;for(s(0);""!==e;)if(y=e.charAt(0),o(y))_=!0,s(1);else if(y in d)x.push({type:d[y]}),_=!1,s(1);else if(","===y){if(0===x.length)throw new SyntaxError("empty sub-selector");t.push(x),x=[],_=!1,s(1)}else if(_&&(x.length>0&&x.push({type:"descendant"}),_=!1),"*"===y)e=e.substr(1),x.push({type:"universal"});else if(y in p)e=e.substr(1),x.push({type:"attribute",name:p[y][0],action:p[y][1],value:r(),ignoreCase:!1});else if("["===y){if(e=e.substr(1),!(u=e.match(h)))throw new SyntaxError("Malformed attribute selector: "+e);e=e.substr(u[0].length),b=i(u[1]),n&&("lowerCaseAttributeNames"in n?!n.lowerCaseAttributeNames:n.xmlMode)||(b=b.toLowerCase()),x.push({type:"attribute",name:b,action:f[u[2]],value:i(u[4]||u[5]||""),ignoreCase:!!u[6]})}else if(":"===y){if(":"===e.charAt(1)){e=e.substr(2),x.push({type:"pseudo-element",name:r().toLowerCase()});continue}if(e=e.substr(1),b=r().toLowerCase(),u=null,"("===e.charAt(0))if(b in g){w=e.charAt(1);var C=w in m;if(e=e.substr(C+1),u=[],e=a(u,e,n),C){if(e.charAt(0)!==w)throw new SyntaxError("unmatched quotes in :"+b);e=e.substr(1)}if(")"!==e.charAt(0))throw new SyntaxError("missing closing parenthesis in :"+b+" "+e);e=e.substr(1)}else{for(var k=1,S=1;S>0&&k<e.length;k++)"("===e.charAt(k)?S++:")"===e.charAt(k)&&S--;if(S)throw new SyntaxError("parenthesis not matched");u=e.substr(1,k-2),e=e.substr(k),b in v&&(w=u.charAt(0),w===u.slice(-1)&&w in m&&(u=u.slice(1,-1)),u=i(u))}x.push({type:"pseudo",name:b,data:u})}else{if(!c.test(e))return x.length&&"descendant"===x[x.length-1].type&&x.pop(),l(t,x),e;b=r(),n&&("lowerCaseTags"in n?!n.lowerCaseTags:n.xmlMode)||(b=b.toLowerCase()),x.push({type:"tag",name:b})}return l(t,x),e}function l(t,e){if(t.length>0&&0===e.length)throw new SyntaxError("empty sub-selector");t.push(e)}t.exports=s;var c=/^(?:\\.|[\w\-\u00c0-\uFFFF])+/,u=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,h=/^\s*((?:\\.|[\w\u00c0-\uFFFF\-])+)\s*(?:(\S?)=\s*(?:(['"])(.*?)\3|(#?(?:\\.|[\w\u00c0-\uFFFF\-])*)|)|)\s*(i)?\]/,f={__proto__:null,undefined:"exists","":"equals","~":"element","^":"start",$:"end","*":"any","!":"not","|":"hyphen"},d={__proto__:null,">":"child","<":"parent","~":"sibling","+":"adjacent"},p={__proto__:null,"#":["id","equals"],".":["class","element"]},g={__proto__:null,has:!0,not:!0,matches:!0},v={__proto__:null,contains:!0,icontains:!0},m={__proto__:null,'"':!0,"'":!0}},function(t,e,n){var r=n(4),i=r.isTag,o=r.getParent,s=r.getChildren,a=r.getSiblings,l=r.getName;t.exports={__proto__:null,attribute:n(43).compile,pseudo:n(26).compile,tag:function(t,e){var n=e.name;return function(e){return l(e)===n&&t(e)}},descendant:function(t,e,n,r,i){return function(e){if(i&&t(e))return!0;for(var n=!1;!n&&(e=o(e));)n=t(e);return n}},parent:function(t,e,n){function r(e){return i(e)&&t(e)}if(n&&n.strict)throw SyntaxError("Parent selector isn't part of CSS3");return function(t){return s(t).some(r)}},child:function(t){return function(e){var n=o(e);return!!n&&t(n)}},sibling:function(t){return function(e){for(var n=a(e),r=0;r<n.length;r++)if(i(n[r])){if(n[r]===e)break;if(t(n[r]))return!0}return!1}},adjacent:function(t){return function(e){for(var n,r=a(e),o=0;o<r.length;o++)if(i(r[o])){if(r[o]===e)break;n=r[o]}return!!n&&t(n)}},universal:function(t){return t}}},function(t,e,n){function r(t){for(var e=t.map(i),n=1;n<t.length;n++){var r=e[n];if(!(r<0))for(var o=n-1;o>=0&&r<e[o];o--){var s=t[o+1];t[o+1]=t[o],t[o]=s,e[o+1]=e[o],e[o]=r}}}function i(t){var e=o[t.type];if(e===o.attribute)e=s[t.action],e===s.equals&&"id"===t.name&&(e=9),t.ignoreCase&&(e>>=1);else if(e===o.pseudo)if(t.data)if("has"===t.name||"contains"===t.name)e=0;else if("matches"===t.name||"not"===t.name){e=0;for(var n=0;n<t.data.length;n++)if(1===t.data[n].length){var r=i(t.data[n][0]);if(0===r){e=0;break}r>e&&(e=r)}t.data.length>1&&e>0&&(e-=1)}else e=1;else e=3;return e}t.exports=r;var o=n(44),s={__proto__:null,exists:10,equals:8,not:7,start:6,end:6,any:5,hyphen:4,element:4}},function(t,e,n){(function(t,n){function r(t,e){return t.set(e[0],e[1]),t}function i(t,e){return t.add(e),t}function o(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function s(t,e){for(var n=-1,r=t?t.length:0;++n<r&&!1!==e(t[n],n,t););return t}function a(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function l(t,e,n,r){var i=-1,o=t?t.length:0;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function c(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function u(t,e){return null==t?void 0:t[e]}function h(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function f(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function d(t,e){return function(n){return t(e(n))}}function p(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function g(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function v(){this.__data__=Qe?Qe(null):{}}function m(t){return this.has(t)&&delete this.__data__[t]}function y(t){var e=this.__data__;if(Qe){var n=e[t];return n===zt?void 0:n}return je.call(e,t)?e[t]:void 0}function b(t){var e=this.__data__;return Qe?void 0!==e[t]:je.call(e,t)}function w(t,e){return this.__data__[t]=Qe&&void 0===e?zt:e,this}function x(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function _(){this.__data__=[]}function C(t){var e=this.__data__,n=V(e,t);return!(n<0||(n==e.length-1?e.pop():He.call(e,n,1),0))}function k(t){var e=this.__data__,n=V(e,t);return n<0?void 0:e[n][1]}function S(t){return V(this.__data__,t)>-1}function T(t,e){var n=this.__data__,r=V(n,t);return r<0?n.push([t,e]):n[r][1]=e,this}function E(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function A(){this.__data__={hash:new g,map:new(Ke||x),string:new g}}function O(t){return dt(this,t)["delete"](t)}function M(t){return dt(this,t).get(t)}function L(t){return dt(this,t).has(t)}function P(t,e){return dt(this,t).set(t,e),this}function j(t){this.__data__=new x(t)}function D(){this.__data__=new x}function N(t){return this.__data__["delete"](t)}function I(t){return this.__data__.get(t)}function R(t){return this.__data__.has(t)}function B(t,e){var n=this.__data__;if(n instanceof x){var r=n.__data__;if(!Ke||r.length<Ft-1)return r.push([t,e]),this;n=this.__data__=new E(r)}return n.set(t,e),this}function F(t,e){var n=un(t)||Tt(t)?c(t.length,String):[],r=n.length,i=!!r;for(var o in t)!e&&!je.call(t,o)||i&&("length"==o||yt(o,r))||n.push(o);return n}function z(t,e,n){(void 0===n||St(t[e],n))&&("number"!=typeof e||void 0!==n||e in t)||(t[e]=n)}function $(t,e,n){var r=t[e];je.call(t,e)&&St(r,n)&&(void 0!==n||e in t)||(t[e]=n)}function V(t,e){for(var n=t.length;n--;)if(St(t[n][0],e))return n;return-1}function H(t,e){return t&&ut(e,Nt(e),t)}function U(t,e,n,r,i,o,a){var l;if(r&&(l=o?r(t,i,o,a):r(t)),void 0!==l)return l;if(!Lt(t))return t;var c=un(t);if(c){if(l=gt(t),!e)return ct(t,l)}else{var u=cn(t),f=u==qt||u==Wt;if(hn(t))return et(t,e);if(u==Kt||u==Vt||f&&!o){if(h(t))return o?t:{};if(l=vt(f?{}:t),!e)return ht(t,H(l,t))}else{if(!me[u])return o?t:{};l=mt(t,u,U,e)}}a||(a=new j);var d=a.get(t);if(d)return d;if(a.set(t,l),!c)var p=n?ft(t):Nt(t);return s(p||t,function(i,o){p&&(o=i,i=t[o]),$(l,o,U(i,e,n,r,o,t,a))}),l}function q(t){return Lt(t)?$e(t):{}}function W(t,e,n){var r=e(t);return un(t)?r:a(r,n(t))}function G(t){return Ne.call(t)}function Y(t){return!(!Lt(t)||xt(t))&&(Ot(t)||h(t)?Ie:pe).test(kt(t))}function K(t){return Pt(t)&&Mt(t.length)&&!!ve[Ne.call(t)]}function X(t){if(!_t(t))return We(t);var e=[];for(var n in Object(t))je.call(t,n)&&"constructor"!=n&&e.push(n);return e}function J(t){if(!Lt(t))return Ct(t);var e=_t(t),n=[];for(var r in t)("constructor"!=r||!e&&je.call(t,r))&&n.push(r);return n}function Z(t,e,n,r,i){if(t!==e){if(!un(e)&&!fn(e))var o=J(e);s(o||e,function(s,a){if(o&&(a=s,s=e[a]),Lt(s))i||(i=new j),Q(t,e,a,n,Z,r,i);else{var l=r?r(t[a],s,a+"",t,e,i):void 0;void 0===l&&(l=s),z(t,a,l)}})}}function Q(t,e,n,r,i,o,s){var a=t[n],l=e[n],c=s.get(l);if(c)return void z(t,n,c);var u=o?o(a,l,n+"",t,e,s):void 0,h=void 0===u;h&&(u=l,un(l)||fn(l)?un(a)?u=a:At(a)?u=ct(a):(h=!1,u=U(l,!0)):jt(l)||Tt(l)?Tt(a)?u=Dt(a):!Lt(a)||r&&Ot(a)?(h=!1,u=U(l,!0)):u=a:h=!1),h&&(s.set(l,u),i(u,l,r,o,s),s["delete"](l)),z(t,n,u)}function tt(t,e){return e=Ge(void 0===e?t.length-1:e,0),function(){for(var n=arguments,r=-1,i=Ge(n.length-e,0),s=Array(i);++r<i;)s[r]=n[e+r];r=-1;for(var a=Array(e+1);++r<e;)a[r]=n[r];return a[e]=s,o(t,this,a)}}function et(t,e){if(e)return t.slice();var n=new t.constructor(t.length);return t.copy(n),n}function nt(t){var e=new t.constructor(t.byteLength);return new Fe(e).set(new Fe(t)),e}function rt(t,e){var n=e?nt(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}function it(t,e,n){return l(e?n(f(t),!0):f(t),r,new t.constructor)}function ot(t){var e=new t.constructor(t.source,de.exec(t));return e.lastIndex=t.lastIndex,e}function st(t,e,n){return l(e?n(p(t),!0):p(t),i,new t.constructor)}function at(t){return an?Object(an.call(t)):{}}function lt(t,e){var n=e?nt(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function ct(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function ut(t,e,n,r){n||(n={});for(var i=-1,o=e.length;++i<o;){var s=e[i],a=r?r(n[s],t[s],s,n,t):void 0;$(n,s,void 0===a?t[s]:a)}return n}function ht(t,e){return ut(t,ln(t),e)}function ft(t){return W(t,Nt,ln)}function dt(t,e){var n=t.__data__;return wt(e)?n["string"==typeof e?"string":"hash"]:n.map}function pt(t,e){var n=u(t,e);return Y(n)?n:void 0}function gt(t){var e=t.length,n=t.constructor(e);return e&&"string"==typeof t[0]&&je.call(t,"index")&&(n.index=t.index,n.input=t.input),n}function vt(t){return"function"!=typeof t.constructor||_t(t)?{}:q(ze(t))}function mt(t,e,n,r){var i=t.constructor;switch(e){case ee:return nt(t);case Ht:case Ut:return new i((+t));case ne:return rt(t,r);case re:case ie:case oe:case se:case ae:case le:case ce:case ue:case he:return lt(t,r);case Gt:return it(t,r,n);case Yt:case Zt:return new i(t);case Xt:return ot(t);case Jt:return st(t,r,n);case Qt:return at(t)}}function yt(t,e){return!!(e=null==e?$t:e)&&("number"==typeof t||ge.test(t))&&t>-1&&t%1==0&&t<e}function bt(t,e,n){if(!Lt(n))return!1;var r=typeof e;return!!("number"==r?Et(n)&&yt(e,n.length):"string"==r&&e in n)&&St(n[e],t)}function wt(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function xt(t){return!!Le&&Le in t}function _t(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Oe)}function Ct(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}function kt(t){if(null!=t){try{return Pe.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function St(t,e){return t===e||t!==t&&e!==e}function Tt(t){return At(t)&&je.call(t,"callee")&&(!Ve.call(t,"callee")||Ne.call(t)==Vt)}function Et(t){return null!=t&&Mt(t.length)&&!Ot(t)}function At(t){return Pt(t)&&Et(t)}function Ot(t){var e=Lt(t)?Ne.call(t):"";return e==qt||e==Wt}function Mt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=$t}function Lt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Pt(t){return!!t&&"object"==typeof t}function jt(t){if(!Pt(t)||Ne.call(t)!=Kt||h(t))return!1;var e=ze(t);if(null===e)return!0;var n=je.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Pe.call(n)==De}function Dt(t){return ut(t,It(t))}function Nt(t){return Et(t)?F(t):X(t)}function It(t){return Et(t)?F(t,!0):J(t)}function Rt(){return[]}function Bt(){return!1}var Ft=200,zt="__lodash_hash_undefined__",$t=9007199254740991,Vt="[object Arguments]",Ht="[object Boolean]",Ut="[object Date]",qt="[object Function]",Wt="[object GeneratorFunction]",Gt="[object Map]",Yt="[object Number]",Kt="[object Object]",Xt="[object RegExp]",Jt="[object Set]",Zt="[object String]",Qt="[object Symbol]",te="[object WeakMap]",ee="[object ArrayBuffer]",ne="[object DataView]",re="[object Float32Array]",ie="[object Float64Array]",oe="[object Int8Array]",se="[object Int16Array]",ae="[object Int32Array]",le="[object Uint8Array]",ce="[object Uint8ClampedArray]",ue="[object Uint16Array]",he="[object Uint32Array]",fe=/[\\^$.*+?()[\]{}|]/g,de=/\w*$/,pe=/^\[object .+?Constructor\]$/,ge=/^(?:0|[1-9]\d*)$/,ve={};ve[re]=ve[ie]=ve[oe]=ve[se]=ve[ae]=ve[le]=ve[ce]=ve[ue]=ve[he]=!0,ve[Vt]=ve["[object Array]"]=ve[ee]=ve[Ht]=ve[ne]=ve[Ut]=ve["[object Error]"]=ve[qt]=ve[Gt]=ve[Yt]=ve[Kt]=ve[Xt]=ve[Jt]=ve[Zt]=ve[te]=!1;var me={};me[Vt]=me["[object Array]"]=me[ee]=me[ne]=me[Ht]=me[Ut]=me[re]=me[ie]=me[oe]=me[se]=me[ae]=me[Gt]=me[Yt]=me[Kt]=me[Xt]=me[Jt]=me[Zt]=me[Qt]=me[le]=me[ce]=me[ue]=me[he]=!0,me["[object Error]"]=me[qt]=me[te]=!1;var ye="object"==typeof t&&t&&t.Object===Object&&t,be="object"==typeof self&&self&&self.Object===Object&&self,we=ye||be||Function("return this")(),xe="object"==typeof e&&e&&!e.nodeType&&e,_e=xe&&"object"==typeof n&&n&&!n.nodeType&&n,Ce=_e&&_e.exports===xe,ke=Ce&&ye.process,Se=function(){try{return ke&&ke.binding("util")}catch(t){}}(),Te=Se&&Se.isTypedArray,Ee=Array.prototype,Ae=Function.prototype,Oe=Object.prototype,Me=we["__core-js_shared__"],Le=function(){var t=/[^.]+$/.exec(Me&&Me.keys&&Me.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Pe=Ae.toString,je=Oe.hasOwnProperty,De=Pe.call(Object),Ne=Oe.toString,Ie=RegExp("^"+Pe.call(je).replace(fe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Re=Ce?we.Buffer:void 0,Be=we.Symbol,Fe=we.Uint8Array,ze=d(Object.getPrototypeOf,Object),$e=Object.create,Ve=Oe.propertyIsEnumerable,He=Ee.splice,Ue=Object.getOwnPropertySymbols,qe=Re?Re.isBuffer:void 0,We=d(Object.keys,Object),Ge=Math.max,Ye=pt(we,"DataView"),Ke=pt(we,"Map"),Xe=pt(we,"Promise"),Je=pt(we,"Set"),Ze=pt(we,"WeakMap"),Qe=pt(Object,"create"),tn=kt(Ye),en=kt(Ke),nn=kt(Xe),rn=kt(Je),on=kt(Ze),sn=Be?Be.prototype:void 0,an=sn?sn.valueOf:void 0;g.prototype.clear=v,g.prototype["delete"]=m,g.prototype.get=y,g.prototype.has=b,g.prototype.set=w,x.prototype.clear=_,x.prototype["delete"]=C,x.prototype.get=k,x.prototype.has=S,x.prototype.set=T,E.prototype.clear=A,E.prototype["delete"]=O,E.prototype.get=M,E.prototype.has=L,E.prototype.set=P,j.prototype.clear=D,j.prototype["delete"]=N,j.prototype.get=I,j.prototype.has=R,j.prototype.set=B;var ln=Ue?d(Ue,Object):Rt,cn=G;(Ye&&cn(new Ye(new ArrayBuffer(1)))!=ne||Ke&&cn(new Ke)!=Gt||Xe&&"[object Promise]"!=cn(Xe.resolve())||Je&&cn(new Je)!=Jt||Ze&&cn(new Ze)!=te)&&(cn=function(t){var e=Ne.call(t),n=e==Kt?t.constructor:void 0,r=n?kt(n):void 0;if(r)switch(r){case tn:return ne;case en:return Gt;case nn:return"[object Promise]";case rn:return Jt;case on:return te}return e});var un=Array.isArray,hn=qe||Bt,fn=Te?function(t){return function(e){return t(e)}}(Te):K,dn=function(t){return tt(function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,s&&bt(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var a=n[r];a&&t(e,a,r,o)}return e})}(function(t,e,n){Z(t,e,n)});n.exports=dn}).call(e,n(0),n(5)(t))},function(t,e,n){(function(t,n){function r(t,e){for(var n=-1,r=t?t.length:0;++n<r;)if(e(t[n],n,t))return!0;return!1}function i(t){return function(e){return null==e?void 0:e[t]}}function o(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function s(t,e){return null==t?void 0:t[e]}function a(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function l(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function c(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function u(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function h(){this.__data__=Ve?Ve(null):{}}function f(t){return this.has(t)&&delete this.__data__[t]}function d(t){var e=this.__data__;if(Ve){var n=e[t];return n===Bt?void 0:n}return Oe.call(e,t)?e[t]:void 0}function p(t){var e=this.__data__;return Ve?void 0!==e[t]:Oe.call(e,t)}function g(t,e){return this.__data__[t]=Ve&&void 0===e?Bt:e,this}function v(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function m(){this.__data__=[]}function y(t){var e=this.__data__,n=B(e,t);return!(n<0||(n==e.length-1?e.pop():Ne.call(e,n,1),0))}function b(t){var e=this.__data__,n=B(e,t);return n<0?void 0:e[n][1]}function w(t){return B(this.__data__,t)>-1}function x(t,e){var n=this.__data__,r=B(n,t);return r<0?n.push([t,e]):n[r][1]=e,this}function _(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function C(){this.__data__={hash:new u,map:new(Be||v),string:new u}}function k(t){return ot(this,t)["delete"](t)}function S(t){return ot(this,t).get(t)}function T(t){return ot(this,t).has(t)}function E(t,e){return ot(this,t).set(t,e),this}function A(t){var e=-1,n=t?t.length:0;for(this.__data__=new _;++e<n;)this.add(t[e])}function O(t){return this.__data__.set(t,Bt),this}function M(t){return this.__data__.has(t)}function L(t){this.__data__=new v(t)}function P(){this.__data__=new v}function j(t){return this.__data__["delete"](t)}function D(t){return this.__data__.get(t)}function N(t){return this.__data__.has(t)}function I(t,e){var n=this.__data__;if(n instanceof v){var r=n.__data__;if(!Be||r.length<It-1)return r.push([t,e]),this;n=this.__data__=new _(r)}return n.set(t,e),this}function R(t,e){var n=en(t)||_t(t)?o(t.length,String):[],r=n.length,i=!!r;for(var s in t)!e&&!Oe.call(t,s)||i&&("length"==s||ct(s,r))||n.push(s);return n}function B(t,e){for(var n=t.length;n--;)if(xt(t[n][0],e))return n;return-1}function F(t,e){return t&&Ze(t,e,jt)}function z(t,e){e=ht(e,t)?[e]:et(e);for(var n=0,r=e.length;null!=t&&n<r;)t=t[mt(e[n++])];return n&&n==r?t:void 0}function $(t){return Me.call(t)}function V(t,e){return null!=t&&e in Object(t)}function H(t,e,n,r,i){return t===e||(null==t||null==e||!Et(t)&&!At(e)?t!==t&&e!==e:U(t,e,H,n,r,i))}function U(t,e,n,r,i,o){var s=en(t),l=en(e),c=Ut,u=Ut;s||(c=Qe(t),c=c==Ht?Zt:c),l||(u=Qe(e),u=u==Ht?Zt:u);var h=c==Zt&&!a(t),f=u==Zt&&!a(e),d=c==u;if(d&&!h)return o||(o=new L),s||nn(t)?nt(t,e,n,r,i,o):rt(t,e,c,n,r,i,o);if(!(i&zt)){var p=h&&Oe.call(t,"__wrapped__"),g=f&&Oe.call(e,"__wrapped__");if(p||g){var v=p?t.value():t,m=g?e.value():e;return o||(o=new L),n(v,m,r,i,o)}}return!!d&&(o||(o=new L),it(t,e,n,r,i,o))}function q(t,e,n,r){var i=n.length,o=i,s=!r;if(null==t)return!o;for(t=Object(t);i--;){var a=n[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=n[i];var l=a[0],c=t[l],u=a[1];if(s&&a[2]){if(void 0===c&&!(l in t))return!1}else{var h=new L;if(r)var f=r(c,u,l,t,e,h);if(!(void 0===f?H(u,c,r,Ft|zt,h):f))return!1}}return!0}function W(t){return!(!Et(t)||dt(t))&&(St(t)||a(t)?Le:he).test(yt(t))}function G(t){return At(t)&&Tt(t.length)&&!!de[Me.call(t)]}function Y(t){return"function"==typeof t?t:null==t?Dt:"object"==typeof t?en(t)?J(t[0],t[1]):X(t):Nt(t)}function K(t){if(!pt(t))return Ie(t);var e=[];for(var n in Object(t))Oe.call(t,n)&&"constructor"!=n&&e.push(n);return e}function X(t){var e=st(t);return 1==e.length&&e[0][2]?vt(e[0][0],e[0][1]):function(n){return n===t||q(n,t,e)}}function J(t,e){return ht(t)&&gt(e)?vt(mt(t),e):function(n){var r=Lt(n,t);return void 0===r&&r===e?Pt(n,t):H(e,r,void 0,Ft|zt)}}function Z(t){return function(e){return z(e,t)}}function Q(t,e){var n;return Je(t,function(t,r,i){return!(n=e(t,r,i))}),!!n}function tt(t){if("string"==typeof t)return t;if(Ot(t))return Xe?Xe.call(t):"";var e=t+"";return"0"==e&&1/t==-$t?"-0":e}function et(t){return en(t)?t:tn(t)}function nt(t,e,n,i,o,s){var a=o&zt,l=t.length,c=e.length;if(l!=c&&!(a&&c>l))return!1;var u=s.get(t);if(u&&s.get(e))return u==e;var h=-1,f=!0,d=o&Ft?new A:void 0;for(s.set(t,e),s.set(e,t);++h<l;){
var p=t[h],g=e[h];if(i)var v=a?i(g,p,h,e,t,s):i(p,g,h,t,e,s);if(void 0!==v){if(v)continue;f=!1;break}if(d){if(!r(e,function(t,e){if(!d.has(e)&&(p===t||n(p,t,i,o,s)))return d.add(e)})){f=!1;break}}else if(p!==g&&!n(p,g,i,o,s)){f=!1;break}}return s["delete"](t),s["delete"](e),f}function rt(t,e,n,r,i,o,s){switch(n){case ie:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case re:return!(t.byteLength!=e.byteLength||!r(new je(t),new je(e)));case qt:case Wt:case Jt:return xt(+t,+e);case Gt:return t.name==e.name&&t.message==e.message;case Qt:case ee:return t==e+"";case Xt:var a=l;case te:var u=o&zt;if(a||(a=c),t.size!=e.size&&!u)return!1;var h=s.get(t);if(h)return h==e;o|=Ft,s.set(t,e);var f=nt(a(t),a(e),r,i,o,s);return s["delete"](t),f;case ne:if(Ke)return Ke.call(t)==Ke.call(e)}return!1}function it(t,e,n,r,i,o){var s=i&zt,a=jt(t),l=a.length;if(l!=jt(e).length&&!s)return!1;for(var c=l;c--;){var u=a[c];if(!(s?u in e:Oe.call(e,u)))return!1}var h=o.get(t);if(h&&o.get(e))return h==e;var f=!0;o.set(t,e),o.set(e,t);for(var d=s;++c<l;){u=a[c];var p=t[u],g=e[u];if(r)var v=s?r(g,p,u,e,t,o):r(p,g,u,t,e,o);if(!(void 0===v?p===g||n(p,g,r,i,o):v)){f=!1;break}d||(d="constructor"==u)}if(f&&!d){var m=t.constructor,y=e.constructor;m!=y&&"constructor"in t&&"constructor"in e&&!("function"==typeof m&&m instanceof m&&"function"==typeof y&&y instanceof y)&&(f=!1)}return o["delete"](t),o["delete"](e),f}function ot(t,e){var n=t.__data__;return ft(e)?n["string"==typeof e?"string":"hash"]:n.map}function st(t){for(var e=jt(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,gt(i)]}return e}function at(t,e){var n=s(t,e);return W(n)?n:void 0}function lt(t,e,n){e=ht(e,t)?[e]:et(e);for(var r,i=-1,o=e.length;++i<o;){var s=mt(e[i]);if(!(r=null!=t&&n(t,s)))break;t=t[s]}if(r)return r;var o=t?t.length:0;return!!o&&Tt(o)&&ct(s,o)&&(en(t)||_t(t))}function ct(t,e){return!!(e=null==e?Vt:e)&&("number"==typeof t||fe.test(t))&&t>-1&&t%1==0&&t<e}function ut(t,e,n){if(!Et(n))return!1;var r=typeof e;return!!("number"==r?Ct(n)&&ct(e,n.length):"string"==r&&e in n)&&xt(n[e],t)}function ht(t,e){if(en(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Ot(t))||se.test(t)||!oe.test(t)||null!=e&&t in Object(e)}function ft(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function dt(t){return!!Ee&&Ee in t}function pt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Se)}function gt(t){return t===t&&!Et(t)}function vt(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}}function mt(t){if("string"==typeof t||Ot(t))return t;var e=t+"";return"0"==e&&1/t==-$t?"-0":e}function yt(t){if(null!=t){try{return Ae.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function bt(t,e,n){var i=en(t)?r:Q;return n&&ut(t,e,n)&&(e=void 0),i(t,Y(e,3))}function wt(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError(Rt);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s),s};return n.cache=new(wt.Cache||_),n}function xt(t,e){return t===e||t!==t&&e!==e}function _t(t){return kt(t)&&Oe.call(t,"callee")&&(!De.call(t,"callee")||Me.call(t)==Ht)}function Ct(t){return null!=t&&Tt(t.length)&&!St(t)}function kt(t){return At(t)&&Ct(t)}function St(t){var e=Et(t)?Me.call(t):"";return e==Yt||e==Kt}function Tt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Vt}function Et(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function At(t){return!!t&&"object"==typeof t}function Ot(t){return"symbol"==typeof t||At(t)&&Me.call(t)==ne}function Mt(t){return null==t?"":tt(t)}function Lt(t,e,n){var r=null==t?void 0:z(t,e);return void 0===r?n:r}function Pt(t,e){return null!=t&&lt(t,e,V)}function jt(t){return Ct(t)?R(t):K(t)}function Dt(t){return t}function Nt(t){return ht(t)?i(mt(t)):Z(t)}var It=200,Rt="Expected a function",Bt="__lodash_hash_undefined__",Ft=1,zt=2,$t=1/0,Vt=9007199254740991,Ht="[object Arguments]",Ut="[object Array]",qt="[object Boolean]",Wt="[object Date]",Gt="[object Error]",Yt="[object Function]",Kt="[object GeneratorFunction]",Xt="[object Map]",Jt="[object Number]",Zt="[object Object]",Qt="[object RegExp]",te="[object Set]",ee="[object String]",ne="[object Symbol]",re="[object ArrayBuffer]",ie="[object DataView]",oe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,se=/^\w*$/,ae=/^\./,le=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ce=/[\\^$.*+?()[\]{}|]/g,ue=/\\(\\)?/g,he=/^\[object .+?Constructor\]$/,fe=/^(?:0|[1-9]\d*)$/,de={};de["[object Float32Array]"]=de["[object Float64Array]"]=de["[object Int8Array]"]=de["[object Int16Array]"]=de["[object Int32Array]"]=de["[object Uint8Array]"]=de["[object Uint8ClampedArray]"]=de["[object Uint16Array]"]=de["[object Uint32Array]"]=!0,de[Ht]=de[Ut]=de[re]=de[qt]=de[ie]=de[Wt]=de[Gt]=de[Yt]=de[Xt]=de[Jt]=de[Zt]=de[Qt]=de[te]=de[ee]=de["[object WeakMap]"]=!1;var pe="object"==typeof t&&t&&t.Object===Object&&t,ge="object"==typeof self&&self&&self.Object===Object&&self,ve=pe||ge||Function("return this")(),me="object"==typeof e&&e&&!e.nodeType&&e,ye=me&&"object"==typeof n&&n&&!n.nodeType&&n,be=ye&&ye.exports===me,we=be&&pe.process,xe=function(){try{return we&&we.binding("util")}catch(t){}}(),_e=xe&&xe.isTypedArray,Ce=Array.prototype,ke=Function.prototype,Se=Object.prototype,Te=ve["__core-js_shared__"],Ee=function(){var t=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Ae=ke.toString,Oe=Se.hasOwnProperty,Me=Se.toString,Le=RegExp("^"+Ae.call(Oe).replace(ce,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pe=ve.Symbol,je=ve.Uint8Array,De=Se.propertyIsEnumerable,Ne=Ce.splice,Ie=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object),Re=at(ve,"DataView"),Be=at(ve,"Map"),Fe=at(ve,"Promise"),ze=at(ve,"Set"),$e=at(ve,"WeakMap"),Ve=at(Object,"create"),He=yt(Re),Ue=yt(Be),qe=yt(Fe),We=yt(ze),Ge=yt($e),Ye=Pe?Pe.prototype:void 0,Ke=Ye?Ye.valueOf:void 0,Xe=Ye?Ye.toString:void 0;u.prototype.clear=h,u.prototype["delete"]=f,u.prototype.get=d,u.prototype.has=p,u.prototype.set=g,v.prototype.clear=m,v.prototype["delete"]=y,v.prototype.get=b,v.prototype.has=w,v.prototype.set=x,_.prototype.clear=C,_.prototype["delete"]=k,_.prototype.get=S,_.prototype.has=T,_.prototype.set=E,A.prototype.add=A.prototype.push=O,A.prototype.has=M,L.prototype.clear=P,L.prototype["delete"]=j,L.prototype.get=D,L.prototype.has=N,L.prototype.set=I;var Je=function(t,e){return function(n,r){if(null==n)return n;if(!Ct(n))return t(n,r);for(var i=n.length,o=e?i:-1,s=Object(n);(e?o--:++o<i)&&!1!==r(s[o],o,s););return n}}(F),Ze=function(t){return function(e,n,r){for(var i=-1,o=Object(e),s=r(e),a=s.length;a--;){var l=s[t?a:++i];if(!1===n(o[l],l,o))break}return e}}(),Qe=$;(Re&&Qe(new Re(new ArrayBuffer(1)))!=ie||Be&&Qe(new Be)!=Xt||Fe&&"[object Promise]"!=Qe(Fe.resolve())||ze&&Qe(new ze)!=te||$e&&"[object WeakMap]"!=Qe(new $e))&&(Qe=function(t){var e=Me.call(t),n=e==Zt?t.constructor:void 0,r=n?yt(n):void 0;if(r)switch(r){case He:return ie;case Ue:return Xt;case qe:return"[object Promise]";case We:return te;case Ge:return"[object WeakMap]"}return e});var tn=wt(function(t){t=Mt(t);var e=[];return ae.test(t)&&e.push(""),t.replace(le,function(t,n,r,i){e.push(r?i.replace(ue,"$1"):n||t)}),e});wt.Cache=_;var en=Array.isArray,nn=_e?function(t){return function(e){return t(e)}}(_e):G;n.exports=bt}).call(e,n(0),n(5)(t))},function(t,e,n){function r(t,n,r,i){for(var o=[];n&&o.length<i;)r&&!e.filter.call([n],r,t).length||o.push(n),n=n.parent;return o}var i=n(42),o=n(10),s=o.domEach,a=n(3).DomUtils.uniqueSort,l=o.isTag,c={bind:n(24),forEach:n(15),reject:n(95),filter:n(96),reduce:n(97)};e.find=function(t){var e,n=c.reduce(this,function(t,e){return t.concat(c.filter(e.children,l))},[]),r=this.constructor.contains;if(t&&"string"!=typeof t)return e=t.cheerio?t.get():[t],this._make(e.filter(function(t){var e,n;for(e=0,n=this.length;e<n;++e)if(r(this[e],t))return!0},this));var o={__proto__:this.options,context:this.toArray()};return this._make(i(t,n,o))},e.parent=function(t){var n=[];return s(this,function(t,e){var r=e.parent;r&&n.indexOf(r)<0&&n.push(r)}),arguments.length&&(n=e.filter.call(n,t,this)),this._make(n)},e.parents=function(t){var e=[];return this.get().reverse().forEach(function(n){r(this,n.parent,t,1/0).forEach(function(t){-1===e.indexOf(t)&&e.push(t)})},this),this._make(e)},e.parentsUntil=function(t,e){var n,r,o=[];return"string"==typeof t?n=i(t,this.parents().toArray(),this.options)[0]:t&&t.cheerio?r=t.toArray():t&&(n=t),this.toArray().reverse().forEach(function(t){for(;(t=t.parent)&&(n&&t!==n||r&&-1===r.indexOf(t)||!n&&!r);)l(t)&&-1===o.indexOf(t)&&o.push(t)},this),this._make(e?i(e,o,this.options):o)},e.closest=function(t){var e=[];return t?(s(this,function(n,i){var o=r(this,i,t,1)[0];o&&e.indexOf(o)<0&&e.push(o)}.bind(this)),this._make(e)):this._make(e)},e.next=function(t){if(!this[0])return this;var n=[];return c.forEach(this,function(t){for(;t=t.next;)if(l(t))return void n.push(t)}),t?e.filter.call(n,t,this):this._make(n)},e.nextAll=function(t){if(!this[0])return this;var n=[];return c.forEach(this,function(t){for(;t=t.next;)l(t)&&-1===n.indexOf(t)&&n.push(t)}),t?e.filter.call(n,t,this):this._make(n)},e.nextUntil=function(t,n){if(!this[0])return this;var r,o,s=[];return"string"==typeof t?r=i(t,this.nextAll().get(),this.options)[0]:t&&t.cheerio?o=t.get():t&&(r=t),c.forEach(this,function(t){for(;(t=t.next)&&(r&&t!==r||o&&-1===o.indexOf(t)||!r&&!o);)l(t)&&-1===s.indexOf(t)&&s.push(t)}),n?e.filter.call(s,n,this):this._make(s)},e.prev=function(t){if(!this[0])return this;var n=[];return c.forEach(this,function(t){for(;t=t.prev;)if(l(t))return void n.push(t)}),t?e.filter.call(n,t,this):this._make(n)},e.prevAll=function(t){if(!this[0])return this;var n=[];return c.forEach(this,function(t){for(;t=t.prev;)l(t)&&-1===n.indexOf(t)&&n.push(t)}),t?e.filter.call(n,t,this):this._make(n)},e.prevUntil=function(t,n){if(!this[0])return this;var r,o,s=[];return"string"==typeof t?r=i(t,this.prevAll().get(),this.options)[0]:t&&t.cheerio?o=t.get():t&&(r=t),c.forEach(this,function(t){for(;(t=t.prev)&&(r&&t!==r||o&&-1===o.indexOf(t)||!r&&!o);)l(t)&&-1===s.indexOf(t)&&s.push(t)}),n?e.filter.call(s,n,this):this._make(s)},e.siblings=function(t){var n=this.parent(),r=c.filter(n?n.children():this.siblingsAndMe(),c.bind(function(t){return l(t)&&!this.is(t)},this));return void 0!==t?e.filter.call(r,t,this):this._make(r)},e.children=function(t){var n=c.reduce(this,function(t,e){return t.concat(c.filter(e.children,l))},[]);return void 0===t?this._make(n):e.filter.call(n,t,this)},e.contents=function(){return this._make(c.reduce(this,function(t,e){return t.push.apply(t,e.children),t},[]))},e.each=function(t){for(var e=0,n=this.length;e<n&&!1!==t.call(this[e],e,this[e]);)++e;return this},e.map=function(t){return this._make(c.reduce(this,function(e,n,r){var i=t.call(n,r,n);return null==i?e:e.concat(i)},[]))};var u=function(t){return function(e,n){var r;return n=n||this,r="string"==typeof e?i.compile(e,n.options):"function"==typeof e?function(t,n){return e.call(t,n,t)}:e.cheerio?e.is.bind(e):function(t){return e===t},n._make(t(this,r))}};e.filter=u(c.filter),e.not=u(c.reject),e.has=function(t){var n=this;return e.filter.call(this,function(){return n._make(this).find(t).length>0})},e.first=function(){return this.length>1?this._make(this[0]):this},e.last=function(){return this.length>1?this._make(this[this.length-1]):this},e.eq=function(t){return 0===(t=+t)&&this.length<=1?this:(t<0&&(t=this.length+t),this[t]?this._make(this[t]):this._make([]))},e.get=function(t){return null==t?Array.prototype.slice.call(this):this[t<0?this.length+t:t]},e.index=function(t){var e,n;return 0===arguments.length?(e=this.parent().children(),n=this[0]):"string"==typeof t?(e=this._make(t),n=this[0]):(e=this,n=t.cheerio?t[0]:t),e.get().indexOf(n)},e.slice=function(){return this._make([].slice.apply(this,arguments))},e.end=function(){return this.prevObject||this._make([])},e.add=function(t,e){for(var n=this._make(t,e),r=a(n.get().concat(this.get())),i=0;i<r.length;++i)n[i]=r[i];return n.length=r.length,n},e.addBack=function(t){return this.add(arguments.length?this.prevObject.filter(t):this.prevObject)}},function(t,e,n){(function(t,n){function r(t,e){for(var n=-1,r=t?t.length:0,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}function i(t,e){for(var n=-1,r=t?t.length:0;++n<r;)if(e(t[n],n,t))return!0;return!1}function o(t){return function(e){return null==e?void 0:e[t]}}function s(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function a(t,e){return null==t?void 0:t[e]}function l(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function c(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function u(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function h(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function f(){this.__data__=He?He(null):{}}function d(t){return this.has(t)&&delete this.__data__[t]}function p(t){var e=this.__data__;if(He){var n=e[t];return n===Ft?void 0:n}return Me.call(e,t)?e[t]:void 0}function g(t){var e=this.__data__;return He?void 0!==e[t]:Me.call(e,t)}function v(t,e){return this.__data__[t]=He&&void 0===e?Ft:e,this}function m(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function y(){this.__data__=[]}function b(t){var e=this.__data__,n=F(e,t);return!(n<0||(n==e.length-1?e.pop():Ie.call(e,n,1),0))}function w(t){var e=this.__data__,n=F(e,t);return n<0?void 0:e[n][1]}function x(t){return F(this.__data__,t)>-1}function _(t,e){var n=this.__data__,r=F(n,t);return r<0?n.push([t,e]):n[r][1]=e,this}function C(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function k(){this.__data__={hash:new h,map:new(Fe||m),string:new h}}function S(t){return st(this,t)["delete"](t)}function T(t){return st(this,t).get(t)}function E(t){return st(this,t).has(t)}function A(t,e){return st(this,t).set(t,e),this}function O(t){var e=-1,n=t?t.length:0;for(this.__data__=new C;++e<n;)this.add(t[e])}function M(t){return this.__data__.set(t,Ft),this}function L(t){return this.__data__.has(t)}function P(t){this.__data__=new m(t)}function j(){this.__data__=new m}function D(t){return this.__data__["delete"](t)}function N(t){return this.__data__.get(t)}function I(t){return this.__data__.has(t)}function R(t,e){var n=this.__data__;if(n instanceof m){var r=n.__data__;if(!Fe||r.length<Rt-1)return r.push([t,e]),this;n=this.__data__=new C(r)}return n.set(t,e),this}function B(t,e){var n=nn(t)||Ct(t)?s(t.length,String):[],r=n.length,i=!!r;for(var o in t)!e&&!Me.call(t,o)||i&&("length"==o||ut(o,r))||n.push(o);return n}function F(t,e){for(var n=t.length;n--;)if(_t(t[n][0],e))return n;return-1}function z(t,e){var n=[];return Ze(t,function(t,r,i){e(t,r,i)&&n.push(t)}),n}function $(t,e){return t&&Qe(t,e,Dt)}function V(t,e){e=ht(e,t)?[e]:nt(e);for(var n=0,r=e.length;null!=t&&n<r;)t=t[mt(e[n++])];return n&&n==r?t:void 0}function H(t){return Le.call(t)}function U(t,e){return null!=t&&e in Object(t)}function q(t,e,n,r,i){return t===e||(null==t||null==e||!At(t)&&!Ot(e)?t!==t&&e!==e:W(t,e,q,n,r,i))}function W(t,e,n,r,i,o){var s=nn(t),a=nn(e),c=qt,u=qt;s||(c=tn(t),c=c==Ut?Qt:c),a||(u=tn(e),u=u==Ut?Qt:u);var h=c==Qt&&!l(t),f=u==Qt&&!l(e),d=c==u;if(d&&!h)return o||(o=new P),s||rn(t)?rt(t,e,n,r,i,o):it(t,e,c,n,r,i,o);if(!(i&$t)){var p=h&&Me.call(t,"__wrapped__"),g=f&&Me.call(e,"__wrapped__");if(p||g){var v=p?t.value():t,m=g?e.value():e;return o||(o=new P),n(v,m,r,i,o)}}return!!d&&(o||(o=new P),ot(t,e,n,r,i,o))}function G(t,e,n,r){var i=n.length,o=i,s=!r;if(null==t)return!o;for(t=Object(t);i--;){var a=n[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=n[i];var l=a[0],c=t[l],u=a[1];if(s&&a[2]){if(void 0===c&&!(l in t))return!1}else{var h=new P;if(r)var f=r(c,u,l,t,e,h);if(!(void 0===f?q(u,c,r,zt|$t,h):f))return!1}}return!0}function Y(t){return!(!At(t)||dt(t))&&(Tt(t)||l(t)?Pe:fe).test(yt(t))}function K(t){return Ot(t)&&Et(t.length)&&!!pe[Le.call(t)]}function X(t){return"function"==typeof t?t:null==t?Nt:"object"==typeof t?nn(t)?Q(t[0],t[1]):Z(t):It(t)}function J(t){if(!pt(t))return Re(t);var e=[];for(var n in Object(t))Me.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Z(t){var e=at(t);return 1==e.length&&e[0][2]?vt(e[0][0],e[0][1]):function(n){return n===t||G(n,t,e)}}function Q(t,e){return ht(t)&&gt(e)?vt(mt(t),e):function(n){var r=Pt(n,t);return void 0===r&&r===e?jt(n,t):q(e,r,void 0,zt|$t)}}function tt(t){return function(e){return V(e,t)}}function et(t){if("string"==typeof t)return t;if(Mt(t))return Je?Je.call(t):"";var e=t+"";return"0"==e&&1/t==-Vt?"-0":e}function nt(t){return nn(t)?t:en(t)}function rt(t,e,n,r,o,s){var a=o&$t,l=t.length,c=e.length;if(l!=c&&!(a&&c>l))return!1;var u=s.get(t);if(u&&s.get(e))return u==e;var h=-1,f=!0,d=o&zt?new O:void 0;for(s.set(t,e),s.set(e,t);++h<l;){var p=t[h],g=e[h];if(r)var v=a?r(g,p,h,e,t,s):r(p,g,h,t,e,s);if(void 0!==v){if(v)continue;f=!1;break}if(d){if(!i(e,function(t,e){if(!d.has(e)&&(p===t||n(p,t,r,o,s)))return d.add(e)})){f=!1;break}}else if(p!==g&&!n(p,g,r,o,s)){f=!1;break}}return s["delete"](t),s["delete"](e),f}function it(t,e,n,r,i,o,s){switch(n){case oe:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case ie:return!(t.byteLength!=e.byteLength||!r(new De(t),new De(e)));case Wt:case Gt:case Zt:return _t(+t,+e);case Yt:return t.name==e.name&&t.message==e.message;case te:case ne:return t==e+"";case Jt:var a=c;case ee:var l=o&$t;if(a||(a=u),t.size!=e.size&&!l)return!1;var h=s.get(t);if(h)return h==e;o|=zt,s.set(t,e);var f=rt(a(t),a(e),r,i,o,s);return s["delete"](t),f;case re:if(Xe)return Xe.call(t)==Xe.call(e)}return!1}function ot(t,e,n,r,i,o){var s=i&$t,a=Dt(t),l=a.length;if(l!=Dt(e).length&&!s)return!1;for(var c=l;c--;){var u=a[c];if(!(s?u in e:Me.call(e,u)))return!1}var h=o.get(t);if(h&&o.get(e))return h==e;var f=!0;o.set(t,e),o.set(e,t);for(var d=s;++c<l;){u=a[c];var p=t[u],g=e[u];if(r)var v=s?r(g,p,u,e,t,o):r(p,g,u,t,e,o);if(!(void 0===v?p===g||n(p,g,r,i,o):v)){f=!1;break}d||(d="constructor"==u)}if(f&&!d){var m=t.constructor,y=e.constructor;m!=y&&"constructor"in t&&"constructor"in e&&!("function"==typeof m&&m instanceof m&&"function"==typeof y&&y instanceof y)&&(f=!1)}return o["delete"](t),o["delete"](e),f}function st(t,e){var n=t.__data__;return ft(e)?n["string"==typeof e?"string":"hash"]:n.map}function at(t){for(var e=Dt(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,gt(i)]}return e}function lt(t,e){var n=a(t,e);return Y(n)?n:void 0}function ct(t,e,n){e=ht(e,t)?[e]:nt(e);for(var r,i=-1,o=e.length;++i<o;){var s=mt(e[i]);if(!(r=null!=t&&n(t,s)))break;t=t[s]}if(r)return r;var o=t?t.length:0;return!!o&&Et(o)&&ut(s,o)&&(nn(t)||Ct(t))}function ut(t,e){return!!(e=null==e?Ht:e)&&("number"==typeof t||de.test(t))&&t>-1&&t%1==0&&t<e}function ht(t,e){if(nn(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Mt(t))||ae.test(t)||!se.test(t)||null!=e&&t in Object(e)}function ft(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function dt(t){return!!Ae&&Ae in t}function pt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Te)}function gt(t){return t===t&&!At(t)}function vt(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}}function mt(t){if("string"==typeof t||Mt(t))return t;var e=t+"";return"0"==e&&1/t==-Vt?"-0":e}function yt(t){if(null!=t){try{return Oe.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function bt(t,e){return(nn(t)?r:z)(t,xt(X(e,3)))}function wt(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError(Bt);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s),s};return n.cache=new(wt.Cache||C),n}function xt(t){if("function"!=typeof t)throw new TypeError(Bt);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function _t(t,e){return t===e||t!==t&&e!==e}function Ct(t){return St(t)&&Me.call(t,"callee")&&(!Ne.call(t,"callee")||Le.call(t)==Ut)}function kt(t){return null!=t&&Et(t.length)&&!Tt(t)}function St(t){return Ot(t)&&kt(t)}function Tt(t){var e=At(t)?Le.call(t):"";return e==Kt||e==Xt}function Et(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Ht}function At(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Ot(t){return!!t&&"object"==typeof t}function Mt(t){return"symbol"==typeof t||Ot(t)&&Le.call(t)==re}function Lt(t){return null==t?"":et(t)}function Pt(t,e,n){var r=null==t?void 0:V(t,e);return void 0===r?n:r}function jt(t,e){return null!=t&&ct(t,e,U)}function Dt(t){return kt(t)?B(t):J(t)}function Nt(t){return t}function It(t){return ht(t)?o(mt(t)):tt(t)}var Rt=200,Bt="Expected a function",Ft="__lodash_hash_undefined__",zt=1,$t=2,Vt=1/0,Ht=9007199254740991,Ut="[object Arguments]",qt="[object Array]",Wt="[object Boolean]",Gt="[object Date]",Yt="[object Error]",Kt="[object Function]",Xt="[object GeneratorFunction]",Jt="[object Map]",Zt="[object Number]",Qt="[object Object]",te="[object RegExp]",ee="[object Set]",ne="[object String]",re="[object Symbol]",ie="[object ArrayBuffer]",oe="[object DataView]",se=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ae=/^\w*$/,le=/^\./,ce=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ue=/[\\^$.*+?()[\]{}|]/g,he=/\\(\\)?/g,fe=/^\[object .+?Constructor\]$/,de=/^(?:0|[1-9]\d*)$/,pe={};pe["[object Float32Array]"]=pe["[object Float64Array]"]=pe["[object Int8Array]"]=pe["[object Int16Array]"]=pe["[object Int32Array]"]=pe["[object Uint8Array]"]=pe["[object Uint8ClampedArray]"]=pe["[object Uint16Array]"]=pe["[object Uint32Array]"]=!0,pe[Ut]=pe[qt]=pe[ie]=pe[Wt]=pe[oe]=pe[Gt]=pe[Yt]=pe[Kt]=pe[Jt]=pe[Zt]=pe[Qt]=pe[te]=pe[ee]=pe[ne]=pe["[object WeakMap]"]=!1;var ge="object"==typeof t&&t&&t.Object===Object&&t,ve="object"==typeof self&&self&&self.Object===Object&&self,me=ge||ve||Function("return this")(),ye="object"==typeof e&&e&&!e.nodeType&&e,be=ye&&"object"==typeof n&&n&&!n.nodeType&&n,we=be&&be.exports===ye,xe=we&&ge.process,_e=function(){try{return xe&&xe.binding("util")}catch(t){}}(),Ce=_e&&_e.isTypedArray,ke=Array.prototype,Se=Function.prototype,Te=Object.prototype,Ee=me["__core-js_shared__"],Ae=function(){var t=/[^.]+$/.exec(Ee&&Ee.keys&&Ee.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Oe=Se.toString,Me=Te.hasOwnProperty,Le=Te.toString,Pe=RegExp("^"+Oe.call(Me).replace(ue,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),je=me.Symbol,De=me.Uint8Array,Ne=Te.propertyIsEnumerable,Ie=ke.splice,Re=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object),Be=lt(me,"DataView"),Fe=lt(me,"Map"),ze=lt(me,"Promise"),$e=lt(me,"Set"),Ve=lt(me,"WeakMap"),He=lt(Object,"create"),Ue=yt(Be),qe=yt(Fe),We=yt(ze),Ge=yt($e),Ye=yt(Ve),Ke=je?je.prototype:void 0,Xe=Ke?Ke.valueOf:void 0,Je=Ke?Ke.toString:void 0;h.prototype.clear=f,h.prototype["delete"]=d,h.prototype.get=p,h.prototype.has=g,h.prototype.set=v,m.prototype.clear=y,m.prototype["delete"]=b,m.prototype.get=w,m.prototype.has=x,m.prototype.set=_,C.prototype.clear=k,C.prototype["delete"]=S,C.prototype.get=T,C.prototype.has=E,C.prototype.set=A,O.prototype.add=O.prototype.push=M,O.prototype.has=L,P.prototype.clear=j,P.prototype["delete"]=D,P.prototype.get=N,P.prototype.has=I,P.prototype.set=R;var Ze=function(t,e){return function(n,r){if(null==n)return n;if(!kt(n))return t(n,r);for(var i=n.length,o=e?i:-1,s=Object(n);(e?o--:++o<i)&&!1!==r(s[o],o,s););return n}}($),Qe=function(t){return function(e,n,r){for(var i=-1,o=Object(e),s=r(e),a=s.length;a--;){var l=s[t?a:++i];if(!1===n(o[l],l,o))break}return e}}(),tn=H;(Be&&tn(new Be(new ArrayBuffer(1)))!=oe||Fe&&tn(new Fe)!=Jt||ze&&"[object Promise]"!=tn(ze.resolve())||$e&&tn(new $e)!=ee||Ve&&"[object WeakMap]"!=tn(new Ve))&&(tn=function(t){var e=Le.call(t),n=e==Qt?t.constructor:void 0,r=n?yt(n):void 0;if(r)switch(r){case Ue:return oe;case qe:return Jt;case We:return"[object Promise]";case Ge:return ee;case Ye:return"[object WeakMap]"}return e});var en=wt(function(t){t=Lt(t);var e=[];return le.test(t)&&e.push(""),t.replace(ce,function(t,n,r,i){e.push(r?i.replace(he,"$1"):n||t)}),e});wt.Cache=C;var nn=Array.isArray,rn=Ce?function(t){return function(e){return t(e)}}(Ce):K;n.exports=bt}).call(e,n(0),n(5)(t))},function(t,e,n){(function(t,n){function r(t,e){for(var n=-1,r=t?t.length:0,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}function i(t,e){for(var n=-1,r=t?t.length:0;++n<r;)if(e(t[n],n,t))return!0;return!1}function o(t){return function(e){return null==e?void 0:e[t]}}function s(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function a(t,e){return null==t?void 0:t[e]}function l(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function c(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function u(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function h(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function f(){this.__data__=Ve?Ve(null):{}}function d(t){return this.has(t)&&delete this.__data__[t]}function p(t){var e=this.__data__;if(Ve){var n=e[t];return n===Bt?void 0:n}return Oe.call(e,t)?e[t]:void 0}function g(t){var e=this.__data__;return Ve?void 0!==e[t]:Oe.call(e,t)}function v(t,e){return this.__data__[t]=Ve&&void 0===e?Bt:e,this}function m(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function y(){this.__data__=[]}function b(t){var e=this.__data__,n=F(e,t);return!(n<0||(n==e.length-1?e.pop():Ne.call(e,n,1),0))}function w(t){var e=this.__data__,n=F(e,t);return n<0?void 0:e[n][1]}function x(t){return F(this.__data__,t)>-1}function _(t,e){var n=this.__data__,r=F(n,t);return r<0?n.push([t,e]):n[r][1]=e,this}function C(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function k(){this.__data__={hash:new h,map:new(Be||m),string:new h}}function S(t){return st(this,t)["delete"](t)}function T(t){return st(this,t).get(t)}function E(t){return st(this,t).has(t)}function A(t,e){return st(this,t).set(t,e),this}function O(t){var e=-1,n=t?t.length:0;for(this.__data__=new C;++e<n;)this.add(t[e])}function M(t){return this.__data__.set(t,Bt),this}function L(t){return this.__data__.has(t)}function P(t){this.__data__=new m(t)}function j(){this.__data__=new m}function D(t){return this.__data__["delete"](t)}function N(t){return this.__data__.get(t)}function I(t){return this.__data__.has(t)}function R(t,e){var n=this.__data__;if(n instanceof m){var r=n.__data__;if(!Be||r.length<It-1)return r.push([t,e]),this;n=this.__data__=new C(r)}return n.set(t,e),this}function B(t,e){var n=en(t)||_t(t)?s(t.length,String):[],r=n.length,i=!!r;for(var o in t)!e&&!Oe.call(t,o)||i&&("length"==o||ut(o,r))||n.push(o);return n}function F(t,e){for(var n=t.length;n--;)if(xt(t[n][0],e))return n;return-1}function z(t,e){var n=[];return Je(t,function(t,r,i){e(t,r,i)&&n.push(t)}),n}function $(t,e){return t&&Ze(t,e,jt)}function V(t,e){e=ht(e,t)?[e]:nt(e);for(var n=0,r=e.length;null!=t&&n<r;)t=t[mt(e[n++])];return n&&n==r?t:void 0}function H(t){return Me.call(t)}function U(t,e){return null!=t&&e in Object(t)}function q(t,e,n,r,i){return t===e||(null==t||null==e||!Et(t)&&!At(e)?t!==t&&e!==e:W(t,e,q,n,r,i))}function W(t,e,n,r,i,o){var s=en(t),a=en(e),c=Ut,u=Ut;s||(c=Qe(t),c=c==Ht?Zt:c),a||(u=Qe(e),u=u==Ht?Zt:u);var h=c==Zt&&!l(t),f=u==Zt&&!l(e),d=c==u;if(d&&!h)return o||(o=new P),s||nn(t)?rt(t,e,n,r,i,o):it(t,e,c,n,r,i,o);if(!(i&zt)){var p=h&&Oe.call(t,"__wrapped__"),g=f&&Oe.call(e,"__wrapped__");if(p||g){var v=p?t.value():t,m=g?e.value():e;return o||(o=new P),n(v,m,r,i,o)}}return!!d&&(o||(o=new P),ot(t,e,n,r,i,o))}function G(t,e,n,r){var i=n.length,o=i,s=!r;if(null==t)return!o;for(t=Object(t);i--;){var a=n[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=n[i];var l=a[0],c=t[l],u=a[1];if(s&&a[2]){if(void 0===c&&!(l in t))return!1}else{var h=new P;if(r)var f=r(c,u,l,t,e,h);if(!(void 0===f?q(u,c,r,Ft|zt,h):f))return!1}}return!0}function Y(t){return!(!Et(t)||dt(t))&&(St(t)||l(t)?Le:he).test(yt(t))}function K(t){return At(t)&&Tt(t.length)&&!!de[Me.call(t)]}function X(t){return"function"==typeof t?t:null==t?Dt:"object"==typeof t?en(t)?Q(t[0],t[1]):Z(t):Nt(t)}function J(t){if(!pt(t))return Ie(t);var e=[];for(var n in Object(t))Oe.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Z(t){var e=at(t);return 1==e.length&&e[0][2]?vt(e[0][0],e[0][1]):function(n){return n===t||G(n,t,e)}}function Q(t,e){return ht(t)&&gt(e)?vt(mt(t),e):function(n){var r=Lt(n,t);return void 0===r&&r===e?Pt(n,t):q(e,r,void 0,Ft|zt)}}function tt(t){return function(e){return V(e,t)}}function et(t){if("string"==typeof t)return t;if(Ot(t))return Xe?Xe.call(t):"";var e=t+"";return"0"==e&&1/t==-$t?"-0":e}function nt(t){return en(t)?t:tn(t)}function rt(t,e,n,r,o,s){var a=o&zt,l=t.length,c=e.length;if(l!=c&&!(a&&c>l))return!1;var u=s.get(t);if(u&&s.get(e))return u==e;var h=-1,f=!0,d=o&Ft?new O:void 0;for(s.set(t,e),s.set(e,t);++h<l;){var p=t[h],g=e[h];if(r)var v=a?r(g,p,h,e,t,s):r(p,g,h,t,e,s);if(void 0!==v){if(v)continue;f=!1;break}if(d){if(!i(e,function(t,e){if(!d.has(e)&&(p===t||n(p,t,r,o,s)))return d.add(e)})){f=!1;break}}else if(p!==g&&!n(p,g,r,o,s)){f=!1;break}}return s["delete"](t),s["delete"](e),f}function it(t,e,n,r,i,o,s){switch(n){case ie:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case re:return!(t.byteLength!=e.byteLength||!r(new je(t),new je(e)));case qt:case Wt:case Jt:return xt(+t,+e);case Gt:return t.name==e.name&&t.message==e.message;case Qt:case ee:return t==e+"";case Xt:var a=c;case te:var l=o&zt;if(a||(a=u),t.size!=e.size&&!l)return!1;var h=s.get(t);if(h)return h==e;o|=Ft,s.set(t,e);var f=rt(a(t),a(e),r,i,o,s);return s["delete"](t),f;case ne:if(Ke)return Ke.call(t)==Ke.call(e)}return!1}function ot(t,e,n,r,i,o){var s=i&zt,a=jt(t),l=a.length;if(l!=jt(e).length&&!s)return!1;for(var c=l;c--;){var u=a[c];if(!(s?u in e:Oe.call(e,u)))return!1}var h=o.get(t);if(h&&o.get(e))return h==e;var f=!0;o.set(t,e),o.set(e,t);for(var d=s;++c<l;){u=a[c];var p=t[u],g=e[u];if(r)var v=s?r(g,p,u,e,t,o):r(p,g,u,t,e,o);if(!(void 0===v?p===g||n(p,g,r,i,o):v)){f=!1;break}d||(d="constructor"==u)}if(f&&!d){var m=t.constructor,y=e.constructor;m!=y&&"constructor"in t&&"constructor"in e&&!("function"==typeof m&&m instanceof m&&"function"==typeof y&&y instanceof y)&&(f=!1)}return o["delete"](t),o["delete"](e),f}function st(t,e){var n=t.__data__;return ft(e)?n["string"==typeof e?"string":"hash"]:n.map}function at(t){for(var e=jt(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,gt(i)]}return e}function lt(t,e){var n=a(t,e);return Y(n)?n:void 0}function ct(t,e,n){e=ht(e,t)?[e]:nt(e);for(var r,i=-1,o=e.length;++i<o;){var s=mt(e[i]);if(!(r=null!=t&&n(t,s)))break;t=t[s]}if(r)return r;var o=t?t.length:0;return!!o&&Tt(o)&&ut(s,o)&&(en(t)||_t(t))}function ut(t,e){return!!(e=null==e?Vt:e)&&("number"==typeof t||fe.test(t))&&t>-1&&t%1==0&&t<e}function ht(t,e){if(en(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Ot(t))||se.test(t)||!oe.test(t)||null!=e&&t in Object(e)}function ft(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function dt(t){return!!Ee&&Ee in t}function pt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Se)}function gt(t){return t===t&&!Et(t);
}function vt(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}}function mt(t){if("string"==typeof t||Ot(t))return t;var e=t+"";return"0"==e&&1/t==-$t?"-0":e}function yt(t){if(null!=t){try{return Ae.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function bt(t,e){return(en(t)?r:z)(t,X(e,3))}function wt(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError(Rt);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s),s};return n.cache=new(wt.Cache||C),n}function xt(t,e){return t===e||t!==t&&e!==e}function _t(t){return kt(t)&&Oe.call(t,"callee")&&(!De.call(t,"callee")||Me.call(t)==Ht)}function Ct(t){return null!=t&&Tt(t.length)&&!St(t)}function kt(t){return At(t)&&Ct(t)}function St(t){var e=Et(t)?Me.call(t):"";return e==Yt||e==Kt}function Tt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Vt}function Et(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function At(t){return!!t&&"object"==typeof t}function Ot(t){return"symbol"==typeof t||At(t)&&Me.call(t)==ne}function Mt(t){return null==t?"":et(t)}function Lt(t,e,n){var r=null==t?void 0:V(t,e);return void 0===r?n:r}function Pt(t,e){return null!=t&&ct(t,e,U)}function jt(t){return Ct(t)?B(t):J(t)}function Dt(t){return t}function Nt(t){return ht(t)?o(mt(t)):tt(t)}var It=200,Rt="Expected a function",Bt="__lodash_hash_undefined__",Ft=1,zt=2,$t=1/0,Vt=9007199254740991,Ht="[object Arguments]",Ut="[object Array]",qt="[object Boolean]",Wt="[object Date]",Gt="[object Error]",Yt="[object Function]",Kt="[object GeneratorFunction]",Xt="[object Map]",Jt="[object Number]",Zt="[object Object]",Qt="[object RegExp]",te="[object Set]",ee="[object String]",ne="[object Symbol]",re="[object ArrayBuffer]",ie="[object DataView]",oe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,se=/^\w*$/,ae=/^\./,le=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ce=/[\\^$.*+?()[\]{}|]/g,ue=/\\(\\)?/g,he=/^\[object .+?Constructor\]$/,fe=/^(?:0|[1-9]\d*)$/,de={};de["[object Float32Array]"]=de["[object Float64Array]"]=de["[object Int8Array]"]=de["[object Int16Array]"]=de["[object Int32Array]"]=de["[object Uint8Array]"]=de["[object Uint8ClampedArray]"]=de["[object Uint16Array]"]=de["[object Uint32Array]"]=!0,de[Ht]=de[Ut]=de[re]=de[qt]=de[ie]=de[Wt]=de[Gt]=de[Yt]=de[Xt]=de[Jt]=de[Zt]=de[Qt]=de[te]=de[ee]=de["[object WeakMap]"]=!1;var pe="object"==typeof t&&t&&t.Object===Object&&t,ge="object"==typeof self&&self&&self.Object===Object&&self,ve=pe||ge||Function("return this")(),me="object"==typeof e&&e&&!e.nodeType&&e,ye=me&&"object"==typeof n&&n&&!n.nodeType&&n,be=ye&&ye.exports===me,we=be&&pe.process,xe=function(){try{return we&&we.binding("util")}catch(t){}}(),_e=xe&&xe.isTypedArray,Ce=Array.prototype,ke=Function.prototype,Se=Object.prototype,Te=ve["__core-js_shared__"],Ee=function(){var t=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Ae=ke.toString,Oe=Se.hasOwnProperty,Me=Se.toString,Le=RegExp("^"+Ae.call(Oe).replace(ce,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pe=ve.Symbol,je=ve.Uint8Array,De=Se.propertyIsEnumerable,Ne=Ce.splice,Ie=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object),Re=lt(ve,"DataView"),Be=lt(ve,"Map"),Fe=lt(ve,"Promise"),ze=lt(ve,"Set"),$e=lt(ve,"WeakMap"),Ve=lt(Object,"create"),He=yt(Re),Ue=yt(Be),qe=yt(Fe),We=yt(ze),Ge=yt($e),Ye=Pe?Pe.prototype:void 0,Ke=Ye?Ye.valueOf:void 0,Xe=Ye?Ye.toString:void 0;h.prototype.clear=f,h.prototype["delete"]=d,h.prototype.get=p,h.prototype.has=g,h.prototype.set=v,m.prototype.clear=y,m.prototype["delete"]=b,m.prototype.get=w,m.prototype.has=x,m.prototype.set=_,C.prototype.clear=k,C.prototype["delete"]=S,C.prototype.get=T,C.prototype.has=E,C.prototype.set=A,O.prototype.add=O.prototype.push=M,O.prototype.has=L,P.prototype.clear=j,P.prototype["delete"]=D,P.prototype.get=N,P.prototype.has=I,P.prototype.set=R;var Je=function(t,e){return function(n,r){if(null==n)return n;if(!Ct(n))return t(n,r);for(var i=n.length,o=e?i:-1,s=Object(n);(e?o--:++o<i)&&!1!==r(s[o],o,s););return n}}($),Ze=function(t){return function(e,n,r){for(var i=-1,o=Object(e),s=r(e),a=s.length;a--;){var l=s[t?a:++i];if(!1===n(o[l],l,o))break}return e}}(),Qe=H;(Re&&Qe(new Re(new ArrayBuffer(1)))!=ie||Be&&Qe(new Be)!=Xt||Fe&&"[object Promise]"!=Qe(Fe.resolve())||ze&&Qe(new ze)!=te||$e&&"[object WeakMap]"!=Qe(new $e))&&(Qe=function(t){var e=Me.call(t),n=e==Zt?t.constructor:void 0,r=n?yt(n):void 0;if(r)switch(r){case He:return ie;case Ue:return Xt;case qe:return"[object Promise]";case We:return te;case Ge:return"[object WeakMap]"}return e});var tn=wt(function(t){t=Mt(t);var e=[];return ae.test(t)&&e.push(""),t.replace(le,function(t,n,r,i){e.push(r?i.replace(ue,"$1"):n||t)}),e});wt.Cache=C;var en=Array.isArray,nn=_e?function(t){return function(e){return t(e)}}(_e):K;n.exports=bt}).call(e,n(0),n(5)(t))},function(t,e,n){(function(t,n){function r(t,e,n,r){var i=-1,o=t?t.length:0;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function i(t,e){for(var n=-1,r=t?t.length:0;++n<r;)if(e(t[n],n,t))return!0;return!1}function o(t){return function(e){return null==e?void 0:e[t]}}function s(t,e,n,r,i){return i(t,function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)}),n}function a(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function l(t,e){return null==t?void 0:t[e]}function c(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function u(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function h(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function f(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function d(){this.__data__=Ve?Ve(null):{}}function p(t){return this.has(t)&&delete this.__data__[t]}function g(t){var e=this.__data__;if(Ve){var n=e[t];return n===Bt?void 0:n}return Oe.call(e,t)?e[t]:void 0}function v(t){var e=this.__data__;return Ve?void 0!==e[t]:Oe.call(e,t)}function m(t,e){return this.__data__[t]=Ve&&void 0===e?Bt:e,this}function y(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function b(){this.__data__=[]}function w(t){var e=this.__data__,n=z(e,t);return!(n<0||(n==e.length-1?e.pop():Ne.call(e,n,1),0))}function x(t){var e=this.__data__,n=z(e,t);return n<0?void 0:e[n][1]}function _(t){return z(this.__data__,t)>-1}function C(t,e){var n=this.__data__,r=z(n,t);return r<0?n.push([t,e]):n[r][1]=e,this}function k(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function S(){this.__data__={hash:new f,map:new(Be||y),string:new f}}function T(t){return st(this,t)["delete"](t)}function E(t){return st(this,t).get(t)}function A(t){return st(this,t).has(t)}function O(t,e){return st(this,t).set(t,e),this}function M(t){var e=-1,n=t?t.length:0;for(this.__data__=new k;++e<n;)this.add(t[e])}function L(t){return this.__data__.set(t,Bt),this}function P(t){return this.__data__.has(t)}function j(t){this.__data__=new y(t)}function D(){this.__data__=new y}function N(t){return this.__data__["delete"](t)}function I(t){return this.__data__.get(t)}function R(t){return this.__data__.has(t)}function B(t,e){var n=this.__data__;if(n instanceof y){var r=n.__data__;if(!Be||r.length<It-1)return r.push([t,e]),this;n=this.__data__=new k(r)}return n.set(t,e),this}function F(t,e){var n=en(t)||_t(t)?a(t.length,String):[],r=n.length,i=!!r;for(var o in t)!e&&!Oe.call(t,o)||i&&("length"==o||ut(o,r))||n.push(o);return n}function z(t,e){for(var n=t.length;n--;)if(xt(t[n][0],e))return n;return-1}function $(t,e){return t&&Ze(t,e,jt)}function V(t,e){e=ht(e,t)?[e]:nt(e);for(var n=0,r=e.length;null!=t&&n<r;)t=t[mt(e[n++])];return n&&n==r?t:void 0}function H(t){return Me.call(t)}function U(t,e){return null!=t&&e in Object(t)}function q(t,e,n,r,i){return t===e||(null==t||null==e||!Et(t)&&!At(e)?t!==t&&e!==e:W(t,e,q,n,r,i))}function W(t,e,n,r,i,o){var s=en(t),a=en(e),l=Ut,u=Ut;s||(l=Qe(t),l=l==Ht?Zt:l),a||(u=Qe(e),u=u==Ht?Zt:u);var h=l==Zt&&!c(t),f=u==Zt&&!c(e),d=l==u;if(d&&!h)return o||(o=new j),s||nn(t)?rt(t,e,n,r,i,o):it(t,e,l,n,r,i,o);if(!(i&zt)){var p=h&&Oe.call(t,"__wrapped__"),g=f&&Oe.call(e,"__wrapped__");if(p||g){var v=p?t.value():t,m=g?e.value():e;return o||(o=new j),n(v,m,r,i,o)}}return!!d&&(o||(o=new j),ot(t,e,n,r,i,o))}function G(t,e,n,r){var i=n.length,o=i,s=!r;if(null==t)return!o;for(t=Object(t);i--;){var a=n[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=n[i];var l=a[0],c=t[l],u=a[1];if(s&&a[2]){if(void 0===c&&!(l in t))return!1}else{var h=new j;if(r)var f=r(c,u,l,t,e,h);if(!(void 0===f?q(u,c,r,Ft|zt,h):f))return!1}}return!0}function Y(t){return!(!Et(t)||dt(t))&&(St(t)||c(t)?Le:he).test(yt(t))}function K(t){return At(t)&&Tt(t.length)&&!!de[Me.call(t)]}function X(t){return"function"==typeof t?t:null==t?Dt:"object"==typeof t?en(t)?Q(t[0],t[1]):Z(t):Nt(t)}function J(t){if(!pt(t))return Ie(t);var e=[];for(var n in Object(t))Oe.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Z(t){var e=at(t);return 1==e.length&&e[0][2]?vt(e[0][0],e[0][1]):function(n){return n===t||G(n,t,e)}}function Q(t,e){return ht(t)&&gt(e)?vt(mt(t),e):function(n){var r=Lt(n,t);return void 0===r&&r===e?Pt(n,t):q(e,r,void 0,Ft|zt)}}function tt(t){return function(e){return V(e,t)}}function et(t){if("string"==typeof t)return t;if(Ot(t))return Xe?Xe.call(t):"";var e=t+"";return"0"==e&&1/t==-$t?"-0":e}function nt(t){return en(t)?t:tn(t)}function rt(t,e,n,r,o,s){var a=o&zt,l=t.length,c=e.length;if(l!=c&&!(a&&c>l))return!1;var u=s.get(t);if(u&&s.get(e))return u==e;var h=-1,f=!0,d=o&Ft?new M:void 0;for(s.set(t,e),s.set(e,t);++h<l;){var p=t[h],g=e[h];if(r)var v=a?r(g,p,h,e,t,s):r(p,g,h,t,e,s);if(void 0!==v){if(v)continue;f=!1;break}if(d){if(!i(e,function(t,e){if(!d.has(e)&&(p===t||n(p,t,r,o,s)))return d.add(e)})){f=!1;break}}else if(p!==g&&!n(p,g,r,o,s)){f=!1;break}}return s["delete"](t),s["delete"](e),f}function it(t,e,n,r,i,o,s){switch(n){case ie:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case re:return!(t.byteLength!=e.byteLength||!r(new je(t),new je(e)));case qt:case Wt:case Jt:return xt(+t,+e);case Gt:return t.name==e.name&&t.message==e.message;case Qt:case ee:return t==e+"";case Xt:var a=u;case te:var l=o&zt;if(a||(a=h),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;o|=Ft,s.set(t,e);var f=rt(a(t),a(e),r,i,o,s);return s["delete"](t),f;case ne:if(Ke)return Ke.call(t)==Ke.call(e)}return!1}function ot(t,e,n,r,i,o){var s=i&zt,a=jt(t),l=a.length;if(l!=jt(e).length&&!s)return!1;for(var c=l;c--;){var u=a[c];if(!(s?u in e:Oe.call(e,u)))return!1}var h=o.get(t);if(h&&o.get(e))return h==e;var f=!0;o.set(t,e),o.set(e,t);for(var d=s;++c<l;){u=a[c];var p=t[u],g=e[u];if(r)var v=s?r(g,p,u,e,t,o):r(p,g,u,t,e,o);if(!(void 0===v?p===g||n(p,g,r,i,o):v)){f=!1;break}d||(d="constructor"==u)}if(f&&!d){var m=t.constructor,y=e.constructor;m!=y&&"constructor"in t&&"constructor"in e&&!("function"==typeof m&&m instanceof m&&"function"==typeof y&&y instanceof y)&&(f=!1)}return o["delete"](t),o["delete"](e),f}function st(t,e){var n=t.__data__;return ft(e)?n["string"==typeof e?"string":"hash"]:n.map}function at(t){for(var e=jt(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,gt(i)]}return e}function lt(t,e){var n=l(t,e);return Y(n)?n:void 0}function ct(t,e,n){e=ht(e,t)?[e]:nt(e);for(var r,i=-1,o=e.length;++i<o;){var s=mt(e[i]);if(!(r=null!=t&&n(t,s)))break;t=t[s]}if(r)return r;var o=t?t.length:0;return!!o&&Tt(o)&&ut(s,o)&&(en(t)||_t(t))}function ut(t,e){return!!(e=null==e?Vt:e)&&("number"==typeof t||fe.test(t))&&t>-1&&t%1==0&&t<e}function ht(t,e){if(en(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Ot(t))||se.test(t)||!oe.test(t)||null!=e&&t in Object(e)}function ft(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function dt(t){return!!Ee&&Ee in t}function pt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Se)}function gt(t){return t===t&&!Et(t)}function vt(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}}function mt(t){if("string"==typeof t||Ot(t))return t;var e=t+"";return"0"==e&&1/t==-$t?"-0":e}function yt(t){if(null!=t){try{return Ae.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function bt(t,e,n){var i=en(t)?r:s,o=arguments.length<3;return i(t,X(e,4),n,o,Je)}function wt(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError(Rt);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s),s};return n.cache=new(wt.Cache||k),n}function xt(t,e){return t===e||t!==t&&e!==e}function _t(t){return kt(t)&&Oe.call(t,"callee")&&(!De.call(t,"callee")||Me.call(t)==Ht)}function Ct(t){return null!=t&&Tt(t.length)&&!St(t)}function kt(t){return At(t)&&Ct(t)}function St(t){var e=Et(t)?Me.call(t):"";return e==Yt||e==Kt}function Tt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Vt}function Et(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function At(t){return!!t&&"object"==typeof t}function Ot(t){return"symbol"==typeof t||At(t)&&Me.call(t)==ne}function Mt(t){return null==t?"":et(t)}function Lt(t,e,n){var r=null==t?void 0:V(t,e);return void 0===r?n:r}function Pt(t,e){return null!=t&&ct(t,e,U)}function jt(t){return Ct(t)?F(t):J(t)}function Dt(t){return t}function Nt(t){return ht(t)?o(mt(t)):tt(t)}var It=200,Rt="Expected a function",Bt="__lodash_hash_undefined__",Ft=1,zt=2,$t=1/0,Vt=9007199254740991,Ht="[object Arguments]",Ut="[object Array]",qt="[object Boolean]",Wt="[object Date]",Gt="[object Error]",Yt="[object Function]",Kt="[object GeneratorFunction]",Xt="[object Map]",Jt="[object Number]",Zt="[object Object]",Qt="[object RegExp]",te="[object Set]",ee="[object String]",ne="[object Symbol]",re="[object ArrayBuffer]",ie="[object DataView]",oe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,se=/^\w*$/,ae=/^\./,le=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ce=/[\\^$.*+?()[\]{}|]/g,ue=/\\(\\)?/g,he=/^\[object .+?Constructor\]$/,fe=/^(?:0|[1-9]\d*)$/,de={};de["[object Float32Array]"]=de["[object Float64Array]"]=de["[object Int8Array]"]=de["[object Int16Array]"]=de["[object Int32Array]"]=de["[object Uint8Array]"]=de["[object Uint8ClampedArray]"]=de["[object Uint16Array]"]=de["[object Uint32Array]"]=!0,de[Ht]=de[Ut]=de[re]=de[qt]=de[ie]=de[Wt]=de[Gt]=de[Yt]=de[Xt]=de[Jt]=de[Zt]=de[Qt]=de[te]=de[ee]=de["[object WeakMap]"]=!1;var pe="object"==typeof t&&t&&t.Object===Object&&t,ge="object"==typeof self&&self&&self.Object===Object&&self,ve=pe||ge||Function("return this")(),me="object"==typeof e&&e&&!e.nodeType&&e,ye=me&&"object"==typeof n&&n&&!n.nodeType&&n,be=ye&&ye.exports===me,we=be&&pe.process,xe=function(){try{return we&&we.binding("util")}catch(t){}}(),_e=xe&&xe.isTypedArray,Ce=Array.prototype,ke=Function.prototype,Se=Object.prototype,Te=ve["__core-js_shared__"],Ee=function(){var t=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Ae=ke.toString,Oe=Se.hasOwnProperty,Me=Se.toString,Le=RegExp("^"+Ae.call(Oe).replace(ce,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pe=ve.Symbol,je=ve.Uint8Array,De=Se.propertyIsEnumerable,Ne=Ce.splice,Ie=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object),Re=lt(ve,"DataView"),Be=lt(ve,"Map"),Fe=lt(ve,"Promise"),ze=lt(ve,"Set"),$e=lt(ve,"WeakMap"),Ve=lt(Object,"create"),He=yt(Re),Ue=yt(Be),qe=yt(Fe),We=yt(ze),Ge=yt($e),Ye=Pe?Pe.prototype:void 0,Ke=Ye?Ye.valueOf:void 0,Xe=Ye?Ye.toString:void 0;f.prototype.clear=d,f.prototype["delete"]=p,f.prototype.get=g,f.prototype.has=v,f.prototype.set=m,y.prototype.clear=b,y.prototype["delete"]=w,y.prototype.get=x,y.prototype.has=_,y.prototype.set=C,k.prototype.clear=S,k.prototype["delete"]=T,k.prototype.get=E,k.prototype.has=A,k.prototype.set=O,M.prototype.add=M.prototype.push=L,M.prototype.has=P,j.prototype.clear=D,j.prototype["delete"]=N,j.prototype.get=I,j.prototype.has=R,j.prototype.set=B;var Je=function(t,e){return function(n,r){if(null==n)return n;if(!Ct(n))return t(n,r);for(var i=n.length,o=e?i:-1,s=Object(n);(e?o--:++o<i)&&!1!==r(s[o],o,s););return n}}($),Ze=function(t){return function(e,n,r){for(var i=-1,o=Object(e),s=r(e),a=s.length;a--;){var l=s[t?a:++i];if(!1===n(o[l],l,o))break}return e}}(),Qe=H;(Re&&Qe(new Re(new ArrayBuffer(1)))!=ie||Be&&Qe(new Be)!=Xt||Fe&&"[object Promise]"!=Qe(Fe.resolve())||ze&&Qe(new ze)!=te||$e&&"[object WeakMap]"!=Qe(new $e))&&(Qe=function(t){var e=Me.call(t),n=e==Zt?t.constructor:void 0,r=n?yt(n):void 0;if(r)switch(r){case He:return ie;case Ue:return Xt;case qe:return"[object Promise]";case We:return te;case Ge:return"[object WeakMap]"}return e});var tn=wt(function(t){t=Mt(t);var e=[];return ae.test(t)&&e.push(""),t.replace(le,function(t,n,r,i){e.push(r?i.replace(ue,"$1"):n||t)}),e});wt.Cache=k;var en=Array.isArray,nn=_e?function(t){return function(e){return t(e)}}(_e):K;n.exports=bt}).call(e,n(0),n(5)(t))},function(t,e,n){var r=n(12),i=n(25),o=r.update,s=r.evaluate,a=n(10),l=a.domEach,c=a.cloneDom,u=a.isHtml,h=Array.prototype.slice,f={flatten:n(99),bind:n(24),forEach:n(15)};e._makeDomArray=function(t,e){return null==t?[]:t.cheerio?e?c(t.get(),t.options):t.get():Array.isArray(t)?f.flatten(t.map(function(t){return this._makeDomArray(t,e)},this)):"string"==typeof t?s(t,this.options):e?c([t]):[t]};var d=function(t){return function(){var e=h.call(arguments),n=this.length-1;return l(this,function(r,o){var s,a;a="function"==typeof e[0]?e[0].call(o,r,i.html(o.children)):e,s=this._makeDomArray(a,r<n),t(s,o.children,o)})}},p=function(t,e,n,r,i){var o,s,a,l,c,u=[e,n].concat(r),h=t[e-1]||null,f=t[e]||null;for(o=0,s=r.length;o<s;++o)l=r[o],c=l.parent||l.root,a=c&&c.children.indexOf(r[o]),c&&a>-1&&(c.children.splice(a,1),i===c&&e>a&&u[0]--),l.root=null,l.parent=i,l.prev&&(l.prev.next=l.next||null),l.next&&(l.next.prev=l.prev||null),l.prev=r[o-1]||h,l.next=r[o+1]||f;return h&&(h.next=r[0]),f&&(f.prev=r[r.length-1]),t.splice.apply(t,u)};e.appendTo=function(t){return t.cheerio||(t=this.constructor.call(this.constructor,t,null,this._originalRoot)),t.append(this),this},e.prependTo=function(t){return t.cheerio||(t=this.constructor.call(this.constructor,t,null,this._originalRoot)),t.prepend(this),this},e.append=d(function(t,e,n){p(e,e.length,0,t,n)}),e.prepend=d(function(t,e,n){p(e,0,0,t,n)}),e.wrap=function(t){var e="function"==typeof t&&t,n=this.length-1;return f.forEach(this,f.bind(function(r,i){var s,a,l=r.parent||r.root,c=l.children;l&&(e&&(t=e.call(r,i)),"string"!=typeof t||u(t)||(t=this.parents().last().find(t).clone()),s=this._makeDomArray(t,i<n).slice(0,1),a=c.indexOf(r),o([r],s[0]),p(c,a,0,s,l))},this)),this},e.after=function(){var t=h.call(arguments),e=this.length-1;return l(this,function(n,r){var o=r.parent||r.root;if(o){var s,a,l=o.children,c=l.indexOf(r);c<0||(s="function"==typeof t[0]?t[0].call(r,n,i.html(r.children)):t,a=this._makeDomArray(s,n<e),p(l,c+1,0,a,o))}}),this},e.insertAfter=function(t){var e=[],n=this;return"string"==typeof t&&(t=this.constructor.call(this.constructor,t,null,this._originalRoot)),t=this._makeDomArray(t),n.remove(),l(t,function(t,r){var i=n._makeDomArray(n.clone()),o=r.parent||r.root;if(o){var s=o.children,a=s.indexOf(r);a<0||(p(s,a+1,0,i,o),e.push(i))}}),this.constructor.call(this.constructor,this._makeDomArray(e))},e.before=function(){var t=h.call(arguments),e=this.length-1;return l(this,function(n,r){var o=r.parent||r.root;if(o){var s,a,l=o.children,c=l.indexOf(r);c<0||(s="function"==typeof t[0]?t[0].call(r,n,i.html(r.children)):t,a=this._makeDomArray(s,n<e),p(l,c,0,a,o))}}),this},e.insertBefore=function(t){var e=[],n=this;return"string"==typeof t&&(t=this.constructor.call(this.constructor,t,null,this._originalRoot)),t=this._makeDomArray(t),n.remove(),l(t,function(t,r){var i=n._makeDomArray(n.clone()),o=r.parent||r.root;if(o){var s=o.children,a=s.indexOf(r);a<0||(p(s,a,0,i,o),e.push(i))}}),this.constructor.call(this.constructor,this._makeDomArray(e))},e.remove=function(t){var e=this;return t&&(e=e.filter(t)),l(e,function(t,e){var n=e.parent||e.root;if(n){var r=n.children,i=r.indexOf(e);i<0||(r.splice(i,1),e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.prev=e.next=e.parent=e.root=null)}}),this},e.replaceWith=function(t){var e=this;return l(this,function(n,r){var i=r.parent||r.root;if(i){var s,a=i.children,l=e._makeDomArray("function"==typeof t?t.call(r,n,r):t);o(l,null),s=a.indexOf(r),p(a,s,1,l,i),r.parent=r.prev=r.next=r.root=null}}),this},e.empty=function(){return l(this,function(t,e){f.forEach(e.children,function(t){t.next=t.prev=t.parent=null}),e.children.length=0}),this},e.html=function(t){if(void 0===t)return this[0]&&this[0].children?i.html(this[0].children,this.options):null;var e=this.options;return l(this,function(n,r){f.forEach(r.children,function(t){t.next=t.prev=t.parent=null});var i=t.cheerio?t.clone().get():s(""+t,e);o(i,r)}),this},e.toString=function(){return i.html(this,this.options)},e.text=function(t){return void 0===t?i.text(this):"function"==typeof t?l(this,function(n,r){var o=[r];return e.text.call(o,t.call(r,n,i.text(o)))}):(l(this,function(e,n){f.forEach(n.children,function(t){t.next=t.prev=t.parent=null}),o({data:""+t,type:"text",parent:n,prev:null,next:null,children:[]},n)}),this)},e.clone=function(){return this._make(c(this.get(),this.options))}},function(t,e,n){(function(e){function n(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function r(t,e,o,s,a){var l=-1,c=t.length;for(o||(o=i),a||(a=[]);++l<c;){var u=t[l];e>0&&o(u)?e>1?r(u,e-1,o,s,a):n(a,u):s||(a[a.length]=u)}return a}function i(t){return T(t)||s(t)||!!(S&&t&&t[S])}function o(t){return(t?t.length:0)?r(t,1):[]}function s(t){return l(t)&&x.call(t,"callee")&&(!k.call(t,"callee")||_.call(t)==p)}function a(t){return null!=t&&u(t.length)&&!c(t)}function l(t){return f(t)&&a(t)}function c(t){var e=h(t)?_.call(t):"";return e==g||e==v}function u(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=d}function h(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function f(t){return!!t&&"object"==typeof t}var d=9007199254740991,p="[object Arguments]",g="[object Function]",v="[object GeneratorFunction]",m="object"==typeof e&&e&&e.Object===Object&&e,y="object"==typeof self&&self&&self.Object===Object&&self,b=m||y||Function("return this")(),w=Object.prototype,x=w.hasOwnProperty,_=w.toString,C=b.Symbol,k=w.propertyIsEnumerable,S=C?C.isConcatSpreadable:void 0,T=Array.isArray;t.exports=o}).call(e,n(0))},function(t,e,n){function r(t,e,n,s){if("string"==typeof e){var a=i(t);"function"==typeof n&&(n=n.call(t,s,a[e])),""===n?delete a[e]:null!=n&&(a[e]=n),t.attribs.style=o(a)}else"object"==typeof e&&Object.keys(e).forEach(function(n){r(t,n,e[n])})}function i(t,e){var n=s(t.attribs.style);return"string"==typeof e?n[e]:Array.isArray(e)?l.pick(n,e):n}function o(t){return Object.keys(t||{}).reduce(function(e,n){return e+=(e?" ":"")+n+": "+t[n]+";"},"")}function s(t){return t=(t||"").trim(),t?t.split(";").reduce(function(t,e){var n=e.indexOf(":");return n<1||n===e.length-1?t:(t[e.slice(0,n).trim()]=e.slice(n+1).trim(),t)},{}):{}}var a=n(10).domEach,l={pick:n(101)},c=Object.prototype.toString;e.css=function(t,e){return 2===arguments.length||"[object Object]"===c.call(t)?a(this,function(n,i){r(i,t,e,n)}):i(this[0],t)}},function(t,e,n){(function(e){function n(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function r(t,e){for(var n=-1,r=t?t.length:0,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function i(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function o(t,e,n,r,s){var a=-1,c=t.length;for(n||(n=l),s||(s=[]);++a<c;){var u=t[a];e>0&&n(u)?e>1?o(u,e-1,n,r,s):i(s,u):r||(s[s.length]=u)}return s}function s(t,e){return t=Object(t),a(t,e,function(e,n){return n in t})}function a(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var s=e[r],a=t[s];n(a,s)&&(o[s]=a)}return o}function l(t){return D(t)||u(t)||!!(P&&t&&t[P])}function c(t){if("string"==typeof t||m(t))return t;var e=t+"";return"0"==e&&1/t==-y?"-0":e}function u(t){return f(t)&&A.call(t,"callee")&&(!L.call(t,"callee")||O.call(t)==w)}function h(t){return null!=t&&p(t.length)&&!d(t)}function f(t){return v(t)&&h(t)}function d(t){var e=g(t)?O.call(t):"";return e==x||e==_}function p(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=b}function g(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function v(t){return!!t&&"object"==typeof t}function m(t){return"symbol"==typeof t||v(t)&&O.call(t)==C}var y=1/0,b=9007199254740991,w="[object Arguments]",x="[object Function]",_="[object GeneratorFunction]",C="[object Symbol]",k="object"==typeof e&&e&&e.Object===Object&&e,S="object"==typeof self&&self&&self.Object===Object&&self,T=k||S||Function("return this")(),E=Object.prototype,A=E.hasOwnProperty,O=E.toString,M=T.Symbol,L=E.propertyIsEnumerable,P=M?M.isConcatSpreadable:void 0,j=Math.max,D=Array.isArray,N=function(t,e){return e=j(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=j(r.length-e,0),s=Array(o);++i<o;)s[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=s,n(t,this,a)}}(function(t,e){return null==t?{}:s(t,r(o(e,1),c))});t.exports=N}).call(e,n(0))},function(t,e,n){var r=/%20/g,i=/\r?\n/g,o={map:n(103)};e.serialize=function(){var t=this.serializeArray();return o.map(t,function(t){return encodeURIComponent(t.name)+"="+encodeURIComponent(t.value)}).join("&").replace(r,"+")},e.serializeArray=function(){var t=this.constructor;return this.map(function(){var e=this,n=t(e);return"form"===e.name?n.find("input,select,textarea,keygen").toArray():n.filter("input,select,textarea,keygen").toArray()}).filter('[name!=""]:not(:disabled):not(:submit, :button, :image, :reset, :file):matches([checked], :not(:checkbox, :radio))').map(function(e,n){var r=t(n),s=r.attr("name"),a=r.val();return null==a?null:Array.isArray(a)?o.map(a,function(t){return{name:s,value:t.replace(i,"\r\n")}}):{name:s,value:a.replace(i,"\r\n")}}).get()}},function(t,e,n){(function(t,n){function r(t,e){for(var n=-1,r=t?t.length:0,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function i(t,e){for(var n=-1,r=t?t.length:0;++n<r;)if(e(t[n],n,t))return!0;return!1}function o(t){return function(e){return null==e?void 0:e[t]}}function s(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function a(t,e){return null==t?void 0:t[e]}function l(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function c(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function u(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function h(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function f(){this.__data__=Ve?Ve(null):{}}function d(t){return this.has(t)&&delete this.__data__[t]}function p(t){var e=this.__data__;if(Ve){var n=e[t];return n===Bt?void 0:n}return Oe.call(e,t)?e[t]:void 0}function g(t){var e=this.__data__;return Ve?void 0!==e[t]:Oe.call(e,t)}function v(t,e){return this.__data__[t]=Ve&&void 0===e?Bt:e,this}function m(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function y(){this.__data__=[]}function b(t){var e=this.__data__,n=F(e,t);return!(n<0||(n==e.length-1?e.pop():Ne.call(e,n,1),0))}function w(t){var e=this.__data__,n=F(e,t);return n<0?void 0:e[n][1]}function x(t){return F(this.__data__,t)>-1}function _(t,e){var n=this.__data__,r=F(n,t);return r<0?n.push([t,e]):n[r][1]=e,this}function C(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function k(){this.__data__={hash:new h,map:new(Be||m),string:new h}}function S(t){return st(this,t)["delete"](t)}function T(t){return st(this,t).get(t)}function E(t){return st(this,t).has(t)}function A(t,e){return st(this,t).set(t,e),this}function O(t){var e=-1,n=t?t.length:0;for(this.__data__=new C;++e<n;)this.add(t[e])}function M(t){return this.__data__.set(t,Bt),this}function L(t){return this.__data__.has(t)}function P(t){this.__data__=new m(t)}function j(){this.__data__=new m}function D(t){return this.__data__["delete"](t)}function N(t){return this.__data__.get(t)}function I(t){return this.__data__.has(t)}function R(t,e){var n=this.__data__;if(n instanceof m){var r=n.__data__;if(!Be||r.length<It-1)return r.push([t,e]),this;n=this.__data__=new C(r)}return n.set(t,e),this}function B(t,e){var n=en(t)||_t(t)?s(t.length,String):[],r=n.length,i=!!r;for(var o in t)!e&&!Oe.call(t,o)||i&&("length"==o||ut(o,r))||n.push(o);return n}function F(t,e){for(var n=t.length;n--;)if(xt(t[n][0],e))return n;return-1}function z(t,e){return t&&Ze(t,e,jt)}function $(t,e){e=ht(e,t)?[e]:nt(e);for(var n=0,r=e.length;null!=t&&n<r;)t=t[mt(e[n++])];return n&&n==r?t:void 0}function V(t){return Me.call(t)}function H(t,e){return null!=t&&e in Object(t)}function U(t,e,n,r,i){return t===e||(null==t||null==e||!Et(t)&&!At(e)?t!==t&&e!==e:q(t,e,U,n,r,i))}function q(t,e,n,r,i,o){var s=en(t),a=en(e),c=Ut,u=Ut;s||(c=Qe(t),c=c==Ht?Zt:c),a||(u=Qe(e),u=u==Ht?Zt:u);var h=c==Zt&&!l(t),f=u==Zt&&!l(e),d=c==u;if(d&&!h)return o||(o=new P),s||nn(t)?rt(t,e,n,r,i,o):it(t,e,c,n,r,i,o);if(!(i&zt)){var p=h&&Oe.call(t,"__wrapped__"),g=f&&Oe.call(e,"__wrapped__");if(p||g){var v=p?t.value():t,m=g?e.value():e;return o||(o=new P),n(v,m,r,i,o)}}return!!d&&(o||(o=new P),ot(t,e,n,r,i,o))}function W(t,e,n,r){var i=n.length,o=i,s=!r;if(null==t)return!o;for(t=Object(t);i--;){var a=n[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=n[i];var l=a[0],c=t[l],u=a[1];if(s&&a[2]){if(void 0===c&&!(l in t))return!1}else{var h=new P;if(r)var f=r(c,u,l,t,e,h);if(!(void 0===f?U(u,c,r,Ft|zt,h):f))return!1}}return!0}function G(t){return!(!Et(t)||dt(t))&&(St(t)||l(t)?Le:he).test(yt(t))}function Y(t){return At(t)&&Tt(t.length)&&!!de[Me.call(t)]}function K(t){return"function"==typeof t?t:null==t?Dt:"object"==typeof t?en(t)?Q(t[0],t[1]):Z(t):Nt(t)}function X(t){if(!pt(t))return Ie(t);var e=[];for(var n in Object(t))Oe.call(t,n)&&"constructor"!=n&&e.push(n);return e}function J(t,e){var n=-1,r=Ct(t)?Array(t.length):[];return Je(t,function(t,i,o){r[++n]=e(t,i,o)}),r}function Z(t){var e=at(t);return 1==e.length&&e[0][2]?vt(e[0][0],e[0][1]):function(n){return n===t||W(n,t,e)}}function Q(t,e){return ht(t)&&gt(e)?vt(mt(t),e):function(n){var r=Lt(n,t);return void 0===r&&r===e?Pt(n,t):U(e,r,void 0,Ft|zt)}}function tt(t){return function(e){return $(e,t)}}function et(t){if("string"==typeof t)return t;if(Ot(t))return Xe?Xe.call(t):"";var e=t+"";return"0"==e&&1/t==-$t?"-0":e}function nt(t){return en(t)?t:tn(t)}function rt(t,e,n,r,o,s){var a=o&zt,l=t.length,c=e.length;if(l!=c&&!(a&&c>l))return!1;var u=s.get(t);if(u&&s.get(e))return u==e;var h=-1,f=!0,d=o&Ft?new O:void 0;for(s.set(t,e),s.set(e,t);++h<l;){var p=t[h],g=e[h];if(r)var v=a?r(g,p,h,e,t,s):r(p,g,h,t,e,s);if(void 0!==v){if(v)continue;f=!1;break}if(d){if(!i(e,function(t,e){if(!d.has(e)&&(p===t||n(p,t,r,o,s)))return d.add(e)})){f=!1;break}}else if(p!==g&&!n(p,g,r,o,s)){f=!1;break}}return s["delete"](t),s["delete"](e),f}function it(t,e,n,r,i,o,s){switch(n){case ie:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case re:return!(t.byteLength!=e.byteLength||!r(new je(t),new je(e)));case qt:case Wt:case Jt:return xt(+t,+e);case Gt:return t.name==e.name&&t.message==e.message;case Qt:case ee:return t==e+"";case Xt:var a=c;case te:var l=o&zt;if(a||(a=u),t.size!=e.size&&!l)return!1;var h=s.get(t);if(h)return h==e;o|=Ft,s.set(t,e);var f=rt(a(t),a(e),r,i,o,s);return s["delete"](t),f;case ne:if(Ke)return Ke.call(t)==Ke.call(e)}return!1}function ot(t,e,n,r,i,o){var s=i&zt,a=jt(t),l=a.length;if(l!=jt(e).length&&!s)return!1;
for(var c=l;c--;){var u=a[c];if(!(s?u in e:Oe.call(e,u)))return!1}var h=o.get(t);if(h&&o.get(e))return h==e;var f=!0;o.set(t,e),o.set(e,t);for(var d=s;++c<l;){u=a[c];var p=t[u],g=e[u];if(r)var v=s?r(g,p,u,e,t,o):r(p,g,u,t,e,o);if(!(void 0===v?p===g||n(p,g,r,i,o):v)){f=!1;break}d||(d="constructor"==u)}if(f&&!d){var m=t.constructor,y=e.constructor;m!=y&&"constructor"in t&&"constructor"in e&&!("function"==typeof m&&m instanceof m&&"function"==typeof y&&y instanceof y)&&(f=!1)}return o["delete"](t),o["delete"](e),f}function st(t,e){var n=t.__data__;return ft(e)?n["string"==typeof e?"string":"hash"]:n.map}function at(t){for(var e=jt(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,gt(i)]}return e}function lt(t,e){var n=a(t,e);return G(n)?n:void 0}function ct(t,e,n){e=ht(e,t)?[e]:nt(e);for(var r,i=-1,o=e.length;++i<o;){var s=mt(e[i]);if(!(r=null!=t&&n(t,s)))break;t=t[s]}if(r)return r;var o=t?t.length:0;return!!o&&Tt(o)&&ut(s,o)&&(en(t)||_t(t))}function ut(t,e){return!!(e=null==e?Vt:e)&&("number"==typeof t||fe.test(t))&&t>-1&&t%1==0&&t<e}function ht(t,e){if(en(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Ot(t))||se.test(t)||!oe.test(t)||null!=e&&t in Object(e)}function ft(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function dt(t){return!!Ee&&Ee in t}function pt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Se)}function gt(t){return t===t&&!Et(t)}function vt(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}}function mt(t){if("string"==typeof t||Ot(t))return t;var e=t+"";return"0"==e&&1/t==-$t?"-0":e}function yt(t){if(null!=t){try{return Ae.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function bt(t,e){return(en(t)?r:J)(t,K(e,3))}function wt(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError(Rt);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s),s};return n.cache=new(wt.Cache||C),n}function xt(t,e){return t===e||t!==t&&e!==e}function _t(t){return kt(t)&&Oe.call(t,"callee")&&(!De.call(t,"callee")||Me.call(t)==Ht)}function Ct(t){return null!=t&&Tt(t.length)&&!St(t)}function kt(t){return At(t)&&Ct(t)}function St(t){var e=Et(t)?Me.call(t):"";return e==Yt||e==Kt}function Tt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Vt}function Et(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function At(t){return!!t&&"object"==typeof t}function Ot(t){return"symbol"==typeof t||At(t)&&Me.call(t)==ne}function Mt(t){return null==t?"":et(t)}function Lt(t,e,n){var r=null==t?void 0:$(t,e);return void 0===r?n:r}function Pt(t,e){return null!=t&&ct(t,e,H)}function jt(t){return Ct(t)?B(t):X(t)}function Dt(t){return t}function Nt(t){return ht(t)?o(mt(t)):tt(t)}var It=200,Rt="Expected a function",Bt="__lodash_hash_undefined__",Ft=1,zt=2,$t=1/0,Vt=9007199254740991,Ht="[object Arguments]",Ut="[object Array]",qt="[object Boolean]",Wt="[object Date]",Gt="[object Error]",Yt="[object Function]",Kt="[object GeneratorFunction]",Xt="[object Map]",Jt="[object Number]",Zt="[object Object]",Qt="[object RegExp]",te="[object Set]",ee="[object String]",ne="[object Symbol]",re="[object ArrayBuffer]",ie="[object DataView]",oe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,se=/^\w*$/,ae=/^\./,le=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ce=/[\\^$.*+?()[\]{}|]/g,ue=/\\(\\)?/g,he=/^\[object .+?Constructor\]$/,fe=/^(?:0|[1-9]\d*)$/,de={};de["[object Float32Array]"]=de["[object Float64Array]"]=de["[object Int8Array]"]=de["[object Int16Array]"]=de["[object Int32Array]"]=de["[object Uint8Array]"]=de["[object Uint8ClampedArray]"]=de["[object Uint16Array]"]=de["[object Uint32Array]"]=!0,de[Ht]=de[Ut]=de[re]=de[qt]=de[ie]=de[Wt]=de[Gt]=de[Yt]=de[Xt]=de[Jt]=de[Zt]=de[Qt]=de[te]=de[ee]=de["[object WeakMap]"]=!1;var pe="object"==typeof t&&t&&t.Object===Object&&t,ge="object"==typeof self&&self&&self.Object===Object&&self,ve=pe||ge||Function("return this")(),me="object"==typeof e&&e&&!e.nodeType&&e,ye=me&&"object"==typeof n&&n&&!n.nodeType&&n,be=ye&&ye.exports===me,we=be&&pe.process,xe=function(){try{return we&&we.binding("util")}catch(t){}}(),_e=xe&&xe.isTypedArray,Ce=Array.prototype,ke=Function.prototype,Se=Object.prototype,Te=ve["__core-js_shared__"],Ee=function(){var t=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Ae=ke.toString,Oe=Se.hasOwnProperty,Me=Se.toString,Le=RegExp("^"+Ae.call(Oe).replace(ce,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pe=ve.Symbol,je=ve.Uint8Array,De=Se.propertyIsEnumerable,Ne=Ce.splice,Ie=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object),Re=lt(ve,"DataView"),Be=lt(ve,"Map"),Fe=lt(ve,"Promise"),ze=lt(ve,"Set"),$e=lt(ve,"WeakMap"),Ve=lt(Object,"create"),He=yt(Re),Ue=yt(Be),qe=yt(Fe),We=yt(ze),Ge=yt($e),Ye=Pe?Pe.prototype:void 0,Ke=Ye?Ye.valueOf:void 0,Xe=Ye?Ye.toString:void 0;h.prototype.clear=f,h.prototype["delete"]=d,h.prototype.get=p,h.prototype.has=g,h.prototype.set=v,m.prototype.clear=y,m.prototype["delete"]=b,m.prototype.get=w,m.prototype.has=x,m.prototype.set=_,C.prototype.clear=k,C.prototype["delete"]=S,C.prototype.get=T,C.prototype.has=E,C.prototype.set=A,O.prototype.add=O.prototype.push=M,O.prototype.has=L,P.prototype.clear=j,P.prototype["delete"]=D,P.prototype.get=N,P.prototype.has=I,P.prototype.set=R;var Je=function(t,e){return function(n,r){if(null==n)return n;if(!Ct(n))return t(n,r);for(var i=n.length,o=e?i:-1,s=Object(n);(e?o--:++o<i)&&!1!==r(s[o],o,s););return n}}(z),Ze=function(t){return function(e,n,r){for(var i=-1,o=Object(e),s=r(e),a=s.length;a--;){var l=s[t?a:++i];if(!1===n(o[l],l,o))break}return e}}(),Qe=V;(Re&&Qe(new Re(new ArrayBuffer(1)))!=ie||Be&&Qe(new Be)!=Xt||Fe&&"[object Promise]"!=Qe(Fe.resolve())||ze&&Qe(new ze)!=te||$e&&"[object WeakMap]"!=Qe(new $e))&&(Qe=function(t){var e=Me.call(t),n=e==Zt?t.constructor:void 0,r=n?yt(n):void 0;if(r)switch(r){case He:return ie;case Ue:return Xt;case qe:return"[object Promise]";case We:return te;case Ge:return"[object WeakMap]"}return e});var tn=wt(function(t){t=Mt(t);var e=[];return ae.test(t)&&e.push(""),t.replace(le,function(t,n,r,i){e.push(r?i.replace(ue,"$1"):n||t)}),e});wt.Cache=C;var en=Array.isArray,nn=_e?function(t){return function(e){return t(e)}}(_e):Y;n.exports=bt}).call(e,n(0),n(5)(t))},function(t,e){t.exports={name:"cheerio",version:"0.22.0",description:"Tiny, fast, and elegant implementation of core jQuery designed specifically for the server",author:"Matt Mueller <mattmuelle@gmail.com> (mat.io)",license:"MIT",keywords:["htmlparser","jquery","selector","scraper","parser","html"],repository:{type:"git",url:"git://github.com/cheeriojs/cheerio.git"},main:"./index.js",files:["index.js","lib"],engines:{node:">= 0.6"},dependencies:{"css-select":"~1.2.0","dom-serializer":"~0.1.0",entities:"~1.1.1",htmlparser2:"^3.9.1","lodash.assignin":"^4.0.9","lodash.bind":"^4.1.4","lodash.defaults":"^4.0.1","lodash.filter":"^4.4.0","lodash.flatten":"^4.2.0","lodash.foreach":"^4.3.0","lodash.map":"^4.4.0","lodash.merge":"^4.4.0","lodash.pick":"^4.2.1","lodash.reduce":"^4.4.0","lodash.reject":"^4.4.0","lodash.some":"^4.4.0"},devDependencies:{benchmark:"^2.1.0",coveralls:"^2.11.9","expect.js":"~0.3.1",istanbul:"^0.4.3",jsdom:"^9.2.1",jquery:"^3.0.0",jshint:"^2.9.2",mocha:"^2.5.3",xyz:"~0.5.0"},scripts:{test:"make test"}}},function(t,e,n){t.exports={lex:n(45),parse:n(106),stringify:n(107)}},function(t,e,n){function r(t,e){var n;e||(e={}),x=!!e.comments,C=!!e.position,_=0,k=Array.isArray(t)?t.slice():w(t);var r,i,s=[];for(y&&(n=Date.now());i=o();)(r=d(i))&&s.push(r);return y&&b("ran in",Date.now()-n+"ms"),{type:"stylesheet",stylesheet:{rules:s}}}function i(t,e){e||(e={});for(var n,r=["type","name","value"],i={},o=0;o<r.length;++o)n=r[o],t[n]&&(i[n]=e[n]||t[n]);for(r=Object.keys(e),o=0;o<r.length;++o)n=r[o],i[n]||(i[n]=e[n]);return C&&(i.position={start:t.start,end:t.end}),m&&b("astNode:",JSON.stringify(i,null,2)),i}function o(){var t=k.shift();return m&&b("next:",JSON.stringify(t,null,2)),t}function s(t){_+=1;var e={};switch(t.type){case"font-face":case"viewport":e.declarations=g();break;case"page":e.prefix=t.prefix,e.declarations=g();break;default:e.prefix=t.prefix,e.rules=v()}return i(t,e)}function a(t){return i(t)}function l(t){return i(t)}function c(t){return i(t,{text:t.text})}function u(t){return i(t)}function h(t){return i(t)}function f(t){function e(t){return t.trim()}return i(t,{type:"rule",selectors:t.text.split(",").map(e),declarations:g()})}function d(t){switch(t.type){case"property":return h(t);case"selector":return f(t);case"at-group-end":return void(_-=1);case"media":case"keyframes":return s(t);case"comment":if(x)return c(t);break;case"charset":return l(t);case"import":return a(t);case"namespace":return u(t);case"font-face":case"supports":case"viewport":case"document":case"page":return s(t)}m&&b("parseToken: unexpected token:",JSON.stringify(t))}function p(t){for(var e,n,r=[];(n=o())&&t&&t(n);)(e=d(n))&&r.push(e);return n&&"end"!==n.type&&k.unshift(n),r}function g(){return p(function(t){return"property"===t.type||"comment"===t.type})}function v(){return p(function(){return _})}var m=!1,y=!1,b=n(28)("parse"),w=n(45);t.exports=r;var x,_,C,k},function(t,e,n){function r(t,e){var n;e||(e={}),m=e.indentation||"",v=!!e.compress,g=!!e.comments,v?y=b="":(y="\n",b=" "),x&&(n=Date.now());var r=c(t.stylesheet.rules,d).join("\n").trim();return x&&_("ran in",Date.now()-n+"ms"),r}function i(t){return this.level||(this.level=1),t?void(this.level+=t):v?"":Array(this.level).join(m||"")}function o(t){return"@"+t.type+" "+t.value+";"+y}function s(t){var e="",n=t.prefix||"";t.name&&(e=" "+t.name);var r="page"!==t.type;return"@"+n+t.type+e+b+u(t,r)+y}function a(t){return g?"/*"+(t.text||"")+"*/"+y:""}function l(t){var e;return t.selectors?e=t.selectors.join(","+y):(e="@"+t.type,e+=t.name?" "+t.name:""),i()+e+b+u(t)+y}function c(t,e){return t.reduce(function(t,n){var r="comment"===n.type?a(n):e(n);return r&&t.push(r),t},[])}function u(t,e){var n=t.declarations,r=f;return t.rules&&(n=t.rules,r=l),n=h(n,r),n&&(n=y+n+(e?"":y)),"{"+n+i()+"}"}function h(t,e){if(!t)return"";i(1);var n=c(t,e);return i(-1),n.length?n.join(y):""}function f(t){return"property"===t.type?p(t):void(w&&_("stringifyDeclaration: unexpected node:",JSON.stringify(t)))}function d(t){switch(t.type){case"rule":return l(t);case"media":case"keyframes":return s(t);case"comment":return a(t);case"import":case"charset":case"namespace":return o(t);case"font-face":case"supports":case"viewport":case"document":case"page":return s(t)}w&&_("stringifyNode: unexpected node: "+JSON.stringify(t))}function p(t){var e=t.name?t.name+":"+b:"";return i()+e+t.value+";"}var g,v,m,y,b,w=!1,x=!1,_=n(28)("stringify");t.exports=r},function(t,e,n){"use strict";function r(t,e){this.text=t,this.spec=void 0,this.styleAttribute=e||!1}function i(t){try{return o(t)[0]}catch(t){return[]}}var o=n(109);t.exports=r,r.prototype.parsed=function(){return this.tokens||(this.tokens=i(this.text)),this.tokens},r.prototype.specificity=function(){function t(n,r){for(var o=r||i(n),s=[e?1:0,0,0,0],a=[],l=0;l<o.length;l++){var c=o[l],u=c.pseudos;if(c.id&&s[1]++,c.attributes&&(s[2]+=c.attributes.length),c.classList&&(s[2]+=c.classList.length),c.tag&&"*"!==c.tag&&s[3]++,u){s[3]+=u.length;for(var h=0;h<u.length;h++)"not"===u[h].name&&(a.push(u[h].value),s[3]--)}}for(var f=a.length;f--;)for(var d=t(a[f]),p=4;p--;)s[p]+=d[p];return s}var e=this.styleAttribute;return this.spec||(this.spec=t(this.text,this.parsed())),this.spec}},function(t,e,n){"use strict";var r=/([-.*+?^${}()|[\]\/\\])/g,i=/\\/g,o=function(t){return(t+"").replace(r,"\\$1")},s=function(t){return(t+"").replace(i,"")},a=RegExp("^(?:\\s*(,)\\s*|\\s*(<combinator>+)\\s*|(\\s+)|(<unicode>+|\\*)|\\#(<unicode>+)|\\.(<unicode>+)|\\[\\s*(<unicode1>+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(<unicode>+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)".replace(/<combinator>/,"["+o(">+~`!@$%^&={}\\;</")+"]").replace(/<unicode>/g,"(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])").replace(/<unicode1>/g,"(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])")),l=function(t){this.combinator=t||" ",this.tag="*"};l.prototype.toString=function(){if(!this.raw){var t,e,n="";if(n+=this.tag||"*",this.id&&(n+="#"+this.id),this.classes&&(n+="."+this.classList.join(".")),this.attributes)for(t=0;e=this.attributes[t++];)n+="["+e.name+(e.operator?e.operator+'"'+e.value+'"':"")+"]";if(this.pseudos)for(t=0;e=this.pseudos[t++];)n+=":"+e.name,e.value&&(n+="("+e.value+")");this.raw=n}return this.raw};var c=function(){this.length=0};c.prototype.toString=function(){if(!this.raw){for(var t,e="",n=0;t=this[n++];)1!==n&&(e+=" ")," "!==t.combinator&&(e+=t.combinator+" "),e+=t;this.raw=e}return this.raw};var u=function(t,e,n,r,i,a,u,h,f,d,p,g,v,m,y,b){var w,x;if((e||!this.length)&&(w=this[this.length++]=new c,e))return"";if(w||(w=this[this.length-1]),(n||r||!w.length)&&(x=w[w.length++]=new l(n)),x||(x=w[w.length-1]),i)x.tag=s(i);else if(a)x.id=s(a);else if(u){var _=s(u),C=x.classes||(x.classes={});if(!C[_]){C[_]=o(u);var k=x.classList||(x.classList=[]);k.push(_),k.sort()}}else v?(b=b||y,(x.pseudos||(x.pseudos=[])).push({type:1==g.length?"class":"element",name:s(v),escapedName:o(v),value:b?s(b):null,escapedValue:b?o(b):null})):h&&(p=p?o(p):null,(x.attributes||(x.attributes=[])).push({operator:f,name:s(h),escapedName:o(h),value:p?s(p):null,escapedValue:p?o(p):null}));return""},h=function(t){this.length=0;for(var e,n=this,r=t;t;){if((e=t.replace(a,function(){return u.apply(n,arguments)}))===t)throw new Error(r+" is an invalid expression");t=e}};h.prototype.toString=function(){if(!this.raw){for(var t,e=[],n=0;t=this[n++];)e.push(t);this.raw=e.join(", ")}return this.raw};var f={},d=function(t){return null==t?null:(t=(""+t).replace(/^\s+|\s+$/g,""),f[t]||(f[t]=new h(t)))};t.exports=d},function(t,e,n){"use strict";function r(t,e,n,r,i){this.prop=t,this.value=e,this.selector=n,this.priority=r||0,this.additionalPriority=i||[]}t.exports=r;var i=n(27);r.prototype.compareFunc=function(t){var e=[];e.push.apply(e,this.selector.specificity()),e.push.apply(e,this.additionalPriority),e[0]+=this.priority;var n=[];return n.push.apply(n,t.selector.specificity()),n.push.apply(n,t.additionalPriority),n[0]+=t.priority,i.compareFunc(e,n)},r.prototype.compare=function(t){return 1===this.compareFunc(t)?this:t},r.prototype.toString=function(){return this.prop+": "+this.value.replace(/['"]+/g,"")+";"}},function(t,e,n){"use strict";var r=n(27);t.exports=function(t){function e(e,o,a){function l(t){for(var n=t[0],o=t[1],l=new r.Selector(n),c=l.parsed(),u=i(c),h=0;h<c.length;++h){var f=c[h];if(f.pseudos)for(var d=0;d<f.pseudos.length;++d){var p=f.pseudos[d];if(w.ignoredPseudos.indexOf(p.name)>=0)return}}if(u){var m=c[c.length-1],y=m.pseudos;m.pseudos=s(m.pseudos),n=c.toString(),m.pseudos=y}var b;try{b=e(n)}catch(w){return}b.each(function(){function t(t,e){for(var i=0,o=t.length;i<o;i++)if("property"==t[i].type){var s=t[i].name,l=t[i].value,c=null!==t[i].value.match(/!important$/);c&&!a.preserveImportant&&(l=l.replace(/\s*!important$/,""));var u=[t[i].position.start.line,t[i].position.start.col],h=new r.Property(s,l,e,c?2:0,u),f=n.styleProps[s];w.excludedProperties.indexOf(s)<0&&(f&&f.compare(h)===h||!f)&&(f&&f.selector!==e?delete n.styleProps[s]:f&&(h.nextProp=f),n.styleProps[s]=h)}}var n=this;if(!(n.name&&w.nonVisualElements.indexOf(n.name.toUpperCase())>=0)){if(u){var i="pseudo"+u,s=n[i];s||(s=n[i]=e("<span />").get(0),s.pseudoElementType=u,s.pseudoElementParent=n,n[i]=s),n=s}if(!n.styleProps){if(n.styleProps={},e(n).attr(v)){var c="* { "+e(n).attr(v)+" } ";t(r.parseCSS(c)[0][1],new r.Selector("<style>",(!0)))}g.push(n)}t(o,l)}})}function c(t){var n=(Object.keys(t.styleProps).length,[]);Object.keys(t.styleProps).forEach(function(e){for(var r=t.styleProps[e];void 0!==r;)n.push(r),r=r.nextProp}),n.sort(function(t,e){return t.compareFunc(e)});var r=n.filter(function(t){return"content"!==t.prop}).map(function(t){return t.prop+": "+t.value.replace(/["]/g,"'")+";"}).join(" ");r&&e(t).attr(v,r)}function u(t){if(t.pseudoElementType&&t.styleProps.content){var r=n(t.styleProps.content.value);r.img?(t.name="img",e(t).attr("src",r.img)):e(t).text(r);var i=t.pseudoElementParent;"before"===t.pseudoElementType?e(i).prepend(t):e(i).append(t)}}function h(n,r){if(n.name){var i=n.name.toUpperCase();if(t[r+"Elements"].indexOf(i)>-1)for(var o in n.styleProps)if(n.styleProps[o].prop===r){if(n.styleProps[o].value.match(/px/)){var s=n.styleProps[o].value.replace("px","");return void e(n).attr(r,s)}if(t.tableElements.indexOf(i)>-1&&n.styleProps[o].value.match(/\%/))return void e(n).attr(r,n.styleProps[o].value)}}}function f(t){return 0!==t.indexOf("url(")?t:t.replace(/^url\((["'])?([^"']+)\1\)$/,"$2")}function d(n){if(n.name){var r=n.name.toUpperCase(),i=Object.keys(t.styleToAttribute);if(t.tableElements.indexOf(r)>-1)for(var o in n.styleProps)if(i.indexOf(n.styleProps[o].prop)>-1){var s=t.styleToAttribute[n.styleProps[o].prop],a=n.styleProps[o].value;"background"===s&&(a=f(a)),e(n).attr(s,a)}}}a=a||{};var p=r.parseCSS(o),g=[],v="style";if(a.styleAttributeName&&(v=a.styleAttributeName),p.forEach(l),g.forEach(c),a.inlinePseudoElements&&g.forEach(u),a.applyWidthAttributes&&g.forEach(function(t){h(t,"width")}),a.applyHeightAttributes&&g.forEach(function(t){h(t,"height")}),a.applyAttributesTableElements&&g.forEach(d),a.insertPreservedExtraCss&&a.extraCss){var m=r.getPreservedText(a.extraCss,{mediaQueries:a.preserveMediaQueries,fontFaces:a.preserveFontFaces});if(m){var y=null;!0!==a.insertPreservedExtraCss?y=e(a.insertPreservedExtraCss):(y=e("head"),y.length||(y=e("body")),y.length||(y=e.root())),y.first().append("<style>"+m+"</style>")}}}function n(t){if("none"===t||"normal"===t)return"";var e=t.match(/^\s*url\s*\(\s*(.*?)\s*\)\s*$/i);return e?{img:e[1].replace(/^['"]|['"]$/g,"")}:(t=t.slice(1,t.length-1),t=t.replace(/\\/g,""))}function i(t){if(0!==t.length){var e=t[t.length-1].pseudos;if(e)for(var n=0;n<e.length;n++)if(o(e[n]))return e[n].name}}function o(t){return"before"===t.name||"after"===t.name}function s(t){return t.filter(function(t){return!o(t)})}function a(t,n){n=r.getDefaultOptions(n);var i=c(t,n);return i+="\n"+n.extraCss,e(t,i,n),t}function l(t,e){var n,i,o,s=[],a=t("style");return a.each(function(){if(o=this,n=o.childNodes,1===n.length){if(i=n[0].data,e.applyStyleTags&&void 0===t(o).attr("data-embed")&&s.push(i),e.removeStyleTags&&void 0===t(o).attr("data-embed")){var a=r.getPreservedText(o.childNodes[0].nodeValue,{mediaQueries:e.preserveMediaQueries,fontFaces:e.preserveFontFaces});a?o.childNodes[0].nodeValue=a:t(o).remove()}t(o).removeAttr("data-embed")}}),s}function c(t,e){return l(t,e).join("\n")}return t.ignoredPseudos=["hover","active","focus","visited","link"],t.widthElements=["TABLE","TD","IMG"],t.heightElements=["TABLE","TD","IMG"],t.tableElements=["TABLE","TD","TH","TR","TD","CAPTION","COLGROUP","COL","THEAD","TBODY","TFOOT"],t.nonVisualElements=["HEAD","TITLE","BASE","LINK","STYLE","META","SCRIPT","NOSCRIPT"],t.styleToAttribute={"background-color":"bgcolor","background-image":"background","text-align":"align","vertical-align":"valign"},t.excludedProperties=[],t.juiceDocument=a,t.inlineDocument=e,t}},function(t,e,n){"use strict";var r;void 0!==(r=function(){return function(){var t=(arguments.length>0&&void 0!==arguments[0]&&arguments[0],function e(t,n){t.each(function(t){if("image"==t.get("type")){var r=t.get("src");n?"##"==r&&t.set("src",t.get("src_bkp")):"##"!=r&&(t.set("src_bkp",t.get("src")),t.set("src","##"))}e(t.get("components"),n)})});return{run:function(e){var n=e.getComponents();t(n)},stop:function(e){var n=e.getComponents();t(n,1)}}}}.call(e,n,e,t))&&(t.exports=r)},function(t,e,n){"use strict";var r;void 0!==(r=function(){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="",n="",r=t.editor,i=t.tableStyle||{},o=t.cellStyle||{},s=r.BlockManager;for(var a in i)e+=a+": "+i[a]+"; ";for(var l in o)n+=l+": "+o[l]+"; ";s.getAll().reset(),s.add("sect100",{label:t.sect100BlkLabel,category:t.categoryLabel,attributes:{"class":"gjs-fonts gjs-f-b1"},content:'<table style="'+e+'">\n <tr>\n <td style="'+n+'"></td>\n </tr>\n </table>'}),s.add("sect50",{label:t.sect50BlkLabel,category:t.categoryLabel,attributes:{"class":"gjs-fonts gjs-f-b2"},content:'<table style="'+e+'">\n <tr>\n <td style="'+n+' width: 50%"></td>\n <td style="'+n+' width: 50%"></td>\n </tr>\n </table>'}),s.add("sect30",{label:t.sect30BlkLabel,category:t.categoryLabel,attributes:{"class":"gjs-fonts gjs-f-b3"},content:'<table style="'+e+'">\n <tr>\n <td style="'+n+' width: 33.3333%"></td>\n <td style="'+n+' width: 33.3333%"></td>\n <td style="'+n+' width: 33.3333%"></td>\n </tr>\n </table>'}),s.add("sect37",{label:t.sect37BlkLabel,category:t.categoryLabel,attributes:{"class":"gjs-fonts gjs-f-b37"},content:'<table style="'+e+'">\n <tr>\n <td style="'+n+' width:30%"></td>\n <td style="'+n+' width:70%"></td>\n </tr>\n </table>'}),s.add("button",{label:t.buttonBlkLabel,category:t.categoryLabel,content:'<a class="button">Button</a>',attributes:{"class":"gjs-fonts gjs-f-button"}}),s.add("divider",{label:t.dividerBlkLabel,category:t.categoryLabel,content:'<table style="width: 100%; margin-top: 10px; margin-bottom: 10px;">\n <tr>\n <td class="divider"></td>\n </tr>\n </table>\n <style>\n .divider {\n background-color: rgba(0, 0, 0, 0.1);\n height: 1px;\n }\n </style>',attributes:{"class":"gjs-fonts gjs-f-divider"}}),s.add("text",{label:t.textBlkLabel,category:t.categoryLabel,attributes:{"class":"gjs-fonts gjs-f-text"},content:{type:"text",content:"Insert your text here",style:{padding:"10px"},activeOnRender:1}}),s.add("text-sect",{label:t.textSectionBlkLabel,category:t.categoryLabel,content:'<h1 class="heading">Insert title here</h1><p class="paragraph">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p>',attributes:{"class":"gjs-fonts gjs-f-h1p"}}),s.add("image",{label:t.imageBlkLabel,category:t.categoryLabel,attributes:{"class":"gjs-fonts gjs-f-image"},content:{type:"image",style:{color:"black"},activeOnRender:1}}),s.add("quote",{label:t.quoteBlkLabel,category:t.categoryLabel,content:'<blockquote class="quote">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore ipsum dolor sit</blockquote>',attributes:{"class":"fa fa-quote-right"}}),s.add("link",{label:t.linkBlkLabel,category:t.categoryLabel,attributes:{"class":"fa fa-link"},content:{type:"link",content:"Link",style:{color:"#3b97e3"}}}),s.add("link-block",{label:t.linkBlockBlkLabel,category:t.categoryLabel,attributes:{"class":"fa fa-link"},content:{type:"link",editable:!1,droppable:!0,style:{display:"inline-block",padding:"5px","min-height":"50px","min-width":"50px"}}});var c='<table class="grid-item-card">\n <tr>\n <td class="grid-item-card-cell">\n <img class="grid-item-image" src="http://placehold.it/250x150/78c5d6/fff/" alt="Image"/>\n <table class="grid-item-card-body">\n <tr>\n <td class="grid-item-card-content">\n <h1 class="card-title">Title here</h1>\n <p class="card-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt</p>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>';s.add("grid-items",{label:t.gridItemsBlkLabel,category:t.categoryLabel,content:'<table class="grid-item-row">\n <tr>\n <td class="grid-item-cell2-l">'+c+'</td>\n <td class="grid-item-cell2-r">'+c+"</td>\n </tr>\n </table>",attributes:{"class":"fa fa-th"}});var u='<table class="list-item">\n <tr>\n <td class="list-item-cell">\n <table class="list-item-content">\n <tr class="list-item-row">\n <td class="list-cell-left">\n <img class="list-item-image" src="http://placehold.it/150x150/78c5d6/fff/" alt="Image"/>\n </td>\n <td class="list-cell-right">\n <h1 class="card-title">Title here</h1>\n <p class="card-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt</p>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>';s.add("list-items",{label:t.listItemsBlkLabel,category:t.categoryLabel,content:u+u,attributes:{"class":"fa fa-th-list"}})}}.call(e,n,e,t))&&(t.exports=r)},function(t,e,n){"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var i;void 0!==(i=function(){var t=function(t){t.each(function(t){var e=t.get("attributes");e["data-tooltip-pos"]="bottom",t.set("attributes",e)})};return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.editor,i=n.Panels,o=i.getPanel("options");if(i.addButton("options",{id:e.cmdOpenImport,className:"fa fa-download",command:e.cmdOpenImport,attributes:r({},"title",e.modalTitleImport)}),i.addButton("options",{id:e.cmdTglImages,className:"fa fa-warning",command:e.cmdTglImages,attributes:r({},"title",e.cmtTglImagesLabel)}),o){var s=o.get("buttons");s.each(function(t){var e=t.get("attributes");e["data-tooltip-pos"]="bottom",t.set("attributes",e)});var a=i.addButton("options","preview");a&&s.remove(a)}var l=i.getPanel("commands");if(l){var c=l.get("buttons");c.reset(),c.add([{id:"undo",className:"fa fa-undo",command:"undo",attributes:r({},"title",e.cmdBtnUndoLabel)},{id:"redo",className:"fa fa-repeat",command:"redo",attributes:r({},"title",e.cmdBtnRedoLabel)}]),t(c)}n.getConfig().showDevices=0;var u=i.addPanel({id:"devices-c"}),h=u.get("buttons");u.get("buttons").add([{id:"deviceDesktop",command:"set-device-desktop",className:"fa fa-desktop",attributes:r({},"title",e.cmdBtnDesktopLabel),active:1},{id:"deviceTablet",command:"set-device-tablet",className:"fa fa-tablet",attributes:r({},"title",e.cmdBtnTabletLabel)},{id:"deviceMobile",command:"set-device-mobile",className:"fa fa-mobile",attributes:r({},"title",e.cmdBtnMobileLabel)}]),t(h)}}.call(e,n,e,t))&&(t.exports=i)},function(t,e,n){"use strict";var r;void 0!==(r=function(){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.editor,n=e.StyleManager.getSectors();e.on("load",function(){n.reset(),n.add(t.styleManagerSectors)})}}.call(e,n,e,t))&&(t.exports=r)}])});
//# sourceMappingURL=grapesjs.min.js.map