@data-client/vue 0.15.0 → 0.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # @data-client/vue
2
2
 
3
+ ## 0.15.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#3703](https://github.com/reactive/data-client/pull/3703) [`4fe8779`](https://github.com/reactive/data-client/commit/4fe8779706cb14d9018b3375d07b486a758ccb57) Thanks [@ntucker](https://github.com/ntucker)! - Improve normalize/denormalize performance 10-15%
8
+ - Replace `Object.keys().forEach()` with indexed for loops
9
+ - Replace `reduce()` with spreading to direct object mutation
10
+ - Cache getter results to avoid repeated property lookups
11
+ - Centralize arg extraction with pre-allocated loop
12
+ - Eliminate Map double-get pattern
13
+
14
+ #### Microbenchmark Results
15
+
16
+ | # | Optimization | Before | After | Improvement |
17
+ | --- | ---------------------------- | ----------------- | ----------------- | ---------------- |
18
+ | 1 | **forEach → forLoop** | 7,164 ops/sec | 7,331 ops/sec | **+2.3%** |
19
+ | 2 | **reduce+spread → mutation** | 912 ops/sec | 7,468 ops/sec | **+719% (8.2x)** |
20
+ | 3 | **getter repeated → cached** | 1,652,211 ops/sec | 4,426,994 ops/sec | **+168% (2.7x)** |
21
+ | 4 | **slice+map → indexed** | 33,221 ops/sec | 54,701 ops/sec | **+65% (1.65x)** |
22
+ | 5 | **Map double-get → single** | 23,046 ops/sec | 23,285 ops/sec | **+1%** |
23
+
24
+ #### Impact Summary by Codepath
25
+
26
+ | Codepath | Optimizations Applied | Expected Improvement |
27
+ | ------------------------------------------ | --------------------- | -------------------- |
28
+ | **normalize** (setResponse) | 1, 2, 4 | 10-15% |
29
+ | **denormalize** (getResponse) | 1, 2, 4 | 10-15% |
30
+ | **Controller queries** (get, getQueryMeta) | 5, 6 | 5-10% |
31
+
32
+ - [`09056b0`](https://github.com/reactive/data-client/commit/09056b0adf1375e0aa17df6c1db6f73f721c518f) Thanks [@ntucker](https://github.com/ntucker)! - Simplify endpoint.update() error message
33
+
34
+ - Updated dependencies [[`4fe8779`](https://github.com/reactive/data-client/commit/4fe8779706cb14d9018b3375d07b486a758ccb57), [`09056b0`](https://github.com/reactive/data-client/commit/09056b0adf1375e0aa17df6c1db6f73f721c518f)]:
35
+ - @data-client/core@0.15.4
36
+
37
+ ## 0.15.1
38
+
39
+ ### Patch Changes
40
+
41
+ - [`ed4ec6d`](https://github.com/reactive/data-client/commit/ed4ec6dc516ac9e3977de7ec9018bff962626133) Thanks [@ntucker](https://github.com/ntucker)! - Fix image links in package README
42
+
43
+ - Updated dependencies [[`bf3ac79`](https://github.com/reactive/data-client/commit/bf3ac7966dc615b1dc6cc6c6d600148fdca4e354), [`ed4ec6d`](https://github.com/reactive/data-client/commit/ed4ec6dc516ac9e3977de7ec9018bff962626133)]:
44
+ - @data-client/core@0.15.3
45
+
3
46
  ## 0.15.0
4
47
 
5
48
  ### Minor Changes
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <h1>
2
2
  <div align="center">
3
3
  <a href="https://dataclient.io" target="_blank" rel="noopener">
4
- <img alt="Reactive Data Client" src="./data_client_logo_and_text.svg?sanitize=true">
4
+ <img alt="Reactive Data Client" src="https://raw.githubusercontent.com/reactive/data-client/master/packages/vue/data_client_logo_and_text.svg?sanitize=true">
5
5
  </a>
6
6
  </div>
7
7
  </h1>
@@ -257,7 +257,7 @@ For the small price of 9kb gziped. &nbsp;&nbsp; [🏁Get started now](https://da
257
257
 
258
258
  ## Features
259
259
 
260
- - [x] ![TS](./typescript.svg?sanitize=true) Strong [Typescript](https://www.typescriptlang.org/) inference
260
+ - [x] ![TS](https://raw.githubusercontent.com/reactive/data-client/master/packages/vue/typescript.svg?sanitize=true) Strong [Typescript](https://www.typescriptlang.org/) inference
261
261
  - [x] 🔄 Vue 3 [Composition API](https://vuejs.org/guide/extras/composition-api-faq.html) composables
262
262
  - [x] 🎣 [Declarative API](https://dataclient.io/docs/getting-started/data-dependency)
263
263
  - [x] 📝 Composition over configuration
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VDC={},e.Vue)}(this,(function(e,t){"use strict";class n{constructor(){this.localCache=new Map}getEntity(e,t,n,s){const i=t.key;this.localCache.has(i)||this.localCache.set(i,new Map);const r=this.localCache.get(i);return r.get(e)||s(r),r.get(e)}getResults(e,t,n){return{data:n(),paths:[]}}}const s=Symbol("INVALID"),i={};function r(e){return null!==e&&void 0!==e.pk}const a=e=>e[0],o=e=>void 0!==e&&"symbol"!=typeof e,c=(e,t,n,s,i,r)=>{e=a(e);const o=(e=>Array.isArray(e)?e:Object.keys(e).map((t=>e[t])))(t);return o.map((t=>r(e,t,n,s,i)))},l=(e,t,n,s)=>(e=a(e),t.map?t.map((t=>s(e,t))).filter(o):t);function u(){}function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},h.apply(null,arguments)}const d=(e,t,n,s,i,r)=>{const a=h({},t);return Object.keys(e).forEach((n=>{const s=e[n],o=r(s,t[n],t,n,i);void 0===o?delete a[n]:a[n]=o})),a},p=(e,t,n,i)=>{if(function(e){return!("function"!=typeof e.hasOwnProperty||!(Object.hasOwnProperty.call(e,"__ownerID")||e._map&&Object.hasOwnProperty.call(e._map,"__ownerID")))}(t))return function(e,t,n,i){let r=!1;const a=Object.keys(e).reduce(((t,n)=>{const s=`${n}`,a=i(e[s],t.get(s));return"symbol"==typeof a&&(r=!0),t.has(s)?t.set(s,a):t}),t);return r?s:a}(e,t,0,i);const r=h({},t);let a=!1;return Object.keys(e).forEach((t=>{const n=i(e[t],r[t]);void 0!==r[t]&&(r[t]=n),"symbol"==typeof n&&(a=!0)})),a?s:r};function f(e,t,n,s){const i={};for(const r of Object.keys(e))i[r]=n(e[r],t,s);return i}const y=(e,t,n,s)=>function(r,a){const o="object"!=typeof a,c=o?e({key:r.key,pk:a}):a;if("symbol"==typeof c)return r.denormalize(c,n,s);if(void 0===c&&o&&""!==a&&"undefined"!==a)return t.getEntity(a,r,i,(e=>{e.set(a,void 0)}));if("object"!=typeof c||null===c)return c;let l=o?a:r.pk(c,void 0,void 0,n);return void 0===l||""===l||"undefined"===l?function(e){const t=new Map;return e(t),t.get("")}((e=>g(r,c,"",e,n,s))):("string"!=typeof l&&(l=`${l}`),t.getEntity(l,r,c,(e=>g(r,c,l,e,n,s))))};function g(e,t,n,i,r,a){const o=e.createIfValid(t);void 0===o?i.set(n,s):(i.set(n,o),i.set(n,e.denormalize(o,r,a)))}const v=(e,t,n)=>{const s=y(e,t,n,i);function i(e,t){if(!e)return t;if(null==t)return t;if("function"==typeof e.denormalize)return r(e)?s(e,t):e.denormalize(t,n,i);if("function"==typeof e)return e(t);if("object"==typeof e){return(Array.isArray(e)?l:p)(e,t,n,i)}return t}return(e,n)=>{const s=Object(n)===n&&Object(e)===e;return t.getResults(n,s,(()=>i(e,n)))}};class m{constructor({entities:e,indexes:t}){this.entities=e,this.indexes=t}tracked(e){const t=this,n=[{path:[""],entity:e}];return[{INVALID:s,getIndex(...e){const s=t.getIndex(...e);return n.push({path:e,entity:s}),t.getIndexEnd(s,e[2])},getEntity(...e){const s=t.getEntity(...e);return n.push({path:e,entity:s}),s},getEntities(e){const s=t.getEntitiesObject(e);return n.push({path:[e],entity:s}),t.getEntities(e)}},n]}}class w extends m{constructor(e){super(e)}getEntitiesObject(e){return this.entities[e]}getEntities(e){const t=this.entities[e];if(void 0!==t)return{keys:()=>Object.keys(t),entries:()=>Object.entries(t)}}getEntity(e,t){var n;return null==(n=this.entities[e])?void 0:n[t]}getIndex(e,t){var n;return null==(n=this.indexes[e])?void 0:n[t]}getIndexEnd(e,t){return null==e?void 0:e[t]}}const E={QueryDelegate:w,getEntities:e=>({key:t,pk:n})=>{var s;return null==(s=e[t])?void 0:s[n]}};class x{constructor(){this.next=new WeakMap,this.nextPath=void 0}get(e,t){let n=this.next.get(e);if(!n)return b;for(;n.nextPath;){var s;const e=null!=(s=t(n.nextPath))?s:i;if(n=n.next.get(e),!n)return b}return[n.value,n.journey]}set(e,t){if(e.length<1)throw new I;let n=this;for(const{path:t,entity:s}of e){let e=n.next.get(s);e||(e=new k,n.next.set(null!=s?s:i,e)),n.nextPath=t,n=e}n.nextPath=void 0,n.value=t,n.journey=e.map((e=>e.path))}}const b=[void 0,void 0];class k{constructor(){this.next=new WeakMap,this.nextPath=void 0,this.value=void 0,this.journey=[]}}class I extends Error{constructor(...e){super(...e),this.message="Keys must include at least one member"}}class L extends w{constructor(e,t){super(e),this.newEntities=new Map,this.newIndexes=new Map,this.entitiesMeta=e.entitiesMeta,this.meta=t,this.checkLoop=function(){const e=new Map;return function(t,n,s){let i=e.get(t);i||(i=new Map,e.set(t,i));let r=i.get(n);return r||(r=new Set,i.set(n,r)),!!r.has(s)||(r.add(s),!1)}}()}getNewEntity(e,t){return this.getNewEntities(e).get(t)}getNewEntities(e){return this.newEntities.has(e)||(this.newEntities.set(e,new Map),this.entities[e]=h({},this.entities[e]),this.entitiesMeta[e]=h({},this.entitiesMeta[e])),this.newEntities.get(e)}getNewIndexes(e){return this.newIndexes.has(e)||(this.newIndexes.set(e,new Map),this.indexes[e]=h({},this.indexes[e])),this.newIndexes.get(e)}mergeEntity(e,t,n){const s=e.key;let i=n,r=this.meta,a=this.getNewEntity(s,t);if(a)i=e.merge(a,n);else if(a=this.getEntity(s,t),a){const o=this.getMeta(s,t);i=e.mergeWithStore(o,r,a,n),r=e.mergeMetaWithStore(o,r,a,n)}this.setEntity(e,t,i,r)}setEntity(e,t,n,i=this.meta){const r=e.key,a=this.getNewEntities(r),o=!a.has(t);a.set(t,n),e.indexes&&function(e,t,n,i,r,a){for(const o of t){n.has(o)||n.set(o,i[o]={});const t=n.get(o);a[e]&&delete t[a[e][o]],a&&a[e]&&a[e][o]!==r[o]&&(t[a[e][o]]=s),o in r&&(t[r[o]]=e)}}(t,e.indexes,this.getNewIndexes(r),this.indexes[r],n,this.entities[r]),this._setEntity(r,t,n),o&&this._setMeta(r,t,i)}invalidate({key:e},t){this.setEntity({key:e},t,s)}_setEntity(e,t,n){this.entities[e][t]=n}_setMeta(e,t,n){this.entitiesMeta[e][t]=n}getMeta(e,t){return this.entitiesMeta[e][t]}}const S=(e,t,n=[],{entities:s,indexes:i,entitiesMeta:r}=A,a={fetchedAt:0,date:Date.now(),expiresAt:1/0})=>{if(null==e)return{result:t,entities:s,indexes:i,entitiesMeta:r};const o=function(e){return["object","function"].includes(typeof e)?"object":typeof e}(e);if(null===t||typeof t!==o&&(void 0===e.key||void 0!==e.pk||"string"!=typeof t))throw new Error(`Unexpected input given to normalize. Expected type to be "${o}", found "${null===t?"null":typeof t}".`);const l={result:"",entities:h({},s),indexes:h({},i),entitiesMeta:h({},r)},u=(e=>{const t=(n,s,i,r,a)=>s&&n?n.normalize&&"function"==typeof n.normalize?"object"!=typeof s?n.pk?`${s}`:s:n.normalize(s,i,r,a,t,e):"object"!=typeof s||"object"!=typeof n?s:(Array.isArray(n)?c:d)(n,s,i,r,a,t):s;return t})(new L(l,a));return l.result=u(e,t,t,void 0,n),l};const A={entities:{},indexes:{},entitiesMeta:{}};class M{constructor(e,t,n){this.dependencies=[],this.cycleCache=new Map,this.cycleIndex=-1,this.localCache=new Map,this._getEntity=e,this._getCache=t,this._resultCache=n}getEntity(e,t,n,s){const i=t.key,{localCacheKey:r,cycleCacheKey:a}=this.getCacheKey(i);if(r.get(e))a.has(e)?this.cycleIndex=a.get(e):this.dependencies.push({path:{key:i,pk:e},entity:n});else{const o=this._getCache(e,t),[c,l]=o.get(n,this._getEntity);if(l)return r.set(e,c.value),this.dependencies.push(...c.dependencies),c.value;{const t=this.dependencies.length;a.set(e,t),this.dependencies.push({path:{key:i,pk:e},entity:n}),s(r),a.delete(e);const c=this.dependencies.slice(-1===this.cycleIndex?t:this.cycleIndex),l={dependencies:c,value:r.get(e)};o.set(c,l),this.cycleIndex===t&&(this.cycleIndex=-1)}}return r.get(e)}getCacheKey(e){this.localCache.has(e)||this.localCache.set(e,new Map),this.cycleCache.has(e)||this.cycleCache.set(e,new Map);return{localCacheKey:this.localCache.get(e),cycleCacheKey:this.cycleCache.get(e)}}getResults(e,t,n){if(!t)return{data:n(),paths:this.paths()};let[s,i]=this._resultCache.get(e,this._getEntity);return void 0===i?(s=n(),i=this.paths(),this.dependencies.unshift({path:{key:"",pk:""},entity:e}),this._resultCache.set(this.dependencies,s)):i.shift(),{data:s,paths:i}}paths(){return this.dependencies.map((e=>e.path))}}function R(e){return void 0!==e&&(!(e&&"object"==typeof e&&!Array.isArray(e))||Object.values(e).every(R))}class O{constructor(e=E){var t;this.endpoints=new x,this.queryKeys=new Map,this.policy=e,this._getCache=(t=new Map,(e,n)=>{var s;const i=n.key,r=null!=(s=n.cacheWith)?s:n;t.has(i)||t.set(i,new Map);const a=t.get(i);a.has(e)||a.set(e,new WeakMap);const o=a.get(e);let c=o.get(r);return c||(c=new x,o.set(r,c)),c})}denormalize(e,t,n,s=[]){if(void 0===e)return{data:t,paths:[]};if(void 0===t)return{data:void 0,paths:[]};const i=this.policy.getEntities(n);return v(i,new M(i,this._getCache,this.endpoints),s)(e,t)}query(e,t,n,s=JSON.stringify(t)){const i=this.buildQueryKey(e,t,n,s);return i?this.denormalize(e,i,n.entities,t):{data:void 0,paths:[]}}buildQueryKey(e,t,n,s=JSON.stringify(t)){if("object"!=typeof e&&"function"!=typeof e.queryKey||!e)return e;this.queryKeys.get(s)||this.queryKeys.set(s,new x);const i=this.queryKeys.get(s),r=new this.policy.QueryDelegate(n);let[a,o]=i.get(e,(c=r,e=>c[["","getEntitiesObject","getEntity","getIndex"][e.length]](...e)));var c;if(!o){const[n,s]=r.tracked(e);a=function(e){return function t(n,s){return function(e){return!!e&&"function"==typeof e.queryKey}(n)?n.queryKey(s,t,e):"object"==typeof n&&n?(Array.isArray(n)?u:f)(n,s,t,e):n}}(n)(e,t),i.set(s,a)}return a}}var C={Invalid:1,InvalidIfStale:2,Valid:3};function P(e,t){const n=Date.now();return{fetchedAt:null!=t?t:n,date:n,expiresAt:n+e}}const _="rdc/fetch",j="rdc/set",D="rdc/setresponse",T="rdc/optimistic",q="rdc/reset",N="rdc/subscribe",K="rdc/unsubscribe",V="rdc/invalidate",H="rdc/invalidateall",z="rdc/expireall",F="rdc/gc",U=_,B=j,Y=D,Q=T,$=q,W=N,X=K,J=V,G=H,Z=z,ee=F;var te=Object.freeze({__proto__:null,EXPIREALL:z,EXPIREALL_TYPE:Z,FETCH:_,FETCH_TYPE:U,GC:F,GC_TYPE:ee,INVALIDATE:V,INVALIDATEALL:H,INVALIDATEALL_TYPE:G,INVALIDATE_TYPE:J,OPTIMISTIC:T,OPTIMISTIC_TYPE:Q,RESET:q,RESET_TYPE:$,SET:j,SET_RESPONSE:D,SET_RESPONSE_TYPE:Y,SET_TYPE:B,SUBSCRIBE:N,SUBSCRIBE_TYPE:W,UNSUBSCRIBE:K,UNSUBSCRIBE_TYPE:X});function ne(e,t){if(t.endpoint.getOptimisticResponse&&t.endpoint.sideEffect){const a=(n=t.endpoint,s=t.args,i=t.meta.fetchedAt,{type:T,key:n.key(...s),args:s,endpoint:n,meta:P(null!=(r=n.dataExpiryLength)?r:6e4,i)});return h({},e,{optimistic:[...e.optimistic,a]})}var n,s,i,r;return e}class se extends Error{}function ie(e,t,n){return"AbortError"===n.name?h({},e,{optimistic:re(e,t)}):h({},e,{meta:h({},e.meta,{[t.key]:{date:t.meta.date,fetchedAt:t.meta.fetchedAt,expiresAt:t.meta.expiresAt,error:n,errorPolicy:null==t.endpoint.errorPolicy?void 0:t.endpoint.errorPolicy(n)}}),optimistic:re(e,t)})}function re(e,t){return e.optimistic.filter((e=>e.key!==t.key||(e.type===T?e.meta.fetchedAt!==t.meta.fetchedAt:e.meta.date>t.meta.date)))}function ae(e){return function(t,n){switch(t||(t=oe),n.type){case F:return n.entities.forEach((({key:e,pk:n})=>{var s,i;null==(s=t.entities[e])||delete s[n],null==(i=t.entitiesMeta[e])||delete i[n]})),n.endpoints.forEach((e=>{delete t.endpoints[e],delete t.meta[e]})),t;case _:return ne(t,n);case T:case D:return function(e,t,n){if(t.error)return ie(e,t,t.response);try{var s;let i;if(t.type===T){if(!t.endpoint.getOptimisticResponse)return e;try{i=t.endpoint.getOptimisticResponse.call(t.endpoint,n.snapshot(e,t.meta.fetchedAt),...t.args)}catch(t){if(t.constructor===se)return e;throw t}}else i=t.response;const{result:r,entities:a,indexes:o,entitiesMeta:c}=S(t.endpoint.schema,i,t.args,e,t.meta),l=h({},e.endpoints,{[t.key]:r});try{if(t.endpoint.update){const e=t.endpoint.update(r,...t.args);Object.keys(e).forEach((t=>{l[t]=e[t](l[t])}))}}catch(e){console.error(`The following error occured during Endpoint.update() for ${t.key}`),console.error(e)}return{entities:a,endpoints:l,indexes:o,meta:h({},e.meta,{[t.key]:{date:t.meta.date,fetchedAt:t.meta.fetchedAt,expiresAt:t.meta.expiresAt,prevExpiresAt:null==(s=e.meta[t.key])?void 0:s.expiresAt}}),entitiesMeta:c,optimistic:re(e,t),lastReset:e.lastReset}}catch(n){return"object"==typeof n&&(n.message=`Error processing ${t.key}\n\nFull Schema: ${JSON.stringify(t.endpoint.schema,void 0,2)}\n\nError:\n${n.message}`,"response"in t&&(n.response=t.response),n.status=400),ie(e,t,n)}}(t,n,e);case j:return function(e,t,n){let s;if("function"==typeof t.value){const i=n.get(t.schema,...t.args,e);if(void 0===i)return e;s=t.value(i)}else s=t.value;try{const{entities:n,indexes:i,entitiesMeta:r}=S(t.schema,s,t.args,e,t.meta);return{entities:n,endpoints:e.endpoints,indexes:i,meta:e.meta,entitiesMeta:r,optimistic:e.optimistic,lastReset:e.lastReset}}catch(t){return e}}(t,n,e);case H:case V:return function(e,t){const n=h({},e.endpoints),s=h({},e.meta),i=e=>{delete n[e];const t=h({},s[e],{expiresAt:0,invalidated:!0});delete t.error,s[e]=t};return t.type===V?i(t.key):Object.keys(n).forEach((e=>{t.testKey(e)&&i(e)})),h({},e,{endpoints:n,meta:s})}(t,n);case z:return function(e,t){const n=h({},e.meta);return Object.keys(n).forEach((e=>{t.testKey(e)&&(n[e]=h({},n[e],{expiresAt:1}))})),h({},e,{meta:n})}(t,n);case q:return h({},oe,{lastReset:n.date});default:return t}}}const oe={entities:{},endpoints:{},indexes:{},meta:{},entitiesMeta:{},optimistic:[],lastReset:0};const ce="undefined"!=typeof FormData?e=>e instanceof FormData?Object.fromEntries(e.entries()):e:e=>e;function le(e,{args:t,fetchedAt:n,response:s,error:i=!1}){var r,a;const o=i?null!=(r=e.errorExpiryLength)?r:1e3:null!=(a=e.dataExpiryLength)?a:6e4;return{type:D,key:e.key(...t),response:s,args:t.map(ce),endpoint:e,meta:P(o,n),error:i}}class ue{init(){}cleanup(){}createCountRef(){return()=>()=>{}}}function he(e,t){return e.meta[t]}const de=e=>{throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},pe=()=>oe;class fe{constructor({dispatch:e=de,getState:t=pe,memo:s=new O,gcPolicy:i=new ue}={}){this.fetch=(e,...t)=>{const s=function(e,{args:t}){let n=0,s=0;const i=new Promise(((e,t)=>{[n,s]=[e,t]})),r={fetchedAt:Date.now(),resolve:n,reject:s,promise:i};return{type:_,key:e.key(...t),args:t,endpoint:e,meta:r}}(e,{args:t});return this.dispatch(s),e.schema?s.meta.promise.then((s=>function(e,t,s,i=[]){return void 0===e||void 0===t?t:v(E.getEntities(s),new n,i)(e,t).data}(e.schema,s,{},t))):s.meta.promise},this.fetchIfStale=(e,...t)=>{const{data:n,expiresAt:s,expiryStatus:i}=this.getResponseMeta(e,...t,this.getState());return i!==C.Invalid&&Date.now()<=s?n:this.fetch(e,...t)},this.invalidate=(e,...t)=>null!==t[0]?this.dispatch(function(e,{args:t}){return{type:V,key:e.key(...t)}}(e,{args:t})):Promise.resolve(),this.invalidateAll=e=>this.dispatch({type:H,testKey:t=>e.testKey(t)}),this.expireAll=e=>this.dispatch({type:z,testKey:t=>e.testKey(t)}),this.resetEntireStore=()=>this.dispatch({type:q,date:Date.now()}),this.setResponse=(e,...t)=>{const n=t[t.length-1],s=le(e,{args:t.slice(0,t.length-1),response:n});return this.dispatch(s)},this.setError=(e,...t)=>{const n=t[t.length-1],s=le(e,{args:t.slice(0,t.length-1),response:n,error:!0});return this.dispatch(s)},this.resolve=(e,t)=>this.dispatch(le(e,t)),this.subscribe=(e,...t)=>null!==t[0]?this.dispatch(function(e,{args:t}){return{type:N,key:e.key(...t),args:t,endpoint:e}}(e,{args:t})):Promise.resolve(),this.unsubscribe=(e,...t)=>null!==t[0]?this.dispatch(function(e,{args:t}){return{type:K,key:e.key(...t),args:t,endpoint:e}}(e,{args:t})):Promise.resolve(),this.snapshot=(e,t)=>new ge(this,e,t),this._dispatch=e,this.getState=t,this.memo=s,this.gcPolicy=i}set dispatch(e){this._dispatch=e}get dispatch(){return this._dispatch}bindMiddleware({dispatch:e,getState:t}){this._dispatch=e,this.getState=t}set(e,...t){const n=t[t.length-1],s=function(e,{args:t,fetchedAt:n,value:s}){return{type:j,value:s,args:t.map(ce),schema:e,meta:P(6e4,n)}}(e,{args:t.slice(0,t.length-1),value:n});return this.dispatch(s)}getError(e,...t){if(null===t[0])return;const n=t[t.length-1],s=t.slice(0,t.length-1),i=e.key(...s),r=he(n,i);return void 0===n.endpoints[i]||"soft"!==(null==r?void 0:r.errorPolicy)?null==r?void 0:r.error:void 0}getResponse(e,...t){return this.getResponseMeta(e,...t)}getResponseMeta(e,...t){const n=t[t.length-1],s=t.slice(0,t.length-1).map(ce),i=1!==s.length||null!==s[0],r=i?e.key(...s):"",a=i?n.endpoints[r]:void 0,o=e.schema,c=he(n,r);let l=null==c?void 0:c.expiresAt;const u=void 0===a&&void 0!==o,h=u?this.memo.buildQueryKey(o,s,n,r):a;if(!i)return{data:h,expiryStatus:C.Valid,expiresAt:1/0,countRef:()=>()=>{}};let d=!1;if(u)d=!R(h);else if(!o||!ye(o))return{data:a,expiryStatus:this.getExpiryStatus(!a,!!e.invalidIfStale,c),expiresAt:l||0,countRef:this.gcPolicy.createCountRef({key:r})};const{data:p,paths:f}=this.memo.denormalize(o,h,n.entities,s);return l||(l=d?1:function(e,t){let n=1/0;for(const{key:i,pk:r}of e){var s;const e=null==(s=t[i])||null==(s=s[r])?void 0:s.expiresAt;e<n&&(n=e)}return n}(f,n.entitiesMeta)),{data:p,expiryStatus:this.getExpiryStatus("symbol"==typeof p,!!e.invalidIfStale||d,c),expiresAt:l,countRef:this.gcPolicy.createCountRef({key:r,paths:f})}}get(e,...t){const n=t[t.length-1],s=t.slice(0,t.length-1).map(ce),{data:i}=this.memo.query(e,s,n);return"symbol"==typeof i?void 0:i}getQueryMeta(e,...t){const n=t[t.length-1],s=t.slice(0,t.length-1).map(ce),{data:i,paths:r}=this.memo.query(e,s,n);return{data:"symbol"==typeof i?void 0:i,countRef:this.gcPolicy.createCountRef({paths:r})}}getExpiryStatus(e,t,n={}){return n.invalidated||e&&!n.error?C.Invalid:e||t?C.InvalidIfStale:C.Valid}}function ye(e){if(r(e))return!0;if(Array.isArray(e))return 0!==e.length&&ye(e[0]);if(e&&("object"==typeof e||"function"==typeof e)){const t="schema"in e?e.schema:e;return"function"==typeof t?ye(t):Object.values(t).some((e=>ye(e)))}return!1}class ge{constructor(e,t,n=0){this.state=void 0,this.controller=void 0,this.fetchedAt=void 0,this.abort=ge.abort,this.state=t,this.controller=e,this.fetchedAt=n}getResponse(e,...t){return this.controller.getResponse(e,...t,this.state)}getResponseMeta(e,...t){return this.controller.getResponseMeta(e,...t,this.state)}getError(e,...t){return this.controller.getError(e,...t,this.state)}get(e,...t){return this.controller.get(e,...t,this.state)}getQueryMeta(e,...t){return this.controller.getQueryMeta(e,...t,this.state)}}ge.abort=new se;class ve extends Error{constructor(){super("Aborted due to RESET"),this.name="ResetError"}}class me{constructor({dataExpiryLength:e=6e4,errorExpiryLength:t=1e3}={}){this.fetching=new Map,this.controller=new fe,this.middleware=e=>(this.controller=e,t=>n=>{switch(n.type){case _:return this.handleFetch(n),void 0!==n.endpoint.getOptimisticResponse&&n.endpoint.sideEffect?t(n):Promise.resolve();case D:return t(n).then((()=>{if(this.fetching.has(n.key)){var t;const s=null==(t=e.getState().meta[n.key])?void 0:t.error;s?this.handleSet(le(n.endpoint,{args:n.args,response:s,fetchedAt:n.meta.fetchedAt,error:!0})):this.handleSet(n)}}));case q:{const e=Array.from(this.fetching.values());return this.clearAll(),t(n).then((()=>{for(const{reject:t}of e)t(new ve)}))}default:return t(n)}}),this.dataExpiryLength=e,this.errorExpiryLength=t}init(){delete this.cleanupDate}cleanup(){this.cleanupDate=Date.now()}skipLogging(e){return e.type===_&&this.fetching.has(e.key)}allSettled(){if(this.fetching.size)return Promise.allSettled(this.fetching.values().map((({promise:e})=>e)))}clearAll(){for(const e of this.fetching.keys())this.clear(e)}clear(e){this.fetching.has(e)&&(this.fetching.get(e).promise.catch((()=>{})),this.fetching.delete(e))}getLastReset(){return this.cleanupDate?this.cleanupDate:this.controller.getState().lastReset}handleFetch(e){const{resolve:t,reject:n,fetchedAt:s}=e.meta,i=!e.endpoint.sideEffect,r=()=>{let r=e.endpoint(...e.args);return i||(r=(e=>e.then((e=>(t(e),e))).catch((e=>{throw n(e),e})))(r)),r=r.then((t=>{let n=this.getLastReset();return s>=n&&this.controller.resolve(e.endpoint,{args:e.args,response:t,fetchedAt:s}),t})).catch((t=>{const n=this.getLastReset();throw s>=n&&this.controller.resolve(e.endpoint,{args:e.args,response:t,fetchedAt:s,error:!0}),t})),r};return i?this.throttle(e.key,r,s).then((e=>t(e))).catch((e=>n(e))):r().catch((()=>{}))}handleSet(e){if(this.fetching.has(e.key)){const{reject:t,resolve:n}=this.fetching.get(e.key);e.error?t(e.response):n(e.response),this.clear(e.key)}}throttle(e,t,n){const s=this.getLastReset();let i=this.fetching.get(e);return i&&i.fetchedAt>s||(i=function(e){const t={fetchedAt:e};return t.promise=new Promise(((e,n)=>{t.resolve=e,t.reject=n})),t}(n),this.fetching.set(e,i),this.idleCallback((()=>{t().catch((()=>null))}),{timeout:500})),i.promise}idleCallback(e,t){e()}}class we{isOnline(){return void 0===navigator.onLine||navigator.onLine}addOnlineListener(e){addEventListener("online",e)}removeOnlineListener(e){removeEventListener("online",e)}addOfflineListener(e){addEventListener("offline",e)}removeOfflineListener(e){removeEventListener("offline",e)}}class Ee{isOnline(){return!0}addOnlineListener(){}removeOnlineListener(){}addOfflineListener(){}removeOfflineListener(){}}e.DefaultConnectionListener=void 0,"undefined"!=typeof navigator&&"function"==typeof addEventListener?e.DefaultConnectionListener=we:e.DefaultConnectionListener=Ee;class xe{constructor(t,n,s){if(this.frequencyHistogram=new Map,this.offlineListener=()=>{this.cleanup(),this.connectionListener.addOnlineListener(this.onlineListener)},this.onlineListener=()=>{this.connectionListener.removeOnlineListener(this.onlineListener);const e=Date.now();this.startId=setTimeout((()=>{this.startId&&(delete this.startId,this.update(),this.run())}),Math.max(0,this.lastFetchTime()-e+this.frequency)),this.connectionListener.addOfflineListener(this.offlineListener)},void 0===t.endpoint.pollFrequency)throw new Error("frequency needed for polling subscription");this.endpoint=t.endpoint,this.frequency=t.endpoint.pollFrequency,this.args=t.args,this.key=t.key,this.frequencyHistogram.set(this.frequency,1),this.controller=n,this.connectionListener=s||new e.DefaultConnectionListener,this.connectionListener.isOnline()?this.onlineListener():this.offlineListener()}add(e){void 0!==e&&(this.frequencyHistogram.has(e)?this.frequencyHistogram.set(e,this.frequencyHistogram.get(e)+1):(this.frequencyHistogram.set(e,1),e<this.frequency&&(this.frequency=e,this.run())))}remove(e){if(void 0===e)return!1;if(this.frequencyHistogram.has(e)&&(this.frequencyHistogram.set(e,this.frequencyHistogram.get(e)-1),this.frequencyHistogram.get(e)<1)){if(this.frequencyHistogram.delete(e),0===this.frequencyHistogram.size)return this.cleanup(),!0;e<=this.frequency&&(this.frequency=Math.min(...this.frequencyHistogram.keys()),this.run())}return!1}cleanup(){this.intervalId&&(clearInterval(this.intervalId),delete this.intervalId),this.lastIntervalId&&(clearInterval(this.lastIntervalId),delete this.lastIntervalId),this.startId&&(clearTimeout(this.startId),delete this.startId),this.connectionListener.removeOnlineListener(this.onlineListener),this.connectionListener.removeOfflineListener(this.offlineListener)}update(){const e=this.endpoint,t=function(...t){return e.call(this,...t)};Object.assign(t,this.endpoint),t.dataExpiryLength=this.frequency/2,t.errorExpiryLength=this.frequency/10,t.errorPolicy=()=>"soft",t.key=()=>this.key,this.controller.fetch(t,...this.args).catch((()=>null))}run(){this.startId||(this.intervalId&&(this.lastIntervalId=this.intervalId),this.intervalId=setInterval((()=>{this.lastIntervalId&&(clearInterval(this.lastIntervalId),delete this.lastIntervalId),this.intervalId&&this.update()}),this.frequency))}lastFetchTime(){var e,t;return null!=(e=null==(t=this.controller.getState().meta[this.key])?void 0:t.date)?e:0}}class be{constructor(e){this.subscriptions={},this.controller=new fe,this.middleware=e=>(this.controller=e,e=>t=>{switch(t.type){case N:try{this.handleSubscribe(t)}catch(e){console.error(e)}return Promise.resolve();case K:return this.handleUnsubscribe(t),Promise.resolve();default:return e(t)}}),this.Subscription=e}cleanup(){for(const e in this.subscriptions)this.subscriptions[e].cleanup()}handleSubscribe(e){const t=e.key;if(t in this.subscriptions){const n=e.endpoint.pollFrequency;this.subscriptions[t].add(n)}else this.subscriptions[t]=new this.Subscription(e,this.controller)}handleUnsubscribe(e){const t=e.key;if(t in this.subscriptions){const n=e.endpoint.pollFrequency;this.subscriptions[t].remove(n)&&delete this.subscriptions[t]}}}let ke={};class Ie{constructor(e,t){this.started=!1,this.actions=[],this.maxBufferLength=100,this.devTools="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__.connect(h({},ke,e)),null!=e&&e.maxAge&&(this.maxBufferLength=2*e.maxAge),t&&(this.skipLogging=t)}handleAction(e,t){this.started?this.devTools.send(e,t):(this.actions.length>this.maxBufferLength&&(this.actions=this.actions.slice(this.maxBufferLength/2)),this.actions.push([e,t]))}init(e){}cleanup(){}}Ie.prototype.middleware=()=>e=>t=>e(t);const Le=Symbol("DataClientState"),Se=Symbol("DataClientController"),Ae=t.shallowRef(oe);function Me(){const e=t.inject(Se,null);return e||new fe}function Re(){const e=t.inject(Le,null);return e||Ae}async function Oe(e,...n){const s=Re(),i=Me(),r=t.computed((()=>n.map((e=>t.unref(e))))),a=t.computed((()=>null!==r.value[0]?e.key(...r.value):"")),o=t.computed((()=>i.getResponseMeta(e,...r.value,s.value))),c=async()=>{if(!a.value)return;const t=o.value,n=t.expiryStatus===C.Invalid;Date.now()<=t.expiresAt&&!n||await i.fetch(e,...r.value)};return t.watch((()=>{const e=o.value;return[e.expiresAt,e.expiryStatus,s.value.lastReset,a.value]}),(()=>c())),t.watch((()=>o.value.data),((e,t,n)=>{const s=o.value.countRef();n((()=>null==s?void 0:s()))}),{immediate:!0}),await c(),t.readonly(t.computed((()=>o.value.data)))}function Ce(e,...n){const s=Me(),i=t.computed((()=>n.map((e=>t.unref(e))))),r=t.computed((()=>null===i.value[0]?"":e.key(...i.value)));t.watch(r,((t,n,a)=>{if(!r.value)return;const o=i.value;s.subscribe(e,...o),a((()=>{s.unsubscribe(e,...o)}))}),{immediate:!0})}let Pe=(e={})=>{const{networkManager:t,subscriptionManager:n=xe}=e;return null===n?[_e(me,null!=t?t:{})]:[_e(me,null!=t?t:{}),_e(be,n)]};function _e(e,t){return t instanceof e?t:new e(t)}function je(e={}){var n,s;const{Controller:i=fe,gcPolicy:r,app:a}=e,o=new i({gcPolicy:r}),c=null!=(n=e.managers)?n:Pe(),l=null!=(s=e.initialState)?s:oe,u=function(e,t,n){return()=>(e.forEach((e=>{null==e.init||e.init(n)})),t.gcPolicy.init(t),()=>{e.forEach((e=>{e.cleanup()})),t.gcPolicy.cleanup()})}(c,o,l),h=function(e,t){return e.map(((e,n)=>(e.middleware||(e.middleware=null==e.getMiddleware?void 0:e.getMiddleware()),s=>(0===n&&t.bindMiddleware(s),e.middleware(t)))))}(c,o),d=ae(o),p=t.shallowRef(l),f=t.shallowRef(x(l));let y=null;const g=()=>p.value,v=h.map((e=>e({getState:g,dispatch:e=>m(e)}))),m=(w=v,e=>w.reduceRight(((e,t)=>t(e)),e))((async e=>{const t=new Promise((e=>{y=e}));return await(async e=>{const t=d(p.value,e);if(p.value=t,f.value=x(t),y){const e=y;y=null,e()}})(e),t}));var w;let E;o.bindMiddleware({getState:g,dispatch:e=>m(e)});return a?(a.provide(Le,f),a.provide(Se,o)):(t.provide(Le,f),t.provide(Se,o)),{controller:o,stateRef:f,start:()=>{E=u()},stop:()=>{E&&E()}};function x(e){return e.optimistic.reduce(d,e)}}const De={install(e,t={}){const n=je(h({},t,{app:e}));return e.config.globalProperties.$dataClient=n.controller,n.start(),e.onUnmount((()=>{n.stop()})),n}};e.Controller=fe,e.DataClientPlugin=De,e.DevToolsManager=Ie,e.ExpiryStatus=C,e.LogoutManager=class{constructor({handleLogout:e,shouldLogout:t}={}){this.middleware=e=>t=>async n=>{await t(n),n.type===D&&n.error&&this.shouldLogout(n.response)&&this.handleLogout(e)},e&&(this.handleLogout=e),t&&(this.shouldLogout=t)}cleanup(){}shouldLogout(e){return 401===e.status}handleLogout(e){e.resetEntireStore()}},e.NetworkManager=me,e.PollingSubscription=xe,e.SubscriptionManager=be,e.actionTypes=te,e.createDataClient=je,e.getDefaultManagers=Pe,e.useCache=function(e,...n){const s=Re(),i=Me(),r=t.computed((()=>n.map((e=>t.unref(e))))),a=t.computed((()=>null!==r.value[0]?e.key(...r.value):"")),o=t.computed((()=>i.getResponseMeta(e,...r.value,s.value))),c=t.computed((()=>o.value.expiryStatus===C.Invalid)),l=t.computed((()=>(Date.now()>o.value.expiresAt||c.value)&&a.value)),u=t.computed((()=>o.value.expiryStatus!==C.Valid&&l.value));return t.watch((()=>o.value.data),((e,t,n)=>{const s=o.value.countRef();n((()=>s()))}),{immediate:!0}),t.computed((()=>{if(u.value){if(!e.schema)return;return i.getResponseMeta(e,...r.value,h({},s.value,{entities:{}})).data}return o.value.data}))},e.useController=Me,e.useDLE=function(e,...n){const s=Re(),i=Me(),r=t.computed((()=>n.map((e=>t.unref(e))))),a=t.computed((()=>null!==r.value[0]?e.key(...r.value):"")),o=t.computed((()=>i.getResponseMeta(e,...r.value,s.value))),c=t.computed((()=>o.value.expiryStatus===C.Invalid)),l=t.computed((()=>!(!(Date.now()>o.value.expiresAt||c.value)||!a.value))),u=t.computed((()=>!(o.value.expiryStatus===C.Valid||!l.value)));t.watch((()=>{const e=o.value;return[e.expiresAt,e.expiryStatus,s.value.lastReset,a.value]}),(async()=>{if(!a.value)return;const t=o.value,n=c.value;Date.now()<=t.expiresAt&&!n||await i.fetch(e,...r.value).catch((()=>{}))}),{immediate:!0}),t.watch((()=>o.value.data),((e,t,n)=>{const s=o.value.countRef();n((()=>s()))}),{immediate:!0});const d=t.computed((()=>{if(u.value){if(!e.schema)return;return i.getResponseMeta(e,...r.value,h({},s.value,{entities:{}})).data}return o.value.data})),p=t.computed((()=>i.getError(e,...r.value,s.value)));return t.markRaw({data:d,loading:u,error:p})},e.useDebounce=function(e,n,s=!0){const i=t.ref("object"==typeof e&&null!==e&&"value"in e?e.value:e),r=t.ref(!1);let a=null;const o=()=>{null!==a&&(clearTimeout(a),a=null)};return t.watch([()=>"object"==typeof e&&null!==e&&"value"in e?e.value:e,()=>"object"==typeof s&&null!==s&&"value"in s?s.value:s,()=>n],(([e,t])=>{o(),t?(r.value=!0,a=setTimeout((()=>{i.value=e,r.value=!1,a=null}),n)):r.value=!1}),{immediate:!1}),t.onUnmounted((()=>{o()})),[i,r]},e.useFetch=function(e,...n){const s=Re(),i=Me(),r=t.computed((()=>n.map((e=>t.unref(e))))),a=t.computed((()=>null!==r.value[0]?e.key(...r.value):"")),o=t.computed((()=>i.getResponseMeta(e,...r.value,s.value))),c=t.ref(void 0),l=()=>{if(!a.value)return;const t=o.value,n=t.expiryStatus===C.Invalid;Date.now()<=t.expiresAt&&!n||(c.value=i.fetch(e,...r.value))};return l(),t.watch((()=>{const e=o.value;return[e.expiresAt,e.expiryStatus,s.value.lastReset,a.value]}),(()=>{l()})),c},e.useLive=async function(e,...t){return Ce(e,...t),Oe(e,...t)},e.useLoading=function(e){const n=t.ref(!1),s=t.ref(void 0),i=t.ref(!0);return t.onUnmounted((()=>{i.value=!1})),[async(...t)=>{let r;n.value=!0,s.value=void 0;try{r=await e(...t)}catch(e){s.value=e}finally{i.value&&(n.value=!1)}return r},n,s]},e.useQuery=function(e,...n){const s=Re(),i=Me(),r=t.computed((()=>n.map((e=>t.unref(e))))),a=t.computed((()=>i.getQueryMeta(e,...r.value,s.value)));return t.watch((()=>a.value.data),((e,t,n)=>{const s=a.value.countRef();n((()=>s()))}),{immediate:!0}),t.computed((()=>a.value.data))},e.useSubscription=Ce,e.useSuspense=Oe}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VDC={},e.Vue)}(this,(function(e,t){"use strict";class n{constructor(){this.localCache=new Map}getEntity(e,t,n,s){const i=t.key;this.localCache.has(i)||this.localCache.set(i,new Map);const r=this.localCache.get(i);return r.get(e)||s(r),r.get(e)}getResults(e,t,n){return{data:n(),paths:[]}}}const s=Symbol("INVALID"),i={};function r(e){return null!==e&&void 0!==e.pk}const a=e=>e[0],o=e=>void 0!==e&&"symbol"!=typeof e,c=(e,t,n,s,i,r)=>{e=a(e);const o=(e=>Array.isArray(e)?e:Object.keys(e).map((t=>e[t])))(t);return o.map((t=>r(e,t,n,s,i)))},l=(e,t,n,s)=>(e=a(e),t.map?t.map((t=>s(e,t))).filter(o):t);function u(){}function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},h.apply(null,arguments)}const d=(e,t,n,s,i,r)=>{const a=h({},t),o=Object.keys(e);for(let n=0;n<o.length;n++){const s=o[n],c=r(e[s],t[s],t,s,i);void 0===c?delete a[s]:a[s]=c}return a},p=(e,t,n,i)=>{if(function(e){return!("function"!=typeof e.hasOwnProperty||!(Object.hasOwnProperty.call(e,"__ownerID")||e._map&&Object.hasOwnProperty.call(e._map,"__ownerID")))}(t))return function(e,t,n,i){let r=!1;const a=Object.keys(e).reduce(((t,n)=>{const s=`${n}`,a=i(e[s],t.get(s));return"symbol"==typeof a&&(r=!0),t.has(s)?t.set(s,a):t}),t);return r?s:a}(e,t,0,i);const r=h({},t);let a=!1;const o=Object.keys(e);for(let t=0;t<o.length;t++){const n=o[t],s=i(e[n],r[n]);void 0!==r[n]&&(r[n]=s),"symbol"==typeof s&&(a=!0)}return a?s:r};function f(e,t,n,s){const i={};for(const r of Object.keys(e))i[r]=n(e[r],t,s);return i}const y=(e,t,n,s)=>function(r,a){const o="object"!=typeof a,c=o?e({key:r.key,pk:a}):a;if("symbol"==typeof c)return r.denormalize(c,n,s);if(void 0===c&&o&&""!==a&&"undefined"!==a)return t.getEntity(a,r,i,(e=>{e.set(a,void 0)}));if("object"!=typeof c||null===c)return c;let l=o?a:r.pk(c,void 0,void 0,n);return void 0===l||""===l||"undefined"===l?function(e){const t=new Map;return e(t),t.get("")}((e=>g(r,c,"",e,n,s))):("string"!=typeof l&&(l=`${l}`),t.getEntity(l,r,c,(e=>g(r,c,l,e,n,s))))};function g(e,t,n,i,r,a){const o=e.createIfValid(t);void 0===o?i.set(n,s):(i.set(n,o),i.set(n,e.denormalize(o,r,a)))}const v=(e,t,n)=>{const s=y(e,t,n,i);function i(e,t){if(!e)return t;if(null==t)return t;if("function"==typeof e.denormalize)return r(e)?s(e,t):e.denormalize(t,n,i);if("function"==typeof e)return e(t);if("object"==typeof e){return(Array.isArray(e)?l:p)(e,t,n,i)}return t}return(e,n)=>{const s=Object(n)===n&&Object(e)===e;return t.getResults(n,s,(()=>i(e,n)))}};class m{constructor({entities:e,indexes:t}){this.entities=e,this.indexes=t}tracked(e){const t=this,n=[{path:[""],entity:e}];return[{INVALID:s,getIndex(...e){const s=t.getIndex(...e);return n.push({path:e,entity:s}),t.getIndexEnd(s,e[2])},getEntity(...e){const s=t.getEntity(...e);return n.push({path:e,entity:s}),s},getEntities(e){const s=t.getEntitiesObject(e);return n.push({path:[e],entity:s}),t.getEntities(e)}},n]}}class w extends m{constructor(e){super(e)}getEntitiesObject(e){return this.entities[e]}getEntities(e){const t=this.entities[e];if(void 0!==t)return{keys:()=>Object.keys(t),entries:()=>Object.entries(t)}}getEntity(e,t){var n;return null==(n=this.entities[e])?void 0:n[t]}getIndex(e,t){var n;return null==(n=this.indexes[e])?void 0:n[t]}getIndexEnd(e,t){return null==e?void 0:e[t]}}const E={QueryDelegate:w,getEntities:e=>({key:t,pk:n})=>{var s;return null==(s=e[t])?void 0:s[n]}};class x{constructor(){this.next=new WeakMap,this.nextPath=void 0}get(e,t){let n=this.next.get(e);if(!n)return b;for(;n.nextPath;){var s;const e=null!=(s=t(n.nextPath))?s:i;if(n=n.next.get(e),!n)return b}return[n.value,n.journey]}set(e,t){if(e.length<1)throw new I;let n=this;for(const{path:t,entity:s}of e){let e=n.next.get(s);e||(e=new k,n.next.set(null!=s?s:i,e)),n.nextPath=t,n=e}n.nextPath=void 0,n.value=t,n.journey=e.map((e=>e.path))}}const b=[void 0,void 0];class k{constructor(){this.next=new WeakMap,this.nextPath=void 0,this.value=void 0,this.journey=[]}}class I extends Error{constructor(...e){super(...e),this.message="Keys must include at least one member"}}class L extends w{constructor(e,t){super(e),this.newEntities=new Map,this.newIndexes=new Map,this.entitiesMeta=e.entitiesMeta,this.meta=t,this.checkLoop=function(){const e=new Map;return function(t,n,s){let i=e.get(t);i||(i=new Map,e.set(t,i));let r=i.get(n);return r||(r=new Set,i.set(n,r)),!!r.has(s)||(r.add(s),!1)}}()}getNewEntity(e,t){return this.getNewEntities(e).get(t)}getNewEntities(e){return this.newEntities.has(e)||(this.newEntities.set(e,new Map),this.entities[e]=h({},this.entities[e]),this.entitiesMeta[e]=h({},this.entitiesMeta[e])),this.newEntities.get(e)}getNewIndexes(e){return this.newIndexes.has(e)||(this.newIndexes.set(e,new Map),this.indexes[e]=h({},this.indexes[e])),this.newIndexes.get(e)}mergeEntity(e,t,n){const s=e.key;let i=n,r=this.meta,a=this.getNewEntity(s,t);if(a)i=e.merge(a,n);else if(a=this.getEntity(s,t),a){const o=this.getMeta(s,t);i=e.mergeWithStore(o,r,a,n),r=e.mergeMetaWithStore(o,r,a,n)}this.setEntity(e,t,i,r)}setEntity(e,t,n,i=this.meta){const r=e.key,a=this.getNewEntities(r),o=!a.has(t);a.set(t,n),e.indexes&&function(e,t,n,i,r,a){for(const o of t){n.has(o)||n.set(o,i[o]={});const t=n.get(o);a[e]&&delete t[a[e][o]],a&&a[e]&&a[e][o]!==r[o]&&(t[a[e][o]]=s),o in r&&(t[r[o]]=e)}}(t,e.indexes,this.getNewIndexes(r),this.indexes[r],n,this.entities[r]),this._setEntity(r,t,n),o&&this._setMeta(r,t,i)}invalidate({key:e},t){this.setEntity({key:e},t,s)}_setEntity(e,t,n){this.entities[e][t]=n}_setMeta(e,t,n){this.entitiesMeta[e][t]=n}getMeta(e,t){return this.entitiesMeta[e][t]}}const S=(e,t,n=[],{entities:s,indexes:i,entitiesMeta:r}=A,a={fetchedAt:0,date:Date.now(),expiresAt:1/0})=>{if(null==e)return{result:t,entities:s,indexes:i,entitiesMeta:r};const o=function(e){return["object","function"].includes(typeof e)?"object":typeof e}(e);if(null===t||typeof t!==o&&(void 0===e.key||void 0!==e.pk||"string"!=typeof t))throw new Error(`Unexpected input given to normalize. Expected type to be "${o}", found "${null===t?"null":typeof t}".`);const l={result:"",entities:h({},s),indexes:h({},i),entitiesMeta:h({},r)},u=(e=>{const t=(n,s,i,r,a)=>s&&n?n.normalize&&"function"==typeof n.normalize?"object"!=typeof s?n.pk?`${s}`:s:n.normalize(s,i,r,a,t,e):"object"!=typeof s||"object"!=typeof n?s:(Array.isArray(n)?c:d)(n,s,i,r,a,t):s;return t})(new L(l,a));return l.result=u(e,t,t,void 0,n),l};const A={entities:{},indexes:{},entitiesMeta:{}};class M{constructor(e,t,n){this.dependencies=[],this.cycleCache=new Map,this.cycleIndex=-1,this.localCache=new Map,this._getEntity=e,this._getCache=t,this._resultCache=n}getEntity(e,t,n,s){const i=t.key,{localCacheKey:r,cycleCacheKey:a}=this.getCacheKey(i);if(r.get(e))a.has(e)?this.cycleIndex=a.get(e):this.dependencies.push({path:{key:i,pk:e},entity:n});else{const o=this._getCache(e,t),[c,l]=o.get(n,this._getEntity);if(l)return r.set(e,c.value),this.dependencies.push(...c.dependencies),c.value;{const t=this.dependencies.length;a.set(e,t),this.dependencies.push({path:{key:i,pk:e},entity:n}),s(r),a.delete(e);const c=this.dependencies.slice(-1===this.cycleIndex?t:this.cycleIndex),l={dependencies:c,value:r.get(e)};o.set(c,l),this.cycleIndex===t&&(this.cycleIndex=-1)}}return r.get(e)}getCacheKey(e){this.localCache.has(e)||this.localCache.set(e,new Map),this.cycleCache.has(e)||this.cycleCache.set(e,new Map);return{localCacheKey:this.localCache.get(e),cycleCacheKey:this.cycleCache.get(e)}}getResults(e,t,n){if(!t)return{data:n(),paths:this.paths()};let[s,i]=this._resultCache.get(e,this._getEntity);return void 0===i?(s=n(),i=this.paths(),this.dependencies.unshift({path:{key:"",pk:""},entity:e}),this._resultCache.set(this.dependencies,s)):i.shift(),{data:s,paths:i}}paths(){return this.dependencies.map((e=>e.path))}}function R(e){return void 0!==e&&(!(e&&"object"==typeof e&&!Array.isArray(e))||Object.values(e).every(R))}class O{constructor(e=E){var t;this.endpoints=new x,this.queryKeys=new Map,this.policy=e,this._getCache=(t=new Map,(e,n)=>{var s;const i=n.key,r=null!=(s=n.cacheWith)?s:n;t.has(i)||t.set(i,new Map);const a=t.get(i);a.has(e)||a.set(e,new WeakMap);const o=a.get(e);let c=o.get(r);return c||(c=new x,o.set(r,c)),c})}denormalize(e,t,n,s=[]){if(void 0===e)return{data:t,paths:[]};if(void 0===t)return{data:void 0,paths:[]};const i=this.policy.getEntities(n);return v(i,new M(i,this._getCache,this.endpoints),s)(e,t)}query(e,t,n,s=JSON.stringify(t)){const i=this.buildQueryKey(e,t,n,s);return i?this.denormalize(e,i,n.entities,t):{data:void 0,paths:[]}}buildQueryKey(e,t,n,s=JSON.stringify(t)){if("object"!=typeof e&&"function"!=typeof e.queryKey||!e)return e;let i=this.queryKeys.get(s);i||(i=new x,this.queryKeys.set(s,i));const r=new this.policy.QueryDelegate(n);let[a,o]=i.get(e,(c=r,e=>c[["","getEntitiesObject","getEntity","getIndex"][e.length]](...e)));var c;if(!o){const[n,s]=r.tracked(e);a=function(e){return function t(n,s){return function(e){return!!e&&"function"==typeof e.queryKey}(n)?n.queryKey(s,t,e):"object"==typeof n&&n?(Array.isArray(n)?u:f)(n,s,t,e):n}}(n)(e,t),i.set(s,a)}return a}}var C={Invalid:1,InvalidIfStale:2,Valid:3};function P(e,t){const n=Date.now();return{fetchedAt:null!=t?t:n,date:n,expiresAt:n+e}}const _="rdc/fetch",j="rdc/set",D="rdc/setresponse",T="rdc/optimistic",q="rdc/reset",N="rdc/subscribe",K="rdc/unsubscribe",V="rdc/invalidate",H="rdc/invalidateall",z="rdc/expireall",F="rdc/gc",U=_,B=j,Y=D,Q=T,$=q,W=N,X=K,J=V,G=H,Z=z,ee=F;var te=Object.freeze({__proto__:null,EXPIREALL:z,EXPIREALL_TYPE:Z,FETCH:_,FETCH_TYPE:U,GC:F,GC_TYPE:ee,INVALIDATE:V,INVALIDATEALL:H,INVALIDATEALL_TYPE:G,INVALIDATE_TYPE:J,OPTIMISTIC:T,OPTIMISTIC_TYPE:Q,RESET:q,RESET_TYPE:$,SET:j,SET_RESPONSE:D,SET_RESPONSE_TYPE:Y,SET_TYPE:B,SUBSCRIBE:N,SUBSCRIBE_TYPE:W,UNSUBSCRIBE:K,UNSUBSCRIBE_TYPE:X});function ne(e,t){if(t.endpoint.getOptimisticResponse&&t.endpoint.sideEffect){const a=(n=t.endpoint,s=t.args,i=t.meta.fetchedAt,{type:T,key:n.key(...s),args:s,endpoint:n,meta:P(null!=(r=n.dataExpiryLength)?r:6e4,i)});return h({},e,{optimistic:[...e.optimistic,a]})}var n,s,i,r;return e}class se extends Error{}function ie(e,t,n){return"AbortError"===n.name?h({},e,{optimistic:re(e,t)}):h({},e,{meta:h({},e.meta,{[t.key]:{date:t.meta.date,fetchedAt:t.meta.fetchedAt,expiresAt:t.meta.expiresAt,error:n,errorPolicy:null==t.endpoint.errorPolicy?void 0:t.endpoint.errorPolicy(n)}}),optimistic:re(e,t)})}function re(e,t){return e.optimistic.filter((e=>e.key!==t.key||(e.type===T?e.meta.fetchedAt!==t.meta.fetchedAt:e.meta.date>t.meta.date)))}function ae(e){return function(t,n){switch(t||(t=oe),n.type){case F:return n.entities.forEach((({key:e,pk:n})=>{var s,i;null==(s=t.entities[e])||delete s[n],null==(i=t.entitiesMeta[e])||delete i[n]})),n.endpoints.forEach((e=>{delete t.endpoints[e],delete t.meta[e]})),t;case _:return ne(t,n);case T:case D:return function(e,t,n){if(t.error)return ie(e,t,t.response);try{var s;let i;if(t.type===T){if(!t.endpoint.getOptimisticResponse)return e;try{i=t.endpoint.getOptimisticResponse.call(t.endpoint,n.snapshot(e,t.meta.fetchedAt),...t.args)}catch(t){if(t.constructor===se)return e;throw t}}else i=t.response;const{result:r,entities:a,indexes:o,entitiesMeta:c}=S(t.endpoint.schema,i,t.args,e,t.meta),l=h({},e.endpoints,{[t.key]:r});try{if(t.endpoint.update){const e=t.endpoint.update(r,...t.args);Object.keys(e).forEach((t=>{l[t]=e[t](l[t])}))}}catch(e){console.error(`Endpoint.update() error: ${t.key}`),console.error(e)}return{entities:a,endpoints:l,indexes:o,meta:h({},e.meta,{[t.key]:{date:t.meta.date,fetchedAt:t.meta.fetchedAt,expiresAt:t.meta.expiresAt,prevExpiresAt:null==(s=e.meta[t.key])?void 0:s.expiresAt}}),entitiesMeta:c,optimistic:re(e,t),lastReset:e.lastReset}}catch(n){return"object"==typeof n&&(n.message=`Error processing ${t.key}\n\nFull Schema: ${JSON.stringify(t.endpoint.schema,void 0,2)}\n\nError:\n${n.message}`,"response"in t&&(n.response=t.response),n.status=400),ie(e,t,n)}}(t,n,e);case j:return function(e,t,n){let s;if("function"==typeof t.value){const i=n.get(t.schema,...t.args,e);if(void 0===i)return e;s=t.value(i)}else s=t.value;try{const{entities:n,indexes:i,entitiesMeta:r}=S(t.schema,s,t.args,e,t.meta);return{entities:n,endpoints:e.endpoints,indexes:i,meta:e.meta,entitiesMeta:r,optimistic:e.optimistic,lastReset:e.lastReset}}catch(t){return e}}(t,n,e);case H:case V:return function(e,t){const n=h({},e.endpoints),s=h({},e.meta),i=e=>{delete n[e];const t=h({},s[e],{expiresAt:0,invalidated:!0});delete t.error,s[e]=t};return t.type===V?i(t.key):Object.keys(n).forEach((e=>{t.testKey(e)&&i(e)})),h({},e,{endpoints:n,meta:s})}(t,n);case z:return function(e,t){const n=h({},e.meta);return Object.keys(n).forEach((e=>{t.testKey(e)&&(n[e]=h({},n[e],{expiresAt:1}))})),h({},e,{meta:n})}(t,n);case q:return h({},oe,{lastReset:n.date});default:return t}}}const oe={entities:{},endpoints:{},indexes:{},meta:{},entitiesMeta:{},optimistic:[],lastReset:0};const ce="undefined"!=typeof FormData?e=>e instanceof FormData?Object.fromEntries(e.entries()):e:e=>e;function le(e,{args:t,fetchedAt:n,response:s,error:i=!1}){var r,a;const o=i?null!=(r=e.errorExpiryLength)?r:1e3:null!=(a=e.dataExpiryLength)?a:6e4;return{type:D,key:e.key(...t),response:s,args:t.map(ce),endpoint:e,meta:P(o,n),error:i}}class ue{init(){}cleanup(){}createCountRef(){return()=>()=>{}}}function he(e,t){return e.meta[t]}const de=e=>{throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},pe=()=>oe;class fe{constructor({dispatch:e=de,getState:t=pe,memo:s=new O,gcPolicy:i=new ue}={}){this.fetch=(e,...t)=>{const s=function(e,{args:t}){let n=0,s=0;const i=new Promise(((e,t)=>{[n,s]=[e,t]})),r={fetchedAt:Date.now(),resolve:n,reject:s,promise:i};return{type:_,key:e.key(...t),args:t,endpoint:e,meta:r}}(e,{args:t});return this.dispatch(s),e.schema?s.meta.promise.then((s=>function(e,t,s,i=[]){return void 0===e||void 0===t?t:v(E.getEntities(s),new n,i)(e,t).data}(e.schema,s,{},t))):s.meta.promise},this.fetchIfStale=(e,...t)=>{const{data:n,expiresAt:s,expiryStatus:i}=this.getResponseMeta(e,...t,this.getState());return i!==C.Invalid&&Date.now()<=s?n:this.fetch(e,...t)},this.invalidate=(e,...t)=>null!==t[0]?this.dispatch(function(e,{args:t}){return{type:V,key:e.key(...t)}}(e,{args:t})):Promise.resolve(),this.invalidateAll=e=>this.dispatch({type:H,testKey:t=>e.testKey(t)}),this.expireAll=e=>this.dispatch({type:z,testKey:t=>e.testKey(t)}),this.resetEntireStore=()=>this.dispatch({type:q,date:Date.now()}),this.setResponse=(e,...t)=>{const n=t[t.length-1],s=le(e,{args:t.slice(0,t.length-1),response:n});return this.dispatch(s)},this.setError=(e,...t)=>{const n=t[t.length-1],s=le(e,{args:t.slice(0,t.length-1),response:n,error:!0});return this.dispatch(s)},this.resolve=(e,t)=>this.dispatch(le(e,t)),this.subscribe=(e,...t)=>null!==t[0]?this.dispatch(function(e,{args:t}){return{type:N,key:e.key(...t),args:t,endpoint:e}}(e,{args:t})):Promise.resolve(),this.unsubscribe=(e,...t)=>null!==t[0]?this.dispatch(function(e,{args:t}){return{type:K,key:e.key(...t),args:t,endpoint:e}}(e,{args:t})):Promise.resolve(),this.snapshot=(e,t)=>new ge(this,e,t),this._dispatch=e,this.getState=t,this.memo=s,this.gcPolicy=i}set dispatch(e){this._dispatch=e}get dispatch(){return this._dispatch}bindMiddleware({dispatch:e,getState:t}){this._dispatch=e,this.getState=t}set(e,...t){const n=t[t.length-1],s=function(e,{args:t,fetchedAt:n,value:s}){return{type:j,value:s,args:t.map(ce),schema:e,meta:P(6e4,n)}}(e,{args:t.slice(0,t.length-1),value:n});return this.dispatch(s)}getError(e,...t){if(null===t[0])return;const n=t[t.length-1],s=t.slice(0,t.length-1),i=e.key(...s),r=he(n,i);return void 0===n.endpoints[i]||"soft"!==(null==r?void 0:r.errorPolicy)?null==r?void 0:r.error:void 0}getResponse(e,...t){return this.getResponseMeta(e,...t)}getResponseMeta(e,...t){const[n,s]=ve(t),i=1!==s.length||null!==s[0],r=i?e.key(...s):"",a=i?n.endpoints[r]:void 0,o=e.schema,c=he(n,r);let l=null==c?void 0:c.expiresAt;const u=void 0===a&&void 0!==o,h=u?this.memo.buildQueryKey(o,s,n,r):a;if(!i)return{data:h,expiryStatus:C.Valid,expiresAt:1/0,countRef:()=>()=>{}};let d=!1;if(u)d=!R(h);else if(!o||!ye(o))return{data:a,expiryStatus:this.getExpiryStatus(!a,!!e.invalidIfStale,c),expiresAt:l||0,countRef:this.gcPolicy.createCountRef({key:r})};const{data:p,paths:f}=this.memo.denormalize(o,h,n.entities,s);return l||(l=d?1:function(e,t){let n=1/0;for(const{key:i,pk:r}of e){var s;const e=null==(s=t[i])||null==(s=s[r])?void 0:s.expiresAt;e<n&&(n=e)}return n}(f,n.entitiesMeta)),{data:p,expiryStatus:this.getExpiryStatus("symbol"==typeof p,!!e.invalidIfStale||d,c),expiresAt:l,countRef:this.gcPolicy.createCountRef({key:r,paths:f})}}get(e,...t){const[n,s]=ve(t),{data:i}=this.memo.query(e,s,n);return"symbol"==typeof i?void 0:i}getQueryMeta(e,...t){const[n,s]=ve(t),{data:i,paths:r}=this.memo.query(e,s,n);return{data:"symbol"==typeof i?void 0:i,countRef:this.gcPolicy.createCountRef({paths:r})}}getExpiryStatus(e,t,n={}){return n.invalidated||e&&!n.error?C.Invalid:e||t?C.InvalidIfStale:C.Valid}}function ye(e){if(r(e))return!0;if(Array.isArray(e))return 0!==e.length&&ye(e[0]);if(e&&("object"==typeof e||"function"==typeof e)){const t="schema"in e?e.schema:e;return"function"==typeof t?ye(t):Object.values(t).some((e=>ye(e)))}return!1}class ge{constructor(e,t,n=0){this.state=void 0,this.controller=void 0,this.fetchedAt=void 0,this.abort=ge.abort,this.state=t,this.controller=e,this.fetchedAt=n}getResponse(e,...t){return this.controller.getResponse(e,...t,this.state)}getResponseMeta(e,...t){return this.controller.getResponseMeta(e,...t,this.state)}getError(e,...t){return this.controller.getError(e,...t,this.state)}get(e,...t){return this.controller.get(e,...t,this.state)}getQueryMeta(e,...t){return this.controller.getQueryMeta(e,...t,this.state)}}function ve(e){const t=e.length,n=new Array(t-1);for(let s=0;s<t-1;s++)n[s]=ce(e[s]);return[e[t-1],n]}ge.abort=new se;class me extends Error{constructor(){super("Aborted due to RESET"),this.name="ResetError"}}class we{constructor({dataExpiryLength:e=6e4,errorExpiryLength:t=1e3}={}){this.fetching=new Map,this.controller=new fe,this.middleware=e=>(this.controller=e,t=>n=>{switch(n.type){case _:return this.handleFetch(n),void 0!==n.endpoint.getOptimisticResponse&&n.endpoint.sideEffect?t(n):Promise.resolve();case D:return t(n).then((()=>{if(this.fetching.has(n.key)){var t;const s=null==(t=e.getState().meta[n.key])?void 0:t.error;s?this.handleSet(le(n.endpoint,{args:n.args,response:s,fetchedAt:n.meta.fetchedAt,error:!0})):this.handleSet(n)}}));case q:{const e=Array.from(this.fetching.values());return this.clearAll(),t(n).then((()=>{for(const{reject:t}of e)t(new me)}))}default:return t(n)}}),this.dataExpiryLength=e,this.errorExpiryLength=t}init(){delete this.cleanupDate}cleanup(){this.cleanupDate=Date.now()}skipLogging(e){return e.type===_&&this.fetching.has(e.key)}allSettled(){if(this.fetching.size)return Promise.allSettled(this.fetching.values().map((({promise:e})=>e)))}clearAll(){for(const e of this.fetching.keys())this.clear(e)}clear(e){this.fetching.has(e)&&(this.fetching.get(e).promise.catch((()=>{})),this.fetching.delete(e))}getLastReset(){return this.cleanupDate?this.cleanupDate:this.controller.getState().lastReset}handleFetch(e){const{resolve:t,reject:n,fetchedAt:s}=e.meta,i=!e.endpoint.sideEffect,r=()=>{let r=e.endpoint(...e.args);return i||(r=(e=>e.then((e=>(t(e),e))).catch((e=>{throw n(e),e})))(r)),r=r.then((t=>{let n=this.getLastReset();return s>=n&&this.controller.resolve(e.endpoint,{args:e.args,response:t,fetchedAt:s}),t})).catch((t=>{const n=this.getLastReset();throw s>=n&&this.controller.resolve(e.endpoint,{args:e.args,response:t,fetchedAt:s,error:!0}),t})),r};return i?this.throttle(e.key,r,s).then((e=>t(e))).catch((e=>n(e))):r().catch((()=>{}))}handleSet(e){if(this.fetching.has(e.key)){const{reject:t,resolve:n}=this.fetching.get(e.key);e.error?t(e.response):n(e.response),this.clear(e.key)}}throttle(e,t,n){const s=this.getLastReset();let i=this.fetching.get(e);return i&&i.fetchedAt>s||(i=function(e){const t={fetchedAt:e};return t.promise=new Promise(((e,n)=>{t.resolve=e,t.reject=n})),t}(n),this.fetching.set(e,i),this.idleCallback((()=>{t().catch((()=>null))}),{timeout:500})),i.promise}idleCallback(e,t){e()}}class Ee{isOnline(){return void 0===navigator.onLine||navigator.onLine}addOnlineListener(e){addEventListener("online",e)}removeOnlineListener(e){removeEventListener("online",e)}addOfflineListener(e){addEventListener("offline",e)}removeOfflineListener(e){removeEventListener("offline",e)}}class xe{isOnline(){return!0}addOnlineListener(){}removeOnlineListener(){}addOfflineListener(){}removeOfflineListener(){}}e.DefaultConnectionListener=void 0,"undefined"!=typeof navigator&&"function"==typeof addEventListener?e.DefaultConnectionListener=Ee:e.DefaultConnectionListener=xe;class be{constructor(t,n,s){if(this.frequencyHistogram=new Map,this.offlineListener=()=>{this.cleanup(),this.connectionListener.addOnlineListener(this.onlineListener)},this.onlineListener=()=>{this.connectionListener.removeOnlineListener(this.onlineListener);const e=Date.now();this.startId=setTimeout((()=>{this.startId&&(delete this.startId,this.update(),this.run())}),Math.max(0,this.lastFetchTime()-e+this.frequency)),this.connectionListener.addOfflineListener(this.offlineListener)},void 0===t.endpoint.pollFrequency)throw new Error("frequency needed for polling subscription");this.endpoint=t.endpoint,this.frequency=t.endpoint.pollFrequency,this.args=t.args,this.key=t.key,this.frequencyHistogram.set(this.frequency,1),this.controller=n,this.connectionListener=s||new e.DefaultConnectionListener,this.connectionListener.isOnline()?this.onlineListener():this.offlineListener()}add(e){void 0!==e&&(this.frequencyHistogram.has(e)?this.frequencyHistogram.set(e,this.frequencyHistogram.get(e)+1):(this.frequencyHistogram.set(e,1),e<this.frequency&&(this.frequency=e,this.run())))}remove(e){if(void 0===e)return!1;if(this.frequencyHistogram.has(e)&&(this.frequencyHistogram.set(e,this.frequencyHistogram.get(e)-1),this.frequencyHistogram.get(e)<1)){if(this.frequencyHistogram.delete(e),0===this.frequencyHistogram.size)return this.cleanup(),!0;e<=this.frequency&&(this.frequency=Math.min(...this.frequencyHistogram.keys()),this.run())}return!1}cleanup(){this.intervalId&&(clearInterval(this.intervalId),delete this.intervalId),this.lastIntervalId&&(clearInterval(this.lastIntervalId),delete this.lastIntervalId),this.startId&&(clearTimeout(this.startId),delete this.startId),this.connectionListener.removeOnlineListener(this.onlineListener),this.connectionListener.removeOfflineListener(this.offlineListener)}update(){const e=this.endpoint,t=function(...t){return e.call(this,...t)};Object.assign(t,this.endpoint),t.dataExpiryLength=this.frequency/2,t.errorExpiryLength=this.frequency/10,t.errorPolicy=()=>"soft",t.key=()=>this.key,this.controller.fetch(t,...this.args).catch((()=>null))}run(){this.startId||(this.intervalId&&(this.lastIntervalId=this.intervalId),this.intervalId=setInterval((()=>{this.lastIntervalId&&(clearInterval(this.lastIntervalId),delete this.lastIntervalId),this.intervalId&&this.update()}),this.frequency))}lastFetchTime(){var e,t;return null!=(e=null==(t=this.controller.getState().meta[this.key])?void 0:t.date)?e:0}}class ke{constructor(e){this.subscriptions={},this.controller=new fe,this.middleware=e=>(this.controller=e,e=>t=>{switch(t.type){case N:try{this.handleSubscribe(t)}catch(e){console.error(e)}return Promise.resolve();case K:return this.handleUnsubscribe(t),Promise.resolve();default:return e(t)}}),this.Subscription=e}cleanup(){for(const e in this.subscriptions)this.subscriptions[e].cleanup()}handleSubscribe(e){const t=e.key;if(t in this.subscriptions){const n=e.endpoint.pollFrequency;this.subscriptions[t].add(n)}else this.subscriptions[t]=new this.Subscription(e,this.controller)}handleUnsubscribe(e){const t=e.key;if(t in this.subscriptions){const n=e.endpoint.pollFrequency;this.subscriptions[t].remove(n)&&delete this.subscriptions[t]}}}let Ie={};class Le{constructor(e,t){this.started=!1,this.actions=[],this.maxBufferLength=100,this.devTools="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__.connect(h({},Ie,e)),null!=e&&e.maxAge&&(this.maxBufferLength=2*e.maxAge),t&&(this.skipLogging=t)}handleAction(e,t){this.started?this.devTools.send(e,t):(this.actions.length>this.maxBufferLength&&(this.actions=this.actions.slice(this.maxBufferLength/2)),this.actions.push([e,t]))}init(e){}cleanup(){}}Le.prototype.middleware=()=>e=>t=>e(t);const Se=Symbol("DataClientState"),Ae=Symbol("DataClientController"),Me=t.shallowRef(oe);function Re(){const e=t.inject(Ae,null);return e||new fe}function Oe(){const e=t.inject(Se,null);return e||Me}async function Ce(e,...n){const s=Oe(),i=Re(),r=t.computed((()=>n.map((e=>t.unref(e))))),a=t.computed((()=>null!==r.value[0]?e.key(...r.value):"")),o=t.computed((()=>i.getResponseMeta(e,...r.value,s.value))),c=async()=>{if(!a.value)return;const t=o.value,n=t.expiryStatus===C.Invalid;Date.now()<=t.expiresAt&&!n||await i.fetch(e,...r.value)};return t.watch((()=>{const e=o.value;return[e.expiresAt,e.expiryStatus,s.value.lastReset,a.value]}),(()=>c())),t.watch((()=>o.value.data),((e,t,n)=>{const s=o.value.countRef();n((()=>null==s?void 0:s()))}),{immediate:!0}),await c(),t.readonly(t.computed((()=>o.value.data)))}function Pe(e,...n){const s=Re(),i=t.computed((()=>n.map((e=>t.unref(e))))),r=t.computed((()=>null===i.value[0]?"":e.key(...i.value)));t.watch(r,((t,n,a)=>{if(!r.value)return;const o=i.value;s.subscribe(e,...o),a((()=>{s.unsubscribe(e,...o)}))}),{immediate:!0})}let _e=(e={})=>{const{networkManager:t,subscriptionManager:n=be}=e;return null===n?[je(we,null!=t?t:{})]:[je(we,null!=t?t:{}),je(ke,n)]};function je(e,t){return t instanceof e?t:new e(t)}function De(e={}){var n,s;const{Controller:i=fe,gcPolicy:r,app:a}=e,o=new i({gcPolicy:r}),c=null!=(n=e.managers)?n:_e(),l=null!=(s=e.initialState)?s:oe,u=function(e,t,n){return()=>(e.forEach((e=>{null==e.init||e.init(n)})),t.gcPolicy.init(t),()=>{e.forEach((e=>{e.cleanup()})),t.gcPolicy.cleanup()})}(c,o,l),h=function(e,t){return e.map(((e,n)=>(e.middleware||(e.middleware=null==e.getMiddleware?void 0:e.getMiddleware()),s=>(0===n&&t.bindMiddleware(s),e.middleware(t)))))}(c,o),d=ae(o),p=t.shallowRef(l),f=t.shallowRef(x(l));let y=null;const g=()=>p.value,v=h.map((e=>e({getState:g,dispatch:e=>m(e)}))),m=(w=v,e=>w.reduceRight(((e,t)=>t(e)),e))((async e=>{const t=new Promise((e=>{y=e}));return await(async e=>{const t=d(p.value,e);if(p.value=t,f.value=x(t),y){const e=y;y=null,e()}})(e),t}));var w;let E;o.bindMiddleware({getState:g,dispatch:e=>m(e)});return a?(a.provide(Se,f),a.provide(Ae,o)):(t.provide(Se,f),t.provide(Ae,o)),{controller:o,stateRef:f,start:()=>{E=u()},stop:()=>{E&&E()}};function x(e){return e.optimistic.reduce(d,e)}}const Te={install(e,t={}){const n=De(h({},t,{app:e}));return e.config.globalProperties.$dataClient=n.controller,n.start(),e.onUnmount((()=>{n.stop()})),n}};e.Controller=fe,e.DataClientPlugin=Te,e.DevToolsManager=Le,e.ExpiryStatus=C,e.LogoutManager=class{constructor({handleLogout:e,shouldLogout:t}={}){this.middleware=e=>t=>async n=>{await t(n),n.type===D&&n.error&&this.shouldLogout(n.response)&&this.handleLogout(e)},e&&(this.handleLogout=e),t&&(this.shouldLogout=t)}cleanup(){}shouldLogout(e){return 401===e.status}handleLogout(e){e.resetEntireStore()}},e.NetworkManager=we,e.PollingSubscription=be,e.SubscriptionManager=ke,e.actionTypes=te,e.createDataClient=De,e.getDefaultManagers=_e,e.useCache=function(e,...n){const s=Oe(),i=Re(),r=t.computed((()=>n.map((e=>t.unref(e))))),a=t.computed((()=>null!==r.value[0]?e.key(...r.value):"")),o=t.computed((()=>i.getResponseMeta(e,...r.value,s.value))),c=t.computed((()=>o.value.expiryStatus===C.Invalid)),l=t.computed((()=>(Date.now()>o.value.expiresAt||c.value)&&a.value)),u=t.computed((()=>o.value.expiryStatus!==C.Valid&&l.value));return t.watch((()=>o.value.data),((e,t,n)=>{const s=o.value.countRef();n((()=>s()))}),{immediate:!0}),t.computed((()=>{if(u.value){if(!e.schema)return;return i.getResponseMeta(e,...r.value,h({},s.value,{entities:{}})).data}return o.value.data}))},e.useController=Re,e.useDLE=function(e,...n){const s=Oe(),i=Re(),r=t.computed((()=>n.map((e=>t.unref(e))))),a=t.computed((()=>null!==r.value[0]?e.key(...r.value):"")),o=t.computed((()=>i.getResponseMeta(e,...r.value,s.value))),c=t.computed((()=>o.value.expiryStatus===C.Invalid)),l=t.computed((()=>!(!(Date.now()>o.value.expiresAt||c.value)||!a.value))),u=t.computed((()=>!(o.value.expiryStatus===C.Valid||!l.value)));t.watch((()=>{const e=o.value;return[e.expiresAt,e.expiryStatus,s.value.lastReset,a.value]}),(async()=>{if(!a.value)return;const t=o.value,n=c.value;Date.now()<=t.expiresAt&&!n||await i.fetch(e,...r.value).catch((()=>{}))}),{immediate:!0}),t.watch((()=>o.value.data),((e,t,n)=>{const s=o.value.countRef();n((()=>s()))}),{immediate:!0});const d=t.computed((()=>{if(u.value){if(!e.schema)return;return i.getResponseMeta(e,...r.value,h({},s.value,{entities:{}})).data}return o.value.data})),p=t.computed((()=>i.getError(e,...r.value,s.value)));return t.markRaw({data:d,loading:u,error:p})},e.useDebounce=function(e,n,s=!0){const i=t.ref("object"==typeof e&&null!==e&&"value"in e?e.value:e),r=t.ref(!1);let a=null;const o=()=>{null!==a&&(clearTimeout(a),a=null)};return t.watch([()=>"object"==typeof e&&null!==e&&"value"in e?e.value:e,()=>"object"==typeof s&&null!==s&&"value"in s?s.value:s,()=>n],(([e,t])=>{o(),t?(r.value=!0,a=setTimeout((()=>{i.value=e,r.value=!1,a=null}),n)):r.value=!1}),{immediate:!1}),t.onUnmounted((()=>{o()})),[i,r]},e.useFetch=function(e,...n){const s=Oe(),i=Re(),r=t.computed((()=>n.map((e=>t.unref(e))))),a=t.computed((()=>null!==r.value[0]?e.key(...r.value):"")),o=t.computed((()=>i.getResponseMeta(e,...r.value,s.value))),c=t.ref(void 0),l=()=>{if(!a.value)return;const t=o.value,n=t.expiryStatus===C.Invalid;Date.now()<=t.expiresAt&&!n||(c.value=i.fetch(e,...r.value))};return l(),t.watch((()=>{const e=o.value;return[e.expiresAt,e.expiryStatus,s.value.lastReset,a.value]}),(()=>{l()})),c},e.useLive=async function(e,...t){return Pe(e,...t),Ce(e,...t)},e.useLoading=function(e){const n=t.ref(!1),s=t.ref(void 0),i=t.ref(!0);return t.onUnmounted((()=>{i.value=!1})),[async(...t)=>{let r;n.value=!0,s.value=void 0;try{r=await e(...t)}catch(e){s.value=e}finally{i.value&&(n.value=!1)}return r},n,s]},e.useQuery=function(e,...n){const s=Oe(),i=Re(),r=t.computed((()=>n.map((e=>t.unref(e))))),a=t.computed((()=>i.getQueryMeta(e,...r.value,s.value)));return t.watch((()=>a.value.data),((e,t,n)=>{const s=a.value.countRef();n((()=>s()))}),{immediate:!0}),t.computed((()=>a.value.data))},e.useSubscription=Pe,e.useSuspense=Ce}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@data-client/vue",
3
- "version": "0.15.0",
3
+ "version": "0.15.2",
4
4
  "description": "Async State Management without the Management. REST, GraphQL, SSE, Websockets, Fetch",
5
5
  "homepage": "https://dataclient.io",
6
6
  "repository": {
@@ -76,9 +76,7 @@
76
76
  "lib",
77
77
  "node.mjs",
78
78
  "LICENSE",
79
- "README.md",
80
- "./data_client_logo_and_text.svg",
81
- "./typescript.svg"
79
+ "README.md"
82
80
  ],
83
81
  "scripts": {
84
82
  "build:lib": "NODE_ENV=production BROWSERSLIST_ENV='2020' POLYFILL_TARGETS='chrome>88,safari>14' yarn g:babel --out-dir lib",
@@ -96,7 +94,7 @@
96
94
  "license": "Apache-2.0",
97
95
  "dependencies": {
98
96
  "@babel/runtime": "^7.20.0",
99
- "@data-client/core": "^0.15.0"
97
+ "@data-client/core": "^0.15.4"
100
98
  },
101
99
  "peerDependencies": {
102
100
  "@types/vue": "^3.0.0",
@@ -113,7 +111,7 @@
113
111
  },
114
112
  "devDependencies": {
115
113
  "@anansi/browserslist-config": "^1.4.2",
116
- "@data-client/rest": "0.15.0",
114
+ "@data-client/rest": "0.15.4",
117
115
  "@jest/globals": "^30.0.0",
118
116
  "@js-temporal/polyfill": "^0.5.0",
119
117
  "@types/jest": "30.0.0",
@@ -1,64 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!-- Generator: Adobe Illustrator 23.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
- <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
- viewBox="69 220 1136 205" height="100" xml:space="preserve">
5
- <style type="text/css">
6
- .st0{fill:current;}
7
- .st1{fill:#3E96DB;}
8
- </style>
9
- <g>
10
- <g>
11
- <g>
12
- <path class="st0" d="M448.61,325.58l5.27,10.28h-11.52l-5.27-10.28l-5.51-10.78l-0.25-0.49c-1.81-2.96-5.02-4.94-8.72-4.94
13
- h-10.28v26.49h-10.28v-57.59h36.37c4.28,0,8.15,1.73,10.94,4.53c2.8,2.88,4.53,6.75,4.53,11.02c0,6.25-3.7,11.68-9.05,14.15
14
- c-1.4,0.66-2.88,1.07-4.44,1.23L448.61,325.58z M438.41,299.09c0.74,0,1.48-0.16,2.14-0.49c1.89-0.82,3.13-2.72,3.13-4.77
15
- c0-1.89-0.99-3.21-1.56-3.78c-0.66-0.66-1.89-1.48-3.7-1.48h-26.08v10.61L438.41,299.09z"/>
16
- <path class="st0" d="M518.13,293.74v5.35h37.02v10.28h-37.02v10.86c0,2.88,2.39,5.27,5.27,5.27h42.04v10.28H523.4
17
- c-8.56,0-15.47-6.99-15.47-15.55v-26.49c0-8.56,6.91-15.55,15.47-15.55h42.04v10.28H523.4
18
- C520.52,288.48,518.13,290.86,518.13,293.74z"/>
19
- <path class="st0" d="M674.79,335.78h-11.52L658,325.5l-12.59-24.68l-12.59,24.68l-5.27,10.28h-11.52l5.27-10.28l24.11-47.31
20
- l24.11,47.31L674.79,335.78z"/>
21
- <path class="st0" d="M727.61,306.99c0,10.2,8.31,18.51,18.51,18.51h28.8v10.28h-28.8c-15.88,0-28.8-12.92-28.8-28.8
22
- s12.92-28.8,28.8-28.8h28.8v10.28h-28.8C735.92,288.48,727.61,296.79,727.61,306.99z"/>
23
- <path class="st0" d="M886.32,278.27v10.28h-23.61v47.31h-10.28v-47.31h-23.61v-10.28H886.32z"/>
24
- <path class="st0" d="M940.3,335.78v-57.59h10.28v57.59H940.3z"/>
25
- <path class="st0" d="M1059.85,278.19l-5.27,10.28l-24.11,47.31l-24.11-47.31l-5.27-10.28h11.52l5.27,10.28l12.59,24.68
26
- l12.59-24.68l5.27-10.28H1059.85z"/>
27
- <path class="st0" d="M1117.19,293.74v5.35h37.02v10.28h-37.02v10.86c0,2.88,2.39,5.27,5.27,5.27h42.04v10.28h-42.04
28
- c-8.56,0-15.47-6.99-15.47-15.55v-26.49c0-8.56,6.91-15.55,15.47-15.55h42.04v10.28h-42.04
29
- C1119.58,288.48,1117.19,290.86,1117.19,293.74z"/>
30
- </g>
31
- <g>
32
- <path class="st0" d="M562.83,376.16h9.02c6.88,0,11.55,4.34,11.55,10.7c0,6.36-4.68,10.7-11.55,10.7h-9.02V376.16z M571.67,394.9
33
- c5.29,0,8.68-3.24,8.68-8.04c0-4.8-3.39-8.04-8.68-8.04h-5.78v16.08H571.67z"/>
34
- <path class="st0" d="M625.16,392.21h-11.37l-2.35,5.35h-3.15l9.69-21.4H621l9.72,21.4h-3.21L625.16,392.21z M624.09,389.76
35
- l-4.62-10.48l-4.62,10.48H624.09z"/>
36
- <path class="st0" d="M660.83,378.82h-7.34v-2.66h17.7v2.66h-7.34v18.74h-3.03V378.82z"/>
37
- <path class="st0" d="M710.84,392.21h-11.37l-2.35,5.35h-3.15l9.69-21.4h3.03l9.72,21.4h-3.21L710.84,392.21z M709.77,389.76
38
- l-4.62-10.48l-4.62,10.48H709.77z"/>
39
- <path class="st0" d="M773.57,386.86c0-6.33,4.83-10.94,11.34-10.94c3.3,0,6.17,1.13,8.13,3.33l-1.99,1.93
40
- c-1.65-1.74-3.67-2.54-6.02-2.54c-4.83,0-8.41,3.48-8.41,8.22c0,4.74,3.58,8.22,8.41,8.22c2.35,0,4.37-0.83,6.02-2.57l1.99,1.93
41
- c-1.96,2.2-4.83,3.36-8.16,3.36C778.4,397.8,773.57,393.19,773.57,386.86z"/>
42
- <path class="st0" d="M821.16,376.16h3.06v18.74h11.59v2.66h-14.64V376.16z"/>
43
- <path class="st0" d="M863.07,376.16h3.06v21.4h-3.06V376.16z"/>
44
- <path class="st0" d="M911.82,394.9v2.66h-15.53v-21.4h15.1v2.66h-12.04v6.57h10.73v2.6h-10.73v6.91H911.82z"/>
45
- <path class="st0" d="M958.93,376.16v21.4h-2.51l-12.84-15.96v15.96h-3.06v-21.4h2.51l12.84,15.96v-15.96H958.93z"/>
46
- <path class="st0" d="M993.35,378.82h-7.34v-2.66h17.7v2.66h-7.34v18.74h-3.03V378.82z"/>
47
- </g>
48
- </g>
49
- <g>
50
- <path class="st1" d="M275.11,347.41c-21.84,54.68-67.33,87.9-101.61,74.21c-1.86-0.74-3.65-1.61-5.36-2.59
51
- c31.37,7.82,68.88-18.56,86.22-61.96c18.43-46.13,7.09-94.02-25.32-106.97c-19.2-7.67-41.49-1.36-60.3,14.65
52
- c23.82-34.07,57.23-51.76,83.86-41.13C286.87,237.31,296.95,292.74,275.11,347.41z"/>
53
- <path class="st1" d="M215.54,391.87c-67.76-21.72-114.76-64.06-104.98-94.57c0.53-1.66,1.22-3.24,2.06-4.76
54
- c-3.46,28.09,34.11,62.97,87.9,80.22c57.17,18.33,111.01,9.8,120.25-19.05c5.48-17.09-5.92-37.48-28-55.07
55
- c44.07,22.77,70.76,53.62,63.16,77.33C346.16,406.48,283.3,413.6,215.54,391.87z"/>
56
- <path class="st1" d="M161.63,326.13c37.03-27.02,76.92-35.4,89.08-18.72c0.66,0.91,1.22,1.86,1.7,2.88
57
- c-13.31-12.47-45.72-6.16-75.13,15.29c-31.25,22.79-47.25,54.05-35.75,69.82c6.81,9.34,21.75,11.15,39.29,6.34
58
- c-28.58,14.29-54.78,16.46-64.23,3.51C104.44,388.57,124.6,353.15,161.63,326.13z"/>
59
- <circle class="st1" cx="212.69" cy="340.87" r="11.83"/>
60
- <circle class="st1" cx="143.77" cy="298.83" r="11.83"/>
61
- <circle class="st1" cx="318.02" cy="274.77" r="11.83"/>
62
- </g>
63
- </g>
64
- </svg>
package/typescript.svg DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <svg width="21px" height="21px" viewBox="0 0 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid">
3
- <g>
4
- <polygon fill="#007ACC" transform="translate(128.000000, 128.000000) scale(1, -1) translate(-128.000000, -128.000000) " points="0 128 0 0 128 0 256 0 256 128 256 256 128 256 0 256"></polygon>
5
- <path d="M146.658132,223.436863 L146.739401,212.953054 L130.079084,212.953054 L113.418767,212.953054 L113.418767,165.613371 L113.418767,118.273689 L101.63464,118.273689 L89.8505126,118.273689 L89.8505126,165.613371 L89.8505126,212.953054 L73.1901951,212.953054 L56.5298776,212.953054 L56.5298776,223.233689 C56.5298776,228.922577 56.6517824,233.676863 56.8143221,233.798768 C56.9362269,233.961308 77.2130522,234.042577 101.797179,234.001943 L146.536227,233.880038 L146.658132,223.436863 Z" fill="#FFFFFF" transform="translate(101.634640, 176.142993) rotate(-180.000000) translate(-101.634640, -176.142993) "></path>
6
- <path d="M206.566631,234.272145 C213.068219,232.646748 218.025679,229.761668 222.57679,225.048018 C224.933616,222.528653 228.428219,217.936907 228.712663,216.839764 C228.793933,216.514684 217.659965,209.037859 210.914568,204.852462 C210.670758,204.689922 209.69552,205.74643 208.598377,207.371827 C205.306949,212.166748 201.852981,214.239129 196.570441,214.604843 C188.809171,215.133097 183.811076,211.069605 183.851711,204.283573 C183.851711,202.292462 184.136155,201.114049 184.948854,199.488653 C186.65552,195.953414 189.825044,193.840399 199.7806,189.533097 C218.106949,181.649922 225.949489,176.448653 230.825679,169.053097 C236.270758,160.804208 237.489806,147.638494 233.792028,137.845478 C229.728536,127.199129 219.651076,119.966113 205.469489,117.568653 C201.080917,116.796589 190.678377,116.918494 185.964727,117.771827 C175.684092,119.600399 165.931711,124.679764 159.917743,131.343891 C157.560917,133.944526 152.969171,140.730557 153.253616,141.218176 C153.37552,141.380716 154.432028,142.030875 155.610441,142.721668 C156.748219,143.371827 161.05552,145.850557 165.119012,148.207383 L172.473933,152.474049 L174.01806,150.198494 C176.171711,146.907065 180.885362,142.396589 183.729806,140.893097 C191.897425,136.585795 203.112663,137.195319 208.639012,142.15278 C210.995838,144.30643 211.971076,146.541351 211.971076,149.83278 C211.971076,152.799129 211.605362,154.099446 210.061235,156.334367 C208.070123,159.178811 204.006631,161.576272 192.466314,166.574367 C179.259965,172.263256 173.571076,175.798494 168.369806,181.406113 C165.362822,184.656907 162.518377,189.858176 161.339965,194.206113 C160.364727,197.822621 160.120917,206.884208 160.892981,210.541351 C163.61552,223.300716 173.245996,232.199764 187.143139,234.841034 C191.653616,235.694367 202.137425,235.369287 206.566631,234.272145 Z" fill="#FFFFFF" transform="translate(194.578507, 176.190240) scale(1, -1) translate(-194.578507, -176.190240) "></path>
7
- </g>
8
- </svg>