"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function f(e){const{selectionStart:t}=e;return e.value.slice(0,t)}function g(e,t=""){return(Array.isArray(t)?t:[t]).reduce((s,r)=>{const o=e.lastIndexOf(r);return o>s.location?{location:o,prefix:r}:s},{location:-1,prefix:""})}function u(e){return(e||"").toLowerCase()}function d(e,t,i){const s=e[0];if(!s||s===i)return e;let r=e;const o=t.length;for(let n=0;n<o;n+=1)if(u(r[n])!==u(t[n])){r=r.slice(n);break}else n===o-1&&(r=r.slice(o));return r}function h(e,t){const{measureLocation:i,prefix:s,targetText:r,selectionStart:o,split:n}=t;let l=e.slice(0,i);l[l.length-n.length]===n&&(l=l.slice(0,l.length-n.length)),l&&(l=`${l}${n}`);let c=d(e.slice(o),r.slice(o-i-s.length),n);c.slice(0,n.length)===n&&(c=c.slice(n.length));const a=`${l}${s}${r}${n}`;return{text:`${a}${c}`,selectionLocation:a.length}}function x(e,t){e.setSelectionRange(t,t),e.blur(),e.focus()}function S(e,t){const{split:i}=t;return!i||!e.includes(i)}function L(e,{value:t=""}){const i=e.toLowerCase();return t.toLowerCase().includes(i)}exports.filterOption=L;exports.getBeforeSelectionText=f;exports.getLastMeasureIndex=g;exports.replaceWithMeasure=h;exports.setInputSelection=x;exports.validateSearch=S;
