@hitgrab/finder 0.1.8-alpha → 0.1.10-alpha

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.
@@ -23,6 +23,6 @@ declare class FiltersMixin {
23
23
  get values(): Record<string, any>;
24
24
  get raw(): Record<string, any>;
25
25
  serialize(): SerializedFiltersMixin;
26
- static process<FItem>(options: SerializedFiltersMixin, items: FItem[], context?: any): FItem[];
26
+ static process<FItem>(options: SerializedFiltersMixin, items: FItem[], context: any): FItem[];
27
27
  }
28
28
  export { FiltersMixin };
@@ -65,7 +65,7 @@ declare class FinderCore<FItem = any, FContext = any> {
65
65
  activeRule: import("..").GroupByRule<unknown, any> | undefined;
66
66
  requireGroup: boolean;
67
67
  rules: import("..").GroupByRule<unknown, any>[];
68
- groupIdSortDirection: import("..").SortDirection | undefined;
68
+ groupSortDirection: import("..").SortDirection | undefined;
69
69
  set: (identifier?: string | import("..").GroupByRule) => void;
70
70
  toggle: (identifier: import("..").GroupByRule | string) => void;
71
71
  setGroupSortDirection: (direction?: import("..").SortDirection) => void;
@@ -18,6 +18,6 @@ declare class GroupByMixin<FItem, FContext> {
18
18
  toggle(identifier: GroupByRule | string): void;
19
19
  reset(): void;
20
20
  serialize(): SerializedGroupByMixin;
21
- static process<FItem>(options: SerializedGroupByMixin, items: FItem[], context?: unknown): FinderResultGroup<FItem>[];
21
+ static process<FItem>(options: SerializedGroupByMixin, items: FItem[], context: unknown): FinderResultGroup<FItem>[];
22
22
  }
23
23
  export { GroupByMixin };
@@ -13,6 +13,6 @@ declare class SearchMixin<FItem> {
13
13
  reset(): void;
14
14
  serialize(): SerializedSearchMixin;
15
15
  test(searchTerm: string, isAdditive?: boolean): FItem[];
16
- static process<FItem>(options: SerializedSearchMixin, items: FItem[], context?: unknown): FItem[];
16
+ static process<FItem>(options: SerializedSearchMixin, items: FItem[], context: unknown): FItem[];
17
17
  }
18
18
  export { SearchMixin };
@@ -2,7 +2,7 @@ import { FinderResultGroup, SortDirection } from "./core-types";
2
2
  /**
3
3
  * Select a property from the item to sort by.
4
4
  */
5
- export type FinderPropertySelector<FItem, FContext = any> = (item: FItem, context?: FContext) => string | number;
5
+ export type FinderPropertySelector<FItem, FContext = any> = (item: FItem, context: FContext) => string | number;
6
6
  interface RuleBase {
7
7
  id: string;
8
8
  debounceMilliseconds?: number;
@@ -13,11 +13,11 @@ export type FinderRule<FItem = any, FContext = any> = SearchRule<FItem, FContext
13
13
  export type HydratedFinderRule<FItem = any, FContext = any> = SearchRule<FItem, FContext> | HydratedFilterRule<FItem, FContext> | SortByRule<FItem, FContext> | GroupByRule<FItem, FContext>;
14
14
  export interface SearchRule<FItem = any, FContext = any> extends Omit<RuleBase, "id"> {
15
15
  id?: string;
16
- searchFn?: (item: FItem, context?: FContext) => string | string[];
16
+ searchFn?: (item: FItem, context: FContext) => string | string[];
17
17
  }
18
18
  export interface FilterOptionGeneratorFnOptions<FItem, FContext = any> {
19
19
  items: FItem[];
20
- context?: FContext;
20
+ context: FContext;
21
21
  }
22
22
  /**
23
23
  * Describes the display of a filter or sort option.
@@ -34,19 +34,19 @@ export interface FilterRule<FItem = any, FValue = any, FContext = any> extends R
34
34
  export interface FilterRuleWithBooleanValue<FItem, FContext = any> extends FilterRule<FItem> {
35
35
  multiple?: false;
36
36
  boolean: true;
37
- filterFn: (item: FItem, value: boolean, context?: FContext) => boolean;
37
+ filterFn: (item: FItem, value: boolean, context: FContext) => boolean;
38
38
  defaultValue?: boolean;
39
39
  }
40
40
  export interface FilterRuleWithSingleValue<FItem, FValue, FContext = any> extends FilterRule<FItem, FValue, FContext> {
41
41
  multiple?: false;
42
42
  boolean?: false;
43
- filterFn: (item: FItem, value: FValue, context?: FContext) => boolean;
43
+ filterFn: (item: FItem, value: FValue, context: FContext) => boolean;
44
44
  defaultValue?: FValue;
45
45
  }
46
46
  export interface FilterRuleWithMultipleValues<FItem, FValue, FContext = any> extends FilterRule<FItem, FValue, FContext> {
47
47
  multiple: true;
48
48
  boolean?: false;
49
- filterFn: (item: FItem, value: FValue[], context?: FContext) => boolean;
49
+ filterFn: (item: FItem, value: FValue[], context: FContext) => boolean;
50
50
  defaultValue?: FValue[];
51
51
  }
52
52
  export type FilterRuleUnion<FItem = any, FValue = any> = FilterRuleWithBooleanValue<FItem> | FilterRuleWithSingleValue<FItem, FValue> | FilterRuleWithMultipleValues<FItem, FValue>;
@@ -59,7 +59,7 @@ export interface HydratedFilterRule<FItem = any, FValue = any, FContext = any> e
59
59
  boolean: boolean;
60
60
  hidden: boolean;
61
61
  multiple: boolean;
62
- filterFn: ((item: FItem, value: FValue, context?: FContext) => boolean) | ((item: FItem, value: FValue[], context?: FContext) => boolean);
62
+ filterFn: ((item: FItem, value: FValue, context: FContext) => boolean) | ((item: FItem, value: FValue[], context: FContext) => boolean);
63
63
  defaultValue?: boolean | FValue | FValue[];
64
64
  _isHydrated: true;
65
65
  }
@@ -4,7 +4,7 @@ import { FilterRuleWithBooleanValue, FilterRuleWithMultipleValues, FilterRuleWit
4
4
  /**
5
5
  * Enforce structure for an array of rule of mixed types.
6
6
  */
7
- export declare function finderRuleset<FItem>(rules: FinderRule<FItem>[]): FinderRule<FItem>[];
7
+ export declare function finderRuleset<FItem, FContext = any>(rules: FinderRule<FItem, FContext>[]): FinderRule<FItem, FContext>[];
8
8
  export declare function searchRule<FItem, FContext = any>(rule: SearchRule<FItem, FContext>): SearchRule<FItem, FContext>;
9
9
  export declare function filterRule<FItem, FValue = any, FContext = any, T = FilterRuleWithMultipleValues<FItem, FValue, FContext>>(rule: T): FilterRuleWithMultipleValues<FItem, FValue>;
10
10
  export declare function filterRule<FItem, FValue = any, FContext = any, T = FilterRuleWithBooleanValue<FItem, FContext>>(rule: T): FilterRuleWithBooleanValue<FItem, FValue>;
package/dist/index.js CHANGED
@@ -5248,7 +5248,7 @@ class iv {
5248
5248
  activeRule: u.activeRule,
5249
5249
  requireGroup: u.requireGroup,
5250
5250
  rules: u.rules,
5251
- groupIdSortDirection: u.groupSortDirection,
5251
+ groupSortDirection: u.groupSortDirection,
5252
5252
  set: u.set.bind(u),
5253
5253
  toggle: u.toggle.bind(u),
5254
5254
  setGroupSortDirection: u.setGroupSortDirection.bind(u),
@@ -45,4 +45,4 @@ __p += '`),z&&(m+=`' +
45
45
  function print() { __p += __j.call(arguments, '') }
46
46
  `:`;
47
47
  `)+m+`return __p
48
- }`;var M=qo(function(){return $(o,x+"return "+m).apply(i,a)});if(M.source=m,Fu(M))throw M;return M}function _p(e){return X(e).toLowerCase()}function pp(e){return X(e).toUpperCase()}function vp(e,t,n){if(e=X(e),e&&(n||t===i))return Zs(e);if(!e||!(t=Xe(t)))return e;var r=_t(e),s=_t(t),o=Js(r,s),a=Vs(r,s)+1;return en(r,o,a).join("")}function Tp(e,t,n){if(e=X(e),e&&(n||t===i))return e.slice(0,js(e)+1);if(!e||!(t=Xe(t)))return e;var r=_t(e),s=Vs(r,_t(t))+1;return en(r,0,s).join("")}function Rp(e,t,n){if(e=X(e),e&&(n||t===i))return e.replace(Fi,"");if(!e||!(t=Xe(t)))return e;var r=_t(e),s=Js(r,_t(t));return en(r,s).join("")}function Ep(e,t){var n=Si,r=$n;if(oe(t)){var s="separator"in t?t.separator:s;n="length"in t?F(t.length):n,r="omission"in t?Xe(t.omission):r}e=X(e);var o=e.length;if(wn(e)){var a=_t(e);o=a.length}if(n>=o)return e;var c=n-yn(r);if(c<1)return r;var d=a?en(a,0,c).join(""):e.slice(0,c);if(s===i)return d+r;if(a&&(c+=d.length-c),Mu(s)){if(e.slice(c).search(s)){var E,I=d;for(s.global||(s=Qi(s.source,X(vs.exec(s))+"g")),s.lastIndex=0;E=s.exec(I);)var m=E.index;d=d.slice(0,m===i?c:m)}}else if(e.indexOf(Xe(s),c)!=c){var w=d.lastIndexOf(s);w>-1&&(d=d.slice(0,w))}return d+r}function Ip(e){return e=X(e),e&&Na.test(e)?e.replace(ds,Jl):e}var mp=Cn(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Gu=qf("toUpperCase");function Ho(e,t,n){return e=X(e),t=n?i:t,t===i?zl(e)?jl(e):Ml(e):e.match(t)||[]}var qo=B(function(e,t){try{return $e(e,i,t)}catch(n){return Fu(n)?n:new C(n)}}),Sp=Mt(function(e,t){return it(t,function(n){n=yt(n),Dt(e,n,Cu(e[n],e))}),e});function Ap(e){var t=e==null?0:e.length,n=L();return e=t?ie(e,function(r){if(typeof r[1]!="function")throw new ut(A);return[n(r[0]),r[1]]}):[],B(function(r){for(var s=-1;++s<t;){var o=e[s];if($e(o[0],this,r))return $e(o[1],this,r)}})}function wp(e){return Jc(ft(e,G))}function Wu(e){return function(){return e}}function yp(e,t){return e==null||e!==e?t:e}var xp=kf(),Op=kf(!0);function ke(e){return e}function Hu(e){return Ef(typeof e=="function"?e:ft(e,G))}function Lp(e){return mf(ft(e,G))}function Pp(e,t){return Sf(e,ft(t,G))}var bp=B(function(e,t){return function(n){return or(n,e,t)}}),Np=B(function(e,t){return function(n){return or(e,n,t)}});function qu(e,t,n){var r=Ie(t),s=Zr(t,r);n==null&&!(oe(t)&&(s.length||!r.length))&&(n=t,t=e,e=this,s=Zr(t,Ie(t)));var o=!(oe(n)&&"chain"in n)||!!n.chain,a=Bt(e);return it(s,function(c){var d=t[c];e[c]=d,a&&(e.prototype[c]=function(){var E=this.__chain__;if(o||E){var I=e(this.__wrapped__),m=I.__actions__=He(this.__actions__);return m.push({func:d,args:arguments,thisArg:e}),I.__chain__=E,I}return d.apply(e,Xt([this.value()],arguments))})}),e}function Cp(){return ye._===this&&(ye._=uc),this}function Yu(){}function Dp(e){return e=F(e),B(function(t){return Af(t,e)})}var Fp=Eu(ie),Mp=Eu(ks),Up=Eu(zi);function Yo(e){return xu(e)?$i(yt(e)):gh(e)}function Bp(e){return function(t){return e==null?i:dn(e,t)}}var Gp=$f(),Wp=$f(!0);function ku(){return[]}function zu(){return!1}function Hp(){return{}}function qp(){return""}function Yp(){return!0}function kp(e,t){if(e=F(e),e<1||e>Pt)return[];var n=N,r=Pe(e,N);t=L(t),e-=N;for(var s=Zi(r,t);++n<e;)t(n);return s}function zp(e){return D(e)?ie(e,yt):Ze(e)?[e]:He(oo(X(e)))}function $p(e){var t=++rc;return X(e)+t}var Kp=ti(function(e,t){return e+t},0),Xp=Iu("ceil"),Zp=ti(function(e,t){return e/t},1),Jp=Iu("floor");function Vp(e){return e&&e.length?Xr(e,ke,su):i}function Qp(e,t){return e&&e.length?Xr(e,L(t,2),su):i}function jp(e){return Ks(e,ke)}function ev(e,t){return Ks(e,L(t,2))}function tv(e){return e&&e.length?Xr(e,ke,lu):i}function nv(e,t){return e&&e.length?Xr(e,L(t,2),lu):i}var rv=ti(function(e,t){return e*t},1),iv=Iu("round"),uv=ti(function(e,t){return e-t},0);function sv(e){return e&&e.length?Xi(e,ke):0}function fv(e,t){return e&&e.length?Xi(e,L(t,2)):0}return f.after=Ld,f.ary=Eo,f.assign=p_,f.assignIn=Do,f.assignInWith=di,f.assignWith=v_,f.at=T_,f.before=Io,f.bind=Cu,f.bindAll=Sp,f.bindKey=mo,f.castArray=Hd,f.chain=vo,f.chunk=Jh,f.compact=Vh,f.concat=Qh,f.cond=Ap,f.conforms=wp,f.constant=Wu,f.countBy=sd,f.create=R_,f.curry=So,f.curryRight=Ao,f.debounce=wo,f.defaults=E_,f.defaultsDeep=I_,f.defer=Pd,f.delay=bd,f.difference=jh,f.differenceBy=eg,f.differenceWith=tg,f.drop=ng,f.dropRight=rg,f.dropRightWhile=ig,f.dropWhile=ug,f.fill=sg,f.filter=od,f.flatMap=cd,f.flatMapDeep=hd,f.flatMapDepth=gd,f.flatten=ho,f.flattenDeep=fg,f.flattenDepth=og,f.flip=Nd,f.flow=xp,f.flowRight=Op,f.fromPairs=ag,f.functions=O_,f.functionsIn=L_,f.groupBy=dd,f.initial=cg,f.intersection=hg,f.intersectionBy=gg,f.intersectionWith=dg,f.invert=b_,f.invertBy=N_,f.invokeMap=pd,f.iteratee=Hu,f.keyBy=vd,f.keys=Ie,f.keysIn=Ye,f.map=oi,f.mapKeys=D_,f.mapValues=F_,f.matches=Lp,f.matchesProperty=Pp,f.memoize=li,f.merge=M_,f.mergeWith=Fo,f.method=bp,f.methodOf=Np,f.mixin=qu,f.negate=ci,f.nthArg=Dp,f.omit=U_,f.omitBy=B_,f.once=Cd,f.orderBy=Td,f.over=Fp,f.overArgs=Dd,f.overEvery=Mp,f.overSome=Up,f.partial=Du,f.partialRight=yo,f.partition=Rd,f.pick=G_,f.pickBy=Mo,f.property=Yo,f.propertyOf=Bp,f.pull=Tg,f.pullAll=_o,f.pullAllBy=Rg,f.pullAllWith=Eg,f.pullAt=Ig,f.range=Gp,f.rangeRight=Wp,f.rearg=Fd,f.reject=md,f.remove=mg,f.rest=Md,f.reverse=bu,f.sampleSize=Ad,f.set=H_,f.setWith=q_,f.shuffle=wd,f.slice=Sg,f.sortBy=Od,f.sortedUniq=Pg,f.sortedUniqBy=bg,f.split=cp,f.spread=Ud,f.tail=Ng,f.take=Cg,f.takeRight=Dg,f.takeRightWhile=Fg,f.takeWhile=Mg,f.tap=Vg,f.throttle=Bd,f.thru=fi,f.toArray=bo,f.toPairs=Uo,f.toPairsIn=Bo,f.toPath=zp,f.toPlainObject=Co,f.transform=Y_,f.unary=Gd,f.union=Ug,f.unionBy=Bg,f.unionWith=Gg,f.uniq=Wg,f.uniqBy=Hg,f.uniqWith=qg,f.unset=k_,f.unzip=Nu,f.unzipWith=po,f.update=z_,f.updateWith=$_,f.values=Mn,f.valuesIn=K_,f.without=Yg,f.words=Ho,f.wrap=Wd,f.xor=kg,f.xorBy=zg,f.xorWith=$g,f.zip=Kg,f.zipObject=Xg,f.zipObjectDeep=Zg,f.zipWith=Jg,f.entries=Uo,f.entriesIn=Bo,f.extend=Do,f.extendWith=di,qu(f,f),f.add=Kp,f.attempt=qo,f.camelCase=V_,f.capitalize=Go,f.ceil=Xp,f.clamp=X_,f.clone=qd,f.cloneDeep=kd,f.cloneDeepWith=zd,f.cloneWith=Yd,f.conformsTo=$d,f.deburr=Wo,f.defaultTo=yp,f.divide=Zp,f.endsWith=Q_,f.eq=vt,f.escape=j_,f.escapeRegExp=ep,f.every=fd,f.find=ad,f.findIndex=lo,f.findKey=m_,f.findLast=ld,f.findLastIndex=co,f.findLastKey=S_,f.floor=Jp,f.forEach=To,f.forEachRight=Ro,f.forIn=A_,f.forInRight=w_,f.forOwn=y_,f.forOwnRight=x_,f.get=Uu,f.gt=Kd,f.gte=Xd,f.has=P_,f.hasIn=Bu,f.head=go,f.identity=ke,f.includes=_d,f.indexOf=lg,f.inRange=Z_,f.invoke=C_,f.isArguments=vn,f.isArray=D,f.isArrayBuffer=Zd,f.isArrayLike=qe,f.isArrayLikeObject=he,f.isBoolean=Jd,f.isBuffer=tn,f.isDate=Vd,f.isElement=Qd,f.isEmpty=jd,f.isEqual=e_,f.isEqualWith=t_,f.isError=Fu,f.isFinite=n_,f.isFunction=Bt,f.isInteger=xo,f.isLength=hi,f.isMap=Oo,f.isMatch=r_,f.isMatchWith=i_,f.isNaN=u_,f.isNative=s_,f.isNil=o_,f.isNull=f_,f.isNumber=Lo,f.isObject=oe,f.isObjectLike=ce,f.isPlainObject=dr,f.isRegExp=Mu,f.isSafeInteger=a_,f.isSet=Po,f.isString=gi,f.isSymbol=Ze,f.isTypedArray=Fn,f.isUndefined=l_,f.isWeakMap=c_,f.isWeakSet=h_,f.join=_g,f.kebabCase=tp,f.last=at,f.lastIndexOf=pg,f.lowerCase=np,f.lowerFirst=rp,f.lt=g_,f.lte=d_,f.max=Vp,f.maxBy=Qp,f.mean=jp,f.meanBy=ev,f.min=tv,f.minBy=nv,f.stubArray=ku,f.stubFalse=zu,f.stubObject=Hp,f.stubString=qp,f.stubTrue=Yp,f.multiply=rv,f.nth=vg,f.noConflict=Cp,f.noop=Yu,f.now=ai,f.pad=ip,f.padEnd=up,f.padStart=sp,f.parseInt=fp,f.random=J_,f.reduce=Ed,f.reduceRight=Id,f.repeat=op,f.replace=ap,f.result=W_,f.round=iv,f.runInContext=g,f.sample=Sd,f.size=yd,f.snakeCase=lp,f.some=xd,f.sortedIndex=Ag,f.sortedIndexBy=wg,f.sortedIndexOf=yg,f.sortedLastIndex=xg,f.sortedLastIndexBy=Og,f.sortedLastIndexOf=Lg,f.startCase=hp,f.startsWith=gp,f.subtract=uv,f.sum=sv,f.sumBy=fv,f.template=dp,f.times=kp,f.toFinite=Gt,f.toInteger=F,f.toLength=No,f.toLower=_p,f.toNumber=lt,f.toSafeInteger=__,f.toString=X,f.toUpper=pp,f.trim=vp,f.trimEnd=Tp,f.trimStart=Rp,f.truncate=Ep,f.unescape=Ip,f.uniqueId=$p,f.upperCase=mp,f.upperFirst=Gu,f.each=To,f.eachRight=Ro,f.first=go,qu(f,function(){var e={};return At(f,function(t,n){Z.call(f.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),f.VERSION=l,it(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){f[e].placeholder=f}),it(["drop","take"],function(e,t){H.prototype[e]=function(n){n=n===i?1:pe(F(n),0);var r=this.__filtered__&&!t?new H(this):this.clone();return r.__filtered__?r.__takeCount__=Pe(n,r.__takeCount__):r.__views__.push({size:Pe(n,N),type:e+(r.__dir__<0?"Right":"")}),r},H.prototype[e+"Right"]=function(n){return this.reverse()[e](n).reverse()}}),it(["filter","map","takeWhile"],function(e,t){var n=t+1,r=n==En||n==Sr;H.prototype[e]=function(s){var o=this.clone();return o.__iteratees__.push({iteratee:L(s,3),type:n}),o.__filtered__=o.__filtered__||r,o}}),it(["head","last"],function(e,t){var n="take"+(t?"Right":"");H.prototype[e]=function(){return this[n](1).value()[0]}}),it(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");H.prototype[e]=function(){return this.__filtered__?new H(this):this[n](1)}}),H.prototype.compact=function(){return this.filter(ke)},H.prototype.find=function(e){return this.filter(e).head()},H.prototype.findLast=function(e){return this.reverse().find(e)},H.prototype.invokeMap=B(function(e,t){return typeof e=="function"?new H(this):this.map(function(n){return or(n,e,t)})}),H.prototype.reject=function(e){return this.filter(ci(L(e)))},H.prototype.slice=function(e,t){e=F(e);var n=this;return n.__filtered__&&(e>0||t<0)?new H(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(t=F(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)},H.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},H.prototype.toArray=function(){return this.take(N)},At(H.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),s=f[r?"take"+(t=="last"?"Right":""):t],o=r||/^find/.test(t);s&&(f.prototype[t]=function(){var a=this.__wrapped__,c=r?[1]:arguments,d=a instanceof H,E=c[0],I=d||D(a),m=function(W){var z=s.apply(f,Xt([W],c));return r&&w?z[0]:z};I&&n&&typeof E=="function"&&E.length!=1&&(d=I=!1);var w=this.__chain__,x=!!this.__actions__.length,P=o&&!w,M=d&&!x;if(!o&&I){a=M?a:new H(this);var b=e.apply(a,c);return b.__actions__.push({func:fi,args:[m],thisArg:i}),new st(b,w)}return P&&M?e.apply(this,c):(b=this.thru(m),P?r?b.value()[0]:b.value():b)})}),it(["pop","push","shift","sort","splice","unshift"],function(e){var t=Cr[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);f.prototype[e]=function(){var s=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(D(o)?o:[],s)}return this[n](function(a){return t.apply(D(a)?a:[],s)})}}),At(H.prototype,function(e,t){var n=f[t];if(n){var r=n.name+"";Z.call(Pn,r)||(Pn[r]=[]),Pn[r].push({name:t,func:n})}}),Pn[ei(i,Ce).name]=[{name:"wrapper",func:i}],H.prototype.clone=Ic,H.prototype.reverse=mc,H.prototype.value=Sc,f.prototype.at=Qg,f.prototype.chain=jg,f.prototype.commit=ed,f.prototype.next=td,f.prototype.plant=rd,f.prototype.reverse=id,f.prototype.toJSON=f.prototype.valueOf=f.prototype.value=ud,f.prototype.first=f.prototype.head,tr&&(f.prototype[tr]=nd),f},xn=ec();an?((an.exports=xn)._=xn,Hi._=xn):ye._=xn}).call(na)}(Gn,Gn.exports)),Gn.exports}var Ge=ra();function Wn(h){return h.toLowerCase().replace(/[^\w\d]+/g,"")}function _i(h,u){const i=new RegExp(/"(.*?)"/g);let l=u,_=[],T,A=!1;for(;(T=i.exec(u))!==null&&A===!1;){const K=Wn(String(T[1])),G=ia(h,K);G===void 0?A=!0:(_=_.concat(G),l=l.replace(T[0],""))}if(A)return;const O=Wn(l),U=ua(h,O);return U===void 0?void 0:(_=_.concat(U),_.sort((K,G)=>K-G))}function ia(h,u){const i=h.indexOf(u);if(i!==-1)return Ge.range(i,i+u.length).map(l=>l)}function ua(h,u){const i=Array.from(u),l=[];let _=h,T=0,A=!1;for(const O of i){const U=_.indexOf(O);if(U===-1&&(A=!0),A===!1){l.push(T+U);const k=U+1;T+=k,_=_.substring(k)}}if(!A)return l}const mi=class mi{constructor(u){j(this,qn);this.source=u;const i=mi.composeTransformedHaystackSegments(u);q(this,qn,i),this.transformed=i.map(l=>l.value).join("").toLowerCase()}getSourceCharacterIndex(u){let i=0;return v(this,qn).reduce((l,_)=>{if(l!==1/0)return l;const T=i+_.value.length;if(u>=i&&u<=T){const A=u-i;l=_.index+A}return i+=_.value.length,l},1/0)}static composeTransformedHaystackSegments(u){const i=u.matchAll(/[\w\d]+/g),l=[];for(const _ of i)l.push({value:_[0],index:_.index,length:_[0].length});return l}};qn=new WeakMap;let pi=mi;function sa(h,u){return(Array.isArray(h)?h:[h]).map(_=>new pi(_)).reduce((_,T)=>{if(_!==void 0)return _;const A=_i(T.transformed,u);if(A===void 0)return _;const O=fa(A,T.transformed),U=oa(T,O);return aa(U)},void 0)}function fa(h,u){const i=[...h],l=[];let _=0;for(;i.length>0&&_<100;){const T=i.at(0);if(T===void 0)throw new Error("Should never get here");let A=1;for(let K=1;K<=i.length;K+=1){const G=i.at(K);G!==void 0&&T+K===G&&(A+=1)}const O=T,U=T+A,k=u.substring(O,U);l.push({index:O,value:k,is_match:!0,length:k.length}),i.splice(0,A),_+=1}return l}function oa(h,u){return u.reduce((i,l,_)=>{if(_===0&&l.index!==0){const k=h.source.substring(0,h.getSourceCharacterIndex(l.index));i.push({index:0,value:k,is_match:!1,length:k.length})}const T=h.getSourceCharacterIndex(l.index),A=h.getSourceCharacterIndex(l.index+l.length),O=h.source.substring(T,A);i.push({index:T,value:O,is_match:!0,length:O.length});const U=u.at(_+1);if(U){const k=h.getSourceCharacterIndex(l.index+l.length),K=h.getSourceCharacterIndex(U.index),G=h.source.substring(k,K);i.push({index:k,value:G,is_match:!1,length:G.length})}else if(T+O.length!==h.source.length){const k=T+O.length,K=h.source.substring(k);i.push({index:k,value:K,is_match:!1,length:K.length})}return i},[])}function aa(h){const u=/\S/,i=[...h];return i.forEach((l,_)=>{if(l.is_match){const T=l.value.search(u);if(T!==0){const A=i.at(_-1);A&&(A.length+=T,A.value+=l.value.substring(0,T),l.value=l.value.substring(T),l.index=l.index+T)}}}),i}function la(h,u){return(Array.isArray(h)?h:[h]).some(l=>{const _=Wn(l);return _i(_,u)!==void 0})}function is({needle:h,haystack:u,Match:i="span",Miss:l}){const _=J.useMemo(()=>sa(u,h),[u,h]);return _===void 0?u:_.map((T,A)=>{const O=[T.value,A].join();return T.is_match?typeof i=="string"?Oe.jsx(i,{"data-is-match":T.is_match,children:T.value},O):Oe.jsx(i,{"data-is-match":T.is_match,segment:T,segmentIndex:A},O):l!==void 0?typeof l=="string"?Oe.jsx(l,{"data-is-match":T.is_match,children:T.value},O):Oe.jsx(l,{"data-is-match":T.is_match,segment:T,segmentIndex:A},O):T.value})}function ca({Match:h="span",Miss:u,children:i}){const l=nn();return l.search.hasSearchTerm===!1?i:Oe.jsx(is,{needle:l.search.searchTerm,haystack:i,Match:h,Miss:u})}function vi(h){return typeof h=="object"&&h!==null&&"sortFn"in h}function Rr(h){return typeof h=="object"&&h!==null&&("searchFn"in h||"haystackFn"in h)}function us(h){return typeof h=="object"&&h!==null&&"filterFn"in h}function ss(h){return typeof h=="object"&&h!==null&&"filterFn"in h&&"_isHydrated"in h}function Ti(h){return typeof h=="object"&&h!==null&&"groupFn"in h}function ha(h){return typeof h=="object"&&h!==null&&("rules"in h||"callback"in h)}function ga(h){return typeof h=="object"&&h!==null&&("haystack"in h||"callback"in h)}const ue={INIT:"init",FIRST_USER_INTERACTION:"firstUserInteraction",READY:"ready",CHANGE:"change",SET_ITEMS:"setItems",SET_IS_LOADING:"setIsLoading",SET_IS_DISABLED:"setIsDisabled",SET_CONTEXT:"setContext",SET_SEARCH_TERM:"setSearchTerm",RESET_SEARCH_TERM:"resetSearchTerm",SET_FILTER:"setFilter",SET_SORT_BY:"setSortBy",SET_SORT_BY_DIRECTION:"setSortDirection",SET_GROUP_BY:"setGroupBy",SET_GROUP_SORT_BY_DIRECTION:"setGroupBySortDirection",SET_PAGE:"setPage",SET_NUM_ITEMS_PER_PAGE:"setNumItemsPerPage"},me={CORE:"core",SEARCH:"search",FILTERS:"filters",GROUP_BY:"groupBy",SORT_BY:"sortBy",PAGINATION:"pagination"},se={RULE_NOT_FOUND:"Finder could not locate requested rule",WRONG_RULE_TYPE_FOR_MIXIN:"The requested rule is not valid for this mixin.",NO_SEARCH_RULE_SET:"Unable to set search term; no SearchRule was found.",SETTING_MULTIPLE_FILTER_WITHOUT_ARRAY:"Finder could not set this filter value, as the rule requires an array.",ADDING_OPTION_TO_MULTIPLE_FILTER_WITHOUT_OPTION_VALUE:"Finder could not add to this filter, as no optionValue was passed.",DELETING_OPTION_VALUE_FROM_NON_MULTIPLE_FILTER:"Finder could not delete an option from this filter, as it does not support multiple values.",SETTING_BOOLEAN_FILTER_WITHOUT_BOOLEAN_VALUE:"Finder could not set this filter value, as the rule requires a boolean.",ADDING_OPTION_VALUE_TO_NON_MULTIPLE_FILTER:"Finder could not add to this filter value, as the rule is a boolean.",TOGGLING_OPTION_ON_RULE_WITH_NO_OPTIONS:"Finder could not toggle this filter rule option, as the filter does not have any options.",TOGGLING_OPTION_ON_RULE_WITH_SINGLE_VALUE:"Finder could not toggle this filter rule option, as the rule does not allow multiple values.",TOGGLING_OPTION_THAT_DOES_NOT_EXIST:"Finder could not toggle this filter rule option, as the option was not found.",TOGGLING_OPTION_WITHOUT_PASSING_OPTION:"Finder could not toggle this filter rule option, as the option was not found.",TESTING_OPTIONS_ON_RULE_WITH_NO_OPTIONS:"Finder was unable to test the options for this filter rule. It must be a boolean or have defined options.",INVALID_RULE_WITHOUT_ID:"Init failed: Missing rule id.",INVALID_RULE_SHAPE:"Init failed: Malformed rule definition",INVALID_RULE_DUPLICATE:"Init failed: Duplicate rule id."};class fe extends Error{constructor(u,i){const l=`${u} ${JSON.stringify({...i})}`;super(l),this.name="FinderError"}}function da(h,u){const i=h.length/u.length;let l=1,_=1,T=0;for(let A=0;A<h.length;A+=1)T!==void 0&&h.at(A)===T+1&&(_+=1,_>=l&&(l=_)),T=h.at(A);return{percentOfHaystackMatched:i,longestSequentialSequence:l}}class fs{constructor({initialSearchTerm:u},i){j(this,Qe);this.searchTerm=u??"",q(this,Qe,i)}get rule(){return v(this,Qe).getRuleBook().rules.find(Rr)}get hasSearchRule(){return v(this,Qe).getRuleBook().rules.some(Rr)}get hasSearchTerm(){return this.searchTerm!==""}setSearchTerm(u){const i=this.rule;if(!i)throw new fe(se.NO_SEARCH_RULE_SET);if(v(this,Qe).isDisabled())return;const l=this.searchTerm;this.searchTerm=u,l!==u&&v(this,Qe).debouncer(i,()=>{v(this,Qe).touch({source:me.SEARCH,event:ue.SET_SEARCH_TERM,current:u,initial:l,rule:i})})}reset(){if(v(this,Qe).isDisabled())return;const u=this.searchTerm;this.searchTerm="",v(this,Qe).touch({source:me.SEARCH,event:ue.RESET_SEARCH_TERM,current:"",initial:u,rule:this.rule})}serialize(){return{searchTerm:this.searchTerm,rule:this.rule}}test(u,i=!1){return v(this,Qe).test({search:{searchTerm:u,rule:this.rule}},i)}static process(u,i,l){if(u.rule===void 0||u.searchTerm==="")return i;const _=i.reduce((O,U)=>{var ae;if(((ae=u.rule)==null?void 0:ae.searchFn)===void 0)return O;const k=u.rule.searchFn(U,l),G=(Array.isArray(k)?k.map(Wn):[Wn(k)]).reduce((Ae,Te)=>{const Ne=_i(Te,u.searchTerm);return Ne!==void 0&&Ae.push(da(Ne,Te)),Ae},[]);if(G.length>0){const Te=Ge.orderBy(G,["percentOfHaystackMatched","longestSequentialSequence"],["desc","asc"]).at(0);Te&&O.push({item:U,score:Te})}return O},[]),T=_.reduce((O,U)=>(U.score.longestSequentialSequence>O&&(O=U.score.longestSequentialSequence),O),0);return Ge.orderBy(_,[O=>{const U=O.score.percentOfHaystackMatched*100,k=O.score.longestSequentialSequence/T*100;return U+k}],["desc"]).map(O=>O.item)}}Qe=new WeakMap;function _a(h){return{validate(u){if(u!==void 0&&typeof u!="boolean")throw new fe(se.SETTING_BOOLEAN_FILTER_WITHOUT_BOOLEAN_VALUE,{rule:h,value:u});return!0},parse(u){return u===void 0?h.required?!0:h.defaultValue!==void 0?h.defaultValue:!1:u},has(u){return this.parse(u)},toggle(u,i){const l=this.parse(u);if(typeof l!="boolean")throw new fe(se.SETTING_BOOLEAN_FILTER_WITHOUT_BOOLEAN_VALUE,{rule:h,value:l,optionValue:i});return!l},add(u,i){throw new fe(se.ADDING_OPTION_VALUE_TO_NON_MULTIPLE_FILTER,{rule:h,value:u,optionValue:i})},delete(u,i){if(i!==void 0)throw new fe(se.DELETING_OPTION_VALUE_FROM_NON_MULTIPLE_FILTER,{rule:h,value:u,optionValue:i})},isActive(u){return h.required?!0:this.parse(u)===!0}}}function pa(h){return{validate(u){if(u!==void 0&&Array.isArray(u)===!1)throw new fe(se.SETTING_MULTIPLE_FILTER_WITHOUT_ARRAY,{rule:h,value:u});return!0},parse(u){var i;if(u===void 0)return h.required&&Array.isArray(h.options)&&h.options.length>0?[(i=h.options.at(0))==null?void 0:i.value]:[];if(Array.isArray(u))return u;throw new fe(se.SETTING_MULTIPLE_FILTER_WITHOUT_ARRAY,{rule:h,value:u})},has(u,i){var _;if(i===void 0)return Array.isArray(u)&&u.length>0;if(Array.isArray(i))return i.every(T=>this.has(h,T));const l=(_=h.options)==null?void 0:_.find(T=>typeof i=="object"&&"value"in i?T.value===i.value:T.value===i);return Array.isArray(u)&&l!==void 0&&u.includes(l.value)},toggle(u,i){const l=this.parse(u);if(Array.isArray(l)===!1)throw new fe(se.SETTING_MULTIPLE_FILTER_WITHOUT_ARRAY,{rule:h,value:l});if(i===void 0)throw new fe(se.TOGGLING_OPTION_WITHOUT_PASSING_OPTION,{rule:h});if(h.options===void 0)throw new fe(se.TOGGLING_OPTION_ON_RULE_WITH_NO_OPTIONS,{rule:h,optionValue:i});const _=h.options.find(T=>typeof i=="object"&&"value"in i?T.value===i.value:T.value===i);if(_===void 0)throw new fe(se.TOGGLING_OPTION_THAT_DOES_NOT_EXIST,{rule:h,optionValue:i});return l.includes(_.value)?[...l.filter(T=>T!==_.value)]:[...l,_.value]},add(u,i){var T;const l=this.parse(u);if(i===void 0)throw new fe(se.ADDING_OPTION_TO_MULTIPLE_FILTER_WITHOUT_OPTION_VALUE,{rule:h,optionValue:i});const _=(T=h.options)==null?void 0:T.find(A=>typeof i=="object"&&"value"in i?A.value===i.value:A.value===i);return _!==void 0?l.includes(_.value)===!1?[...l,_.value]:l:[...l,i]},delete(u,i){var T;if(i===void 0)return;const l=this.parse(u),_=(T=h.options)==null?void 0:T.find(A=>typeof i=="object"&&"value"in i?A.value===i.value:A.value===i);return _!==void 0&&l.includes(_.value)?l.filter(A=>A.value!==_.value):l.filter(A=>A!==i)},isActive(u){return h.required?!0:this.parse(u).length>0}}}function va(h){return{validate(){return!0},parse(u){var i;if(u===void 0&&h.required){if(h.defaultValue)return h.defaultValue;if(Array.isArray(h.options)&&h.options.length>0)return(i=h.options.at(0))==null?void 0:i.value}return u},has(u){return u!==void 0},toggle(u,i){throw new fe(se.TOGGLING_OPTION_ON_RULE_WITH_SINGLE_VALUE,{rule:h,value:u,optionValue:i})},add(u,i){throw new fe(se.ADDING_OPTION_VALUE_TO_NON_MULTIPLE_FILTER,{rule:h,value:u,optionValue:i})},delete(u,i){if(i!==void 0)throw new fe(se.DELETING_OPTION_VALUE_FROM_NON_MULTIPLE_FILTER,{rule:h,value:u,optionValue:i})},isActive(u){return h.required?!0:!(u===void 0||typeof u=="string"&&u.trim()==="")}}}function xt(h){return h.boolean?_a(h):h.multiple?pa(h):va(h)}class os{constructor({initialFilters:u},i){j(this,Se);j(this,ze);q(this,Se,u??{}),q(this,ze,i)}set(u,i){if(v(this,ze).isDisabled())return;const l=this.getRule(u),_=this.get(u),A=typeof i=="string"&&i.trim()===""?void 0:i;xt(l).validate(i),!(v(this,Se)[l.id]!==void 0&&v(this,Se)[l.id]===A)&&v(this,ze).debouncer(l,()=>{q(this,Se,{...v(this,Se),[l.id]:A}),v(this,ze).touch({source:me.FILTERS,event:ue.SET_FILTER,current:A,initial:_,rule:l})})}get rules(){return v(this,ze).getRuleBook().rules.filter(ss)}get activeRules(){return this.rules.filter(u=>xt(u).isActive(v(this,Se)[u.id]))}get(u){const i=this.getRule(u),l=v(this,Se)[i.id];return xt(i).parse(l)}has(u,i){const l=this.getRule(u),_=v(this,Se)[l.id];return xt(l).has(_,i)}getRule(u){const i=v(this,ze).getRuleBook().getRule(u);if(ss(i)===!1)throw new fe(se.WRONG_RULE_TYPE_FOR_MIXIN,{rule:i});return i}add(u,i){const l=this.getRule(u),_=v(this,Se)[l.id];this.set(l,xt(l).add(_,i))}delete(u,i){const l=this.getRule(u),_=v(this,Se)[l.id];this.set(l,xt(l).delete(_,i))}isRuleActive(u){const i=this.getRule(u),l=v(this,Se)[i.id];return xt(i).isActive(l)}toggle(u,i){const l=this.getRule(u),_=v(this,Se)[l.id],T=xt(l).toggle(_,i);this.set(l,T)}test(u){if(v(this,ze).isLoading())return[];if(u.isAdditive){const i=Ge.uniqBy([...this.rules,...u.rules],"id"),l={...this.values,...u.values};return v(this,ze).test({filters:{rules:i,values:l}},!0)}return v(this,ze).test({filters:{rules:u.rules,values:u.values??{}}})}testRule({rule:u,value:i,...l}){const _=this.getRule(u);return this.test({rules:[_],values:{[_.id]:i},...l})}testRuleOptions({rule:u,...i}){if(v(this,ze).isLoading())return new Map;const l=this.getRule(u);if(l.boolean===!0){const _=new Map;return _.set(!0,this.testRule({rule:l,value:!0,...i})),_.set(!1,this.testRule({rule:l,value:!1,...i})),_}if(Array.isArray(l.options)){const _=new Map;return l.options.forEach(T=>{let A;if(i.mergeExistingValue){const O=v(this,Se)[l.id]??[];l.multiple&&(A=[...O,T.value])}else l.multiple?A=[T.value]:A=T.value;_.set(T,this.testRule({rule:l,value:A,...i}))}),_}throw new fe(se.TESTING_OPTIONS_ON_RULE_WITH_NO_OPTIONS,l)}get values(){return this.rules.reduce((u,i)=>(u[i.id]=this.get(i),u),{})}get raw(){return v(this,Se)}serialize(){return{rules:this.rules,values:this.values}}static process(u,i,l){const _=u.rules.filter(T=>xt(T).isActive(u.values[T.id]));return _.length===0?i:i.filter(T=>_.every(A=>A.filterFn(T,u.values[A.id],l)))}}Se=new WeakMap,ze=new WeakMap;const Ri=[void 0,"desc","asc"];class as{constructor({initialSortBy:u,initialSortDirection:i},l){j(this,rn);j(this,je);j(this,Rt);q(this,Rt,l),u&&q(this,rn,this.getRule(u)),q(this,je,i)}getRule(u){const i=v(this,Rt).getRuleBook().getRule(u);if(vi(i)===!1)throw new fe(se.WRONG_RULE_TYPE_FOR_MIXIN,{rule:i});return i}get rules(){return v(this,Rt).getRuleBook().rules.filter(vi)}get activeRule(){const u=this.rules.at(0);return v(this,rn)??u}get sortDirection(){var u;return v(this,je)??((u=this.activeRule)==null?void 0:u.defaultSortDirection)??"asc"}get userHasSetSortDirection(){return v(this,je)!==void 0}setSortDirection(u){if(v(this,Rt).isDisabled()||!this.activeRule)return;const i=v(this,je);q(this,je,u),v(this,Rt).touch({source:me.SORT_BY,event:ue.SET_SORT_BY_DIRECTION,current:{sortDirection:u},initial:{sortDirection:i},rule:this.activeRule})}cycleSortDirection(){const u=Ri.findIndex(i=>i===v(this,je));if(u!==-1){const i=u+1%(Ri.length-1);this.setSortDirection(Ri[i])}}toggleSortDirection(){var i;if((v(this,je)??((i=this.activeRule)==null?void 0:i.defaultSortDirection))==="desc"){this.setSortDirection("asc");return}this.setSortDirection("desc")}set(u,i){if(v(this,Rt).isDisabled()||!this.activeRule)return;const l=v(this,je),_=v(this,rn),T=u?this.getRule(u):void 0;q(this,rn,T),q(this,je,i),v(this,Rt).touch({source:me.SORT_BY,event:ue.SET_SORT_BY,current:{rule:T==null?void 0:T.id,sortDirection:i},initial:{rule:_==null?void 0:_.id,sortDirection:l},rule:this.activeRule})}reset(){this.set(void 0,void 0)}serialize(){return{rule:this.activeRule,sortDirection:this.sortDirection}}static process(u,i,l){return u.rule===void 0?i:Ge.orderBy(i,_=>{var T;return typeof((T=u.rule)==null?void 0:T.sortFn)=="function"?u.rule.sortFn(_,l):Number.NEGATIVE_INFINITY},u.sortDirection)}}rn=new WeakMap,je=new WeakMap,Rt=new WeakMap;class ls{constructor({initialGroupBy:u,requireGroup:i},l){j(this,qt);j(this,Yt);j(this,Ot);q(this,Ot,l),u&&q(this,qt,this.getRule(u)),this.requireGroup=i}getRule(u){const i=v(this,Ot).getRuleBook().getRule(u);if(Ti(i)===!1)throw new fe(se.WRONG_RULE_TYPE_FOR_MIXIN,{rule:i});return i}get rules(){return v(this,Ot).getRuleBook().rules.filter(Ti)}get activeRule(){const u=this.requireGroup?this.rules.at(0):void 0;return v(this,qt)??u}get hasGroupByRule(){return this.activeRule!==void 0}get groupSortDirection(){var u;return v(this,Yt)??((u=this.activeRule)==null?void 0:u.defaultGroupSortDirection)}set(u){if(v(this,Ot).isDisabled())return;const i=v(this,qt);let l;const _=typeof u=="string"&&u.trim()==="";_&&(l=void 0),_===!1&&u!==void 0&&(l=this.getRule(u)),v(this,qt)!==l&&(q(this,qt,l),q(this,Yt,void 0),v(this,Ot).touch({source:me.GROUP_BY,event:ue.SET_GROUP_BY,current:l==null?void 0:l.id,initial:i==null?void 0:i.id,rule:l}))}setGroupSortDirection(u){const i=v(this,Yt);q(this,Yt,u),v(this,Ot).touch({source:me.GROUP_BY,event:ue.SET_GROUP_SORT_BY_DIRECTION,current:u,initial:i,rule:this.activeRule})}toggle(u){const i=this.getRule(u);if(this.activeRule===i){this.set(void 0);return}this.set(i)}reset(){this.setGroupSortDirection(void 0),this.set(void 0)}serialize(){return{rule:this.activeRule,sortDirection:v(this,Yt)}}static process(u,i,l){var k,K;const _=Ge.groupBy(i,G=>{var ae;return(ae=u.rule)==null?void 0:ae.groupFn(G,l)}),T=Object.entries(_).map(([G,ae])=>({id:G,items:ae})),A=((k=u.rule)==null?void 0:k.sticky)!==void 0,O=[],U=[];if(A&&u.rule&&(O.push(Ta(u.rule)),U.push("asc")),(K=u.rule)!=null&&K.sortGroupFn&&(O.push(u.rule.sortGroupFn),U.push(u.sortDirection??"asc")),O.length>0){const G=U;return Ge.orderBy(T,O,G)}return T}}qt=new WeakMap,Yt=new WeakMap,Ot=new WeakMap;function Ta(h){var l,_;let u=[];((l=h.sticky)==null?void 0:l.header)!==void 0&&(Array.isArray(h.sticky.header)&&(u=h.sticky.header),typeof h.sticky.header=="string"&&(u=[h.sticky.header]));let i=[];return((_=h.sticky)==null?void 0:_.footer)!==void 0&&(Array.isArray(h.sticky.footer)&&(i=h.sticky.footer),typeof h.sticky.footer=="string"&&(i=[h.sticky.footer])),T=>{if(u.includes(T.id)){const A=u.findIndex(U=>T.id===U);return(u.length-A)*-1}return i.includes(T.id)?1+i.findIndex(O=>T.id===O):0}}class cs{constructor({page:u,numItemsPerPage:i},l){j(this,et);j(this,kt);q(this,et,u??1),this.numItemsPerPage=i,q(this,kt,l)}setPage(u){if(u!==v(this,et)){const i=v(this,et);q(this,et,u),v(this,kt).touch({source:me.PAGINATION,event:ue.SET_PAGE,current:{page:v(this,et)},initial:{page:i}})}}setNumItemsPerPage(u){if(u!==this.numItemsPerPage){const i=this.numItemsPerPage;this.numItemsPerPage=u,v(this,kt).touch({source:me.PAGINATION,event:ue.SET_NUM_ITEMS_PER_PAGE,current:{numItemsPerPage:this.numItemsPerPage},initial:{numItemsPerPage:i}})}}get lastPage(){if(this.numItemsPerPage!==void 0)return Math.ceil(v(this,kt).getItems().length/this.numItemsPerPage)}get numTotalItems(){return v(this,kt).getItems().length}get page(){return this.numItemsPerPage&&this.lastPage?Ge.clamp(v(this,et),1,this.lastPage):v(this,et)}get offset(){return this.numItemsPerPage&&this.lastPage?(Ge.clamp(v(this,et),1,this.lastPage)-1)*this.numItemsPerPage:0}serialize(){return{page:v(this,et),numItemsPerPage:this.numItemsPerPage}}static process(u,i){if(u.numItemsPerPage===void 0)return i;const l=Math.ceil(i.length/u.numItemsPerPage),T=(Ge.clamp(u.page,1,l)-1)*u.numItemsPerPage;return i.slice(T,T+u.numItemsPerPage)}}et=new WeakMap,kt=new WeakMap;function Ra(){const h=new Map;return(u,i)=>{var l;return u.debounceMilliseconds===void 0?i():(h.has(u)===!1&&h.set(u,Ge.debounce(_=>_(),u.debounceMilliseconds)),(l=h.get(u))==null?void 0:l(i))}}class Ea{constructor(u,i,l){j(this,Yn);j(this,kn);this.searchEffects=[],this.ruleEffects=[],q(this,Yn,u.filter(ha)),q(this,kn,u.filter(ga)),this.hydrateDefinitions(i,l)}hydrateDefinitions(u,i){this.ruleEffects=v(this,Yn).map(l=>{const _=typeof l.rules=="function"?l.rules(u,i):l.rules,T=Array.isArray(_)?_:[_];return{...l,rules:T,_isHydrated:!0}}),this.searchEffects=v(this,kn).map(l=>{const _=typeof l.haystack=="function"?l.haystack(u,i):l.haystack,T=Array.isArray(_)?_:[_];return{...l,haystack:T,_isHydrated:!0}})}processRule(u,i){this.ruleEffects.forEach(l=>{l.rules.some(T=>typeof T=="string"&&u.id===T||typeof T=="object"&&u.id===T.id)&&l.onChange(i,u)})}processSearchTerm(u,i){this.searchEffects.forEach(l=>{la(l.haystack,u)&&l.onChange(i,u)})}}Yn=new WeakMap,kn=new WeakMap;class Ia{constructor(){j(this,Et,new Map);j(this,un,!1)}on(u,i){v(this,Et).has(u)===!1&&v(this,Et).set(u,new Set);const l=v(this,Et).get(u);l==null||l.add(i)}off(u,i){if(v(this,Et).has(u)===!1)return;if(i===void 0){v(this,Et).delete(u);return}const l=v(this,Et).get(u);l==null||l.delete(i)}emit(u,i){if(v(this,un))return;const l=v(this,Et).get(u);l==null||l.forEach(_=>{_(i)})}silently(u){q(this,un,!0),u(),q(this,un,!1)}isSilent(){return v(this,un)}}Et=new WeakMap,un=new WeakMap;const Er=class Er{constructor(u,i,l){j(this,sn);this.rules=[],Er.validateDefinitions(u),q(this,sn,u),this.hydrateDefinitions(i,l)}hydrateDefinitions(u,i){this.rules=v(this,sn).map(l=>us(l)?{...l,options:typeof l.options=="function"?l.options({items:u,context:i}):l.options,multiple:!!l.multiple,required:!!l.required,boolean:!!l.boolean,hidden:!!l.hidden,_isHydrated:!0}:l)}getRule(u){const i=this.rules.find(l=>typeof u=="object"?l.id===u.id:l.id===u);if(i===void 0)throw new fe(se.RULE_NOT_FOUND,u);return i}getDefinitions(){return v(this,sn)}setRules(u){Er.validateDefinitions(u),q(this,sn,u)}static validateDefinitions(u){if(u.length===0)return!1;const i=[Rr,us,vi,Ti],l=new Set;return u.forEach(_=>{if(_.id===void 0&&!Rr(_))throw new fe(se.INVALID_RULE_WITHOUT_ID,_);if(i.some(T=>T(_))===!1)throw new fe(se.INVALID_RULE_SHAPE,_);if(_.id){if(l.has(_.id))throw new fe(se.INVALID_RULE_DUPLICATE,_);l.add(_.id)}}),!0}};sn=new WeakMap;let Ei=Er;class Hn{constructor(){this.snapshot={},this.isStale=!0}setIsStale(u){this.isStale=u}takeSnapshot({items:u,context:i,mixins:l}){const _=Hn.test({mixins:l,items:u,context:i}),T=l.pagination?cs.process(l.pagination,_):_;let A=[];const O=l.groupBy!==void 0;l.groupBy&&(A=ls.process(l.groupBy,T,i)),this.snapshot={items:O?void 0:T,groups:O?A:void 0,numMatchedItems:_.length,numTotalItems:u.length,hasGroupByRule:O}}static test({mixins:u,items:i,context:l}){let _=[...i];return u.search&&(_=fs.process(u.search,_,l)),u.filters&&(_=os.process(u.filters,_,l)),u.sortBy&&(_=as.process(u.sortBy,_,l)),_}}class ma{constructor(u,{rules:i,effects:l,initialSearchTerm:_,initialSortBy:T,initialSortDirection:A,initialGroupBy:O,initialFilters:U,context:k,page:K,numItemsPerPage:G,isLoading:ae,disabled:Ae,requireGroup:Te,ignoreSortByRulesWhileSearchRuleIsActive:Ne,onInit:Re,onReady:Ce,onFirstUserInteraction:mt,onChange:Le},ht){j(this,We);j(this,Lt);j(this,Rn);j(this,zn);j(this,ve);j(this,It);j(this,ct);j(this,zt);this.isReady=!1,q(this,Rn,!1),q(this,Lt,u),this.disabled=!!Ae,this.isLoading=!!ae,q(this,ve,new Ia),this.getInstanceFn=ht,q(this,ct,new Ei(i,u??[],k)),q(this,zt,new Ea(l??[],u??[],k));const De=Ra(),ee={getItems:()=>this.items,getRuleBook:()=>v(this,ct),isLoading:()=>this.isLoading,isDisabled:()=>this.disabled,test:(de,tt)=>this.test(de,tt),touch:de=>Ht(this,We,$o).call(this,de),debouncer:De};this.search=new fs({initialSearchTerm:_},ee),this.filters=new os({initialFilters:U},ee),this.sortBy=new as({initialSortBy:T,initialSortDirection:A},ee),this.groupBy=new ls({initialGroupBy:O,requireGroup:!!Te},ee),this.pagination=new cs({page:K,numItemsPerPage:G},ee),this.updatedAt=Date.now(),q(this,It,new Hn),this.context=k,q(this,zn,Ne),v(this,ve).silently(()=>{const de={source:me.CORE,event:ue.INIT,timestamp:Date.now(),instance:this.getInstanceFn()};Re&&Re(de)}),Le&&v(this,ve).on(ue.CHANGE,Le),mt&&v(this,ve).on(ue.FIRST_USER_INTERACTION,mt),this.isReady=!ae&&Array.isArray(u)&&u.length>0,Ce&&this.isReady&&Ce({source:me.CORE,event:ue.READY,timestamp:Date.now(),instance:this.getInstanceFn()}),this.isReady===!1&&Ce&&v(this,ve).on(ue.READY,Ce)}emitFirstUserInteraction(){if(v(this,Rn)===!1){q(this,Rn,!0);const u={source:me.CORE,event:ue.FIRST_USER_INTERACTION,timestamp:Date.now(),instance:this.getInstanceFn()};v(this,ve).emit(ue.FIRST_USER_INTERACTION,u)}}get items(){return Array.isArray(v(this,Lt))?v(this,Lt):[]}get matches(){return v(this,It).isStale&&(v(this,It).takeSnapshot({items:this.items,context:this.context,mixins:Ht(this,We,Ku).call(this)}),v(this,It).setIsStale(!1)),v(this,It).snapshot}test(u,i=!1){if(i){const l={...Ht(this,We,Ku).call(this),...u};return Hn.test({mixins:l,items:this.items,context:this.context})}return Hn.test({mixins:u,items:this.items,context:this.context})}get isEmpty(){return this.isLoading===!1&&this.items.length===0}get hasMatches(){const u=Array.isArray(this.matches.items)&&this.matches.items.length>0,i=Array.isArray(this.matches.groups)&&this.matches.groups.length>0;return u||i}get events(){return{on:(u,i)=>v(this,ve).on(u,i),off:(u,i)=>v(this,ve).off(u,i),silently:u=>v(this,ve).silently(u),isSilent:()=>v(this,ve).isSilent()}}getRule(u){return v(this,ct).getRule(u)}get state(){if(this.isLoading)return"loading";if(this.isEmpty)return"empty";const u=this.groupBy.activeRule!==void 0;return u&&Array.isArray(this.matches.groups)&&this.matches.groups.length>0?"groups":u===!1&&Array.isArray(this.matches.items)&&this.matches.items.length>0?"items":"noMatches"}setItems(u){if(Ge.isEqual(u,v(this,Lt))===!1){const i=v(this,Lt);q(this,Lt,u),v(this,ct).hydrateDefinitions(this.items,this.context),v(this,zt).hydrateDefinitions(this.items,this.context),Ht(this,We,_r).call(this,{source:me.CORE,event:ue.SET_ITEMS,current:u,initial:i})}}setIsLoading(u){if(!!u!==this.isLoading){const i=this.isLoading;this.isLoading=!!u,Ht(this,We,_r).call(this,{source:me.CORE,event:ue.SET_IS_LOADING,current:!!u,initial:i}),this.isLoading===!1&&Ht(this,We,Ko).call(this)}}setIsDisabled(u){if(!!u!==this.disabled){const i=this.disabled;this.disabled=!!u,Ht(this,We,_r).call(this,{source:me.CORE,event:ue.SET_IS_DISABLED,current:!!u,initial:i})}}setRules(u){Ge.isEqual(u,v(this,ct).getDefinitions())===!1&&(v(this,ct).setRules(u),v(this,ct).hydrateDefinitions(this.items,this.context))}setContext(u){const i=this.context;Ge.isEqual(u,i)===!1&&(this.context=u,v(this,ct).hydrateDefinitions(this.items,this.context),v(this,zt).hydrateDefinitions(this.items,this.context),Ht(this,We,_r).call(this,{source:me.CORE,event:ue.SET_CONTEXT,current:u,initial:i}))}}Lt=new WeakMap,Rn=new WeakMap,zn=new WeakMap,ve=new WeakMap,It=new WeakMap,ct=new WeakMap,zt=new WeakMap,We=new WeakSet,$o=function(u){if(v(this,ve).isSilent())return;this.emitFirstUserInteraction(),this.updatedAt=Date.now(),v(this,It).setIsStale(!0);const i={...u,timestamp:Date.now(),instance:this.getInstanceFn()};v(this,ve).emit(ue.CHANGE,i),v(this,ve).silently(()=>{u.rule&&v(this,zt).processRule(u.rule,this.getInstanceFn()),this.search.hasSearchTerm&&v(this,zt).processSearchTerm(this.search.searchTerm,this.getInstanceFn())})},_r=function(u){v(this,It).setIsStale(!0),this.updatedAt=Date.now();const i={...u,timestamp:Date.now(),instance:this.getInstanceFn()};v(this,ve).emit(u.event,i)},Ko=function(){this.isReady===!1&&(this.isReady=!0,v(this,ve).emit(ue.READY,{source:me.CORE,event:ue.READY,timestamp:Date.now()}))},Ku=function(){const u=this.search.hasSearchRule&&this.search.hasSearchTerm,i=u&&v(this,zn),l={};return u&&(l.search=this.search.serialize()),this.filters.activeRules.length>0&&(l.filters=this.filters.serialize()),this.pagination.numItemsPerPage&&(l.pagination=this.pagination.serialize()),i===!1&&(l.sortBy=this.sortBy.serialize()),this.groupBy.activeRule!==void 0&&(l.groupBy=this.groupBy.serialize()),l};class Sa{constructor(u,i){j(this,V);const l=()=>this;q(this,V,new ma(u,i,l))}get items(){return v(this,V).items}get context(){return v(this,V).context}get isReady(){return v(this,V).isReady}get isEmpty(){return v(this,V).isEmpty}get hasMatches(){return v(this,V).hasMatches}get isLoading(){return v(this,V).isLoading}get disabled(){return v(this,V).disabled}get state(){return v(this,V).state}get updatedAt(){return v(this,V).updatedAt}get events(){return v(this,V).events}get matches(){return v(this,V).matches}get search(){const u=v(this,V).search;return{searchTerm:u.searchTerm,hasSearchTerm:u.hasSearchTerm,hasSearchRule:u.hasSearchRule,setSearchTerm:u.setSearchTerm.bind(u),reset:u.reset.bind(u),test:u.test.bind(u)}}get filters(){const u=v(this,V).filters;return{values:u.values,raw:u.raw,activeRules:u.activeRules,rules:u.rules,isActive:u.isRuleActive.bind(u),get:u.get.bind(u),add:u.add.bind(u),has:u.has.bind(u),getRule:u.getRule.bind(u),toggle:u.toggle.bind(u),set:u.set.bind(u),delete:u.delete.bind(u),test:u.test.bind(u),testRule:u.testRule.bind(u),testRuleOptions:u.testRuleOptions.bind(u)}}get sortBy(){const u=v(this,V).sortBy;return{activeRule:u.activeRule,sortDirection:u.sortDirection,userHasSetSortDirection:u.userHasSetSortDirection,rules:u.rules,set:u.set.bind(u),setSortDirection:u.setSortDirection.bind(u),cycleSortDirection:u.cycleSortDirection.bind(u),toggleSortDirection:u.toggleSortDirection.bind(u),reset:u.reset.bind(u)}}get groupBy(){const u=v(this,V).groupBy;return{activeRule:u.activeRule,requireGroup:u.requireGroup,rules:u.rules,groupIdSortDirection:u.groupSortDirection,set:u.set.bind(u),toggle:u.toggle.bind(u),setGroupSortDirection:u.setGroupSortDirection.bind(u),reset:u.reset.bind(u)}}get pagination(){const u=v(this,V).pagination;return{page:u.page,offset:u.offset,numItemsPerPage:u.numItemsPerPage,numTotalItems:u.numTotalItems,lastPage:u.lastPage,isPaginated:u.numItemsPerPage!==void 0,setPage:u.setPage.bind(u),setNumItemsPerPage:u.setNumItemsPerPage.bind(u)}}setItems(u){return v(this,V).setItems(u)}setIsLoading(u){return v(this,V).setIsLoading(u)}setIsDisabled(u){return v(this,V).setIsDisabled(u)}setRules(u){return v(this,V).setRules(u)}setContext(u){return v(this,V).setContext(u)}test(u,i=!1){return v(this,V).test(u,i)}getRule(u){return v(this,V).getRule(u)}}V=new WeakMap;function Ii({items:h,rules:u,effects:i,initialSearchTerm:l,initialSortBy:_,initialSortDirection:T,initialGroupBy:A,initialFilters:O,context:U,isLoading:k,disabled:K,page:G,numItemsPerPage:ae,requireGroup:Ae,ignoreSortByRulesWhileSearchRuleIsActive:Te,onInit:Ne,onReady:Re,onFirstUserInteraction:Ce,onChange:mt,controllerRef:Le,children:ht}){const[,De]=J.useState(void 0),[ee]=J.useState(()=>{const de=tt=>{ee.events.on("change",fn=>De(fn.instance.updatedAt)),mt&&mt(tt)};return new Sa(h,{rules:u,effects:i,initialSearchTerm:l,initialSortBy:_,initialSortDirection:T,initialGroupBy:A,initialFilters:O,context:U,isLoading:k,disabled:K,page:G,numItemsPerPage:ae,requireGroup:Ae,ignoreSortByRulesWhileSearchRuleIsActive:Te,onInit:Ne,onReady:Re,onFirstUserInteraction:Ce,onChange:de})});return ee.setItems(h),ee.setIsLoading(k),ee.setIsDisabled(K),ee.setRules(u),U!==void 0&&ee.setContext(U),G!==void 0&&ee.pagination.setPage(G),ae!==void 0&&ee.pagination.setNumItemsPerPage(ae),J.useImperativeHandle(Le,()=>ee,[ee]),Oe.jsx(Xu,{value:[ee,ee.updatedAt],children:ht})}Ii.Content=Tn,Ii.SearchTermHaystack=ca;function Aa(){return J.useRef(null)}Y.Finder=Ii,Y.StringMatch=is,Y.filterRule=Xo,Y.finderRuleset=Be,Y.groupByRule=Jo,Y.ruleEffect=Vo,Y.searchEffect=Qo,Y.searchRule=pr,Y.sortByRule=Zo,Y.useFinder=nn,Y.useFinderRef=Aa,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})});
48
+ }`;var M=qo(function(){return $(o,x+"return "+m).apply(i,a)});if(M.source=m,Fu(M))throw M;return M}function _p(e){return X(e).toLowerCase()}function pp(e){return X(e).toUpperCase()}function vp(e,t,n){if(e=X(e),e&&(n||t===i))return Zs(e);if(!e||!(t=Xe(t)))return e;var r=_t(e),s=_t(t),o=Js(r,s),a=Vs(r,s)+1;return en(r,o,a).join("")}function Tp(e,t,n){if(e=X(e),e&&(n||t===i))return e.slice(0,js(e)+1);if(!e||!(t=Xe(t)))return e;var r=_t(e),s=Vs(r,_t(t))+1;return en(r,0,s).join("")}function Rp(e,t,n){if(e=X(e),e&&(n||t===i))return e.replace(Fi,"");if(!e||!(t=Xe(t)))return e;var r=_t(e),s=Js(r,_t(t));return en(r,s).join("")}function Ep(e,t){var n=Si,r=$n;if(oe(t)){var s="separator"in t?t.separator:s;n="length"in t?F(t.length):n,r="omission"in t?Xe(t.omission):r}e=X(e);var o=e.length;if(wn(e)){var a=_t(e);o=a.length}if(n>=o)return e;var c=n-yn(r);if(c<1)return r;var d=a?en(a,0,c).join(""):e.slice(0,c);if(s===i)return d+r;if(a&&(c+=d.length-c),Mu(s)){if(e.slice(c).search(s)){var E,I=d;for(s.global||(s=Qi(s.source,X(vs.exec(s))+"g")),s.lastIndex=0;E=s.exec(I);)var m=E.index;d=d.slice(0,m===i?c:m)}}else if(e.indexOf(Xe(s),c)!=c){var w=d.lastIndexOf(s);w>-1&&(d=d.slice(0,w))}return d+r}function Ip(e){return e=X(e),e&&Na.test(e)?e.replace(ds,Jl):e}var mp=Cn(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Gu=qf("toUpperCase");function Ho(e,t,n){return e=X(e),t=n?i:t,t===i?zl(e)?jl(e):Ml(e):e.match(t)||[]}var qo=B(function(e,t){try{return $e(e,i,t)}catch(n){return Fu(n)?n:new C(n)}}),Sp=Mt(function(e,t){return it(t,function(n){n=yt(n),Dt(e,n,Cu(e[n],e))}),e});function Ap(e){var t=e==null?0:e.length,n=L();return e=t?ie(e,function(r){if(typeof r[1]!="function")throw new ut(A);return[n(r[0]),r[1]]}):[],B(function(r){for(var s=-1;++s<t;){var o=e[s];if($e(o[0],this,r))return $e(o[1],this,r)}})}function wp(e){return Jc(ft(e,G))}function Wu(e){return function(){return e}}function yp(e,t){return e==null||e!==e?t:e}var xp=kf(),Op=kf(!0);function ke(e){return e}function Hu(e){return Ef(typeof e=="function"?e:ft(e,G))}function Lp(e){return mf(ft(e,G))}function Pp(e,t){return Sf(e,ft(t,G))}var bp=B(function(e,t){return function(n){return or(n,e,t)}}),Np=B(function(e,t){return function(n){return or(e,n,t)}});function qu(e,t,n){var r=Ie(t),s=Zr(t,r);n==null&&!(oe(t)&&(s.length||!r.length))&&(n=t,t=e,e=this,s=Zr(t,Ie(t)));var o=!(oe(n)&&"chain"in n)||!!n.chain,a=Bt(e);return it(s,function(c){var d=t[c];e[c]=d,a&&(e.prototype[c]=function(){var E=this.__chain__;if(o||E){var I=e(this.__wrapped__),m=I.__actions__=He(this.__actions__);return m.push({func:d,args:arguments,thisArg:e}),I.__chain__=E,I}return d.apply(e,Xt([this.value()],arguments))})}),e}function Cp(){return ye._===this&&(ye._=uc),this}function Yu(){}function Dp(e){return e=F(e),B(function(t){return Af(t,e)})}var Fp=Eu(ie),Mp=Eu(ks),Up=Eu(zi);function Yo(e){return xu(e)?$i(yt(e)):gh(e)}function Bp(e){return function(t){return e==null?i:dn(e,t)}}var Gp=$f(),Wp=$f(!0);function ku(){return[]}function zu(){return!1}function Hp(){return{}}function qp(){return""}function Yp(){return!0}function kp(e,t){if(e=F(e),e<1||e>Pt)return[];var n=N,r=Pe(e,N);t=L(t),e-=N;for(var s=Zi(r,t);++n<e;)t(n);return s}function zp(e){return D(e)?ie(e,yt):Ze(e)?[e]:He(oo(X(e)))}function $p(e){var t=++rc;return X(e)+t}var Kp=ti(function(e,t){return e+t},0),Xp=Iu("ceil"),Zp=ti(function(e,t){return e/t},1),Jp=Iu("floor");function Vp(e){return e&&e.length?Xr(e,ke,su):i}function Qp(e,t){return e&&e.length?Xr(e,L(t,2),su):i}function jp(e){return Ks(e,ke)}function ev(e,t){return Ks(e,L(t,2))}function tv(e){return e&&e.length?Xr(e,ke,lu):i}function nv(e,t){return e&&e.length?Xr(e,L(t,2),lu):i}var rv=ti(function(e,t){return e*t},1),iv=Iu("round"),uv=ti(function(e,t){return e-t},0);function sv(e){return e&&e.length?Xi(e,ke):0}function fv(e,t){return e&&e.length?Xi(e,L(t,2)):0}return f.after=Ld,f.ary=Eo,f.assign=p_,f.assignIn=Do,f.assignInWith=di,f.assignWith=v_,f.at=T_,f.before=Io,f.bind=Cu,f.bindAll=Sp,f.bindKey=mo,f.castArray=Hd,f.chain=vo,f.chunk=Jh,f.compact=Vh,f.concat=Qh,f.cond=Ap,f.conforms=wp,f.constant=Wu,f.countBy=sd,f.create=R_,f.curry=So,f.curryRight=Ao,f.debounce=wo,f.defaults=E_,f.defaultsDeep=I_,f.defer=Pd,f.delay=bd,f.difference=jh,f.differenceBy=eg,f.differenceWith=tg,f.drop=ng,f.dropRight=rg,f.dropRightWhile=ig,f.dropWhile=ug,f.fill=sg,f.filter=od,f.flatMap=cd,f.flatMapDeep=hd,f.flatMapDepth=gd,f.flatten=ho,f.flattenDeep=fg,f.flattenDepth=og,f.flip=Nd,f.flow=xp,f.flowRight=Op,f.fromPairs=ag,f.functions=O_,f.functionsIn=L_,f.groupBy=dd,f.initial=cg,f.intersection=hg,f.intersectionBy=gg,f.intersectionWith=dg,f.invert=b_,f.invertBy=N_,f.invokeMap=pd,f.iteratee=Hu,f.keyBy=vd,f.keys=Ie,f.keysIn=Ye,f.map=oi,f.mapKeys=D_,f.mapValues=F_,f.matches=Lp,f.matchesProperty=Pp,f.memoize=li,f.merge=M_,f.mergeWith=Fo,f.method=bp,f.methodOf=Np,f.mixin=qu,f.negate=ci,f.nthArg=Dp,f.omit=U_,f.omitBy=B_,f.once=Cd,f.orderBy=Td,f.over=Fp,f.overArgs=Dd,f.overEvery=Mp,f.overSome=Up,f.partial=Du,f.partialRight=yo,f.partition=Rd,f.pick=G_,f.pickBy=Mo,f.property=Yo,f.propertyOf=Bp,f.pull=Tg,f.pullAll=_o,f.pullAllBy=Rg,f.pullAllWith=Eg,f.pullAt=Ig,f.range=Gp,f.rangeRight=Wp,f.rearg=Fd,f.reject=md,f.remove=mg,f.rest=Md,f.reverse=bu,f.sampleSize=Ad,f.set=H_,f.setWith=q_,f.shuffle=wd,f.slice=Sg,f.sortBy=Od,f.sortedUniq=Pg,f.sortedUniqBy=bg,f.split=cp,f.spread=Ud,f.tail=Ng,f.take=Cg,f.takeRight=Dg,f.takeRightWhile=Fg,f.takeWhile=Mg,f.tap=Vg,f.throttle=Bd,f.thru=fi,f.toArray=bo,f.toPairs=Uo,f.toPairsIn=Bo,f.toPath=zp,f.toPlainObject=Co,f.transform=Y_,f.unary=Gd,f.union=Ug,f.unionBy=Bg,f.unionWith=Gg,f.uniq=Wg,f.uniqBy=Hg,f.uniqWith=qg,f.unset=k_,f.unzip=Nu,f.unzipWith=po,f.update=z_,f.updateWith=$_,f.values=Mn,f.valuesIn=K_,f.without=Yg,f.words=Ho,f.wrap=Wd,f.xor=kg,f.xorBy=zg,f.xorWith=$g,f.zip=Kg,f.zipObject=Xg,f.zipObjectDeep=Zg,f.zipWith=Jg,f.entries=Uo,f.entriesIn=Bo,f.extend=Do,f.extendWith=di,qu(f,f),f.add=Kp,f.attempt=qo,f.camelCase=V_,f.capitalize=Go,f.ceil=Xp,f.clamp=X_,f.clone=qd,f.cloneDeep=kd,f.cloneDeepWith=zd,f.cloneWith=Yd,f.conformsTo=$d,f.deburr=Wo,f.defaultTo=yp,f.divide=Zp,f.endsWith=Q_,f.eq=vt,f.escape=j_,f.escapeRegExp=ep,f.every=fd,f.find=ad,f.findIndex=lo,f.findKey=m_,f.findLast=ld,f.findLastIndex=co,f.findLastKey=S_,f.floor=Jp,f.forEach=To,f.forEachRight=Ro,f.forIn=A_,f.forInRight=w_,f.forOwn=y_,f.forOwnRight=x_,f.get=Uu,f.gt=Kd,f.gte=Xd,f.has=P_,f.hasIn=Bu,f.head=go,f.identity=ke,f.includes=_d,f.indexOf=lg,f.inRange=Z_,f.invoke=C_,f.isArguments=vn,f.isArray=D,f.isArrayBuffer=Zd,f.isArrayLike=qe,f.isArrayLikeObject=he,f.isBoolean=Jd,f.isBuffer=tn,f.isDate=Vd,f.isElement=Qd,f.isEmpty=jd,f.isEqual=e_,f.isEqualWith=t_,f.isError=Fu,f.isFinite=n_,f.isFunction=Bt,f.isInteger=xo,f.isLength=hi,f.isMap=Oo,f.isMatch=r_,f.isMatchWith=i_,f.isNaN=u_,f.isNative=s_,f.isNil=o_,f.isNull=f_,f.isNumber=Lo,f.isObject=oe,f.isObjectLike=ce,f.isPlainObject=dr,f.isRegExp=Mu,f.isSafeInteger=a_,f.isSet=Po,f.isString=gi,f.isSymbol=Ze,f.isTypedArray=Fn,f.isUndefined=l_,f.isWeakMap=c_,f.isWeakSet=h_,f.join=_g,f.kebabCase=tp,f.last=at,f.lastIndexOf=pg,f.lowerCase=np,f.lowerFirst=rp,f.lt=g_,f.lte=d_,f.max=Vp,f.maxBy=Qp,f.mean=jp,f.meanBy=ev,f.min=tv,f.minBy=nv,f.stubArray=ku,f.stubFalse=zu,f.stubObject=Hp,f.stubString=qp,f.stubTrue=Yp,f.multiply=rv,f.nth=vg,f.noConflict=Cp,f.noop=Yu,f.now=ai,f.pad=ip,f.padEnd=up,f.padStart=sp,f.parseInt=fp,f.random=J_,f.reduce=Ed,f.reduceRight=Id,f.repeat=op,f.replace=ap,f.result=W_,f.round=iv,f.runInContext=g,f.sample=Sd,f.size=yd,f.snakeCase=lp,f.some=xd,f.sortedIndex=Ag,f.sortedIndexBy=wg,f.sortedIndexOf=yg,f.sortedLastIndex=xg,f.sortedLastIndexBy=Og,f.sortedLastIndexOf=Lg,f.startCase=hp,f.startsWith=gp,f.subtract=uv,f.sum=sv,f.sumBy=fv,f.template=dp,f.times=kp,f.toFinite=Gt,f.toInteger=F,f.toLength=No,f.toLower=_p,f.toNumber=lt,f.toSafeInteger=__,f.toString=X,f.toUpper=pp,f.trim=vp,f.trimEnd=Tp,f.trimStart=Rp,f.truncate=Ep,f.unescape=Ip,f.uniqueId=$p,f.upperCase=mp,f.upperFirst=Gu,f.each=To,f.eachRight=Ro,f.first=go,qu(f,function(){var e={};return At(f,function(t,n){Z.call(f.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),f.VERSION=l,it(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){f[e].placeholder=f}),it(["drop","take"],function(e,t){H.prototype[e]=function(n){n=n===i?1:pe(F(n),0);var r=this.__filtered__&&!t?new H(this):this.clone();return r.__filtered__?r.__takeCount__=Pe(n,r.__takeCount__):r.__views__.push({size:Pe(n,N),type:e+(r.__dir__<0?"Right":"")}),r},H.prototype[e+"Right"]=function(n){return this.reverse()[e](n).reverse()}}),it(["filter","map","takeWhile"],function(e,t){var n=t+1,r=n==En||n==Sr;H.prototype[e]=function(s){var o=this.clone();return o.__iteratees__.push({iteratee:L(s,3),type:n}),o.__filtered__=o.__filtered__||r,o}}),it(["head","last"],function(e,t){var n="take"+(t?"Right":"");H.prototype[e]=function(){return this[n](1).value()[0]}}),it(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");H.prototype[e]=function(){return this.__filtered__?new H(this):this[n](1)}}),H.prototype.compact=function(){return this.filter(ke)},H.prototype.find=function(e){return this.filter(e).head()},H.prototype.findLast=function(e){return this.reverse().find(e)},H.prototype.invokeMap=B(function(e,t){return typeof e=="function"?new H(this):this.map(function(n){return or(n,e,t)})}),H.prototype.reject=function(e){return this.filter(ci(L(e)))},H.prototype.slice=function(e,t){e=F(e);var n=this;return n.__filtered__&&(e>0||t<0)?new H(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(t=F(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)},H.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},H.prototype.toArray=function(){return this.take(N)},At(H.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),s=f[r?"take"+(t=="last"?"Right":""):t],o=r||/^find/.test(t);s&&(f.prototype[t]=function(){var a=this.__wrapped__,c=r?[1]:arguments,d=a instanceof H,E=c[0],I=d||D(a),m=function(W){var z=s.apply(f,Xt([W],c));return r&&w?z[0]:z};I&&n&&typeof E=="function"&&E.length!=1&&(d=I=!1);var w=this.__chain__,x=!!this.__actions__.length,P=o&&!w,M=d&&!x;if(!o&&I){a=M?a:new H(this);var b=e.apply(a,c);return b.__actions__.push({func:fi,args:[m],thisArg:i}),new st(b,w)}return P&&M?e.apply(this,c):(b=this.thru(m),P?r?b.value()[0]:b.value():b)})}),it(["pop","push","shift","sort","splice","unshift"],function(e){var t=Cr[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);f.prototype[e]=function(){var s=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(D(o)?o:[],s)}return this[n](function(a){return t.apply(D(a)?a:[],s)})}}),At(H.prototype,function(e,t){var n=f[t];if(n){var r=n.name+"";Z.call(Pn,r)||(Pn[r]=[]),Pn[r].push({name:t,func:n})}}),Pn[ei(i,Ce).name]=[{name:"wrapper",func:i}],H.prototype.clone=Ic,H.prototype.reverse=mc,H.prototype.value=Sc,f.prototype.at=Qg,f.prototype.chain=jg,f.prototype.commit=ed,f.prototype.next=td,f.prototype.plant=rd,f.prototype.reverse=id,f.prototype.toJSON=f.prototype.valueOf=f.prototype.value=ud,f.prototype.first=f.prototype.head,tr&&(f.prototype[tr]=nd),f},xn=ec();an?((an.exports=xn)._=xn,Hi._=xn):ye._=xn}).call(na)}(Gn,Gn.exports)),Gn.exports}var Ge=ra();function Wn(h){return h.toLowerCase().replace(/[^\w\d]+/g,"")}function _i(h,u){const i=new RegExp(/"(.*?)"/g);let l=u,_=[],T,A=!1;for(;(T=i.exec(u))!==null&&A===!1;){const K=Wn(String(T[1])),G=ia(h,K);G===void 0?A=!0:(_=_.concat(G),l=l.replace(T[0],""))}if(A)return;const O=Wn(l),U=ua(h,O);return U===void 0?void 0:(_=_.concat(U),_.sort((K,G)=>K-G))}function ia(h,u){const i=h.indexOf(u);if(i!==-1)return Ge.range(i,i+u.length).map(l=>l)}function ua(h,u){const i=Array.from(u),l=[];let _=h,T=0,A=!1;for(const O of i){const U=_.indexOf(O);if(U===-1&&(A=!0),A===!1){l.push(T+U);const k=U+1;T+=k,_=_.substring(k)}}if(!A)return l}const mi=class mi{constructor(u){j(this,qn);this.source=u;const i=mi.composeTransformedHaystackSegments(u);q(this,qn,i),this.transformed=i.map(l=>l.value).join("").toLowerCase()}getSourceCharacterIndex(u){let i=0;return v(this,qn).reduce((l,_)=>{if(l!==1/0)return l;const T=i+_.value.length;if(u>=i&&u<=T){const A=u-i;l=_.index+A}return i+=_.value.length,l},1/0)}static composeTransformedHaystackSegments(u){const i=u.matchAll(/[\w\d]+/g),l=[];for(const _ of i)l.push({value:_[0],index:_.index,length:_[0].length});return l}};qn=new WeakMap;let pi=mi;function sa(h,u){return(Array.isArray(h)?h:[h]).map(_=>new pi(_)).reduce((_,T)=>{if(_!==void 0)return _;const A=_i(T.transformed,u);if(A===void 0)return _;const O=fa(A,T.transformed),U=oa(T,O);return aa(U)},void 0)}function fa(h,u){const i=[...h],l=[];let _=0;for(;i.length>0&&_<100;){const T=i.at(0);if(T===void 0)throw new Error("Should never get here");let A=1;for(let K=1;K<=i.length;K+=1){const G=i.at(K);G!==void 0&&T+K===G&&(A+=1)}const O=T,U=T+A,k=u.substring(O,U);l.push({index:O,value:k,is_match:!0,length:k.length}),i.splice(0,A),_+=1}return l}function oa(h,u){return u.reduce((i,l,_)=>{if(_===0&&l.index!==0){const k=h.source.substring(0,h.getSourceCharacterIndex(l.index));i.push({index:0,value:k,is_match:!1,length:k.length})}const T=h.getSourceCharacterIndex(l.index),A=h.getSourceCharacterIndex(l.index+l.length),O=h.source.substring(T,A);i.push({index:T,value:O,is_match:!0,length:O.length});const U=u.at(_+1);if(U){const k=h.getSourceCharacterIndex(l.index+l.length),K=h.getSourceCharacterIndex(U.index),G=h.source.substring(k,K);i.push({index:k,value:G,is_match:!1,length:G.length})}else if(T+O.length!==h.source.length){const k=T+O.length,K=h.source.substring(k);i.push({index:k,value:K,is_match:!1,length:K.length})}return i},[])}function aa(h){const u=/\S/,i=[...h];return i.forEach((l,_)=>{if(l.is_match){const T=l.value.search(u);if(T!==0){const A=i.at(_-1);A&&(A.length+=T,A.value+=l.value.substring(0,T),l.value=l.value.substring(T),l.index=l.index+T)}}}),i}function la(h,u){return(Array.isArray(h)?h:[h]).some(l=>{const _=Wn(l);return _i(_,u)!==void 0})}function is({needle:h,haystack:u,Match:i="span",Miss:l}){const _=J.useMemo(()=>sa(u,h),[u,h]);return _===void 0?u:_.map((T,A)=>{const O=[T.value,A].join();return T.is_match?typeof i=="string"?Oe.jsx(i,{"data-is-match":T.is_match,children:T.value},O):Oe.jsx(i,{"data-is-match":T.is_match,segment:T,segmentIndex:A},O):l!==void 0?typeof l=="string"?Oe.jsx(l,{"data-is-match":T.is_match,children:T.value},O):Oe.jsx(l,{"data-is-match":T.is_match,segment:T,segmentIndex:A},O):T.value})}function ca({Match:h="span",Miss:u,children:i}){const l=nn();return l.search.hasSearchTerm===!1?i:Oe.jsx(is,{needle:l.search.searchTerm,haystack:i,Match:h,Miss:u})}function vi(h){return typeof h=="object"&&h!==null&&"sortFn"in h}function Rr(h){return typeof h=="object"&&h!==null&&("searchFn"in h||"haystackFn"in h)}function us(h){return typeof h=="object"&&h!==null&&"filterFn"in h}function ss(h){return typeof h=="object"&&h!==null&&"filterFn"in h&&"_isHydrated"in h}function Ti(h){return typeof h=="object"&&h!==null&&"groupFn"in h}function ha(h){return typeof h=="object"&&h!==null&&("rules"in h||"callback"in h)}function ga(h){return typeof h=="object"&&h!==null&&("haystack"in h||"callback"in h)}const ue={INIT:"init",FIRST_USER_INTERACTION:"firstUserInteraction",READY:"ready",CHANGE:"change",SET_ITEMS:"setItems",SET_IS_LOADING:"setIsLoading",SET_IS_DISABLED:"setIsDisabled",SET_CONTEXT:"setContext",SET_SEARCH_TERM:"setSearchTerm",RESET_SEARCH_TERM:"resetSearchTerm",SET_FILTER:"setFilter",SET_SORT_BY:"setSortBy",SET_SORT_BY_DIRECTION:"setSortDirection",SET_GROUP_BY:"setGroupBy",SET_GROUP_SORT_BY_DIRECTION:"setGroupBySortDirection",SET_PAGE:"setPage",SET_NUM_ITEMS_PER_PAGE:"setNumItemsPerPage"},me={CORE:"core",SEARCH:"search",FILTERS:"filters",GROUP_BY:"groupBy",SORT_BY:"sortBy",PAGINATION:"pagination"},se={RULE_NOT_FOUND:"Finder could not locate requested rule",WRONG_RULE_TYPE_FOR_MIXIN:"The requested rule is not valid for this mixin.",NO_SEARCH_RULE_SET:"Unable to set search term; no SearchRule was found.",SETTING_MULTIPLE_FILTER_WITHOUT_ARRAY:"Finder could not set this filter value, as the rule requires an array.",ADDING_OPTION_TO_MULTIPLE_FILTER_WITHOUT_OPTION_VALUE:"Finder could not add to this filter, as no optionValue was passed.",DELETING_OPTION_VALUE_FROM_NON_MULTIPLE_FILTER:"Finder could not delete an option from this filter, as it does not support multiple values.",SETTING_BOOLEAN_FILTER_WITHOUT_BOOLEAN_VALUE:"Finder could not set this filter value, as the rule requires a boolean.",ADDING_OPTION_VALUE_TO_NON_MULTIPLE_FILTER:"Finder could not add to this filter value, as the rule is a boolean.",TOGGLING_OPTION_ON_RULE_WITH_NO_OPTIONS:"Finder could not toggle this filter rule option, as the filter does not have any options.",TOGGLING_OPTION_ON_RULE_WITH_SINGLE_VALUE:"Finder could not toggle this filter rule option, as the rule does not allow multiple values.",TOGGLING_OPTION_THAT_DOES_NOT_EXIST:"Finder could not toggle this filter rule option, as the option was not found.",TOGGLING_OPTION_WITHOUT_PASSING_OPTION:"Finder could not toggle this filter rule option, as the option was not found.",TESTING_OPTIONS_ON_RULE_WITH_NO_OPTIONS:"Finder was unable to test the options for this filter rule. It must be a boolean or have defined options.",INVALID_RULE_WITHOUT_ID:"Init failed: Missing rule id.",INVALID_RULE_SHAPE:"Init failed: Malformed rule definition",INVALID_RULE_DUPLICATE:"Init failed: Duplicate rule id."};class fe extends Error{constructor(u,i){const l=`${u} ${JSON.stringify({...i})}`;super(l),this.name="FinderError"}}function da(h,u){const i=h.length/u.length;let l=1,_=1,T=0;for(let A=0;A<h.length;A+=1)T!==void 0&&h.at(A)===T+1&&(_+=1,_>=l&&(l=_)),T=h.at(A);return{percentOfHaystackMatched:i,longestSequentialSequence:l}}class fs{constructor({initialSearchTerm:u},i){j(this,Qe);this.searchTerm=u??"",q(this,Qe,i)}get rule(){return v(this,Qe).getRuleBook().rules.find(Rr)}get hasSearchRule(){return v(this,Qe).getRuleBook().rules.some(Rr)}get hasSearchTerm(){return this.searchTerm!==""}setSearchTerm(u){const i=this.rule;if(!i)throw new fe(se.NO_SEARCH_RULE_SET);if(v(this,Qe).isDisabled())return;const l=this.searchTerm;this.searchTerm=u,l!==u&&v(this,Qe).debouncer(i,()=>{v(this,Qe).touch({source:me.SEARCH,event:ue.SET_SEARCH_TERM,current:u,initial:l,rule:i})})}reset(){if(v(this,Qe).isDisabled())return;const u=this.searchTerm;this.searchTerm="",v(this,Qe).touch({source:me.SEARCH,event:ue.RESET_SEARCH_TERM,current:"",initial:u,rule:this.rule})}serialize(){return{searchTerm:this.searchTerm,rule:this.rule}}test(u,i=!1){return v(this,Qe).test({search:{searchTerm:u,rule:this.rule}},i)}static process(u,i,l){if(u.rule===void 0||u.searchTerm==="")return i;const _=i.reduce((O,U)=>{var ae;if(((ae=u.rule)==null?void 0:ae.searchFn)===void 0)return O;const k=u.rule.searchFn(U,l),G=(Array.isArray(k)?k.map(Wn):[Wn(k)]).reduce((Ae,Te)=>{const Ne=_i(Te,u.searchTerm);return Ne!==void 0&&Ae.push(da(Ne,Te)),Ae},[]);if(G.length>0){const Te=Ge.orderBy(G,["percentOfHaystackMatched","longestSequentialSequence"],["desc","asc"]).at(0);Te&&O.push({item:U,score:Te})}return O},[]),T=_.reduce((O,U)=>(U.score.longestSequentialSequence>O&&(O=U.score.longestSequentialSequence),O),0);return Ge.orderBy(_,[O=>{const U=O.score.percentOfHaystackMatched*100,k=O.score.longestSequentialSequence/T*100;return U+k}],["desc"]).map(O=>O.item)}}Qe=new WeakMap;function _a(h){return{validate(u){if(u!==void 0&&typeof u!="boolean")throw new fe(se.SETTING_BOOLEAN_FILTER_WITHOUT_BOOLEAN_VALUE,{rule:h,value:u});return!0},parse(u){return u===void 0?h.required?!0:h.defaultValue!==void 0?h.defaultValue:!1:u},has(u){return this.parse(u)},toggle(u,i){const l=this.parse(u);if(typeof l!="boolean")throw new fe(se.SETTING_BOOLEAN_FILTER_WITHOUT_BOOLEAN_VALUE,{rule:h,value:l,optionValue:i});return!l},add(u,i){throw new fe(se.ADDING_OPTION_VALUE_TO_NON_MULTIPLE_FILTER,{rule:h,value:u,optionValue:i})},delete(u,i){if(i!==void 0)throw new fe(se.DELETING_OPTION_VALUE_FROM_NON_MULTIPLE_FILTER,{rule:h,value:u,optionValue:i})},isActive(u){return h.required?!0:this.parse(u)===!0}}}function pa(h){return{validate(u){if(u!==void 0&&Array.isArray(u)===!1)throw new fe(se.SETTING_MULTIPLE_FILTER_WITHOUT_ARRAY,{rule:h,value:u});return!0},parse(u){var i;if(u===void 0)return h.required&&Array.isArray(h.options)&&h.options.length>0?[(i=h.options.at(0))==null?void 0:i.value]:[];if(Array.isArray(u))return u;throw new fe(se.SETTING_MULTIPLE_FILTER_WITHOUT_ARRAY,{rule:h,value:u})},has(u,i){var _;if(i===void 0)return Array.isArray(u)&&u.length>0;if(Array.isArray(i))return i.every(T=>this.has(h,T));const l=(_=h.options)==null?void 0:_.find(T=>typeof i=="object"&&"value"in i?T.value===i.value:T.value===i);return Array.isArray(u)&&l!==void 0&&u.includes(l.value)},toggle(u,i){const l=this.parse(u);if(Array.isArray(l)===!1)throw new fe(se.SETTING_MULTIPLE_FILTER_WITHOUT_ARRAY,{rule:h,value:l});if(i===void 0)throw new fe(se.TOGGLING_OPTION_WITHOUT_PASSING_OPTION,{rule:h});if(h.options===void 0)throw new fe(se.TOGGLING_OPTION_ON_RULE_WITH_NO_OPTIONS,{rule:h,optionValue:i});const _=h.options.find(T=>typeof i=="object"&&"value"in i?T.value===i.value:T.value===i);if(_===void 0)throw new fe(se.TOGGLING_OPTION_THAT_DOES_NOT_EXIST,{rule:h,optionValue:i});return l.includes(_.value)?[...l.filter(T=>T!==_.value)]:[...l,_.value]},add(u,i){var T;const l=this.parse(u);if(i===void 0)throw new fe(se.ADDING_OPTION_TO_MULTIPLE_FILTER_WITHOUT_OPTION_VALUE,{rule:h,optionValue:i});const _=(T=h.options)==null?void 0:T.find(A=>typeof i=="object"&&"value"in i?A.value===i.value:A.value===i);return _!==void 0?l.includes(_.value)===!1?[...l,_.value]:l:[...l,i]},delete(u,i){var T;if(i===void 0)return;const l=this.parse(u),_=(T=h.options)==null?void 0:T.find(A=>typeof i=="object"&&"value"in i?A.value===i.value:A.value===i);return _!==void 0&&l.includes(_.value)?l.filter(A=>A.value!==_.value):l.filter(A=>A!==i)},isActive(u){return h.required?!0:this.parse(u).length>0}}}function va(h){return{validate(){return!0},parse(u){var i;if(u===void 0&&h.required){if(h.defaultValue)return h.defaultValue;if(Array.isArray(h.options)&&h.options.length>0)return(i=h.options.at(0))==null?void 0:i.value}return u},has(u){return u!==void 0},toggle(u,i){throw new fe(se.TOGGLING_OPTION_ON_RULE_WITH_SINGLE_VALUE,{rule:h,value:u,optionValue:i})},add(u,i){throw new fe(se.ADDING_OPTION_VALUE_TO_NON_MULTIPLE_FILTER,{rule:h,value:u,optionValue:i})},delete(u,i){if(i!==void 0)throw new fe(se.DELETING_OPTION_VALUE_FROM_NON_MULTIPLE_FILTER,{rule:h,value:u,optionValue:i})},isActive(u){return h.required?!0:!(u===void 0||typeof u=="string"&&u.trim()==="")}}}function xt(h){return h.boolean?_a(h):h.multiple?pa(h):va(h)}class os{constructor({initialFilters:u},i){j(this,Se);j(this,ze);q(this,Se,u??{}),q(this,ze,i)}set(u,i){if(v(this,ze).isDisabled())return;const l=this.getRule(u),_=this.get(u),A=typeof i=="string"&&i.trim()===""?void 0:i;xt(l).validate(i),!(v(this,Se)[l.id]!==void 0&&v(this,Se)[l.id]===A)&&v(this,ze).debouncer(l,()=>{q(this,Se,{...v(this,Se),[l.id]:A}),v(this,ze).touch({source:me.FILTERS,event:ue.SET_FILTER,current:A,initial:_,rule:l})})}get rules(){return v(this,ze).getRuleBook().rules.filter(ss)}get activeRules(){return this.rules.filter(u=>xt(u).isActive(v(this,Se)[u.id]))}get(u){const i=this.getRule(u),l=v(this,Se)[i.id];return xt(i).parse(l)}has(u,i){const l=this.getRule(u),_=v(this,Se)[l.id];return xt(l).has(_,i)}getRule(u){const i=v(this,ze).getRuleBook().getRule(u);if(ss(i)===!1)throw new fe(se.WRONG_RULE_TYPE_FOR_MIXIN,{rule:i});return i}add(u,i){const l=this.getRule(u),_=v(this,Se)[l.id];this.set(l,xt(l).add(_,i))}delete(u,i){const l=this.getRule(u),_=v(this,Se)[l.id];this.set(l,xt(l).delete(_,i))}isRuleActive(u){const i=this.getRule(u),l=v(this,Se)[i.id];return xt(i).isActive(l)}toggle(u,i){const l=this.getRule(u),_=v(this,Se)[l.id],T=xt(l).toggle(_,i);this.set(l,T)}test(u){if(v(this,ze).isLoading())return[];if(u.isAdditive){const i=Ge.uniqBy([...this.rules,...u.rules],"id"),l={...this.values,...u.values};return v(this,ze).test({filters:{rules:i,values:l}},!0)}return v(this,ze).test({filters:{rules:u.rules,values:u.values??{}}})}testRule({rule:u,value:i,...l}){const _=this.getRule(u);return this.test({rules:[_],values:{[_.id]:i},...l})}testRuleOptions({rule:u,...i}){if(v(this,ze).isLoading())return new Map;const l=this.getRule(u);if(l.boolean===!0){const _=new Map;return _.set(!0,this.testRule({rule:l,value:!0,...i})),_.set(!1,this.testRule({rule:l,value:!1,...i})),_}if(Array.isArray(l.options)){const _=new Map;return l.options.forEach(T=>{let A;if(i.mergeExistingValue){const O=v(this,Se)[l.id]??[];l.multiple&&(A=[...O,T.value])}else l.multiple?A=[T.value]:A=T.value;_.set(T,this.testRule({rule:l,value:A,...i}))}),_}throw new fe(se.TESTING_OPTIONS_ON_RULE_WITH_NO_OPTIONS,l)}get values(){return this.rules.reduce((u,i)=>(u[i.id]=this.get(i),u),{})}get raw(){return v(this,Se)}serialize(){return{rules:this.rules,values:this.values}}static process(u,i,l){const _=u.rules.filter(T=>xt(T).isActive(u.values[T.id]));return _.length===0?i:i.filter(T=>_.every(A=>A.filterFn(T,u.values[A.id],l)))}}Se=new WeakMap,ze=new WeakMap;const Ri=[void 0,"desc","asc"];class as{constructor({initialSortBy:u,initialSortDirection:i},l){j(this,rn);j(this,je);j(this,Rt);q(this,Rt,l),u&&q(this,rn,this.getRule(u)),q(this,je,i)}getRule(u){const i=v(this,Rt).getRuleBook().getRule(u);if(vi(i)===!1)throw new fe(se.WRONG_RULE_TYPE_FOR_MIXIN,{rule:i});return i}get rules(){return v(this,Rt).getRuleBook().rules.filter(vi)}get activeRule(){const u=this.rules.at(0);return v(this,rn)??u}get sortDirection(){var u;return v(this,je)??((u=this.activeRule)==null?void 0:u.defaultSortDirection)??"asc"}get userHasSetSortDirection(){return v(this,je)!==void 0}setSortDirection(u){if(v(this,Rt).isDisabled()||!this.activeRule)return;const i=v(this,je);q(this,je,u),v(this,Rt).touch({source:me.SORT_BY,event:ue.SET_SORT_BY_DIRECTION,current:{sortDirection:u},initial:{sortDirection:i},rule:this.activeRule})}cycleSortDirection(){const u=Ri.findIndex(i=>i===v(this,je));if(u!==-1){const i=u+1%(Ri.length-1);this.setSortDirection(Ri[i])}}toggleSortDirection(){var i;if((v(this,je)??((i=this.activeRule)==null?void 0:i.defaultSortDirection))==="desc"){this.setSortDirection("asc");return}this.setSortDirection("desc")}set(u,i){if(v(this,Rt).isDisabled()||!this.activeRule)return;const l=v(this,je),_=v(this,rn),T=u?this.getRule(u):void 0;q(this,rn,T),q(this,je,i),v(this,Rt).touch({source:me.SORT_BY,event:ue.SET_SORT_BY,current:{rule:T==null?void 0:T.id,sortDirection:i},initial:{rule:_==null?void 0:_.id,sortDirection:l},rule:this.activeRule})}reset(){this.set(void 0,void 0)}serialize(){return{rule:this.activeRule,sortDirection:this.sortDirection}}static process(u,i,l){return u.rule===void 0?i:Ge.orderBy(i,_=>{var T;return typeof((T=u.rule)==null?void 0:T.sortFn)=="function"?u.rule.sortFn(_,l):Number.NEGATIVE_INFINITY},u.sortDirection)}}rn=new WeakMap,je=new WeakMap,Rt=new WeakMap;class ls{constructor({initialGroupBy:u,requireGroup:i},l){j(this,qt);j(this,Yt);j(this,Ot);q(this,Ot,l),u&&q(this,qt,this.getRule(u)),this.requireGroup=i}getRule(u){const i=v(this,Ot).getRuleBook().getRule(u);if(Ti(i)===!1)throw new fe(se.WRONG_RULE_TYPE_FOR_MIXIN,{rule:i});return i}get rules(){return v(this,Ot).getRuleBook().rules.filter(Ti)}get activeRule(){const u=this.requireGroup?this.rules.at(0):void 0;return v(this,qt)??u}get hasGroupByRule(){return this.activeRule!==void 0}get groupSortDirection(){var u;return v(this,Yt)??((u=this.activeRule)==null?void 0:u.defaultGroupSortDirection)}set(u){if(v(this,Ot).isDisabled())return;const i=v(this,qt);let l;const _=typeof u=="string"&&u.trim()==="";_&&(l=void 0),_===!1&&u!==void 0&&(l=this.getRule(u)),v(this,qt)!==l&&(q(this,qt,l),q(this,Yt,void 0),v(this,Ot).touch({source:me.GROUP_BY,event:ue.SET_GROUP_BY,current:l==null?void 0:l.id,initial:i==null?void 0:i.id,rule:l}))}setGroupSortDirection(u){const i=v(this,Yt);q(this,Yt,u),v(this,Ot).touch({source:me.GROUP_BY,event:ue.SET_GROUP_SORT_BY_DIRECTION,current:u,initial:i,rule:this.activeRule})}toggle(u){const i=this.getRule(u);if(this.activeRule===i){this.set(void 0);return}this.set(i)}reset(){this.setGroupSortDirection(void 0),this.set(void 0)}serialize(){return{rule:this.activeRule,sortDirection:v(this,Yt)}}static process(u,i,l){var k,K;const _=Ge.groupBy(i,G=>{var ae;return(ae=u.rule)==null?void 0:ae.groupFn(G,l)}),T=Object.entries(_).map(([G,ae])=>({id:G,items:ae})),A=((k=u.rule)==null?void 0:k.sticky)!==void 0,O=[],U=[];if(A&&u.rule&&(O.push(Ta(u.rule)),U.push("asc")),(K=u.rule)!=null&&K.sortGroupFn&&(O.push(u.rule.sortGroupFn),U.push(u.sortDirection??"asc")),O.length>0){const G=U;return Ge.orderBy(T,O,G)}return T}}qt=new WeakMap,Yt=new WeakMap,Ot=new WeakMap;function Ta(h){var l,_;let u=[];((l=h.sticky)==null?void 0:l.header)!==void 0&&(Array.isArray(h.sticky.header)&&(u=h.sticky.header),typeof h.sticky.header=="string"&&(u=[h.sticky.header]));let i=[];return((_=h.sticky)==null?void 0:_.footer)!==void 0&&(Array.isArray(h.sticky.footer)&&(i=h.sticky.footer),typeof h.sticky.footer=="string"&&(i=[h.sticky.footer])),T=>{if(u.includes(T.id)){const A=u.findIndex(U=>T.id===U);return(u.length-A)*-1}return i.includes(T.id)?1+i.findIndex(O=>T.id===O):0}}class cs{constructor({page:u,numItemsPerPage:i},l){j(this,et);j(this,kt);q(this,et,u??1),this.numItemsPerPage=i,q(this,kt,l)}setPage(u){if(u!==v(this,et)){const i=v(this,et);q(this,et,u),v(this,kt).touch({source:me.PAGINATION,event:ue.SET_PAGE,current:{page:v(this,et)},initial:{page:i}})}}setNumItemsPerPage(u){if(u!==this.numItemsPerPage){const i=this.numItemsPerPage;this.numItemsPerPage=u,v(this,kt).touch({source:me.PAGINATION,event:ue.SET_NUM_ITEMS_PER_PAGE,current:{numItemsPerPage:this.numItemsPerPage},initial:{numItemsPerPage:i}})}}get lastPage(){if(this.numItemsPerPage!==void 0)return Math.ceil(v(this,kt).getItems().length/this.numItemsPerPage)}get numTotalItems(){return v(this,kt).getItems().length}get page(){return this.numItemsPerPage&&this.lastPage?Ge.clamp(v(this,et),1,this.lastPage):v(this,et)}get offset(){return this.numItemsPerPage&&this.lastPage?(Ge.clamp(v(this,et),1,this.lastPage)-1)*this.numItemsPerPage:0}serialize(){return{page:v(this,et),numItemsPerPage:this.numItemsPerPage}}static process(u,i){if(u.numItemsPerPage===void 0)return i;const l=Math.ceil(i.length/u.numItemsPerPage),T=(Ge.clamp(u.page,1,l)-1)*u.numItemsPerPage;return i.slice(T,T+u.numItemsPerPage)}}et=new WeakMap,kt=new WeakMap;function Ra(){const h=new Map;return(u,i)=>{var l;return u.debounceMilliseconds===void 0?i():(h.has(u)===!1&&h.set(u,Ge.debounce(_=>_(),u.debounceMilliseconds)),(l=h.get(u))==null?void 0:l(i))}}class Ea{constructor(u,i,l){j(this,Yn);j(this,kn);this.searchEffects=[],this.ruleEffects=[],q(this,Yn,u.filter(ha)),q(this,kn,u.filter(ga)),this.hydrateDefinitions(i,l)}hydrateDefinitions(u,i){this.ruleEffects=v(this,Yn).map(l=>{const _=typeof l.rules=="function"?l.rules(u,i):l.rules,T=Array.isArray(_)?_:[_];return{...l,rules:T,_isHydrated:!0}}),this.searchEffects=v(this,kn).map(l=>{const _=typeof l.haystack=="function"?l.haystack(u,i):l.haystack,T=Array.isArray(_)?_:[_];return{...l,haystack:T,_isHydrated:!0}})}processRule(u,i){this.ruleEffects.forEach(l=>{l.rules.some(T=>typeof T=="string"&&u.id===T||typeof T=="object"&&u.id===T.id)&&l.onChange(i,u)})}processSearchTerm(u,i){this.searchEffects.forEach(l=>{la(l.haystack,u)&&l.onChange(i,u)})}}Yn=new WeakMap,kn=new WeakMap;class Ia{constructor(){j(this,Et,new Map);j(this,un,!1)}on(u,i){v(this,Et).has(u)===!1&&v(this,Et).set(u,new Set);const l=v(this,Et).get(u);l==null||l.add(i)}off(u,i){if(v(this,Et).has(u)===!1)return;if(i===void 0){v(this,Et).delete(u);return}const l=v(this,Et).get(u);l==null||l.delete(i)}emit(u,i){if(v(this,un))return;const l=v(this,Et).get(u);l==null||l.forEach(_=>{_(i)})}silently(u){q(this,un,!0),u(),q(this,un,!1)}isSilent(){return v(this,un)}}Et=new WeakMap,un=new WeakMap;const Er=class Er{constructor(u,i,l){j(this,sn);this.rules=[],Er.validateDefinitions(u),q(this,sn,u),this.hydrateDefinitions(i,l)}hydrateDefinitions(u,i){this.rules=v(this,sn).map(l=>us(l)?{...l,options:typeof l.options=="function"?l.options({items:u,context:i}):l.options,multiple:!!l.multiple,required:!!l.required,boolean:!!l.boolean,hidden:!!l.hidden,_isHydrated:!0}:l)}getRule(u){const i=this.rules.find(l=>typeof u=="object"?l.id===u.id:l.id===u);if(i===void 0)throw new fe(se.RULE_NOT_FOUND,u);return i}getDefinitions(){return v(this,sn)}setRules(u){Er.validateDefinitions(u),q(this,sn,u)}static validateDefinitions(u){if(u.length===0)return!1;const i=[Rr,us,vi,Ti],l=new Set;return u.forEach(_=>{if(_.id===void 0&&!Rr(_))throw new fe(se.INVALID_RULE_WITHOUT_ID,_);if(i.some(T=>T(_))===!1)throw new fe(se.INVALID_RULE_SHAPE,_);if(_.id){if(l.has(_.id))throw new fe(se.INVALID_RULE_DUPLICATE,_);l.add(_.id)}}),!0}};sn=new WeakMap;let Ei=Er;class Hn{constructor(){this.snapshot={},this.isStale=!0}setIsStale(u){this.isStale=u}takeSnapshot({items:u,context:i,mixins:l}){const _=Hn.test({mixins:l,items:u,context:i}),T=l.pagination?cs.process(l.pagination,_):_;let A=[];const O=l.groupBy!==void 0;l.groupBy&&(A=ls.process(l.groupBy,T,i)),this.snapshot={items:O?void 0:T,groups:O?A:void 0,numMatchedItems:_.length,numTotalItems:u.length,hasGroupByRule:O}}static test({mixins:u,items:i,context:l}){let _=[...i];return u.search&&(_=fs.process(u.search,_,l)),u.filters&&(_=os.process(u.filters,_,l)),u.sortBy&&(_=as.process(u.sortBy,_,l)),_}}class ma{constructor(u,{rules:i,effects:l,initialSearchTerm:_,initialSortBy:T,initialSortDirection:A,initialGroupBy:O,initialFilters:U,context:k,page:K,numItemsPerPage:G,isLoading:ae,disabled:Ae,requireGroup:Te,ignoreSortByRulesWhileSearchRuleIsActive:Ne,onInit:Re,onReady:Ce,onFirstUserInteraction:mt,onChange:Le},ht){j(this,We);j(this,Lt);j(this,Rn);j(this,zn);j(this,ve);j(this,It);j(this,ct);j(this,zt);this.isReady=!1,q(this,Rn,!1),q(this,Lt,u),this.disabled=!!Ae,this.isLoading=!!ae,q(this,ve,new Ia),this.getInstanceFn=ht,q(this,ct,new Ei(i,u??[],k)),q(this,zt,new Ea(l??[],u??[],k));const De=Ra(),ee={getItems:()=>this.items,getRuleBook:()=>v(this,ct),isLoading:()=>this.isLoading,isDisabled:()=>this.disabled,test:(de,tt)=>this.test(de,tt),touch:de=>Ht(this,We,$o).call(this,de),debouncer:De};this.search=new fs({initialSearchTerm:_},ee),this.filters=new os({initialFilters:U},ee),this.sortBy=new as({initialSortBy:T,initialSortDirection:A},ee),this.groupBy=new ls({initialGroupBy:O,requireGroup:!!Te},ee),this.pagination=new cs({page:K,numItemsPerPage:G},ee),this.updatedAt=Date.now(),q(this,It,new Hn),this.context=k,q(this,zn,Ne),v(this,ve).silently(()=>{const de={source:me.CORE,event:ue.INIT,timestamp:Date.now(),instance:this.getInstanceFn()};Re&&Re(de)}),Le&&v(this,ve).on(ue.CHANGE,Le),mt&&v(this,ve).on(ue.FIRST_USER_INTERACTION,mt),this.isReady=!ae&&Array.isArray(u)&&u.length>0,Ce&&this.isReady&&Ce({source:me.CORE,event:ue.READY,timestamp:Date.now(),instance:this.getInstanceFn()}),this.isReady===!1&&Ce&&v(this,ve).on(ue.READY,Ce)}emitFirstUserInteraction(){if(v(this,Rn)===!1){q(this,Rn,!0);const u={source:me.CORE,event:ue.FIRST_USER_INTERACTION,timestamp:Date.now(),instance:this.getInstanceFn()};v(this,ve).emit(ue.FIRST_USER_INTERACTION,u)}}get items(){return Array.isArray(v(this,Lt))?v(this,Lt):[]}get matches(){return v(this,It).isStale&&(v(this,It).takeSnapshot({items:this.items,context:this.context,mixins:Ht(this,We,Ku).call(this)}),v(this,It).setIsStale(!1)),v(this,It).snapshot}test(u,i=!1){if(i){const l={...Ht(this,We,Ku).call(this),...u};return Hn.test({mixins:l,items:this.items,context:this.context})}return Hn.test({mixins:u,items:this.items,context:this.context})}get isEmpty(){return this.isLoading===!1&&this.items.length===0}get hasMatches(){const u=Array.isArray(this.matches.items)&&this.matches.items.length>0,i=Array.isArray(this.matches.groups)&&this.matches.groups.length>0;return u||i}get events(){return{on:(u,i)=>v(this,ve).on(u,i),off:(u,i)=>v(this,ve).off(u,i),silently:u=>v(this,ve).silently(u),isSilent:()=>v(this,ve).isSilent()}}getRule(u){return v(this,ct).getRule(u)}get state(){if(this.isLoading)return"loading";if(this.isEmpty)return"empty";const u=this.groupBy.activeRule!==void 0;return u&&Array.isArray(this.matches.groups)&&this.matches.groups.length>0?"groups":u===!1&&Array.isArray(this.matches.items)&&this.matches.items.length>0?"items":"noMatches"}setItems(u){if(Ge.isEqual(u,v(this,Lt))===!1){const i=v(this,Lt);q(this,Lt,u),v(this,ct).hydrateDefinitions(this.items,this.context),v(this,zt).hydrateDefinitions(this.items,this.context),Ht(this,We,_r).call(this,{source:me.CORE,event:ue.SET_ITEMS,current:u,initial:i})}}setIsLoading(u){if(!!u!==this.isLoading){const i=this.isLoading;this.isLoading=!!u,Ht(this,We,_r).call(this,{source:me.CORE,event:ue.SET_IS_LOADING,current:!!u,initial:i}),this.isLoading===!1&&Ht(this,We,Ko).call(this)}}setIsDisabled(u){if(!!u!==this.disabled){const i=this.disabled;this.disabled=!!u,Ht(this,We,_r).call(this,{source:me.CORE,event:ue.SET_IS_DISABLED,current:!!u,initial:i})}}setRules(u){Ge.isEqual(u,v(this,ct).getDefinitions())===!1&&(v(this,ct).setRules(u),v(this,ct).hydrateDefinitions(this.items,this.context))}setContext(u){const i=this.context;Ge.isEqual(u,i)===!1&&(this.context=u,v(this,ct).hydrateDefinitions(this.items,this.context),v(this,zt).hydrateDefinitions(this.items,this.context),Ht(this,We,_r).call(this,{source:me.CORE,event:ue.SET_CONTEXT,current:u,initial:i}))}}Lt=new WeakMap,Rn=new WeakMap,zn=new WeakMap,ve=new WeakMap,It=new WeakMap,ct=new WeakMap,zt=new WeakMap,We=new WeakSet,$o=function(u){if(v(this,ve).isSilent())return;this.emitFirstUserInteraction(),this.updatedAt=Date.now(),v(this,It).setIsStale(!0);const i={...u,timestamp:Date.now(),instance:this.getInstanceFn()};v(this,ve).emit(ue.CHANGE,i),v(this,ve).silently(()=>{u.rule&&v(this,zt).processRule(u.rule,this.getInstanceFn()),this.search.hasSearchTerm&&v(this,zt).processSearchTerm(this.search.searchTerm,this.getInstanceFn())})},_r=function(u){v(this,It).setIsStale(!0),this.updatedAt=Date.now();const i={...u,timestamp:Date.now(),instance:this.getInstanceFn()};v(this,ve).emit(u.event,i)},Ko=function(){this.isReady===!1&&(this.isReady=!0,v(this,ve).emit(ue.READY,{source:me.CORE,event:ue.READY,timestamp:Date.now()}))},Ku=function(){const u=this.search.hasSearchRule&&this.search.hasSearchTerm,i=u&&v(this,zn),l={};return u&&(l.search=this.search.serialize()),this.filters.activeRules.length>0&&(l.filters=this.filters.serialize()),this.pagination.numItemsPerPage&&(l.pagination=this.pagination.serialize()),i===!1&&(l.sortBy=this.sortBy.serialize()),this.groupBy.activeRule!==void 0&&(l.groupBy=this.groupBy.serialize()),l};class Sa{constructor(u,i){j(this,V);const l=()=>this;q(this,V,new ma(u,i,l))}get items(){return v(this,V).items}get context(){return v(this,V).context}get isReady(){return v(this,V).isReady}get isEmpty(){return v(this,V).isEmpty}get hasMatches(){return v(this,V).hasMatches}get isLoading(){return v(this,V).isLoading}get disabled(){return v(this,V).disabled}get state(){return v(this,V).state}get updatedAt(){return v(this,V).updatedAt}get events(){return v(this,V).events}get matches(){return v(this,V).matches}get search(){const u=v(this,V).search;return{searchTerm:u.searchTerm,hasSearchTerm:u.hasSearchTerm,hasSearchRule:u.hasSearchRule,setSearchTerm:u.setSearchTerm.bind(u),reset:u.reset.bind(u),test:u.test.bind(u)}}get filters(){const u=v(this,V).filters;return{values:u.values,raw:u.raw,activeRules:u.activeRules,rules:u.rules,isActive:u.isRuleActive.bind(u),get:u.get.bind(u),add:u.add.bind(u),has:u.has.bind(u),getRule:u.getRule.bind(u),toggle:u.toggle.bind(u),set:u.set.bind(u),delete:u.delete.bind(u),test:u.test.bind(u),testRule:u.testRule.bind(u),testRuleOptions:u.testRuleOptions.bind(u)}}get sortBy(){const u=v(this,V).sortBy;return{activeRule:u.activeRule,sortDirection:u.sortDirection,userHasSetSortDirection:u.userHasSetSortDirection,rules:u.rules,set:u.set.bind(u),setSortDirection:u.setSortDirection.bind(u),cycleSortDirection:u.cycleSortDirection.bind(u),toggleSortDirection:u.toggleSortDirection.bind(u),reset:u.reset.bind(u)}}get groupBy(){const u=v(this,V).groupBy;return{activeRule:u.activeRule,requireGroup:u.requireGroup,rules:u.rules,groupSortDirection:u.groupSortDirection,set:u.set.bind(u),toggle:u.toggle.bind(u),setGroupSortDirection:u.setGroupSortDirection.bind(u),reset:u.reset.bind(u)}}get pagination(){const u=v(this,V).pagination;return{page:u.page,offset:u.offset,numItemsPerPage:u.numItemsPerPage,numTotalItems:u.numTotalItems,lastPage:u.lastPage,isPaginated:u.numItemsPerPage!==void 0,setPage:u.setPage.bind(u),setNumItemsPerPage:u.setNumItemsPerPage.bind(u)}}setItems(u){return v(this,V).setItems(u)}setIsLoading(u){return v(this,V).setIsLoading(u)}setIsDisabled(u){return v(this,V).setIsDisabled(u)}setRules(u){return v(this,V).setRules(u)}setContext(u){return v(this,V).setContext(u)}test(u,i=!1){return v(this,V).test(u,i)}getRule(u){return v(this,V).getRule(u)}}V=new WeakMap;function Ii({items:h,rules:u,effects:i,initialSearchTerm:l,initialSortBy:_,initialSortDirection:T,initialGroupBy:A,initialFilters:O,context:U,isLoading:k,disabled:K,page:G,numItemsPerPage:ae,requireGroup:Ae,ignoreSortByRulesWhileSearchRuleIsActive:Te,onInit:Ne,onReady:Re,onFirstUserInteraction:Ce,onChange:mt,controllerRef:Le,children:ht}){const[,De]=J.useState(void 0),[ee]=J.useState(()=>{const de=tt=>{ee.events.on("change",fn=>De(fn.instance.updatedAt)),mt&&mt(tt)};return new Sa(h,{rules:u,effects:i,initialSearchTerm:l,initialSortBy:_,initialSortDirection:T,initialGroupBy:A,initialFilters:O,context:U,isLoading:k,disabled:K,page:G,numItemsPerPage:ae,requireGroup:Ae,ignoreSortByRulesWhileSearchRuleIsActive:Te,onInit:Ne,onReady:Re,onFirstUserInteraction:Ce,onChange:de})});return ee.setItems(h),ee.setIsLoading(k),ee.setIsDisabled(K),ee.setRules(u),U!==void 0&&ee.setContext(U),G!==void 0&&ee.pagination.setPage(G),ae!==void 0&&ee.pagination.setNumItemsPerPage(ae),J.useImperativeHandle(Le,()=>ee,[ee]),Oe.jsx(Xu,{value:[ee,ee.updatedAt],children:ht})}Ii.Content=Tn,Ii.SearchTermHaystack=ca;function Aa(){return J.useRef(null)}Y.Finder=Ii,Y.StringMatch=is,Y.filterRule=Xo,Y.finderRuleset=Be,Y.groupByRule=Jo,Y.ruleEffect=Vo,Y.searchEffect=Qo,Y.searchRule=pr,Y.sortByRule=Zo,Y.useFinder=nn,Y.useFinderRef=Aa,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})});
@@ -11,7 +11,7 @@ export interface FinderProps<FItem, FContext> extends FinderConstructorOptions<F
11
11
  }
12
12
  export interface FinderContentProps<FContext = any> {
13
13
  pagination: PaginationMixinInterface;
14
- context?: FContext;
14
+ context: FContext;
15
15
  }
16
16
  export interface FinderContentItemProps<FItem, FContext = any> extends FinderContentProps<FContext> {
17
17
  items: FItem[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitgrab/finder",
3
- "version": "0.1.8-alpha",
3
+ "version": "0.1.10-alpha",
4
4
  "description": "Headless datatables for things that aren't tables.",
5
5
  "type": "module",
6
6
  "files": [
@@ -26,8 +26,8 @@
26
26
  "dev": "vite",
27
27
  "build": "vite build && tsc --project tsconfig.production.json",
28
28
  "build:docs": "npm --prefix docusaurus run build && rm -r docs && cp -r ./docusaurus/build ./docs && mkdir ./docs/examples",
29
- "build:armory": "npm --prefix examples/react-armory run build && rm -r ./docs/examples/armory && cp -r ./examples/react-armory/dist ./docs/examples/armory",
30
- "build:shoes": "npm --prefix examples/react-shoes run build && rm -r ./docs/examples/shoes && cp -r ./examples/react-shoes/dist ./docs/examples/shoes",
29
+ "build:armory": "npm --prefix examples/pixel-armory run build && rm -r ./docs/examples/armory && cp -r ./examples/pixel-armory/dist ./docs/examples/armory",
30
+ "build:shoes": "npm --prefix examples/shoe-store run build && rm -r ./docs/examples/shoes && cp -r ./examples/shoe-store/dist ./docs/examples/shoes",
31
31
  "test": "vitest"
32
32
  },
33
33
  "repository": {