PageSourceSearch

https://lavandaflor.ru/_nuxt/_y03iwcl.js

js lavandaflor.ru collected 2026-10-06 13:18:01 UTC 6,466 bytes, 1 lines download raw bytes

1import{C as e,f as t,p as n}from"./BQpMFI2t.js";import{Et as r,R as i,d as a}from"./CB5-eA5X.js";import{l as o,o as s,t as c}from"./DNnrF5Vr.js";import{t as l}from"./rqsZAQa3.js";import{t as u}from"./DSPOfPkl.js";import{t as d}from"./B01tAdpj.js";var f=`https://test.saastra.ru/chat/api/v1/chat`;function p(t,n){return e().$customFetch(t,{baseURL:f,...n})}function m(e){return p(`/info`,{method:`GET`,headers:e?{"guest-token":`${e}`}:{}})}function h(){return p(`/create`,{method:`POST`})}function g(e){return p(`/messages`,{method:`GET`,headers:a(()=>e.value?{"guest-token":`${e.value}`}:void 0).value})}function _(e){return p(`/message/create`,{method:`POST`,body:e})}function v(e){return p(`/read/client`,{method:`POST`,headers:e?{"guest-token":`${e}`}:{}})}var y=s(`chat`,()=>{let e=u(),t=d(),{authToken:n}=o(K()),i=c(`LavandaAnonChatToken`,{expires:e().add(90,`day`).toDate()}),s=r(null),l=r(!1),f=r(!1),p=r(null),h=r([]),_=r(0),v=r(0);async function y(){if(n.value||i.value){let e=await m(i.value);p.value=e,_.value=p.value.unread_count,h.value=await g(i),b()}}function b(){s.value||(S(),C())}function x(){s.value&&=(s.value?.close(1e3,`Закрываем соединение с чатами`),null),i.value=void 0,p.value=null,h.value=[],_.value=0,v.value++}function S(){if(!p.value)return;let e=n.value?`token=${n.value}`:p.value.guest_token?`guest_token=${p.value.guest_token}`:``;s.value=new WebSocket(`wss://test.saastra.ru/chat/api/v1/chat/ws/${p.value.id}?${e}`),s.value.onopen=()=>{l.value=!0},s.value.onclose=e=>{if(l.value=!1,s.value=null,console.log(`Закрытие сокетов чата`,e.code,e),n.value||i.value){let t=[1011,1012].includes(e.code)?3e4:1e4;setTimeout(()=>{console.log(`Переподключение чатов`),b()},t)}}}function C(){let e=new Audio(`/audio/notification.wav`);s.value.onmessage=t=>{let n=JSON.parse(t.data);n.event===`unread_count_update`&&n.unread_count!==void 0?_.value=n.unread_count:n?.event===`new_message`&&n.message?(n.message.is_staff&&e.play(),h.value=[...h.value,n.message]):h.value&&n.event===`mark_read_admin_messages`&&h.value.forEach(e=>{!e.is_staff&&!e.is_read&&(e.is_read=!0)})}}function w(){f.value=!0,t.toggle_opened_modals_count(`open`)}return{websocketConnection:a(()=>s.value),isChatConnected:l,isChatOpen:f,chatCookie:i,chatInfo:p,messagesList:h,unreadMessagesCount:_,remountChatKey:v,chatInit:y,chatConnect:b,closeChatConnection:x,openChat:w}}),b=`https://test.saastra.ru/notifications/api/v1/notifications`;function x(t,n){return e().$customFetch(t,{baseURL:b,...n})}function S(){return x(`/admin/inbox/unread-count`)}function C(e){return x(`/admin/inbox`,{method:`GET`,query:e})}function w(){return x(`/admin/inbox/mark-read`,{method:`POST`,body:{read_all:!0}})}var T=s(`notifications`,()=>{let{authToken:e}=o(K()),t=r(null),n=r([]),s=r(0),c=r(!1);function l(){e.value&&!t.value&&(u(),f())}function u(){t.value=new WebSocket(`wss://test.saastra.ru/notifications/api/v1/notifications/ws?token=${e.value}`),t.value.onclose=n=>{if(t.value=null,console.log(`Закрытие сокетов уведомлений`,n.code,n),e.value){let e=[1012].includes(n.code)?3e4:n.code===1011?300:1e4;setTimeout(()=>{console.log(`Переподключение уведомлений`),l(),m(),h()},e)}},t.value.onerror=e=>{console.log(`Ошибка сокетов уведомлений:`,e)}}function f(){let e=d();t.value.onmessage=t=>{let r=JSON.parse(t.data);e.notify(!0,`${r.name}${r.title}`),n.value.unshift(r),h()}}function p(){t.value&&=(t.value?.close(1e3,`Закрываем соединение с уведомлениями`),null),s.value=0}async function m(){try{if(e.value){let e=await C({page:1,size:9999});e&&(n.value=e.items)}}catch(e){console.log(e)}}async function h(){try{if(e.value){let e=await S();s.value=e.unread_count_messages}}catch(e){console.log(e)}}function g(){let e=d();c.value=!0,e.toggle_opened_modals_count(`open`),ym(48109733,`reachGoal`,`open-notification`)}async function _(){let e=d();c.value=!1,await i(),e.toggle_opened_modals_count(`close`)}return{wsNotificationConnection:a(()=>t.value),notificationsList:n,notificationsUnseenCount:s,notificationsSidebarState:c,getNotificationsList:m,notificationsWsConnect:l,closeNotificationConnection:p,getUnreadCount:h,openNotificationsSidebar:g,closeNotificationsSidebar:_}}),E=`https://test.saastra.ru/auth/api`;function D(e,t={}){return l(e,{baseURL:E,...t})}function O(t,n){return e().$customFetch(t,{baseURL:E,...n})}function k(e){return O(`/v2/auth/code/request`,{method:`POST`,body:e})}function A(e){return O(`/v1/auth/code/verify`,{headers:{"x-client-id":c(`temporary_client_id`).value??``},method:`POST`,body:e})}function j(e){return O(`/v1/user/phone/request`,{method:`POST`,body:{phone:e}})}
1function M(e){return O(`/v1/user/phone/verify`,{headers:{"x-client-id":c(`temporary_client_id`).value??``},method:`POST`,body:e})}function N(){return O(`/v1/auth/logout`,{method:`POST`,credentials:`include`})}function P(){return O(`/v1/auth/user/current`)}function F(e,t){return O(`/v1/user/${e}`,{method:`PATCH`,body:{type:`customer`,...t}})}function I(e,t){return O(`/v1/reason/create`,{method:`POST`,body:{user_id:e,...t}})}function L(e,t){return O(`/v1/reason/${e}/update`,{method:`PATCH`,body:t})}function R(e){return O(`/v1/reason/${e}`,{method:`DELETE`})}function z(e,t){return O(`/v1/addresses/create`,{method:`POST`,body:{user_id:e,...t}})}function B(e,t){return O(`/v1/addresses/${e}/update`,{method:`PATCH`,body:t})}function V(e){return O(`/v1/addresses/${e}`,{method:`DELETE`})}function H(e,t){return O(`/v1/recipients/create`,{method:`POST`,body:{user_id:e,...t}})}function U(e,t){return O(`/v1/recipients/${e}/update`,{method:`PATCH`,body:t})}function W(e){return O(`/v1/recipients/${e}`,{method:`DELETE`})}function G(e){return D(()=>`/v1/loyalty/${e}/balance-history`)}var K=s(`auth`,()=>{let e=c(`LavandaAuthToken`,{expires:new Date(Date.now()+31536e6)}),o=n(),s=t(),l=r(null),u=a(()=>!!e.value);async function d(){try{let e=await P();l.value=e}catch(e){console.log(e)}}async function f(){let t=y(),n=T();e.value=null,await N(),s.meta.layout===`profile`&&await o.push(`/`),t.closeChatConnection(),n.closeNotificationConnection(),l.value=null,await i(),location?.reload()}return{authToken:e,isAuth:u,authUser:l,loadProfileData:d,logout:f}});export{v as S,T as _,V as a,h as b,G as c,j as d,M as f,U as g,L as h,H as i,k as l,F as m,z as n,R as o,B as p,I as r,W as s,K as t,A as u,w as v,_ as x,y};

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.