@converse/skeletor 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).skeletor=e()}(this,(function(){"use strict";var t="object"==typeof global&&global&&global.Object===Object&&global,e="object"==typeof self&&self&&self.Object===Object&&self,n=t||e||Function("return this")(),r=n.Symbol,i=Object.prototype,o=i.hasOwnProperty,s=i.toString,c=r?r.toStringTag:void 0;var u=Object.prototype.toString;var a=r?r.toStringTag:void 0;function l(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?function(t){var e=o.call(t,c),n=t[c];try{t[c]=void 0;var r=!0}catch(t){}var i=s.call(t);return r&&(e?t[c]=n:delete t[c]),i}(t):function(t){return u.call(t)}(t)}function h(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function f(t){if(!h(t))return!1;var e=l(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var d,p=n["__core-js_shared__"],v=(d=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||""))?"Symbol(src)_1."+d:"";var g=Function.prototype.toString;function b(t){if(null!=t){try{return g.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var y=/^\[object .+?Constructor\]$/,m=Function.prototype,_=Object.prototype,j=m.toString,w=_.hasOwnProperty,x=RegExp("^"+j.call(w).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function O(t){return!(!h(t)||(e=t,v&&v in e))&&(f(t)?x:y).test(b(t));var e}function A(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return O(n)?n:void 0}var E=function(){try{var t=A(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();function S(t,e,n){"__proto__"==e&&E?E(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function I(t,e){return t===e||t!=t&&e!=e}var P=Object.prototype.hasOwnProperty;function M(t,e,n){var r=t[e];P.call(t,e)&&I(r,n)&&(void 0!==n||e in t)||S(t,e,n)}function k(t,e,n,r){var i=!n;n||(n={});for(var o=-1,s=e.length;++o<s;){var c=e[o],u=r?r(n[c],t[c],c,n,t):void 0;void 0===u&&(u=t[c]),i?S(n,c,u):M(n,c,u)}return n}function H(t){return null!=t&&"object"==typeof t}function N(t){return H(t)&&"[object Arguments]"==l(t)}var $=Object.prototype,T=$.hasOwnProperty,R=$.propertyIsEnumerable,z=N(function(){return arguments}())?N:function(t){return H(t)&&T.call(t,"callee")&&!R.call(t,"callee")},C=Array.isArray;var U="object"==typeof exports&&exports&&!exports.nodeType&&exports,L=U&&"object"==typeof module&&module&&!module.nodeType&&module,B=L&&L.exports===U?n.Buffer:void 0,F=(B?B.isBuffer:void 0)||function(){return!1},W=/^(?:0|[1-9]\d*)$/;function D(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&W.test(t))&&t>-1&&t%1==0&&t<e}function V(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}var q={};function J(t){return function(e){return t(e)}}q["[object Float32Array]"]=q["[object Float64Array]"]=q["[object Int8Array]"]=q["[object Int16Array]"]=q["[object Int32Array]"]=q["[object Uint8Array]"]=q["[object Uint8ClampedArray]"]=q["[object Uint16Array]"]=q["[object Uint32Array]"]=!0,q["[object Arguments]"]=q["[object Array]"]=q["[object ArrayBuffer]"]=q["[object Boolean]"]=q["[object DataView]"]=q["[object Date]"]=q["[object Error]"]=q["[object Function]"]=q["[object Map]"]=q["[object Number]"]=q["[object Object]"]=q["[object RegExp]"]=q["[object Set]"]=q["[object String]"]=q["[object WeakMap]"]=!1;var G="object"==typeof exports&&exports&&!exports.nodeType&&exports,Z=G&&"object"==typeof module&&module&&!module.nodeType&&module,K=Z&&Z.exports===G&&t.process,Q=function(){try{var t=Z&&Z.require&&Z.require("util").types;return t||K&&K.binding&&K.binding("util")}catch(t){}}(),X=Q&&Q.isTypedArray,Y=X?J(X):function(t){return H(t)&&V(t.length)&&!!q[l(t)]},tt=Object.prototype.hasOwnProperty;function et(t,e){var n=C(t),r=!n&&z(t),i=!n&&!r&&F(t),o=!n&&!r&&!i&&Y(t),s=n||r||i||o,c=s?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],u=c.length;for(var a in t)!e&&!tt.call(t,a)||s&&("length"==a||i&&("offset"==a||"parent"==a)||o&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||D(a,u))||c.push(a);return c}var nt=Object.prototype;function rt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||nt)}function it(t,e){return function(n){return t(e(n))}}var ot=it(Object.keys,Object),st=Object.prototype.hasOwnProperty;function ct(t){if(!rt(t))return ot(t);var e=[];for(var n in Object(t))st.call(t,n)&&"constructor"!=n&&e.push(n);return e}function ut(t){return null!=t&&V(t.length)&&!f(t)}function at(t){return ut(t)?et(t):ct(t)}function lt(t,e){return t&&k(e,at(e),t)}var ht=Object.create,ft=function(){function t(){}return function(e){if(!h(e))return{};if(ht)return ht(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function dt(t){return t}function pt(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)}var vt=Math.max;function gt(t,e,n){return e=vt(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=vt(r.length-e,0),s=Array(o);++i<o;)s[i]=r[e+i];i=-1;for(var c=Array(e+1);++i<e;)c[i]=r[i];return c[e]=n(s),pt(t,this,c)}}function bt(t){return function(){return t}}var yt=E?function(t,e){return E(t,"toString",{configurable:!0,enumerable:!1,value:bt(e),writable:!0})}:dt,mt=Date.now;var _t,jt,wt,xt=(_t=yt,jt=0,wt=0,function(){var t=mt(),e=16-(t-wt);if(wt=t,e>0){if(++jt>=800)return arguments[0]}else jt=0;return _t.apply(void 0,arguments)});function Ot(t,e){return xt(gt(t,e,dt),t+"")}function At(t,e,n){if(!h(n))return!1;var r=typeof e;return!!("number"==r?ut(n)&&D(e,n.length):"string"==r&&e in n)&&I(n[e],t)}var Et=Object.prototype.hasOwnProperty;function St(t){if(!h(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=rt(t),n=[];for(var r in t)("constructor"!=r||!e&&Et.call(t,r))&&n.push(r);return n}function It(t){return ut(t)?et(t,!0):St(t)}var Pt,Mt=(Pt=function(t,e){k(e,It(e),t)},Ot((function(t,e){var n=-1,r=e.length,i=r>1?e[r-1]:void 0,o=r>2?e[2]:void 0;for(i=Pt.length>3&&"function"==typeof i?(r--,i):void 0,o&&At(e[0],e[1],o)&&(i=r<3?void 0:i,r=1),t=Object(t);++n<r;){var s=e[n];s&&Pt(t,s,n,i)}return t}))),kt=Object.prototype.hasOwnProperty;function Ht(t,e){return null!=t&&kt.call(t,e)}function Nt(t){return"symbol"==typeof t||H(t)&&"[object Symbol]"==l(t)}var $t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Tt=/^\w*$/;function Rt(t,e){if(C(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Nt(t))||(Tt.test(t)||!$t.test(t)||null!=e&&t in Object(e))}var zt=A(Object,"create");var Ct=Object.prototype.hasOwnProperty;var Ut=Object.prototype.hasOwnProperty;function Lt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Bt(t,e){for(var n=t.length;n--;)if(I(t[n][0],e))return n;return-1}Lt.prototype.clear=function(){this.__data__=zt?zt(null):{},this.size=0},Lt.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Lt.prototype.get=function(t){var e=this.__data__;if(zt){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return Ct.call(e,t)?e[t]:void 0},Lt.prototype.has=function(t){var e=this.__data__;return zt?void 0!==e[t]:Ut.call(e,t)},Lt.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=zt&&void 0===e?"__lodash_hash_undefined__":e,this};var Ft=Array.prototype.splice;function Wt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Wt.prototype.clear=function(){this.__data__=[],this.size=0},Wt.prototype.delete=function(t){var e=this.__data__,n=Bt(e,t);return!(n<0)&&(n==e.length-1?e.pop():Ft.call(e,n,1),--this.size,!0)},Wt.prototype.get=function(t){var e=this.__data__,n=Bt(e,t);return n<0?void 0:e[n][1]},Wt.prototype.has=function(t){return Bt(this.__data__,t)>-1},Wt.prototype.set=function(t,e){var n=this.__data__,r=Bt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var Dt=A(n,"Map");function Vt(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function qt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}qt.prototype.clear=function(){this.size=0,this.__data__={hash:new Lt,map:new(Dt||Wt),string:new Lt}},qt.prototype.delete=function(t){var e=Vt(this,t).delete(t);return this.size-=e?1:0,e},qt.prototype.get=function(t){return Vt(this,t).get(t)},qt.prototype.has=function(t){return Vt(this,t).has(t)},qt.prototype.set=function(t,e){var n=Vt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};function Jt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function n(){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)||o,s};return n.cache=new(Jt.Cache||qt),n}Jt.Cache=qt;var Gt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zt=/\\(\\)?/g,Kt=function(t){var e=Jt(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Gt,(function(t,n,r,i){e.push(r?i.replace(Zt,"$1"):n||t)})),e}));function Qt(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var Xt=r?r.prototype:void 0,Yt=Xt?Xt.toString:void 0;function te(t){if("string"==typeof t)return t;if(C(t))return Qt(t,te)+"";if(Nt(t))return Yt?Yt.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ee(t){return null==t?"":te(t)}function ne(t,e){return C(t)?t:Rt(t,e)?[t]:Kt(ee(t))}function re(t){if("string"==typeof t||Nt(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ie(t,e,n){for(var r=-1,i=(e=ne(e,t)).length,o=!1;++r<i;){var s=re(e[r]);if(!(o=null!=t&&n(t,s)))break;t=t[s]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&V(i)&&D(s,i)&&(C(t)||z(t))}function oe(t,e){return null!=t&&ie(t,e,Ht)}function se(t,e,n){var r=-1,i=(e=ne(e,t)).length;for(i||(i=1,t=void 0);++r<i;){var o=null==t?void 0:t[re(e[r])];void 0===o&&(r=i,o=n),t=f(o)?o.call(t):o}return t}function ce(t,e){const n=this;let r;return r=t&&oe(t,"constructor")?t.constructor:function(){return n.apply(this,arguments)},Mt(r,n,e),r.prototype=function(t,e){var n=ft(t);return null==e?n:lt(n,e)}(n.prototype,t),r.prototype.constructor=r,r.__super__=n.prototype,r}function ue(){const t={isResolved:!1,isPending:!0,isRejected:!1},e=new Promise((e,n)=>{t.resolve=e,t.reject=n});return Object.assign(e,t),e.then((function(t){return e.isResolved=!0,e.isPending=!1,e.isRejected=!1,t}),(function(t){throw e.isResolved=!1,e.isPending=!1,e.isRejected=!0,t})),e}function ae(){throw new Error('A "url" property or function must be specified')}function le(t,e){const n=e.error;e.error=function(r){n&&n.call(e.context,t,r,e),t.trigger("error",t,r,e)}}const he={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};function fe(t){const e=se(t,"browserStorage")||se(t.collection,"browserStorage");return e?e.sync():de}function de(t,e,n={}){const r={type:he[t],dataType:"json"};n.url||(r.url=se(e,"url")||ae()),null!=n.data||!e||"create"!==t&&"update"!==t&&"patch"!==t||(r.contentType="application/json",r.data=JSON.stringify(n.attrs||e.toJSON(n))),"GET"!==r.type&&(r.processData=!1);const i=n.error;n.error=function(t,e,r){n.textStatus=e,n.errorThrown=r,i&&i.call(n.context,t,e,r)};const o=n.xhr=pe(Mt(r,n));return e.trigger("request",e,o,n),o}function pe(){return fetch.apply(this,arguments)}var ve=A(n,"DataView"),ge=A(n,"Promise"),be=A(n,"Set"),ye=A(n,"WeakMap"),me=b(ve),_e=b(Dt),je=b(ge),we=b(be),xe=b(ye),Oe=l;(ve&&"[object DataView]"!=Oe(new ve(new ArrayBuffer(1)))||Dt&&"[object Map]"!=Oe(new Dt)||ge&&"[object Promise]"!=Oe(ge.resolve())||be&&"[object Set]"!=Oe(new be)||ye&&"[object WeakMap]"!=Oe(new ye))&&(Oe=function(t){var e=l(t),n="[object Object]"==e?t.constructor:void 0,r=n?b(n):"";if(r)switch(r){case me:return"[object DataView]";case _e:return"[object Map]";case je:return"[object Promise]";case we:return"[object Set]";case xe:return"[object WeakMap]"}return e});var Ae=Oe,Ee=Object.prototype.hasOwnProperty;function Se(t){if(null==t)return!0;if(ut(t)&&(C(t)||"string"==typeof t||"function"==typeof t.splice||F(t)||Y(t)||z(t)))return!t.length;var e=Ae(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(rt(t))return!ct(t).length;for(var n in t)if(Ee.call(t,n))return!1;return!0}var Ie=/\s/;var Pe=/^\s+/;function Me(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&Ie.test(t.charAt(e)););return e}(t)+1).replace(Pe,""):t}var ke=/^[-+]0x[0-9a-f]+$/i,He=/^0b[01]+$/i,Ne=/^0o[0-7]+$/i,$e=parseInt;function Te(t){return t?(t=function(t){if("number"==typeof t)return t;if(Nt(t))return NaN;if(h(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=h(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Me(t);var n=He.test(t);return n||Ne.test(t)?$e(t.slice(2),n?2:8):ke.test(t)?NaN:+t}(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function Re(t){var e=Te(t),n=e%1;return e==e?n?e-n:e:0}function ze(t){return function(t,e){var n;if("function"!=typeof e)throw new TypeError("Expected a function");return t=Re(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}(2,t)}var Ce=0;function Ue(t){var e=++Ce;return ee(t)+e}const Le={},Be=/\s+/;let Fe;const We=function t(e,n,r,i,o){let s,c=0;if(r&&"object"==typeof r){void 0!==i&&"context"in o&&void 0===o.context&&(o.context=i);for(s=at(r);c<s.length;c++)n=t(e,n,s[c],r[s[c]],o)}else if(r&&Be.test(r))for(s=r.split(Be);c<s.length;c++)n=e(n,s[c],i,o);else n=e(n,r,i,o);return n};Le.on=function(t,e,n){if(this._events=We(De,this._events||{},t,e,{context:n,ctx:this,listening:Fe}),Fe){(this._listeners||(this._listeners={}))[Fe.id]=Fe,Fe.interop=!1}return this},Le.listenTo=function(t,e,n){if(!t)return this;const r=t._listenId||(t._listenId=Ue("l")),i=this._listeningTo||(this._listeningTo={});let o=Fe=i[r];o||(this._listenId||(this._listenId=Ue("l")),o=Fe=i[r]=new Ke(this,t));const s=Ve(t,e,n,this);if(Fe=void 0,s)throw s;return o.interop&&o.on(e,n),this};const De=function(t,e,n,r){if(n){const i=t[e]||(t[e]=[]),o=r.context,s=r.ctx,c=r.listening;c&&c.count++,i.push({callback:n,context:o,ctx:o||s,listening:c})}return t},Ve=function(t,e,n,r){try{t.on(e,n,r)}catch(t){return t}};Le.off=function(t,e,n){return this._events?(this._events=We(qe,this._events,t,e,{context:n,listeners:this._listeners}),this):this},Le.stopListening=function(t,e,n){const r=this._listeningTo;if(!r)return this;const i=t?[t._listenId]:at(r);for(let t=0;t<i.length;t++){const o=r[i[t]];if(!o)break;o.obj.off(e,n,this),o.interop&&o.off(e,n)}return Se(r)&&(this._listeningTo=void 0),this};const qe=function(t,e,n,r){if(!t)return;const i=r.context,o=r.listeners;let s,c=0;if(e||i||n){for(s=e?[e]:at(t);c<s.length;c++){const r=t[e=s[c]];if(!r)break;const o=[];for(let t=0;t<r.length;t++){const s=r[t];if(n&&n!==s.callback&&n!==s.callback._callback||i&&i!==s.context)o.push(s);else{const t=s.listening;t&&t.off(e,n)}}o.length?t[e]=o:delete t[e]}return t}for(s=at(o);c<s.length;c++)o[s[c]].cleanup()};Le.once=function(t,e,n){const r=We(Je,{},t,e,this.off.bind(this));return"string"==typeof t&&null==n&&(e=void 0),this.on(r,e,n)},Le.listenToOnce=function(t,e,n){const r=We(Je,{},e,n,this.stopListening.bind(this,t));return this.listenTo(t,r)};const Je=function(t,e,n,r){if(n){const i=t[e]=ze((function(){r(e,i),n.apply(this,arguments)}));i._callback=n}return t};Le.trigger=function(t){if(!this._events)return this;const e=Math.max(0,arguments.length-1),n=Array(e);for(let t=0;t<e;t++)n[t]=arguments[t+1];return We(Ge,this._events,t,void 0,n),this};const Ge=function(t,e,n,r){if(t){const n=t[e];let i=t.all;n&&i&&(i=i.slice()),n&&Ze(n,r),i&&Ze(i,[e].concat(r))}return t},Ze=function(t,e){let n,r=-1;const i=t.length,o=e[0],s=e[1],c=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,c);return;default:for(;++r<i;)(n=t[r]).callback.apply(n.ctx,e);return}},Ke=function(t,e){this.id=t._listenId,this.listener=t,this.obj=e,this.interop=!0,this.count=0,this._events=void 0};Ke.prototype.on=Le.on,Ke.prototype.off=function(t,e){let n;this.interop?(this._events=We(qe,this._events,t,e,{context:void 0,listeners:void 0}),n=!this._events):(this.count--,n=0===this.count),n&&this.cleanup()},Ke.prototype.cleanup=function(){delete this.listener._listeningTo[this.obj._listenId],this.interop||delete this.obj._listeners[this.id]},Le.bind=Le.on,Le.unbind=Le.off;function Qe(t){var e=this.__data__=new Wt(t);this.size=e.size}Qe.prototype.clear=function(){this.__data__=new Wt,this.size=0},Qe.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Qe.prototype.get=function(t){return this.__data__.get(t)},Qe.prototype.has=function(t){return this.__data__.has(t)},Qe.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Wt){var r=n.__data__;if(!Dt||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new qt(r)}return n.set(t,e),this.size=n.size,this};var Xe="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ye=Xe&&"object"==typeof module&&module&&!module.nodeType&&module,tn=Ye&&Ye.exports===Xe?n.Buffer:void 0,en=tn?tn.allocUnsafe:void 0;function nn(){return[]}var rn=Object.prototype.propertyIsEnumerable,on=Object.getOwnPropertySymbols,sn=on?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}(on(t),(function(e){return rn.call(t,e)})))}:nn;function cn(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var un=it(Object.getPrototypeOf,Object),an=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)cn(e,sn(t)),t=un(t);return e}:nn;function ln(t,e,n){var r=e(t);return C(t)?r:cn(r,n(t))}function hn(t){return ln(t,at,sn)}function fn(t){return ln(t,It,an)}var dn=Object.prototype.hasOwnProperty;var pn=n.Uint8Array;function vn(t){var e=new t.constructor(t.byteLength);return new pn(e).set(new pn(t)),e}var gn=/\w*$/;var bn=r?r.prototype:void 0,yn=bn?bn.valueOf:void 0;function mn(t,e,n){var r,i=t.constructor;switch(e){case"[object ArrayBuffer]":return vn(t);case"[object Boolean]":case"[object Date]":return new i(+t);case"[object DataView]":return function(t,e){var n=e?vn(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(t,e){var n=e?vn(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}(t,n);case"[object Map]":return new i;case"[object Number]":case"[object String]":return new i(t);case"[object RegExp]":return function(t){var e=new t.constructor(t.source,gn.exec(t));return e.lastIndex=t.lastIndex,e}(t);case"[object Set]":return new i;case"[object Symbol]":return r=t,yn?Object(yn.call(r)):{}}}var _n=Q&&Q.isMap,jn=_n?J(_n):function(t){return H(t)&&"[object Map]"==Ae(t)};var wn=Q&&Q.isSet,xn=wn?J(wn):function(t){return H(t)&&"[object Set]"==Ae(t)},On={};function An(t,e,n,r,i,o){var s,c=1&e,u=2&e,a=4&e;if(n&&(s=i?n(t,r,i,o):n(t)),void 0!==s)return s;if(!h(t))return t;var l=C(t);if(l){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&dn.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!c)return function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}(t,s)}else{var f=Ae(t),d="[object Function]"==f||"[object GeneratorFunction]"==f;if(F(t))return function(t,e){if(e)return t.slice();var n=t.length,r=en?en(n):new t.constructor(n);return t.copy(r),r}(t,c);if("[object Object]"==f||"[object Arguments]"==f||d&&!i){if(s=u||d?{}:function(t){return"function"!=typeof t.constructor||rt(t)?{}:ft(un(t))}(t),!c)return u?function(t,e){return k(t,an(t),e)}(t,function(t,e){return t&&k(e,It(e),t)}(s,t)):function(t,e){return k(t,sn(t),e)}(t,lt(s,t))}else{if(!On[f])return i?t:{};s=mn(t,f,c)}}o||(o=new Qe);var p=o.get(t);if(p)return p;o.set(t,s),xn(t)?t.forEach((function(r){s.add(An(r,e,n,r,t,o))})):jn(t)&&t.forEach((function(r,i){s.set(i,An(r,e,n,i,t,o))}));var v=l?void 0:(a?u?fn:hn:u?It:at)(t);return function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););}(v||t,(function(r,i){v&&(r=t[i=r]),M(s,i,An(r,e,n,i,t,o))})),s}On["[object Arguments]"]=On["[object Array]"]=On["[object ArrayBuffer]"]=On["[object DataView]"]=On["[object Boolean]"]=On["[object Date]"]=On["[object Float32Array]"]=On["[object Float64Array]"]=On["[object Int8Array]"]=On["[object Int16Array]"]=On["[object Int32Array]"]=On["[object Map]"]=On["[object Number]"]=On["[object Object]"]=On["[object RegExp]"]=On["[object Set]"]=On["[object String]"]=On["[object Symbol]"]=On["[object Uint8Array]"]=On["[object Uint8ClampedArray]"]=On["[object Uint16Array]"]=On["[object Uint32Array]"]=!0,On["[object Error]"]=On["[object Function]"]=On["[object WeakMap]"]=!1;function En(t){return An(t,4)}var Sn=Object.prototype,In=Sn.hasOwnProperty,Pn=Ot((function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&At(e[0],e[1],i)&&(r=1);++n<r;)for(var o=e[n],s=It(o),c=-1,u=s.length;++c<u;){var a=s[c],l=t[a];(void 0===l||I(l,Sn[a])&&!In.call(t,a))&&(t[a]=o[a])}return t}));var Mn=Ot((function(t,e){return function(t,e,n){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout((function(){t.apply(void 0,n)}),e)}(t,1,e)}));var kn,Hn=(kn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},function(t){return null==kn?void 0:kn[t]}),Nn=/[&<>"']/g,$n=RegExp(Nn.source);var Tn,Rn=function(t,e,n){for(var r=-1,i=Object(t),o=n(t),s=o.length;s--;){var c=o[Tn?s:++r];if(!1===e(i[c],c,i))break}return t};function zn(t,e){return t&&Rn(t,e,at)}var Cn,Un,Ln=Object.prototype.toString,Bn=(Cn=function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ln.call(e)),t[e]=n},Un=bt(dt),function(t,e){return function(t,e,n,r){return zn(t,(function(t,i,o){e(r,n(t),i,o)})),r}(t,Cn,Un(e),{})}),Fn=Function.prototype,Wn=Object.prototype,Dn=Fn.toString,Vn=Wn.hasOwnProperty,qn=Dn.call(Object);function Jn(t){if(!H(t)||"[object Object]"!=l(t))return!1;var e=un(t);if(null===e)return!0;var n=Vn.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Dn.call(n)==qn}function Gn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new qt;++e<n;)this.add(t[e])}function Zn(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function Kn(t,e){return t.has(e)}Gn.prototype.add=Gn.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Gn.prototype.has=function(t){return this.__data__.has(t)};function Qn(t,e,n,r,i,o){var s=1&n,c=t.length,u=e.length;if(c!=u&&!(s&&u>c))return!1;var a=o.get(t),l=o.get(e);if(a&&l)return a==e&&l==t;var h=-1,f=!0,d=2&n?new Gn:void 0;for(o.set(t,e),o.set(e,t);++h<c;){var p=t[h],v=e[h];if(r)var g=s?r(v,p,h,e,t,o):r(p,v,h,t,e,o);if(void 0!==g){if(g)continue;f=!1;break}if(d){if(!Zn(e,(function(t,e){if(!Kn(d,e)&&(p===t||i(p,t,n,r,o)))return d.push(e)}))){f=!1;break}}else if(p!==v&&!i(p,v,n,r,o)){f=!1;break}}return o.delete(t),o.delete(e),f}function Xn(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function Yn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var tr=r?r.prototype:void 0,er=tr?tr.valueOf:void 0;var nr=Object.prototype.hasOwnProperty;var rr=Object.prototype.hasOwnProperty;function ir(t,e,n,r,i,o){var s=C(t),c=C(e),u=s?"[object Array]":Ae(t),a=c?"[object Array]":Ae(e),l="[object Object]"==(u="[object Arguments]"==u?"[object Object]":u),h="[object Object]"==(a="[object Arguments]"==a?"[object Object]":a),f=u==a;if(f&&F(t)){if(!F(e))return!1;s=!0,l=!1}if(f&&!l)return o||(o=new Qe),s||Y(t)?Qn(t,e,n,r,i,o):function(t,e,n,r,i,o,s){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new pn(t),new pn(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return I(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var c=Xn;case"[object Set]":var u=1&r;if(c||(c=Yn),t.size!=e.size&&!u)return!1;var a=s.get(t);if(a)return a==e;r|=2,s.set(t,e);var l=Qn(c(t),c(e),r,i,o,s);return s.delete(t),l;case"[object Symbol]":if(er)return er.call(t)==er.call(e)}return!1}(t,e,u,n,r,i,o);if(!(1&n)){var d=l&&rr.call(t,"__wrapped__"),p=h&&rr.call(e,"__wrapped__");if(d||p){var v=d?t.value():t,g=p?e.value():e;return o||(o=new Qe),i(v,g,n,r,o)}}return!!f&&(o||(o=new Qe),function(t,e,n,r,i,o){var s=1&n,c=hn(t),u=c.length;if(u!=hn(e).length&&!s)return!1;for(var a=u;a--;){var l=c[a];if(!(s?l in e:nr.call(e,l)))return!1}var h=o.get(t),f=o.get(e);if(h&&f)return h==e&&f==t;var d=!0;o.set(t,e),o.set(e,t);for(var p=s;++a<u;){var v=t[l=c[a]],g=e[l];if(r)var b=s?r(g,v,l,e,t,o):r(v,g,l,t,e,o);if(!(void 0===b?v===g||i(v,g,n,r,o):b)){d=!1;break}p||(p="constructor"==l)}if(d&&!p){var y=t.constructor,m=e.constructor;y!=m&&"constructor"in t&&"constructor"in e&&!("function"==typeof y&&y instanceof y&&"function"==typeof m&&m instanceof m)&&(d=!1)}return o.delete(t),o.delete(e),d}(t,e,n,r,i,o))}function or(t,e,n,r,i){return t===e||(null==t||null==e||!H(t)&&!H(e)?t!=t&&e!=e:ir(t,e,n,r,or,i))}function sr(t,e){return or(t,e)}function cr(t){return t==t&&!h(t)}function ur(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}function ar(t){var e=function(t){for(var e=at(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,cr(i)]}return e}(t);return 1==e.length&&e[0][2]?ur(e[0][0],e[0][1]):function(n){return n===t||function(t,e,n,r){var i=n.length,o=i,s=!r;if(null==t)return!o;for(t=Object(t);i--;){var c=n[i];if(s&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++i<o;){var u=(c=n[i])[0],a=t[u],l=c[1];if(s&&c[2]){if(void 0===a&&!(u in t))return!1}else{var h=new Qe;if(r)var f=r(a,l,u,t,e,h);if(!(void 0===f?or(l,a,3,r,h):f))return!1}}return!0}(n,t,e)}}function lr(t,e){for(var n=0,r=(e=ne(e,t)).length;null!=t&&n<r;)t=t[re(e[n++])];return n&&n==r?t:void 0}function hr(t,e){return null!=t&&e in Object(t)}function fr(t,e){return null!=t&&ie(t,e,hr)}function dr(t,e){return Rt(t)&&cr(e)?ur(re(t),e):function(n){var r=function(t,e,n){var r=null==t?void 0:lr(t,e);return void 0===r?n:r}(n,t);return void 0===r&&r===e?fr(n,t):or(e,r,3)}}function pr(t){return Rt(t)?(e=re(t),function(t){return null==t?void 0:t[e]}):function(t){return function(e){return lr(e,t)}}(t);var e}function vr(t){return"function"==typeof t?t:null==t?dt:"object"==typeof t?C(t)?dr(t[0],t[1]):ar(t):pr(t)}function gr(t,e){return e.length<2?t:lr(t,function(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}(e,0,-1))}function br(t,e){return null==(t=gr(t,e=ne(e,t)))||delete t[re((n=e,r=null==n?0:n.length,r?n[r-1]:void 0))];var n,r}function yr(t){return Jn(t)?void 0:t}var mr=r?r.isConcatSpreadable:void 0;function _r(t){return C(t)||z(t)||!!(mr&&t&&t[mr])}function jr(t,e,n,r,i){var o=-1,s=t.length;for(n||(n=_r),i||(i=[]);++o<s;){var c=t[o];e>0&&n(c)?e>1?jr(c,e-1,n,r,i):cn(i,c):r||(i[i.length]=c)}return i}function wr(t){return(null==t?0:t.length)?jr(t,1):[]}function xr(t){return xt(gt(t,void 0,wr),t+"")}var Or=xr((function(t,e){var n={};if(null==t)return n;var r=!1;e=Qt(e,(function(e){return e=ne(e,t),r||(r=e.length>1),e})),k(t,fn(t),n),r&&(n=An(n,7,yr));for(var i=e.length;i--;)br(n,e[i]);return n}));function Ar(t,e,n,r){if(!h(t))return t;for(var i=-1,o=(e=ne(e,t)).length,s=o-1,c=t;null!=c&&++i<o;){var u=re(e[i]),a=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(i!=s){var l=c[u];void 0===(a=r?r(l,u,c):void 0)&&(a=h(l)?l:D(e[i+1])?[]:{})}M(c,u,a),c=c[u]}return t}function Er(t,e){return function(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var s=e[r],c=lr(t,s);n(c,s)&&Ar(o,ne(s,t),c)}return o}(t,e,(function(e,n){return fr(t,n)}))}var Sr=xr((function(t,e){return null==t?{}:Er(t,e)}));const Ir=function(t,e){let n=t||{};e||(e={}),this.preinitialize.apply(this,arguments),this.cid=Ue(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(n=this.parse(n,e)||{});const r=se(this,"defaults");n=Pn(Mt({},r,n),r),this.set(n,e),this.changed={},this.initialize.apply(this,arguments)};function Pr(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var s=t[i];e(r,s,n(s),t)}return r}Ir.extend=ce,Object.assign(Ir.prototype,Le,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",preinitialize:function(){},initialize:function(){},toJSON:function(t){return En(this.attributes)},sync:function(t,e,n){return fe(this)(t,e,n)},get:function(t){return this.attributes[t]},keys:function(){return Object.keys(this.attributes)},values:function(){return Object.values(this.attributes)},pairs:function(){return this.entries()},entries:function(){return Object.entries(this.attributes)},invert:function(){return Bn(this.attributes)},pick:function(...t){return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),Sr(this.attributes,t)},omit:function(...t){return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),Or(this.attributes,t)},isEmpty:function(){return Se(this.attributes)},escape:function(t){return(e=ee(e=this.get(t)))&&$n.test(e)?e.replace(Nn,Hn):e;var e},has:function(t){return null!=this.get(t)},matches:function(t){return!!function(t){return vr("function"==typeof t?t:An(t,1))}(t)(this.attributes)},set:function(t,e,n){if(null==t)return this;let r;if("object"==typeof t?(r=t,n=e):(r={})[t]=e,n||(n={}),!this._validate(r,n))return!1;const i=n.unset,o=n.silent,s=[],c=this._changing;this._changing=!0,c||(this._previousAttributes=En(this.attributes),this.changed={});const u=this.attributes,a=this.changed,l=this._previousAttributes;for(const t in r)e=r[t],sr(u[t],e)||s.push(t),sr(l[t],e)?delete a[t]:a[t]=e,i?delete u[t]:u[t]=e;if(this.idAttribute in r&&(this.id=this.get(this.idAttribute)),!o){s.length&&(this._pending=n);for(let t=0;t<s.length;t++)this.trigger("change:"+s[t],this,u[s[t]],n)}if(c)return this;if(!o)for(;this._pending;)n=this._pending,this._pending=!1,this.trigger("change",this,n);return this._pending=!1,this._changing=!1,this},unset:function(t,e){return this.set(t,void 0,Mt({},e,{unset:!0}))},clear:function(t){const e={};for(const t in this.attributes)e[t]=void 0;return this.set(e,Mt({},t,{unset:!0}))},hasChanged:function(t){return null==t?!Se(this.changed):oe(this.changed,t)},changedAttributes:function(t){if(!t)return!!this.hasChanged()&&En(this.changed);const e=this._changing?this._previousAttributes:this.attributes,n={};let r;for(const i in t){const o=t[i];sr(e[i],o)||(n[i]=o,r=!0)}return!!r&&n},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return En(this._previousAttributes)},fetch:function(t){t=Mt({parse:!0},t);const e=this,n=t.success;return t.success=function(r){const i=t.parse?e.parse(r,t):r;if(!e.set(i,t))return!1;n&&n.call(t.context,e,r,t),e.trigger("sync",e,r,t)},le(this,t),this.sync("read",this,t)},save:function(t,e,n){let r;null==t||"object"==typeof t?(r=t,n=e):(r={})[t]=e;const i=(n=Mt({validate:!0,parse:!0},n)).wait,o=n.promise,s=o&&ue();if(r&&!i){if(!this.set(r,n))return!1}else if(!this._validate(r,n))return!1;const c=this,u=n.success,a=n.error,l=this.attributes;n.success=function(t){c.attributes=l;let e=n.parse?c.parse(t,n):t;if(i&&(e=Mt({},r,e)),e&&!c.set(e,n))return!1;u&&u.call(n.context,c,t,n),c.trigger("sync",c,t,n),o&&s.resolve()},n.error=function(t,e,n){a&&a.call(n.context,t,e,n),o&&s.reject(e)},le(this,n),r&&i&&(this.attributes=Mt({},l,r));const h=this.isNew()?"create":n.patch?"patch":"update";"patch"!==h||n.attrs||(n.attrs=r);const f=this.sync(h,this,n);return this.attributes=l,o?s:f},destroy:function(t){t=t?En(t):{};const e=this,n=t.success,r=t.wait,i=function(){e.stopListening(),e.trigger("destroy",e,e.collection,t)};t.success=function(o){r&&i(),n&&n.call(t.context,e,o,t),e.isNew()||e.trigger("sync",e,o,t)};let o=!1;return this.isNew()?Mn(t.success):(le(this,t),o=this.sync("delete",this,t)),r||i(),o},url:function(){const t=se(this,"urlRoot")||se(this.collection,"url")||ae();if(this.isNew())return t;const 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({},Mt({},t,{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=Mt({},this.attributes,t);const n=this.validationError=this.validate(t,e)||null;return!n||(this.trigger("invalid",this,n,Mt(e,{validationError:n})),!1)}});var Mr=function(t,e){return function(n,r){if(null==n)return n;if(!ut(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}}(zn);function kr(t,e,n,r){return Mr(t,(function(t,i,o){e(r,t,n(t),o)})),r}function Hr(t,e){return function(n,r){var i=C(n)?Pr:kr,o=e?e():{};return i(n,t,vr(r),o)}}var Nr=Object.prototype.hasOwnProperty,$r=Hr((function(t,e,n){Nr.call(t,n)?++t[n]:S(t,n,1)}));function Tr(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 Rr(t){return t!=t}function zr(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):Tr(t,Rr,n)}function Cr(t,e){return!!(null==t?0:t.length)&&zr(t,e,0)>-1}function Ur(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function Lr(t){return H(t)&&ut(t)}var Br=Ot((function(t,e){return Lr(t)?function(t,e,n,r){var i=-1,o=Cr,s=!0,c=t.length,u=[],a=e.length;if(!c)return u;n&&(e=Qt(e,J(n))),r?(o=Ur,s=!1):e.length>=200&&(o=Kn,s=!1,e=new Gn(e));t:for(;++i<c;){var l=t[i],h=null==n?l:n(l);if(l=r||0!==l?l:0,s&&h==h){for(var f=a;f--;)if(e[f]===h)continue t;u.push(l)}else o(e,h,r)||u.push(l)}return u}(t,jr(e,1,Lr,!0)):[]}));function Fr(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Wr(t,e){var n=!0;return Mr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}var Dr=Math.max;var Vr=Math.max,qr=Math.min;var Jr=Object.prototype.hasOwnProperty,Gr=Hr((function(t,e,n){Jr.call(t,n)?t[n].push(e):S(t,n,[e])})),Zr=Math.max;function Kr(t){return"string"==typeof t||!C(t)&&H(t)&&"[object String]"==l(t)}var Qr=Hr((function(t,e,n){S(t,n,e)}));var Xr=Math.max,Yr=Math.min;function ti(t,e){var n;return Mr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function ei(t,e,n){var r=C(t)?Zn:ti;return n&&At(t,e,n)&&(e=void 0),r(t,vr(e))}function ni(t,e){if(t!==e){var n=void 0!==t,r=null===t,i=t==t,o=Nt(t),s=void 0!==e,c=null===e,u=e==e,a=Nt(e);if(!c&&!a&&!o&&t>e||o&&s&&u&&!c&&!a||r&&s&&u||!n&&u||!i)return 1;if(!r&&!o&&!a&&t<e||a&&n&&i&&!r&&!o||c&&n&&i||!s&&i||!u)return-1}return 0}function ri(t,e,n){e=e.length?Qt(e,(function(t){return C(t)?function(e){return lr(e,1===t.length?t[0]:t)}:t})):[dt];var r=-1;return e=Qt(e,J(vr)),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(function(t,e){var n=-1,r=ut(t)?Array(t.length):[];return Mr(t,(function(t,i,o){r[++n]=e(t,i,o)})),r}(t,(function(t,n,i){return{criteria:Qt(e,(function(e){return e(t)})),index:++r,value:t}})),(function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,s=i.length,c=n.length;++r<s;){var u=ni(i[r],o[r]);if(u)return r>=c?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}var ii=Ot((function(t,e){if(null==t)return[];var n=e.length;return n>1&&At(t,e[0],e[1])?e=[]:n>2&&At(e[0],e[1],e[2])&&(e=[e[0]]),ri(t,jr(e,1),[])}));const oi=Array.prototype.slice,si=function(t,e){e||(e={}),this.preinitialize.apply(this,arguments),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,Mt({silent:!0},e))};si.extend=ce;const ci={add:!0,remove:!0,merge:!0},ui={add:!0,remove:!1},ai=function(t,e,n){n=Math.min(Math.max(n,0),t.length);const r=Array(t.length-n),i=e.length;let o;for(o=0;o<r.length;o++)r[o]=t[o+n];for(o=0;o<i;o++)t[o+n]=e[o];for(o=0;o<r.length;o++)t[o+i+n]=r[o]};Object.assign(si.prototype,Le,{model:Ir,preinitialize:function(){},initialize:function(){},toJSON:function(t){return this.map((function(e){return e.toJSON(t)}))},sync:function(t,e,n){return fe(this)(t,e,n)},add:function(t,e){return this.set(t,Mt({merge:!1},e,ui))},remove:function(t,e){e=Mt({},e);const n=!Array.isArray(t);t=n?[t]:t.slice();const r=this._removeModels(t,e);return!e.silent&&r.length&&(e.changes={added:[],merged:[],removed:r},this.trigger("update",this,e)),n?r[0]:r},set:function(t,e){if(null==t)return;(e=Mt({},ci,e)).parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);const n=!Array.isArray(t);t=n?[t]:t.slice();let r=e.at;null!=r&&(r=+r),r>this.length&&(r=this.length),r<0&&(r+=this.length+1);const i=[],o=[],s=[],c=[],u={},a=e.add,l=e.merge,h=e.remove;let f=!1;const d=this.comparator&&null==r&&!1!==e.sort,p=Kr(this.comparator)?this.comparator:null;let v,g;for(g=0;g<t.length;g++){v=t[g];const n=this.get(v);if(n){if(l&&v!==n){let t=this._isModel(v)?v.attributes:v;e.parse&&(t=n.parse(t,e)),n.set(t,e),s.push(n),d&&!f&&(f=n.hasChanged(p))}u[n.cid]||(u[n.cid]=!0,i.push(n)),t[g]=n}else a&&(v=t[g]=this._prepareModel(v,e),v&&(o.push(v),this._addReference(v,e),u[v.cid]=!0,i.push(v)))}if(h){for(g=0;g<this.length;g++)v=this.models[g],u[v.cid]||c.push(v);c.length&&this._removeModels(c,e)}let b=!1;const y=!d&&a&&h;if(i.length&&y?(b=this.length!==i.length||ei(this.models,(t,e)=>t!==i[e]),this.models.length=0,ai(this.models,i,0),this.length=this.models.length):o.length&&(d&&(f=!0),ai(this.models,o,null==r?this.length:r),this.length=this.models.length),f&&this.sort({silent:!0}),!e.silent){for(g=0;g<o.length;g++)null!=r&&(e.index=r+g),v=o[g],v.trigger("add",v,this,e);(f||b)&&this.trigger("sort",this,e),(o.length||c.length||s.length)&&(e.changes={added:o,removed:c,merged:s},this.trigger("update",this,e))}return n?t[0]:t},clearStore:async function(t={},e=(t=>t)){await Promise.all(this.models.filter(e).map(e=>new Promise(n=>{e.destroy(Object.assign(t,{success:n,error:(t,e)=>{console.error(e),n()}}))}))),await this.browserStorage.clear(),this.reset()},reset:function(t,e){e=e?En(e):{};for(let t=0;t<this.models.length;t++)this._removeReference(this.models[t],e);return e.previousModels=this.models,this._reset(),t=this.add(t,Mt({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},push:function(t,e){return this.add(t,Mt({at:this.length},e))},pop:function(t){const e=this.at(this.length-1);return this.remove(e,t)},unshift:function(t,e){return this.add(t,Mt({at:0},e))},shift:function(t){const e=this.at(0);return this.remove(e,t)},slice:function(){return oi.apply(this.models,arguments)},filter:function(t,e){return this.models.filter(f(t)?t:e=>e.matches(t),e)},every:function(t){return function(t,e,n){var r=C(t)?Fr:Wr;return n&&At(t,e,n)&&(e=void 0),r(t,vr(e))}(this.models.map(t=>t.attributes),t)},difference:function(t){return Br(this.models,t)},max:function(){return Math.max.apply(Math,this.models)},min:function(){return Math.min.apply(Math,this.models)},drop:function(t=1){return this.models.slice(t)},some:function(t){return ei(this.models.map(t=>t.attributes),t)},sortBy:function(t){return ii(this.models,f(t)?t:e=>Kr(t)?e.get(t):e.matches(t))},isEmpty:function(){return Se(this.models)},keyBy:function(t){return Qr(this.models,t)},each:function(t,e){return this.forEach(t,e)},forEach:function(t,e){return this.models.forEach(t,e)},includes:function(t){return this.models.includes(t)},size:function(){return this.models.length},countBy:function(t){return $r(this.models,f(t)?t:e=>Kr(t)?e.get(t):e.matches(t))},groupBy:function(t){return Gr(this.models,f(t)?t:e=>Kr(t)?e.get(t):e.matches(t))},indexOf:function(t){return function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Re(n);return i<0&&(i=Zr(r+i,0)),zr(t,e,i)}(this.models,t)},findLastIndex:function(t,e){return function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r-1;return void 0!==n&&(i=Re(n),i=n<0?Vr(r+i,0):qr(i,r-1)),Tr(t,vr(e),i,!0)}(this.models,f(t)?t:e=>Kr(t)?e.get(t):e.matches(t),e)},lastIndexOf:function(t){return function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=Re(n))<0?Xr(r+i,0):Yr(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):Tr(t,Rr,i,!0)}(this.models,t)},findIndex:function(t){return function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Re(n);return i<0&&(i=Dr(r+i,0)),Tr(t,vr(e),i)}(this.models,f(t)?t:e=>Kr(t)?e.get(t):e.matches(t))},last:function(){const t=null==this.models?0:this.models.length;return t?this.models[t-1]:void 0},head:function(){return this.models[0]},first:function(){return this.head()},map:function(t,e){return this.models.map(f(t)?t:e=>Kr(t)?e.get(t):e.matches(t),e)},reduce:function(t,e){return this.models.reduce(t,e||this.models[0])},reduceRight:function(t,e){return this.models.reduceRight(t,e||this.models[0])},toArray:function(){return Array.from(this.models)},get:function(t){if(null!=t)return this._byId[t]||this._byId[this.modelId(this._isModel(t)?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)},find:function(t,e){const n=f(t)?t:e=>e.matches(t);return this.models.find(n,e)},sort:function(t){let e=this.comparator;if(!e)throw new Error("Cannot sort a set without a comparator");t||(t={});const n=e.length;return f(e)&&(e=e.bind(this)),1===n||Kr(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){const e=(t=Mt({parse:!0},t)).success,n=this,r=t.promise&&ue();return t.success=function(i){const o=t.reset?"reset":"set";n[o](i,t),e&&e.call(t.context,n,i,t),r&&r.resolve(),n.trigger("sync",n,i,t)},le(this,t),r||this.sync("read",this,t)},create:function(t,e){const n=(e=e?En(e):{}).wait,r=e.promise,i=r&&ue();if(!(t=this._prepareModel(t,e)))return!1;n||this.add(t,e);const o=this,s=e.success,c=e.error;return e.success=function(t,e,c){n&&o.add(t,c),s&&s.call(c.context,t,e,c),r&&i.resolve(t)},e.error=function(t,e,n){c&&c.call(n.context,t,e,n),r&&i.reject(e)},t.save(null,Object.assign(e,{promise:!1})),r?i:t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t){var e;return t[(null===(e=this.model.prototype)||void 0===e?void 0:e.idAttribute)||"id"]},values:function(){return new hi(this,fi)},keys:function(){return new hi(this,di)},entries:function(){return new hi(this,pi)},_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?En(e):{}).collection=this;const n=new this.model(t,e);return n.validationError?(this.trigger("invalid",this,n.validationError,e),!1):n},_removeModels:function(t,e){const n=[];for(let r=0;r<t.length;r++){const i=this.get(t[r]);if(!i)continue;const o=this.indexOf(i);this.models.splice(o,1),this.length--,delete this._byId[i.cid];const 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 Ir},_addReference:function(t,e){this._byId[t.cid]=t;const 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];const 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){const t=this.modelId(e.previousAttributes()),n=this.modelId(e.attributes);t!==n&&(null!=t&&delete this._byId[t],null!=n&&(this._byId[n]=e))}}this.trigger.apply(this,arguments)}});const li="function"==typeof Symbol&&Symbol.iterator;li&&(si.prototype[li]=si.prototype.values);const hi=function(t,e){this._collection=t,this._kind=e,this._index=0},fi=1,di=2,pi=3;li&&(hi.prototype[li]=function(){return this}),hi.prototype.next=function(){if(this._collection){if(this._index<this._collection.length){const t=this._collection.at(this._index);let e;if(this._index++,this._kind===fi)e=t;else{const n=this._collection.modelId(t.attributes);e=this._kind===di?n:[n,t]}return{value:e,done:!1}}this._collection=void 0}return{value:void 0,done:!0}};const vi=function(){this.handlers=[],this.checkUrl=this.checkUrl.bind(this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)};vi.extend=ce;const gi=/^[#\/]|\s+$/g,bi=/^\/+|\/+$/g,yi=/#.*$/;vi.started=!1,Object.assign(vi.prototype,Le,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root&&!this.getSearch()},matchRoot:function(){return this.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+"/"===this.root},decodeFragment:function(t){return decodeURI(t.replace(/%25/g,"%2525"))},getSearch:function(){const t=this.location.href.replace(/#.*/,"").match(/\?.+/);return t?t[0]:""},getHash:function(t){const e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getPath:function(){const 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(gi,"")},start:function(t){if(vi.started)throw new Error("history has already been started");if(vi.started=!0,this.options=Mt({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._hasHashChange="onhashchange"in window&&(void 0===document.documentMode||document.documentMode>7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(bi,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){const t=this.root.slice(0,-1)||"/";return this.location.replace(t+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;const t=document.body,e=t.insertBefore(this.iframe,t.firstChild).contentWindow;e.document.open(),e.document.close(),e.location.hash="#"+this.fragment}if(this._usePushState?addEventListener("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?addEventListener("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){this._usePushState?removeEventListener("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&removeEventListener("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),vi.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){let e=this.getFragment();if(e===this.fragment&&this.iframe&&(e=this.getHash(this.iframe.contentWindow)),e===this.fragment)return!1;this.iframe&&this.navigate(e),this.loadUrl()},loadUrl:function(t){return!!this.matchRoot()&&(t=this.fragment=this.getFragment(t),ei(this.handlers,(function(e){if(e.route.test(t))return e.callback(t),!0})))},navigate:function(t,e){if(!vi.started)return!1;e&&!0!==e||(e={trigger:!!e}),t=this.getFragment(t||"");let n=this.root;""!==t&&"?"!==t.charAt(0)||(n=n.slice(0,-1)||"/");const r=n+t;t=t.replace(yi,"");const i=this.decodeFragment(t);if(this.fragment!==i){if(this.fragment=i,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)){const n=this.iframe.contentWindow;e.replace||(n.document.open(),n.document.close()),this._updateHash(n.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,n){if(n){const n=t.href.replace(/(javascript:|#).*$/,"");t.replace(n+"#"+e)}else t.hash="#"+e}});var mi=Q&&Q.isRegExp,_i=mi?J(mi):function(t){return H(t)&&"[object RegExp]"==l(t)};const ji=function(t={}){this.history=t.history||new vi,this.preinitialize.apply(this,arguments),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)};ji.extend=ce;const wi=/\((.*?)\)/g,xi=/(\(\?)?:\w+/g,Oi=/\*\w+/g,Ai=/[\-{}\[\]+?.,\\\^$|#\s]/g;
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).skeletor=e()}(this,(function(){"use strict";var t="object"==typeof global&&global&&global.Object===Object&&global,e="object"==typeof self&&self&&self.Object===Object&&self,n=t||e||Function("return this")(),r=n.Symbol,i=Object.prototype,o=i.hasOwnProperty,s=i.toString,c=r?r.toStringTag:void 0;var u=Object.prototype.toString;var a=r?r.toStringTag:void 0;function l(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?function(t){var e=o.call(t,c),n=t[c];try{t[c]=void 0;var r=!0}catch(t){}var i=s.call(t);return r&&(e?t[c]=n:delete t[c]),i}(t):function(t){return u.call(t)}(t)}function h(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function f(t){if(!h(t))return!1;var e=l(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var d,p=n["__core-js_shared__"],v=(d=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||""))?"Symbol(src)_1."+d:"";var g=Function.prototype.toString;function b(t){if(null!=t){try{return g.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var y=/^\[object .+?Constructor\]$/,m=Function.prototype,_=Object.prototype,j=m.toString,w=_.hasOwnProperty,x=RegExp("^"+j.call(w).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function O(t){return!(!h(t)||(e=t,v&&v in e))&&(f(t)?x:y).test(b(t));var e}function A(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return O(n)?n:void 0}var E=function(){try{var t=A(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();function S(t,e,n){"__proto__"==e&&E?E(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function I(t,e){return t===e||t!=t&&e!=e}var P=Object.prototype.hasOwnProperty;function M(t,e,n){var r=t[e];P.call(t,e)&&I(r,n)&&(void 0!==n||e in t)||S(t,e,n)}function k(t,e,n,r){var i=!n;n||(n={});for(var o=-1,s=e.length;++o<s;){var c=e[o],u=r?r(n[c],t[c],c,n,t):void 0;void 0===u&&(u=t[c]),i?S(n,c,u):M(n,c,u)}return n}function $(t){return null!=t&&"object"==typeof t}function H(t){return $(t)&&"[object Arguments]"==l(t)}var N=Object.prototype,T=N.hasOwnProperty,R=N.propertyIsEnumerable,z=H(function(){return arguments}())?H:function(t){return $(t)&&T.call(t,"callee")&&!R.call(t,"callee")},C=Array.isArray;var U="object"==typeof exports&&exports&&!exports.nodeType&&exports,L=U&&"object"==typeof module&&module&&!module.nodeType&&module,B=L&&L.exports===U?n.Buffer:void 0,F=(B?B.isBuffer:void 0)||function(){return!1},W=/^(?:0|[1-9]\d*)$/;function D(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&W.test(t))&&t>-1&&t%1==0&&t<e}function V(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}var q={};function J(t){return function(e){return t(e)}}q["[object Float32Array]"]=q["[object Float64Array]"]=q["[object Int8Array]"]=q["[object Int16Array]"]=q["[object Int32Array]"]=q["[object Uint8Array]"]=q["[object Uint8ClampedArray]"]=q["[object Uint16Array]"]=q["[object Uint32Array]"]=!0,q["[object Arguments]"]=q["[object Array]"]=q["[object ArrayBuffer]"]=q["[object Boolean]"]=q["[object DataView]"]=q["[object Date]"]=q["[object Error]"]=q["[object Function]"]=q["[object Map]"]=q["[object Number]"]=q["[object Object]"]=q["[object RegExp]"]=q["[object Set]"]=q["[object String]"]=q["[object WeakMap]"]=!1;var G="object"==typeof exports&&exports&&!exports.nodeType&&exports,Z=G&&"object"==typeof module&&module&&!module.nodeType&&module,K=Z&&Z.exports===G&&t.process,Q=function(){try{var t=Z&&Z.require&&Z.require("util").types;return t||K&&K.binding&&K.binding("util")}catch(t){}}(),X=Q&&Q.isTypedArray,Y=X?J(X):function(t){return $(t)&&V(t.length)&&!!q[l(t)]},tt=Object.prototype.hasOwnProperty;function et(t,e){var n=C(t),r=!n&&z(t),i=!n&&!r&&F(t),o=!n&&!r&&!i&&Y(t),s=n||r||i||o,c=s?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],u=c.length;for(var a in t)!e&&!tt.call(t,a)||s&&("length"==a||i&&("offset"==a||"parent"==a)||o&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||D(a,u))||c.push(a);return c}var nt=Object.prototype;function rt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||nt)}function it(t,e){return function(n){return t(e(n))}}var ot=it(Object.keys,Object),st=Object.prototype.hasOwnProperty;function ct(t){if(!rt(t))return ot(t);var e=[];for(var n in Object(t))st.call(t,n)&&"constructor"!=n&&e.push(n);return e}function ut(t){return null!=t&&V(t.length)&&!f(t)}function at(t){return ut(t)?et(t):ct(t)}function lt(t,e){return t&&k(e,at(e),t)}var ht=Object.create,ft=function(){function t(){}return function(e){if(!h(e))return{};if(ht)return ht(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function dt(t){return t}function pt(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)}var vt=Math.max;function gt(t,e,n){return e=vt(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=vt(r.length-e,0),s=Array(o);++i<o;)s[i]=r[e+i];i=-1;for(var c=Array(e+1);++i<e;)c[i]=r[i];return c[e]=n(s),pt(t,this,c)}}function bt(t){return function(){return t}}var yt=E?function(t,e){return E(t,"toString",{configurable:!0,enumerable:!1,value:bt(e),writable:!0})}:dt,mt=Date.now;var _t,jt,wt,xt=(_t=yt,jt=0,wt=0,function(){var t=mt(),e=16-(t-wt);if(wt=t,e>0){if(++jt>=800)return arguments[0]}else jt=0;return _t.apply(void 0,arguments)});function Ot(t,e){return xt(gt(t,e,dt),t+"")}function At(t,e,n){if(!h(n))return!1;var r=typeof e;return!!("number"==r?ut(n)&&D(e,n.length):"string"==r&&e in n)&&I(n[e],t)}var Et=Object.prototype.hasOwnProperty;function St(t){if(!h(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=rt(t),n=[];for(var r in t)("constructor"!=r||!e&&Et.call(t,r))&&n.push(r);return n}function It(t){return ut(t)?et(t,!0):St(t)}var Pt,Mt=(Pt=function(t,e){k(e,It(e),t)},Ot((function(t,e){var n=-1,r=e.length,i=r>1?e[r-1]:void 0,o=r>2?e[2]:void 0;for(i=Pt.length>3&&"function"==typeof i?(r--,i):void 0,o&&At(e[0],e[1],o)&&(i=r<3?void 0:i,r=1),t=Object(t);++n<r;){var s=e[n];s&&Pt(t,s,n,i)}return t}))),kt=Object.prototype.hasOwnProperty;function $t(t,e){return null!=t&&kt.call(t,e)}function Ht(t){return"symbol"==typeof t||$(t)&&"[object Symbol]"==l(t)}var Nt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Tt=/^\w*$/;function Rt(t,e){if(C(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Ht(t))||(Tt.test(t)||!Nt.test(t)||null!=e&&t in Object(e))}var zt=A(Object,"create");var Ct=Object.prototype.hasOwnProperty;var Ut=Object.prototype.hasOwnProperty;function Lt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Bt(t,e){for(var n=t.length;n--;)if(I(t[n][0],e))return n;return-1}Lt.prototype.clear=function(){this.__data__=zt?zt(null):{},this.size=0},Lt.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Lt.prototype.get=function(t){var e=this.__data__;if(zt){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return Ct.call(e,t)?e[t]:void 0},Lt.prototype.has=function(t){var e=this.__data__;return zt?void 0!==e[t]:Ut.call(e,t)},Lt.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=zt&&void 0===e?"__lodash_hash_undefined__":e,this};var Ft=Array.prototype.splice;function Wt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Wt.prototype.clear=function(){this.__data__=[],this.size=0},Wt.prototype.delete=function(t){var e=this.__data__,n=Bt(e,t);return!(n<0)&&(n==e.length-1?e.pop():Ft.call(e,n,1),--this.size,!0)},Wt.prototype.get=function(t){var e=this.__data__,n=Bt(e,t);return n<0?void 0:e[n][1]},Wt.prototype.has=function(t){return Bt(this.__data__,t)>-1},Wt.prototype.set=function(t,e){var n=this.__data__,r=Bt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var Dt=A(n,"Map");function Vt(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function qt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}qt.prototype.clear=function(){this.size=0,this.__data__={hash:new Lt,map:new(Dt||Wt),string:new Lt}},qt.prototype.delete=function(t){var e=Vt(this,t).delete(t);return this.size-=e?1:0,e},qt.prototype.get=function(t){return Vt(this,t).get(t)},qt.prototype.has=function(t){return Vt(this,t).has(t)},qt.prototype.set=function(t,e){var n=Vt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};function Jt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");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)||o,s};return n.cache=new(Jt.Cache||qt),n}Jt.Cache=qt;var Gt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zt=/\\(\\)?/g,Kt=function(t){var e=Jt(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Gt,(function(t,n,r,i){e.push(r?i.replace(Zt,"$1"):n||t)})),e}));function Qt(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var Xt=r?r.prototype:void 0,Yt=Xt?Xt.toString:void 0;function te(t){if("string"==typeof t)return t;if(C(t))return Qt(t,te)+"";if(Ht(t))return Yt?Yt.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ee(t){return null==t?"":te(t)}function ne(t,e){return C(t)?t:Rt(t,e)?[t]:Kt(ee(t))}function re(t){if("string"==typeof t||Ht(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ie(t,e,n){for(var r=-1,i=(e=ne(e,t)).length,o=!1;++r<i;){var s=re(e[r]);if(!(o=null!=t&&n(t,s)))break;t=t[s]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&V(i)&&D(s,i)&&(C(t)||z(t))}function oe(t,e){return null!=t&&ie(t,e,$t)}function se(t,e,n){var r=-1,i=(e=ne(e,t)).length;for(i||(i=1,t=void 0);++r<i;){var o=null==t?void 0:t[re(e[r])];void 0===o&&(r=i,o=n),t=f(o)?o.call(t):o}return t}function ce(t,e){const n=this;let r;return r=t&&oe(t,"constructor")?t.constructor:function(){return n.apply(this,arguments)},Mt(r,n,e),r.prototype=function(t,e){var n=ft(t);return null==e?n:lt(n,e)}(n.prototype,t),r.prototype.constructor=r,r.__super__=n.prototype,r}function ue(){const t={isResolved:!1,isPending:!0,isRejected:!1},e=new Promise((e,n)=>{t.resolve=e,t.reject=n});return Object.assign(e,t),e.then((function(t){return e.isResolved=!0,e.isPending=!1,e.isRejected=!1,t}),(function(t){throw e.isResolved=!1,e.isPending=!1,e.isRejected=!0,t})),e}function ae(){throw new Error('A "url" property or function must be specified')}function le(t,e){const n=e.error;e.error=function(r){n&&n.call(e.context,t,r,e),t.trigger("error",t,r,e)}}const he={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};function fe(t){const e=se(t,"browserStorage")||se(t.collection,"browserStorage");return e?e.sync():de}function de(t,e,n={}){const r={type:he[t],dataType:"json"};n.url||(r.url=se(e,"url")||ae()),null!=n.data||!e||"create"!==t&&"update"!==t&&"patch"!==t||(r.contentType="application/json",r.data=JSON.stringify(n.attrs||e.toJSON(n))),"GET"!==r.type&&(r.processData=!1);const i=n.error;n.error=function(t,e,r){n.textStatus=e,n.errorThrown=r,i&&i.call(n.context,t,e,r)};const o=n.xhr=pe(Mt(r,n));return e.trigger("request",e,o,n),o}function pe(){return fetch.apply(this,arguments)}var ve=A(n,"DataView"),ge=A(n,"Promise"),be=A(n,"Set"),ye=A(n,"WeakMap"),me=b(ve),_e=b(Dt),je=b(ge),we=b(be),xe=b(ye),Oe=l;(ve&&"[object DataView]"!=Oe(new ve(new ArrayBuffer(1)))||Dt&&"[object Map]"!=Oe(new Dt)||ge&&"[object Promise]"!=Oe(ge.resolve())||be&&"[object Set]"!=Oe(new be)||ye&&"[object WeakMap]"!=Oe(new ye))&&(Oe=function(t){var e=l(t),n="[object Object]"==e?t.constructor:void 0,r=n?b(n):"";if(r)switch(r){case me:return"[object DataView]";case _e:return"[object Map]";case je:return"[object Promise]";case we:return"[object Set]";case xe:return"[object WeakMap]"}return e});var Ae=Oe,Ee=Object.prototype.hasOwnProperty;function Se(t){if(null==t)return!0;if(ut(t)&&(C(t)||"string"==typeof t||"function"==typeof t.splice||F(t)||Y(t)||z(t)))return!t.length;var e=Ae(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(rt(t))return!ct(t).length;for(var n in t)if(Ee.call(t,n))return!1;return!0}var Ie=/\s/;var Pe=/^\s+/;function Me(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&Ie.test(t.charAt(e)););return e}(t)+1).replace(Pe,""):t}var ke=/^[-+]0x[0-9a-f]+$/i,$e=/^0b[01]+$/i,He=/^0o[0-7]+$/i,Ne=parseInt;function Te(t){return t?(t=function(t){if("number"==typeof t)return t;if(Ht(t))return NaN;if(h(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=h(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Me(t);var n=$e.test(t);return n||He.test(t)?Ne(t.slice(2),n?2:8):ke.test(t)?NaN:+t}(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function Re(t){var e=Te(t),n=e%1;return e==e?n?e-n:e:0}function ze(t){return function(t,e){var n;if("function"!=typeof e)throw new TypeError("Expected a function");return t=Re(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}(2,t)}var Ce=0;function Ue(t){var e=++Ce;return ee(t)+e}const Le={},Be=/\s+/;let Fe;const We=function(t,e,n,r,i){let o,s=0;if(n&&"object"==typeof n){void 0!==r&&"context"in i&&void 0===i.context&&(i.context=r);for(o=at(n);s<o.length;s++)e=We(t,e,o[s],n[o[s]],i)}else if(n&&Be.test(n))for(o=n.split(Be);s<o.length;s++)e=t(e,o[s],r,i);else e=t(e,n,r,i);return e};Le.on=function(t,e,n){if(this._events=We(De,this._events||{},t,e,{context:n,ctx:this,listening:Fe}),Fe){(this._listeners||(this._listeners={}))[Fe.id]=Fe,Fe.interop=!1}return this},Le.listenTo=function(t,e,n){if(!t)return this;const r=t._listenId||(t._listenId=Ue("l")),i=this._listeningTo||(this._listeningTo={});let o=Fe=i[r];o||(this._listenId||(this._listenId=Ue("l")),o=Fe=i[r]=new Ke(this,t));const s=Ve(t,e,n,this);if(Fe=void 0,s)throw s;return o.interop&&o.on(e,n),this};const De=function(t,e,n,r){if(n){const i=t[e]||(t[e]=[]),o=r.context,s=r.ctx,c=r.listening;c&&c.count++,i.push({callback:n,context:o,ctx:o||s,listening:c})}return t},Ve=function(t,e,n,r){try{t.on(e,n,r)}catch(t){return t}};Le.off=function(t,e,n){return this._events?(this._events=We(qe,this._events,t,e,{context:n,listeners:this._listeners}),this):this},Le.stopListening=function(t,e,n){const r=this._listeningTo;if(!r)return this;const i=t?[t._listenId]:at(r);for(let t=0;t<i.length;t++){const o=r[i[t]];if(!o)break;o.obj.off(e,n,this),o.interop&&o.off(e,n)}return Se(r)&&(this._listeningTo=void 0),this};const qe=function(t,e,n,r){if(!t)return;const i=r.context,o=r.listeners;let s,c=0;if(e||i||n){for(s=e?[e]:at(t);c<s.length;c++){const r=t[e=s[c]];if(!r)break;const o=[];for(let t=0;t<r.length;t++){const s=r[t];if(n&&n!==s.callback&&n!==s.callback._callback||i&&i!==s.context)o.push(s);else{const t=s.listening;t&&t.off(e,n)}}o.length?t[e]=o:delete t[e]}return t}for(s=at(o);c<s.length;c++)o[s[c]].cleanup()};Le.once=function(t,e,n){const r=We(Je,{},t,e,this.off.bind(this));return"string"==typeof t&&null==n&&(e=void 0),this.on(r,e,n)},Le.listenToOnce=function(t,e,n){const r=We(Je,{},e,n,this.stopListening.bind(this,t));return this.listenTo(t,r)};const Je=function(t,e,n,r){if(n){const i=t[e]=ze((function(){r(e,i),n.apply(this,arguments)}));i._callback=n}return t};Le.trigger=function(t){if(!this._events)return this;const e=Math.max(0,arguments.length-1),n=Array(e);for(let t=0;t<e;t++)n[t]=arguments[t+1];return We(Ge,this._events,t,void 0,n),this};const Ge=function(t,e,n,r){if(t){const n=t[e];let i=t.all;n&&i&&(i=i.slice()),n&&Ze(n,r),i&&Ze(i,[e].concat(r))}return t},Ze=function(t,e){let n,r=-1;const i=t.length,o=e[0],s=e[1],c=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,c);return;default:for(;++r<i;)(n=t[r]).callback.apply(n.ctx,e);return}},Ke=function(t,e){this.id=t._listenId,this.listener=t,this.obj=e,this.interop=!0,this.count=0,this._events=void 0};Ke.prototype.on=Le.on,Ke.prototype.off=function(t,e){let n;this.interop?(this._events=We(qe,this._events,t,e,{context:void 0,listeners:void 0}),n=!this._events):(this.count--,n=0===this.count),n&&this.cleanup()},Ke.prototype.cleanup=function(){delete this.listener._listeningTo[this.obj._listenId],this.interop||delete this.obj._listeners[this.id]},Le.bind=Le.on,Le.unbind=Le.off;function Qe(t){var e=this.__data__=new Wt(t);this.size=e.size}Qe.prototype.clear=function(){this.__data__=new Wt,this.size=0},Qe.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Qe.prototype.get=function(t){return this.__data__.get(t)},Qe.prototype.has=function(t){return this.__data__.has(t)},Qe.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Wt){var r=n.__data__;if(!Dt||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new qt(r)}return n.set(t,e),this.size=n.size,this};var Xe="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ye=Xe&&"object"==typeof module&&module&&!module.nodeType&&module,tn=Ye&&Ye.exports===Xe?n.Buffer:void 0,en=tn?tn.allocUnsafe:void 0;function nn(){return[]}var rn=Object.prototype.propertyIsEnumerable,on=Object.getOwnPropertySymbols,sn=on?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}(on(t),(function(e){return rn.call(t,e)})))}:nn;function cn(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var un=it(Object.getPrototypeOf,Object),an=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)cn(e,sn(t)),t=un(t);return e}:nn;function ln(t,e,n){var r=e(t);return C(t)?r:cn(r,n(t))}function hn(t){return ln(t,at,sn)}function fn(t){return ln(t,It,an)}var dn=Object.prototype.hasOwnProperty;var pn=n.Uint8Array;function vn(t){var e=new t.constructor(t.byteLength);return new pn(e).set(new pn(t)),e}var gn=/\w*$/;var bn=r?r.prototype:void 0,yn=bn?bn.valueOf:void 0;function mn(t,e,n){var r,i=t.constructor;switch(e){case"[object ArrayBuffer]":return vn(t);case"[object Boolean]":case"[object Date]":return new i(+t);case"[object DataView]":return function(t,e){var n=e?vn(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(t,e){var n=e?vn(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}(t,n);case"[object Map]":return new i;case"[object Number]":case"[object String]":return new i(t);case"[object RegExp]":return function(t){var e=new t.constructor(t.source,gn.exec(t));return e.lastIndex=t.lastIndex,e}(t);case"[object Set]":return new i;case"[object Symbol]":return r=t,yn?Object(yn.call(r)):{}}}var _n=Q&&Q.isMap,jn=_n?J(_n):function(t){return $(t)&&"[object Map]"==Ae(t)};var wn=Q&&Q.isSet,xn=wn?J(wn):function(t){return $(t)&&"[object Set]"==Ae(t)},On={};function An(t,e,n,r,i,o){var s,c=1&e,u=2&e,a=4&e;if(n&&(s=i?n(t,r,i,o):n(t)),void 0!==s)return s;if(!h(t))return t;var l=C(t);if(l){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&dn.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!c)return function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}(t,s)}else{var f=Ae(t),d="[object Function]"==f||"[object GeneratorFunction]"==f;if(F(t))return function(t,e){if(e)return t.slice();var n=t.length,r=en?en(n):new t.constructor(n);return t.copy(r),r}(t,c);if("[object Object]"==f||"[object Arguments]"==f||d&&!i){if(s=u||d?{}:function(t){return"function"!=typeof t.constructor||rt(t)?{}:ft(un(t))}(t),!c)return u?function(t,e){return k(t,an(t),e)}(t,function(t,e){return t&&k(e,It(e),t)}(s,t)):function(t,e){return k(t,sn(t),e)}(t,lt(s,t))}else{if(!On[f])return i?t:{};s=mn(t,f,c)}}o||(o=new Qe);var p=o.get(t);if(p)return p;o.set(t,s),xn(t)?t.forEach((function(r){s.add(An(r,e,n,r,t,o))})):jn(t)&&t.forEach((function(r,i){s.set(i,An(r,e,n,i,t,o))}));var v=l?void 0:(a?u?fn:hn:u?It:at)(t);return function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););}(v||t,(function(r,i){v&&(r=t[i=r]),M(s,i,An(r,e,n,i,t,o))})),s}On["[object Arguments]"]=On["[object Array]"]=On["[object ArrayBuffer]"]=On["[object DataView]"]=On["[object Boolean]"]=On["[object Date]"]=On["[object Float32Array]"]=On["[object Float64Array]"]=On["[object Int8Array]"]=On["[object Int16Array]"]=On["[object Int32Array]"]=On["[object Map]"]=On["[object Number]"]=On["[object Object]"]=On["[object RegExp]"]=On["[object Set]"]=On["[object String]"]=On["[object Symbol]"]=On["[object Uint8Array]"]=On["[object Uint8ClampedArray]"]=On["[object Uint16Array]"]=On["[object Uint32Array]"]=!0,On["[object Error]"]=On["[object Function]"]=On["[object WeakMap]"]=!1;function En(t){return An(t,4)}var Sn=Object.prototype,In=Sn.hasOwnProperty,Pn=Ot((function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&At(e[0],e[1],i)&&(r=1);++n<r;)for(var o=e[n],s=It(o),c=-1,u=s.length;++c<u;){var a=s[c],l=t[a];(void 0===l||I(l,Sn[a])&&!In.call(t,a))&&(t[a]=o[a])}return t}));var Mn=Ot((function(t,e){return function(t,e,n){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout((function(){t.apply(void 0,n)}),e)}(t,1,e)}));var kn,$n=(kn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},function(t){return null==kn?void 0:kn[t]}),Hn=/[&<>"']/g,Nn=RegExp(Hn.source);var Tn,Rn=function(t,e,n){for(var r=-1,i=Object(t),o=n(t),s=o.length;s--;){var c=o[Tn?s:++r];if(!1===e(i[c],c,i))break}return t};function zn(t,e){return t&&Rn(t,e,at)}var Cn,Un,Ln=Object.prototype.toString,Bn=(Cn=function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ln.call(e)),t[e]=n},Un=bt(dt),function(t,e){return function(t,e,n,r){return zn(t,(function(t,i,o){e(r,n(t),i,o)})),r}(t,Cn,Un(e),{})}),Fn=Function.prototype,Wn=Object.prototype,Dn=Fn.toString,Vn=Wn.hasOwnProperty,qn=Dn.call(Object);function Jn(t){if(!$(t)||"[object Object]"!=l(t))return!1;var e=un(t);if(null===e)return!0;var n=Vn.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Dn.call(n)==qn}function Gn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new qt;++e<n;)this.add(t[e])}function Zn(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function Kn(t,e){return t.has(e)}Gn.prototype.add=Gn.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Gn.prototype.has=function(t){return this.__data__.has(t)};function Qn(t,e,n,r,i,o){var s=1&n,c=t.length,u=e.length;if(c!=u&&!(s&&u>c))return!1;var a=o.get(t),l=o.get(e);if(a&&l)return a==e&&l==t;var h=-1,f=!0,d=2&n?new Gn:void 0;for(o.set(t,e),o.set(e,t);++h<c;){var p=t[h],v=e[h];if(r)var g=s?r(v,p,h,e,t,o):r(p,v,h,t,e,o);if(void 0!==g){if(g)continue;f=!1;break}if(d){if(!Zn(e,(function(t,e){if(!Kn(d,e)&&(p===t||i(p,t,n,r,o)))return d.push(e)}))){f=!1;break}}else if(p!==v&&!i(p,v,n,r,o)){f=!1;break}}return o.delete(t),o.delete(e),f}function Xn(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function Yn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var tr=r?r.prototype:void 0,er=tr?tr.valueOf:void 0;var nr=Object.prototype.hasOwnProperty;var rr=Object.prototype.hasOwnProperty;function ir(t,e,n,r,i,o){var s=C(t),c=C(e),u=s?"[object Array]":Ae(t),a=c?"[object Array]":Ae(e),l="[object Object]"==(u="[object Arguments]"==u?"[object Object]":u),h="[object Object]"==(a="[object Arguments]"==a?"[object Object]":a),f=u==a;if(f&&F(t)){if(!F(e))return!1;s=!0,l=!1}if(f&&!l)return o||(o=new Qe),s||Y(t)?Qn(t,e,n,r,i,o):function(t,e,n,r,i,o,s){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new pn(t),new pn(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return I(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var c=Xn;case"[object Set]":var u=1&r;if(c||(c=Yn),t.size!=e.size&&!u)return!1;var a=s.get(t);if(a)return a==e;r|=2,s.set(t,e);var l=Qn(c(t),c(e),r,i,o,s);return s.delete(t),l;case"[object Symbol]":if(er)return er.call(t)==er.call(e)}return!1}(t,e,u,n,r,i,o);if(!(1&n)){var d=l&&rr.call(t,"__wrapped__"),p=h&&rr.call(e,"__wrapped__");if(d||p){var v=d?t.value():t,g=p?e.value():e;return o||(o=new Qe),i(v,g,n,r,o)}}return!!f&&(o||(o=new Qe),function(t,e,n,r,i,o){var s=1&n,c=hn(t),u=c.length;if(u!=hn(e).length&&!s)return!1;for(var a=u;a--;){var l=c[a];if(!(s?l in e:nr.call(e,l)))return!1}var h=o.get(t),f=o.get(e);if(h&&f)return h==e&&f==t;var d=!0;o.set(t,e),o.set(e,t);for(var p=s;++a<u;){var v=t[l=c[a]],g=e[l];if(r)var b=s?r(g,v,l,e,t,o):r(v,g,l,t,e,o);if(!(void 0===b?v===g||i(v,g,n,r,o):b)){d=!1;break}p||(p="constructor"==l)}if(d&&!p){var y=t.constructor,m=e.constructor;y!=m&&"constructor"in t&&"constructor"in e&&!("function"==typeof y&&y instanceof y&&"function"==typeof m&&m instanceof m)&&(d=!1)}return o.delete(t),o.delete(e),d}(t,e,n,r,i,o))}function or(t,e,n,r,i){return t===e||(null==t||null==e||!$(t)&&!$(e)?t!=t&&e!=e:ir(t,e,n,r,or,i))}function sr(t,e){return or(t,e)}function cr(t){return t==t&&!h(t)}function ur(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}function ar(t){var e=function(t){for(var e=at(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,cr(i)]}return e}(t);return 1==e.length&&e[0][2]?ur(e[0][0],e[0][1]):function(n){return n===t||function(t,e,n,r){var i=n.length,o=i,s=!r;if(null==t)return!o;for(t=Object(t);i--;){var c=n[i];if(s&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++i<o;){var u=(c=n[i])[0],a=t[u],l=c[1];if(s&&c[2]){if(void 0===a&&!(u in t))return!1}else{var h=new Qe;if(r)var f=r(a,l,u,t,e,h);if(!(void 0===f?or(l,a,3,r,h):f))return!1}}return!0}(n,t,e)}}function lr(t,e){for(var n=0,r=(e=ne(e,t)).length;null!=t&&n<r;)t=t[re(e[n++])];return n&&n==r?t:void 0}function hr(t,e){return null!=t&&e in Object(t)}function fr(t,e){return null!=t&&ie(t,e,hr)}function dr(t,e){return Rt(t)&&cr(e)?ur(re(t),e):function(n){var r=function(t,e,n){var r=null==t?void 0:lr(t,e);return void 0===r?n:r}(n,t);return void 0===r&&r===e?fr(n,t):or(e,r,3)}}function pr(t){return Rt(t)?(e=re(t),function(t){return null==t?void 0:t[e]}):function(t){return function(e){return lr(e,t)}}(t);var e}function vr(t){return"function"==typeof t?t:null==t?dt:"object"==typeof t?C(t)?dr(t[0],t[1]):ar(t):pr(t)}function gr(t,e){return e.length<2?t:lr(t,function(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}(e,0,-1))}function br(t,e){return null==(t=gr(t,e=ne(e,t)))||delete t[re((n=e,r=null==n?0:n.length,r?n[r-1]:void 0))];var n,r}function yr(t){return Jn(t)?void 0:t}var mr=r?r.isConcatSpreadable:void 0;function _r(t){return C(t)||z(t)||!!(mr&&t&&t[mr])}function jr(t,e,n,r,i){var o=-1,s=t.length;for(n||(n=_r),i||(i=[]);++o<s;){var c=t[o];e>0&&n(c)?e>1?jr(c,e-1,n,r,i):cn(i,c):r||(i[i.length]=c)}return i}function wr(t){return(null==t?0:t.length)?jr(t,1):[]}function xr(t){return xt(gt(t,void 0,wr),t+"")}var Or=xr((function(t,e){var n={};if(null==t)return n;var r=!1;e=Qt(e,(function(e){return e=ne(e,t),r||(r=e.length>1),e})),k(t,fn(t),n),r&&(n=An(n,7,yr));for(var i=e.length;i--;)br(n,e[i]);return n}));function Ar(t,e,n,r){if(!h(t))return t;for(var i=-1,o=(e=ne(e,t)).length,s=o-1,c=t;null!=c&&++i<o;){var u=re(e[i]),a=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(i!=s){var l=c[u];void 0===(a=r?r(l,u,c):void 0)&&(a=h(l)?l:D(e[i+1])?[]:{})}M(c,u,a),c=c[u]}return t}function Er(t,e){return function(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var s=e[r],c=lr(t,s);n(c,s)&&Ar(o,ne(s,t),c)}return o}(t,e,(function(e,n){return fr(t,n)}))}var Sr=xr((function(t,e){return null==t?{}:Er(t,e)}));const Ir=function(t,e){let n=t||{};e||(e={}),this.preinitialize.apply(this,arguments),this.cid=Ue(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(n=this.parse(n,e)||{});const r=se(this,"defaults");n=Pn(Mt({},r,n),r),this.set(n,e),this.changed={},this.initialize.apply(this,arguments)};function Pr(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var s=t[i];e(r,s,n(s),t)}return r}Ir.extend=ce,Object.assign(Ir.prototype,Le,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",preinitialize:function(){},initialize:function(){},toJSON:function(t){return En(this.attributes)},sync:function(t,e,n){return fe(this)(t,e,n)},get:function(t){return this.attributes[t]},keys:function(){return Object.keys(this.attributes)},values:function(){return Object.values(this.attributes)},pairs:function(){return this.entries()},entries:function(){return Object.entries(this.attributes)},invert:function(){return Bn(this.attributes)},pick:function(...t){return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),Sr(this.attributes,t)},omit:function(...t){return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),Or(this.attributes,t)},isEmpty:function(){return Se(this.attributes)},escape:function(t){return(e=ee(e=this.get(t)))&&Nn.test(e)?e.replace(Hn,$n):e;var e},has:function(t){return null!=this.get(t)},matches:function(t){return!!function(t){return vr("function"==typeof t?t:An(t,1))}(t)(this.attributes)},set:function(t,e,n){if(null==t)return this;let r;if("object"==typeof t?(r=t,n=e):(r={})[t]=e,n||(n={}),!this._validate(r,n))return!1;const i=n.unset,o=n.silent,s=[],c=this._changing;this._changing=!0,c||(this._previousAttributes=En(this.attributes),this.changed={});const u=this.attributes,a=this.changed,l=this._previousAttributes;for(const t in r)e=r[t],sr(u[t],e)||s.push(t),sr(l[t],e)?delete a[t]:a[t]=e,i?delete u[t]:u[t]=e;if(this.idAttribute in r&&(this.id=this.get(this.idAttribute)),!o){s.length&&(this._pending=n);for(let t=0;t<s.length;t++)this.trigger("change:"+s[t],this,u[s[t]],n)}if(c)return this;if(!o)for(;this._pending;)n=this._pending,this._pending=!1,this.trigger("change",this,n);return this._pending=!1,this._changing=!1,this},unset:function(t,e){return this.set(t,void 0,Mt({},e,{unset:!0}))},clear:function(t){const e={};for(const t in this.attributes)e[t]=void 0;return this.set(e,Mt({},t,{unset:!0}))},hasChanged:function(t){return null==t?!Se(this.changed):oe(this.changed,t)},changedAttributes:function(t){if(!t)return!!this.hasChanged()&&En(this.changed);const e=this._changing?this._previousAttributes:this.attributes,n={};let r;for(const i in t){const o=t[i];sr(e[i],o)||(n[i]=o,r=!0)}return!!r&&n},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return En(this._previousAttributes)},fetch:function(t){t=Mt({parse:!0},t);const e=this,n=t.success;return t.success=function(r){const i=t.parse?e.parse(r,t):r;if(!e.set(i,t))return!1;n&&n.call(t.context,e,r,t),e.trigger("sync",e,r,t)},le(this,t),this.sync("read",this,t)},save:function(t,e,n){let r;null==t||"object"==typeof t?(r=t,n=e):(r={})[t]=e;const i=(n=Mt({validate:!0,parse:!0},n)).wait,o=n.promise,s=o&&ue();if(r&&!i){if(!this.set(r,n))return!1}else if(!this._validate(r,n))return!1;const c=this,u=n.success,a=n.error,l=this.attributes;n.success=function(t){c.attributes=l;let e=n.parse?c.parse(t,n):t;if(i&&(e=Mt({},r,e)),e&&!c.set(e,n))return!1;u&&u.call(n.context,c,t,n),c.trigger("sync",c,t,n),o&&s.resolve()},n.error=function(t,e,n){a&&a.call(n.context,t,e,n),o&&s.reject(e)},le(this,n),r&&i&&(this.attributes=Mt({},l,r));const h=this.isNew()?"create":n.patch?"patch":"update";"patch"!==h||n.attrs||(n.attrs=r);const f=this.sync(h,this,n);return this.attributes=l,o?s:f},destroy:function(t){t=t?En(t):{};const e=this,n=t.success,r=t.wait,i=function(){e.stopListening(),e.trigger("destroy",e,e.collection,t)};t.success=function(o){r&&i(),n&&n.call(t.context,e,o,t),e.isNew()||e.trigger("sync",e,o,t)};let o=!1;return this.isNew()?Mn(t.success):(le(this,t),o=this.sync("delete",this,t)),r||i(),o},url:function(){const t=se(this,"urlRoot")||se(this.collection,"url")||ae();if(this.isNew())return t;const 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({},Mt({},t,{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=Mt({},this.attributes,t);const n=this.validationError=this.validate(t,e)||null;return!n||(this.trigger("invalid",this,n,Mt(e,{validationError:n})),!1)}});var Mr=function(t,e){return function(n,r){if(null==n)return n;if(!ut(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}}(zn);function kr(t,e,n,r){return Mr(t,(function(t,i,o){e(r,t,n(t),o)})),r}function $r(t,e){return function(n,r){var i=C(n)?Pr:kr,o=e?e():{};return i(n,t,vr(r),o)}}var Hr=Object.prototype.hasOwnProperty,Nr=$r((function(t,e,n){Hr.call(t,n)?++t[n]:S(t,n,1)}));function Tr(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 Rr(t){return t!=t}function zr(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):Tr(t,Rr,n)}function Cr(t,e){return!!(null==t?0:t.length)&&zr(t,e,0)>-1}function Ur(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function Lr(t){return $(t)&&ut(t)}var Br=Ot((function(t,e){return Lr(t)?function(t,e,n,r){var i=-1,o=Cr,s=!0,c=t.length,u=[],a=e.length;if(!c)return u;n&&(e=Qt(e,J(n))),r?(o=Ur,s=!1):e.length>=200&&(o=Kn,s=!1,e=new Gn(e));t:for(;++i<c;){var l=t[i],h=null==n?l:n(l);if(l=r||0!==l?l:0,s&&h==h){for(var f=a;f--;)if(e[f]===h)continue t;u.push(l)}else o(e,h,r)||u.push(l)}return u}(t,jr(e,1,Lr,!0)):[]}));function Fr(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Wr(t,e){var n=!0;return Mr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}var Dr=Math.max;var Vr=Math.max,qr=Math.min;var Jr=Object.prototype.hasOwnProperty,Gr=$r((function(t,e,n){Jr.call(t,n)?t[n].push(e):S(t,n,[e])})),Zr=Math.max;function Kr(t){return"string"==typeof t||!C(t)&&$(t)&&"[object String]"==l(t)}var Qr=$r((function(t,e,n){S(t,n,e)}));var Xr=Math.max,Yr=Math.min;function ti(t,e){var n;return Mr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function ei(t,e,n){var r=C(t)?Zn:ti;return n&&At(t,e,n)&&(e=void 0),r(t,vr(e))}function ni(t,e){if(t!==e){var n=void 0!==t,r=null===t,i=t==t,o=Ht(t),s=void 0!==e,c=null===e,u=e==e,a=Ht(e);if(!c&&!a&&!o&&t>e||o&&s&&u&&!c&&!a||r&&s&&u||!n&&u||!i)return 1;if(!r&&!o&&!a&&t<e||a&&n&&i&&!r&&!o||c&&n&&i||!s&&i||!u)return-1}return 0}function ri(t,e,n){e=e.length?Qt(e,(function(t){return C(t)?function(e){return lr(e,1===t.length?t[0]:t)}:t})):[dt];var r=-1;return e=Qt(e,J(vr)),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(function(t,e){var n=-1,r=ut(t)?Array(t.length):[];return Mr(t,(function(t,i,o){r[++n]=e(t,i,o)})),r}(t,(function(t,n,i){return{criteria:Qt(e,(function(e){return e(t)})),index:++r,value:t}})),(function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,s=i.length,c=n.length;++r<s;){var u=ni(i[r],o[r]);if(u)return r>=c?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}var ii=Ot((function(t,e){if(null==t)return[];var n=e.length;return n>1&&At(t,e[0],e[1])?e=[]:n>2&&At(e[0],e[1],e[2])&&(e=[e[0]]),ri(t,jr(e,1),[])}));const oi=Array.prototype.slice,si=function(t,e){e||(e={}),this.preinitialize.apply(this,arguments),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,Mt({silent:!0},e))};si.extend=ce;const ci={add:!0,remove:!0,merge:!0},ui={add:!0,remove:!1},ai=function(t,e,n){n=Math.min(Math.max(n,0),t.length);const r=Array(t.length-n),i=e.length;let o;for(o=0;o<r.length;o++)r[o]=t[o+n];for(o=0;o<i;o++)t[o+n]=e[o];for(o=0;o<r.length;o++)t[o+i+n]=r[o]};Object.assign(si.prototype,Le,{model:Ir,preinitialize:function(){},initialize:function(){},toJSON:function(t){return this.map((function(e){return e.toJSON(t)}))},sync:function(t,e,n){return fe(this)(t,e,n)},add:function(t,e){return this.set(t,Mt({merge:!1},e,ui))},remove:function(t,e){e=Mt({},e);const n=!Array.isArray(t);t=n?[t]:t.slice();const r=this._removeModels(t,e);return!e.silent&&r.length&&(e.changes={added:[],merged:[],removed:r},this.trigger("update",this,e)),n?r[0]:r},set:function(t,e){if(null==t)return;(e=Mt({},ci,e)).parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);const n=!Array.isArray(t);t=n?[t]:t.slice();let r=e.at;null!=r&&(r=+r),r>this.length&&(r=this.length),r<0&&(r+=this.length+1);const i=[],o=[],s=[],c=[],u={},a=e.add,l=e.merge,h=e.remove;let f=!1;const d=this.comparator&&null==r&&!1!==e.sort,p=Kr(this.comparator)?this.comparator:null;let v,g;for(g=0;g<t.length;g++){v=t[g];const n=this.get(v);if(n){if(l&&v!==n){let t=this._isModel(v)?v.attributes:v;e.parse&&(t=n.parse(t,e)),n.set(t,e),s.push(n),d&&!f&&(f=n.hasChanged(p))}u[n.cid]||(u[n.cid]=!0,i.push(n)),t[g]=n}else a&&(v=t[g]=this._prepareModel(v,e),v&&(o.push(v),this._addReference(v,e),u[v.cid]=!0,i.push(v)))}if(h){for(g=0;g<this.length;g++)v=this.models[g],u[v.cid]||c.push(v);c.length&&this._removeModels(c,e)}let b=!1;const y=!d&&a&&h;if(i.length&&y?(b=this.length!==i.length||ei(this.models,(t,e)=>t!==i[e]),this.models.length=0,ai(this.models,i,0),this.length=this.models.length):o.length&&(d&&(f=!0),ai(this.models,o,null==r?this.length:r),this.length=this.models.length),f&&this.sort({silent:!0}),!e.silent){for(g=0;g<o.length;g++)null!=r&&(e.index=r+g),v=o[g],v.trigger("add",v,this,e);(f||b)&&this.trigger("sort",this,e),(o.length||c.length||s.length)&&(e.changes={added:o,removed:c,merged:s},this.trigger("update",this,e))}return n?t[0]:t},clearStore:async function(t={},e=(t=>t)){await Promise.all(this.models.filter(e).map(e=>new Promise(n=>{e.destroy(Object.assign(t,{success:n,error:(t,e)=>{console.error(e),n()}}))}))),await this.browserStorage.clear(),this.reset()},reset:function(t,e){e=e?En(e):{};for(let t=0;t<this.models.length;t++)this._removeReference(this.models[t],e);return e.previousModels=this.models,this._reset(),t=this.add(t,Mt({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},push:function(t,e){return this.add(t,Mt({at:this.length},e))},pop:function(t){const e=this.at(this.length-1);return this.remove(e,t)},unshift:function(t,e){return this.add(t,Mt({at:0},e))},shift:function(t){const e=this.at(0);return this.remove(e,t)},slice:function(){return oi.apply(this.models,arguments)},filter:function(t,e){return this.models.filter(f(t)?t:e=>e.matches(t),e)},every:function(t){return function(t,e,n){var r=C(t)?Fr:Wr;return n&&At(t,e,n)&&(e=void 0),r(t,vr(e))}(this.models.map(t=>t.attributes),t)},difference:function(t){return Br(this.models,t)},max:function(){return Math.max.apply(Math,this.models)},min:function(){return Math.min.apply(Math,this.models)},drop:function(t=1){return this.models.slice(t)},some:function(t){return ei(this.models.map(t=>t.attributes),t)},sortBy:function(t){return ii(this.models,f(t)?t:e=>Kr(t)?e.get(t):e.matches(t))},isEmpty:function(){return Se(this.models)},keyBy:function(t){return Qr(this.models,t)},each:function(t,e){return this.forEach(t,e)},forEach:function(t,e){return this.models.forEach(t,e)},includes:function(t){return this.models.includes(t)},size:function(){return this.models.length},countBy:function(t){return Nr(this.models,f(t)?t:e=>Kr(t)?e.get(t):e.matches(t))},groupBy:function(t){return Gr(this.models,f(t)?t:e=>Kr(t)?e.get(t):e.matches(t))},indexOf:function(t){return function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Re(n);return i<0&&(i=Zr(r+i,0)),zr(t,e,i)}(this.models,t)},findLastIndex:function(t,e){return function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r-1;return void 0!==n&&(i=Re(n),i=n<0?Vr(r+i,0):qr(i,r-1)),Tr(t,vr(e),i,!0)}(this.models,f(t)?t:e=>Kr(t)?e.get(t):e.matches(t),e)},lastIndexOf:function(t){return function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=Re(n))<0?Xr(r+i,0):Yr(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):Tr(t,Rr,i,!0)}(this.models,t)},findIndex:function(t){return function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Re(n);return i<0&&(i=Dr(r+i,0)),Tr(t,vr(e),i)}(this.models,f(t)?t:e=>Kr(t)?e.get(t):e.matches(t))},last:function(){const t=null==this.models?0:this.models.length;return t?this.models[t-1]:void 0},head:function(){return this.models[0]},first:function(){return this.head()},map:function(t,e){return this.models.map(f(t)?t:e=>Kr(t)?e.get(t):e.matches(t),e)},reduce:function(t,e){return this.models.reduce(t,e||this.models[0])},reduceRight:function(t,e){return this.models.reduceRight(t,e||this.models[0])},toArray:function(){return Array.from(this.models)},get:function(t){if(null!=t)return this._byId[t]||this._byId[this.modelId(this._isModel(t)?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)},find:function(t,e){const n=f(t)?t:e=>e.matches(t);return this.models.find(n,e)},sort:function(t){let e=this.comparator;if(!e)throw new Error("Cannot sort a set without a comparator");t||(t={});const n=e.length;return f(e)&&(e=e.bind(this)),1===n||Kr(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){const e=(t=Mt({parse:!0},t)).success,n=this,r=t.promise&&ue();return t.success=function(i){const o=t.reset?"reset":"set";n[o](i,t),e&&e.call(t.context,n,i,t),r&&r.resolve(),n.trigger("sync",n,i,t)},le(this,t),r||this.sync("read",this,t)},create:function(t,e){const n=(e=e?En(e):{}).wait,r=e.promise,i=r&&ue();if(!(t=this._prepareModel(t,e)))return!1;n||this.add(t,e);const o=this,s=e.success,c=e.error;return e.success=function(t,e,c){n&&o.add(t,c),s&&s.call(c.context,t,e,c),r&&i.resolve(t)},e.error=function(t,e,n){c&&c.call(n.context,t,e,n),r&&i.reject(e)},t.save(null,Object.assign(e,{promise:!1})),r?i:t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t){var e;return t[(null===(e=this.model.prototype)||void 0===e?void 0:e.idAttribute)||"id"]},values:function(){return new hi(this,fi)},keys:function(){return new hi(this,di)},entries:function(){return new hi(this,pi)},_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?En(e):{}).collection=this;const n=new this.model(t,e);return n.validationError?(this.trigger("invalid",this,n.validationError,e),!1):n},_removeModels:function(t,e){const n=[];for(let r=0;r<t.length;r++){const i=this.get(t[r]);if(!i)continue;const o=this.indexOf(i);this.models.splice(o,1),this.length--,delete this._byId[i.cid];const 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 Ir},_addReference:function(t,e){this._byId[t.cid]=t;const 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];const 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){const t=this.modelId(e.previousAttributes()),n=this.modelId(e.attributes);t!==n&&(null!=t&&delete this._byId[t],null!=n&&(this._byId[n]=e))}}this.trigger.apply(this,arguments)}});const li="function"==typeof Symbol&&Symbol.iterator;li&&(si.prototype[li]=si.prototype.values);const hi=function(t,e){this._collection=t,this._kind=e,this._index=0},fi=1,di=2,pi=3;li&&(hi.prototype[li]=function(){return this}),hi.prototype.next=function(){if(this._collection){if(this._index<this._collection.length){const t=this._collection.at(this._index);let e;if(this._index++,this._kind===fi)e=t;else{const n=this._collection.modelId(t.attributes);e=this._kind===di?n:[n,t]}return{value:e,done:!1}}this._collection=void 0}return{value:void 0,done:!0}};const vi=function(){this.handlers=[],this.checkUrl=this.checkUrl.bind(this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)};vi.extend=ce;const gi=/^[#\/]|\s+$/g,bi=/^\/+|\/+$/g,yi=/#.*$/;vi.started=!1,Object.assign(vi.prototype,Le,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root&&!this.getSearch()},matchRoot:function(){return this.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+"/"===this.root},decodeFragment:function(t){return decodeURI(t.replace(/%25/g,"%2525"))},getSearch:function(){const t=this.location.href.replace(/#.*/,"").match(/\?.+/);return t?t[0]:""},getHash:function(t){const e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getPath:function(){const 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(gi,"")},start:function(t){if(vi.started)throw new Error("history has already been started");if(vi.started=!0,this.options=Mt({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._hasHashChange="onhashchange"in window&&(void 0===document.documentMode||document.documentMode>7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(bi,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){const t=this.root.slice(0,-1)||"/";return this.location.replace(t+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;const t=document.body,e=t.insertBefore(this.iframe,t.firstChild).contentWindow;e.document.open(),e.document.close(),e.location.hash="#"+this.fragment}if(this._usePushState?addEventListener("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?addEventListener("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){this._usePushState?removeEventListener("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&removeEventListener("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),vi.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){let e=this.getFragment();if(e===this.fragment&&this.iframe&&(e=this.getHash(this.iframe.contentWindow)),e===this.fragment)return!1;this.iframe&&this.navigate(e),this.loadUrl()},loadUrl:function(t){return!!this.matchRoot()&&(t=this.fragment=this.getFragment(t),ei(this.handlers,(function(e){if(e.route.test(t))return e.callback(t),!0})))},navigate:function(t,e){if(!vi.started)return!1;e&&!0!==e||(e={trigger:!!e}),t=this.getFragment(t||"");let n=this.root;""!==t&&"?"!==t.charAt(0)||(n=n.slice(0,-1)||"/");const r=n+t;t=t.replace(yi,"");const i=this.decodeFragment(t);if(this.fragment!==i){if(this.fragment=i,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)){const n=this.iframe.contentWindow;e.replace||(n.document.open(),n.document.close()),this._updateHash(n.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,n){if(n){const n=t.href.replace(/(javascript:|#).*$/,"");t.replace(n+"#"+e)}else t.hash="#"+e}});var mi=Q&&Q.isRegExp,_i=mi?J(mi):function(t){return $(t)&&"[object RegExp]"==l(t)};const ji=function(t={}){this.history=t.history||new vi,this.preinitialize.apply(this,arguments),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)};ji.extend=ce;const wi=/\((.*?)\)/g,xi=/(\(\?)?:\w+/g,Oi=/\*\w+/g,Ai=/[\-{}\[\]+?.,\\\^$|#\s]/g;
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2017 Google LLC
5
5
  * SPDX-License-Identifier: BSD-3-Clause
6
6
  */
7
- var Ei,Si,Ii,Pi;Object.assign(ji.prototype,Le,{preinitialize:function(){},initialize:function(){},route:function(t,e,n){return _i(t)||(t=this._routeToRegExp(t)),f(e)&&(n=e,e=""),n||(n=this[e]),this.history.route(t,r=>{const i=this._extractParameters(t,r);!1!==this.execute(n,i,e)&&(this.trigger.apply(this,["route:"+e].concat(i)),this.trigger("route",e,i),this.history.trigger("route",this,e,i))}),this},execute:function(t,e,n){t&&t.apply(this,e)},navigate:function(t,e){return this.history.navigate(t,e),this},_bindRoutes:function(){if(!this.routes)return;let t;this.routes=se(this,"routes");const e=at(this.routes);for(;null!=(t=e.pop());)this.route(t,this.routes[t])},_routeToRegExp:function(t){return t=t.replace(Ai,"\\$&").replace(wi,"(?:$1)?").replace(xi,(function(t,e){return e?t:"([^/?]+)"})).replace(Oi,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){const n=t.exec(e).slice(1);return n.map((function(t,e){return e===n.length-1?t||null:t?decodeURIComponent(t):null}))}});const Mi=globalThis.trustedTypes,ki=Mi?Mi.createPolicy("lit-html",{createHTML:t=>t}):void 0,Hi="lit$".concat((Math.random()+"").slice(9),"$"),Ni="?"+Hi,$i="<".concat(Ni,">"),Ti=document,Ri=(t="")=>Ti.createComment(t),zi=t=>null===t||"object"!=typeof t&&"function"!=typeof t,Ci=Array.isArray,Ui=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Li=/-->/g,Bi=/>/g,Fi=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,Wi=/'/g,Di=/"/g,Vi=/^(?:script|style|textarea)$/i,qi=Symbol.for("lit-noChange"),Ji=Symbol.for("lit-nothing"),Gi=new WeakMap,Zi=Ti.createTreeWalker(Ti,129,null,!1),Ki=(t,e)=>{const n=t.length-1,r=[];let i,o=2===e?"<svg>":"",s=Ui;for(let e=0;e<n;e++){const n=t[e];let c,u,a=-1,l=0;for(;l<n.length&&(s.lastIndex=l,u=s.exec(n),null!==u);)l=s.lastIndex,s===Ui?"!--"===u[1]?s=Li:void 0!==u[1]?s=Bi:void 0!==u[2]?(Vi.test(u[2])&&(i=RegExp("</"+u[2],"g")),s=Fi):void 0!==u[3]&&(s=Fi):s===Fi?">"===u[0]?(s=null!=i?i:Ui,a=-1):void 0===u[1]?a=-2:(a=s.lastIndex-u[2].length,c=u[1],s=void 0===u[3]?Fi:'"'===u[3]?Di:Wi):s===Di||s===Wi?s=Fi:s===Li||s===Bi?s=Ui:(s=Fi,i=void 0);const h=s===Fi&&t[e+1].startsWith("/>")?" ":"";o+=s===Ui?n+$i:a>=0?(r.push(c),n.slice(0,a)+"$lit$"+n.slice(a)+Hi+h):n+Hi+(-2===a?(r.push(void 0),e):h)}const c=o+(t[n]||"<?>")+(2===e?"</svg>":"");return[void 0!==ki?ki.createHTML(c):c,r]};class Qi{constructor({strings:t,_$litType$:e},n){let r;this.parts=[];let i=0,o=0;const s=t.length-1,c=this.parts,[u,a]=Ki(t,e);if(this.el=Qi.createElement(u,n),Zi.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(r=Zi.nextNode())&&c.length<s;){if(1===r.nodeType){if(r.hasAttributes()){const t=[];for(const e of r.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(Hi)){const n=a[o++];if(t.push(e),void 0!==n){const t=r.getAttribute(n.toLowerCase()+"$lit$").split(Hi),e=/([.?@])?(.*)/.exec(n);c.push({type:1,index:i,name:e[2],strings:t,ctor:"."===e[1]?no:"?"===e[1]?ro:"@"===e[1]?io:eo})}else c.push({type:6,index:i})}for(const e of t)r.removeAttribute(e)}if(Vi.test(r.tagName)){const t=r.textContent.split(Hi),e=t.length-1;if(e>0){r.textContent=Mi?Mi.emptyScript:"";for(let n=0;n<e;n++)r.append(t[n],Ri()),Zi.nextNode(),c.push({type:2,index:++i});r.append(t[e],Ri())}}}else if(8===r.nodeType)if(r.data===Ni)c.push({type:2,index:i});else{let t=-1;for(;-1!==(t=r.data.indexOf(Hi,t+1));)c.push({type:7,index:i}),t+=Hi.length-1}i++}}static createElement(t,e){const n=Ti.createElement("template");return n.innerHTML=t,n}}function Xi(t,e,n=t,r){var i,o,s,c;if(e===qi)return e;let u=void 0!==r?null===(i=n.Σi)||void 0===i?void 0:i[r]:n.Σo;const a=zi(e)?void 0:e._$litDirective$;return(null==u?void 0:u.constructor)!==a&&(null===(o=null==u?void 0:u.O)||void 0===o||o.call(u,!1),void 0===a?u=void 0:(u=new a(t),u.T(t,n,r)),void 0!==r?(null!==(s=(c=n).Σi)&&void 0!==s?s:c.Σi=[])[r]=u:n.Σo=u),void 0!==u&&(e=Xi(t,u.S(t,e.values),u,r)),e}class Yi{constructor(t,e){this.l=[],this.N=void 0,this.D=t,this.M=e}u(t){var e;const{el:{content:n},parts:r}=this.D,i=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:Ti).importNode(n,!0);Zi.currentNode=i;let o=Zi.nextNode(),s=0,c=0,u=r[0];for(;void 0!==u;){if(s===u.index){let e;2===u.type?e=new to(o,o.nextSibling,this,t):1===u.type?e=new u.ctor(o,u.name,u.strings,this,t):6===u.type&&(e=new oo(o,this,t)),this.l.push(e),u=r[++c]}s!==(null==u?void 0:u.index)&&(o=Zi.nextNode(),s++)}return i}v(t){let e=0;for(const n of this.l)void 0!==n&&(void 0!==n.strings?(n.I(t,n,e),e+=n.strings.length-2):n.I(t[e])),e++}}class to{constructor(t,e,n,r){this.type=2,this.N=void 0,this.A=t,this.B=e,this.M=n,this.options=r}setConnected(t){var e;null===(e=this.P)||void 0===e||e.call(this,t)}get parentNode(){return this.A.parentNode}get startNode(){return this.A}get endNode(){return this.B}I(t,e=this){t=Xi(this,t,e),zi(t)?t===Ji||null==t||""===t?(this.H!==Ji&&this.R(),this.H=Ji):t!==this.H&&t!==qi&&this.m(t):void 0!==t._$litType$?this._(t):void 0!==t.nodeType?this.$(t):(t=>{var e;return Ci(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.g(t):this.m(t)}k(t,e=this.B){return this.A.parentNode.insertBefore(t,e)}$(t){this.H!==t&&(this.R(),this.H=this.k(t))}m(t){const e=this.A.nextSibling;null!==e&&3===e.nodeType&&(null===this.B?null===e.nextSibling:e===this.B.previousSibling)?e.data=t:this.$(Ti.createTextNode(t)),this.H=t}_(t){var e;const{values:n,_$litType$:r}=t,i="number"==typeof r?this.C(t):(void 0===r.el&&(r.el=Qi.createElement(r.h,this.options)),r);if((null===(e=this.H)||void 0===e?void 0:e.D)===i)this.H.v(n);else{const t=new Yi(i,this),e=t.u(this.options);t.v(n),this.$(e),this.H=t}}C(t){let e=Gi.get(t.strings);return void 0===e&&Gi.set(t.strings,e=new Qi(t)),e}g(t){Ci(this.H)||(this.H=[],this.R());const e=this.H;let n,r=0;for(const i of t)r===e.length?e.push(n=new to(this.k(Ri()),this.k(Ri()),this,this.options)):n=e[r],n.I(i),r++;r<e.length&&(this.R(n&&n.B.nextSibling,r),e.length=r)}R(t=this.A.nextSibling,e){var n;for(null===(n=this.P)||void 0===n||n.call(this,!1,!0,e);t&&t!==this.B;){const e=t.nextSibling;t.remove(),t=e}}}class eo{constructor(t,e,n,r,i){this.type=1,this.H=Ji,this.N=void 0,this.V=void 0,this.element=t,this.name=e,this.M=r,this.options=i,n.length>2||""!==n[0]||""!==n[1]?(this.H=Array(n.length-1).fill(Ji),this.strings=n):this.H=Ji}get tagName(){return this.element.tagName}I(t,e=this,n,r){const i=this.strings;let o=!1;if(void 0===i)t=Xi(this,t,e,0),o=!zi(t)||t!==this.H&&t!==qi,o&&(this.H=t);else{const r=t;let s,c;for(t=i[0],s=0;s<i.length-1;s++)c=Xi(this,r[n+s],e,s),c===qi&&(c=this.H[s]),o||(o=!zi(c)||c!==this.H[s]),c===Ji?t=Ji:t!==Ji&&(t+=(null!=c?c:"")+i[s+1]),this.H[s]=c}o&&!r&&this.W(t)}W(t){t===Ji?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class no extends eo{constructor(){super(...arguments),this.type=3}W(t){this.element[this.name]=t===Ji?void 0:t}}class ro extends eo{constructor(){super(...arguments),this.type=4}W(t){t&&t!==Ji?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)}}class io extends eo{constructor(){super(...arguments),this.type=5}I(t,e=this){var n;if((t=null!==(n=Xi(this,t,e,0))&&void 0!==n?n:Ji)===qi)return;const r=this.H,i=t===Ji&&r!==Ji||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==Ji&&(r===Ji||i);i&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this.H=t}handleEvent(t){var e,n;"function"==typeof this.H?this.H.call(null!==(n=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==n?n:this.element,t):this.H.handleEvent(t)}}class oo{constructor(t,e,n){this.element=t,this.type=6,this.N=void 0,this.V=void 0,this.M=e,this.options=n}I(t){Xi(this,t)}}null===(Si=(Ei=globalThis).litHtmlPlatformSupport)||void 0===Si||Si.call(Ei,Qi,to),(null!==(Ii=(Pi=globalThis).litHtmlVersions)&&void 0!==Ii?Ii:Pi.litHtmlVersions=[]).push("2.0.0-rc.2");const so=/^\s*</,co=function(t){this.cid=Ue("view"),this._domEvents=[],this.preinitialize.apply(this,arguments),Mt(this,Sr(t,ao)),this._ensureElement(),this.initialize.apply(this,arguments)};co.extend=ce;const uo=/^(\S+)\s*(.*)$/,ao=["model","collection","el","id","attributes","className","tagName","events"];Object.assign(co.prototype,Le,{tagName:"div",$:function(t){return this.el.querySelectorAll(t)},preinitialize:function(){},initialize:function(){},render:function(){return f(this.beforeRender)&&this.beforeRender(),f(this.toHTML)&&((t,e,n)=>{var r,i;const o=null!==(r=null==n?void 0:n.renderBefore)&&void 0!==r?r:e;let s=o._$litPart$;if(void 0===s){const t=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:null;o._$litPart$=s=new to(e.insertBefore(Ri(),t),t,void 0,n)}s.I(t)})(this.toHTML(),this.el),f(this.afterRender)&&this.afterRender(),this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.undelegateEvents(),this.el.parentNode&&this.el.parentNode.removeChild(this.el)},setElement:function(t){return this.undelegateEvents(),this._setElement(t),this.delegateEvents(),this},_setElement:function(t){if("string"==typeof t)if(so.test(t)){const e=document.createElement("div");e.innerHTML=t,this.el=e.firstChild}else this.el=document.querySelector(t);else t&&(!H(e=t)||1!==e.nodeType||Jn(e))&&t.length?this.el=t[0]:this.el=t;var e},delegateEvents:function(t){if(t||(t=se(this,"events")),!t)return this;this.undelegateEvents();for(const e in t){let n=t[e];if(f(n)||(n=this[n]),!n)continue;const r=e.match(uo);this.delegate(r[1],r[2],n.bind(this))}return this},delegate:function(t,e,n){const r=this.el;if(!r)return this;if("function"==typeof e&&(n=e,e=null),-1!==["focus","blur"].indexOf(t)){const r=this.el.querySelectorAll(e);for(let e=0,i=r.length;e<i;e++){const i=r[e];i.addEventListener(t,n,!1),this._domEvents.push({el:i,eventName:t,handler:n})}return n}const i=e?function(t){let i=t.target||t.srcElement;for(;i&&i!=r;i=i.parentNode)i.matches(e)&&(t.delegateTarget=i,n(t))}:n;return this.el.addEventListener(t,i,!1),this._domEvents.push({el:this.el,eventName:t,handler:i,listener:n,selector:e}),this},undelegateEvents:function(){if(this.el){for(let t=0,e=this._domEvents.length;t<e;t++){const e=this._domEvents[t];e.el.removeEventListener(e.eventName,e.handler,!1)}this._domEvents.length=0}return this},undelegate:function(t,e,n){if("function"==typeof e&&(n=e,e=null),this.el){const r=this._domEvents.slice();let i=r.length;for(;i--;){const o=r[i];!(o.eventName!==t||n&&o.listener!==n||e&&o.selector!==e)&&(o.el.removeEventListener(o.eventName,o.handler,!1),this._domEvents.splice(i,1))}}return this},_createElement:function(t){return document.createElement(t)},_ensureElement:function(){if(this.el)this.setElement(se(this,"el"));else{const t=Mt({},se(this,"attributes"));this.id&&(t.id=se(this,"id")),this.className&&(t.class=se(this,"className")),this.setElement(this._createElement(se(this,"tagName"))),this._setAttributes(t)}},_setAttributes:function(t){for(const e in t)e in this.el?this.el[e]=t[e]:this.el.setAttribute(e,t[e])}});const lo={Collection:si,Events:Le,History:vi,Model:Ir,Router:ji,View:co,ajax:pe,sync:de};Object.assign(lo,Le);const ho="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global;lo.VERSION="0.0.1";const fo=ho.Skeletor;return lo.noConflict=function(){return ho.Skeletor=fo,this},ho.Skeletor=lo,lo}));
7
+ var Ei,Si,Ii,Pi;Object.assign(ji.prototype,Le,{preinitialize:function(){},initialize:function(){},route:function(t,e,n){return _i(t)||(t=this._routeToRegExp(t)),f(e)&&(n=e,e=""),n||(n=this[e]),this.history.route(t,r=>{const i=this._extractParameters(t,r);!1!==this.execute(n,i,e)&&(this.trigger.apply(this,["route:"+e].concat(i)),this.trigger("route",e,i),this.history.trigger("route",this,e,i))}),this},execute:function(t,e,n){t&&t.apply(this,e)},navigate:function(t,e){return this.history.navigate(t,e),this},_bindRoutes:function(){if(!this.routes)return;let t;this.routes=se(this,"routes");const e=at(this.routes);for(;null!=(t=e.pop());)this.route(t,this.routes[t])},_routeToRegExp:function(t){return t=t.replace(Ai,"\\$&").replace(wi,"(?:$1)?").replace(xi,(function(t,e){return e?t:"([^/?]+)"})).replace(Oi,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){const n=t.exec(e).slice(1);return n.map((function(t,e){return e===n.length-1?t||null:t?decodeURIComponent(t):null}))}});const Mi=globalThis.trustedTypes,ki=Mi?Mi.createPolicy("lit-html",{createHTML:t=>t}):void 0,$i=`lit$${(Math.random()+"").slice(9)}$`,Hi="?"+$i,Ni=`<${Hi}>`,Ti=document,Ri=(t="")=>Ti.createComment(t),zi=t=>null===t||"object"!=typeof t&&"function"!=typeof t,Ci=Array.isArray,Ui=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Li=/-->/g,Bi=/>/g,Fi=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,Wi=/'/g,Di=/"/g,Vi=/^(?:script|style|textarea)$/i,qi=Symbol.for("lit-noChange"),Ji=Symbol.for("lit-nothing"),Gi=new WeakMap,Zi=Ti.createTreeWalker(Ti,129,null,!1),Ki=(t,e)=>{const n=t.length-1,r=[];let i,o=2===e?"<svg>":"",s=Ui;for(let e=0;e<n;e++){const n=t[e];let c,u,a=-1,l=0;for(;l<n.length&&(s.lastIndex=l,u=s.exec(n),null!==u);)l=s.lastIndex,s===Ui?"!--"===u[1]?s=Li:void 0!==u[1]?s=Bi:void 0!==u[2]?(Vi.test(u[2])&&(i=RegExp("</"+u[2],"g")),s=Fi):void 0!==u[3]&&(s=Fi):s===Fi?">"===u[0]?(s=null!=i?i:Ui,a=-1):void 0===u[1]?a=-2:(a=s.lastIndex-u[2].length,c=u[1],s=void 0===u[3]?Fi:'"'===u[3]?Di:Wi):s===Di||s===Wi?s=Fi:s===Li||s===Bi?s=Ui:(s=Fi,i=void 0);const h=s===Fi&&t[e+1].startsWith("/>")?" ":"";o+=s===Ui?n+Ni:a>=0?(r.push(c),n.slice(0,a)+"$lit$"+n.slice(a)+$i+h):n+$i+(-2===a?(r.push(void 0),e):h)}const c=o+(t[n]||"<?>")+(2===e?"</svg>":"");return[void 0!==ki?ki.createHTML(c):c,r]};class Qi{constructor({strings:t,_$litType$:e},n){let r;this.parts=[];let i=0,o=0;const s=t.length-1,c=this.parts,[u,a]=Ki(t,e);if(this.el=Qi.createElement(u,n),Zi.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(r=Zi.nextNode())&&c.length<s;){if(1===r.nodeType){if(r.hasAttributes()){const t=[];for(const e of r.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith($i)){const n=a[o++];if(t.push(e),void 0!==n){const t=r.getAttribute(n.toLowerCase()+"$lit$").split($i),e=/([.?@])?(.*)/.exec(n);c.push({type:1,index:i,name:e[2],strings:t,ctor:"."===e[1]?no:"?"===e[1]?ro:"@"===e[1]?io:eo})}else c.push({type:6,index:i})}for(const e of t)r.removeAttribute(e)}if(Vi.test(r.tagName)){const t=r.textContent.split($i),e=t.length-1;if(e>0){r.textContent=Mi?Mi.emptyScript:"";for(let n=0;n<e;n++)r.append(t[n],Ri()),Zi.nextNode(),c.push({type:2,index:++i});r.append(t[e],Ri())}}}else if(8===r.nodeType)if(r.data===Hi)c.push({type:2,index:i});else{let t=-1;for(;-1!==(t=r.data.indexOf($i,t+1));)c.push({type:7,index:i}),t+=$i.length-1}i++}}static createElement(t,e){const n=Ti.createElement("template");return n.innerHTML=t,n}}function Xi(t,e,n=t,r){var i,o,s,c;if(e===qi)return e;let u=void 0!==r?null===(i=n.Σi)||void 0===i?void 0:i[r]:n.Σo;const a=zi(e)?void 0:e._$litDirective$;return(null==u?void 0:u.constructor)!==a&&(null===(o=null==u?void 0:u.O)||void 0===o||o.call(u,!1),void 0===a?u=void 0:(u=new a(t),u.T(t,n,r)),void 0!==r?(null!==(s=(c=n).Σi)&&void 0!==s?s:c.Σi=[])[r]=u:n.Σo=u),void 0!==u&&(e=Xi(t,u.S(t,e.values),u,r)),e}class Yi{constructor(t,e){this.l=[],this.N=void 0,this.D=t,this.M=e}u(t){var e;const{el:{content:n},parts:r}=this.D,i=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:Ti).importNode(n,!0);Zi.currentNode=i;let o=Zi.nextNode(),s=0,c=0,u=r[0];for(;void 0!==u;){if(s===u.index){let e;2===u.type?e=new to(o,o.nextSibling,this,t):1===u.type?e=new u.ctor(o,u.name,u.strings,this,t):6===u.type&&(e=new oo(o,this,t)),this.l.push(e),u=r[++c]}s!==(null==u?void 0:u.index)&&(o=Zi.nextNode(),s++)}return i}v(t){let e=0;for(const n of this.l)void 0!==n&&(void 0!==n.strings?(n.I(t,n,e),e+=n.strings.length-2):n.I(t[e])),e++}}class to{constructor(t,e,n,r){this.type=2,this.N=void 0,this.A=t,this.B=e,this.M=n,this.options=r}setConnected(t){var e;null===(e=this.P)||void 0===e||e.call(this,t)}get parentNode(){return this.A.parentNode}get startNode(){return this.A}get endNode(){return this.B}I(t,e=this){t=Xi(this,t,e),zi(t)?t===Ji||null==t||""===t?(this.H!==Ji&&this.R(),this.H=Ji):t!==this.H&&t!==qi&&this.m(t):void 0!==t._$litType$?this._(t):void 0!==t.nodeType?this.$(t):(t=>{var e;return Ci(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.g(t):this.m(t)}k(t,e=this.B){return this.A.parentNode.insertBefore(t,e)}$(t){this.H!==t&&(this.R(),this.H=this.k(t))}m(t){const e=this.A.nextSibling;null!==e&&3===e.nodeType&&(null===this.B?null===e.nextSibling:e===this.B.previousSibling)?e.data=t:this.$(Ti.createTextNode(t)),this.H=t}_(t){var e;const{values:n,_$litType$:r}=t,i="number"==typeof r?this.C(t):(void 0===r.el&&(r.el=Qi.createElement(r.h,this.options)),r);if((null===(e=this.H)||void 0===e?void 0:e.D)===i)this.H.v(n);else{const t=new Yi(i,this),e=t.u(this.options);t.v(n),this.$(e),this.H=t}}C(t){let e=Gi.get(t.strings);return void 0===e&&Gi.set(t.strings,e=new Qi(t)),e}g(t){Ci(this.H)||(this.H=[],this.R());const e=this.H;let n,r=0;for(const i of t)r===e.length?e.push(n=new to(this.k(Ri()),this.k(Ri()),this,this.options)):n=e[r],n.I(i),r++;r<e.length&&(this.R(n&&n.B.nextSibling,r),e.length=r)}R(t=this.A.nextSibling,e){var n;for(null===(n=this.P)||void 0===n||n.call(this,!1,!0,e);t&&t!==this.B;){const e=t.nextSibling;t.remove(),t=e}}}class eo{constructor(t,e,n,r,i){this.type=1,this.H=Ji,this.N=void 0,this.V=void 0,this.element=t,this.name=e,this.M=r,this.options=i,n.length>2||""!==n[0]||""!==n[1]?(this.H=Array(n.length-1).fill(Ji),this.strings=n):this.H=Ji}get tagName(){return this.element.tagName}I(t,e=this,n,r){const i=this.strings;let o=!1;if(void 0===i)t=Xi(this,t,e,0),o=!zi(t)||t!==this.H&&t!==qi,o&&(this.H=t);else{const r=t;let s,c;for(t=i[0],s=0;s<i.length-1;s++)c=Xi(this,r[n+s],e,s),c===qi&&(c=this.H[s]),o||(o=!zi(c)||c!==this.H[s]),c===Ji?t=Ji:t!==Ji&&(t+=(null!=c?c:"")+i[s+1]),this.H[s]=c}o&&!r&&this.W(t)}W(t){t===Ji?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class no extends eo{constructor(){super(...arguments),this.type=3}W(t){this.element[this.name]=t===Ji?void 0:t}}class ro extends eo{constructor(){super(...arguments),this.type=4}W(t){t&&t!==Ji?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)}}class io extends eo{constructor(){super(...arguments),this.type=5}I(t,e=this){var n;if((t=null!==(n=Xi(this,t,e,0))&&void 0!==n?n:Ji)===qi)return;const r=this.H,i=t===Ji&&r!==Ji||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==Ji&&(r===Ji||i);i&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this.H=t}handleEvent(t){var e,n;"function"==typeof this.H?this.H.call(null!==(n=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==n?n:this.element,t):this.H.handleEvent(t)}}class oo{constructor(t,e,n){this.element=t,this.type=6,this.N=void 0,this.V=void 0,this.M=e,this.options=n}I(t){Xi(this,t)}}null===(Si=(Ei=globalThis).litHtmlPlatformSupport)||void 0===Si||Si.call(Ei,Qi,to),(null!==(Ii=(Pi=globalThis).litHtmlVersions)&&void 0!==Ii?Ii:Pi.litHtmlVersions=[]).push("2.0.0-rc.2");const so=/^\s*</,co=function(t){this.cid=Ue("view"),this._domEvents=[],this.preinitialize.apply(this,arguments),Mt(this,Sr(t,ao)),this._ensureElement(),this.initialize.apply(this,arguments)};co.extend=ce;const uo=/^(\S+)\s*(.*)$/,ao=["model","collection","el","id","attributes","className","tagName","events"];Object.assign(co.prototype,Le,{tagName:"div",$:function(t){return this.el.querySelectorAll(t)},preinitialize:function(){},initialize:function(){},render:function(){return f(this.beforeRender)&&this.beforeRender(),f(this.toHTML)&&((t,e,n)=>{var r,i;const o=null!==(r=null==n?void 0:n.renderBefore)&&void 0!==r?r:e;let s=o._$litPart$;if(void 0===s){const t=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:null;o._$litPart$=s=new to(e.insertBefore(Ri(),t),t,void 0,n)}s.I(t)})(this.toHTML(),this.el),f(this.afterRender)&&this.afterRender(),this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.undelegateEvents(),this.el.parentNode&&this.el.parentNode.removeChild(this.el)},setElement:function(t){return this.undelegateEvents(),this._setElement(t),this.delegateEvents(),this},_setElement:function(t){if("string"==typeof t)if(so.test(t)){const e=document.createElement("div");e.innerHTML=t,this.el=e.firstChild}else this.el=document.querySelector(t);else t&&(!$(e=t)||1!==e.nodeType||Jn(e))&&t.length?this.el=t[0]:this.el=t;var e},delegateEvents:function(t){if(t||(t=se(this,"events")),!t)return this;this.undelegateEvents();for(const e in t){let n=t[e];if(f(n)||(n=this[n]),!n)continue;const r=e.match(uo);this.delegate(r[1],r[2],n.bind(this))}return this},delegate:function(t,e,n){const r=this.el;if(!r)return this;if("function"==typeof e&&(n=e,e=null),-1!==["focus","blur"].indexOf(t)){const r=this.el.querySelectorAll(e);for(let e=0,i=r.length;e<i;e++){const i=r[e];i.addEventListener(t,n,!1),this._domEvents.push({el:i,eventName:t,handler:n})}return n}const i=e?function(t){let i=t.target||t.srcElement;for(;i&&i!=r;i=i.parentNode)i.matches(e)&&(t.delegateTarget=i,n(t))}:n;return this.el.addEventListener(t,i,!1),this._domEvents.push({el:this.el,eventName:t,handler:i,listener:n,selector:e}),this},undelegateEvents:function(){if(this.el){for(let t=0,e=this._domEvents.length;t<e;t++){const e=this._domEvents[t];e.el.removeEventListener(e.eventName,e.handler,!1)}this._domEvents.length=0}return this},undelegate:function(t,e,n){if("function"==typeof e&&(n=e,e=null),this.el){const r=this._domEvents.slice();let i=r.length;for(;i--;){const o=r[i];!(o.eventName!==t||n&&o.listener!==n||e&&o.selector!==e)&&(o.el.removeEventListener(o.eventName,o.handler,!1),this._domEvents.splice(i,1))}}return this},_createElement:function(t){return document.createElement(t)},_ensureElement:function(){if(this.el)this.setElement(se(this,"el"));else{const t=Mt({},se(this,"attributes"));this.id&&(t.id=se(this,"id")),this.className&&(t.class=se(this,"className")),this.setElement(this._createElement(se(this,"tagName"))),this._setAttributes(t)}},_setAttributes:function(t){for(const e in t)e in this.el?this.el[e]=t[e]:this.el.setAttribute(e,t[e])}});const lo={Collection:si,Events:Le,History:vi,Model:Ir,Router:ji,View:co,ajax:pe,sync:de};Object.assign(lo,Le);const ho="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global;lo.VERSION="0.0.1";const fo=ho.Skeletor;return lo.noConflict=function(){return ho.Skeletor=fo,this},ho.Skeletor=lo,lo}));
8
8
  //# sourceMappingURL=skeletor.min.js.map