1import{_ as f}from"./index.a4e8ca65.js";import{G as n,O as a,P as h}from"./vue.00f7c436.js";import"./sentry.09480738.js";class u{constructor(t,s){const l=t.length;t.forEach(i=>{Object.keys(i).forEach(r=>{r.match(/Order$/)&&(i[r]=(l-i[r])/l)})}),this.items=t,this.filtered=null,this.filterQuery=s}async query(){return this.filtered=await this.filterQuery(this.items),this.filtered||this.items}}const o={name:"TmlFilterable",props:{items:{type:Array},filterQuery:{type:Function,default:e=>new Promise(t=>t(e))}},data(){return{filtered:[],filterable:null,filtering:!1}},computed:{noResults(){return this.filtered.length===0}},watch:{items:{immediate:!0,handler(e){this.initFilterable(e)}},filterQuery:{immediate:!0,handler(e){this._filterQuery=e,this.initFilterable()}}},methods:{async filter(){this.filtering=!0;const e=await this.filterable.query();return e.length===0&&this.$emit("no-results"),this.filtered=e,this.filtering=!1,this.filtered},initFilterable(e){let t=this.items;e&&e.length&&(t=e),t&&this._filterQuery&&(this.filterable=new u(t,this._filterQuery),this.filter())}}};function c(e,t,s,l,i,r){return n(e.$slots,"default",a(h({filter:r.filter,filtering:i.filtering,filtered:i.filtered||[],noResults:r.noResults})))}const _=f(o,[["render",c]]);export{_ as default}; 2//# sourceMappingURL=TmlFilterable.e011b2b4.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.