PageSourceSearch

https://www.imotriz.com/assets/142432d2/js/FieldBootstrapSearch.a458dc02.js

js imotriz.com collected 2026-09-30 11:36:21 UTC 22,456 bytes, 2 lines download raw bytes

vendor: 16,260 bytes, lines 1-2
1(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".v-select{width:100%}.vue-form-generator .field-wrap button,.vue-form-generator .field-wrap input[type=submit]{padding:0 3px;border:unset}.vue-form-generator .field-wrap button:hover,.vue-form-generator .field-wrap input[type=submit]:hover{background-color:unset}.vs__search{font-size:14px!important}.vue-form-generator .field-wrap button:not(:last-child){padding:0 5px;border:none;margin-bottom:2px}.vs__dropdown-toggle{min-height:35px;font-size:16px}.bootstrap-search-has-icon .bootstrap-search-icon{position:absolute;left:10px;top:50%;transform:translateY(-50%);z-index:2;pointer-events:none}.bootstrap-search-has-icon .vs__dropdown-toggle{padding-left:20px}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2import{v as ue}from"./vfg.eba3391d.js";import{n as fe}from"./vueComponentNormalizer.2bbd088e.js";import{c as de}from"./popper.f3391c26.js";import"./_.37d3602c.js";function x(e){return Array.isArray?Array.isArray(e):ne(e)==="[object Array]"}const pe=1/0;function me(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-pe?"-0":t}function ge(e){return e==null?"":me(e)}function I(e){return typeof e=="string"}function te(e){return typeof e=="number"}function _e(e){return e===!0||e===!1||Se(e)&&ne(e)=="[object Boolean]"}function se(e){return typeof e=="object"}function Se(e){return se(e)&&e!==null}function g(e){return e!=null}function j(e){return!e.trim().length}function ne(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Me="Incorrect 'index' type",ye=e=>`Invalid value for key ${e}`,Ie=e=>`Pattern length exceeds max of ${e}.`,Ee=e=>`Missing ${e} property in key`,xe=e=>`Property 'weight' in key '${e}' must be a positive integer`,U=Object.prototype.hasOwnProperty;class ve{constructor(t){this._keys=[],this._keyMap={};let s=0;t.forEach(n=>{let r=re(n);s+=r.weight,this._keys.push(r),this._keyMap[r.id]=r,s+=r.weight}),this._keys.forEach(n=>{n.weight/=s})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function re(e){let t=null,s=null,n=null,r=1,i=null;if(I(e)||x(e))n=e,t=X(e),s=B(e);else{if(!U.call(e,"name"))throw new Error(Ee("name"));const c=e.name;if(n=c,U.call(e,"weight")&&(r=e.weight,r<=0))throw new Error(xe(c));t=X(c),s=B(c),i=e.getFn}return{path:t,id:s,weight:r,src:n,getFn:i}}function X(e){return x(e)?e:e.split(".")}function B(e){return x(e)?e.join("."):e}function we(e,t){let s=[],n=!1;const r=(i,c,o)=>{if(g(i))if(!c[o])s.push(i);else{let a=c[o];const h=i[a];if(!g(h))return;if(o===c.length-1&&(I(h)||te(h)||_e(h)))s.push(ge(h));else if(x(h)){n=!0;for(let l=0,f=h.length;l<f;l+=1)r(h[l],c,o+1)}else c.length&&r(h,c,o+1)}};return r(e,I(t)?t.split("."):t,0),n?s:s[0]}const Oe={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},be={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},Ae={location:0,threshold:.6,distance:100},Re={useExtendedSearch:!1,getFn:we,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var u={...be,...Oe,...Ae,...Re};const Le=/[^ ]+/g;function Ce(e=1,t=3){const s=new Map,n=Math.pow(10,t);return{get(r){const i=r.match(Le).length;if(s.has(i))return s.get(i);const c=1/Math.pow(i,.5*e),o=parseFloat(Math.round(c*n)/n);return s.set(i,o),o},clear(){s.clear()}}}class Y{constructor({getFn:t=u.getFn,fieldNormWeight:s=u.fieldNormWeight}={}){this.norm=Ce(s,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((s,n)=>{this._keysMap[s.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,I(this.docs[0])?this.docs.forEach((t,s)=>{this._addString(t,s)}):this.docs.forEach((t,s)=>{this._addObject(t,s)}),this.norm.clear())}add(t){const s=this.size();I(t)?this._addString(t,s):this._addObject(t,s)}removeAt(t){this.records.splice(t,1);for(let s=t,n=this.size();s<n;s+=1)this.records[s].i-=1}getValueForItemAtKeyId(t,s){return t[this._keysMap[s]]}size(){return this.records.length}_addString(t,s){if(!g(t)||j(t))return;let n={v:t,i:s,n:this.norm.get(t)};this.records.push(n)}_addObject(t,s){let n={i:s,$:{}};this.keys.forEach((r,i)=>{let c=r.getFn?r.getFn(t):this.getFn(t,r.path);if(g(c)){if(x(c)){let o=[];const a=[{nestedArrIndex:-1,value:c}];for(;a.length;){const{nestedArrIndex:h,value:l}=a.pop();if(g(l))if(I(l)&&!j(l)){let f={v:l,i:h,n:this.norm.get(l)};o.push(f)}else x(l)&&l.forEach((f,d)=>{a.push({nestedArrIndex:d,value:f})})}n.$[i]=o}else if(I(c)&&!j(c)){let o={v:c,n:this.norm.get(c)};n.$[i]=o}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function ie(e,t,{getFn:s=u.getFn,fieldNormWeight:n=u.fieldNormWeight}={}){const r=new Y({getFn:s,fieldNormWeight:n});return r.setKeys(e.map(re)),r.setSources(t),r.create(),r}function ke(e,{getFn:t=u.getFn,fieldNormWeight:s=u.fieldNormWeight}={}){const{keys:n,records:r}=e,i=new Y({getFn:t,fieldNormWeight:s});return i.setKeys(n),i.setIndexRecords(r),i}function $(e,{errors:t=0,currentLocation:s=0,expectedLocation:n=0,distance:r=u.distance,ignoreLocation:i=u.ignoreLocation}={}){const c=t/e.length;if(i)return c;const o=Math.abs(n-s);return r?c+o/r:o?1:c}function Fe(e=[],t=u.minMatchCharLength){let s=[],n=-1,r=-1,i=0;for(let c=e.length;i<c;i+=1){let o=e[i];o&&n===-1?n=i:!o&&n!==-1&&(r=i-1,r-n+1>=t&&s.push([n,r]),n=-1)}return e[i-1]&&i-n>=t&&s.push([n,i-1]),s}const R=32;function Ne(e,t,s,{location:n=u.location,distance:r=u.distance,threshold:i=u.threshold,findAllMatches:c=u.findAllMatches,minMatchCharLength:o=u.minMatchCharLength,includeMatches:a=u.includeMatches,ignoreLocation:h=u.ignoreLocation}={}){if(t.length>R)throw new Error(Ie(R));const l=t.length,f=e.length,d=Math.max(0,Math.min(n,f));let p=i,m=d;const S=o>1||a,b=S?Array(f):[];let E;for(;(E=e.indexOf(t,m))>-1;){let M=$(t,{currentLocation:E,expectedLocation:d,distance:r,ignoreLocation:h});if(p=Math.min(M,p),m=E+l,S){let v=0;for(;v<l;)b[E+v]=1,v+=1}}m=-1;let L=[],A=1,F=l+f;const le=1<<l-1;for(let M=0;M<l;M+=1){let v=0,w=F;for(;v<w;)$(t,{errors:M,currentLocation:d+w,expectedLocation:d,distance:r,ignoreLocation:h})<=p?v=w:F=w,w=Math.floor((F-v)/2+v);F=w;let G=Math.max(1,d-w+1),D=c?f:Math.min(d+w,f)+l,C=Array(D+2);C[D+1]=(1<<M)-1;for(let y=D;y>=G;y-=1){let N=y-1,Q=s[e.charAt(N)];if(S&&(b[N]=+!!Q),C[y]=(C[y+1]<<1|1)&Q,M&&(C[y]|=(L[y+1]|L[y])<<1|1|L[y+1]),C[y]&le&&(A=$(t,{errors:M,currentLocation:N,expectedLocation:d,distance:r,ignoreLocation:h}),A<=p)){if(p=A,m=N,m<=d)break;G=Math.max(1,2*d-m)}}if($(t,{errors:M+1,currentLocation:d,expectedLocation:d,distance:r,ignoreLocation:h})>p)break;L=C}const P={isMatch:m>=0,score:Math.max(.001,A)};if(S){const M=Fe(b,o);M.length?a&&(P.indices=M):P.isMatch=!1}return P}function $e(e){let t={};for(let s=0,n=e.length;s<n;s+=1){const r=e.charAt(s);t[r]=(t[r]||0)|1<<n-s-1}return t}class ce{constructor(t,{location:s=u.location,threshold:n=u.threshold,distance:r=u.distance,includeMatches:i=u.includeMatches,findAllMatches:c=u.findAllMatches,minMatchCharLength:o=u.minMatchCharLength,isCaseSensitive:a=u.isCaseSensitive,ignoreLocation:h=u.ignoreLocation}={}){if(this.options={location:s,threshold:n,distance:r,includeMatches:i,findAllMatches:c,minMatchCharLength:o,isCaseSensitive:a,ignoreLocation:h},this.pattern=a?t:t.toLowerCase(),this.chunks=[],!this.pattern.length)return;const l=(d,p)=>{this.chunks.push({pattern:d,alphabet:$e(d),startIndex:p})},f=this.pattern.length;if(f>R){let d=0;const p=f%R,m=f-p;for(;d<m;)l(this.pattern.substr(d,R),d),d+=R;if(p){const S=f-R;l(this.pattern.substr(S),S)}}else l(this.pattern,0)}searchIn(t){const{isCaseSensitive:s,includeMatches:n}=this.options;if(s||(t=t.toLowerCase()),this.pattern===t){let m={isMatch:!0,score:0};return n&&(m.indices=[[0,t.length-1]]),m}const{location:r,distance:i,threshold:c,findAllMatches:o,minMatchCharLength:a,ignoreLocation:h}=this.options;let l=[],f=0,d=!1;this.chunks.forEach(({pattern:m,alphabet:S,startIndex:b})=>{const{isMatch:E,score:L,indices:A}=Ne(t,m,S,{location:r+b,distance:i,threshold:c,findAllMatches:o,minMatchCharLength:a,includeMatches:n,ignoreLocation:h});E&&(d=!0),f+=L,E&&A&&(l=[...l,...A])});let p={isMatch:d,score:d?f/this.chunks.length:1};return d&&n&&(p.indices=l),p}}class O{constructor(t){this.pattern=t}static isMultiMatch(t){return J(t,this.multiRegex)}static isSingleMatch(t){return J(t,this.singleRegex)}search(){}}function J(e,t){const s=e.match(t);return s?s[1]:null}class Te extends O{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const s=t===this.pattern;return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}}class Pe extends O{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const n=t.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class De extends O{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const s=t.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}}class je extends O{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const s=!t.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}}class Be extends O{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const s=t.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class Ve extends O{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const s=!t.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}}class oe extends O{constructor(t,{location:s=u.location,threshold:n=u.threshold,distance:r=u.distance,includeMatches:i=u.includeMatches,findAllMatches:c=u.findAllMatches,minMatchCharLength:o=u.minMatchCharLength,isCaseSensitive:a=u.isCaseSensitive,ignoreLocation:h=u.ignoreLocation}={}){super(t),this._bitapSearch=new ce(t,{location:s,threshold:n,distance:r,includeMatches:i,findAllMatches:c,minMatchCharLength:o,isCaseSensitive:a,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class ae extends O{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let s=0,n;const r=[],i=this.pattern.length;for(;(n=t.indexOf(this.pattern,s))>-1;)s=n+i,r.push([n,s-1]);const c=!!r.length;return{isMatch:c,score:c?0:1,indices:r}}}const V=[Te,ae,De,je,Ve,Be,Pe,oe],Z=V.length,Ke=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,We="|";function ze(e,t={}){return e.split(We).map(s=>{let n=s.trim().split(Ke).filter(i=>i&&!!i.trim()),r=[];for(let i=0,c=n.length;i<c;i+=1){const o=n[i];let a=!1,h=-1;for(;!a&&++h<Z;){const l=V[h];let f=l.isMultiMatch(o);f&&(r.push(new l(f,t)),a=!0)}if(!a)for(h=-1;++h<Z;){const l=V[h];let f=l.isSingleMatch(o);if(f){r.push(new l(f,t));break}}}return r})}const He=new Set([oe.type,ae.type]);class Ye{constructor(t,{isCaseSensitive:s=u.isCaseSensitive,includeMatches:n=u.includeMatches,minMatchCharLength:r=u.minMatchCharLength,ignoreLocation:i=u.ignoreLocation,findAllMatches:c=u.findAllMatches,location:o=u.location,threshold:a=u.threshold,distance:h=u.distance}={}){this.query=null,this.options={isCaseSensitive:s,includeMatches:n,minMatchCharLength:r,findAllMatches:c,ignoreLocation:i,location:o,threshold:a,distance:h},this.pattern=s?t:t.toLowerCase(),this.query=ze(this.pattern,this.options)}static condition(t,s){return s.useExtendedSearch}searchIn(t){const s=this.query;if(!s)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:r}=this.options;t=r?t:t.toLowerCase();let i=0,c=[],o=0;for(let a=0,h=s.length;a<h;a+=1){const l=s[a];c.length=0,i=0;for(let f=0,d=l.length;f<d;f+=1){const p=l[f],{isMatch:m,indices:S,score:b}=p.search(t);if(m){if(i+=1,o+=b,n){const E=p.constructor.type;He.has(E)?c=[...c,...S]:c.push(S)}}else{o=0,i=0,c.length=0;break}}if(i){let f={isMatch:!0,score:o/i};return n&&(f.indices=c),f}}return{isMatch:!1,score:1}}}const K=[];function Ge(...e){K.push(...e)}function W(e,t){for(let s=0,n=K.length;s<n;s+=1){let r=K[s];if(r.condition(e,t))return new r(e,t)}return new ce(e,t)}const T={AND:"$and",OR:"$or"},z={PATH:"$path",PATTERN:"$val"},H=e=>!!(e[T.AND]||e[T.OR]),Qe=e=>!!e[z.PATH],Ue=e=>!x(e)&&se(e)&&!H(e),q=e=>({[T.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function he(e,t,{auto:s=!0}={}){const n=r=>{let i=Object.keys(r);const c=Qe(r);if(!c&&i.length>1&&!H(r))return n(q(r));if(Ue(r)){const a=c?r[z.PATH]:i[0],h=c?r[z.PATTERN]:r[a];if(!I(h))throw new Error(ye(a));const l={keyId:B(a),pattern:h};return s&&(l.searcher=W(h,t)),l}let o={children:[],operator:i[0]};return i.forEach(a=>{const h=r[a];x(h)&&h.forEach(l=>{o.children.push(n(l))})}),o};return H(e)||(e=q(e)),n(e)}function Xe(e,{ignoreFieldNorm:t=u.ignoreFieldNorm}){e.forEach(s=>{let n=1;s.matches.forEach(({key:r,norm:i,score:c})=>{const o=r?r.weight:null;n*=Math.pow(c===0&&o?Number.EPSILON:c,(o||1)*(t?1:i))}),s.score=n})}function Je(e,t){const s=e.matches;t.matches=[],g(s)&&s.forEach(n=>{if(!g(n.indices)||!n.indices.length)return;const{indices:r,value:i}=n;let c={indices:r,value:i};n.key&&(c.key=n.key.src),n.idx>-1&&(c.refIndex=n.idx),t.matches.push(c)})}function Ze(e,t){t.score=e.score}function qe(e,t,{includeMatches:s=u.includeMatches,includeScore:n=u.includeScore}={}){const r=[];return s&&r.push(Je),n&&r.push(Ze),e.map(i=>{const{idx:c}=i,o={item:t[c],refIndex:c};return r.length&&r.forEach(a=>{a(i,o)}),o})}class k{constructor(t,s={},n){this.options={...u,...s},this.options.useExtendedSearch,this._keyStore=new ve(this.options.keys),this.setCollection(t,n)}setCollection(t,s){if(this._docs=t,s&&!(s instanceof Y))throw new Error(Me);this._myIndex=s||ie(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){g(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const s=[];for(let n=0,r=this._docs.length;n<r;n+=1){const i=this._docs[n];t(i,n)&&(this.removeAt(n),n-=1,r-=1,s.push(i))}return s}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:s=-1}={}){const{includeMatches:n,includeScore:r,shouldSort:i,sortFn:c,ignoreFieldNorm:o}=this.options;let a=I(t)?I(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return Xe(a,{ignoreFieldNorm:o}),i&&a.sort(c),te(s)&&s>-1&&(a=a.slice(0,s)),qe(a,this._docs,{includeMatches:n,includeScore:r})}_searchStringList(t){const s=W(t,this.options),{records:n}=this._myIndex,r=[];return n.forEach(({v:i,i:c,n:o})=>{if(!g(i))return;const{isMatch:a,score:h,indices:l}=s.searchIn(i);a&&r.push({item:i,idx:c,matches:[{score:h,value:i,norm:o,indices:l}]})}),r}_searchLogical(t){const s=he(t,this.options),n=(o,a,h)=>{if(!o.children){const{keyId:f,searcher:d}=o,p=this._findMatches({key:this._keyStore.get(f),value:this._myIndex.getValueForItemAtKeyId(a,f),searcher:d});return p&&p.length?[{idx:h,item:a,matches:p}]:[]}const l=[];for(let f=0,d=o.children.length;f<d;f+=1){const p=o.children[f],m=n(p,a,h);if(m.length)l.push(...m);else if(o.operator===T.AND)return[]}return l},r=this._myIndex.records,i={},c=[];return r.forEach(({$:o,i:a})=>{if(g(o)){let h=n(s,o,a);h.length&&(i[a]||(i[a]={idx:a,item:o,matches:[]},c.push(i[a])),h.forEach(({matches:l})=>{i[a].matches.push(...l)}))}}),c}_searchObjectList(t){const s=W(t,this.options),{keys:n,records:r}=this._myIndex,i=[];return r.forEach(({$:c,i:o})=>{if(!g(c))return;let a=[];
2n.forEach((h,l)=>{a.push(...this._findMatches({key:h,value:c[l],searcher:s}))}),a.length&&i.push({idx:o,item:c,matches:a})}),i}_findMatches({key:t,value:s,searcher:n}){if(!g(s))return[];let r=[];if(x(s))s.forEach(({v:i,i:c,n:o})=>{if(!g(i))return;const{isMatch:a,score:h,indices:l}=n.searchIn(i);a&&r.push({score:h,key:t,value:i,idx:c,norm:o,indices:l})});else{const{v:i,n:c}=s,{isMatch:o,score:a,indices:h}=n.searchIn(i);o&&r.push({score:a,key:t,value:i,norm:c,indices:h})}return r}}k.version="6.6.2";k.createIndex=ie;k.parseIndex=ke;k.config=u;k.parseQuery=he;Ge(Ye);var et=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("section",{staticClass:"w-100"},[s("div",{class:{"bootstrap-search-has-icon position-relative":e.schema.icon}},[e.schema.icon?s("i",{staticClass:"bootstrap-search-icon",class:e.schema.icon,attrs:{"aria-hidden":"true"}}):e._e(),s("v-select",{class:e.schema.fieldClasses,attrs:{id:e.getFieldID(e.schema),filter:e.fuseSearch,disabled:e.disabled,name:e.schema.inputName,placeholder:e.schema.placeholder,required:e.schema.required,options:e.schema.hideSelected?e.hideSelected:e.SelectOptions,label:e.schema.showValue,multiple:e.multiple,"close-on-select":e.closeOnSelect,clearSearchOnBlur:function(){return!1},nameFunctionInService:e.schema.nameFunctionInService,appendToBody:!!e.schema.appendToBody,"calculate-position":e.schema.appendToBody?e.calculatePosition:void 0},on:{search:e.querySearch},scopedSlots:e._u([{key:"no-options",fn:function(n){var r=n.search;return[r?s("span",[e._v("No hay resultados, por favor intenta con otro valor.")]):s("span",[e._v("Ingresa un valor para buscar")])]}}]),model:{value:e.selected,callback:function(n){e.selected=n},expression:"selected"}})],1),e.schema.addButton&&(!Object.hasOwn(e.schema.addButton,"visible")||e.schema.addButton.visible)?s("div",e._b({on:{click:e.buttonClickHandler}},"div",e.schema.addButton.htmlAttributes,!1),[e._v(" "+e._s(e.schema.addButton.name)+" ")]):e._e(),e.schema.dinamicComponentSlot?s("div",[s(e.schema.dinamicComponentSlot,e._b({tag:"component"},"component",e.schema.dynamicProps,!1))],1):e._e()])},tt=[];const st={mixins:[ue.abstractField],data(){return{SelectOptions:[],multiple:!1,closeOnSelect:!0,nameFunctionInService:"searchByTerm",selected:null,refreshSelected:!0,currentValue:null}},methods:{async querySearch(e,t){if(this.schema.min&&e.length<this.schema.min){this.SelectOptions=[];return}this.schema.multiple&&(this.multiple=!0,this.closeOnSelect=!1);let s=e;this.schema.filterColumn&&(s={},s[this.schema.filterColumn]=e);let n=[];if(this.schema.options)n=this.schema.options;else if(t){if(this.schema.preloadAll&&this.schema.noMoreSearchingAfterFirstLoad)return;t(!0),this.search(t,s,this.schema.filter,this)}else{const r=await this.schema.service[this.nameFunctionInService](s,this.schema.filter,this.schema.scopes,this.schema.getters,this.schema.perPage);n=r.data.data,this.schema.emitSearchCountFunction&&this.schema.emitSearchCountFunction(r.data.metadata.count,n)}this.schema.ignoreOptions&&n&&(n=this.excludeOptions(n)),this.schema.deleteDuplicates&&n&&(n=this.filterDuplicates(n)),this.schema.sortResults&&(n=this.sortData(n,this.schema.sortResults.property,this.schema.sortResults.order)),this.SelectOptions=n},search:_.debounce((e,t,s,n)=>{n.schema.service[n.nameFunctionInService](t,s,n.schema.scopes,n.schema.getters,n.schema.perPage).then(r=>{let i=r.data.data;n.schema.ignoreOptions&&i&&(i=n.excludeOptions(i)),n.schema.deleteDuplicates&&i&&(i=n.filterDuplicates(i)),n.schema.sortResults&&(i=n.sortData(i,n.schema.sortResults.property,n.schema.sortResults.order)),n.SelectOptions=i,e(!1)})},350),fuseSearch(e,t){const s=new k(e,{keys:this.schema.fuseSearchColumns||[this.schema.showValue]});return t.length?s.search(t).map(({item:n})=>n):s.list},buttonClickHandler(){const e=this.schema.addButton;if(e.onclick)return e.onclick.call(this,this.model,this.schema,this)},filterDuplicates(e){let t=[],s=[];return e.forEach(r=>{s.push(r[this.schema.showValue])}
2),[...new Set(s)].forEach(r=>{let i=new Object;i[this.schema.showValue]=r,t.push(i)}),t},sortData(e,t,s=1){return e.sort((n,r)=>{const i=n[t].toLowerCase(),c=r[t].toLowerCase();return i<c?s==1?-1:1:i>c?s==1?1:-1:0}),e},excludeOptions(e){let t=[];return e.forEach(s=>{this.schema.ignoreOptions.values.includes(s[this.schema.ignoreOptions.key])||t.push(s)}),t},calculatePosition(e,t,{width:s}){e.style.width=s,e.style.zIndex="1060";const n=de(t.$refs.toggle,e,{placement:"bottom",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,-1]}},{name:"toggleClass",enabled:!0,phase:"write",fn({state:r}){t.$el.classList.toggle("drop-up",r.placement==="top")}}]});return()=>n.destroy()}},created(){this.schema.nameFunctionInService&&(this.nameFunctionInService=this.schema.nameFunctionInService),this.value&&(this.currentValue=_.cloneDeep(this.value),this.selected=_.cloneDeep(this.value)),this.schema.preloadAll&&this.querySearch("")},watch:{async selected(e){if(e&&this.schema.showAlert){const t=await this.schema.alert(e,this);t&&(this.selected=t)}if(!isNaN(e)&&e!==null&&Object.entries(e).length==0){if(this.schema.filterColumn)return;if("getOne"in this.schema.service){const t=await this.schema.service.getOne(e);this.selected=t.data.data}}this.refreshSelected=!1,e&&this.schema.selectValue?(this.value=e[this.schema.selectValue],this.schema.selectDataInProperty&&(this.model[this.schema.selectDataInProperty]=e)):this.value=e},async value(e){this.refreshSelected&&(this.selected=e),this.refreshSelected=!0},"schema.reloadInfo"(){this.querySearch("")},"schema.options"(e){this.SelectOptions=e},"schema.preloadAll"(e){e&&!this.SelectOptions.length&&this.querySearch("")},"schema.addOptions"(e){e.forEach(t=>{let s=this.SelectOptions.findIndex(n=>n.id==t.id);s===-1?this.SelectOptions.unshift(t):this.$set(this.SelectOptions,s,t)})}},computed:{hideSelected(){let e=[];return this.SelectOptions.forEach(t=>{var n;let s=(n=this.value)==null?void 0:n.filter(r=>r[this.schema.showValue]==t[this.schema.showValue]);s!=null&&s.length||e.push(t)}),e}}},ee={};var nt=fe(st,et,tt,!1,rt,null,null,null);function rt(e){for(let t in ee)this[t]=ee[t]}const lt=function(){return nt.exports}();export{lt as default};

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.