1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./v7.12-_pfsIBSO.js","./entry-Bph1uqcI.css"])))=>i.map(i=>d[i]); 2import{d1 as d,b1 as C,b0 as $,aO as u,aP as i,aT as w,bo as B,aW as E,aY as G,bz as l,aU as p,aQ as g,aX as m,bv as M,a_ as j,aN as L,dj as J,dk as X,dl as $e,bC as ye,ch as Q,bE as Z,aV as h,bB as b,dm as N,d0 as ve,b4 as P,b5 as U,dn as ge,dp as O,aR as we,b6 as x,bn as Y,c$ as ke,bF as Ie,dq as Se,b3 as Ae,a$ as be,dr as Ee,ds as Te,dt as Le,du as Ne,dv as De,dw as Me,dx as Re,dy as Fe,bq as Be,bw as Oe,cJ as Pe,bL as Ue,cI as He,cP as Ve,bh as qe,bt as q,bm as ze,dz as je,dA as Ye}from"./v7.12-_pfsIBSO.js";import{d as ee}from"./v7.12-CApw0dbM.js";import{v as te}from"./v7.12-BvaIoJo6.js";import{t as ne}from"./v7.12-CweH_Ckd.js";import{d as We,s as Ge}from"./v7.12-CPQUHMDk.js";import{u as Ze,g as Ke,a as Je}from"./v7.12-EY0gt0hD.js";import{E as Xe}from"./v7.12-DD6w6I-i.js";const oe=async(e,t)=>{const n={content:e.value,parent:t,post_ID:Number(d().postId)};await d().addNewCommentAction({comment:n,files:e.attachments}),e.value="",e.attachments=[],e.notSavedFiles=[]};class v{constructor({eventName:t,action:n,attachments:s,element:a,errorMessage:r,slugReferer:o}){this.eventName=t,this.action=n,this.attachments="",this.element="",this.errorMessage="",this.slugReferer="",s&&(this.attachments=s),a&&(this.element=a),r&&(this.errorMessage=r),o&&(this.slugReferer=o)}}const W="ÐÑпÑавка",z="ввод",K="ÑкопиÑоваÑÑ ÑÑÑлкÑ",se="ÑдалиÑÑ",Qe="намеÑение ÑдалиÑÑ",xe="пеÑейÑи к коÑÐ½ÐµÐ²Ð¾Ð¼Ñ ÐºÐ¾Ð¼Ð¼ÐµÐ½ÑаÑиÑ",ie="жалоба",et="ÑкÑÑÑÑ",tt="оÑмениÑÑ",A="дейÑÑвиÑ_ÐомменÑаÑии",ae="ÑедакÑиÑование_ÐоммеÑаÑии",D="оÑвеÑ_ÐомменÑаÑии",re="поле_ввода_ÐомменÑаÑий",nt="оÑенка_ÐомменÑаÑии",H="ÐвÑоÑизаÑиÑ_попап",F="изобÑажение_комменÑаÑий",ot=C({name:"SvgIcon",props:{tag:{type:String,default:"span"},icon:{type:String,required:!0}},emits:["click"]},"$CQttYwrfis");function st(e,t,n,s,a,r){return i(),u(G(e.tag),{class:E(`svg-icon svg-icon--${e.icon}`),onClick:t[0]||(t[0]=o=>e.$emit("click",o))},{default:w(()=>[B(e.$slots,"default")]),_:3},8,["class"])}const T=$(ot,[["render",st]]),it=C({name:"CommentAttachmentButton",components:{SvgIcon:T},props:{fileInputName:{type:String,default:void 0},disabled:{type:Boolean,default:!1}},computed:{iconClass(){return{"attachment-button__icon--disabled":this.disabled}}}},"$XjrCCb9wlP"),at=["for"];function rt(e,t,n,s,a,r){const o=l("SvgIcon");return i(),p("label",{class:"attachment-button",for:e.fileInputName},[g(o,{class:E(["attachment-button__icon",e.iconClass]),icon:"attachment-icon"},null,8,["class"])],8,at)}const ct=$(it,[["render",rt]]),mt=C({name:"CommentButton",props:{type:{type:String,default:"text"},disabled:{type:Boolean,default:!1}},emits:["click"],computed:{buttonClass(){return{[`comment-button--${this.type}`]:this.type}}}},"$Gvgnii-kPo"),lt=["disabled"];function ut(e,t,n,s,a,r){return i(),p("button",{disabled:e.disabled,class:E([e.buttonClass,"comment-button"]),onClick:t[0]||(t[0]=o=>e.$emit("click"))},[B(e.$slots,"default",{},void 0,!0)],10,lt)}const ce=$(mt,[["render",ut],["__scopeId","data-v-3acd6784"]]),dt=C({name:"CommentInputActions",components:{CommentButton:ce,CommentAttachmentButton:ct},props:{comment:{type:Object,default:null},type:{type:String,default:"primary"},imageContent:{type:String,default:""},disableSend:{type:Boolean,default:!0},fileInputName:{type:String,default:void 0},attachmentIconActive:{type:Boolean,default:!1}},emits:["show-login","send","remove-attachment"],data(){return{image:""}},computed:{computedType(){return this.type==="primary"?this.type:"text"}},methods:{sendComment(){if(!d().isUserExists){this.$emit("show-login");return}this.$emit("send")},removeAttachment(){this.image="",this.$emit("remove-attachment")}}},"$6bOUGyzLHu"),ht={class:"input-footer"},pt={class:"input-footer__actions"};function ft(e,t,n,s,a,r){const o=l("CommentAttachmentButton"),c=l("CommentButton");return i(),p("div",ht,[m("div",pt,[g(o,{class:"input-footer__attachment-button",disabled:!e.attachmentIconActive,"file-input-name":e.fileInputName},null,8,["disabled","file-input-name"]),g(c,{disabled:e.disableSend,type:e.computedType,class:"input-footer__send-button",onClick:e.sendComment},{default:w(()=>[...t[0]||(t[0]=[M(" ÐÑпÑавиÑÑ ",-1)])]),_:1},8,["disabled","type","onClick"])])])}const _t=$(dt,[["render",ft],["__scopeId","data-v-9a572e75"]]),Ct="оÑенка_комменÑаÑий",$t="оÑпÑавка_комменÑаÑий",me="жалоба_комменÑаÑий",yt=C({name:"CommentAttachment",components:{SvgIcon:T},emits:["remove-attachment"]},"$mTq-dQ8ch_"),vt={class:"attachment"};function gt(e,t,n,s,a,r){const o=l("SvgIcon");return i(),p("div",vt,[m("button",{class:"attachment__remove-btn",onClick:t[0]||(t[0]=c=>e.$emit("remove-attachment"))},[g(o,{class:"attachment__remove-icon",icon:"attachment-remove"})]),B(e.$slots,"default",{},void 0,!0)])}const le=$(yt,[["render",gt],["__scopeId","data-v-be27b819"]]),wt=C({name:"FullscreenView",components:{SvgIcon:T},emits:["close"],methods:{close(){this.$emit("close")}}},"$Av5uep4-MN"),kt={class:"fullscreen-view"};function It(e,t,n,s,a,r){const o=l("SvgIcon");return i(),p("div",kt,[g(o,{tag:"button",icon:"close-cross",class:"fullscreen-view__close",onClick:e.close},null,8,["onClick"]),B(e.$slots,"default",{},void 0,!0)])}const ue=$(wt,[["render",It],["__scopeId","data-v-b5a23e76"]]),St=C({name:"FullscreenImage",components:{FullscreenView:ue},props:{image:{type:String,required:!0}},emits:["close"],methods:{close(){this.$emit("close")}}},"$Pr5R7p1Gb4"),At=["src"];function bt(e,t,n,s,a,r){const o=l("FullscreenView");return i(),u(o,{onClose:e.close},{default:w(()=>[m("div",{class:"fullscreen-image__wrapper",onClick:t[0]||(t[0]=j((...c)=>e.close&&e.close(...c),["self"]))}
2,[m("img",{src:e.image,alt:"",class:"fullscreen-image__image"},null,8,At)])]),_:1},8,["onClose"])}const de=$(St,[["render",bt],["__scopeId","data-v-562a0c77"]]),Et=C({name:"CommentImageAttachment",components:{CommentAttachment:le},props:{attachment:{type:String,required:!0}},emits:["remove-attachment"],methods:{openFullscreen(){L().open(de,{image:this.attachment},{transition:"modal-fade"})}}},"$0xi8725JsU"),Tt=["src"];function Lt(e,t,n,s,a,r){const o=l("CommentAttachment");return i(),u(o,{class:"image-attachment",onRemoveAttachment:t[1]||(t[1]=c=>e.$emit("remove-attachment"))},{default:w(()=>[m("img",{src:e.attachment,alt:"ÐаÑÑинка",class:"image-attachment__image",onClick:t[0]||(t[0]=(...c)=>e.openFullscreen&&e.openFullscreen(...c))},null,8,Tt)]),_:1})}const Nt=$(Et,[["render",Lt],["__scopeId","data-v-6cd0ed47"]]),Dt=C({name:"VideoModal",components:{FullscreenView:ue},props:{video:{type:Object,required:!0}},emits:["close"],methods:{close(){this.$emit("close")}}},"$NOkQUmHWJt"),Mt=["innerHTML"];function Rt(e,t,n,s,a,r){const o=l("FullscreenView");return i(),u(o,{class:"fullscreen-video",onClose:e.close},{default:w(()=>[m("div",{class:"fullscreen-video__embed-wrapper",innerHTML:e.video.embed},null,8,Mt)]),_:1},8,["onClose"])}const he=$(Dt,[["render",Rt],["__scopeId","data-v-5eb63aa6"]]),Ft=C({name:"CommentVideoAttachment",components:{CommentAttachment:le,SvgIcon:T},props:{video:{type:Object,required:!0}},emits:["remove-attachment"],methods:{removeAttachment(){this.$emit("remove-attachment")},openFullscreen(){L().open(he,{video:this.video},{transition:"modal-fade"})}}},"$W3t6f2JXux"),Bt=["src","alt"];function Ot(e,t,n,s,a,r){const o=l("SvgIcon"),c=l("CommentAttachment");return i(),u(c,{class:"video-attachment",onRemoveAttachment:e.removeAttachment},{default:w(()=>[g(o,{icon:"play",tag:"button",class:"video-attachment__video-play",onClick:e.openFullscreen},null,8,["onClick"]),m("img",{src:e.video.thumb,alt:e.video.type,onClick:t[0]||(t[0]=(...y)=>e.openFullscreen&&e.openFullscreen(...y))},null,8,Bt)]),_:1},8,["onRemoveAttachment"])}const Pt=$(Ft,[["render",Ot],["__scopeId","data-v-c2880bd9"]]),Ut=C({name:"FileSizeError",components:{ErrorModal:J},emits:["close"],methods:{close(){this.$emit("close")}}},"$8DZR9VJHUC");function Ht(e,t,n,s,a,r){const o=l("ErrorModal");return i(),u(o,{class:"file-size-error",onClose:e.close},{default:w(()=>[...t[0]||(t[0]=[m("p",{class:"file-size-error__text"},"CлиÑком болÑÑой Ñайл. ÐакÑималÑнÑй Ñайл Ð´Ð»Ñ Ð·Ð°Ð³ÑÑзки â 1 Ðб",-1)])]),_:1},8,["onClose"])}const Vt=$(Ut,[["render",Ht]]),qt=C({name:"FileSizeErrorActionSheet",components:{ErrorActionSheet:X},emits:["close"],methods:{close(){this.$emit("close")}}},"$MgUG4G76Ju");function zt(e,t,n,s,a,r){const o=l("ErrorActionSheet");return i(),u(o,{class:"file-size-error-action-sheet",onClose:e.close},{default:w(()=>[...t[0]||(t[0]=[m("p",{class:"file-size-error-action-sheet__text"}," CлиÑком болÑÑой Ñайл. ÐакÑималÑнÑй Ñайл Ð´Ð»Ñ Ð·Ð°Ð³ÑÑзки â 1 Ðб ",-1)])]),_:1},8,["onClose"])}const jt=$(qt,[["render",zt],["__scopeId","data-v-df4576af"]]),Yt=C({name:"FileTypeErrorActionSheet",components:{ErrorActionSheet:X},emits:["close"],methods:{close(){this.$emit("close")}}},"$mMLAuiUb-0");function Wt(e,t,n,s,a,r){const o=l("ErrorActionSheet");return i(),u(o,{class:"file-type-error-action-sheet",onClose:e.close},{default:w(()=>[...t[0]||(t[0]=[m("p",{class:"file-type-error-action-sheet__text"}," Ðе можем загÑÑзиÑÑ Ñакой Ñайл. ÐÑбеÑиÑе изобÑажение ÑоÑмаÑа png, jpg, jpeg или gif ",-1)])]),_:1},8,["onClose"])}const Gt=$(Yt,[["render",Wt],["__scopeId","data-v-d691c666"]]),Zt=C({name:"FileTypeError",components:{ErrorModal:J},emits:["close"],methods:{close(){this.$emit("close")}}},"$sJC7YPlw4e");function Kt(e,t,n,s,a,r){const o=l("ErrorModal");return i(),u(o,{class:"file-type-error",onClose:e.close},{default:w(()=>[...t[0]||(t[0]=[m("p",{class:"file-type-error__text"}," Ðе можем загÑÑзиÑÑ Ñакой Ñайл. ÐÑбеÑиÑе изобÑажение ÑоÑмаÑа png, jpg, jpeg или gif ",-1)])]),_:1},8,["onClose"])}const Jt=$(Zt,[["render",Kt]]),Xt="ÐапиÑиÑе комменÑаÑий",Qt="ÐвÑоÑизÑйÑеÑÑ, ÑÑÐ¾Ð±Ñ Ð¾ÑÑавиÑÑ ÐºÐ¾Ð¼Ð¼ÐµÐ½ÑаÑий";function xt(e){return!(e!=null&&e.sub)}function en(e){return e?Qt:Xt}const tn=C({name:"CommentInput",directives:{clickOutside:te},components:{CommentInputActions:_t,CommentImageAttachment:Nt,CommentVideoAttachment:Pt},props:{comment:{type:Object,default(){return null}},type:{type:String,default:"primary"},buttonDisabled:{type:Boolean,default:!1},inputContent:{type:String,default:""}},emits:["focus-input","input-mount","analytics","show-login","send"],data(){return{active:!1,isHovered:!1,scrolled:!1,scrollY:0,scrollTimer:0,analyticIsSend:!1,inputState:ye({value:"",attachments:[],notSavedFiles:[],action:"",video:{delete:!1,content:{}}})}},computed:{isPrimary(){return this.type==="primary"},analyticEventName(){return this.isMainInput?re:this.isReply?D:ae},isMainInput(){return this.isPrimary&&!this.comment},isReply(){return!this.isPrimary&&!this.comment},isEditing(){return!this.isPrimary&&this.comment},disableSend(){return!this.isCommentEdited||this.buttonDisabled},isUserExist(){return d().isUserExists},isLocked(){return xt(d().userData)},placeholder(){return en(this.isLocked)},video(){var e,t;if(!this.inputState.video.delete)return(t=(e=this.comment)==null?void 0:e.videos)==null?void 0:t[0]},fileInputName(){var e;return`file-input-${((e=this.comment)==null?void 0:e.id)??this.type}`},inputClass(){const e="input";return{[`${e}--primary`]:this.type==="primary",[`${e}--secondary`]:this.type==="secondary",[`${e}--active`]:this.active,[`${e}--has-attachments`]:this.isInputHasAttachments,[`${e}--locked`]:this.isLocked}},isInputHasAttachments(){return this.inputState.attachments.length>0||this.type==="secondary"&&this.isCommentHasFiles},isCommentHasFiles(){var e,t;return((t=(e=this.comment)==null?void 0:e.files)==null?void 0:t.length)>0},isInputHasComment(){return!!this.comment},isCommentNotEmpty(){var n,s;const e=this.inputState.attachments.length>0,t=this.inputState.action==="delete-attachment";return!!this.inputState.value.trim()||e||this.isCommentHasFiles&&!t||!this.inputState.video.delete&&((s=(n=this.comment)==null?void 0:n.videos)==null?void 0:s.length)>0},isCommentEdited(){var s;const e=this.inputState.attachments.length>0,t=this.inputState.action==="delete-attachment",n=this.inputState.video.delete;return this.isInputHasComment?(this.inputState.value!==((s=this.comment)==null?void 0:s.content)||e||t||n)&&this.isCommentNotEmpty:(this.inputState.value.trim()||e)&&this.isCommentNotEmpty},imageContent(){return this.isCommentHasFiles&&this.inputState.action!=="delete-attachment"&&this.inputState.notSavedFiles.length===0?$e(this.comment.files[0]).path:this.inputState.notSavedFiles[0]},attachmentIconActive(){return this.active||this.isHovered||this.isCommentNotEmpty}},watch:{scrolled:{handler(e){e&&(window.scrollTo(0,this.scrollY),this.$emit("focus-input"))}},isLocked(e){e&&this.deactivateInput(),this.setHeight()}},beforeMount(){this.inputState.value=this.inputContent,window.addEventListener("resize",this.setHeight)},mounted(){this.setHeight(),this.$emit("input-mount")},methods:{focusInput(){var t;if(this.isLocked)return;const e=(t=this.$refs)==null?void 0:t.textarea;e&&(e.focus(),setTimeout(()=>{this.$emit("focus-input")},200))},dropFile(e){e.preventDefault(),!this.isLocked&&this.processFile(e.dataTransfer.files[0])},setFile(e){this.isLocked||e.target.files.length>0&&this.processFile(e.target.files[0])},resetFileInput(){this.$refs.fileInput.value=""},checkFileSize(e){return e.size<1048576},errorComponent(e){const t=window.innerWidth<=768;switch(e){case"FileSizeError":return t?jt:Vt;case"FileTypeError":return t?Gt:Jt}},showFileError(e){const t=this.errorComponent(e);L().open(t,{},{transition:"modal-fade"})},processFile(e){if(!this.analyticIsSend){const n=new v({eventName:this.analyticEventName,attachments:F,action:z});this.$emit("analytics",n),this.analyticIsSend=!0}
2if(!this.checkFileSize(e)){this.showFileError("FileSizeError"),this.resetFileInput();return}if(!this.checkFileType(e.type)){this.showFileError("FileTypeError"),this.resetFileInput();return}const t=new FileReader;t.readAsDataURL(e),t.addEventListener("load",n=>{this.loadFile({file:e,fileString:n.target.result})})},checkFileType(e){return!(!(e!=null&&e.startsWith("image"))||!(e!=null&&e.includes("image/gif"))&&!(e!=null&&e.includes("image/png"))&&!(e!=null&&e.includes("image/jpeg"))&&!(e!=null&&e.includes("image/jpg")))},processImageLinkBeforePaste(e){const t=new RegExp("(\\s+)?"+e+"(\\s+)?"),n=this.inputState.value;n.indexOf(e)===0?this.inputState.value=n.replace(t,""):this.inputState.value=n.replace(t," ")},async paste(e){var y,_,f,I;if(this.isLocked){e.preventDefault();return}if(e.clipboardData.files.length>0){e.preventDefault(),this.pasteFile(e);return}const t=e.clipboardData.getData("text/plain");if(this.inputState.attachments.length>0)return;const n=t.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/gm);if(!n)return;const s=[];for(const k of n){const S=$fetch(k,{method:"head"}).catch(Ce=>{console.error("paste fetch url error",Ce)});s.push(S)}let a=[];a=await Promise.allSettled(s);let r=null;for(const k of a){if(k.status==="rejected")continue;const S=(_=(y=k.value)==null?void 0:y.headers)==null?void 0:_["content-type"];if(!(S!=null&&S.startsWith("image"))&&this.checkFileType(S)&&!(Number((I=(f=k.value)==null?void 0:f.headers)==null?void 0:I["content-length"])>=1048576)){r=k;break}}if(!r)return;const o=r.value.config.url,c=await $fetch(o,{responseType:"blob",method:"get"}).catch(k=>{throw console.error("paste image fetch error",k),""});this.processFile(c.data),this.processImageLinkBeforePaste(o,t)},pasteFile(e){const t=e.clipboardData.files[0];this.processFile(t)},deactivateInput(){this.$refs.textarea.blur(),this.active=!1},activateInput(){this.isLocked||(this.active=!0,this.focusInput())},onFormClick(){if(this.isLocked){this.requestLogin();return}this.activateInput()},requestLogin(){this.$emit("show-login")},showLogin(){if(setTimeout(()=>{this.deactivateInput()},0),this.isCommentEdited){const e=new v({eventName:H,action:"",element:$t});this.$emit("show-login",{callback:this.sendComment,analyticData:e})}},removeAttachment(){if(this.isCommentHasFiles&&this.inputState.notSavedFiles[0]!==this.imageContent){if(this.inputState.action="delete-attachment",!this.analyticIsSend){const e=new v({eventName:this.analyticEventName,attachments:F,action:z});this.$emit("analytics",e),this.analyticIsSend=!0}}else this.inputState.notSavedFiles=[],this.inputState.attachments=[],this.resetFileInput();this.setHeight()},removeVideo(){var e;this.inputState.video.delete=!0,this.inputState.video.content=(e=this.comment)==null?void 0:e.videos[0],this.setHeight()},loadFile(e){this.inputState.attachments[0]=e.file,this.inputState.notSavedFiles[0]=e.fileString,this.setHeight()},applySending(){if(this.isLocked){this.requestLogin();return}if(!this.isUserExist){this.showLogin();return}this.sendComment()},sendComment(){this.isCommentEdited&&this.$emit("send",this.inputState)},async onInputTextarea(e){if(!this.isLocked&&(await this.setHeight(),this.inputState.value=e.target.value,!this.analyticIsSend)){this.analyticIsSend=!0;const t=new v({eventName:this.analyticEventName,action:z});this.$emit("analytics",t)}},async setHeight(){const e=this.$refs.textarea;await this.$nextTick(),e&&(e.style.height="auto",e.style.height=e.scrollHeight+"px")},setHovered(e){this.isHovered=e}}},"$KkcMxaerAt"),nn={class:"input__input-wrapper"},on=["tabindex","readonly","value","placeholder","aria-label"],sn={key:0,class:"input__locked-placeholder","aria-hidden":"true"},an={class:"input__locked-placeholder-title"},rn=["id"],cn={class:"input__attachments"};function mn(e,t,n,s,a,r){const o=l("CommentImageAttachment"),c=l("CommentVideoAttachment"),y=l("CommentInputActions"),_=Q("click-outside");return Z((i(),p("form",{class:E(["input",e.inputClass]),onDragover:t[3]||(t[3]=j(()=>{},["prevent"])),onDrop:t[4]||(t[4]=(...f)=>
2e.dropFile&&e.dropFile(...f)),onSubmit:t[5]||(t[5]=j(()=>{},["prevent"])),onMouseover:t[6]||(t[6]=f=>e.setHovered(!0)),onMouseleave:t[7]||(t[7]=f=>e.setHovered(!1)),onClick:t[8]||(t[8]=(...f)=>e.onFormClick&&e.onFormClick(...f))},[m("div",nn,[m("textarea",{ref:"textarea",rows:"1",tabindex:e.isLocked?-1:0,readonly:e.isLocked,class:"input__textarea",contenteditable:"true",value:e.inputState.value,placeholder:e.isLocked?"":e.placeholder,"aria-label":e.isLocked?e.placeholder:void 0,onPaste:t[0]||(t[0]=(...f)=>e.paste&&e.paste(...f)),onInput:t[1]||(t[1]=(...f)=>e.onInputTextarea&&e.onInputTextarea(...f))},null,40,on),e.isLocked&&!e.inputState.value?(i(),p("div",sn,[m("span",an,b(e.placeholder),1)])):h("",!0),m("input",{id:e.fileInputName,ref:"fileInput",accept:".jpg, .jpeg, .png, .gif",class:"input__file-input",type:"file",onChange:t[2]||(t[2]=(...f)=>e.setFile&&e.setFile(...f))},null,40,rn),m("div",cn,[e.imageContent?(i(),u(o,{key:0,attachment:e.imageContent,class:"input__image-attachment",onRemoveAttachment:e.removeAttachment},null,8,["attachment","onRemoveAttachment"])):h("",!0),e.video?(i(),u(c,{key:1,video:e.video,class:"input__video-attachment",onRemoveAttachment:e.removeVideo},null,8,["video","onRemoveAttachment"])):h("",!0)])]),g(y,{"file-input-name":e.fileInputName,"disable-send":e.disableSend||e.isLocked,"image-content":e.imageContent,comment:e.comment,type:e.type,"attachment-icon-active":e.attachmentIconActive&&!e.isLocked,class:"input__footer",onShowLogin:e.showLogin,onLoadFile:e.loadFile,onSend:e.applySending},null,8,["file-input-name","disable-send","image-content","comment","type","attachment-icon-active","onShowLogin","onLoadFile","onSend"])],34)),[[_,e.deactivateInput]])}const pe=$(tn,[["render",mn],["__scopeId","data-v-707b2c2f"]]),ln=C({name:"CommentInputBannedPlate",components:{SvgIcon:T},computed:{rules(){return N==="burninghut"?"https://burninghut.ru/pravila-soobshhestva/":"https://lifehacker.ru/pravila-soobshhestva/"},mail(){return N==="burninghut"?"[email protected]":"[email protected]"}}},"$y2_Df3vd96"),un={class:"comment-input-banned-plate"},dn={class:"comment-input-banned-plate__content"},hn={class:"comment-input-banned-plate__text"},pn=["href"],fn=["href"];function _n(e,t,n,s,a,r){const o=l("SvgIcon");return i(),p("div",un,[m("div",dn,[g(o,{class:"comment-input-banned-plate__icon",icon:"banned-icon"}),m("div",hn,[t[0]||(t[0]=M(" ÐÐ°Ñ Ð°ÐºÐºÐ°ÑÐ½Ñ Ð·Ð°Ð±Ð»Ð¾ÐºÐ¸Ñован за наÑÑÑение ",-1)),m("a",{href:e.rules},"пÑавил ÑообÑеÑÑва",8,pn),t[1]||(t[1]=M(". ÐÑли пÑоизоÑла оÑибка, напиÑиÑе на ",-1)),m("a",{href:"mailto:"+e.mail},b(e.mail),9,fn),t[2]||(t[2]=M(". ",-1))])])])}const Cn=$(ln,[["render",_n],["__scopeId","data-v-22adf444"]]),$n=C({name:"FileImage",props:{file:{type:Object,required:!0}},methods:{openFullscreen(){L().open(de,{image:this.file.path},{transition:"modal-fade"})}}},"$1TypXxvdZS"),yn={class:"file-image"},vn=["src"];function gn(e,t,n,s,a,r){return i(),p("div",yn,[m("img",{class:"file-image__img",src:e.file.path,alt:"",onClick:t[0]||(t[0]=(...o)=>e.openFullscreen&&e.openFullscreen(...o))},null,8,vn)])}const wn=$($n,[["render",gn],["__scopeId","data-v-37453754"]]),kn=C({name:"FileVideo",components:{SvgIcon:T},props:{video:{type:Object,required:!0}},methods:{showVideo(){L().open(he,{video:this.video},{transition:"modal-fade"})}}},"$OarapwagNl"),In={class:"file-video"},Sn=["src","alt"];function An(e,t,n,s,a,r){const o=l("SvgIcon");return i(),p("div",In,[g(o,{icon:"play",tag:"button",class:"file-video__play",onClick:e.showVideo},null,8,["onClick"]),m("img",{class:"file-video__preview",src:e.video.thumb,alt:e.video.type,onClick:t[0]||(t[0]=(...c)=>e.showVideo&&e.showVideo(...c))},null,8,Sn)])}const bn=$(kn,[["render",An],["__scopeId","data-v-ef0881d0"]]),En=C({name:"CommentFiles",components:{FileImage:wn,FileVideo:bn},props:{comment:{type:Object,required:!0}},computed:{isCommentHasVideo(){return this.comment.videos.length>0},mappedFiles(){return ve(this.comment.files)}}},"$39aQ9Jufvi"),Tn={class:"comment-files"};function Ln(e,t,n,s,a,r){const o=l("FileImage"),c=l("FileVideo");return i(),p("div",Tn,[(i(!0),p(P,null,U(e.mappedFiles,(y,_)=>
2(i(),u(o,{key:_,class:"comment-files__image",file:y},null,8,["file"]))),128)),e.isCommentHasVideo?(i(),u(c,{key:0,class:"comment-files__video",video:e.comment.videos[0]},null,8,["video"])):h("",!0)])}const Nn=$(En,[["render",Ln],["__scopeId","data-v-71a72622"]]),Dn=C({name:"IconButton",components:{SvgIcon:T},props:{label:{type:String,default:"Ðнопка"},icon:{type:String,required:!0}},emits:["click"]},"$2bwdiBNJ6l");function Mn(e,t,n,s,a,r){const o=l("SvgIcon");return i(),u(o,{class:"icon-button",tag:"button","aria-label":e.label,icon:e.icon,onClick:t[0]||(t[0]=c=>e.$emit("click"))},{default:w(()=>[B(e.$slots,"default")]),_:3},8,["aria-label","icon"])}const V=$(Dn,[["render",Mn]]);function R(e,t){return e==null||e===""||t==null||t===""?!1:String(e)===String(t)}const Rn=C({name:"CommentFooter",components:{CommentButton:ce,IconButton:V},props:{comment:{type:Object,required:!0},showReply:{type:Boolean,required:!0}},emits:["show-login","send-rate","open-reply","close-reply"],computed:{userData(){return d().userData},isUserExist(){return d().isUserExists},isUserBanned(){return d().isUserBanned},isShowRatingButtons(){return!this.isUserBanned},isShowReplyButton(){return!this.showReply&&!this.isUserBanned},userId(){var e;return(e=this.userData)==null?void 0:e.sub},isOwnComment(){return R(this.comment.author_id,this.userId)},isLiked(){var e;return!!((e=this.likes)!=null&&e.find(t=>R(t.author_id,this.userId)))},isDisliked(){var e;return!!((e=this.dislikes)!=null&&e.find(t=>R(t.author_id,this.userId)))},likesClass(){var t;const e="comment-footer__button";return{[`${e}--liked`]:this.isLiked&&!this.isOwnComment,[`${e}--own-comment`]:this.isOwnComment,[`${e}--empty`]:!((t=this.likes)!=null&&t.length)}},dislikeClass(){var t;const e="comment-footer__button";return{[`${e}--disliked`]:this.isDisliked,[`${e}--own-comment`]:this.isOwnComment,[`${e}--empty`]:!((t=this.dislikes)!=null&&t.length)}},likes(){var e,t;return((t=(e=this.comment)==null?void 0:e.reactions)==null?void 0:t.filter(n=>n.state==="like"))??[]},dislikes(){var e,t;return((t=(e=this.comment)==null?void 0:e.reactions)==null?void 0:t.filter(n=>n.state==="dislike"))??[]},likeText(){var t;const e=(t=this.likes)==null?void 0:t.length;return e===0?"+":"+"+e},dislikeText(){var t;const e=(t=this.dislikes)==null?void 0:t.length;return e===0?"-":"-"+e}},mounted(){document.addEventListener("click",this.checkClick)},methods:{showLogin(){this.$emit("show-login")},applySending(e){if(!this.isOwnComment){if(!this.isUserExist){const t=new v({eventName:H,action:"",element:Ct});this.$emit("show-login",{callback:()=>{this.sendRate(e)},analyticData:t});return}this.sendRate(e)}},sendRate(e){let t=e;this.isLiked&&e==="like"&&(t="remove like"),this.isDisliked&&e==="dislike"&&(t="remove dislike");const n={comment_id:this.comment.id,state:t};this.$emit("send-rate",n)},openInput(){this.$emit("open-reply")},closeInput(){this.$emit("close-reply")},checkClick(e){const t=e.target,n=this.$refs.replyButton,s=Array.from(t.classList),a=t===n;if(s.includes("comment-footer__button--reply")&&!this.showReply){this.closeInput();return}a&&this.openInput()}}},"$qdL-9xBD8B"),Fn={class:"comment-footer"},Bn=["disabled"],On=["disabled"];function Pn(e,t,n,s,a,r){const o=l("CommentButton"),c=l("IconButton");return i(),p("div",Fn,[e.isShowRatingButtons?(i(),p("button",{key:0,class:E([e.likesClass,"comment-footer__button comment-footer__button--reaction comment-footer__button--like"]),disabled:e.isOwnComment,onClick:t[0]||(t[0]=y=>e.applySending("like"))},[m("span",null,b(e.likeText),1)],10,Bn)):h("",!0),e.isShowRatingButtons?(i(),p("button",{key:1,class:E([e.dislikeClass,"comment-footer__button comment-footer__button--reaction comment-footer__button--dislike"]),disabled:e.isOwnComment,onClick:t[1]||(t[1]=y=>e.applySending("dislike"))},b(e.dislikeText),11,On)):h("",!0),e.isShowReplyButton?(i(),u(o,{key:2,ref:"replyButton",class:"comment-footer__button comment-footer__button--reply",onClick:e.openInput},{default:w(()=>[...t[2]||(t[2]=[M(" ÐÑвеÑиÑÑ ",-1)])]),_:1},8,["onClick"])):h("",!0),e.showReply?(i(),u(c,{key:3,class:"comment-footer__close-reply",label:"ÐÑмениÑÑ Ð¾ÑвеÑ",icon:"close-reply",onClick:e.closeInput},null,8,["onClick"])):h("",!0)])}const Un=$(Rn,[["render",Pn],["__scopeId","data-v-ae08ff71"]]),Hn=C({name:"ActionItem",components:{SvgIcon:T},props:{item:{type:Object,required:!0}},emits:["click"],computed:{actionClass(){return{[`action--${this.item.name}`]:!0}
2}},methods:{emitEvent(){this.$emit("click",this.item)}}},"$FvXWN46pTq"),Vn={class:"action__title"};function qn(e,t,n,s,a,r){const o=l("SvgIcon");return i(),p("button",{class:E([e.actionClass,"action"]),onClick:t[0]||(t[0]=(...c)=>e.emitEvent&&e.emitEvent(...c))},[g(o,{class:"action__icon",icon:e.item.icon},null,8,["icon"]),m("span",Vn,b(e.item.title),1)],2)}const fe=$(Hn,[["render",qn],["__scopeId","data-v-8ce90633"]]),zn=C({name:"ActionsPopup",components:{ActionsItem:fe},props:{comment:{type:Object,required:!0}},emits:["copy-link","delete-comment-target","report","edit","to-top","delete-comment","close"],data(){return{isShowApplyDelete:!1}},computed:{userData(){return d().userData},isUserBanned(){return d().isUserBanned},isHasChildren(){return this.comment.children.length>0},isRootComment(){return this.comment.level===0},isShowApplyDeleteButton(){return this.isShowApplyDelete&&this.isOwnComment&&!this.isUserBanned},isShowDeleteButton(){return!this.isUserBanned&&this.isOwnComment&&!this.isShowApplyDeleteButton},isShowReportButton(){return!this.isUserBanned&&!this.isOwnComment},isShowEditButton(){return!this.isUserBanned&&this.isOwnComment&&!this.isHasChildren},isOwnComment(){var e;return R(this.comment.author_id,(e=this.userData)==null?void 0:e.sub)},isShowToTopButton(){return!this.isRootComment},items(){return[{name:"edit",icon:"edit-comment",title:"РедакÑиÑоваÑÑ"},{name:"to-top",icon:"to-top",title:"РнаÑало веÑки"},{name:"copy-link",icon:"copy-link",title:"СкопиÑоваÑÑ ÑÑÑлкÑ"},{name:"report",icon:"report",title:"ÐожаловаÑÑÑÑ"},{name:"delete",icon:"delete",title:"УдалиÑÑ ÐºÐ¾Ð¼Ð¼ÐµÐ½ÑаÑий"},{name:"apply-delete",icon:"delete",title:"ТоÑно ÑдалиÑÑ?"}]}},beforeUnmount(){document.removeEventListener("keyup",this.hidePopupOnESCKey)},mounted(){document.addEventListener("keyup",this.hidePopupOnESCKey)},methods:{onClickAction(e){switch(e.name){case"copy-link":this.$emit("copy-link");break;case"delete":this.$emit("delete-comment-target"),this.showApplyDelete();break;case"report":this.$emit("report");break;case"edit":this.$emit("edit");break;case"to-top":this.$emit("to-top");break;case"apply-delete":this.$emit("delete-comment");break}},showApplyDelete(){this.isShowApplyDelete=!0},hideApplyDelete(){this.isShowApplyDelete=!1},hidePopupOnESCKey(e){e.key==="Escape"&&this.$emit("close")}}},"$Eue72ilE35"),jn={class:"actions-popup"};function Yn(e,t,n,s,a,r){const o=l("ActionsItem");return i(),p("div",jn,[e.isShowEditButton?(i(),u(o,{key:0,class:"actions-popup__item",item:e.items[0],onClick:e.onClickAction},null,8,["item","onClick"])):h("",!0),e.isShowToTopButton?(i(),u(o,{key:1,class:"actions-popup__item",item:e.items[1],onClick:e.onClickAction},null,8,["item","onClick"])):h("",!0),g(o,{class:"actions-popup__item",item:e.items[2],onClick:e.onClickAction},null,8,["item","onClick"]),e.isShowReportButton?(i(),u(o,{key:2,class:"actions-popup__item",item:e.items[3],onClick:e.onClickAction},null,8,["item","onClick"])):h("",!0),e.isShowDeleteButton?(i(),u(o,{key:3,class:"actions-popup__item",item:e.items[4],onClick:e.onClickAction},null,8,["item","onClick"])):h("",!0),e.isShowApplyDeleteButton?(i(),u(o,{key:4,class:"actions-popup__item",item:e.items[5],onClick:e.onClickAction},null,8,["item","onClick"])):h("",!0)])}const Wn=$(zn,[["render",Yn]]),Gn=C({name:"CommentActionsModal",components:{Actionsheet:ge,ActionsItem:fe},props:{comment:{type:Object,required:!0},editCallback:{type:Function,required:!0},showLogin:{type:Function,required:!0},emitReport:{type:Function,required:!0},toTop:{type:Function,required:!0}},emits:["close","analytics"],data(){return{isShowApplyDelete:!1}},computed:{userData(){return d().userData},isUserExist(){return d().isUserExists},isUserBanned(){return d().isUserBanned},isHasChildren(){return this.comment.children.length>0},isRootComment(){return this.comment.level===0},isShowApplyDeleteButton(){return this.isShowApplyDelete&&this.isOwnComment&&!this.isUserBanned},isShowDeleteButton(){return!this.isUserBanned&&this.isOwnComment&&!this.isShowApplyDeleteButton},isShowReportButton(){return!this.isUserBanned&&!this.isOwnComment},isShowEditButton(){return!this.isUserBanned&&this.isOwnComment&&!this.isHasChildren},isOwnComment(){var e;return R(this.comment.author_id,(e=this.userData)==null?void 0:e.sub)},isShowToTopButton(){return!this.isRootComment},items(){return[{name:"edit",icon:"edit-comment",title:"РедакÑиÑоваÑÑ"},{name:"to-top",icon:"to-top",title:"РнаÑало веÑки"},{name:"copy-link",icon:"copy-link",title:"СкопиÑоваÑÑ ÑÑÑлкÑ"},{name:"report",icon:"report",title:"ÐожаловаÑÑÑÑ"},{name:"delete",icon:"delete",title:"УдалиÑÑ ÐºÐ¾Ð¼Ð¼ÐµÐ½ÑаÑий"},{name:"apply-delete",icon:"delete",title:"ТоÑно ÑдалиÑÑ?"}]}},methods:{getCommentLink(){const{location:e}=window;return`${e.origin+e.pathname+e.search}#comment-${this.comment.id}`},async copyLink(){try{await ne(this.getCommentLink()),O(this.$modal,{id:Date.now(),title:"СÑÑлка ÑкопиÑована"}),this.closeActionSheet()}catch{O(this.$modal,{id:Date.now(),title:"Ðе ÑдалоÑÑ ÑкопиÑоваÑÑ ÑÑÑлкÑ"})}},closeActionSheet(){this.$emit("close")},onClickAction(e){switch(e.name){case"delete":this.showApplyDelete();break;case"edit":this.activateEdit();break;case"to-top":this.scrollToParent();break;case"apply-delete":this.applyDelete();break;case"copy-link":this.copyLink();break;case"report":this.applyReport();break}},async applyDelete(){const e=new v({action:se,eventName:A});this.$emit("analytics",e),d().setAnalytics(e),await d().deleteComment(this.comment.id),this.closeActionSheet()},activateEdit(){this.editCallback(),this.closeActionSheet()},showApplyDelete(){this.isShowApplyDelete=!0},scrollToParent(){this.closeActionSheet(),this.toTop()},applyReport(){if(this.isUserExist){const e=new v({action:ie,eventName:A});this.$emit("analytics",e),d().setAnalytics(e),this.report()}else{const e=new v({eventName:H,action:"",element:me});this.showLogin({callback:this.report,analyticData:e});return}},async report(){await d().reportComment(this.comment.id),this.emitReport(),this.closeActionSheet()},hideApplyDelete(){this.isShowApplyDelete=!1}}},"$4_48WLKhry");function Zn(e,t,n,s,a,r){const o=l("ActionsItem"),c=l("Actionsheet");return i(),u(c,{class:"actions-action-sheet","close-click-outside":!0,onClose:e.closeActionSheet},{default:w(()=>[e.isShowEditButton?(i(),u(o,{key:0,class:"actions-popup__item",item:e.items[0],onClick:e.onClickAction},null,8,["item","onClick"])):h("",!0),e.isShowToTopButton?(i(),u(o,{key:1,class:"actions-popup__item",item:e.items[1],onClick:e.onClickAction},null,8,["item","onClick"])):h("",!0),g(o,{class:"actions-popup__item",item:e.items[2],onClick:e.onClickAction},null,8,["item","onClick"]),e.isShowReportButton?(i(),u(o,{key:2,class:"actions-popup__item",item:e.items[3],onClick:e.onClickAction},null,8,["item","onClick"])):h("",!0),e.isShowDeleteButton?(i(),u(o,{key:3,class:"actions-popup__item",item:e.items[4],onClick:e.onClickAction},null,8,["item","onClick"])):h("",!0),e.isShowApplyDeleteButton?(i(),u(o,{key:4,class:"actions-popup__item",item:e.items[5],onClick:e.onClickAction},null,8,["item","onClick"])):h("",!0)]),_:1},8,["onClose"])}const Kn=$(Gn,[["render",Zn]]),Jn=C({name:"CommentActions",directives:{clickOutside:te},components:{IconButton:V,ActionsPopup:Wn},props:{comment:{type:Object,required:!0}},emits:["analytics","report","show-login","activate-edit","close"],data(){return{showPopup:!1}},computed:{isUserExist(){return d().isUserExists}},methods:{getCommentLink(){const{location:e}=window;return`${e.origin+e.pathname+e.search}#comment-${this.comment.id}`},async copyLink(){try{await ne(this.getCommentLink()),O(this.$modal,{id:Date.now(),title:"СÑÑлка ÑкопиÑована"});const e=new v({action:K,eventName:A});this.$emit("analytics",e),this.closePopup()}catch{const e=new v({action:K,eventName:A,errorMessage:"пÑоизоÑла оÑибка"});this.$emit("analytics",e),O(this.$modal,{id:Date.now(),title:"Ðе ÑдалоÑÑ ÑкопиÑоваÑÑ ÑÑÑлкÑ"})}},applyReport(){if(this.isUserExist){const e=new v({action:ie,eventName:A});this.$emit("analytics",e),d().setAnalytics(e),this.report()}else{const e=new v({eventName:H,action:"",element:me});this.$emit("analytics",e),this.showLogin({callback:this.report,analyticData:e});return}},async report(){await d().reportComment(this.comment.id),this.$emit("report"),this.closePopup()},emitReport(){this.$emit("report")},showLogin(e){this.$emit("show-login",e)},togglePopup(){window.innerWidth>=768?this.showPopup=!this.showPopup:L().open(Kn,{comment:this.comment,editCallback:this.activateEdit,showLogin:this.showLogin,emitReport:this.emitReport,toTop:this.scrollToRoot},{transition:"modal-fade",align:"bottom"})},activateEdit(){this.closePopup(),this.$emit("activate-edit")},closePopup(){this.showPopup=!1},async deleteComment(){const e=new v({action:se,eventName:A});this.$emit("analytics",e),d().setAnalytics(e),await d().deleteComment(this.comment.id),this.closePopup()},async deleteCommentTarget(){const e=new v({action:Qe,eventName:A});this.$emit("analytics",e)},scrollToRoot(){const e=document.querySelector(`#comment-${this.comment.root}`);if(!e)return;document.documentElement.style.scrollBehavior="smooth";const n=e.getBoundingClientRect().top;window.scrollBy(0,n),document.documentElement.style.scrollBehavior="",this.closePopup();const s=new v({action:xe,eventName:A});this.$emit("analytics",s)}}},"$lS3WNuPiVz"),Xn={class:"comment-actions"};function Qn(e,t,n,s,a,r){const o=l("IconButton"),c=l("ActionsPopup"),y=Q("click-outside");return i(),p("div",Xn,[g(o,{class:"comment-actions__button",label:"ÐÑкÑÑÑÑ Ð¼ÐµÐ½Ñ",icon:"comment-actions",onClick:e.togglePopup},null,8,["onClick"]),g(we,{name:"actions-fade"},{default:w(()=>[e.showPopup?Z((i(),u(c,{key:0,comment:e.comment,class:"comment-actions__popup",onCopyLink:e.copyLink,onDeleteComment:e.deleteComment,onDeleteCommentTarget:e.deleteCommentTarget,onToTop:e.scrollToRoot,onEdit:e.activateEdit,onReport:e.applyReport,onShowLogin:e.showLogin,onActivateEdit:e.activateEdit,onClose:e.closePopup,onAnalytics:t[0]||(t[0]=_=>e.$emit("analytics",_))},null,8,["comment","onCopyLink","onDeleteComment","onDeleteCommentTarget","onToTop","onEdit","onReport","onShowLogin","onActivateEdit","onClose"])),[[y,e.closePopup]]):h("",!0)]),_:1})])}const xn=$(Jn,[["render",Qn],["__scopeId","data-v-24356617"]]),eo=C({name:"CommentInfo",components:{CommentActions:xn,IconButton:V,ClientOnly:x},props:{comment:{type:Object,required:!0},isActiveEdit:{type:Boolean,default:!1}},emits:["close-edit","analytics","report","show-login","activate-edit"],setup(e){const t=()=>Je(e.comment.date_gmt),n=Ze(`COMMENT_TIME_AGO_${e.comment.id}`,t);return{commentIso:Y(()=>ke(Ke(e.comment.date_gmt))),commentTimeAgo:n,computeTimeAgo:t}},data(){return{isShowDate:!1,noscript:` 3 <noscript> 4 <style> 5 .info__comment-meta-wrapper--edit { 6 opacity: 1; 7 } 8 </style> 9 </noscript> 10 `,componentStyle:` 11 <noscript> 12 <style> 13 .info__comment-meta-wrapper--edit { 14 opacity: ${ee.isIOS?1:0}; 15 } 16 </style> 17 </noscript> 18 `}}
18,computed:{dateClass(){return{["info__comment-date--hidden"]:!this.isShowDate}},isUpdated(){return!!this.comment.updated_at},isUserExist(){return!!this.comment.avatar},userImage(){var e;return((e=this.comment.avatar)==null?void 0:e.url)||We},isDeleted(){return!!this.comment.deleted},isShowActions(){return!this.isDeleted&&!this.isActiveEdit}},mounted(){this.isShowDate=!0,this.commentTimeAgo=this.computeTimeAgo()},methods:{sendAnalytics(e){this.$emit("analytics",e)},report(){this.$emit("report")},showLogin(e){this.$emit("show-login",e)},closeEdit(){this.$emit("close-edit")},activateEdit(){this.$emit("activate-edit")}}},"$VOvJaNepvF"),to={class:"info"},no={class:"info__user-avatar"},oo=["src"],so={class:"info__comment-meta"},io={class:"info__comment-meta-wrapper"},ao={key:0,class:"info__username"},ro={class:"info__comment-meta-wrapper info__comment-meta-wrapper--edit"},co=["innerHTML"],mo=["datetime"],lo={key:0,class:"info__comment-meta-delimiter"},uo={key:1,class:"info__comment-meta-edited"},ho={class:"info__comment-meta-wrapper info__comment-meta-wrapper--edit"},po=["datetime"],fo={key:0,class:"info__comment-meta-delimiter"},_o={key:1,class:"info__comment-meta-edited"};function Co(e,t,n,s,a,r){const o=l("IconButton"),c=l("CommentActions"),y=x;return i(),p("div",to,[m("div",no,[m("img",{src:e.userImage,alt:"",class:"info__user-avatar-img"},null,8,oo)]),m("div",so,[m("div",io,[e.isUserExist?(i(),p("span",ao,b(e.comment.author),1)):h("",!0),e.isActiveEdit?(i(),u(o,{key:1,class:"info__close-edit",icon:"close-reply",onClick:t[0]||(t[0]=_=>e.$emit("close-edit"))})):h("",!0),e.isShowActions?(i(),u(c,{key:2,comment:e.comment,class:"info__actions",onShowLogin:e.showLogin,onReport:e.report,onActivateEdit:e.activateEdit,onAnalytics:e.sendAnalytics},null,8,["comment","onShowLogin","onReport","onActivateEdit","onAnalytics"])):h("",!0)]),g(y,null,{placeholder:w(()=>[m("div",ro,[(i(),u(G("style"),{"component-style":"",innerHTML:""})),Z(m("span",{innerHTML:e.noscript},null,8,co),[[Ie,!1]]),m("time",{class:"info__comment-date info__comment-date--client",datetime:e.commentIso},b(e.commentTimeAgo),9,mo),e.isUpdated?(i(),p("span",lo,"|")):h("",!0),e.isUpdated?(i(),p("span",uo,"изменено")):h("",!0)])]),default:w(()=>[m("div",ho,[m("time",{class:"info__comment-date info__comment-date--client",datetime:e.commentIso},b(e.commentTimeAgo),9,po),e.isUpdated?(i(),p("span",fo,"|")):h("",!0),e.isUpdated?(i(),p("span",_o,"изменено")):h("",!0)])]),_:1})])])}const $o=$(eo,[["render",Co],["__scopeId","data-v-fde6c2c6"]]),yo=C({name:"CommentReportPlate"},"$gm-4DPDCfZ"),vo={class:"comment-report-plate"};function go(e,t,n,s,a,r){return i(),p("p",vo,"ÐÐ ÐÐÐРЯÐÐ ÐÐШУ ÐÐÐÐÐУ")}const wo=$(yo,[["render",go],["__scopeId","data-v-757281e5"]]),ko="лайк",Io="дизлайк",So="комменÑаÑий_дизлайк",Ao="комменÑаÑий_лайк",bo=C({name:"Comment",components:{CommentInfo:$o,CommentInput:pe,CommentFooter:Un,CommentFiles:Nn,CommentReportPlate:wo},props:{comment:{type:Object,required:!0}},emits:["comment-mount","analytics","show-login"],data(){return{isShowEdit:!1,isShowReply:!1,isReported:!1,buttonDisabled:!1,focusedInput:!1}},computed:{userData(){return d().userData},isUserBanned(){return d().isUserBanned},commentId(){return`comment-${this.comment.id}`},commentClass(){return{["comment--deleted"]:this.isDeleted}},commentForInput(){const e={...this.comment};if(this.isShowReply)return null;if(window){const t=document.createElement("div");t.innerHTML=e.content,e.content=t.innerText||""}return e},isShowCommentVerifyPlate(){return this.comment.audit_status_id===2},isShowReportPlate(){return this.isReported},commentContent(){return this.commentContentLinkProcessing(this.comment.content)},isShowFiles(){return(this.comment.files.length>0||this.comment.videos.length>0)&&!this.isShowEdit},isDeleted(){return!!this.comment.deleted},isShowCommentFooter(){return!this.isShowEdit&&!this.isDeleted&&!this.isUserBanned},isShowNestedComments(){return this.comment.children.length>0},inputContent(){var e;return this.isShowEdit?((e=this.commentForInput)==null?void 0:e.content)??"":""},contentClass(){const e="comment__content";return{[`${e}--deleted`]:this.isDeleted&&!this.isShowCommentVerifyPlate,[`${e}--moderated`]:this.isShowCommentVerifyPlate,[`${e}--banned`]:this.isUserBanned}}},beforeMount(){},mounted(){this.comment.isNeedEmitMountEvent&&this.$emit("comment-mount",this.commentId)},methods:{async sendAnalytics(e){await this.$nextTick(),this.$emit("analytics",e)},sanitizeHtmlLinkProtocol(e){return Ge(e,{allowedAttributes:{a:["href","rel","target"]},transformTags:{a:function(t,n){try{const s=new URL(n.href);return s.protocol==="http:"&&(s.protocol="https:"),{tagName:t,attribs:{...n,href:s.toString()}}}catch{return{tagName:t,attribs:n}}}}})},commentContentLinkProcessing(e){let t=/test/,n=/test/;return N==="lifehacker"&&(t=/https?:\/\/(www\.)?(?!(www\.)?(dev\.|stage\.)?(lifehacker|lifebeta))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9@:%_+~#?&//=]*)(?![^<>]*>|[^"]*?<\/a)/gm),N==="burninghut"&&(t=/https?:\/\/(www\.)?(?!(www\.)?(dev\.|stage\.)?(burninghut))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9@:%_+~#?&//=]*)(?![^<>]*>|[^"]*?<\/a)/gm),N==="lifehacker"&&(n=/https?:\/\/(www\.)?((www\.)?(dev\.|stage\.)?(lifehacker|lifebeta))\.ru\b([-a-zA-Z0-9@:%_+~#?&//=]*)(?![^<>]*>|[^"]*?<\/a)/gm),N==="burninghut"&&(n=/https?:\/\/(www\.)?((www\.)?(dev\.|stage\.)?(burninghut))\.ru\b([-a-zA-Z0-9@:%_+~#?&//=]*)(?![^<>]*>|[^"]*?<\/a)/gm),e.replace(t,a=>`<a rel="nofollow" href="${a}" target="_blank">${a}</a>`).replace(n,a=>`<a target="_blank" href="${a}">${a}</a>`)},onChildMount(e){this.$emit("comment-mount",e)}
18,reportComment(){this.isReported=!0},showLogin(e){this.$emit("show-login",e)},sendRate(e){try{const n=e.state==="like"||e.state==="remove like"?ko:Io,s=nt;let a={},r=Ao;(e.state==="remove like"||e.state==="remove dislike")&&(r=So,e.state=null),a=new v({action:n,element:r,eventName:s}),this.$emit("analytics",a),d().setAnalytics(a),d().setLikes(e)}catch(t){this.errorCallback("sendRate",t)}},async saveComment(e){var t;try{this.buttonDisabled=!0,this.isShowEdit&&await this.sendEditedComment(e),this.isShowReply&&await this.sendReply(e),this.closeReply(),this.closeEdit(),this.buttonDisabled=!1,(t=this.$refs.commentInput)==null||t.resetFileInput()}catch(n){this.errorCallback("save-comment",n),this.buttonDisabled=!1}},async sendEditedComment(e){var a;const n={comment:{id:this.comment.id,content:e.value},postId:this.comment.post_ID};n.newFiles=e.attachments,n.video=e.video,(e.action==="delete-attachment"||this.comment.files.length>0&&e.attachments.length>0)&&(n.oldFiles=this.comment.files);const s=new v({eventName:ae,action:W});((a=n.newFiles)==null?void 0:a.length)>0&&(s.attachments=F),this.$emit("analytics",s),d().setAnalytics(s),d().saveEditedComment(n)},async sendReply(e){var s;const t=new v({action:W,eventName:D});((s=e.attachments)==null?void 0:s.length)>0&&(t.attachments=F),this.$emit("analytics",t),d().setAnalytics(t);const n=this.comment.parent!==0?this.comment.id:this.comment.root;await oe(e,n)},errorCallback(e,t){this.isUserBanned&&(this.closeReply(),this.closeEdit()),console.error(e,t)},async scrollToInput(){this.focusedInput||(await this.$nextTick(),setTimeout(()=>{var o;const e=window.innerWidth<768,t=(o=this.$refs.commentInput)==null?void 0:o.$el,n=t.getBoundingClientRect(),s=n.height,a=n.top,r=window.innerHeight;document.documentElement.style.scrollBehavior="smooth",e||a+s+16>r&&window.scrollBy(0,a-r+s+16),e&&t.scrollIntoView({behavior:"smooth",block:"center"}),document.documentElement.style.scrollBehavior=""},300),this.focusedInput=!0)},focusInput(){var e;(e=this.$refs.commentInput)==null||e.activateInput()},async openReply(){this.closeEditWithAnalytic(),this.isShowReply=!0,await this.$nextTick();const e=new v({eventName:A,action:D});this.$emit("analytics",e),this.focusInput()},closeReplyWithAnalytic(){if(!this.closeReply())return;const e=new v({eventName:D,action:tt});this.$emit("analytics",e)},closeEditWithAnalytic(){if(!this.closeEdit())return;const e=new v({eventName:D,action:et});this.$emit("analytics",e)},closeReply(){return this.isShowReply?(this.isShowReply=!1,this.focusedInput=!1,!0):!1},closeEdit(){return this.isShowEdit?(this.isShowEdit=!1,this.focusedInput=!1,!0):!1},async activateEdit(){this.closeReplyWithAnalytic(),this.isShowEdit=!0,await this.$nextTick(),this.focusInput()}}},"$0SUFgHVph8"),Eo=["id"],To={class:"comment__wrapper"},Lo=["innerHTML"],No={key:0,class:"comment__input-wrapper"},Do={key:1,class:"comment__nested-comments"};function Mo(e,t,n,s,a,r){const o=l("CommentInfo"),c=l("CommentReportPlate"),y=l("CommentFiles"),_=l("CommentFooter"),f=l("CommentInput"),I=l("Comment",!0);return i(),p("div",{class:E(["comment",e.commentClass])},[m("div",{id:`comment-${e.comment.id}`,class:"comment__anchor-target"},null,8,Eo),m("div",To,[g(o,{"is-active-edit":e.isShowEdit,class:"comment__info",comment:e.comment,onReport:e.reportComment,onAnalytics:e.sendAnalytics,onShowLogin:e.showLogin,onCloseEdit:e.closeEditWithAnalytic,onActivateEdit:e.activateEdit},null,8,["is-active-edit","comment","onReport","onAnalytics","onShowLogin","onCloseEdit","onActivateEdit"]),e.isShowReportPlate?(i(),u(c,{key:0,class:"comment__report-plate"})):h("",!0),e.isShowEdit?h("",!0):(i(),p("div",{key:1,class:E([e.contentClass,"comment__content"]),innerHTML:e.commentContent},null,10,Lo)),e.isShowFiles?(i(),u(y,{key:2,class:"comment__files",comment:e.comment},null,8,["comment"])):h("",!0),e.isShowCommentFooter?(i(),u(_,{key:3,"show-reply":e.isShowReply,comment:e.comment,onShowLogin:e.showLogin,onSendRate:e.sendRate,onOpenReply:e.openReply,onCloseReply:e.closeReplyWithAnalytic},null,8,["show-reply","comment","onShowLogin","onSendRate","onOpenReply","onCloseReply"])):h("",!0),e.isShowEdit?(i(),u(f,{key:4,ref:"commentInput","button-disabled":e.buttonDisabled,comment:e.commentForInput,"input-content":e.inputContent,class:"comment__input comment__input--edit",type:"secondary",onShowLogin:e.showLogin,onFocusInput:e.scrollToInput,onSend:e.saveComment},null,8,["button-disabled","comment","input-content","onShowLogin","onFocusInput","onSend"])):h("",!0)]),e.isShowReply?(i(),p("div",No,[g(f,{ref:"commentInput","button-disabled":e.buttonDisabled,comment:e.commentForInput,"input-content":e.inputContent,class:"comment__input comment__input--reply",type:"secondary",onShowLogin:e.showLogin,onFocusInput:e.scrollToInput,onSend:e.saveComment},null,8,["button-disabled","comment","input-content","onShowLogin","onFocusInput","onSend"])])):h("",!0),e.isShowNestedComments?(i(),p("div",Do,[(i(!0),p(P,null,U(e.comment.children,k=>(i(),u(I,{key:k.id,comment:k,onCommentMount:e.onChildMount,onShowLogin:e.showLogin,onAnalytics:e.sendAnalytics},null,8,["comment","onCommentMount","onShowLogin","onAnalytics"]))),128))])):h("",!0)],2)}const Ro=$(bo,[["render",Mo],["__scopeId","data-v-52092839"]]),Fo=C({name:"TheMain",components:{Comment:Ro},props:{comments:{type:Array,required:!0}},emits:["analytics","comment-mount","show-login"],methods:{sendAnalytics(e){this.$emit("analytics",e)},onCommentMount(e){this.$emit("comment-mount",e)}
18,showLogin(e){this.$emit("show-login",e)}}},"$KyzQC0sNUv"),Bo={class:"main"};function Oo(e,t,n,s,a,r){const o=l("Comment");return i(),p("div",Bo,[(i(!0),p(P,null,U(e.comments,c=>(i(),u(o,{key:c.id,comment:c,onCommentMount:e.onCommentMount,onShowLogin:e.showLogin,onAnalytics:e.sendAnalytics},null,8,["comment","onCommentMount","onShowLogin","onAnalytics"]))),128))])}const Po=$(Fo,[["render",Oo]]),Uo=C({name:"CommentsPlaceholder"},"$k9jXaNqOLe"),Ho={class:"comments-placeholder"};function Vo(e,t,n,s,a,r){return i(),p("div",Ho,[...t[0]||(t[0]=[m("p",{class:"comments-placeholder__text"},"СÑанÑÑе пеÑвÑм, кÑо оÑÑÐ°Ð²Ð¸Ñ ÐºÐ¾Ð¼Ð¼ÐµÐ½ÑаÑий",-1)])])}const qo=$(Uo,[["render",Vo],["__scopeId","data-v-ff26c696"]]),zo=C({name:"PushText",components:{IconButton:V},props:{push:{type:Object,required:!0}},emits:["close"],mounted(){setTimeout(()=>{this.closePush()},this.push.timeout)},methods:{closePush(){this.$emit("close",this.push.id)}}},"$WUrP-BdCMg"),jo={class:"push"},Yo={class:"push__content"};function Wo(e,t,n,s,a,r){const o=l("IconButton");return i(),p("div",jo,[m("div",Yo,b(e.push.title),1),g(o,{class:"push__close-button",icon:"close-cross",onClick:e.closePush},null,8,["onClick"])])}const Go=$(zo,[["render",Wo]]),Zo=C({name:"PushContainers",components:{"text-push":Go},computed:{pushes(){return d().pushes}},methods:{...Se(d,["removePush"])}},"$yglsy-G3qx"),Ko={class:"push-container"};function Jo(e,t,n,s,a,r){return i(),u(be,{to:"#teleports"},[m("div",Ko,[g(Ae,{name:"list"},{default:w(()=>[(i(!0),p(P,null,U(e.pushes,o=>(i(),u(G(o.type),{key:o.id,class:"push-container__push",push:o,onClose:e.removePush},null,40,["push","onClose"]))),128))]),_:1})])])}const Xo=$(Zo,[["render",Jo]]),Qo=C({name:"Talker",components:{CommentInput:pe,CommentInputBannedPlate:Cn,TheMain:Po,CommentsPlaceholder:qo,PushContainer:Xo},emits:["analytics","comment-mount","input-mount","show-login"],data:()=>({echo:null,buttonDisabled:!1}),computed:{isUserBanned(){return d().isUserBanned},mappedComments(){return d().mappedComments},isShowComments(){var e;return((e=this.mappedComments)==null?void 0:e.length)>0},isShowBannedPlate(){return this.isUserBanned},isShowCommentsPlaceholder(){return!this.isShowComments&&!this.isUserBanned}},unmounted(){var e;(e=this.echo)==null||e.leave("post_comments_update."+d().postId)},methods:{sendAnalytics(e){this.$emit("analytics",e)},onCommentMount(e){this.$emit("comment-mount",e)},onInputMount(){this.$emit("input-mount")},blurMainInput(){var e;(e=this.$refs.commentInput)==null||e.deactivateInput()},focusMainInput(){var e;(e=this.$refs.commentInput)==null||e.activateInput()},createEcho(e){var t,n;this.echo=new Te({broadcaster:"socket.io",host:Le,path:"/talker",transports:["websocket","polling"]}),(n=(t=this.echo)==null?void 0:t.channel("post_comments_update."+e))==null||n.listen(".public.message",this.handleMessage)},async saveComment(e){var t,n,s;try{const a=new v({eventName:re,action:W});((t=e.attachments)==null?void 0:t.length)>0&&(a.attachments=F),this.$emit("analytics",a),d().setAnalytics(a),this.buttonDisabled=!0,await oe(e,0),await((n=this.$refs.commentInput)==null?void 0:n.setHeight()),this.buttonDisabled=!1,(s=this.$refs.commentInput)==null||s.resetFileInput()}catch(a){console.error("save-comment",a),this.buttonDisabled=!1}},showLogin(e){this.$emit("show-login",e)},async addCommentFromMessage(e){await this.$nextTick(),setTimeout(()=>{Ee(this.mappedComments,Number(e.id))||d().addNewCommentMutation(e)},150)},updateCommentFromMessage(e){d().updateComment(e)},handleMessage(e){if(e.event==="add_comment"){this.addCommentFromMessage(e.comment);return}this.updateCommentFromMessage(e.comment)}}},"$ilXwLNFaYT"),xo={class:"talker"},es={class:"talker__top-container"};function ts(e,t,n,s,a,r){const o=l("CommentInput"),c=l("CommentInputBannedPlate"),y=l("TheMain"),_=l("CommentsPlaceholder"),f=l("PushContainer");return i(),p("div",xo,[m("div",es,[t[0]||(t[0]=m("div",{class:"talker__headline"},"ÐомменÑаÑии",-1)),e.isUserBanned?h("",!0):(i(),u(o,{key:0,ref:"commentInput","button-disabled":e.buttonDisabled,class:"talker__input",onInputMount:e.onInputMount,onShowLogin:e.showLogin,onSend:e.saveComment,onAnalytics:e.sendAnalytics},null,8,["button-disabled","onInputMount","onShowLogin","onSend","onAnalytics"])),e.isShowBannedPlate?(i(),u(c,{key:1,class:"talker__input-plate"})):h("",!0)]),e.isShowComments?(i(),u(y,{key:0,class:"talker__main",comments:e.mappedComments,onCommentMount:e.onCommentMount,onShowLogin:e.showLogin,onAnalytics:e.sendAnalytics},null,8,["comments","onCommentMount","onShowLogin","onAnalytics"])):h("",!0),e.isShowCommentsPlaceholder?(i(),u(_,{key:1})):h("",!0),g(f)])}const ns=$(Qo,[["render",ts],["__scopeId","data-v-ac939d6b"]]),os=C({name:"CommentsContainer",TALKER_API_URL:De,PUSHER_API_URL:Ne,components:{TalkerRoot:ns,ErrorBoundary:Xe},props:{id:{type:Number,required:!0}},setup(){return{indexStore:qe(),modal:L(),pageStore:Ve(),recipesListWidgetStore:He(),route:Ue(),serviceErrorsStore:Pe(),talkerStore:d()}},data(){return{timer:null,observer:null,isFirstOpenModal:!0}},computed:{articleCommentsError(){return this.serviceErrorsStore.articleCommentsError},recipeCommentsError(){return this.serviceErrorsStore.recipeCommentsError},currentArticle(){return this.pageStore.currentArticle},isServiceError(){return this.articleCommentsError||this.recipeCommentsError},hash(){return this.route.hash},currentSlug(){return Oe(this.route.fullPath)},postId(){var e;return((e=this.currentArticle)==null?void 0:e.id)??this.recipesListWidgetStore.currentRecipeId}},async beforeMount(){this.isServiceError||!this.postId||this.talkerStore.setPostId(this.postId)},async mounted(){if(!this.isServiceError){this.createAuthEventBus(),this.goToHash(),await this.$nextTick();try{if(!this.postId)throw new Error("No postId provided");window.io=(await Be(async()=>{const{default:e}=await import("./v7.12-_pfsIBSO.js").then(t=>t.i);return{default:e}},__vite__mapDeps([0,1]),import.meta.url)).default,this.$refs.talker.createEcho(this.postId)}catch(e){console.error("Error while mounting comments",e)}}},unmounted(){window.removeEventListener("success-refresh-comments",this.successRefreshListener),window.removeEventListener("failed-refresh-comments",this.failedRefreshListener)},methods:{sendAnalytics(e){this.$sendYandexMetrika({level1:`${e.eventName}_${e.action}`})},createAuthEventBus(){document.addEventListener("success-refresh-comments",this.successRefreshListener),document.addEventListener("failed-refresh-comments",this.failedRefreshListener)},prepareAnalyticsData(e){const{eventName:t,action:n,attachments:s,currency:a,element:r,value:o,slugReferer:c,errorMessage:y,item:_}=e;return{event:t,error_message:y,slug_location:this.currentSlug,slug_referer:c,action:n,attachments:s,currency:a,element:r,value:o,item:_}},checkIOS(){return ee.isIOS},createObserver(e){this.observer=new MutationObserver(e),this.observer.observe(document,{childList:!0,subtree:!0})},goToHash(){var e;this.hash==="#write-a-comment"&&(this.scrollToInput(),this.createObserver(this.scrollToInputCallback)),this.hash==="#comments"&&(this.scrollToComments(),this.createObserver(this.scrollToCommentsCallback)),(e=this.hash)!=null&&e.match(/comment-[0-9]*/gm)&&(this.scrollToComment(this.hash),this.createObserver(this.scrollToCommentCallback))},scrollToComments(){this.$refs.commentsAnchorTarget.scrollIntoView()},scrollToComment(e){const t=document.querySelector(e);t==null||t.scrollIntoView()},scrollToCommentCallback(){this.timer&&clearTimeout(this.timer),this.scrollToComment(this.hash),this.createDestroyObserverTimer()},scrollToCommentsCallback(){this.timer&&clearTimeout(this.timer),this.scrollToComments(),this.createDestroyObserverTimer()},createDestroyObserverTimer(){this.timer=setTimeout(()=>{var e;(e=this.observer)==null||e.disconnect()},1e3)},scrollToInputCallback(){this.timer&&clearTimeout(this.timer),this.createDestroyObserverTimer(),this.scrollToInput()},scrollToInput(){this.$refs.commentsInputAnchorTarget.scrollIntoView(),setTimeout(()=>
18{this.$refs.talker.focusMainInput()},150)},prepareAnalyticModal(e){const{eventName:t,action:n,attachments:s,currency:a,element:r,value:o,slugReferer:c,item:y}=e;return{event:t,slug_location:this.currentSlug,slug_referer:c,action:n,attachments:s,currency:a,element:r,value:o,item:y}},showLoginPopup(e){Fe().requestAuthPush()},successRefreshListener(){console.log("refresh-success-talker-frontend")},failedRefreshListener(e){var s,a,r,o,c,y;const t=e.detail;((r=(a=(s=t==null?void 0:t.response)==null?void 0:s.data)==null?void 0:a.data)==null?void 0:r.isBanned)||((y=(c=(o=t==null?void 0:t.request)==null?void 0:o.data)==null?void 0:c.data)==null?void 0:y.isBanned)||(this.indexStore.logout(),Me||console.error("refresh failed CommentsContainer",t),this.isFirstOpenModal&&(Re().login(),this.isFirstOpenModal=!1))}}},"$fn5YduU5Lc"),ss={key:0,class:"comments-wrapper"},is={class:"comments__anchor",ref:"commentsAnchor",href:"#comments"},as={class:"comments__anchor",ref:"commentsAnchorInput",href:"#write-a-comment"},rs={class:"comments__anchor-target",id:"comments",ref:"commentsAnchorTarget"},cs={class:"comments__anchor-target",id:"write-a-comment",ref:"commentsInputAnchorTarget"},ms={class:"comments__container"},ls={class:"comments__container-inner"};function us(e,t,n,s,a,r){const o=l("TalkerRoot"),c=l("ErrorBoundary");return i(),u(c,{moduleName:"CommentsContainer"},{error:w(()=>[...t[0]||(t[0]=[m("p",null,"ÐеизвеÑÑÐ½Ð°Ñ Ð¾Ñибка",-1)])]),default:w(()=>[e.isServiceError?h("",!0):(i(),p("div",ss,[m("a",is,null,512),m("a",as,null,512),m("div",rs,null,512),m("div",cs,null,512),m("div",ms,[m("div",ls,[g(o,{ref:"talker",id:e.id,onShowLogin:e.showLoginPopup,onAnalytics:e.sendAnalytics},null,8,["id","onShowLogin","onAnalytics"])])])]))]),_:1})}const vs=$(os,[["render",us]]);function ds(e){const t=[],n=s=>{var r,o;if(((o=(r=s.attributes)==null?void 0:r["data-rel"])==null?void 0:o.indexOf("lightbox-gallery"))===0){const c=_e(s);t.push(...c)}else s.children.forEach(c=>n(c))};return n(e),t}function _e(e){const t=[];return e.children.forEach(n=>{n.type==="img"?t.push(n):_e(n)}),t}function gs(e){const t=q([]),n=q(0),s=q(!1),a=Y(()=>t.value.filter(_=>{var f;return!!((f=_.attributes)!=null&&f.src)}).map(_=>{var f;return(f=_.attributes)==null?void 0:f.src})),r=Y(()=>t.value.filter(_=>{var f;return!!((f=_.attributes)!=null&&f.srcset)}).map(_=>{var f;return(f=_.attributes)==null?void 0:f.srcset})),o=_=>{_>-1&&(n.value=_),s.value=!0,Ye()},c=()=>{s.value=!1,n.value=0,je()},y=_=>{if(!_||!_.composedPath)return;const f=_.composedPath().find(I=>{var k,S;return I instanceof HTMLAnchorElement&&((S=(k=I.dataset)==null?void 0:k.rel)==null?void 0:S.indexOf("lightbox-gallery"))===0});if(f instanceof HTMLAnchorElement){const I=f.querySelector("img");if(I instanceof HTMLImageElement){const{src:k}=I,S=a.value.indexOf(k);o(S),_.preventDefault()}}};return ze(()=>{t.value=e.reduce((_,f)=>{const I=ds(f);return[..._,...I]},[])}),{imagesSrc:a,imagesSrcset:r,currentImageId:n,isGalleryVisible:s,openGallery:o,closeGallery:c,checkImageClick:y}}function ws(e){}export{vs as C,gs as a,ws as u}; 19//# sourceMappingURL=v7.12-DKRimpz5.js.map
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.