PageSourceSearch

https://public.getgreenspark.com/assets/suggestions-B6QV79vU.js

js getgreenspark.com collected 2026-09-26 05:06:15 UTC 5,602 bytes, 2 lines download raw bytes

1import"./localforage-92l_8Lt_.js";import{i as l}from"./xtend-DZjZcCaF.js";import{f as d}from"./fuzzy-B_A5LPN3.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},i=new Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="12315cc6-eaa8-4c97-9c4e-41eb8bc432cb",t._sentryDebugIdIdentifier="sentry-dbid-12315cc6-eaa8-4c97-9c4e-41eb8bc432cb")}catch{}})();var r=function(t){return this.component=t,this.items=[],this.active=0,this.wrapper=document.createElement("div"),this.wrapper.className="suggestions-wrapper",this.element=document.createElement("ul"),this.element.className="suggestions",this.wrapper.appendChild(this.element),this.selectingListItem=!1,t.el.parentNode.insertBefore(this.wrapper,t.el.nextSibling),this};r.prototype.show=function(){this.element.style.display="block"};r.prototype.hide=function(){this.element.style.display="none"};r.prototype.add=function(t){this.items.push(t)};r.prototype.clear=function(){this.items=[],this.active=0};r.prototype.isEmpty=function(){return!this.items.length};r.prototype.isVisible=function(){return this.element.style.display==="block"};r.prototype.draw=function(){if(this.element.innerHTML="",this.items.length===0){this.hide();return}for(var t=0;t<this.items.length;t++)this.drawItem(this.items[t],this.active===t);this.show()};r.prototype.drawItem=function(t,i){var e=document.createElement("li"),s=document.createElement("a");i&&(e.className+=" active"),s.innerHTML=t.string,e.appendChild(s),this.element.appendChild(e),e.addEventListener("mousedown",(function(){this.selectingListItem=!0}).bind(this)),e.addEventListener("mouseup",(function(){this.handleMouseUp.call(this,t)}).bind(this))};r.prototype.handleMouseUp=function(t){this.selectingListItem=!1,this.component.value(t.original),this.clear(),this.draw()};r.prototype.move=function(t){this.active=t,this.draw()};r.prototype.previous=function(){this.move(this.active===0?this.items.length-1:this.active-1)};r.prototype.next=function(){this.move(this.active===this.items.length-1?0:this.active+1)};r.prototype.drawError=function(t){var i=document.createElement("li");i.innerHTML=t,this.element.appendChild(i),this.show()};var u=r,p=l,c=d,f=u,n=function(t,i,e){return e=e||{},this.options=p({minLength:2,limit:5,filter:!0,hideOnBlur:!0},e),this.el=t,this.data=i||[],this.list=new f(this),this.query="",this.selected=null,this.list.draw(),this.el.addEventListener("keyup",(function(s){this.handleKeyUp(s.keyCode)}).bind(this),!1),this.el.addEventListener("keydown",(function(s){this.handleKeyDown(s)}).bind(this)),this.el.addEventListener("focus",(function(){this.handleFocus()}).bind(this)),this.el.addEventListener("blur",(function(){this.handleBlur()}).bind(this)),this.el.addEventListener("paste",(function(s){this.handlePaste(s)}).bind(this)),this.render=this.options.render?this.options.render.bind(this):this.render.bind(this),this.getItemValue=this.options.getItemValue?this.options.getItemValue.bind(this):this.getItemValue.bind(this),this};n.prototype.handleKeyUp=function(t){t===40||t===38||t===27||t===13||t===9||this.handleInputChange(this.el.value)};n.prototype.handleKeyDown=function(t){switch(t.keyCode){case 13:case 9:this.list.isEmpty()||(this.list.isVisible()&&t.preventDefault(),this.value(this.list.items[this.list.active].original),this.list.hide());break;case 27:this.list.isEmpty()||this.list.hide();break;case 38:this.list.previous();break;case 40:this.list.next();break}};n.prototype.handleBlur=function(){!this.list.selectingListItem&&this.options.hideOnBlur&&this.list.hide()};n.prototype.handlePaste=function(t){if(t.clipboardData)this.handleInputChange(t.clipboardData.getData("Text"));else{var i=this;setTimeout(function(){i.handleInputChange(t.target.value)},100)}};n.prototype.handleInputChange=function(t){if(this.query=this.normalize(t),this.list.clear(),this.query.length<this.options.minLength){this.list.draw();return}this.getCandidates((function(i){for(var e=0;e<i.length&&(this.list.add(i[e]),e!==this.options.limit-1);e++);this.list.draw()}).bind(this))};n.prototype.handleFocus=function(){this.list.isEmpty()||this.list.show(),this.list.selectingListItem=!1};n.prototype.update=function(t){this.data=t,this.handleKeyUp()};n.prototype.clear=function(){this.data=[],this.list.clear()};n.prototype.normalize=function(t){return t=t.toLowerCase(),t};n.prototype.match=function(t,i){return t.indexOf(i)>-1};n.prototype.value=function(t){if(this.selected=t,this.el.value=this.getItemV
1alue(t),document.createEvent){var i=document.createEvent("HTMLEvents");i.initEvent("change",!0,!1),this.el.dispatchEvent(i)}else this.el.fireEvent("onchange")};n.prototype.getCandidates=function(t){var i={pre:"<strong>",post:"</strong>",extract:(function(s){return this.getItemValue(s)}).bind(this)},e;this.options.filter?(e=c.filter(this.query,this.data,i),e=e.map((function(s){return{original:s.original,string:this.render(s.original,s.string)}}).bind(this))):e=this.data.map((function(s){var h=this.render(s);return{original:s,string:h}}).bind(this)),t(e)};n.prototype.getItemValue=function(t){return t};n.prototype.render=function(t,i){if(i)return i;for(var e=t.original?this.getItemValue(t.original):this.getItemValue(t),s=this.normalize(e),h=s.lastIndexOf(this.query);h>-1;){var o=h+this.query.length;e=e.slice(0,h)+"<strong>"+e.slice(h,o)+"</strong>"+e.slice(o),h=s.slice(0,h).lastIndexOf(this.query)}return e};n.prototype.renderError=function(t){this.list.drawError(t)};var g=n,a=g,b=a;typeof window<"u"&&(window.Suggestions=a);export{b as s};
2//# sourceMappingURL=suggestions-B6QV79vU.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.