1import{r as a,p as X,$ as z,x as K,d as Q,q as Y,R as _,dh as Z,j as e,L as k,X as ee,f as se,g as te,M as ae,C as le,i as j,D as re,aw as ne,I as ie,U as oe}from"./index-DixATX_x.js";import{s as ce}from"./index-CSRbtWnK.js";import{A as de}from"./index-Da-IRJMP.js";import{U as ue}from"./index-DJ5WaqIc.js";import{U as me}from"./UserVideoGallery-6mSfY4Fl.js";import{E as he,D as pe,G as ge}from"./AddVideoModal-DxqLuw0o.js";import{C as fe}from"./index-BH3cj0qD.js";import{d as xe}from"./declension-BmUzLZ4k.js";/* empty css */import"./index-CNS4OU2R.js";import"./index-12TPZId_.js";import"./checkIsFed-Cd0TZEOS.js";import"./index-DjoU9w2O.js";import"./slick-theme-B8H7jiE8.js";const _e=()=>{const[E,A]=a.useState(!0),[$,G]=a.useState(null),[r,U]=a.useState({}),[y,L]=a.useState(!1),[l,C]=a.useState(null),[b,u]=a.useState(!1),[D,S]=a.useState(!1),[N,g]=a.useState(!0),[i,h]=a.useState([]),[o,f]=a.useState([]),[x,M]=a.useState(!1),[I,O]=a.useState(1),{isAuthenticated:v,profile_id:P,is_active_profile:R,user_info:je}=X(t=>t.authentication),ye=z(),c=K(),{alias:p}=c,T=Q(1080),{confirm:F}=Y();a.useEffect(()=>{Promise.all([q(),m(1)]).then(()=>A(!1))},[]);const q=async t=>_({url:Z+p},s=>{U(s),L(v&&R&&P===s.profile_id)},s=>{console.error(s.response),G(s.response)}),m=async(t=1)=>{S(!0),await _({url:`/api/photogallery/gallery?alias=${c.alias}&start_element=${t}${c.album?"&album_id="+c.album:""}`},s=>{if(s.photos.length){const d=s.photos.map(n=>({id:n.id,src:n.link,thumbnail:n.small_photo.link,thumbnailWidth:n.small_photo.width,thumbnailHeight:n.small_photo.height,caption:n.caption!=="null"?n.caption:""}));s.photos.length<25?g(!1):g(!0),h(t===1?d:[...i,...d])}else t===1&&h([]),g(!1);C(s.album),S(!1)},s=>w(s))},H=()=>{N&&(O(I+25),m(I+25))},w=t=>{let s=t.response.data.errors?Object.values(t.response.data.errors):`${t.response.status} ${t.response.statusText}`;u({title:`ÐÑибка: ${s}`,text:"ÐопÑобÑйÑе повÑоÑиÑÑ Ð¿Ð¾Ð¿ÑÑÐºÑ Ð¿Ð¾Ð·Ð¶Ðµ, либо воÑполÑзÑйÑеÑÑ ÑоÑмой обÑаÑной ÑвÑзи.",autoclose:7.5,onOk:()=>u(!1)})},V=async()=>{await F("УважаемÑй полÑзоваÑелÑ!",`ÐÑ Ð´ÐµÐ¹ÑÑвиÑелÑно Ñ
оÑиÑе ÑдалиÑÑ ${o.length>1?"ÑÑи ÑоÑогÑаÑии":"ÑÑÑ ÑоÑогÑаÑиÑ"}?`)&&await _({url:"/api/photogallery/gallery",method:"DELETE",data:JSON.stringify(o.map(t=>t.id))},()=>{u({title:"УÑпеÑно Ñдалено!",autoclose:1.5,onOk:()=>u(!1)}),f([]),m()},t=>w(t))},B=async()=>{u({title:"ÐнÑоÑмаÑÐ¸Ñ ÑоÑ
Ñанена!",autoclose:2.5,onOk:()=>u(!1)}),await m()},J=()=>{let t=i;if(x)for(let s=0;s<t.length;s++)t[s].isSelected=!1;else for(let s=0;s<t.length;s++)t[s].isSelected=!0;h(t),f(t.filter(s=>s.isSelected===!0)),M(!x)},W=t=>{const s=i.slice();let d=s[t];d.hasOwnProperty("isSelected")?d.isSelected=!d.isSelected:d.isSelected=!0,h(s),f(s.filter(n=>n.isSelected===!0))};return e.jsx(de,{children:E?e.jsx(k,{}):$?e.jsx(ee,{to:"/404"}):e.jsx(se,{children:e.jsx("div",{className:"user-page",children:e.jsxs(te,{className:"user-page__content content",children:[e.jsx("aside",{className:"user-page__left",children:e.jsxs(ce,{offsetTop:60,children:[e.jsx(ue,{logo:r.logo_link,alias:r.alias,user_type:1,profileId:r.profile_id,canEdit:y,openRoles:r.open_roles,subscribed:r.subscribed,isAuthenticated:v,first_name:r.personal_information?r.personal_information.first_name:"Ðноним",last_name:r.personal_information?r.personal_information.last_name:"",isAcceptPersonalData:r.personal_data_request_accepted,isAvitoBreederVerified:r?.has_avito_badge}),!T&&e.jsxs(e.Fragment,{children:[e.jsx(ae,{}),e.jsx(me,{alias:p,pageLink:`/user/${p}/video`}),e.jsx(fe,{withSocials:!0})]})]})}),e.jsx("div",{className:"user-page__right",children:e.jsxs("div",{className:"NurseryGallery__content",children:[e.jsxs(le,{children:[e.jsx("div",{className:"NurseryGallery__breadcrumbs wrap",children:e.jsxs("div",{children:[e.jsxs(j,{className:"btn-backward",to:`/user/${c.alias}/`,children:[e.jsx("span",{children:"â¹"})," ÐиÑÐ½Ð°Ñ ÑÑÑаниÑа"]})," ","/",e.jsxs(j,{className:"btn-backward",to:`/user/${c.alias}/gallery`,children:[" ","ФоÑогалеÑеÑ"]}),l?e.jsxs(e.Fragment,{children:[" ","/"," ",e.jsx(j,{className:"btn-backward",to:`/user/${p}/gallery/${c.album}`,children:l.name})]}):""," / РедакÑиÑование"]})}),l&&l.addition&&e.jsxs("div",{className:"NurseryGallery__edit-wrap",children:[e.jsxs("div",{className:"NurseryGallery__edit-cover",children:[e.jsx("h4",{children:"Ðбложка алÑбома"}),e.jsx("div",{className:"NurseryGallery__edit-cover-image",style:{backgroundImage:`url(${l.cover||re.noImage})`}})]}),e.jsx(he,{album:l,onSuccess:B})]}),y&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"NurseryGallery__content-divider"}),l&&l.addition&&e.jsx(pe,{callback:m,album_id:l&&l.id}),e.jsxs("div",{className:"NurseryGallery__count",children:[e.jsx("h4",{children:l?o.length?e.jsxs("span",{children:["ÐÑбÑано ",e.jsx("strong",{children:o.length})," из"," ",e.jsx("strong",{children:l.count})," ÑоÑогÑаÑий"]}):e.jsxs("span",{children:[e.jsx("strong",{children:i.length})," ",xe(i.length,["ÑоÑогÑаÑиÑ","ÑоÑогÑаÑии","ÑоÑогÑаÑий"])]}):e.jsxs("span",{children:["ÐÑбÑано ÑоÑогÑаÑий:"," ",e.jsx("strong",{children:o.length})]})}),e.jsxs("div",{className:"NurseryGallery__count-buttons",children:[!!o.length&&e.jsxs("span",{onClick:V,children:[e.jsx(ne,{})," УдалиÑÑ"]}),!!i.length&&e.jsx("span",{onClick:J,children:o.length&&x?"СнÑÑÑ Ð²Ñделение":"ÐÑбÑаÑÑ Ð²Ñе ÑоÑогÑаÑии"})]})]}),e.jsx(ie,{dataLength:i.length,next:H,hasMore:N,loader:D&&e.jsx(k,{centered:!1}),children:e.jsx("div",{className:"edit-gallery__wrap",children:e.jsx(ge,{items:i,backdropClosesModal:!0,onSelectImage:W,isEditPage:!0})})})]})]}),b&&e.jsx(oe,{...b})]})})]})})})})},Me=a.memo(_e);export{Me 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.