12 |
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[19418],{19418:function(t,e,n){function s(t){return Array.isArray?Array.isArray(t):"[object Array]"===l(t)}n.d(e,{Z:function(){return Q}});function i(t){return"string"===typeof t}function r(t){return"number"===typeof t}function c(t){return!0===t||!1===t||function(t){return o(t)&&null!==t}(t)&&"[object Boolean]"==l(t)}function o(t){return"object"===typeof t}function h(t){return void 0!==t&&null!==t}function a(t){return!t.trim().length}function l(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const u=Object.prototype.hasOwnProperty;class d{constructor(t){this._keys=[],this._keyMap={};let e=0;t.forEach((t=>{let n=g(t);e+=n.weight,this._keys.push(n),this._keyMap[n.id]=n,e+=n.weight})),this._keys.forEach((t=>{t.weight/=e}))}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function g(t){let e=null,n=null,r=null,c=1,o=null;if(i(t)||s(t))r=t,e=f(t),n=p(t);else{if(!u.call(t,"name"))throw new Error((t=>`Missing ${t} property in key`)("name"));const s=t.name;if(r=s,u.call(t,"weight")&&(c=t.weight,c<=0))throw new Error((t=>`Property 'weight' in key '${t}' must be a positive integer`)(s));e=f(s),n=p(s),o=t.getFn}return{path:e,id:n,weight:c,src:r,getFn:o}}function f(t){return s(t)?t:t.split(".")}function p(t){return s(t)?t.join("."):t}var m={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,...{useExtendedSearch:!1,getFn:function(t,e){let n=[],o=!1;const a=(t,e,l)=>{if(h(t))if(e[l]){const u=t[e[l]];if(!h(u))return;if(l===e.length-1&&(i(u)||r(u)||c(u)))n.push(function(t){return null==t?"":function(t){if("string"==typeof t)return t;let e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(t)}(u));else if(s(u)){o=!0;for(let t=0,n=u.length;t<n;t+=1)a(u[t],e,l+1)}else e.length&&a(u,e,l+1)}else n.push(t)};return a(t,i(e)?e.split("."):e,0),o?n:n[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};const M=/[^ ]+/g;class y{constructor({getFn:t=m.getFn,fieldNormWeight:e=m.fieldNormWeight}={}){this.norm=function(t=1,e=3){const n=new Map,s=Math.pow(10,e);return{get(e){const i=e.match(M).length;if(n.has(i))return n.get(i);const r=1/Math.pow(i,.5*t),c=parseFloat(Math.round(r*s)/s);return n.set(i,c),c},clear(){n.clear()}}}(e,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach(((t,e)=>{this._keysMap[t.id]=e}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,i(this.docs[0])?this.docs.forEach(((t,e)=>{this._addString(t,e)})):this.docs.forEach(((t,e)=>{this._addObject(t,e)})),this.norm.clear())}add(t){const e=this.size();i(t)?this._addString(t,e):this._addObject(t,e)}removeAt(t){this.records.splice(t,1);for(let e=t,n=this.size();e<n;e+=1)this.records[e].i-=1}getValueForItemAtKeyId(t,e){return t[this._keysMap[e]]}size(){return this.records.length}_addString(t,e){if(!h(t)||a(t))return;let n={v:t,i:e,n:this.norm.get(t)};this.records.push(n)}_addObject(t,e){let n={i:e,$:{}};this.keys.forEach(((e,r)=>{let c=e.getFn?e.getFn(t):this.getFn(t,e.path);if(h(c))if(s(c)){let t=[];const e=[{nestedArrIndex:-1,value:c}];for(;e.length;){const{nestedArrIndex:n,value:r}=e.pop();if(h(r))if(i(r)&&!a(r)){let e={v:r,i:n,n:this.norm.get(r)};t.push(e)}else s(r)&&r.forEach(((t,n)=>{e.push({nestedArrIndex:n,value:t})}))}n.$[r]=t}else if(i(c)&&!a(c)){let t={v:c,n:this.norm.get(c)};n.$[r]=t}})),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function x(t,e,{getFn:n=m.getFn,fieldNormWeight:s=m.fieldNormWeight}={}){const i=new y({getFn:n,fieldNormWeight:s});return i.setKeys(t.map(g)),i.setSources(e),i.create(),i}function L(t,{errors:e=0,currentLocation:n=0,expectedLocation:s=0,distance:i=m.distance,ignoreLocation:r=m.ignoreLocation}={}){const c=e/t.length;if(r)return c;const o=Math.abs(s-n);return i?c+o/i:o?1:c}const k=32;function _(t,e,n,{location:s=m.location,distance:i=m.distance,threshold:r=m.threshold,findAllMatches:c=m.findAllMatches,minMatchCharLength:o=m.minMatchCharLength,includeMatches:h=m.includeMatches,ignoreLocation:a=m.ignoreLocation}={}){if(e.length>k)throw new Error(`Pattern length exceeds max of ${k}.`);const l=e.length,u=t.length,d=Math.max(0,Math.min(s,u));let g=r,f=d;const p=o>1||h,M=p?Array(u):[];let y;for(;(y=t.indexOf(e,f))>-1;){let t=L(e,{currentLocation:y,expectedLocation:d,distance:i,ignoreLocation:a});if(g=Math.min(t,g),f=y+l,p){let t=0;for(;t<l;)M[y+t]=1,t+=1}}f=-1;let x=[],_=1,v=l+u;const S=1<<l-1;for(let m=0;m<l;m+=1){let s=0,r=v;for(;s<r;){L(e,{errors:m,currentLocation:d+r,expectedLocation:d,distance:i,ignoreLocation:a})<=g?s=r:v=r,r=Math.floor((v-s)/2+s)}v=r;let o=Math.max(1,d-r+1),h=c?u:Math.min(d+r,u)+l,y=Array(h+2);y[h+1]=(1<<m)-1;for(let c=h;c>=o;c-=1){let s=c-1,r=n[t.charAt(s)];if(p&&(M[s]=+!!r),y[c]=(y[c+1]<<1|1)&r,m&&(y[c]|=(x[c+1]|x[c])<<1|1|x[c+1]),y[c]&S&&(_=L(e,{errors:m,currentLocation:s,expectedLocation:d,distance:i,ignoreLocation:a}),_<=g)){if(g=_,f=s,f<=d)break;o=Math.max(1,2*d-f)}}if(L(e,{errors:m+1,currentLocation:d,expectedLocation:d,distance:i,ignoreLocation:a})>g)break;x=y}const w={isMatch:f>=0,score:Math.max(.001,_)};if(p){const t=function(t=[],e=m.minMatchCharLength){let n=[],s=-1,i=-1,r=0;for(let c=t.length;r<c;r+=1){let c=t[r];c&&-1===s?s=r:c||-1===s||(i=r-1,i-s+1>=e&&n.push([s,i]),s=-1)}return t[r-1]&&r-s>=e&&n.push([s,r-1]),n}(M,o);t.length?h&&(w.indices=t):w.isMatch=!1}return w}function v(t){let e={};for(let n=0,s=t.length;n<s;n+=1){const i=t.charAt(n);e[i]=(e[i]||0)|1<<s-n-1}return e}class S{constructor(t,{location:e=m.location,threshold:n=m.threshold,distance:s=m.distance,includeMatches:i=m.includeMatches,findAllMatches:r=m.findAllMatches,minMatchCharLength:c=m.minMatchCharLength,isCaseSensitive:o=m.isCaseSensitive,ignoreLocation:h=m.ignoreLocation}={}){if(this.options={location:e,threshold:n,distance:s,includeMatches:i,findAllMatches:r,minMatchCharLength:c,isCaseSensitive:o,ignoreLocation:h},this.pattern=o?t:t.toLowerCase(),this.chunks=[],!this.pattern.length)return;const a=(t,e)=>{this.chunks.push({pattern:t,alphabet:v(t),startIndex:e})},l=this.pattern.length;if(l>k){let t=0;const e=l%k,n=l-e;for(;t<n;)a(this.pattern.substr(t,k),t),t+=k;if(e){const t=l-k;a(this.pattern.substr(t),t)}}else a(this.pattern,0)}searchIn(t){const{isCaseSensitive:e,includeMatches:n}=this.options;if(e||(t=t.toLowerCase()),this.pattern===t){let e={isMatch:!0,score:0};return n&&(e.indices=[[0,t.length-1]]),e}const{location:s,distance:i,threshold:r,findAllMatches:c,minMatchCharLength:o,ignoreLocation:h}=this.options;let a=[],l=0,u=!1;this.chunks.forEach((({pattern:e,alphabet:d,startIndex:g})=>{const{isMatch:f,score:p,indices:m}=_(t,e,d,{location:s+g,distance:i,threshold:r,findAllMatches:c,minMatchCharLength:o,includeMatches:n,ignoreLocation:h});f&&(u=!0),l+=p,f&&m&&(a=[...a,...m])}));let d={isMatch:u,score:u?l/this.chunks.length:1};return u&&n&&(d.indices=a),d}}class w{constructor(t){this.pattern=t}static isMultiMatch(t){return C(t,this.multiRegex)}static isSingleMatch(t){return C(t,this.singleRegex)}search(){}}function C(t,e){const n=t.match(e);return n?n[1]:null}class I extends w{constructor(t,{location:e=m.location,threshold:n=m.threshold,distance:s=m.distance,includeMatches:i=m.includeMatches,findAllMatches:r=m.findAllMatches,minMatchCharLength:c=m.minMatchCharLength,isCaseSensitive:o=m.isCaseSensitive,ignoreLocation:h=m.ignoreLocation}={}){super(t),this._bitapSearch=new S(t,{location:e,threshold:n,distance:s,includeMatches:i,findAllMatches:r,minMatchCharLength:c,isCaseSensitive:o,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class $ extends w{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let e,n=0;const s=[],i=this.pattern.length;for(;(e=t.indexOf(this.pattern,n))>-1;)n=e+i,s.push([e,n-1]);const r=!!s.length;return{isMatch:r,score:r?0:1,indices:s}}}const A=[class extends w{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const e=t===this.pattern;return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},$,class extends w{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const e=t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},class extends w{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const e=!t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends w{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const e=!t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends w{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const e=t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[t.length-this.pattern.length,t.length-1]}}},class extends w{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const e=-1===t.indexOf(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},I],E=A.length,b=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;const F=new Set([I.type,$.type]);class N{constructor(t,{isCaseSensitive:e=m.isCaseSensitive,includeMatches:n=m.includeMatches,minMatchCharLength:s=m.minMatchCharLength,ignoreLocation:i=m.ignoreLocation,findAllMatches:r=m.findAllMatches,location:c=m.location,threshold:o=m.threshold,distance:h=m.distance}={}){this.query=null,this.options={isCaseSensitive:e,includeMatches:n,minMatchCharLength:s,findAllMatches:r,ignoreLocation:i,location:c,threshold:o,distance:h},this.pattern=e?t:t.toLowerCase(),this.query=function(t,e={}){return t.split("|").map((t=>{let n=t.trim().split(b).filter((t=>t&&!!t.trim())),s=[];for(let i=0,r=n.length;i<r;i+=1){const t=n[i];let r=!1,c=-1;for(;!r&&++c<E;){const n=A[c];let i=n.isMultiMatch(t);i&&(s.push(new n(i,e)),r=!0)}if(!r)for(c=-1;++c<E;){const n=A[c];let i=n.isSingleMatch(t);if(i){s.push(new n(i,e));break}}}return s}))}(this.pattern,this.options)}static condition(t,e){return e.useExtendedSearch}searchIn(t){const e=this.query;if(!e)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:s}=this.options;t=s?t:t.toLowerCase();let i=0,r=[],c=0;for(let o=0,h=e.length;o<h;o+=1){const s=e[o];r.length=0,i=0;for(let e=0,o=s.length;e<o;e+=1){const o=s[e],{isMatch:h,indices:a,score:l}=o.search(t);if(!h){c=0,i=0,r.length=0;break}if(i+=1,c+=l,n){const t=o.constructor.type;F.has(t)?r=[...r,...a]:r.push(a)}}if(i){let t={isMatch:!0,score:c/i};return n&&(t.indices=r),t}}return{isMatch:!1,score:1}}}const R=[];function O(t,e){for(let n=0,s=R.length;n<s;n+=1){let s=R[n];if(s.condition(t,e))return new s(t,e)}return new S(t,e)}const j="$and",W="$or",z="$path",K="$val",P=t=>!(!t[j]&&!t[W]),q=t=>({[j]:Object.keys(t).map((e=>({[e]:t[e]})))});function J(t,e,{auto:n=!0}={}){const r=t=>{let c=Object.keys(t);const h=(t=>!!t[z])(t);if(!h&&c.length>1&&!P(t))return r(q(t));if((t=>!s(t)&&o(t)&&!P(t))(t)){const s=h?t[z]:c[0],r=h?t[K]:t[s];if(!i(r))throw new Error((t=>`Invalid value for key ${t}`)(s));const o={keyId:p(s),pattern:r};return n&&(o.searcher=O(r,e)),o}let a={children:[],operator:c[0]};return c.forEach((e=>{const n=t[e];s(n)&&n.forEach((t=>{a.children.push(r(t))}))})),a};return P(t)||(t=q(t)),r(t)}function V(t,e){const n=t.matches;e.matches=[],h(n)&&n.forEach((t=>{if(!h(t.indices)||!t.indices.length)return;const{indices:n,value:s}=t;let i={indices:n,value:s};t.key&&(i.key=t.key.src),t.idx>-1&&(i.refIndex=t.idx),e.matches.push(i)}))}function B(t,e){e.score=t.score}class Q{constructor(t,e={},n){this.options={...m,...e},this.options.useExtendedSearch,this._keyStore=new d(this.options.keys),this.setCollection(t,n)}setCollection(t,e){if(this._docs=t,e&&!(e instanceof y))throw new Error("Incorrect 'index' type");this._myIndex=e||x(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){h(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=(()=>!1)){const e=[];for(let n=0,s=this._docs.length;n<s;n+=1){const i=this._docs[n];t(i,n)&&(this.removeAt(n),n-=1,s-=1,e.push(i))}return e}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:e=-1}={}){const{includeMatches:n,includeScore:s,shouldSort:c,sortFn:o,ignoreFieldNorm:h}=this.options;let a=i(t)?i(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return function(t,{ignoreFieldNorm:e=m.ignoreFieldNorm}){t.forEach((t=>{let n=1;t.matches.forEach((({key:t,norm:s,score:i})=>{const r=t?t.weight:null;n*=Math.pow(0===i&&r?Number.EPSILON:i,(r||1)*(e?1:s))})),t.score=n}))}(a,{ignoreFieldNorm:h}),c&&a.sort(o),r(e)&&e>-1&&(a=a.slice(0,e)),function(t,e,{includeMatches:n=m.includeMatches,includeScore:s=m.includeScore}={}){const i=[];return n&&i.push(V),s&&i.push(B),t.map((t=>{const{idx:n}=t,s={item:e[n],refIndex:n};return i.length&&i.forEach((e=>{e(t,s)})),s}))}(a,this._docs,{includeMatches:n,includeScore:s})}_searchStringList(t){const e=O(t,this.options),{records:n}=this._myIndex,s=[];return n.forEach((({v:t,i:n,n:i})=>{if(!h(t))return;const{isMatch:r,score:c,indices:o}=e.searchIn(t);r&&s.push({item:t,idx:n,matches:[{score:c,value:t,norm:i,indices:o}]})})),s}_searchLogical(t){const e=J(t,this.options),n=(t,e,s)=>{if(!t.children){const{keyId:n,searcher:i}=t,r=this._findMatches({key:this._keyStore.get(n),value:this._myIndex.getValueForItemAtKeyId(e,n),searcher:i});return r&&r.length?[{idx:s,item:e,matches:r}]:[]}const i=[];for(let r=0,c=t.children.length;r<c;r+=1){const c=t.children[r],o=n(c,e,s);if(o.length)i.push(...o);else if(t.operator===j)return[]}return i},s=this._myIndex.records,i={},r=[];return s.forEach((({$:t,i:s})=>{if(h(t)){let c=n(e,t,s);c.length&&(i[s]||(i[s]={idx:s,item:t,matches:[]},r.push(i[s])),c.forEach((({matches:t})=>{i[s].matches.push(...t)})))}})),r}_searchObjectList(t){const e=O(t,this.options),{keys:n,records:s}=this._myIndex,i=[];return s.forEach((({$:t,i:s})=>{if(!h(t))return;let r=[];n.forEach(((n,s)=>{r.push(...this._findMatches({key:n,value:t[s],searcher:e}))})),r.length&&i.push({idx:s,item:t,matches:r})})),i}_findMatches({key:t,value:e,searcher:n}){if(!h(e))return[];let i=[];if(s(e))e.forEach((({v:e,i:s,n:r})=>{if(!h(e))return;const{isMatch:c,score:o,indices:a}=n.searchIn(e);c&&i.push({score:o,key:t,value:e,idx:s,norm:r,indices:a})}));else{const{v:s,n:r}=e,{isMatch:c,score:o,indices:h}=n.searchIn(s);c&&i.push({score:o,key:t,value:s,norm:r,indices:h})}return i}}Q.version="6.6.2",Q.createIndex=x,Q.parseIndex=function(t,{getFn:e=m.getFn,fieldNormWeight:n=m.fieldNormWeight}={}){const{keys:s,records:i}=t,r=new y({getFn:e,fieldNormWeight:n});return r.setKeys(s),r.setIndexRecords(i),r},Q.config=m,Q.parseQuery=J,function(...t){R.push(...t)}(N)}}]);
- //# sourceMappingURL=19418-2f6f0f0a71d1b2b1.js.map
|