var app=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function r(t){t.forEach(e)}function o(t){return"function"==typeof t}function l(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}let c,u;function s(t,e){t.appendChild(e)}function a(t,e,n){t.insertBefore(e,n||null)}function i(t){t.parentNode&&t.parentNode.removeChild(t)}function f(t){return document.createElement(t)}function d(){return t=" ",document.createTextNode(t);var t}function p(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function h(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function g(t,e){t.value=null==e?"":e}function m(t,e,n){t.classList[n?"add":"remove"](e)}function $(t){u=t}const b=[],y=[],v=[],x=[],_=Promise.resolve();let w=!1;function E(t){v.push(t)}const k=new Set;let S=0;function N(){const t=u;do{for(;S{const r=n.length?n[0]:e;return m.ctx&&f(m.ctx[t],m.ctx[t]=r)&&(!m.skip_bound&&m.bound[t]&&m.bound[t](r),b&&O(l,t)),e})):[],m.update(),b=!0,r(m.before_update),m.fragment=!!a&&a(m.ctx),c.target){if(c.hydrate){const t=function(t){return Array.from(t.childNodes)}(c.target);m.fragment&&m.fragment.l(t),t.forEach(i)}else m.fragment&&m.fragment.c();c.intro&&((y=l.$$.fragment)&&y.i&&(j.delete(y),y.i(v))),function(t,n,l,c){const{fragment:u,after_update:s}=t.$$;u&&u.m(n,l),c||E((()=>{const n=t.$$.on_mount.map(e).filter(o);t.$$.on_destroy?t.$$.on_destroy.push(...n):r(n),t.$$.on_mount=[]})),s.forEach(E)}(l,c.target,c.anchor,c.customElement),N()}var y,v;$(g)}class P{$destroy(){!function(t,e){const n=t.$$;null!==n.fragment&&(r(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(e,n){if(!o(n))return t;const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{const t=r.indexOf(n);-1!==t&&r.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function M(t,e,n){const r=t.slice();return r[12]=e[n],r[14]=n,r}function A(e){let n,r;return{c(){var t,e,o,l,u,s;n=f("img"),t=n.src,e=r=`${JSON.parse(window.BINGOPRESS_THEME.path).plugin_url}assets/img/loading.gif`,c||(c=document.createElement("a")),c.href=e,t!==c.href&&h(n,"src",r),h(n,"class","w-10 h-10 absolute right-4"),h(n,"alt","Loading..."),o=n,l="z-index",null===(u="10")?o.style.removeProperty(l):o.style.setProperty(l,u,s?"important":"")},m(t,e){a(t,n,e)},p:t,d(t){t&&i(n)}}}function C(e){let n;return{c(){n=f("div"),n.textContent="Search Not Found!",h(n,"class","w-full flex justify-between p-4 border-t border-gray-200 cursor-pointer hover:bg-gray-100 text-red-400")},m(t,e){a(t,n,e)},p:t,d(t){t&&i(n)}}}function H(t){let e,n,r=t[3],o=[];for(let e=0;e{let t=`${window.BINGOPRESS_THEME.rest_url}wp/v2/search`,e={search:r,per_page:10,page:l};t+="?"+Object.keys(e).map((t=>`${t}=${e[t]}`)).join("&"),fetch(t).then((t=>async function(t){if(n(2,c=t.headers.get("X-WP-TotalPages")),200===t.status&&r){let e=await t.text();e=JSON.parse(e).filter((t=>"fab"!==t.subtype)),n(3,a=[...a,...e])}else n(3,a=[]);n(4,s=!1),o=r}(t)))};return[r,l,c,a,s,i,()=>{clearTimeout(u),u=setTimeout((()=>{r!=o&&(n(4,s=!0),n(3,a=[]),n(1,l=1),i())}),500)},function(){r=this.value,n(0,r)},()=>{n(1,l+=1),i()}]}return app=new class extends P{constructor(t){super(),L(this,t,J,q,l,{})}}({target:document.querySelector("#bingopress-search-dom")})}();