UNPKG

@silexlabs/silex-cms

Version:

Silex plugin

142 lines (126 loc) 856 kB
/****************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function() { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; function __awaiter(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (g && (g = 0, op[0] && (_ = 0)), _) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } function __spreadArray(to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; } typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { var e = new Error(message); return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; }; var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; function getDefaultExportFromCjs (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } function getAugmentedNamespace(n) { if (Object.prototype.hasOwnProperty.call(n, '__esModule')) return n; var f = n.default; if (typeof f == "function") { var a = function a () { if (this instanceof a) { return Reflect.construct(f, arguments, this.constructor); } return f.apply(this, arguments); }; a.prototype = f.prototype; } else a = {}; Object.defineProperty(a, '__esModule', {value: true}); Object.keys(n).forEach(function (k) { var d = Object.getOwnPropertyDescriptor(n, k); Object.defineProperty(a, k, d.get ? d : { enumerable: true, get: function () { return n[k]; } }); }); return a; } var dist$1 = {exports: {}}; /*! @silexlabs/grapesjs-data-source - 0.1.1-4 */ var dist = dist$1.exports; var hasRequiredDist; function requireDist () { if (hasRequiredDist) return dist$1.exports; hasRequiredDist = 1; (function (module, exports) { !function(e,t){module.exports=t();}('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof window?window:dist,(()=>(()=>{var e={365:e=>{e.exports=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=[],i='string'==typeof e?[e]:e.slice();i[i.length-1]=i[i.length-1].replace(/\r?\n([\t ]*)$/,'');for(var o=0;o<i.length;o++){var s;(s=i[o].match(/\n[\t ]+/g))&&r.push.apply(r,s);}if(r.length){var a=Math.min.apply(Math,r.map((function(e){return e.length-1}))),l=new RegExp("\n[\t ]{"+a+"}",'g');for(o=0;o<i.length;o++)i[o]=i[o].replace(l,'\n');}i[0]=i[0].replace(/^\r?\n/,'');var u=i[0];for(o=0;o<t.length;o++)u+=t[o]+i[o+1];return u};},391:(e,t,n)=>{var r,i;!function(){var o='object'==typeof self&&self.self===self&&self||'object'==typeof n.g&&n.g.global===n.g&&n.g;r=[n(523),n(692),t],i=function(e,t,n){o.Backbone=function(e,t,n,r){var i=e.Backbone,o=Array.prototype.slice;t.VERSION='1.6.1',t.$=r,t.noConflict=function(){return e.Backbone=i,this},t.emulateHTTP=false,t.emulateJSON=false;var s,a=t.Events={},l=/\s+/,u=function(e,t,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++)t=u(e,t,s[a],r[s[a]],o);}else if(r&&l.test(r))for(s=r.split(l);a<s.length;a++)t=e(t,s[a],i,o);else t=e(t,r,i,o);return t};a.on=function(e,t,n){(this._events=u(d,this._events||{},e,t,{context:n,ctx:this,listening:s}),s)&&((this._listeners||(this._listeners={}))[s.id]=s,s.interop=false);return this},a.listenTo=function(e,t,r){if(!e)return this;var i=e._listenId||(e._listenId=n.uniqueId('l')),o=this._listeningTo||(this._listeningTo={}),a=s=o[i];a||(this._listenId||(this._listenId=n.uniqueId('l')),a=s=o[i]=new v(this,e));var l=c(e,t,r,this);if(s=void 0,l)throw l;return a.interop&&a.on(t,r),this};var d=function(e,t,n,r){if(n){var i=e[t]||(e[t]=[]),o=r.context,s=r.ctx,a=r.listening;a&&a.count++,i.push({callback:n,context:o,ctx:o||s,listening:a});}return e},c=function(e,t,n,r){try{e.on(t,n,r);}catch(e){return e}};a.off=function(e,t,n){return this._events?(this._events=u(p,this._events,e,t,{context:n,listeners:this._listeners}),this):this},a.stopListening=function(e,t,r){var i=this._listeningTo;if(!i)return this;for(var o=e?[e._listenId]:n.keys(i),s=0;s<o.length;s++){var a=i[o[s]];if(!a)break;a.obj.off(t,r,this),a.interop&&a.off(t,r);}return n.isEmpty(i)&&(this._listeningTo=void 0),this};var p=function(e,t,r,i){if(e){var o,s=i.context,a=i.listeners,l=0;if(t||s||r){for(o=t?[t]:n.keys(e);l<o.length;l++){var u=e[t=o[l]];if(!u)break;for(var d=[],c=0;c<u.length;c++){var p=u[c];if(r&&r!==p.callback&&r!==p.callback._callback||s&&s!==p.context)d.push(p);else {var h=p.listening;h&&h.off(t,r);}}d.length?e[t]=d:delete e[t];}return e}for(o=n.keys(a);l<o.length;l++)a[o[l]].cleanup();}};a.once=function(e,t,n){var r=u(h,{},e,t,this.off.bind(this));return 'string'==typeof e&&null==n&&(t=void 0),this.on(r,t,n)},a.listenToOnce=function(e,t,n){var r=u(h,{},t,n,this.stopListening.bind(this,e));return this.listenTo(e,r)};var h=function(e,t,r,i){if(r){var o=e[t]=n.once((function(){i(t,o),r.apply(this,arguments);}));o._callback=r;}return e};a.trigger=function(e){if(!this._events)return this;for(var t=Math.max(0,arguments.length-1),n=Array(t),r=0;r<t;r++)n[r]=arguments[r+1];return u(f,this._events,e,void 0,n),this};var f=function(e,t,n,r){if(e){var i=e[t],o=e.all;i&&o&&(o=o.slice()),i&&g(i,r),o&&g(o,[t].concat(r));}return e},g=function(e,t){var n,r=-1,i=e.length,o=t[0],s=t[1],a=t[2];switch(t.length){case 0:for(;++r<i;)(n=e[r]).callback.call(n.ctx);return;case 1:for(;++r<i;)(n=e[r]).callback.call(n.ctx,o);return;case 2:for(;++r<i;)(n=e[r]).callback.call(n.ctx,o,s);return;case 3:for(;++r<i;)(n=e[r]).callback.call(n.ctx,o,s,a);return;default:for(;++r<i;)(n=e[r]).callback.apply(n.ctx,t);return}},v=function(e,t){this.id=e._listenId,this.listener=e,this.obj=t,this.interop=true,this.count=0,this._events=void 0;};v.prototype.on=a.on,v.prototype.off=function(e,t){var n;this.interop?(this._events=u(p,this._events,e,t,{context:void 0,listeners:void 0}),n=!this._events):(this.count--,n=0===this.count),n&&this.cleanup();},v.prototype.cleanup=function(){delete this.listener._listeningTo[this.obj._listenId],this.interop||delete this.obj._listeners[this.id];},a.bind=a.on,a.unbind=a.off,n.extend(t,a);var y=t.Model=function(e,t){var r=e||{};t||(t={}),this.preinitialize.apply(this,arguments),this.cid=n.uniqueId(this.cidPrefix),this.attributes={},t.collection&&(this.collection=t.collection),t.parse&&(r=this.parse(r,t)||{});var i=n.result(this,'defaults');r=n.defaults(n.extend({},i,r),i),this.set(r,t),this.changed={},this.initialize.apply(this,arguments);};n.extend(y.prototype,a,{changed:null,validationError:null,idAttribute:'id',cidPrefix:'c',preinitialize:function(){},initialize:function(){},toJSON:function(e){return n.clone(this.attributes)},sync:function(){return t.sync.apply(this,arguments)},get:function(e){return this.attributes[e]},escape:function(e){return n.escape(this.get(e))},has:function(e){return null!=this.get(e)},matches:function(e){return !!n.iteratee(e,this)(this.attributes)},set:function(e,t,r){if(null==e)return this;var i;if('object'==typeof e?(i=e,r=t):(i={})[e]=t,r||(r={}),!this._validate(i,r))return false;var o=r.unset,s=r.silent,a=[],l=this._changing;this._changing=true,l||(this._previousAttributes=n.clone(this.attributes),this.changed={});var u=this.attributes,d=this.changed,c=this._previousAttributes;for(var p in i)t=i[p],n.isEqual(u[p],t)||a.push(p),n.isEqual(c[p],t)?delete d[p]:d[p]=t,o?delete u[p]:u[p]=t;if(this.idAttribute in i){var h=this.id;this.id=this.get(this.idAttribute),this.id!==h&&this.trigger('changeId',this,h,r);}if(!s){a.length&&(this._pending=r);for(var f=0;f<a.length;f++)this.trigger('change:'+a[f],this,u[a[f]],r);}if(l)return this;if(!s)for(;this._pending;)r=this._pending,this._pending=false,this.trigger('change',this,r);return this._pending=false,this._changing=false,this},unset:function(e,t){return this.set(e,void 0,n.extend({},t,{unset:true}))},clear:function(e){var t={};for(var r in this.attributes)t[r]=void 0;return this.set(t,n.extend({},e,{unset:true}))},hasChanged:function(e){return null==e?!n.isEmpty(this.changed):n.has(this.changed,e)},changedAttributes:function(e){if(!e)return !!this.hasChanged()&&n.clone(this.changed);var t,r=this._changing?this._previousAttributes:this.attributes,i={};for(var o in e){var s=e[o];n.isEqual(r[o],s)||(i[o]=s,t=true);}return !!t&&i},previous:function(e){return null!=e&&this._previousAttributes?this._previousAttributes[e]:null},previousAttributes:function(){return n.clone(this._previousAttributes)},fetch:function(e){e=n.extend({parse:true},e);var t=this,r=e.success;return e.success=function(n){var i=e.parse?t.parse(n,e):n;if(!t.set(i,e))return false;r&&r.call(e.context,t,n,e),t.trigger('sync',t,n,e);},G(this,e),this.sync('read',this,e)},save:function(e,t,r){var i;null==e||'object'==typeof e?(i=e,r=t):(i={})[e]=t;var o=(r=n.extend({validate:true,parse:true},r)).wait;if(i&&!o){if(!this.set(i,r))return false}else if(!this._validate(i,r))return false;var s=this,a=r.success,l=this.attributes;r.success=function(e){s.attributes=l;var t=r.parse?s.parse(e,r):e;if(o&&(t=n.extend({},i,t)),t&&!s.set(t,r))return false;a&&a.call(r.context,s,e,r),s.trigger('sync',s,e,r);},G(this,r),i&&o&&(this.attributes=n.extend({},l,i));var u=this.isNew()?'create':r.patch?'patch':'update';'patch'!==u||r.attrs||(r.attrs=i);var d=this.sync(u,this,r);return this.attributes=l,d},destroy:function(e){e=e?n.clone(e):{};var t=this,r=e.success,i=e.wait,o=function(){t.stopListening(),t.trigger('destroy',t,t.collection,e);};e.success=function(n){i&&o(),r&&r.call(e.context,t,n,e),t.isNew()||t.trigger('sync',t,n,e);};var s=false;return this.isNew()?n.defer(e.success):(G(this,e),s=this.sync('delete',this,e)),i||o(),s},url:function(){var e=n.result(this,'urlRoot')||n.result(this.collection,'url')||Q();if(this.isNew())return e;var t=this.get(this.idAttribute);return e.replace(/[^\/]$/,'$&/')+encodeURIComponent(t)},parse:function(e,t){return e},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return !this.has(this.idAttribute)},isValid:function(e){return this._validate({},n.extend({},e,{validate:true}))},_validate:function(e,t){if(!t.validate||!this.validate)return true;e=n.extend({},this.attributes,e);var r=this.validationError=this.validate(e,t)||null;return !r||(this.trigger('invalid',this,r,n.extend(t,{validationError:r})),false)}});var m=t.Collection=function(e,t){t||(t={}),this.preinitialize.apply(this,arguments),t.model&&(this.model=t.model),void 0!==t.comparator&&(this.comparator=t.comparator),this._reset(),this.initialize.apply(this,arguments),e&&this.reset(e,n.extend({silent:true},t));},b={add:true,remove:true,merge:true},x={add:true,remove:false},w=function(e,t,n){n=Math.min(Math.max(n,0),e.length);var r,i=Array(e.length-n),o=t.length;for(r=0;r<i.length;r++)i[r]=e[r+n];for(r=0;r<o;r++)e[r+n]=t[r];for(r=0;r<i.length;r++)e[r+o+n]=i[r];};n.extend(m.prototype,a,{model:y,preinitialize:function(){},initialize:function(){},toJSON:function(e){return this.map((function(t){return t.toJSON(e)}))},sync:function(){return t.sync.apply(this,arguments)},add:function(e,t){return this.set(e,n.extend({merge:false},t,x))},remove:function(e,t){t=n.extend({},t);var r=!n.isArray(e);e=r?[e]:e.slice();var i=this._removeModels(e,t);return !t.silent&&i.length&&(t.changes={added:[],merged:[],removed:i},this.trigger('update',this,t)),r?i[0]:i},set:function(e,t){if(null!=e){(t=n.extend({},b,t)).parse&&!this._isModel(e)&&(e=this.parse(e,t)||[]);var r=!n.isArray(e);e=r?[e]:e.slice();var i=t.at;null!=i&&(i=+i),i>this.length&&(i=this.length),i<0&&(i+=this.length+1);var o,s,a=[],l=[],u=[],d=[],c={},p=t.add,h=t.merge,f=t.remove,g=false,v=this.comparator&&null==i&&false!==t.sort,y=n.isString(this.comparator)?this.comparator:null;for(s=0;s<e.length;s++){o=e[s];var m=this.get(o);if(m){if(h&&o!==m){var x=this._isModel(o)?o.attributes:o;t.parse&&(x=m.parse(x,t)),m.set(x,t),u.push(m),v&&!g&&(g=m.hasChanged(y));}c[m.cid]||(c[m.cid]=true,a.push(m)),e[s]=m;}else p&&(o=e[s]=this._prepareModel(o,t))&&(l.push(o),this._addReference(o,t),c[o.cid]=true,a.push(o));}if(f){for(s=0;s<this.length;s++)c[(o=this.models[s]).cid]||d.push(o);d.length&&this._removeModels(d,t);}var _=false,$=!v&&p&&f;if(a.length&&$?(_=this.length!==a.length||n.some(this.models,(function(e,t){return e!==a[t]})),this.models.length=0,w(this.models,a,0),this.length=this.models.length):l.length&&(v&&(g=true),w(this.models,l,null==i?this.length:i),this.length=this.models.length),g&&this.sort({silent:true}),!t.silent){for(s=0;s<l.length;s++)null!=i&&(t.index=i+s),(o=l[s]).trigger('add',o,this,t);(g||_)&&this.trigger('sort',this,t),(l.length||d.length||u.length)&&(t.changes={added:l,removed:d,merged:u},this.trigger('update',this,t));}return r?e[0]:e}},reset:function(e,t){t=t?n.clone(t):{};for(var r=0;r<this.models.length;r++)this._removeReference(this.models[r],t);return t.previousModels=this.models,this._reset(),e=this.add(e,n.extend({silent:true},t)),t.silent||this.trigger('reset',this,t),e},push:function(e,t){return this.add(e,n.extend({at:this.length},t))},pop:function(e){var t=this.at(this.length-1);return this.remove(t,e)},unshift:function(e,t){return this.add(e,n.extend({at:0},t))},shift:function(e){var t=this.at(0);return this.remove(t,e)},slice:function(){return o.apply(this.models,arguments)},get:function(e){if(null!=e)return this._byId[e]||this._byId[this.modelId(this._isModel(e)?e.attributes:e,e.idAttribute)]||e.cid&&this._byId[e.cid]},has:function(e){return null!=this.get(e)},at:function(e){return e<0&&(e+=this.length),this.models[e]},where:function(e,t){return this[t?'find':'filter'](e)},findWhere:function(e){return this.where(e,true)},sort:function(e){var t=this.comparator;if(!t)throw new Error('Cannot sort a set without a comparator');e||(e={});var r=t.length;return n.isFunction(t)&&(t=t.bind(this)),1===r||n.isString(t)?this.models=this.sortBy(t):this.models.sort(t),e.silent||this.trigger('sort',this,e),this},pluck:function(e){return this.map(e+'')},fetch:function(e){var t=(e=n.extend({parse:true},e)).success,r=this;return e.success=function(n){var i=e.reset?'reset':'set';r[i](n,e),t&&t.call(e.context,r,n,e),r.trigger('sync',r,n,e);},G(this,e),this.sync('read',this,e)},create:function(e,t){var r=(t=t?n.clone(t):{}).wait;if(!(e=this._prepareModel(e,t)))return false;r||this.add(e,t);var i=this,o=t.success;return t.success=function(e,t,n){r&&(e.off('error',i._forwardPristineError,i),i.add(e,n)),o&&o.call(n.context,e,t,n);},r&&e.once('error',this._forwardPristineError,this),e.save(null,t),e},parse:function(e,t){return e},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(e,t){return e[t||this.model.prototype.idAttribute||'id']},values:function(){return new $(this,S)},keys:function(){return new $(this,k)},entries:function(){return new $(this,E)},_reset:function(){this.length=0,this.models=[],this._byId={};},_prepareModel:function(e,t){return this._isModel(e)?(e.collection||(e.collection=this),e):((t=t?n.clone(t):{}).collection=this,(r=this.model.prototype?new this.model(e,t):this.model(e,t)).validationError?(this.trigger('invalid',this,r.validationError,t),false):r);var r;},_removeModels:function(e,t){for(var n=[],r=0;r<e.length;r++){var i=this.get(e[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,i.idAttribute);null!=s&&delete this._byId[s],t.silent||(t.index=o,i.trigger('remove',i,this,t)),n.push(i),this._removeReference(i,t);}}return e.length>0&&!t.silent&&delete t.index,n},_isModel:function(e){return e instanceof y},_addReference:function(e,t){this._byId[e.cid]=e;var n=this.modelId(e.attributes,e.idAttribute);null!=n&&(this._byId[n]=e),e.on('all',this._onModelEvent,this);},_removeReference:function(e,t){delete this._byId[e.cid];var n=this.modelId(e.attributes,e.idAttribute);null!=n&&delete this._byId[n],this===e.collection&&delete e.collection,e.off('all',this._onModelEvent,this);},_onModelEvent:function(e,t,n,r){if(t){if(('add'===e||'remove'===e)&&n!==this)return;if('destroy'===e&&this.remove(t,r),'changeId'===e){var i=this.modelId(t.previousAttributes(),t.idAttribute),o=this.modelId(t.attributes,t.idAttribute);null!=i&&delete this._byId[i],null!=o&&(this._byId[o]=t);}}this.trigger.apply(this,arguments);},_forwardPristineError:function(e,t,n){this.has(e)||this._onModelEvent('error',e,t,n);}});var _='function'==typeof Symbol&&Symbol.iterator;_&&(m.prototype[_]=m.prototype.values);var $=function(e,t){this._collection=e,this._kind=t,this._index=0;},S=1,k=2,E=3;_&&($.prototype[_]=function(){return this});$.prototype.next=function(){if(this._collection){if(this._index<this._collection.length){var e,t=this._collection.at(this._index);if(this._index++,this._kind===S)e=t;else {var n=this._collection.modelId(t.attributes,t.idAttribute);e=this._kind===k?n:[n,t];}return {value:e,done:false}}this._collection=void 0;}return {value:void 0,done:true}};var T=t.View=function(e){this.cid=n.uniqueId('view'),this.preinitialize.apply(this,arguments),n.extend(this,n.pick(e,C)),this._ensureElement(),this.initialize.apply(this,arguments);},A=/^(\S+)\s*(.*)$/,C=['model','collection','el','id','attributes','className','tagName','events'];n.extend(T.prototype,a,{tagName:'div',$:function(e){return this.$el.find(e)},preinitialize:function(){},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove();},setElement:function(e){return this.undelegateEvents(),this._setElement(e),this.delegateEvents(),this},_setElement:function(e){this.$el=e instanceof t.$?e:t.$(e),this.el=this.$el[0];},delegateEvents:function(e){if(e||(e=n.result(this,'events')),!e)return this;for(var t in this.undelegateEvents(),e){var r=e[t];if(n.isFunction(r)||(r=this[r]),r){var i=t.match(A);this.delegate(i[1],i[2],r.bind(this));}}return this},delegate:function(e,t,n){return this.$el.on(e+'.delegateEvents'+this.cid,t,n),this},undelegateEvents:function(){return this.$el&&this.$el.off('.delegateEvents'+this.cid),this},undelegate:function(e,t,n){return this.$el.off(e+'.delegateEvents'+this.cid,t,n),this},_createElement:function(e){return document.createElement(e)},_ensureElement:function(){if(this.el)this.setElement(n.result(this,'el'));else {var e=n.extend({},n.result(this,'attributes'));this.id&&(e.id=n.result(this,'id')),this.className&&(e['class']=n.result(this,'className')),this.setElement(this._createElement(n.result(this,'tagName'))),this._setAttributes(e);}},_setAttributes:function(e){this.$el.attr(e);}});var j=function(e,t,n,r){switch(t){case 1:return function(){return e[n](this[r])};case 2:return function(t){return e[n](this[r],t)};case 3:return function(t,i){return e[n](this[r],I(t,this),i)};case 4:return function(t,i,o){return e[n](this[r],I(t,this),i,o)};default:return function(){var t=o.call(arguments);return t.unshift(this[r]),e[n].apply(e,t)}}},O=function(e,t,r,i){n.each(r,(function(n,r){t[r]&&(e.prototype[r]=j(t,n,r,i));}));},I=function(e,t){return n.isFunction(e)?e:n.isObject(e)&&!t._isModel(e)?N(e):n.isString(e)?function(t){return t.get(e)}:e},N=function(e){var t=n.matches(e);return function(e){return t(e.attributes)}},D={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},R={keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1};n.each([[m,D,'models'],[y,R,'attributes']],(function(e){var t=e[0],r=e[1],i=e[2];t.mixin=function(e){var r=n.reduce(n.functions(e),(function(e,t){return e[t]=0,e}),{});O(t,e,r,i);},O(t,n,r,i);})),t.sync=function(e,r,i){var o=P[e];n.defaults(i||(i={}),{emulateHTTP:t.emulateHTTP,emulateJSON:t.emulateJSON});var s={type:o,dataType:'json'};if(i.url||(s.url=n.result(r,'url')||Q()),null!=i.data||!r||'create'!==e&&'update'!==e&&'patch'!==e||(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(e){if(e.setRequestHeader('X-HTTP-Method-Override',o),a)return a.apply(this,arguments)};}'GET'===s.type||i.emulateJSON||(s.processData=false);var l=i.error;i.error=function(e,t,n){i.textStatus=t,i.errorThrown=n,l&&l.call(i.context,e,t,n);};var u=i.xhr=t.ajax(n.extend(s,i));return r.trigger('request',r,u,i),u};var P={create:'POST',update:'PUT',patch:'PATCH',delete:'DELETE',read:'GET'};t.ajax=function(){return t.$.ajax.apply(t.$,arguments)};var M=t.Router=function(e){e||(e={}),this.preinitialize.apply(this,arguments),e.routes&&(this.routes=e.routes),this._bindRoutes(),this.initialize.apply(this,arguments);},L=/\((.*?)\)/g,q=/(\(\?)?:\w+/g,F=/\*\w+/g,H=/[\-{}\[\]+?.,\\\^$|#\s]/g;n.extend(M.prototype,a,{preinitialize:function(){},initialize:function(){},route:function(e,r,i){n.isRegExp(e)||(e=this._routeToRegExp(e)),n.isFunction(r)&&(i=r,r=''),i||(i=this[r]);var o=this;return t.history.route(e,(function(n){var s=o._extractParameters(e,n);false!==o.execute(i,s,r)&&(o.trigger.apply(o,['route:'+r].concat(s)),o.trigger('route',r,s),t.history.trigger('route',o,r,s));})),this},execute:function(e,t,n){e&&e.apply(this,t);},navigate:function(e,n){return t.history.navigate(e,n),this},_bindRoutes:function(){if(this.routes){this.routes=n.result(this,'routes');for(var e,t=n.keys(this.routes);null!=(e=t.pop());)this.route(e,this.routes[e]);}},_routeToRegExp:function(e){return e=e.replace(H,'\\$&').replace(L,'(?:$1)?').replace(q,(function(e,t){return t?e:'([^/?]+)'})).replace(F,'([^?]*?)'),new RegExp('^'+e+'(?:\\?([\\s\\S]*))?$')},_extractParameters:function(e,t){var r=e.exec(t).slice(1);return n.map(r,(function(e,t){return t===r.length-1?e||null:e?decodeURIComponent(e):null}))}});var U=t.History=function(){this.handlers=[],this.checkUrl=this.checkUrl.bind(this),'undefined'!=typeof window&&(this.location=window.location,this.history=window.history);},B=/^[#\/]|\s+$/g,z=/^\/+|\/+$/g,W=/#.*$/;U.started=false,n.extend(U.prototype,a,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,'$&/')===this.root&&!this.getSearch()},matchRoot:function(){return this.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+'/'===this.root},decodeFragment:function(e){return decodeURI(e.replace(/%25/g,'%2525'))},getSearch:function(){var e=this.location.href.replace(/#.*/,'').match(/\?.+/);return e?e[0]:''},getHash:function(e){var t=(e||this).location.href.match(/#(.*)$/);return t?t[1]:''},getPath:function(){var e=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return '/'===e.charAt(0)?e.slice(1):e},getFragment:function(e){return null==e&&(e=this._usePushState||!this._wantsHashChange?this.getPath():this.getHash()),e.replace(B,'')},start:function(e){if(U.started)throw new Error('Backbone.history has already been started');if(U.started=true,this.options=n.extend({root:'/'},this.options,e),this.root=this.options.root,this._trailingSlash=this.options.trailingSlash,this._wantsHashChange=false!==this.options.hashChange,this._hasHashChange='onhashchange'in window&&(void 0===document.documentMode||document.documentMode>7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=('/'+this.root+'/').replace(z,'/'),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var t=this.root.slice(0,-1)||'/';return this.location.replace(t+'#'+this.getPath()),true}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:true});}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(e,t){return attachEvent('on'+e,t)};if(this._usePushState?o('popstate',this.checkUrl,false):this._useHashChange&&!this.iframe?o('hashchange',this.checkUrl,false):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var e=window.removeEventListener||function(e,t){return detachEvent('on'+e,t)};this._usePushState?e('popstate',this.checkUrl,false):this._useHashChange&&!this.iframe&&e('hashchange',this.checkUrl,false),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),U.started=false;},route:function(e,t){this.handlers.unshift({route:e,callback:t});},checkUrl:function(e){var t=this.getFragment();if(t===this.fragment&&this.iframe&&(t=this.getHash(this.iframe.contentWindow)),t===this.fragment)return !this.matchRoot()&&this.notfound();this.iframe&&this.navigate(t),this.loadUrl();},loadUrl:function(e){return this.matchRoot()?(e=this.fragment=this.getFragment(e),n.some(this.handlers,(function(t){if(t.route.test(e))return t.callback(e),true}))||this.notfound()):this.notfound()},notfound:function(){return this.trigger('notfound'),false},navigate:function(e,t){if(!U.started)return false;t&&true!==t||(t={trigger:!!t}),e=this.getFragment(e||'');var n=this.root;this._trailingSlash||''!==e&&'?'!==e.charAt(0)||(n=n.slice(0,-1)||'/');var r=n+e;e=e.replace(W,'');var i=this.decodeFragment(e);if(this.fragment!==i){if(this.fragment=i,this._usePushState)this.history[t.replace?'replaceState':'pushState']({},document.title,r);else {if(!this._wantsHashChange)return this.location.assign(r);if(this._updateHash(this.location,e,t.replace),this.iframe&&e!==this.getHash(this.iframe.contentWindow)){var o=this.iframe.contentWindow;t.replace||(o.document.open(),o.document.close()),this._updateHash(o.location,e,t.replace);}}return t.trigger?this.loadUrl(e):void 0}},_updateHash:function(e,t,n){if(n){var r=e.href.replace(/(javascript:|#).*$/,'');e.replace(r+'#'+t);}else e.hash='#'+t;}}),t.history=new U;var V=function(e,t){var r,i=this;return r=e&&n.has(e,'constructor')?e.constructor:function(){return i.apply(this,arguments)},n.extend(r,i,t),r.prototype=n.create(i.prototype,e),r.prototype.constructor=r,r.__super__=i.prototype,r};y.extend=m.extend=M.extend=T.extend=U.extend=V;var Q=function(){throw new Error('A "url" property or function must be specified')},G=function(e,t){var n=t.error;t.error=function(r){n&&n.call(t.context,e,r,t),e.trigger('error',e,r,t);};};return t._debug=function(){return {root:e,_:n}},t}(o,n,e,t);}.apply(t,r),void 0===i||(e.exports=i);}();},523:(e,t,n)=>{n.r(t),n.d(t,{VERSION:()=>i,after:()=>Rt,all:()=>tn,allKeys:()=>ve,any:()=>nn,assign:()=>Re,before:()=>Pt,bind:()=>$t,bindAll:()=>Et,chain:()=>bt,chunk:()=>qn,clone:()=>qe,collect:()=>Jt,compact:()=>An,compose:()=>Dt,constant:()=>Y,contains:()=>rn,countBy:()=>mn,create:()=>Le,debounce:()=>Ot,default:()=>zn,defaults:()=>Pe,defer:()=>Ct,delay:()=>At,detect:()=>Vt,difference:()=>jn,drop:()=>En,each:()=>Gt,escape:()=>at,every:()=>tn,extend:()=>De,extendOwn:()=>Re,filter:()=>Zt,find:()=>Vt,findIndex:()=>Ft,findKey:()=>Lt,findLastIndex:()=>Ht,findWhere:()=>Qt,first:()=>kn,flatten:()=>Cn,foldl:()=>Xt,foldr:()=>Yt,forEach:()=>Gt,functions:()=>Ie,get:()=>ze,groupBy:()=>vn,has:()=>We,head:()=>kn,identity:()=>Ve,include:()=>rn,includes:()=>rn,indexBy:()=>yn,indexOf:()=>zt,initial:()=>Sn,inject:()=>Xt,intersection:()=>Dn,invert:()=>Oe,invoke:()=>on,isArguments:()=>J,isArray:()=>V,isArrayBuffer:()=>M,isBoolean:()=>A,isDataView:()=>W,isDate:()=>N,isElement:()=>C,isEmpty:()=>le,isEqual:()=>ge,isError:()=>R,isFinite:()=>K,isFunction:()=>F,isMap:()=>ke,isMatch:()=>ue,isNaN:()=>X,isNull:()=>E,isNumber:()=>I,isObject:()=>k,isRegExp:()=>D,isSet:()=>Te,isString:()=>O,isSymbol:()=>P,isTypedArray:()=>ie,isUndefined:()=>T,isWeakMap:()=>Ee,isWeakSet:()=>Ae,iteratee:()=>Xe,keys:()=>ae,last:()=>Tn,lastIndexOf:()=>Wt,map:()=>Jt,mapObject:()=>Ze,matcher:()=>Qe,matches:()=>Qe,max:()=>ln,memoize:()=>Tt,methods:()=>Ie,min:()=>un,mixin:()=>Hn,negate:()=>Nt,noop:()=>et,now:()=>it,object:()=>Mn,omit:()=>$n,once:()=>Mt,pairs:()=>je,partial:()=>_t,partition:()=>bn,pick:()=>_n,pluck:()=>sn,property:()=>Ge,propertyOf:()=>tt,random:()=>rt,range:()=>Ln,reduce:()=>Xt,reduceRight:()=>Yt,reject:()=>en,rest:()=>En,restArguments:()=>S,result:()=>vt,sample:()=>pn,select:()=>Zt,shuffle:()=>hn,size:()=>xn,some:()=>nn,sortBy:()=>fn,sortedIndex:()=>Ut,tail:()=>En,take:()=>kn,tap:()=>Fe,template:()=>gt,templateSettings:()=>ut,throttle:()=>jt,times:()=>nt,toArray:()=>cn,toPath:()=>He,transpose:()=>Rn,unescape:()=>lt,union:()=>Nn,uniq:()=>In,unique:()=>In,uniqueId:()=>mt,unzip:()=>Rn,values:()=>Ce,where:()=>an,without:()=>On,wrap:()=>It,zip:()=>Pn});var r={};n.r(r),n.d(r,{VERSION:()=>i,after:()=>Rt,all:()=>tn,allKeys:()=>ve,any:()=>nn,assign:()=>Re,before:()=>Pt,bind:()=>$t,bindAll:()=>Et,chain:()=>bt,chunk:()=>qn,clone:()=>qe,collect:()=>Jt,compact:()=>An,compose:()=>Dt,constant:()=>Y,contains:()=>rn,countBy:()=>mn,create:()=>Le,debounce:()=>Ot,default:()=>Un,defaults:()=>Pe,defer:()=>Ct,delay:()=>At,detect:()=>Vt,difference:()=>jn,drop:()=>En,each:()=>Gt,escape:()=>at,every:()=>tn,extend:()=>De,extendOwn:()=>Re,filter:()=>Zt,find:()=>Vt,findIndex:()=>Ft,findKey:()=>Lt,findLastIndex:()=>Ht,findWhere:()=>Qt,first:()=>kn,flatten:()=>Cn,foldl:()=>Xt,foldr:()=>Yt,forEach:()=>Gt,functions:()=>Ie,get:()=>ze,groupBy:()=>vn,has:()=>We,head:()=>kn,identity:()=>Ve,include:()=>rn,includes:()=>rn,indexBy:()=>yn,indexOf:()=>zt,initial:()=>Sn,inject:()=>Xt,intersection:()=>Dn,invert:()=>Oe,invoke:()=>on,isArguments:()=>J,isArray:()=>V,isArrayBuffer:()=>M,isBoolean:()=>A,isDataView:()=>W,isDate:()=>N,isElement:()=>C,isEmpty:()=>le,isEqual:()=>ge,isError:()=>R,isFinite:()=>K,isFunction:()=>F,isMap:()=>ke,isMatch:()=>ue,isNaN:()=>X,isNull:()=>E,isNumber:()=>I,isObject:()=>k,isRegExp:()=>D,isSet:()=>Te,isString:()=>O,isSymbol:()=>P,isTypedArray:()=>ie,isUndefined:()=>T,isWeakMap:()=>Ee,isWeakSet:()=>Ae,iteratee:()=>Xe,keys:()=>ae,last:()=>Tn,lastIndexOf:()=>Wt,map:()=>Jt,mapObject:()=>Ze,matcher:()=>Qe,matches:()=>Qe,max:()=>ln,memoize:()=>Tt,methods:()=>Ie,min:()=>un,mixin:()=>Hn,negate:()=>Nt,noop:()=>et,now:()=>it,object:()=>Mn,omit:()=>$n,once:()=>Mt,pairs:()=>je,partial:()=>_t,partition:()=>bn,pick:()=>_n,pluck:()=>sn,property:()=>Ge,propertyOf:()=>tt,random:()=>rt,range:()=>Ln,reduce:()=>Xt,reduceRight:()=>Yt,reject:()=>en,rest:()=>En,restArguments:()=>S,result:()=>vt,sample:()=>pn,select:()=>Zt,shuffle:()=>hn,size:()=>xn,some:()=>nn,sortBy:()=>fn,sortedIndex:()=>Ut,tail:()=>En,take:()=>kn,tap:()=>Fe,template:()=>gt,templateSettings:()=>ut,throttle:()=>jt,times:()=>nt,toArray:()=>cn,toPath:()=>He,transpose:()=>Rn,unescape:()=>lt,union:()=>Nn,uniq:()=>In,unique:()=>In,uniqueId:()=>mt,unzip:()=>Rn,values:()=>Ce,where:()=>an,without:()=>On,wrap:()=>It,zip:()=>Pn});var i='1.13.7',o='object'==typeof self&&self.self===self&&self||'object'==typeof commonjsGlobal&&commonjsGlobal.global===commonjsGlobal&&commonjsGlobal||Function('return this')()||{},s=Array.prototype,a=Object.prototype,l='undefined'!=typeof Symbol?Symbol.prototype:null,u=s.push,d=s.slice,c=a.toString,p=a.hasOwnProperty,h='undefined'!=typeof ArrayBuffer,f='undefined'!=typeof DataView,g=Array.isArray,v=Object.keys,y=Object.create,m=h&&ArrayBuffer.isView,b=isNaN,x=isFinite,w=!{toString:null}.propertyIsEnumerable('toString'),_=['valueOf','isPrototypeOf','toString','propertyIsEnumerable','hasOwnProperty','toLocaleString'],$=Math.pow(2,53)-1;function S(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+t];switch(t){case 0:return e.call(this,r);case 1:return e.call(this,arguments[0],r);case 2:return e.call(this,arguments[0],arguments[1],r)}var o=Array(t+1);for(i=0;i<t;i++)o[i]=arguments[i];return o[t]=r,e.apply(this,o)}}function k(e){var t=typeof e;return 'function'===t||'object'===t&&!!e}function E(e){return null===e}function T(e){return void 0===e}function A(e){return true===e||false===e||'[object Boolean]'===c.call(e)}function C(e){return !(!e||1!==e.nodeType)}function j(e){var t='[object '+e+']';return function(e){return c.call(e)===t}}const O=j('String'),I=j('Number'),N=j('Date'),D=j('RegExp'),R=j('Error'),P=j('Symbol'),M=j('ArrayBuffer');var L=j('Function'),q=o.document&&o.document.childNodes;'object'!=typeof Int8Array&&'function'!=typeof q&&(L=function(e){return 'function'==typeof e||false});const F=L,H=j('Object');var U=f&&(!/\[native code\]/.test(String(DataView))||H(new DataView(new ArrayBuffer(8)))),B='undefined'!=typeof Map&&H(new Map),z=j('DataView');const W=U?function(e){return null!=e&&F(e.getInt8)&&M(e.buffer)}:z,V=g||j('Array');function Q(e,t){return null!=e&&p.call(e,t)}var G=j('Arguments');!function(){G(arguments)||(G=function(e){return Q(e,'callee')});}();const J=G;function K(e){return !P(e)&&x(e)&&!isNaN(parseFloat(e))}function X(e){return I(e)&&b(e)}function Y(e){return function(){return e}}function Z(e){return function(t){var n=e(t);return 'number'==typeof n&&n>=0&&n<=$}}function ee(e){return function(t){return null==t?void 0:t[e]}}const te=ee('byteLength'),ne=Z(te);var re=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;const ie=h?function(e){return m?m(e)&&!W(e):ne(e)&&re.test(c.call(e))}:Y(false),oe=ee('length');function se(e,t){t=function(e){for(var t={},n=e.length,r=0;r<n;++r)t[e[r]]=true;return {contains:function(e){return true===t[e]},push:function(n){return t[n]=true,e.push(n)}}}(t);var n=_.length,r=e.constructor,i=F(r)&&r.prototype||a,o='constructor';for(Q(e,o)&&!t.contains(o)&&t.push(o);n--;)(o=_[n])in e&&e[o]!==i[o]&&!t.contains(o)&&t.push(o);}function ae(e){if(!k(e))return [];if(v)return v(e);var t=[];for(var n in e)Q(e,n)&&t.push(n);return w&&se(e,t),t}function le(e){if(null==e)return true;var t=oe(e);return 'number'==typeof t&&(V(e)||O(e)||J(e))?0===t:0===oe(ae(e))}function ue(e,t){var n=ae(t),r=n.length;if(null==e)return !r;for(var i=Object(e),o=0;o<r;o++){var s=n[o];if(t[s]!==i[s]||!(s in i))return false}return true}function de(e){return e instanceof de?e:this instanceof de?void(this._wrapped=e):new de(e)}function ce(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,te(e))}de.VERSION=i,de.prototype.value=function(){return this._wrapped},de.prototype.valueOf=de.prototype.toJSON=de.prototype.value,de.prototype.toString=function(){return String(this._wrapped)};var pe='[object DataView]';function he(e,t,n,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return false;if(e!=e)return t!=t;var i=typeof e;return ('function'===i||'object'===i||'object'==typeof t)&&fe(e,t,n,r)}function fe(e,t,n,r){e instanceof de&&(e=e._wrapped),t instanceof de&&(t=t._wrapped);var i=c.call(e);if(i!==c.call(t))return false;if(U&&'[object Object]'==i&&W(e)){if(!W(t))return false;i=pe;}switch(i){case '[object RegExp]':case '[object String]':return ''+e==''+t;case '[object Number]':return +e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case '[object Date]':case '[object Boolean]':return +e==+t;case '[object Symbol]':return l.valueOf.call(e)===l.valueOf.call(t);case '[object ArrayBuffer]':case pe:return fe(ce(e),ce(t),n,r)}var o='[object Array]'===i;if(!o&&ie(e)){if(te(e)!==te(t))return false;if(e.buffer===t.buffer&&e.byteOffset===t.byteOffset)return true;o=true;}if(!o){if('object'!=typeof e||'object'!=typeof t)return false;var s=e.constructor,a=t.constructor;if(s!==a&&!(F(s)&&s instanceof s&&F(a)&&a instanceof a)&&'constructor'in e&&'constructor'in t)return false}r=r||[];for(var u=(n=n||[]).length;u--;)if(n[u]===e)return r[u]===t;if(n.push(e),r.push(t),o){if((u=e.length)!==t.length)return false;for(;u--;)if(!he(e[u],t[u],n,r))return false}else {var d,p=ae(e);if(u=p.length,ae(t).length!==u)return false;for(;u--;)if(!Q(t,d=p[u])||!he(e[d],t[d],n,r))return false}return n.pop(),r.pop(),true}function ge(e,t){return he(e,t)}function ve(e){if(!k(e))return [];var t=[];for(var n in e)t.push(n);return w&&se(e,t),t}function ye(e){var t=oe(e);return function(n){if(null==n)return false;var r=ve(n);if(oe(r))return false;for(var i=0;i<t;i++)if(!F(n[e[i]]))return false;return e!==$e||!F(n[me])}}var me='forEach',be='has',xe=['clear','delete'],we=['get',be,'set'],_e=xe.concat(me,we),$e=xe.concat(we),Se=['add'].concat(xe,me,be);const ke=B?ye(_e):j('Map'),Ee=B?ye($e):j('WeakMap'),Te=B?ye(Se):j('Set'),Ae=j('WeakSet');function Ce(e){for(var t=ae(e),n=t.length,r=Array(n),i=0;i<n;i++)r[i]=e[t[i]];return r}function je(e){for(var t=ae(e),n=t.length,r=Array(n),i=0;i<n;i++)r[i]=[t[i],e[t[i]]];return r}function Oe(e){for(var t={},n=ae(e),r=0,i=n.length;r<i;r++)t[e[n[r]]]=n[r];return t}function Ie(e){var t=[];for(var n in e)F(e[n])&&t.push(n);return t.sort()}function Ne(e,t){return function(n){var r=arguments.length;if(t&&(n=Object(n)),r<2||null==n)return n;for(var i=1;i<r;i++)for(var o=arguments[i],s=e(o),a=s.length,l=0;l<a;l++){var u=s[l];t&&void 0!==n[u]||(n[u]=o[u]);}return n}}const De=Ne(ve),Re=Ne(ae),Pe=Ne(ve,true);function Me(e){if(!k(e))return {};if(y)return y(e);var t=function(){};t.prototype=e;var n=new t;return t.prototype=null,n}function Le(e,t){var n=Me(e);return t&&Re(n,t),n}function qe(e){return k(e)?V(e)?e.slice():De({},e):e}function Fe(e,t){return t(e),e}function He(e){return V(e)?e:[e]}function Ue(e){return de.toPath(e)}function Be(e,t){for(var n=t.length,r=0;r<n;r++){if(null==e)return;e=e[t[r]];}return n?e:void 0}function ze(e,t,n){var r=Be(e,Ue(t));return T(r)?n:r}function We(e,t){for(var n=(t=Ue(t)).length,r=0;r<n;r++){var i=t[r];if(!Q(e,i))return false;e=e[i];}return !!n}function Ve(e){return e}function Qe(e){return e=Re({},e),function(t){return ue(t,e)}}function Ge(e){return e=Ue(e),function(t){return Be(t,e)}}function Je(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,o){return e.call(t,n,r,i,o)}}return function(){return e.apply(t,arguments)}}function Ke(e,t,n){return null==e?Ve:F(e)?Je(e,t,n):k(e)&&!V(e)?Qe(e):Ge(e)}function Xe(e,t){return Ke(e,t,1/0)}function Ye(e,t,n){return de.iteratee!==Xe?de.iteratee(e,t):Ke(e,t,n)}function Ze(e,t,n){t=Ye(t,n);for(var r=ae(e),i=r.length,o={},s=0;s<i;s++){var a=r[s];o[a]=t(e[a],a,e);}return o}function et(){}function tt(e){return null==e?et:function(t){return ze(e,t)}}function nt(e,t,n){var r=Array(Math.max(0,e));t=Je(t,n,1);for(var i=0;i<e;i++)r[i]=t(i);return r}function rt(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}de.toPath=He,de.iteratee=Xe;const it=Date.now||function(){return (new Date).getTime()};function ot(e){var t=function(t){return e[t]},n='(?:'+ae(e).join('|')+')',r=RegExp(n),i=RegExp(n,'g');return function(e){return e=null==e?'':''+e,r.test(e)?e.replace(i,t):e}}const st={'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#x27;','`':'&#x60;'},at=ot(st),lt=ot(Oe(st)),ut=de.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var dt=/(.)^/,ct={"'":"'",'\\':'\\','\r':'r','\n':'n','\u2028':'u2028','\u2029':'u2029'},pt=/\\|'|\r|\n|\u2028|\u2029/g;function ht(e){return '\\'+ct[e]}var ft=/^\s*(\w|\$)+\s*$/;function gt(e,t,n){!t&&n&&(t=n),t=Pe({},t,de.templateSettings);var r=RegExp([(t.escape||dt).source,(t.interpolate||dt).source,(t.evaluate||dt).source].join('|')+'|$','g'),i=0,o="__p+='";e.replace(r,(function(t,n,r,s,a){return o+=e.slice(i,a).replace(pt,ht),i=a+t.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":s&&(o+="';\n"+s+"\n__p+='"),t})),o+="';\n";var s,a=t.variable;if(a){if(!ft.test(a))throw new Error('variable is not a bare identifier: '+a)}else o='with(obj||{}){\n'+o+'}\n',a='obj';o="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+o+'return __p;\n';try{s=new Function(a,'_',o);}catch(e){throw e.source=o,e}var l=function(e){return s.call(this,e,de)};return l.source='function('+a+'){\n'+o+'}',l}function vt(e,t,n){var r=(t=Ue(t)).length;if(!r)return F(n)?n.call(e):n;for(var i=0;i<r;i++){var o=null==e?void 0:e[t[i]];void 0===o&&(o=n,i=r),e=F(o)?o.call(e):o;}return e}var yt=0;function mt(e){var t=++yt+'';return e?e+t:t}function bt(e){var t=de(e);return t._chain=true,t}function xt(e,t,n,r,i){if(!(r instanceof t))return e.apply(n,i);var o=Me(e.prototype),s=e.apply(o,i);return k(s)?s:o}var wt=S((function(e,t){var n=wt.placeholder,r=function(){for(var i=0,o=t.length,s=Array(o),a=0;a<o;a++)s[a]=t[a]===n?arguments[i++]:t[a];for(;i<arguments.length;)s.push(arguments[i++]);return xt(e,r,this,this,s)};return r}));wt.placeholder=de;const _t=wt,$t=S((function(e,t,n){if(!F(e))throw new TypeError('Bind must be called on a function');var r=S((function(i){return xt(e,r,t,this,n.concat(i))}));return r})),St=Z(oe);function kt(e,t,n,r){if(r=r||[],t||0===t){if(t<=0)return r.concat(e)}else t=1/0;for(var i=r.length,o=0,s=oe(e);o<s;o++){var a=e[o];if(St(a)&&(V(a)||J(a)))if(t>1)kt(a,t-1,n,r),i=r.length;else for(var l=0,u=a.length;l<u;)r[i++]=a[l++];else n||(r[i++]=a);}return r}const Et=S((function(e,t){var n=(t=kt(t,false,false)).length;if(n<1)throw new Error('bindAll must be passed function names');for(;n--;){var r=t[n];e[r]=$t(e[r],e);}return e}));function Tt(e,t){var n=function(r){var i=n.cache,o=''+(t?t.apply(this,arguments):r);return Q(i,o)||(i[o]=e.apply(this,arguments)),i[o]};return n.cache={},n}const At=S((function(e,t,n){return setTimeout((function(){return e.apply(null,n)}),t)})),Ct=_t(At,de,1);function jt(e,t,n){var r,i,o,s,a=0;n||(n={});var l=function(){a=false===n.leading?0:it(),r=null,s=e.apply(i,o),r||(i=o=null);},u=function(){var u=it();a||false!==n.leading||(a=u);var d=t-(u-a);return i=this,o=arguments,d<=0||d>t?(r&&(clearTimeout(r),r=null),a=u,s=e.apply(i,o),r||(i=o=null)):r||false===n.trailing||(r=setTimeout(l,d)),s};return u.cancel=function(){clearTimeout(r),a=0,r=i=o=null;},u}function Ot(e,t,n){var r,i,o,s,a,l=function(){var u=it()-i;t>u?r=setTimeout(l,t-u):(r=null,n||(s=e.apply(a,o)),r||(o=a=null));},u=S((function(u){return a=this,o=u,i=it(),r||(r=setTimeout(l,t),n&&(s=e.apply(a,o))),s}));return u.cancel=function(){clearTimeout(r),r=o=a=null;},u}function It(e,t){return _t(t,e)}function Nt(e){return function(){return !e.apply(this,arguments)}}function Dt(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}}function Rt(e,t){return function(){if(--e<1)return t.apply(this,arguments)}}function Pt(e,t){var n;return function(){return --e>0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}}const Mt=_t(Pt,2);function Lt(e,t,n){t=Ye(t,n);for(var r,i=ae(e),o=0,s=i.length;o<s;o++)if(t(e[r=i[o]],r,e))return r}function qt(e){return function(t,n,r){n=Ye(n,r);for(var i=oe(t),o=e>0?0:i-1;o>=0&&o<i;o+=e)if(n(t[o],o,t))return o;return -1}}const Ft=qt(1),Ht=qt(-1);function Ut(e,t,n,r){for(var i=(n=Ye(n,r,1))(t),o=0,s=oe(e);o<s;){var a=Math.floor((o+s)/2);n(e[a])<i?o=a+1:s=a;}return o}function Bt(e,t,n){return function(r,i,o){var s=0,a=oe(r);if('number'==typeof o)e>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 r[o=n(r,i)]===i?o:-1;if(i!=i)return (o=t(d.call(r,s,a),X))>=0?o+s:-1;for(o=e>0?s:a-1;o>=0&&o<a;o+=e)if(r[o]===i)return o;return -1}}const zt=Bt(1,Ft,Ut),Wt=Bt(-1,Ht);function Vt(e,t,n){var r=(St(e)?Ft:Lt)(e,t,n);if(void 0!==r&&-1!==r)return e[r]}function Qt(e,t){return Vt(e,Qe(t))}function Gt(e,t,n){var r,i;if(t=Je(t,n),St(e))for(r=0,i=e.length;r<i;r++)t(e[r],r,e);else {var o=ae(e);for(r=0,i=o.length;r<i;r++)t(e[o[r]],o[r],e);}return e}function Jt(e,t,n){t=Ye(t,n);for(var r=!St(e)&&ae(e),i=(r||e).length,o=Array(i),s=0;s<i;s++){var a=r?r[s]:s;o[s]=t(e[a],a,e);}return o}function Kt(e){return function(t,n,r,i){var o=arguments.length>=3;return function(t,n,r,i){var o=!St(t)&&ae(t),s=(o||t).length,a=e>0?0:s-1;for(i||(r=t[o?o[a]:a],a+=e);a>=0&&a<s;a+=e){var l=o?o[a]:a;r=n(r,t[l],l,t);}return r}(t,Je(n,i,4),r,o)}}const Xt=Kt(1),Yt=Kt(-1);function Zt(e,t,n){var r=[];return t=Ye(t,n),Gt(e,(function(e,n,i){t(e,n,i)&&r.push(e);})),r}function en(e,t,n){return Zt(e,Nt(Ye(t)),n)}function tn(e,t,n){t=Ye(t,n);for(var r=!St(e)&&ae(e),i=(r||e).length,o=0;o<i;o++){var s=r?r[o]:o;if(!t(e[s],s,e))return false}return true}function nn(e,t,n){t=Ye(t,n);for(var r=!St(e)&&ae(e),i=(r||e).length,o=0;o<i;o++){var s=r?r[o]:o;if(t(e[s],s,e))return true}return false}function rn(e,t,n,r){return St(e)||(e=Ce(e)),('number'!=typeof n||r)&&(n=0),zt(e,t,n)>=0}const on=S((function(e,t,n){var r,i;return F(t)?i=t:(t=Ue(t),r=t.slice(0,-1),t=t[t.length-1]),Jt(e,(function(e){var o=i;if(!o){if(r&&r.length&&(e=Be(e,r)),null==e)return;o=e[t];}return null==o?o:o.apply(e,n)}))}));func