var e=Symbol(`NOT_FOUND`);function t(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function n(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function r(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var i=e=>Array.isArray(e)?e:[e];function a(e){let t=Array.isArray(e[0])?e[0]:e;return r(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function o(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}function s(t){let n;return{get(r){return n&&t(n.key,r)?n.value:e},put(e,t){n={key:e,value:t}},getEntries(){return n?[n]:[]},clear(){n=void 0}}}function c(t,n){let r=[];function i(t){let i=r.findIndex(e=>n(t,e.key));if(i>-1){let e=r[i];return i>0&&(r.splice(i,1),r.unshift(e)),e.value}return e}function a(n,a){i(n)===e&&(r.unshift({key:n,value:a}),r.length>t&&r.pop())}function o(){return r}function s(){r=[]}return{get:i,put:a,getEntries:o,clear:s}}var l=(e,t)=>e===t;function u(e){return function(t,n){if(t===null||n===null||t.length!==n.length)return!1;let{length:r}=t;for(let i=0;i<r;i++)if(!e(t[i],n[i]))return!1;return!0}}function d(t,n){let{equalityCheck:r=l,maxSize:i=1,resultEqualityCheck:a}=typeof n==`object`?n:{equalityCheck:n},o=u(r),d=0,f=i<=1?s(o):c(i,o);function p(){let n=f.get(arguments);if(n===e){if(n=t.apply(null,arguments),d++,a){let e=f.getEntries().find(e=>a(e.value,n));e&&(n=e.value,d!==0&&d--)}f.put(arguments,n)}return n}return p.clearCache=()=>{f.clear(),p.resetResultsCount()},p.resultsCount=()=>d,p.resetResultsCount=()=>{d=0},p}var f=class{constructor(e){this.value=e}deref(){return this.value}},p=typeof WeakRef<`u`?WeakRef:f,m=0,h=1;function g(){return{s:m,v:void 0,o:null,p:null}}function _(e,t={}){let n=g(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=g(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=g(),e.set(n,t)):t=r}}let s=t,c;if(t.s===h)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=i?.deref?.()??i;e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new p(c):c}return s.s=h,s.v=c,c}return o.clearCache=()=>{n=g(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function v(e,...n){let r=typeof e==`function`?{memoize:e,memoizeOptions:n}:e,s=(...e)=>{let n=0,s=0,c,l={},u=e.pop();typeof u==`object`&&(l=u,u=e.pop()),t(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);let{memoize:d,memoizeOptions:f=[],argsMemoize:p=_,argsMemoizeOptions:m=[],devModeChecks:h={}}={...r,...l},g=i(f),v=i(m),y=a(e),b=d(function(){return n++,u.apply(null,arguments)},...g),x=p(function(){s++;let e=o(y,arguments);return c=b.apply(null,e),c},...v);return Object.assign(x,{resultFunc:u,memoizedResultFunc:b,dependencies:y,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>c,recomputations:()=>n,resetRecomputations:()=>{n=0},memoize:d,argsMemoize:p})};return Object.assign(s,{withTypes:()=>s}),s}var y=v(_),b=Object.assign((e,t=y)=>{n(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e);return t(r.map(t=>e[t]),(...e)=>e.reduce((e,t,n)=>(e[r[n]]=t,e),{}))},{withTypes:()=>b});export{d as n,v as t};