PageSourceSearch

https://resorto.io/_nuxt/EH563Ivo.js

js resorto.io collected 2026-10-07 18:16:24 UTC 7,014 bytes, 1 lines download raw bytes

1import{_ as X}from"./DUsZeIPc.js";import{_ as Z}from"./BDB-2-sh.js";import{_ as J,b as Q}from"./CCLGE7HO.js";import{_ as ee}from"./J4TwfYUr.js";import{_ as te}from"./DA-PK9rN.js";import{_ as ae}from"./BfIMbz6V.js";import{F as se}from"./CZV4FN4L.js";import{c as le,d as oe,R as ie}from"./CfMhDJ1z.js";import{u as ne}from"./CIJxLe6O.js";import{u as re}from"./vg45JOSX.js";import{b as ce,aa as de,n as me,z as pe,l as ue,H as u,q as i,w as n,I as l,g as a,ab as r,U as E,ac as y,r as m,c as S,a as _e,o as c,e as R,ah as $,ai as z,aB as ge,ar as fe}from"./D5rHXhro.js";import{b as ve,p as he}from"./D_eVSWY6.js";import{D as xe}from"./BkRKkRVK.js";import"./CHIgUVhi.js";import"./C8cEfhYm.js";import"./B5Ecnx5o.js";import"./cnf1vCcu.js";import"./Z-t5L1OF.js";import"./CAvrO_zP.js";import"./D7nh0L5D.js";import"./CWUtwyWJ.js";import"./BK3A3arq.js";import"./ynpQD74A.js";import"./Donr2QHd.js";import"./DJwW2gnp.js";import"./DicNefIb.js";import"./C1T4AniJ.js";import"./DelXDR0o.js";import"./CZ4U5BQk.js";import"./_t4O0CKZ.js";import"./DQAudIPM.js";import"./C1bHKWm-.js";import"./D5yaTNiD.js";import"./D4k11_F0.js";import"./RQpAQxc1.js";const be={class:"space-y-6 p-4 sm:p-6"},ye={class:"flex flex-wrap items-end gap-4"},Se={class:"overflow-hidden rounded-lg border border-default bg-default"},Ue={class:"whitespace-nowrap text-sm text-muted"},we={class:"text-sm font-medium text-highlighted"},ke={class:"min-w-0 max-w-[200px]"},Te={class:"truncate text-sm font-medium text-highlighted"},Ee=["title"],Be={class:"flex items-center gap-1 whitespace-nowrap text-sm"},Fe={class:"ml-1 font-medium text-toned"},Ve={class:"max-w-[520px] whitespace-pre-line text-sm text-toned"},Ae={class:"mt-3 max-w-[520px]"},Pe={key:1,class:"mt-2 flex flex-wrap gap-2"},Re=["href"],$e=["src","srcset"],ze={class:"flex flex-col items-center gap-3 py-12"},Oe={class:"text-sm text-muted"},Ce={key:0,class:"flex flex-col gap-3 border-t border-default px-4 sm:px-6 py-4 sm:flex-row sm:items-center sm:justify-between"},Ie={class:"text-xs text-muted"},O=220,yt=ce({__name:"index",setup(He){de({title:"Отзывы"});const{setHeader:B}=re(),{properties:w,load:C}=ne(),U=le,I=oe,H=[{label:"Все статусы",value:"all"},...Object.keys(U).map(t=>({label:U[t],value:t}))],F=m([]),p=m(0),d=m(1),g=m(xe),f=m(!1),v=m(""),h=m(""),x=m(new Set),L=S(()=>!!(v.value||h.value)),M=S(()=>[{accessorKey:"created_at",header:"Дата"},...w.value.length>1?[{id:"property",header:"Объект"}]:[],{id:"author",header:"Автор"},{accessorKey:"rating",header:"Оценка"},{accessorKey:"text",header:"Текст"},{accessorKey:"status",header:"Статус"}]),D=S(()=>[{label:"Все объекты",value:"all"},...w.value.map(t=>({label:t.title,value:t.id}))]),k=S({get:()=>v.value||"all",set:t=>{v.value=t==="all"?"":t,d.value=1,b()}}),T=S({get:()=>h.value||"all",set:t=>{h.value=t in U?t:"",d.value=1,b()}});function V(){B({title:"Отзывы",subtitle:`Всего: ${p.value}`,icon:"ic:baseline-reviews"})}function j(t,s){const _=String(t||"");return _.length<=s?_:`${_.slice(0,s)}…`}function N(t){const s=new Set(x.value);s.has(t)?s.delete(t):s.add(t),x.value=s}async function b(){f.value=!0;try{const t=new URLSearchParams({page:String(d.value),limit:String(g.value)});v.value&&t.set("property_id",v.value),h.value&&t.set("status",h.value);const s=await _e(`/partner/v1/reviews?${t.toString()}`);F.value=s.items,p.value=s.total,x.value=new Set}catch(t){console.error("Failed to load reviews:",t)}finally{f.value=!1}}function K(t){if(!t)return"";const s=[t.first_name,t.last_name].filter(Boolean).join(" ");return s||t.email||""}return me(async()=>{V(),await Promise.all([C(),b()])}),pe(p,V),ue(()=>{B(null)}),(t,s)=>{const _=X,A=Z,P=J,Y=ee,W=Q,q=te,G=ae;return c(),u("div",be,[i(se,null,{default:n(()=>[l("div",ye,[a(w).length>1?(c(),R(A,{key:0,label:"Объект",class:"w-72"},{default:n(()=>[i(_,{modelValue:a(k),"onUpdate:modelValue":s[0]||(s[0]=e=>E(k)?k.value=e:null),items:a(D),class:"w-full"},null,8,["modelValue","items"])]),_:1})):y("",!0),i(A,{label:"Статус",class:"w-48"},{default:n(()=>[i(_,{modelValue:a(T),"onUpdate:modelValue":s[1]||(s[1]=e=>E(T)?T.value=e:null),items:H,class:"w-full"},null,8,["modelValue"])]),_:1}),i(P,{label:"Обновить",icon:"ic:baseline-refresh",color:"neutral",variant:"outline",loading:a(f),class:"ml-auto",onClick:b},null,8,["loading"])])]),_:1}),l("div",Se,[i(q,{data:a(F),columns:a(M),loading:a(f),ui:{td:"align-top"}},{"created_at-cell":n(({row:e})=>[l("span",Ue,r(a(fe)(e.original.created_at,"DD.MM.YYYY HH:mm")),1)]),"property-cell":n(({row:e})=>[l("span",we,r(e.original.property?.title||e.original.property?.slug||e.original.property_id),1)]),"author-cell":n(({row:e})=>[l("div",ke,[l("div",Te,r(K(e.original.user)||e.original.author_name||"Аноним"),1),e.original.user?.email?(c(),u("div",{key:0,class:"truncate text-xs text-muted",title:e.original.user.email},r(e.original.user.email),9,Ee)):y("",!0)])]),"rating-cell":n(({row:e})=>[l("div",Be,[(c(),u($,null,z(5,o=>l("span",{key:o,class:ge(o<=e.original.rating?"text-yellow-500":"text-dimmed")},"★",2)),64)),l("span",Fe,r(e.original.rating)+"/5",1)])]),"text-cell":n(({row:e})=>[l("div",Ve,r(a(x).has(e.original.id)?e.original.text:j(e.original.text,O)),1),e.original.text.length>O?(c(),R(P,{key:0,label:a(x).has(e.original.id)?"Свернуть":"Показать полностью",color:"neutral",variant:"link",size:"xs",class:"mt-1 px-0",onClick:o=>N(e.original.id)},null,8,["label","onClick"])):y("",!0),l("div",Ae,[i(ie,{review:e.original,"api-base-path":"/partner/v1",onUpdated:o=>Object.assign(e.original,o)},null,8,["review","onUpdated"])]),e.original.media?.gallery?.length?(c(),u("div",Pe,[(c(!0),u($,null,z(e.original.media.gallery,o=>(c(),u("a",{key:o.id,href:o.url,target:"_blank",rel:"noopener noreferrer",class:"block size-16 overflow-hidden rounded border border-default bg-elevated",title:"Открыть оригинал"},[l("img",{src:a(he)(o,"small")||o.url,srcset:a(ve)(o),sizes:"64px",class:"!h-full !w-full object-cover",alt:"",loading:"lazy",decoding:"async"},null,8,$e)],8,Re))),128))])):y("",!0)]),"status-cell":n(({row:e})=>[i(Y,{label:a(U)[e.original.status]??e.original.status,color:a(I)[e.original.status]??"neutral",variant:"subtle",size:"sm"},null,8,["label","color"])]),empty:n(()=>[l("div",ze,[i(W,{name:"ic:baseline-reviews",class:"size-12 text-dimmed"}),s[3]||(s[3]=l("div",{class:"text-sm font-medium text-highlighted"},"Нет отзывов",-1)),l("p",Oe,r(a(L)?"Попробуйте изменить фильтры.":"Отзывы гостей появятся здесь."),1)])]),_:1},8,["data","columns","loading"]),a(p)>
1a(g)?(c(),u("div",Ce,[l("div",Ie," Показано "+r((a(d)-1)*a(g)+1)+" – "+r(Math.min(a(d)*a(g),a(p)))+" из "+r(a(p)),1),i(G,{page:a(d),"onUpdate:page":[s[2]||(s[2]=e=>E(d)?d.value=e:null),b],size:"sm",total:a(p),"items-per-page":a(g),disabled:a(f)},null,8,["page","total","items-per-page","disabled"])])):y("",!0)])])}}});export{yt as default};

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.