DmitrMakeev commited on
Commit
c55366d
·
verified ·
1 Parent(s): e9f809d

Create bundle.3ea86973b4b6c8f6c2bf.js

Browse files
Files changed (1) hide show
  1. bundle.3ea86973b4b6c8f6c2bf.js +1 -0
bundle.3ea86973b4b6c8f6c2bf.js ADDED
@@ -0,0 +1 @@
 
 
1
+ !function(e){var t={};function o(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,o),a.l=!0,a.exports}o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)o.d(n,a,function(t){return e[t]}.bind(null,a));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t){var o,n;vkBridge.send("VKWebAppInit");var a=l("sky");function l(e){var t=String(document.location.href).split("?");if(t[1]){var o=t[1].split("&");for(i=0;i<o.length;i++){var n=o[i].split("=");if(n[0]==e&&n[1])return n[1]}}return""}var s=l("keys");function l(e){var t=String(document.location.href).split("?");if(t[1]){var o=t[1].split("&");for(i=0;i<o.length;i++){var n=o[i].split("=");if(n[0]==e&&n[1])return n[1]}}return""}vkBridge.send("VKWebAppGetUserInfo").then(e=>{console.log(e.id),console.log(e.first_name),console.log(e.last_name),console.log(e),o=e.id,e.id,n=e.photo_100,location.hash,console.log(location.hash),console.log(n),fetch("https://skyauto.me/cllbck/"+a+"?api=1&uid="+s+"&sid_man="+o).then((function(e){return e.json()})).then((function(e){console.log(e);var t=e.status;(console.log("Статус:",t),0===t)&&(document.getElementById("focusis").style.display="none")})).catch((function(e){console.log(e)})),console.log(code_hash)}).catch(e=>{});document.querySelector("#darkModeToggle").addEventListener("change",(function(e){e.target.checked?(document.body.classList.add("dark-mode"),document.nav.classList.remove("bg-skyblue")):document.body.classList.remove("dark-mode")})),document.querySelector("#submit2").onclick=function(){document.getElementById("chatbox").innerHTML="",document.getElementById("userInput").value=""};const c=new URL(window.location.href).searchParams.get("key"),r=$("#apiKey");function d(e){localStorage.setItem("apiKey",e)}var u;c?(r.val(c),d(c)):function(){const e=localStorage.getItem("apiKey");e&&r.val(e)}(),r.on("input",()=>{d(r.val())}),r.attr("type","password"),userInput.on("keydown",e=>{if(13!==e.keyCode||e.ctrlKey||e.shiftKey){if(13===e.keyCode&&(e.ctrlKey||e.shiftKey)){e.preventDefault();const t=userInput.prop("selectionStart"),o=userInput.val();userInput.val(o.slice(0,t)+"\n"+o.slice(t)),userInput.prop("selectionStart",t+1),userInput.prop("selectionEnd",t+1)}}else e.preventDefault(),sendButton.click()});const m=document.querySelector("#languageSelect"),g=()=>{localStorage.setItem("language",m.value),u=m.value,console.log(u)};(()=>{const e=localStorage.getItem("language");e&&(m.value=e,u=e,console.log(u))})(),g(),m.addEventListener("change",()=>{g()});const p=document.querySelector("#formControlTemp"),y=document.querySelector("#rangeTemp"),f=document.querySelector("#formControlTop_P"),v=document.querySelector("#rangeTop_P"),h=()=>{localStorage.setItem("rangeValue",p.value),localStorage.setItem("rangeValue2",f.value)};(()=>{const e=localStorage.getItem("rangeValue"),t=localStorage.getItem("rangeValue2");e&&(p.value=e,y.textContent=e),t&&(f.value=t,v.textContent=t)})(),p.addEventListener("input",()=>{y.textContent=p.value,h()}),f.addEventListener("input",()=>{v.textContent=f.value,h()});const I=document.querySelector("#stopWordInput"),b=document.querySelector("#stopWordValue"),E=localStorage.getItem("stopWord");if(E)I.value=E,b.textContent=E;else{const e=I.value;b.textContent=e}I.addEventListener("input",()=>{const e=I.value;b.textContent=e,localStorage.setItem("stopWord",e)});const S=document.querySelector("#maxTokensInput"),k=document.querySelector("#maxTokensValue"),x=localStorage.getItem("maxTokens");x?(S.value=x,k.textContent=x):k.textContent=S.value,S.addEventListener("input",()=>{k.textContent=S.value,localStorage.setItem("maxTokens",S.value)}),document.getElementById("openModal_sd").addEventListener("click",(function(){document.getElementById("myModal_sd").style.display="block"}));var C=document.getElementById("myModal_sd"),B=document.getElementsByClassName("close_sd")[0];window.onclick=function(e){e.target!=C&&e.target!=B||(C.style.display="none")},document.getElementById("privacyLink_sd").addEventListener("click",(function(){document.getElementById("privacyModal_sd").style.display="block"})),document.getElementById("dataProcessingLink_sd").addEventListener("click",(function(){document.getElementById("dataProcessingModal_sd").style.display="block"})),document.getElementById("openAiLink_sd").addEventListener("click",(function(){document.getElementById("openAiModal_sd").style.display="block"}));var L=document.getElementById("privacyModal_sd"),_=document.getElementById("dataProcessingModal_sd"),T=document.getElementById("openAiModal_sd"),w=document.getElementById("closePrivacy_sd"),A=document.getElementById("closeDataProcessing_sd"),F=document.getElementById("closeOpenAi_sd");window.onclick=function(e){e.target!=L&&e.target!=w||(L.style.display="none"),e.target!=_&&e.target!=A||(_.style.display="none"),e.target!=T&&e.target!=F||(T.style.display="none")},document.getElementById("myForm_sd").addEventListener("submit",(function(e){var t=document.getElementById("privacyCheckbox_sd").checked,o=document.getElementById("dataProcessingCheckbox_sd").checked,n=document.getElementById("openAiCheckbox_sd").checked;t&&o&&n||(e.preventDefault(),alert("Пожалуйста, ознакомьтесь со всеми политиками перед отправкой формы."))})),document.querySelectorAll(".close_sd").forEach((function(e){e.addEventListener("click",(function(){e.closest(".modal_sd").style.display="none"}))}));var P=document.getElementById("butSet"),O=0,M=0;P.addEventListener("click",(function(e){e.preventDefault();var t=document.getElementById("name_sd").value,o=document.getElementById("email_sd").value,n=document.getElementById("phone_sd").value,a=document.querySelector('input[name="product_sd"]:checked');a&&a.value;/^([А-Я]{1}[а-яё]{1,23}|[A-Z]{1}[a-z]{1,23})$/.test(t)?console.log("Имя соответствует"):(Toastify({text:"ОШИБКА ВВОДА ДАННЫХ \n Пожалуйста, проверьте правильность заполнения \n Имени!",duration:3e3,close:!0,gravity:"top",position:"center",backgroundColor:"linear-gradient(to right, #FF0000, #FFA500)",stopOnFocus:!0,className:"error-toast",textAlign:"center"}).showToast(),O=1,console.log("Имя не соответствует требованиям")),/^(([^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*)|(".+"))@(([^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{2,})$/iu.test(o)?console.log("Email соответствует"):(Toastify({text:"ОШИБКА ВВОДА ДАННЫХ \n Пожалуйста, проверьте правильность заполнения \n Email!",duration:3e3,close:!0,gravity:"top",position:"center",backgroundColor:"linear-gradient(to right, #FF0000, #FFA500)",stopOnFocus:!0,className:"error-toast",textAlign:"center"}).showToast(),M=1,console.log("Email не соответствует требованиям")),!function(e){return/^((8|\+374|\+994|\+995|\+375|\+7|\+380|\+38|\+996|\+998|\+993)[\- ]?)?\(?\d{3,5}\)?[\- ]?\d{1}[\- ]?\d{1}[\- ]?\d{1}[\- ]?\d{1}[\- ]?\d{1}(([\- ]?\d{1})?[\- ]?\d{1})?$/.test(e)}(n)?(Toastify({text:"ОШИБКА ВВОДА ДАННЫХ \n Пожалуйста, проверьте правильность заполнения \n Телефон",duration:3e3,close:!0,gravity:"top",position:"center",backgroundColor:"linear-gradient(to right, #FF0000, #FFA500)",stopOnFocus:!0,className:"error-toast",textAlign:"center"}).showToast(),1,console.log("Телефон не соответствует требованиям")):console.log("Телефон соответствует");var l=document.getElementById("privacyCheckbox_sd"),s=document.getElementById("dataProcessingCheckbox_sd"),c=document.getElementById("openAiCheckbox_sd"),r=l.checked,i=s.checked,d=c.checked;if(console.log("Состояние privacyCheckbox:",r),console.log("Состояние dataProcessingCheckbox:",i),console.log("Состояние openAiCheckbox:",d),!r||!i||!d)return Toastify({text:"ОШИБКА ВВОДА ДАННЫХ \n Пожалуйста, ознакомтесь с \n политиками сотрудничиства",duration:3e3,close:!0,gravity:"top",position:"center",backgroundColor:"linear-gradient(to right, #FF0000, #FFA500)",stopOnFocus:!0,className:"error-toast",textAlign:"center"}).showToast(),1,void console.log("Политика не соответствует требованиям");1===O?console.log("Ошибка в имени"):1===M?console.log("Ошибка в email"):console.log("OK")}));const q=document.getElementById("myButton0");q.addEventListener("click",(function(){const e=document.getElementById("myButton0");"on"===e.getAttribute("data-state")?(e.setAttribute("data-state","off"),e.textContent="Включить сохранение сессии беседы",e.classList.remove("button-on"),e.classList.add("button-off"),localStorage.setItem("buttonState","off"),setTimeout(()=>{location.reload()},100)):(e.setAttribute("data-state","on"),e.textContent="Отключить сохранение сессии беседы",e.classList.remove("button-off"),e.classList.add("button-on"),localStorage.setItem("buttonState","on"),setTimeout(()=>{location.reload()},100))})),document.addEventListener("DOMContentLoaded",()=>{"on"===localStorage.getItem("buttonState")?(q.setAttribute("data-state","on"),q.textContent="Включить сохранение сессии беседы",q.classList.add("button-on"),function(){const e=function(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let o="";for(let n=0;n<e;n++){o+=t[Math.floor(Math.random()*t.length)]}return o}(50);localStorage.setItem("staturt_out",e),Toastify({text:"Новая сессия беседы создана успешно!",duration:3e3,close:!0,gravity:"top",position:"center",backgroundColor:"linear-gradient(to right, #001f3f, #0074D9)",stopOnFocus:!0}).showToast()}()):(q.setAttribute("data-state","off"),q.textContent="Отключить сохранение сессии беседы",q.classList.add("button-off"),function(){localStorage.getItem("staturt_out");Toastify({text:"Сессия беседы продолжается!",duration:3e3,close:!0,gravity:"top",position:"center",backgroundColor:"linear-gradient(to right, #026902, #00a8a8)",stopOnFocus:!0}).showToast()}())});const N=document.getElementById("chat"),K=document.getElementById("messageInput"),j=document.getElementById("send1Button"),D=document.getElementById("resetBasePage"),V=document.getElementById("basePageCount");let H=[];const W=document.querySelector("#maxLemInput"),J=document.querySelector("#maxLemValue"),U=localStorage.getItem("maxLem");U?(W.value=U,J.textContent=U):J.textContent=W.value,W.addEventListener("input",()=>{J.textContent=W.value,localStorage.setItem("maxLem",W.value)});function R(e,t,o,n=!1){const a=document.createElement("div");a.className="message "+t;const l=document.createElement("div");l.className="message-card";const s=document.createElement("img");s.className="avatar",s.src=o?"https://i.ibb.co/QJgmw60/GPT.gif":"https://i.ibb.co/n0S7W97/y1-W5jf-U4-Qc-M.jpg",s.alt=o?"Assistant Avatar":"User Avatar",l.appendChild(s);const c=document.createElement("div");c.className="message-content";const r=document.createElement("p");if(r.className="message-text",c.appendChild(r),l.appendChild(c),a.appendChild(l),N.appendChild(a),N.scrollTop=N.scrollHeight,o){const t=e.replace(/\\n/g,"\n"),o=e=>{e<t.length&&(r.textContent+=t[e],N.scrollTop=N.scrollHeight,setTimeout(()=>{o(e+1)},5))};n?r.textContent=t:o(0)}else r.textContent=e,N.scrollTop=N.scrollHeight}function z(){N.scrollTop=N.scrollHeight}function G(){const e=JSON.parse(localStorage.getItem("basePage"))||[];V.textContent=e.length.toString()}j.addEventListener("click",e=>{e.preventDefault(),async function(){const e=document.getElementById("messageInput"),t=document.getElementById("maxLemInput"),o=JSON.parse(localStorage.getItem("basePage"))||[],n=e.value.trim();let a=[];const l=2*parseInt(t.value);if(e.value="",e.style.height="auto",""===n)return;o.push({role:"user",content:n}),0===l||0===o.length?a=[{role:"user",content:n}]:l>0&&l<=o.length?a=o.slice(-l):l>o.length&&(a=o),R(n,"user",!1);const s=await fetch("https://api.openai.com/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer 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"},body:JSON.stringify({model:"gpt-3.5-turbo",messages:a,temperature:0,max_tokens:2e3})}),c=await s.json();console.log("Отправленное сообщение:",a),console.log("Ответ сервера:",c);const r=c.choices[0].message.content;o.push({role:"assistant",content:r}),localStorage.setItem("basePage",JSON.stringify(o)),R(r,"received",!0),z(),N.innerHTML="";for(const e of o)R(e.content,e.role,"assistant"===e.role,!0);z()}()}),K.addEventListener("keydown",e=>{"Enter"===e.key&&(e.shiftKey||(K.value+="\n",e.preventDefault()))}),K.addEventListener("input",(function(){K.style.height="auto",K.style.height=K.scrollHeight+"px"})),D.addEventListener("click",()=>{localStorage.removeItem("basePage"),H=[],G(),N.innerHTML=""}),G(),window.addEventListener("DOMContentLoaded",()=>{const e=JSON.parse(localStorage.getItem("basePage"))||[];if(e.length>0){H=e;for(const e of H)R(e.content,e.role,"assistant"===e.role,!0);z()}else{const t="Здраствуйте, чем могу быть полезен";R(t,"received",!0,!0),e.push({role:"assistant",content:t}),localStorage.setItem("basePage",JSON.stringify(e))}});const Q=document.querySelector("#fontSelect"),X=localStorage.getItem("selectedFont");var Z;X&&(Q.value=X,document.body.style.fontFamily=X),Q.addEventListener("change",(function(){const e=Q.value;document.body.style.fontFamily=e,localStorage.setItem("selectedFont",e)})),document.getElementById("submit4").addEventListener("click",(function(){localStorage.setItem("tokkis",1e6),function(){let e,t=0;Swal.fire({title:"Увеличиваем до 1 Миллиона",html:"Слова: <b>0</b>",timer:3e3,timerProgressBar:!1,didOpen:()=>{Swal.showLoading();const o=Swal.getHtmlContainer().querySelector("b");e=setInterval(()=>{t+=1e4,o.textContent=t,t>=1e6&&(clearInterval(e),Swal.close())},30)},willClose:()=>{clearInterval(e)},footer:"VK-ChatGPT-3.5-turbo"}).then(e=>{e.dismiss===Swal.DismissReason.timer&&console.log("Таймер завершил работу")}),localStorage.setItem("baziSlov",1e6)}()}));var Y=document.getElementById("userInput");var ee=document.getElementById("submit3");ee.addEventListener("click",(function(){Z?(Z&&(Z.stop(),Z=null),ee.textContent="🎤"):((Z=new webkitSpeechRecognition).continuous=!0,Z.interimResults=!0,Z.lang=u,console.log(u),Z.onstart=function(){recordingIndicator.style.display="inline-block"},Z.onresult=function(e){var t=e.results[e.resultIndex];if(t.isFinal){var o=t[0].transcript;Y.value+=o+" "}else console.log("Промежуточный результат: ",t[0].transcript)},Z.onerror=function(e){console.log("Ошибка распознавания: ",e.error)},Z.onend=function(){recordingIndicator.style.display="none"},Z.start(),ee.textContent="❌")}))}]);