"use strict";!function(e){function t(e,t=!1){var i=w.find(".sb-info-card");t?"error"==t?i.addClass("sb-info-card-error"):i.addClass("sb-info-card-info"):(i.removeClass("sb-info-card-error sb-info-card-warning sb-info-card-info"),clearTimeout(Z),Z=setTimeout(()=>{i.sbActive(!1)},5e3)),i.html(`
${e.data.text}
`;break;case"image":t+=`${e.data.caption}`;break;case"list":t+='${e.data.code}
`;break;case"raw":t+=`${e}`,"info",!1,t,i)}function y(){SBF.ajax({function:"get-conversations"},e=>{e.length||B.find(".sb-board").addClass("sb-no-conversation"),Ee.populateList(e),ge&&B.find(".sb-admin-list").sbActive(!0),SBF.getURL("conversation")?(B.sbActive()||x.find(".sb-admin-nav #sb-conversations").click(),Ee.openConversation(SBF.getURL("conversation"))):ge||SBF.getURL("user")||SBF.getURL("setting")||SBF.getURL("report")||SBF.getURL("area")&&"conversations"!=SBF.getURL("area")||Ee.clickFirst(),Ee.startRealTime(),Ee.datetime_last_conversation=SB_ADMIN_SETTINGS.now_db,a(!1)}),SBPusher.initServiceWorker(),SB_ADMIN_SETTINGS.push_notifications&&SBPusher.initPushNotifications(),setInterval(function(){SBF.ajax({function:"get-active-user",db:!0},e=>{e||SBF.reset()})},36e5)}var w,x,B,k,A,T,C,$,F,I,L,E,N,M,R,D,j,U,G,P,O,H,V,q,W,z,J,X,Y,Z,K,Q,ee,te,ie,se,ae,ne=[],oe=!1,re=!1,le=!1,ce=!1,de=1,ue=1,pe={},he=1,fe=1,ge=e(window).width()<465,be={last:0,header:!0,always_hidden:!1},me="localhost"===location.hostname||"127.0.0.1"===location.hostname,ve=new Date,Se=!1,_e=!0,ye=!1,we="undefined",xe=!1,Be=!1,ke=!1,Ae=!1,Te=!1,Ce=!1;e.fn.miniTip=function(t){var i=e.extend({title:"",content:!1,delay:300,anchor:"n",event:"hover",fadeIn:200,fadeOut:200,aHide:!0,maxW:"250px",offset:5,stemOff:0,doHide:!1},t);0==w.find("#miniTip").length&&w.append('
"+t+""+o("Only {R} sources left to complete.").replace("{R}",i.length+1)+""),t.includes(".xml")?(this.active_source=t,SBF.ajax({function:"get-sitemap-urls",sitemap_url:t},e=>Array.isArray(e)?(this.base_url=e[0],this.start(i.concat(e))):(console.error(e),this.start(i)))):t.includes(".pdf")||t.includes(".txt")?(this.active_source=t,SBF.ajax({function:"open-ai-source-file-to-paragraphs",url:t},e=>Array.isArray(e)?e.length?void this.embeddings(e,e=>{if(e)return this.start(i)}):this.start(i):(console.error(e),this.start(i)))):this.start_urls.includes(t)&&!this.sitemap_processed_urls.includes(t)?(this.active_source=t,this.sitemap_processed_urls.push(t),this.sitemap([t],e=>this.start(i.concat(e)))):this.getHTML(t,s=>{if(!s[0].length)return this.start(i);{let o=s[0],r=[];o.find("ul").each(function(){let t="";e(this).find("li").each(function(){e(this).find("ul").remove();let i=e(this).text().trim();i.split(" ").length>1&&i.length>10&&(t+="###B###"+(e(this).index()+1)+". "+e(this).text().trim())}),e(this).html(t)}),o.find("p").each(function(){e(this).append("###B###")}),o.find("span,label").each(function(){e(this).append(" ")}),o.find("a").each(function(){let t=e(this).attr("href");t&&e(this).html(t.includes("http")?t:m(t,$e.openAI.crawler.base_url))}),o.find("h1,h2").each(function(){e(this).prepend("--------------------------------------------------------------------------------")}),o.find("h1,h2,h3,h4,h5,h6").each(function(){e(this).prepend("###P###")}),o.find("nav, ul").each(function(){let t=e(this)[0].textContent;$e.openAI.crawler.history.includes(t)?e(this).html(""):$e.openAI.crawler.history.push(t)});let l=o[0].textContent.split("###P###"),c=[];for(a=0;a