@open-condo/apollo
Version:
A wrapper over @apollo/client that allows you to use persistent cache from local storage, configure TTL, invalidate cache, and use a single configuration for getServerSideProps, SSR, and CSR
6 lines • 261 kB
JavaScript
"use strict";var e=require("react"),t=require("@apollo/client/core"),n=require("@apollo/client"),r=require("crypto"),i=require("@apollo/client/utilities"),o=require("@apollo/client/link/http");function a(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var s,c=a(e),u=a(t),l=a(n),p=a(i),d=a(o),f=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},h=function(){function e(e){var t=e.debug,n=void 0!==t&&t;this.debug=n,this.lines=[]}return e.prototype.emit=function(t,n){if(t in console){var r=e.prefix;console[t].apply(console,f([r],n,!1))}},e.prototype.tailLogs=function(){var e=this;this.lines.forEach(function(t){var n=t[0],r=t[1];return e.emit(n,r)})},e.prototype.getLogs=function(){return this.lines},e.prototype.write=function(t,n){var r=e.buffer;this.lines=f(f([],this.lines.slice(1-r),!0),[[t,n]],!1),(this.debug||"log"!==t)&&this.emit(t,n)},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.write("log",e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.write("warn",e)},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.write("error",e)},e.buffer=30,e.prefix="[apollo-cache-persist]",e}(),y=function(){function e(e){var t=e.cache,n=e.serialize,r=void 0===n||n;this.cache=t,this.serialize=r}return e.prototype.extract=function(){var e=this.cache.extract();return this.serialize&&(e=JSON.stringify(e)),e},e.prototype.restore=function(e){this.serialize&&"string"==typeof e&&(e=JSON.parse(e)),null!=e&&this.cache.restore(e)},e}(),v=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},m=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},g=function(){function e(e){var t=e.storage,n=e.key,r=void 0===n?"apollo-cache-persist":n;this.storage=t,this.key=r}return e.prototype.read=function(){return v(this,void 0,void 0,function(){return m(this,function(e){return[2,this.storage.getItem(this.key)]})})},e.prototype.write=function(e){return v(this,void 0,void 0,function(){return m(this,function(t){switch(t.label){case 0:return[4,this.storage.setItem(this.key,e)];case 1:return t.sent(),[2]}})})},e.prototype.purge=function(){return v(this,void 0,void 0,function(){return m(this,function(e){switch(e.label){case 0:return[4,this.storage.removeItem(this.key)];case 1:return e.sent(),[2]}})})},e.prototype.getSize=function(){return v(this,void 0,void 0,function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,this.storage.getItem(this.key)];case 1:return null==(e=t.sent())?[2,0]:[2,"string"==typeof e?e.length:null]}})})},e}(),E=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},T=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},b=function(){function e(e,t){var n=e.log,r=e.cache,i=e.storage,o=t.maxSize,a=void 0===o?1048576:o,s=t.persistenceMapper;this.log=n,this.cache=r,this.storage=i,this.paused=!1,s&&(this.persistenceMapper=s),a&&(this.maxSize=a)}return e.prototype.persist=function(){return E(this,void 0,void 0,function(){var e,t;return T(this,function(n){switch(n.label){case 0:return n.trys.push([0,6,,7]),e=this.cache.extract(),this.paused||!this.persistenceMapper?[3,2]:[4,this.persistenceMapper(e)];case 1:e=n.sent(),n.label=2;case 2:return null!=this.maxSize&&"string"==typeof e&&e.length>this.maxSize&&!this.paused?[4,this.purge()]:[3,4];case 3:return n.sent(),this.paused=!0,[2];case 4:return this.paused?[2]:[4,this.storage.write(e)];case 5:return n.sent(),this.log.info("string"==typeof e?"Persisted cache of size ".concat(e.length," characters"):"Persisted cache"),[3,7];case 6:throw t=n.sent(),this.log.error("Error persisting cache",t),t;case 7:return[2]}})})},e.prototype.restore=function(){return E(this,void 0,void 0,function(){var e,t;return T(this,function(n){switch(n.label){case 0:return n.trys.push([0,5,,6]),[4,this.storage.read()];case 1:return null==(e=n.sent())?[3,3]:[4,this.cache.restore(e)];case 2:return n.sent(),this.log.info("string"==typeof e?"Restored cache of size ".concat(e.length," characters"):"Restored cache"),[3,4];case 3:this.log.info("No stored cache to restore"),n.label=4;case 4:return[3,6];case 5:throw t=n.sent(),this.log.error("Error restoring cache",t),t;case 6:return[2]}})})},e.prototype.purge=function(){return E(this,void 0,void 0,function(){var e;return T(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.storage.purge()];case 1:return t.sent(),this.log.info("Purged cache storage"),[3,3];case 2:throw e=t.sent(),this.log.error("Error purging cache storage",e),e;case 3:return[2]}})})},e}(),_=function(e){var t=e.cache;return function(e){var n=t.write,r=t.evict,i=t.modify,o=t.gc;return t.write=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=n.apply(t,r);return e(),o},t.evict=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=r.apply(t,n);return e(),o},t.modify=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=i.apply(t,n);return e(),o},t.gc=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=o.apply(t,n);return e(),i},function(){t.write=n,t.evict=r,t.modify=i,t.gc=o}}},N=function(){function e(t,n){var r=t.log,i=t.persistor,o=this;this.fire=function(){o.debounce?(null!=o.timeout&&clearTimeout(o.timeout),o.timeout=setTimeout(o.persist,o.debounce)):o.persist()},this.persist=function(){o.paused||o.persistor.persist()};var a=e.defaultDebounce,s=n.cache,c=n.debounce,u=n.trigger,l=void 0===u?"write":u;if(l)switch(this.debounce=null!=c?c:a,this.persistor=i,this.paused=!1,l){case"write":this.uninstall=_({cache:s})(this.fire);break;case"background":c&&r.warn("Debounce is not recommended with `background` trigger"),this.debounce=c,this.uninstall=function(e){var t=e.log,n=e.cache;return function(e){return t.warn("Trigger option `background` not available on web; using `write` trigger"),_({cache:n})(e)}}({cache:s,log:r})(this.fire);break;default:if("function"!=typeof l)throw Error("Unrecognized trigger option: ".concat(l));this.uninstall=l(this.fire)}}return e.prototype.pause=function(){this.paused=!0},e.prototype.resume=function(){this.paused=!1},e.prototype.remove=function(){this.uninstall&&(this.uninstall(),this.uninstall=null,this.paused=!0)},e.defaultDebounce=1e3,e}(),I=function(){function e(e){if(!e.cache)throw new Error("In order to persist your Apollo Cache, you need to pass in a cache. Please see https://www.apollographql.com/docs/react/basics/caching.html for our default InMemoryCache.");if(!e.storage)throw new Error("In order to persist your Apollo Cache, you need to pass in an underlying storage provider. Please see https://github.com/apollographql/apollo-cache-persist#storage-providers");var t=new h(e),n=new y(e),r=new g(e),i=new b({log:t,cache:n,storage:r},e),o=new N({log:t,persistor:i},e);this.log=t,this.cache=n,this.storage=r,this.persistor=i,this.trigger=o}return e.prototype.persist=function(){return this.persistor.persist()},e.prototype.restore=function(){return this.persistor.restore()},e.prototype.purge=function(){return this.persistor.purge()},e.prototype.pause=function(){this.trigger.pause()},e.prototype.resume=function(){this.trigger.resume()},e.prototype.remove=function(){this.trigger.remove()},e.prototype.getLogs=function(e){if(void 0===e&&(e=!1),!e)return this.log.getLogs();this.log.tailLogs()},e.prototype.getSize=function(){return this.storage.getSize()},e}(),O=(s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},s(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});!function(e){function t(t){var n=e.call(this,t)||this;return n.storage=new A(t),n.persistor=new w({log:n.log,cache:n.cache,storage:n.storage},t),n}O(t,e),t.prototype.restoreSync=function(){this.persistor.restoreSync()}}(I);var w=function(e){function t(t,n){var r=t.log,i=t.cache,o=t.storage;return e.call(this,{log:r,cache:i,storage:o},n)||this}return O(t,e),t.prototype.restoreSync=function(){this.cache.restore(this.storage.readSync())},t}(b),A=function(e){function t(t){return e.call(this,t)||this}return O(t,e),t.prototype.readSync=function(){return this.storage.getItem(this.key)},t}(g),S=function(){function e(e){this.storage=e}return e.prototype.getItem=function(e){return this.storage.getItem(e)},e.prototype.removeItem=function(e){return this.storage.removeItem(e)},e.prototype.setItem=function(e,t){return null!==t?this.storage.setItem(e,t):this.removeItem(e)},e}();function D(){return"undefined"==typeof window}const R="__APOLLO_STATE__";function F(e){return new I({cache:e,storage:new S(window.localStorage),debug:"development"===process.env.NODE_ENV,key:"__APOLLO_PERSISTED_CACHE__"})}const k=e.createContext({});function x(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function j(e,t,n,r){return new(n||(n=Promise))(function(t,i){function o(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n(function(e){e(r)})).then(o,a)}s((r=r.apply(e,[])).next())})}var C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function P(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function L(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var $=L(u),M=L(d);const V=class{constructor({uri:e,name:t,type:n}){this.uri=e,this.name=t,this.type=n}};var U=function(e){return"undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Blob&&e instanceof Blob||e instanceof V};const B=U;var G=U;const{ApolloLink:Q,Observable:Y}=$,{createSignalIfSupported:q,fallbackHttpConfig:z,parseAndCheckHttpResponse:W,rewriteURIForGET:J,selectHttpOptionsAndBody:K,selectURI:X,serializeFetchParameter:H}=M,Z=function(e,t="",n=B){const r=new Map,i=new Map;return{clone:function e(t,o,a){let s=t;if(n(t)){s=null;const e=r.get(t);e?e.push(o):r.set(t,[o])}else{const n=Array.isArray(t)||"undefined"!=typeof FileList&&t instanceof FileList,r=t&&t.constructor===Object;if(n||r){const r=i.has(t);if(r?s=i.get(t):(s=n?[]:{},i.set(t,s)),!a.has(t)){const i=o?`${o}.`:"",c=new Set(a).add(t);if(n){let n=0;for(const o of t){const t=e(o,i+n++,c);r||s.push(t)}}else for(const n in t){const o=e(t[n],i+n,c);r||(s[n]=o)}}}}return s}(e,t,new Set),files:r}},ee=function(e,t,n){e.append(t,n,n.name)},te=G;var ne=function({uri:e="/graphql",useGETForQueries:t,isExtractableFile:n=te,FormData:r,formDataAppendFile:i=ee,fetch:o,fetchOptions:a,credentials:s,headers:c,includeExtensions:u}={}){const l={http:{includeExtensions:u},options:a,credentials:s,headers:c};return new Q(a=>{const s=a.getContext(),{clientAwareness:{name:c,version:u}={},headers:p}=s,d={http:s.http,options:s.fetchOptions,credentials:s.credentials,headers:{...c&&{"apollographql-client-name":c},...u&&{"apollographql-client-version":u},...p}},{options:f,body:h}=K(a,z,l,d),{clone:y,files:v}=Z(h,"",n);let m=X(a,e);if(v.size){delete f.headers["content-type"];const e=new(r||FormData);e.append("operations",H(y,"Payload"));const t={};let n=0;v.forEach(e=>{t[++n]=e}),e.append("map",JSON.stringify(t)),n=0,v.forEach((t,r)=>{i(e,++n,r)}),f.body=e}else if(t&&!a.query.definitions.some(e=>"OperationDefinition"===e.kind&&"mutation"===e.operation)&&(f.method="GET"),"GET"===f.method){const{newURI:e,parseError:t}=J(m,h);if(t)return new Y(e=>{e.error(t)});m=e}else f.body=H(y,"Payload");const{controller:g}=q();g&&(f.signal&&(f.signal.aborted?g.abort():f.signal.addEventListener("abort",()=>{g.abort()},{once:!0})),f.signal=g.signal);const E=o||fetch;return new Y(e=>{let t;return E(m,f).then(e=>(a.setContext({response:e}),e)).then(W(a)).then(t=>{e.next(t),e.complete()}).catch(n=>{t||(n.result&&n.result.errors&&n.result.data&&e.next(n.result),e.error(n))}),()=>{t=!0,g&&g.abort()}})})},re=P(ne);var ie=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},oe="object"==typeof C&&C&&C.Object===Object&&C,ae=oe,se="object"==typeof self&&self&&self.Object===Object&&self,ce=ae||se||Function("return this")(),ue=ce.Symbol,le=ue,pe=Object.prototype,de=pe.hasOwnProperty,fe=pe.toString,he=le?le.toStringTag:void 0;var ye=function(e){var t=de.call(e,he),n=e[he];try{e[he]=void 0;var r=!0}catch(e){}var i=fe.call(e);return r&&(t?e[he]=n:delete e[he]),i},ve=Object.prototype.toString;var me=ye,ge=function(e){return ve.call(e)},Ee=ue?ue.toStringTag:void 0;var Te=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Ee&&Ee in Object(e)?me(e):ge(e)};var be=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},_e=Te,Ne=be;var Ie,Oe=function(e){if(!Ne(e))return!1;var t=_e(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},we=ce["__core-js_shared__"],Ae=(Ie=/[^.]+$/.exec(we&&we.keys&&we.keys.IE_PROTO||""))?"Symbol(src)_1."+Ie:"";var Se=function(e){return!!Ae&&Ae in e},De=Function.prototype.toString;var Re=function(e){if(null!=e){try{return De.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Fe=Oe,ke=Se,xe=be,je=Re,Ce=/^\[object .+?Constructor\]$/,Pe=Function.prototype,Le=Object.prototype,$e=Pe.toString,Me=Le.hasOwnProperty,Ve=RegExp("^"+$e.call(Me).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Ue=function(e){return!(!xe(e)||ke(e))&&(Fe(e)?Ve:Ce).test(je(e))},Be=function(e,t){return null==e?void 0:e[t]};var Ge=function(e,t){var n=Be(e,t);return Ue(n)?n:void 0},Qe=Ge,Ye=function(){try{var e=Qe(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),qe=Ye;var ze=function(e,t,n){"__proto__"==t&&qe?qe(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var We=function(e){return e};var Je=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},Ke=Je,Xe=Math.max;var He=function(e,t,n){return t=Xe(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=Xe(r.length-t,0),a=Array(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(a),Ke(e,this,s)}};var Ze=function(e){return function(){return e}},et=Ye,tt=et?function(e,t){return et(e,"toString",{configurable:!0,enumerable:!1,value:Ze(t),writable:!0})}:We,nt=Date.now;var rt=function(e){var t=0,n=0;return function(){var r=nt(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}},it=rt(tt),ot=We,at=He,st=it;var ct=function(e,t){return st(at(e,t,ot),e+"")},ut=Ge(ce,"WeakMap"),lt=ut&&new ut,pt=lt,dt=pt?function(e,t){return pt.set(e,t),e}:We,ft=be,ht=Object.create,yt=function(){function e(){}return function(t){if(!ft(t))return{};if(ht)return ht(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),vt=yt,mt=be;var gt=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=vt(e.prototype),r=e.apply(n,t);return mt(r)?r:n}},Et=gt,Tt=ce;var bt=function(e,t,n){var r=1&t,i=Et(e);return function t(){return(this&&this!==Tt&&this instanceof t?i:e).apply(r?n:this,arguments)}},_t=Math.max;var Nt=function(e,t,n,r){for(var i=-1,o=e.length,a=n.length,s=-1,c=t.length,u=_t(o-a,0),l=Array(c+u),p=!r;++s<c;)l[s]=t[s];for(;++i<a;)(p||i<o)&&(l[n[i]]=e[i]);for(;u--;)l[s++]=e[i++];return l},It=Math.max;var Ot=function(e,t,n,r){for(var i=-1,o=e.length,a=-1,s=n.length,c=-1,u=t.length,l=It(o-s,0),p=Array(l+u),d=!r;++i<l;)p[i]=e[i];for(var f=i;++c<u;)p[f+c]=t[c];for(;++a<s;)(d||i<o)&&(p[f+n[a]]=e[i++]);return p};var wt=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r};var At=function(){},St=yt,Dt=At;function Rt(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}Rt.prototype=St(Dt.prototype),Rt.prototype.constructor=Rt;var Ft=Rt;var kt=lt,xt=kt?function(e){return kt.get(e)}:function(){},jt={},Ct=Object.prototype.hasOwnProperty;var Pt=function(e){for(var t=e.name+"",n=jt[t],r=Ct.call(jt,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t},Lt=yt,$t=At;function Mt(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}Mt.prototype=Lt($t.prototype),Mt.prototype.constructor=Mt;var Vt=Mt,Ut=Array.isArray;var Bt=function(e){return null!=e&&"object"==typeof e};var Gt=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t},Qt=Ft,Yt=Vt,qt=Gt;var zt=Ft,Wt=Vt,Jt=At,Kt=Ut,Xt=Bt,Ht=function(e){if(e instanceof Qt)return e.clone();var t=new Yt(e.__wrapped__,e.__chain__);return t.__actions__=qt(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t},Zt=Object.prototype.hasOwnProperty;function en(e){if(Xt(e)&&!Kt(e)&&!(e instanceof zt)){if(e instanceof Wt)return e;if(Zt.call(e,"__wrapped__"))return Ht(e)}return new Wt(e)}en.prototype=Jt.prototype,en.prototype.constructor=en;var tn=Ft,nn=xt,rn=Pt,on=en;var an=function(e){var t=rn(e),n=on[t];if("function"!=typeof n||!(t in tn.prototype))return!1;if(e===n)return!0;var r=nn(n);return!!r&&e===r[0]},sn=rt(dt),cn=/\{\n\/\* \[wrapped with (.+)\] \*/,un=/,? & /;var ln=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;var pn=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1},dn=function(e){return e!=e},fn=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1};var hn=function(e,t,n){return t==t?fn(e,t,n):pn(e,dn,n)};var yn=ie,vn=function(e,t){return!!(null==e?0:e.length)&&hn(e,t,0)>-1},mn=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];var gn=function(e){var t=e.match(cn);return t?t[1].split(un):[]},En=function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ln,"{\n/* [wrapped with "+t+"] */\n")},Tn=it,bn=function(e,t){return yn(mn,function(n){var r="_."+n[0];t&n[1]&&!vn(e,r)&&e.push(r)}),e.sort()};var _n=function(e,t,n){var r=t+"";return Tn(e,En(r,bn(gn(r),n)))},Nn=an,In=sn,On=_n;var wn=function(e,t,n,r,i,o,a,s,c,u){var l=8&t;t|=l?32:64,4&(t&=~(l?64:32))||(t&=-4);var p=[e,t,i,l?o:void 0,l?a:void 0,l?void 0:o,l?void 0:a,s,c,u],d=n.apply(void 0,p);return Nn(e)&&In(d,p),d.placeholder=r,On(d,e,t)};var An=function(e){return e.placeholder},Sn=/^(?:0|[1-9]\d*)$/;var Dn=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Sn.test(e))&&e>-1&&e%1==0&&e<t},Rn=Gt,Fn=Dn,kn=Math.min;var xn="__lodash_placeholder__";var jn=function(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n];a!==t&&a!==xn||(e[n]=xn,o[i++]=n)}return o},Cn=Nt,Pn=Ot,Ln=wt,$n=gt,Mn=wn,Vn=An,Un=function(e,t){for(var n=e.length,r=kn(t.length,n),i=Rn(e);r--;){var o=t[r];e[r]=Fn(o,n)?i[o]:void 0}return e},Bn=jn,Gn=ce;var Qn=function e(t,n,r,i,o,a,s,c,u,l){var p=128&n,d=1&n,f=2&n,h=24&n,y=512&n,v=f?void 0:$n(t);return function m(){for(var g=arguments.length,E=Array(g),T=g;T--;)E[T]=arguments[T];if(h)var b=Vn(m),_=Ln(E,b);if(i&&(E=Cn(E,i,o,h)),a&&(E=Pn(E,a,s,h)),g-=_,h&&g<l){var N=Bn(E,b);return Mn(t,n,e,m.placeholder,r,E,N,c,u,l-g)}var I=d?r:this,O=f?I[t]:t;return g=E.length,c?E=Un(E,c):y&&g>1&&E.reverse(),p&&u<g&&(E.length=u),this&&this!==Gn&&this instanceof m&&(O=v||$n(O)),O.apply(I,E)}},Yn=Je,qn=gt,zn=Qn,Wn=wn,Jn=An,Kn=jn,Xn=ce;var Hn=function(e,t,n){var r=qn(e);return function i(){for(var o=arguments.length,a=Array(o),s=o,c=Jn(i);s--;)a[s]=arguments[s];var u=o<3&&a[0]!==c&&a[o-1]!==c?[]:Kn(a,c);return(o-=u.length)<n?Wn(e,t,zn,i.placeholder,void 0,a,u,void 0,void 0,n-o):Yn(this&&this!==Xn&&this instanceof i?r:e,this,a)}},Zn=Je,er=gt,tr=ce;var nr=function(e,t,n,r){var i=1&t,o=er(e);return function t(){for(var a=-1,s=arguments.length,c=-1,u=r.length,l=Array(u+s),p=this&&this!==tr&&this instanceof t?o:e;++c<u;)l[c]=r[c];for(;s--;)l[c++]=arguments[++a];return Zn(p,i?n:this,l)}},rr=Nt,ir=Ot,or=jn,ar="__lodash_placeholder__",sr=128,cr=Math.min;var ur=/\s/;var lr=function(e){for(var t=e.length;t--&&ur.test(e.charAt(t)););return t},pr=/^\s+/;var dr=Te,fr=Bt;var hr=function(e){return"symbol"==typeof e||fr(e)&&"[object Symbol]"==dr(e)},yr=function(e){return e?e.slice(0,lr(e)+1).replace(pr,""):e},vr=be,mr=hr,gr=/^[-+]0x[0-9a-f]+$/i,Er=/^0b[01]+$/i,Tr=/^0o[0-7]+$/i,br=parseInt;var _r=function(e){if("number"==typeof e)return e;if(mr(e))return NaN;if(vr(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=vr(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=yr(e);var n=Er.test(e);return n||Tr.test(e)?br(e.slice(2),n?2:8):gr.test(e)?NaN:+e},Nr=1/0;var Ir=function(e){return e?(e=_r(e))===Nr||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0};var Or=function(e){var t=Ir(e),n=t%1;return t==t?n?t-n:t:0},wr=dt,Ar=bt,Sr=Hn,Dr=Qn,Rr=nr,Fr=xt,kr=function(e,t){var n=e[1],r=t[1],i=n|r,o=i<131,a=r==sr&&8==n||r==sr&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!o&&!a)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var s=t[3];if(s){var c=e[3];e[3]=c?rr(c,s,t[4]):s,e[4]=c?or(e[3],ar):t[4]}return(s=t[5])&&(c=e[5],e[5]=c?ir(c,s,t[6]):s,e[6]=c?or(e[5],ar):t[6]),(s=t[7])&&(e[7]=s),r&sr&&(e[8]=null==e[8]?t[8]:cr(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e},xr=sn,jr=_n,Cr=Or,Pr=Math.max;var Lr=function(e,t,n,r,i,o,a,s){var c=2&t;if(!c&&"function"!=typeof e)throw new TypeError("Expected a function");var u=r?r.length:0;if(u||(t&=-97,r=i=void 0),a=void 0===a?a:Pr(Cr(a),0),s=void 0===s?s:Cr(s),u-=i?i.length:0,64&t){var l=r,p=i;r=i=void 0}var d=c?void 0:Fr(e),f=[e,t,n,r,i,l,p,o,a,s];if(d&&kr(f,d),e=f[0],t=f[1],n=f[2],r=f[3],i=f[4],!(s=f[9]=void 0===f[9]?c?0:e.length:Pr(f[9]-u,0))&&24&t&&(t&=-25),t&&1!=t)h=8==t||16==t?Sr(e,t,s):32!=t&&33!=t||i.length?Dr.apply(void 0,f):Rr(e,t,n,r);else var h=Ar(e,t,n);return jr((d?wr:xr)(h,f),e,t)},$r=An,Mr=jn,Vr=ct(function(e,t,n){var r=1;if(n.length){var i=Mr(n,$r(Vr));r|=32}return Lr(e,r,t,n,i)});Vr.placeholder={};var Ur=Vr;var Br=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},Gr=Te,Qr=Bt;var Yr=function(e){return Qr(e)&&"[object Arguments]"==Gr(e)},qr=Bt,zr=Object.prototype,Wr=zr.hasOwnProperty,Jr=zr.propertyIsEnumerable,Kr=Yr(function(){return arguments}())?Yr:function(e){return qr(e)&&Wr.call(e,"callee")&&!Jr.call(e,"callee")},Xr=Kr,Hr=Ut,Zr=ue?ue.isConcatSpreadable:void 0;var ei=Br,ti=function(e){return Hr(e)||Xr(e)||!!(Zr&&e&&e[Zr])};var ni=function e(t,n,r,i,o){var a=-1,s=t.length;for(r||(r=ti),o||(o=[]);++a<s;){var c=t[a];n>0&&r(c)?n>1?e(c,n-1,r,i,o):ei(o,c):i||(o[o.length]=c)}return o},ri=ni;var ii=function(e){return(null==e?0:e.length)?ri(e,1):[]},oi=He,ai=it;var si=function(e){return ai(oi(e,void 0,ii),e+"")},ci=hr;var ui=function(e){if("string"==typeof e||ci(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},li=ie,pi=ze,di=Ur,fi=ui,hi=P(si(function(e,t){return li(t,function(t){t=fi(t),pi(e,t,di(e[t],e))}),e})),yi=Ut,vi=hr,mi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,gi=/^\w*$/;var Ei=function(e,t){if(yi(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!vi(e))||(gi.test(e)||!mi.test(e)||null!=t&&e in Object(t))},Ti=Ge(Object,"create"),bi=Ti;var _i=function(){this.__data__=bi?bi(null):{},this.size=0};var Ni=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ii=Ti,Oi=Object.prototype.hasOwnProperty;var wi=function(e){var t=this.__data__;if(Ii){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Oi.call(t,e)?t[e]:void 0},Ai=Ti,Si=Object.prototype.hasOwnProperty;var Di=Ti;var Ri=_i,Fi=Ni,ki=wi,xi=function(e){var t=this.__data__;return Ai?void 0!==t[e]:Si.call(t,e)},ji=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Di&&void 0===t?"__lodash_hash_undefined__":t,this};function Ci(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ci.prototype.clear=Ri,Ci.prototype.delete=Fi,Ci.prototype.get=ki,Ci.prototype.has=xi,Ci.prototype.set=ji;var Pi=Ci;var Li=function(){this.__data__=[],this.size=0};var $i=function(e,t){return e===t||e!=e&&t!=t},Mi=$i;var Vi=function(e,t){for(var n=e.length;n--;)if(Mi(e[n][0],t))return n;return-1},Ui=Vi,Bi=Array.prototype.splice;var Gi=Vi;var Qi=Vi;var Yi=Vi;var qi=Li,zi=function(e){var t=this.__data__,n=Ui(t,e);return!(n<0)&&(n==t.length-1?t.pop():Bi.call(t,n,1),--this.size,!0)},Wi=function(e){var t=this.__data__,n=Gi(t,e);return n<0?void 0:t[n][1]},Ji=function(e){return Qi(this.__data__,e)>-1},Ki=function(e,t){var n=this.__data__,r=Yi(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function Xi(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Xi.prototype.clear=qi,Xi.prototype.delete=zi,Xi.prototype.get=Wi,Xi.prototype.has=Ji,Xi.prototype.set=Ki;var Hi=Xi,Zi=Ge(ce,"Map"),eo=Pi,to=Hi,no=Zi;var ro=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var io=function(e,t){var n=e.__data__;return ro(t)?n["string"==typeof t?"string":"hash"]:n.map},oo=io;var ao=io;var so=io;var co=io;var uo=function(){this.size=0,this.__data__={hash:new eo,map:new(no||to),string:new eo}},lo=function(e){var t=oo(this,e).delete(e);return this.size-=t?1:0,t},po=function(e){return ao(this,e).get(e)},fo=function(e){return so(this,e).has(e)},ho=function(e,t){var n=co(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function yo(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}yo.prototype.clear=uo,yo.prototype.delete=lo,yo.prototype.get=po,yo.prototype.has=fo,yo.prototype.set=ho;var vo=yo,mo=vo;function go(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(go.Cache||mo),n}go.Cache=mo;var Eo=go;var To=function(e){var t=Eo(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t},bo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_o=/\\(\\)?/g,No=To(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(bo,function(e,n,r,i){t.push(r?i.replace(_o,"$1"):n||e)}),t});var Io=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i},Oo=Io,wo=Ut,Ao=hr,So=ue?ue.prototype:void 0,Do=So?So.toString:void 0;var Ro=function e(t){if("string"==typeof t)return t;if(wo(t))return Oo(t,e)+"";if(Ao(t))return Do?Do.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n},Fo=Ro;var ko=Ut,xo=Ei,jo=No,Co=function(e){return null==e?"":Fo(e)};var Po=function(e,t){return ko(e)?e:xo(e,t)?[e]:jo(Co(e))},Lo=Po,$o=ui;var Mo=function(e,t){for(var n=0,r=(t=Lo(t,e)).length;null!=e&&n<r;)e=e[$o(t[n++])];return n&&n==r?e:void 0},Vo=Mo;var Uo=function(e,t,n){var r=null==e?void 0:Vo(e,t);return void 0===r?n:r},Bo=P(Uo),Go=Hi;var Qo=Hi,Yo=Zi,qo=vo;var zo=Hi,Wo=function(){this.__data__=new Go,this.size=0},Jo=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Ko=function(e){return this.__data__.get(e)},Xo=function(e){return this.__data__.has(e)},Ho=function(e,t){var n=this.__data__;if(n instanceof Qo){var r=n.__data__;if(!Yo||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new qo(r)}return n.set(e,t),this.size=n.size,this};function Zo(e){var t=this.__data__=new zo(e);this.size=t.size}Zo.prototype.clear=Wo,Zo.prototype.delete=Jo,Zo.prototype.get=Ko,Zo.prototype.has=Xo,Zo.prototype.set=Ho;var ea=Zo;var ta=vo,na=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},ra=function(e){return this.__data__.has(e)};function ia(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new ta;++t<n;)this.add(e[t])}ia.prototype.add=ia.prototype.push=na,ia.prototype.has=ra;var oa=function(e,t){return e.has(t)},aa=ia,sa=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},ca=oa;var ua=function(e,t,n,r,i,o){var a=1&n,s=e.length,c=t.length;if(s!=c&&!(a&&c>s))return!1;var u=o.get(e),l=o.get(t);if(u&&l)return u==t&&l==e;var p=-1,d=!0,f=2&n?new aa:void 0;for(o.set(e,t),o.set(t,e);++p<s;){var h=e[p],y=t[p];if(r)var v=a?r(y,h,p,t,e,o):r(h,y,p,e,t,o);if(void 0!==v){if(v)continue;d=!1;break}if(f){if(!sa(t,function(e,t){if(!ca(f,t)&&(h===e||i(h,e,n,r,o)))return f.push(t)})){d=!1;break}}else if(h!==y&&!i(h,y,n,r,o)){d=!1;break}}return o.delete(e),o.delete(t),d},la=ce.Uint8Array;var pa=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n},da=la,fa=$i,ha=ua,ya=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n},va=pa,ma=ue?ue.prototype:void 0,ga=ma?ma.valueOf:void 0;var Ea=function(e,t,n,r,i,o,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new da(e),new da(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return fa(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=ya;case"[object Set]":var c=1&r;if(s||(s=va),e.size!=t.size&&!c)return!1;var u=a.get(e);if(u)return u==t;r|=2,a.set(e,t);var l=ha(s(e),s(t),r,i,o,a);return a.delete(e),l;case"[object Symbol]":if(ga)return ga.call(e)==ga.call(t)}return!1},Ta=Br,ba=Ut;var _a=function(e,t,n){var r=t(e);return ba(e)?r:Ta(r,n(e))};var Na=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o};var Ia=function(){return[]},Oa=Na,wa=Ia,Aa=Object.prototype.propertyIsEnumerable,Sa=Object.getOwnPropertySymbols,Da=Sa?function(e){return null==e?[]:(e=Object(e),Oa(Sa(e),function(t){return Aa.call(e,t)}))}:wa;var Ra=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r},Fa={exports:{}};var ka=function(){return!1};!function(e,t){var n=ce,r=ka,i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?n.Buffer:void 0,s=(a?a.isBuffer:void 0)||r;e.exports=s}(Fa,Fa.exports);var xa=Fa.exports;var ja=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Ca=Te,Pa=ja,La=Bt,$a={};$a["[object Float32Array]"]=$a["[object Float64Array]"]=$a["[object Int8Array]"]=$a["[object Int16Array]"]=$a["[object Int32Array]"]=$a["[object Uint8Array]"]=$a["[object Uint8ClampedArray]"]=$a["[object Uint16Array]"]=$a["[object Uint32Array]"]=!0,$a["[object Arguments]"]=$a["[object Array]"]=$a["[object ArrayBuffer]"]=$a["[object Boolean]"]=$a["[object DataView]"]=$a["[object Date]"]=$a["[object Error]"]=$a["[object Function]"]=$a["[object Map]"]=$a["[object Number]"]=$a["[object Object]"]=$a["[object RegExp]"]=$a["[object Set]"]=$a["[object String]"]=$a["[object WeakMap]"]=!1;var Ma=function(e){return La(e)&&Pa(e.length)&&!!$a[Ca(e)]};var Va=function(e){return function(t){return e(t)}},Ua={exports:{}};!function(e,t){var n=oe,r=t&&!t.nodeType&&t,i=r&&e&&!e.nodeType&&e,o=i&&i.exports===r&&n.process,a=function(){try{var e=i&&i.require&&i.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a}(Ua,Ua.exports);var Ba=Ua.exports,Ga=Ma,Qa=Va,Ya=Ba&&Ba.isTypedArray,qa=Ya?Qa(Ya):Ga,za=Ra,Wa=Kr,Ja=Ut,Ka=xa,Xa=Dn,Ha=qa,Za=Object.prototype.hasOwnProperty;var es=function(e,t){var n=Ja(e),r=!n&&Wa(e),i=!n&&!r&&Ka(e),o=!n&&!r&&!i&&Ha(e),a=n||r||i||o,s=a?za(e.length,String):[],c=s.length;for(var u in e)!t&&!Za.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Xa(u,c))||s.push(u);return s},ts=Object.prototype;var ns=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ts)};var rs=function(e,t){return function(n){return e(t(n))}},is=rs(Object.keys,Object),os=ns,as=is,ss=Object.prototype.hasOwnProperty;var cs=Oe,us=ja;var ls=function(e){return null!=e&&us(e.length)&&!cs(e)},ps=es,ds=function(e){if(!os(e))return as(e);var t=[];for(var n in Object(e))ss.call(e,n)&&"constructor"!=n&&t.push(n);return t},fs=ls;var hs=function(e){return fs(e)?ps(e):ds(e)},ys=_a,vs=Da,ms=hs;var gs=function(e){return ys(e,ms,vs)},Es=gs,Ts=Object.prototype.hasOwnProperty;var bs=function(e,t,n,r,i,o){var a=1&n,s=Es(e),c=s.length;if(c!=Es(t).length&&!a)return!1;for(var u=c;u--;){var l=s[u];if(!(a?l in t:Ts.call(t,l)))return!1}var p=o.get(e),d=o.get(t);if(p&&d)return p==t&&d==e;var f=!0;o.set(e,t),o.set(t,e);for(var h=a;++u<c;){var y=e[l=s[u]],v=t[l];if(r)var m=a?r(v,y,l,t,e,o):r(y,v,l,e,t,o);if(!(void 0===m?y===v||i(y,v,n,r,o):m)){f=!1;break}h||(h="constructor"==l)}if(f&&!h){var g=e.constructor,E=t.constructor;g==E||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof E&&E instanceof E||(f=!1)}return o.delete(e),o.delete(t),f},_s=Ge(ce,"DataView"),Ns=Zi,Is=Ge(ce,"Promise"),Os=Ge(ce,"Set"),ws=ut,As=Te,Ss=Re,Ds="[object Map]",Rs="[object Promise]",Fs="[object Set]",ks="[object WeakMap]",xs="[object DataView]",js=Ss(_s),Cs=Ss(Ns),Ps=Ss(Is),Ls=Ss(Os),$s=Ss(ws),Ms=As;(_s&&Ms(new _s(new ArrayBuffer(1)))!=xs||Ns&&Ms(new Ns)!=Ds||Is&&Ms(Is.resolve())!=Rs||Os&&Ms(new Os)!=Fs||ws&&Ms(new ws)!=ks)&&(Ms=function(e){var t=As(e),n="[object Object]"==t?e.constructor:void 0,r=n?Ss(n):"";if(r)switch(r){case js:return xs;case Cs:return Ds;case Ps:return Rs;case Ls:return Fs;case $s:return ks}return t});var Vs=Ms,Us=ea,Bs=ua,Gs=Ea,Qs=bs,Ys=Vs,qs=Ut,zs=xa,Ws=qa,Js="[object Arguments]",Ks="[object Array]",Xs="[object Object]",Hs=Object.prototype.hasOwnProperty;var Zs=function(e,t,n,r,i,o){var a=qs(e),s=qs(t),c=a?Ks:Ys(e),u=s?Ks:Ys(t),l=(c=c==Js?Xs:c)==Xs,p=(u=u==Js?Xs:u)==Xs,d=c==u;if(d&&zs(e)){if(!zs(t))return!1;a=!0,l=!1}if(d&&!l)return o||(o=new Us),a||Ws(e)?Bs(e,t,n,r,i,o):Gs(e,t,c,n,r,i,o);if(!(1&n)){var f=l&&Hs.call(e,"__wrapped__"),h=p&&Hs.call(t,"__wrapped__");if(f||h){var y=f?e.value():e,v=h?t.value():t;return o||(o=new Us),i(y,v,n,r,o)}}return!!d&&(o||(o=new Us),Qs(e,t,n,r,i,o))},ec=Bt;var tc=function e(t,n,r,i,o){return t===n||(null==t||null==n||!ec(t)&&!ec(n)?t!=t&&n!=n:Zs(t,n,r,i,e,o))},nc=tc;var rc=P(function(e,t){return nc(e,t)});var ic={},oc={},ac={},sc=L(l);!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ReactiveVarsCache=e.makeCachedVar=e.initReactiveVarsCache=e.cachedReactiveVarTypename=void 0;const t=sc;var n;e.cachedReactiveVarTypename="CachedReactiveVar",e.initReactiveVarsCache=function(e){return n=new i({cache:e})};const r=t.gql`
fragment ReadCachedReactiveVarFragment on CachedReactiveVar {
id
value
}
`;e.makeCachedVar=function(e,t){return n.registerCachedVar(e,t)};class i{constructor({cache:e}){this.registeredVars={},this.cache=e}watchReactiveVar(e,t){t.onNextChange(n=>{this.writeCachedVar(e,n),this.watchReactiveVar(e,t)})}registerCachedVar(e,n){const r=this.readCachedVar(e),i=(0,t.makeVar)(null!=r?r:n);return this.registeredVars[e]&&console.warn(`Duplicate cached reactive variable with ID ${e} detected. Multiple cached reactive variables should not share the same ID.`),this.registeredVars[e]={rv:i,defaultValue:n},r||this.writeCachedVar(e,n),this.watchReactiveVar(e,i),i}readCachedVar(t){var n;const i=this.cache.identify({__typename:e.cachedReactiveVarTypename,id:t}),o=this.cache.readFragment({fragment:r,id:i});return null!==(n=null==o?void 0:o.value)&&void 0!==n?n:null}writeCachedVar(t,i){void 0!==i&&this.cache.writeFragment({id:n.cache.identify({__typename:e.cachedReactiveVarTypename,id:t}),fragment:r,data:{__typename:e.cachedReactiveVarTypename,id:t,value:i}})}reset(){Object.keys(this.registeredVars).forEach(e=>{var t;const{rv:n,defaultValue:r}=this.registeredVars[e];n(null!==(t=this.readCachedVar(e))&&void 0!==t?t:r)})}}e.ReactiveVarsCache=i}(ac);var cc={};var uc=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i};var lc=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0};var pc=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var c=a[e?s:++i];if(!1===n(o[c],c,o))break}return t}}(),dc=hs;var fc=ls;var hc=function(e,t){return function(n,r){if(null==n)return n;if(!fc(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=Object(n);(t?o--:++o<i)&&!1!==r(a[o],o,a););return n}}(function(e,t){return e&&pc(e,t,dc)}),yc=hc;var vc=ea,mc=tc;var gc=be;var Ec=function(e){return e==e&&!gc(e)},Tc=Ec,bc=hs;var _c=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}},Nc=function(e,t,n,r){var i=n.length,o=i,a=!r;if(null==e)return!o;for(e=Object(e);i--;){var s=n[i];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){var c=(s=n[i])[0],u=e[c],l=s[1];if(a&&s[2]){if(void 0===u&&!(c in e))return!1}else{var p=new vc;if(r)var d=r(u,l,c,e,t,p);if(!(void 0===d?mc(l,u,3,r,p):d))return!1}}return!0},Ic=function(e){for(var t=bc(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Tc(i)]}return t},Oc=_c;var wc=Po,Ac=Kr,Sc=Ut,Dc=Dn,Rc=ja,Fc=ui;var kc=function(e,t){return null!=e&&t in Object(e)},xc=function(e,t,n){for(var r=-1,i=(t=wc(t,e)).length,o=!1;++r<i;){var a=Fc(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Rc(i)&&Dc(a,i)&&(Sc(e)||Ac(e))};var jc=function(e,t){return null!=e&&xc(e,t,kc)},Cc=tc,Pc=Uo,Lc=jc,$c=Ei,Mc=Ec,Vc=_c,Uc=ui;var Bc=Mo;var Gc=function(e){return function(t){return null==t?void 0:t[e]}},Qc=function(e){return function(t){return Bc(t,e)}},Yc=Ei,qc=ui;var zc=function(e){var t=Ic(e);return 1==t.length&&t[0][2]?Oc(t[0][0],t[0][1]):function(n){return n===e||Nc(n,e,t)}},Wc=function(e,t){return $c(e)&&Mc(t)?Vc(Uc(e),t):function(n){var r=Pc(n,e);return void 0===r&&r===t?Lc(n,e):Cc(t,r,3)}},Jc=We,Kc=Ut,Xc=function(e){return Yc(e)?Gc(qc(e)):Qc(e)};var Hc=function(e){return"function"==typeof e?e:null==e?Jc:"object"==typeof e?Kc(e)?Wc(e[0],e[1]):zc(e):Xc(e)},Zc=$i,eu=ls,tu=Dn,nu=be;var ru=lc,iu=function(e,t){var n=!0;return yc(e,function(e,r,i){return n=!!t(e,r,i)}),n},ou=Hc,au=Ut,su=function(e,t,n){if(!nu(n))return!1;var r=typeof t;return!!("number"==r?eu(n)&&tu(t,n.length):"string"==r&&t in n)&&Zc(n[t],e)};var cu=function(e,t,n){var r=au(e)?ru:iu;return n&&su(e,t,n)&&(t=void 0),r(e,ou(t))},uu=ze,lu=$i,pu=Object.prototype.hasOwnProperty;var du=function(e,t,n){var r=e[t];pu.call(e,t)&&lu(r,n)&&(void 0!==n||t in e)||uu(e,t,n)},fu=du,hu=Po,yu=Dn,vu=be,mu=ui;var gu=function(e,t,n,r){if(!vu(e))return e;for(var i=-1,o=(t=hu(t,e)).length,a=o-1,s=e;null!=s&&++i<o;){var c=mu(t[i]),u=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(i!=a){var l=s[c];void 0===(u=r?r(l,c,s):void 0)&&(u=vu(l)?l:yu(t[i+1])?[]:{})}fu(s,c,u),s=s[c]}return e},Eu=Mo,Tu=gu,bu=Po;var _u=function(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],s=Eu(e,a);n(s,a)&&Tu(o,bu(a,e),s)}return o},Nu=jc;var Iu=function(e,t){return _u(e,t,function(t,n){return Nu(e,n)})},Ou=si(function(e,t){return null==e?{}:Iu(e,t)});var wu=function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o},Au=Or;var Su=function(e,t,n){return e&&e.length?(t=n||void 0===t?1:Au(t),wu(e,0,t<0?0:t)):[]};var Du=function(e){return null==e},Ru=hc,Fu=ls;var ku=hr;var xu=function(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=e==e,o=ku(e),a=void 0!==t,s=null===t,c=t==t,u=ku(t);if(!s&&!u&&!o&&e>t||o&&a&&c&&!s&&!u||r&&a&&c||!n&&c||!i)return 1;if(!r&&!o&&!u&&e<t||u&&n&&i&&!r&&!o||s&&n&&i||!a&&i||!c)return-1}return 0};var ju=Io,Cu=Mo,Pu=Hc,Lu=function(e,t){var n=-1,r=Fu(e)?Array(e.length):[];return Ru(e,function(e,i,o){r[++n]=t(e,i,o)}),r},$u=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e},Mu=Va,Vu=function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,a=i.length,s=n.length;++r<a;){var c=xu(i[r],o[r]);if(c)return r>=s?c:c*("desc"==n[r]?-1:1)}return e.index-t.index},Uu=We,Bu=Ut;var Gu=function(e,t,n){t=t.length?ju(t,function(e){return Bu(e)?function(t){return Cu(t,1===e.length?e[0]:e)}:e}):[Uu];var r=-1;t=ju(t,Mu(Pu));var i=Lu(e,function(e,n,i){return{criteria:ju(t,function(t){return t(e)}),index:++r,value:e}});return $u(i,function(e,t){return Vu(e,t,n)})},Qu=Ut;var Yu=function(e,t,n,r){return null==e?[]:(Qu(t)||(t=null==t?[]:[t]),Qu(n=r?void 0:n)||(n=null==n?[]:[n]),Gu(e,t,n))},qu={},zu=Te,Wu=Bt;var Ju,Ku,Xu,Hu=function(e){return"number"==typeof e||Wu(e)&&"[object Number]"==zu(e)},Zu={};Object.defineProperty(Zu,"__esModule",{value:!0}),Zu.RenewalPolicy=Zu.InvalidationPolicyLifecycleEvent=Zu.InvalidationPolicyEvent=void 0,function(e){e.Write="Write",e.Evict="Evict",e.Read="Read"}(Ju||(Zu.InvalidationPolicyEvent=Ju={})),function(e){e.Write="onWrite",e.Evict="onEvict"}(Ku||(Zu.InvalidationPolicyLifecycleEvent=Ku={})),function(e){e.AccessOnly="access-only",e.AccessAndWrite="access-and-write",e.WriteOnly="write-only",e.None="none"}(Xu||(Zu.RenewalPolicy=Xu={}));var el={},tl=du,nl=ze;var rl=function(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],c=r?r(n[s],e[s],s,n,e):void 0;void 0===c&&(c=e[s]),i?nl(n,s,c):tl(n,s,c)}return n},il=rl,ol=hs;var al=function(e,t){return e&&il(t,ol(t),e)};var sl=be,cl=ns,ul=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},ll=Object.prototype.hasOwnProperty;var pl=es,dl=function(e){if(!sl(e))return ul(e);var t=cl(e),n=[];for(var r in e)("constructor"!=r||!t&&ll.call(e,r))&&n.push(r);return n},fl=ls;var hl=function(e){return fl(e)?pl(e,!0):dl(e)},yl=rl,vl=hl;var ml=function(e,t){return e&&yl(t,vl(t),e)},gl={exports:{}};!function(e,t){var n=ce,r=t&&!t.nodeType&&t,i=r&&e&&!e.nodeType&&e,o=i&&i.exports===r?n.Buffer:void 0,a=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=a?a(n):new e.constructor(n);return e.copy(r),r}}(gl,gl.exports);var El=gl.exports,Tl=rl,bl=Da;var _l=function(e,t){return Tl(e,bl(e),t)},Nl=rs(Object.getPrototypeOf,Object),Il=Br,Ol=Nl,wl=Da,Al=Ia,Sl=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Il(t,wl(e)),e=Ol(e);return t}:Al,Dl=rl,Rl=Sl;var Fl=function(e,t){return Dl(e,Rl(e),t)},kl=_a,xl=Sl,jl=hl;var Cl=function(e){return kl(e,jl,xl)},Pl=Object.prototype.hasOwnProperty;var Ll=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Pl.call(e,"index")&&(n.index=e.index,n.input=e.input),n},$l=la;var Ml=function(e){var t=new e.constructor(e.byteLength);return new $l(t).set(new $l(e)),t},Vl=Ml;var Ul=function(e,t){var n=t?Vl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},Bl=/\w*$/;var Gl=function(e){var t=new e.constructor(e.source,Bl.exec(e));return t.lastIndex=e.lastIndex,t},Ql=ue?ue.prototype:void 0,Yl=Ql?Ql.valueOf:void 0;var ql=Ml;var zl=Ml,Wl=Ul,Jl=Gl,Kl=function(e){return Yl?Object(Yl.call(e)):{}},Xl=function(e,t){var n=t?ql(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};var Hl=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return zl(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return Wl(e,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 Xl(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return Jl(e);case"[object Symbol]":return Kl(e)}},Zl=yt,ep=Nl,tp=ns;var np=function(e){return"function"!=typeof e.constructor||tp(e)?{}:Zl(ep(e))},rp=Vs,ip=Bt;var op=function(e){return ip(e)&&"[object Map]"==rp(e)},ap=Va,sp=Ba&&Ba.isMap,cp=sp?ap(sp):op,up=Vs,lp=Bt;var pp=function(e){return lp(e)&&"[object Set]"==up(e)},dp=Va,fp=Ba&&Ba.isSet,hp=fp?dp(fp):pp,yp=ea,vp=ie,mp=du,gp=al,Ep=ml,Tp=El,bp=Gt,_p=_l,Np=Fl,Ip=gs,Op=Cl,wp=Vs,Ap=Ll,Sp=Hl,Dp=np,Rp=Ut,Fp=xa,kp=cp,xp=be,jp=hp,Cp=hs,Pp=hl,Lp="[object Arguments]",$p="[object Function]",Mp="[object Object]",Vp={};Vp[Lp]=Vp["[object Array]"]=Vp["[object ArrayBuffer]"]=Vp["[object DataView]"]=Vp["[object Boolean]"]=Vp["[object Date]"]=Vp["[object Float32Array]"]=Vp["[object Float64Array]"]=Vp["[object Int8Array]"]=Vp["[object Int16Array]"]=Vp["[object Int32Array]"]=Vp["[object Map]"]=Vp["[object Number]"]=Vp[Mp]=Vp["[object RegExp]"]=Vp["[object Set]"]=Vp["[object String]"]=Vp["[object Symbol]"]=Vp["[object Uint8Array]"]=Vp["[object Uint8ClampedArray]"]=Vp["[object Uint16Array]"]=Vp["[object Uint32Array]"]=!0,Vp["[object Error]"]=Vp[$p]=Vp["[object WeakMap]"]=!1;var Up=function e(t,n,r,i,o,a){var s,c=1&n,u=2&n,l=4&n;if(r&&(s=o?r(t,i,o,a):r(t)),void 0!==s)return s;if(!xp(t))return t;var p=Rp(t);if(p){if(s=Ap(t),!c)return bp(t,s)}else{var d=wp(t),f=d==$p||"[object GeneratorFunction]"==d;if(Fp(t))return Tp(t,c);if(d==Mp||d==Lp||f&&!o){if(s=u||f?{}:Dp(t),!c)return u?Np(t,Ep(s,t)):_p(t,gp(s,t))}else{if(!Vp[d])return o?t:{};s=Sp(t,d,c)}}a||(a=new yp);var h=a.get(t);if(h)return h;a.set(t,s),jp(t)?t.forEach(function(i){s.add(e(i,n,r,i,t,a))}):kp(t)&&t.forEach(function(i,o){s.set(o,e(i,n,r,o,t,a))});var y=p?void 0:(l?u?Op:Ip:u?Pp:Cp)(t);return vp(y||t,function(i,o){y&&(i=t[o=i]),mp(s,o,e(i,n,r,o,t,a))}),s},Bp=Up;var Gp=function(e){return Bp(e,5)},Qp=Te,Yp=Nl,qp=Bt,zp=Function.prototype,Wp=Object.prototype,Jp=zp.toString,Kp=Wp.hasOwnProperty,Xp=Jp.call(Object);var Hp=function(e){if(!qp(e)||"[object Object]"!=Qp(e))return!1;var t=Yp(e);if(null===t)return!0;var n=Kp.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Jp.call(n)==Xp};function Zp(){return r.randomBytes(16)}for(var ed,td,nd=[],rd=0;rd<256;++rd)nd[rd]=(rd+256).toString(16).substr(1);function id(e,t){var n=0,r=nd;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n