PageSourceSearch

https://vashgorod.ru/static/js/9245.358b1ec3.chunk.js

js vashgorod.ru collected 2026-10-02 16:37:56 UTC 37,262 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkvg_webapp=self.webpackChunkvg_webapp||[]).push([[9245],{69245:function(e,t,s){s.r(t),s.d(t,{default:function(){return me}});var i=s(72791),n=s(68252),a=s(87915),r=s(74643),l=s(71672),o=s(74072),d=s(96399),c=s(89335),h=s(65873),u=s(84842),p=s(72152),m=s(881),g=s(31335),v=s(70406),f=s(38124),x=s(21635),b=s(83572),y=s(99138),w=s(39673),j=s(74638),k=s(41418),C=s.n(k),_=s(47279),S=s(67367),N=s.n(S),A=s(38758),P=s(53540),E=s(58340),L=s(37658),D=s(15054),I=s.n(D),T=s(33256),O=s.n(T),H=s(95907),Z=s.n(H),q=s(16895);class U{static get isReadOnlySupported(){return!0}static get enableLineBreaks(){return!0}static get toolbox(){return{icon:q.ex,title:"List"}}constructor(e){let{data:t,config:s,api:i,readOnly:n}=e;this._elements={wrapper:null},this.api=i,this.readOnly=n,this.settings=[{name:"unordered",label:this.api.i18n.t("Unordered"),icon:q.ex,default:"unordered"===s.defaultStyle||!1},{name:"ordered",label:this.api.i18n.t("Ordered"),icon:q.RW,default:"ordered"===s.defaultStyle||!0}],this._data={style:this.settings.find((e=>!0===e.default)).name,items:[]},this.data=t}render(){return this._elements.wrapper=this.makeMainTag(this._data.style),this._data.items.length?this._data.items.forEach((e=>{this._elements.wrapper.appendChild(this._make("li",this.CSS.item,{innerHTML:e}))})):this._elements.wrapper.appendChild(this._make("li",this.CSS.item)),this.readOnly||this._elements.wrapper.addEventListener("keydown",(e=>{const[t,s]=[13,8];switch(e.keyCode){case t:this.getOutofList(e);break;case s:this.backspace(e)}}),!1),this._elements.wrapper}save(){return this.data}static get conversionConfig(){return{export:e=>e.items.join(". "),import:e=>({items:[e],style:"unordered"})}}static get sanitize(){return{style:{},items:{br:!0}}}renderSettings(){return this.settings.map((e=>({...e,isActive:this._data.style===e.name,closeOnActivate:!0,onActivate:()=>this.toggleTune(e.name)})))}onPaste(e){const t=e.detail.data;this.data=this.pasteHandler(t)}static get pasteConfig(){return{tags:["OL","UL","LI"]}}makeMainTag(e){const t="ordered"===e?this.CSS.wrapperOrdered:this.CSS.wrapperUnordered,s="ordered"===e?"ol":"ul";return this._make(s,[this.CSS.baseBlock,this.CSS.wrapper,t],{contentEditable:!this.readOnly})}toggleTune(e){const t=this.makeMainTag(e);for(;this._elements.wrapper.hasChildNodes();)t.appendChild(this._elements.wrapper.firstChild);this._elements.wrapper.replaceWith(t),this._elements.wrapper=t,this._data.style=e}get CSS(){return{baseBlock:this.api.styles.block,wrapper:"cdx-list",wrapperOrdered:"cdx-list--ordered",wrapperUnordered:"cdx-list--unordered",item:"cdx-list__item"}}set data(e){e||(e={}),this._data.style=e.style||this.settings.find((e=>!0===e.default)).name,this._data.items=e.items||[];const t=this._elements.wrapper;t&&t.parentNode.replaceChild(this.render(),t)}get data(){this._data.items=[];const e=this._elements.wrapper.querySelectorAll(`.${this.CSS.item}`);for(let t=0;t<e.length;t++){e[t].innerHTML.replace("<br>"," ").trim()&&this._data.items.push(e[t].innerHTML)}return this._data}_make(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=document.createElement(e);Array.isArray(t)?i.classList.add(...t):t&&i.classList.add(t);for(const n in s)i[n]=s[n];return i}get currentItem(){let e=window.getSelection().anchorNode;return e.nodeType!==Node.ELEMENT_NODE&&(e=e.parentNode),e.closest(`.${this.CSS.item}`)}getOutofList(e){const t=this._elements.wrapper.querySelectorAll("."+this.CSS.item);if(t.length<2)return;const s=t[t.length-1],i=this.currentItem;i!==s||s.textContent.trim().length||(i.parentElement.removeChild(i),this.api.blocks.insert(),this.api.caret.setToBlock(this.api.blocks.getCurrentBlockIndex()),e.preventDefault(),e.stopPropagation())}backspace(e){const t=this._elements.wrapper.querySelectorAll("."+this.CSS.item),s=t[0];s&&t.length<2&&!s.innerHTML.replace("<br>"," ").trim()&&e.preventDefault()}selectItem(e){e.preventDefault();const t=window.getSelection(),s=t.anchorNode.parentNode.closest("."+this.CSS.item),i=new Range;i.selectNodeContents(s),t.removeAllRanges(),t.addRange(i)}pasteHandler(e){const{tagName:t}=e;let s;switch(t){case"OL":s="ordered";break;case"UL":case"LI":s="unordered"}const i={style:s,items:[]};if("LI"===t)i.items=[e.innerHTML];else{const t=Array.from(e.querySelectorAll("LI"));i.items=t.map((e=>e.innerHTML)).filter((e=>!!e.trim()))}return i}}class M{static get isReadOnlySupported(){return!0}static get toolbox(){return{icon:q.kV,title:"Quote"}}static get contentless(){return!0}static get enableLineBreaks(){return!0}static get DEFAULT_QUOTE_PLACEHOLDER(){return"Enter a quote"}static get conversionConfig(){return{import:"text",export:function(e){return e.text}}}get CSS(){return{baseClass:this.api.styles.block,wrapper:"cdx-quote",text:"cdx-quote__text",input:this.api.styles.input}}constructor(e){let{data:t,config:s,api:i,readOnly:n}=e;this.api=i,this.readOnly=n,this.quotePlaceholder=s.quotePlaceholder||M.DEFAULT_QUOTE_PLACEHOLDER,this.data={text:t.text||""}}render(){const e=this._make("blockquote",[this.CSS.baseClass,this.CSS.wrapper]),t=this._make("div",[this.CSS.input,this.CSS.text],{contentEditable:!this.readOnly,innerHTML:this.data.text});return t.dataset.placeholder=this.quotePlaceholder,e.appendChild(t),e}save(e){const t=e.querySelector(`.${this.CSS.text}`);return Object.assign(this.data,{text:t.innerHTML})}static get sanitize(){return{text:{br:!0}}}_make(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=document.createElement(e);Array.isArray(t)?i.classList.add(...t):t&&i.classList.add(t);for(const n in s)i[n]=s[n];return i}}var z=e=>({header:{class:I(),config:{placeholder:"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a",levels:[1,2,3,4],defaultLevel:2}},paragraph:{class:Z(),config:{placeholder:"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043a\u0441\u0442"}}
1,quote:{class:M,inlineToolbar:!0,config:{quotePlaceholder:"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0446\u0438\u0442\u0430\u0442\u0443"}},list:{class:U,inlineToolbar:!0,config:{defaultStyle:"unordered"}},image:{class:O(),config:{uploader:{uploadByFile(t){const s={type:5,object_type:20,object_id:`${e}`};return(0,A.Ix)(t,s).then((e=>{const{url:t}=e.items[0];return{success:1,file:{url:t}}}))}}}}});const R={messages:{ui:{blockTunes:{toggler:{"Click to tune":"\u041d\u0430\u0436\u043c\u0438\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c","or drag to move":"\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435"}},inlineToolbar:{converter:{"Convert to":"\u041a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432"}},toolbar:{toolbox:{Add:"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c"}},popover:{Filter:"\u041f\u043e\u0438\u0441\u043a","Nothing found":"\u041d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e"}},toolNames:{Text:"\u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444",Heading:"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a",List:"\u0421\u043f\u0438\u0441\u043e\u043a",Image:"\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435",Warning:"\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435",Checklist:"\u0427\u0435\u043a\u043b\u0438\u0441\u0442",Quote:"\u0426\u0438\u0442\u0430\u0442\u0430",Code:"\u041a\u043e\u0434",Delimiter:"\u0420\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c","Raw HTML":"HTML-\u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442",Table:"\u0422\u0430\u0431\u043b\u0438\u0446\u0430",Link:"\u0421\u0441\u044b\u043b\u043a\u0430",Marker:"\u041c\u0430\u0440\u043a\u0435\u0440",Bold:"\u041f\u043e\u043b\u0443\u0436\u0438\u0440\u043d\u044b\u0439",Italic:"\u041a\u0443\u0440\u0441\u0438\u0432",InlineCode:"\u041c\u043e\u043d\u043e\u0448\u0438\u0440\u0438\u043d\u043d\u044b\u0439"},tools:{warning:{Title:"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435",Message:"\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435"},link:{"Add a link":"\u0412\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u0441\u044b\u043b\u043a\u0443"},stub:{"The block can not be displayed correctly.":"\u0411\u043b\u043e\u043a \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d"},header:{"Heading 1":"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a 1","Heading 2":"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a 2","Heading 3":"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a 3","Heading 4":"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a 4","Heading 5":"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a 5","Heading 6":"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a 6"},image:{Caption:"\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435","With border":"\u0421 \u043e\u0431\u0432\u043e\u0434\u043a\u043e\u0439","Stretch image":"\u041d\u0430 \u0432\u0441\u044e \u0448\u0438\u0440\u0438\u043d\u0443","With background":"\u0421 \u0437\u0430\u043b\u0438\u0432\u043a\u043e\u0439","Can not upload an image, try another":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0434\u0440\u0443\u0433\u043e\u0435","Select an Image":"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435"},list:{Ordered:"\u041d\u0443\u043c\u0435\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439",Unordered:"\u041c\u0430\u0440\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439"}},blockTunes:{delete:{Delete:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c","Click to delete":"\u0422\u043e\u0447\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c?"},moveUp:{"Move up":"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432\u0432\u0435\u0440\u0445"},moveDown:{"Move down":"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u0437"}}}};var V=s(80184);const B={blocks:[{type:"header",data:{text:"",level:1}}]};var $=e=>{let{id:t,source:s,body:n,onChange:a}=e;const r=(0,i.useRef)(null),l=(0,L.E)();if(!t)return null;const o=z(t);return(0,V.jsx)(l,{autofocus:!0,onInitialize:e=>{r.current=e},onReady:async()=>{const e=r.current._editorJS;var t;!s&&n?await((e,t)=>{console.info("[Editor] recovery from html..."),e.blocks.clear();const s=(0,P.ZP)(t),i=t=>{switch(t.type){case"p":e.blocks.insert("paragraph",{text:E.renderToStaticMarkup(t.props.children)});break;case"img":e.blocks.insert("image",{file:{url:t.props.src},caption:"Image"===t.props.alt?"":t.props.alt,withBorder:!1,stretched:!1,withBackgroun
1d:!1});break;case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":e.blocks.insert("header",{level:+t.type.split("h")[1],text:t.props.children});break;case"blockquote":e.blocks.insert("quote",{text:E.renderToStaticMarkup(t.props.children)})}};if(Array.isArray(s))for(const n of(0,P.ZP)(t))i(n);else i(s);e.blocks.delete(0)})(e,n):await e.render(null!==s&&void 0!==s&&null!==(t=s.blocks)&&void 0!==t&&t.length?s:B)},onChange:a,i18n:R,tools:o})};const G=N()({quote:e=>`<blockquote>${e.data.text}</blockquote>`}),F={OK:"ok",LOADING:"loading",CHANGED:"changed",SAVING:"saving"};var W=e=>{let{id:t,header:s,onHide:n,onSave:a,focus:r}=e;const[l,d]=(0,i.useState)(null),[c,h]=(0,i.useState)(null),[p,m]=(0,i.useState)(null);(0,i.useEffect)((()=>{p||(h(F.LOADING),(0,A.FG)(t).then((e=>{m(e),h(F.OK)})))}),[t,p]);const g=async()=>{const e=await(null===l||void 0===l?void 0:l.saver.save());e&&(h(F.SAVING),(0,A.Y5)(p.id,{source:e,body:G.parse(e).join("")}).then((e=>a(e).then((()=>h(F.NORMAL))))))},v=async e=>{d(e),h(F.CHANGED)};return(0,V.jsx)(o.u_,{onHide:()=>{n(),r&&r()},fullscreen:!0,children:e=>(0,V.jsxs)(o.Kq,{className:"w-full",children:[(0,V.jsxs)(o.u_.Header,{onHide:e,className:"font-normal",children:[(0,V.jsxs)(o.Ug,{className:"gap-2 -ml-2 min-w-0",children:[(0,V.jsx)(u.Z,{className:"w-6 h-6 shrink-0"}),(0,V.jsx)("span",{className:"truncate",children:`\u0421\u0442\u0430\u0442\u044c\u044f #${t}`})]}),(0,V.jsxs)(o.Ug,{className:"gap-1 shrink-0",children:[(0,V.jsx)(f.ContextualHelpWidget,{articleAlias:"posteditor-create-article",className:"help-widget-trigger--compact"}),(0,V.jsx)(o.zx,{size:"small",onClick:g,loading:c===F.SAVING,disabled:c!==F.CHANGED,children:c===F.SAVING?"\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435...":"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c"}),(0,V.jsx)(o.zx,{round:!0,size:"rect",variant:"transparent",title:"\u0417\u0430\u043a\u0440\u044b\u0442\u044c",onClick:e,children:(0,V.jsx)(y.Z,{className:"w-5 h-5"})})]})]}),(0,V.jsx)(o.u_.Body,{children:(0,V.jsx)($,{...null===p||void 0===p?void 0:p.context,onChange:v})})]})})};const K=e=>{let{icon:t,onClick:s=(()=>{}),onDelete:n=(()=>{}),wide:a=!1,children:r}=e;return(0,V.jsxs)("div",{className:"rounded overflow-hidden h-16 bg-gray-400 bg-opacity-20",children:[(0,V.jsx)(o.zx,{round:!0,variant:"secondary",className:"!p-0.5 absolute right-0 z-[2] m-0.5",onClick:n,title:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c",children:(0,V.jsx)(y.Z,{className:"w-4"})}),(0,V.jsxs)("button",{className:C()(a?"w-60":"w-16","h-full flex text-left shrink"),onClick:s,children:[t&&(0,V.jsx)("div",{className:"w-16 h-16 flex justify-center shrink-0 items-center bg-gray-400 bg-opacity-60 left-0 absolute z-[1] transition-opacity hover:opacity-10 text-white dark:text-dark",children:(0,i.createElement)(t,{className:"w-6 h-6"})}),r]})]})},J=e=>{let{url:t,alt:s}=e;return(0,V.jsx)("img",{src:t?(0,_.crop)(t,_.ICON):j,className:"h-full m-auto w-16 object-contain bg-muted shrink",alt:s})},Q=(0,l.Pi)((e=>{const{id:t,progress:s,uploading:i,context:n,type:a,onDelete:r}=e;if(!0===i)return(0,V.jsx)("div",{className:"border-[1px] rounded overflow-hidden w-16 h-16 flex flex-col items-center justify-center",children:(0,V.jsx)(o.$J,{value:s,color:"#999"})});if(!n)return null;switch(a){case"photo":return(0,V.jsx)(K,{icon:c.Z,onDelete:r,children:(0,V.jsx)(J,{url:n.url,alt:`${a}-${t}`})});case"video":return(0,V.jsx)(K,{icon:h.Z,onDelete:r,children:(0,V.jsx)(J,{url:n.image,alt:`${a}-${t}`})});case"article":return(0,V.jsx)(Y,{...e});case"link":return(0,V.jsx)(X,{...e});default:return null}})),X=e=>{var t;let{id:s,progress:i,uploading:n,context:a,type:r,onDelete:l}=e;return(0,V.jsxs)(K,{wide:!0,icon:w.Z,onDelete:l,children:[(0,V.jsx)(J,{url:a.image,alt:`${r}-${s}`}),a.url?(0,V.jsxs)("a",{href:a.url,target:"_blank",rel:"noreferrer",className:"p-2 text-sm text-primary overflow-hidden flex flex-col justify-center",children:[(0,V.jsx)("span",{className:C()("font-bold block",null!==(t=a.description)&&void 0!==t&&t.length?"truncate":"line-clamp-3"),children:a.title}),a.description&&(0,V.jsx)("span",{className:"line-clamp-1",children:a.description})]}):"<\u043d\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0438>"]})},Y=e=>{let{id:t,header:s,context:i,type:n,onDelete:a,onSave:r}=e;const[l,d]=(0,m.dd)((()=>(0,V.jsx)(W,{id:t,header:s,onSave:r,onHide:d,value:i.body}
1)),[i]);return(0,V.jsxs)(K,{wide:!0,icon:u.Z,onClick:l,onDelete:a,children:[(0,V.jsx)(J,{url:i.image,alt:`${n}-${t}`}),(0,V.jsx)("div",{className:"p-2 w-full",children:i.body?(0,V.jsxs)(o.Kq,{className:"gap-0 line-clamp-2 text-sm",children:[i.header&&(0,V.jsx)("b",{children:i.header}),(0,V.jsx)("div",{children:i.litera})]}):"<\u0431\u0435\u0437 \u0442\u0435\u043a\u0441\u0442\u0430>"})]})};var ee=Q;var te=e=>{let{onSelect:t,placeholder:s="\u041f\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0444\u0430\u0439\u043b\u044b \u0441\u044e\u0434\u0430"}=e;const[n,a]=(0,i.useState)(!1),[r,l]=(0,i.useState)(!1);if((0,i.useEffect)((()=>{const e=e=>{e.preventDefault(),l(!0)},t=e=>{e.preventDefault()},s=e=>{e.preventDefault(),(!e.relatedTarget&&"dragleave"===e.type||"dragleave"!==e.type)&&l(!1)};return window.addEventListener("dragenter",e,!0),window.addEventListener("dragleave",s,!0),window.addEventListener("dragend",s,!0),window.addEventListener("dragover",t,!0),()=>{window.removeEventListener("dragenter",e,!0),window.removeEventListener("dragleave",s,!0),window.removeEventListener("dragend",s,!0),window.removeEventListener("dragover",t,!0)}}),[]),r)return(0,V.jsx)("div",{onDragLeave:e=>{e.preventDefault(),a(!1)},onDragEnter:e=>{e.dataTransfer.dropEffect="copy",a(!0)},onDrop:e=>{e.preventDefault(),t(e.dataTransfer.files),a(!1),l(!1)},className:"absolute w-full h-full bg-white z-[3]",children:(0,V.jsx)("div",{className:C()("flex transition-colors items-center pointer-events-none border-dashed justify-center border-[1px] w-full h-full rounded text-gray-500",n?"border-green-500 bg-green-50":"border-gray-100 bg-gray-50"),children:s})})},se=s(67025);const ie="link",ne="article",ae="photo",re="video",le=e=>{let{params:t,setParams:s,isGroup:i}=e;const{ref:n,isComponentVisible:a,setIsComponentVisible:l}=(0,r.O3)(!1);return(0,V.jsxs)("div",{ref:n,className:"flex items-center gap-1",children:[(0,V.jsx)(o.zx,{round:!0,variant:"secondary",title:"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438",onClick:()=>l((e=>!e)),children:(0,V.jsx)(d.Z,{className:"w-4 h-4"})}),(0,V.jsx)(o.cw,{isComponentVisible:a,setIsComponentVisible:l,ref:n,className:"left-0 w-max",render:e=>{let{item:i}=e;return i.component||(0,V.jsx)(o.cw.Option,{children:(0,V.jsx)(o.XZ,{className:"w-full",checked:t[i.id],onChange:e=>s(i.id,e.target.checked),label:i.value})},i.id)},options:i?[{value:"\u0421\u043a\u0440\u044b\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u0430",id:"no_author"},{value:"\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438",id:"no_comments"}]:[{value:"\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438",id:"no_comments"}]}),(0,V.jsx)(f.ContextualHelpWidget,{articleAlias:"posteditor-settings",className:"help-widget-trigger--compact"})]})},oe=(0,l.Pi)((e=>{let{attachments:t,handleAddFiles:s,handleAddArticle:i,isAdmin:n}=e;const{ref:a,isComponentVisible:l,setIsComponentVisible:d}=(0,r.O3)(!1);return(0,V.jsxs)("div",{className:"flex items-center gap-1",children:[(0,V.jsx)(o.zx,{ref:a,round:!0,variant:"secondary",title:"\u0412\u043b\u043e\u0436\u0435\u043d\u0438\u044f",onClick:()=>d((e=>!e)),children:(0,V.jsx)(p.Z,{className:"w-4 h-4"})}),(0,V.jsx)(o.cw,{isComponentVisible:l,setIsComponentVisible:d,ref:a,className:"left-0 w-max",render:e=>{let{item:n}=e;return(e=>{switch(e){case ae:return(0,V.jsx)(se.Z,{icon:c.Z,title:"\u0424\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f",accept:"image/*",onSelect:s},e);case re:return(0,V.jsx)(se.Z,{icon:h.Z,title:"\u0412\u0438\u0434\u0435\u043e\u043a\u043b\u0438\u043f",accept:"video/*",onSelect:s,disabled:null===t||void 0===t?void 0:t.find((e=>{let{type:t}=e;return t===re}))},e);case ne:return(0,V.jsx)(se.Z,{icon:u.Z,title:"\u0421\u0442\u0430\u0442\u044c\u044f",onSelect:i,disabled:null===t||void 0===t?void 0:t.find((e=>{let{type:t}=e;return t===ne}))},e);default:return null}})(n.id)},options:n?[{id:ae},{id:re},{id:ne}]:[{id:ae},{id:re}]}),(0,V.jsx)(f.ContextualHelpWidget,{articleAlias:"post-attachments",className:"help-widget-trigger--compact"})]})})),de=(0,l.Pi)((e=>{let{editor:t,header:s,onDelete:i,onSave:n}=e;return t.hasAttachments&&(0,V.jsx)("div",{className:"overflow-x-auto flex mb-2",children:(0,V.jsx)(o.Ug,{className:"gap-2",children:t.attachments.map(((e,t)=>(0,V.jsx)(ee,{...e,header:s,onDelete:()=>i(e.id),onSave:t=>n(e.id,t)},t)))})})})),ce=(0,l.Pi)((e=>{var t,s,n,a,l;let{editor:d,item:c,border:h=!1,useDragArea:u=!1,onClose:p,onPublish:f}=e;const[y,w]=(0,i.useState)(""),[j,k]=(0,i.useState)(null),{toastPromise:C,toastError:_}=(0,r.Ps)(),[S,N]=(0,m.dd)((()=>(0,V.jsx)(W,{id:j,onSave:e=>T(j,e),onHide:N,focus:I})),[j]),A=(0,i.useRef)(),P=(0,i.useRef)(),[E,L]=(0,i.useState)({no_author:!1,no_comments:!1});(0,i.useEffect)((()=>{d.post&&(w((0,v.XZ)(d.post.text||"")),L((e=>({...e,...d.post.params}))))}),[d.post]),(0,i.useEffect)((()=>{d.setContent(y),d.isEmpty()||P.current.focus()}),[y,d]);const D=e=>{d.addAttachments(e,(e=>_(e)))},I=()=>{d.open()},T=async(e,t)=>(await d.updateAttachment(e.id,t),await d.save(),Promise.resolve(t));if(!d)return null;const O=(0,V.jsx)(x.Z,{...null===c||void 0===c||null===(t=c.decoration)||void 0===t?void 0:t.header,id:c.id,onClose:p,edit:!0}),H=null===(s=c.permissions)||void 0===s?void 0:s.can_post_admin,Z=d.changed;return(0,V.jsxs)("div",{ref:A,className:"post-editor",children:[u&&(0,V.jsx)(te,{onSelect:D}),(0,V.jsxs)(o.Kq,{className:"gap-3 justify-between h-[calc(100svh-4.5rem)] sm:h-[calc(100svh-5.5rem)]",children:[(0,V.jsx)(b.Z,{ref:P,placeholder:d.expand?"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043a\u0441\u0442":"\u0427\u0442\u043e \u0443 \u0432\u0430\u0441 \u043d\u043e\u0432\u043e\u0433\u043e?",value:y,disabled:d.disabled,border:h,onPaste:e=>
1{e.files.length&&D(e.files);const t=e.getData("Text");if(t){const e=(0,v.Lf)(t);e&&!d.attachments.find((e=>{let{type:t}=e;return t===ie}))&&d.addLinks(e)}},onChange:w,className:"flex-grow-0 h-full overflow-auto",editorClassName:(0,o.cn)("h-full",d.expand&&"min-h-[5rem]"),onBlur:()=>{d.checkEmpty(),d.startTimer(1e4)},onFocus:I,onKeyUp:()=>{d.checkEmpty(),d.startTimer(1e4)}}),(0,V.jsxs)("div",{className:"post-editor-footer flex-shrink-0 border-t pt-2 pb-3",children:[(0,V.jsx)(de,{editor:d,header:O,onDelete:e=>{d.deleteAttachment(e)},onSave:T}),null!==d.expand&&H&&(0,V.jsxs)(o.Ug,{className:(0,o.cn)("gap-3 pt-2",!1===d.expand&&"hidden"),children:[(0,V.jsx)(g.Z,{size:"small",placeholder:"\u0413\u0435\u043e\u0433\u0440\u0430\u0444\u0438\u044f",d:"feed_geo",value:null===(n=d.geo)||void 0===n?void 0:n.value,id:null===(a=d.geo)||void 0===a?void 0:a.id,maxHeight:208,onChange:e=>{d.setCity(e)}}),(0,V.jsx)(o.aN,{size:"small",defaultValue:d.dt_publish?new Date(d.dt_publish):"",placeholder:"\u0414\u0430\u0442\u0430 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438",title:"\u0414\u0430\u0442\u0430 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438",onChange:e=>{d.setPublishTime(e?(0,v.MA)(e):"")}})]}),null!==d.expand&&(0,V.jsxs)(o.Ug,{className:(0,o.cn)("justify-between pt-3 flex-wrap gap-y-2",!1===d.expand&&"hidden"),children:[(0,V.jsxs)(o.Ug,{className:"gap-2",children:[(0,V.jsx)(oe,{handleAddFiles:D,handleAddArticle:()=>d.addAttachment("article").then((e=>{k(e.id),S()})).catch((e=>_("\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0430\u0442\u0442\u0430\u0447\u0430!"))),attachments:d.attachments,isAdmin:H}),H&&(0,V.jsx)(le,{editor:d,params:E,setParams:(e,t)=>{d.setParams({[e]:t}),L((s=>({...s,[e]:t})))},isGroup:!(null===(l=c.group)||void 0===l||!l.id)})]}),(0,V.jsxs)(o.Ug,{className:"ml-auto",children:[(0,V.jsx)(o.zx,{onClick:Z?()=>{d.save().catch((e=>{var t,s;const i=null===e||void 0===e||null===(t=e.response)||void 0===t||null===(s=t.data)||void 0===s?void 0:s.message;_("\u041e\u0448\u0438\u0431\u043a\u0430!"+(i?"\n\r"+i:""))}))}:()=>{C(d.publish(),{loading:"\u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f...",success:e=>(f&&f(e),"\u0417\u0430\u043f\u0438\u0441\u044c \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u0430"),error:e=>{var t,s;const i=null===e||void 0===e||null===(t=e.response)||void 0===t||null===(s=t.data)||void 0===s?void 0:s.message;return"\u041e\u0448\u0438\u0431\u043a\u0430!"+(i?"\n\r"+i:"")}})},variant:Z?"warning":"success",size:"small",className:"rounded-none rounded-l-md min-w-30",disabled:d.hasLoadingAttachments||d.disabled||d.isBusy,loading:d.isSaving,children:d.isSaving?"\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435...":Z?"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c":"\u041e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c"}),(0,V.jsx)(o.PS,{variant:Z?"warning":"success",size:"small",className:"!px-2 !py-2 rounded-none rounded-r-md ml-[1px]",disabled:d.hasLoadingAttachments||d.disabled||d.isBusy,autoclose:3e4,options:[d.changed&&{value:"\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f",onClick:()=>{d.setDisabled(!0),d.save().then((()=>{d.close(),p&&p()})).catch((e=>{var t,s;const i=null===e||void 0===e||null===(t=e.response)||void 0===t||null===(s=t.data)||void 0===s?void 0:s.message;_("\u041e\u0448\u0438\u0431\u043a\u0430!"+(i?"\n\r"+i:""))}))}},!d.changed&&d.isDraft&&{value:"\u0417\u0430\u043a\u0440\u044b\u0442\u044c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440",onClick:()=>{d.close(),p&&p()}},!d.isDraft&&{value:"\u0412\u0435\u0440\u043d\u0443\u0442\u044c \u0432 \u0447\u0435\u0440\u043d\u043e\u0432\u0438\u043a\u0438",onClick:()=>{d.unpublish()}},{value:"-"},{value:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c",onClick:()=>{P.current.blur(),d.delete().then((()=>{w(""),d.close(),p&&p()})).catch((e=>{_("\u041e\u0448\u0438\u0431\u043a\u0430"+(e.message?":\n\r"+e.message:" \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438"))}))}}]})]})]})]})]})]})}));var he=ce,ue=s(62114);const pe=(0,l.Pi)((e=>{let{editor:t,features:s,counters:i,onPublish:l}=e;const{toastPromise:d}=(0,r.Ps)(),c=(0,r.s0)();return(0,V.jsxs)(o.Ug,{className:"px-4 justify-between",children:[(0,V.jsxs)(o.zx,{onClick:()=>{d(t.newPost(),{loading:"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430...",success:e=>(l&&l(e),setTimeout((()=>
1c("?w=post"+e.id+"&mode=edit")),500),"\u0427\u0435\u0440\u043d\u043e\u0432\u0438\u043a \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d"),error:"\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0447\u0435\u0440\u043d\u043e\u0432\u0438\u043a\u0430"})},disabled:t.creating,children:[(0,V.jsx)(n.Z,{className:"w-5 h-5"}),"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0441\u0442"]}),(0,V.jsx)(o.Ug,{className:"gap-3 mr-2",children:1===(null===s||void 0===s?void 0:s.group_post_offer)&&(0,V.jsxs)(o.rU,{to:"offer",className:"text-muted hover:text-primary",relative:!0,title:"\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0435 \u043d\u043e\u0432\u043e\u0441\u0442\u0438",children:[(0,V.jsx)(a.Z,{className:"w-5"}),Boolean(null===i||void 0===i?void 0:i.tag_post_offer)&&(0,V.jsx)(o.Ct,{className:"badge-round",children:(null===i||void 0===i?void 0:i.tag_post_offer)>9?"9+":null===i||void 0===i?void 0:i.tag_post_offer})]})})]})}));var me=e=>{let{item:t,features:s,counters:n,groupId:a,userId:r,onPublish:l,onClose:o}=e;const d=(0,i.useMemo)((()=>new ue.Z(r,a)),[r,a]);return(0,i.useEffect)((()=>(null!==t&&void 0!==t&&t.id&&d.setPost(t),()=>{d.clear()}
1)),[t,a,d]),t?(0,V.jsx)(he,{editor:d,item:t,onClose:o,onPublish:l}):(0,V.jsx)(pe,{editor:d,features:s,counters:n,onClose:o,onPublish:l})}},32393:function(e,t,s){s.d(t,{R:function(){return r}});var i=s(54390);const n=new class{constructor(){this.entries=new Map,this.requests=new Map}load(e,t){if(!(arguments.length>2&&void 0!==arguments[2]&&arguments[2])){const t=this.entries.get(e);if(t&&t.expiresAt>Date.now())return Promise.resolve(t.items);const s=this.requests.get(e);if(s)return s}const s=t().then((t=>(this.requests.get(e)===s&&this.entries.set(e,{items:t,expiresAt:Date.now()+3e5}),t))).finally((()=>{this.requests.get(e)===s&&this.requests.delete(e)}));return this.requests.set(e,s),s}},a=async function(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=Object.fromEntries(Object.entries(s.params||{}).filter((e=>{let[,t]=e;return void 0!==t}))),r={...a,d:t},l=async()=>{const{data:t}=await i.Z.get(e,{...s,params:r});return t.items||[]};return"/v1/dictionary"!==e||Object.keys(a).length>0?l():n.load(`${i.Z.token||""}:${t}`,l,!1===s.cache)},r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a("/v1/dictionary",e,t)}},31335:function(e,t,s){s.d(t,{Z:function(){return u}});var i=s(72791);var n=s(5409),a=s(74643),r=s(74072),l=s(80184);const o=e=>{let{inputRef:t,isComponentVisible:s}=e;return(0,l.jsx)(r.zx,{variant:"success-fill",size:"small",onMouseDown:e=>{var i,n;e.preventDefault(),s?null===(i=t.current)||void 0===i||i.blur():null===(n=t.current)||void 0===n||n.focus()},children:(0,l.jsx)(n.Z,{className:(0,r.cn)("w-4 h-4 transition-transform",{"rotate-180":s})})})},d=i.forwardRef(((e,t)=>{const{className:s,classOptions:n,onChange:d,onInput:c,onOpen:h,onClose:u,options:p=[],loading:m=!1,render:g,size:v="default",placeholder:f,value:x="",id:b="",maxHeight:y,...w}=e,{ref:j,isComponentVisible:k,setIsComponentVisible:C}=(0,a.O3)(!1),_=(0,i.useRef)(null),S=(0,i.useCallback)((e=>{_.current=e,function(e,t){e&&("function"!==typeof e?e.current=t:e(t))}(t,e)}),[t]),[N,A]=(0,i.useState)(x),[P,E]=(0,i.useState)(b);(0,i.useEffect)((()=>{A(x)}),[x]),(0,i.useEffect)((()=>{E(b)}),[b]);return(0,l.jsxs)("div",{className:(0,r.cn)("searchbox",s),ref:j,children:[(0,l.jsx)(r.II,{onChange:e=>{const t=e.target.value;A(t),null===c||void 0===c||c(t)},size:v,value:N,ref:S,placeholder:f,title:f,onFocus:()=>{C(!0),null===h||void 0===h||h()},onBlur:()=>{C(!1),null===u||void 0===u||u()},...w,children:(0,l.jsx)(o,{inputRef:_,isComponentVisible:k})}),(0,l.jsx)(r.cw,{maxHeight:y,isComponentVisible:k,setIsComponentVisible:C,id:P,optionPlaceholder:N?void 0:"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441",loading:m,ref:_,onChange:e=>{A(e.value),E(e.id),null===d||void 0===d||d(e)},options:p,className:(0,r.cn)("max-w-full",n),render:e=>{let{item:t,selected:s,onClick:i,elementId:n}=e;const a=()=>{var e;null===i||void 0===i||i(),null===(e=_.current)||void 0===e||e.blur()};return g?g({disabled:t.disabled,elementId:n,item:t,key:t.id,onClick:a,selected:s}):(0,l.jsx)(r.cw.Option,{onClick:a,selected:Boolean(s),id:n,disabled:Boolean(t.disabled),children:t.value},t.id)}})]})}));d.Option=r.cw.Option;var c=s(32393);const h=e=>{let{d:t,q:s,id:i}=e;return(0,c.R)(t,{params:{q:s,id:i}})};var u=e=>{const{d:t,id:s,value:n,onChange:a,renderKey:r="title",...o}=e,[c,u]=(0,i.useState)([]),[p,m]=(0,i.useState)(n||""),[g,v]=(0,i.useState)(!1),f=(0,i.useRef)(),x=e=>{v(!0),h({d:t,q:e}).then((e=>u(e||[]))).catch((()=>u([]))).finally((()=>v(!1)))};return(0,i.useEffect)((()=>{(e=>{if("number"===typeof e&&!Number.isNaN(e))return!0;if("string"===typeof e&&""!==e.trim()){const t=Number(e);return!Number.isNaN(t)}return!1})(s)&&!p&&h({d:t,id:s}).then((e=>{var t;const s=null===(t=e[0])||void 0===t?void 0:t[r];void 0!==s&&m(String(s))})).catch((()=>{}))}),[s,p,t,r]),(0,l.jsx)(d,{id:s,value:p,loading:g,onOpen:()=>{c.length||x()},onInput:e=>{""===e&&(null===a||void 0===a||a(e),e="*"),clearTimeout(f.current),f.current=window.setTimeout((()=>x(e)),300)},onChange:e=>{null===a||void 0===a||a(e)},options:c.map((e=>({id:e.id,value:String(e[r]||"")}))),...o})}},62114:function(e,t,s){s.d(t,{Z:function(){return u}});var i=s(38758),n=s(85624),a=s(96442),r=s(66430),l=s(84098);class o{constructor(){this.id=null,this.text="",this.attachments="",this.params={draft:!0,no_author:!1,no_comments:!1}}setGroup(e){this.params.group_id=e}updateParams(e){this.params={...this.params,...e}}setAttachments(e){this.attachments=e.filter((e=>e.id)).map((e=>e.id)).join(",")}import(e){e&&(this.id=e.id,this.text=e.body||"",this.params={...e.params,status:e.f_status},e.geo&&this.updateParams({geo_id:e.geo.id}),e.dt_publish&&this.updateParams({datetime_publish:e.dt_publish}),this.updateParams({no_author:e.params.no_author,no_comments:e.params.no_comments}))}}class d{constructor(){this.id=null,this.type=null,this.context=null,this.uploading=!1,this.progress=null,(0,l.ky)(this)}setUploading(e){this.uploading=e}setProgress(e){this.progress=e}setPostId(e){this.postId=e}setData(e){this.id=e.id,this.type=e.type,this.context=e.context}upload(e){e&&(this.setUploading(!0),this.setProgress(0),(0,i.pD)(e,{type:"file",object_type:1,object_id:this.postId},(e=>{e.total&&this.setProgress(Math.round(100*e.loaded/e.total))})).then((e=>{this.setProgress(100),this.setData(e),this.setUploading(!1)})).catch((e=>{console.error(e),this.setUploading(!1)})))}create(e,t){if(!e)return;const s={type:t,object_id:this.postId,object_type:1,data:e};return this.setUploading(!0),(0,i.OE)(s).then((e=>
1(this.setData(e),this.setUploading(!1),Promise.resolve(e)))).catch((e=>(console.error(e),this.setUploading(!1),Promise.reject(e))))}}const c="publish",h="saving";class u{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.post=null,this.attachments=[],this.expand=null,this.editMode=!1,this.geo=null,this.dt_publish=null,this.no_comments=!1,this.no_author=!1,this.state=null,this.changed=!1,this.empty=!0,this.disabled=!1,this.userId=e,this.groupId=t,this.post=new o,this.post.group_id=this.groupId,s&&(this.post.params=s),(0,l.ky)(this)}setDisabled(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.disabled=e}open(){this.expand=!0}close(){this.expand=!1}newPost(){return this.save()}setPost(e){if(!e)return this.clear();this.post.id!==e.id&&(this.editMode=!0,this.attachments=[],this.post=new o,this.post.import(e),e.dt_publish&&(this.dt_publish=e.dt_publish),e.geo&&(this.geo={id:e.geo.id,value:e.geo.title}),e.attachments?(Object.values(e.attachments).forEach((e=>{(0,l.ZN)(e).forEach((e=>{const t=Object.assign(new d,e);this.attachments.push(t)}))})),this.setDisabled(!1)):(0,i.KU)(e.id).then((e=>{let{items:t}=e;this.setAttachments(t),this.setDisabled(!1)})),this.open(),this.checkEmpty())}setPostId(e){this.post.id=e}setParams(e){this.post.updateParams(e)}setCity(e){this.geo!==e&&(this.geo=e,this.setParams({geo_id:e.id}))}setPublishTime(e){(0,a.Y5)(e,this.dt_publish)||(this.dt_publish=e,this.setParams({datetime_publish:e}))}setContent(e){this.post.text!==e&&(this.changed=!0),this.post.text=e,this.checkEmpty()}clear(){this.post=new o,this.post.setGroup(this.groupId),this.attachments=[],this.checkEmpty()}setAttachments(e){this.attachments=e,this.checkEmpty()}addAttachments(e,t){Array.from(e).forEach((e=>{var s;if(!n.kr.includes(e.type)){const s=`\u041d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0438\u043f ${e.type}`;return void(t?t(s):console.error(s))}let i=new d;i.setPostId((null===(s=this.post)||void 0===s?void 0:s.id)||null),this.attachments.push(i),i.upload(e),this.changed=!0,this.checkEmpty()}))}addAttachment(e){var t;let s=new d;return s.setPostId((null===(t=this.post)||void 0===t?void 0:t.id)||null),this.changed=!0,s.create({},e).then((e=>(s.setData(e),this.attachments.push(s),Promise.resolve(e))))}updateAttachment(e,t){let s=(0,l.ZN)(this.attachments);const i=s.findIndex((t=>t.id===e));s[i]=t,this.setAttachments(s),this.changed=!0}addLinks(e){var t;const s=(0,r.x)(e[0]);let i;try{i=new URL("http"===s.substr(0,4)?s:"https://"+s)}catch(a){return}let n=new d;n.setPostId((null===(t=this.post)||void 0===t?void 0:t.id)||null),n.type="link",this.attachments.push(n),n.create({url:i}),this.changed=!0}deleteAttachment(e){let t=(0,l.ZN)(this.attachments);const s=t.findIndex((t=>t.id===e));(0,i.OW)(e).then((()=>{t.splice(s,1),this.setAttachments(t),this.changed=!0}))}autosave(){this.changed&&this.save().then((e=>{this.postId||this.setPostId(e.id)}))}publish(){return this.state?Promise.reject():(this.post.updateParams({draft:!1,status:1}),this.setDisabled(!0),this.post.setAttachments(this.attachments),this.setState(c),this.changed=!1,(0,i.TJ)(this.post).then((e=>{this.clear(),this.close()})).finally((()=>{this.setDisabled(!1),this.setState(null)})))}unpublish(){return this.state?Promise.reject():(this.post.updateParams({draft:!0}),this.save())}save(){return this.hasLoadingAttachments||this.state?Promise.reject():(this.post.setAttachments(this.attachments),this.setState(h),this.changed=!1,(0,i.TJ)(this.post).finally((()=>{this.setState(null)})))}delete(){return this.state?Promise.reject():(0,i.fR)(this.post.id,"delete")}startTimer(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;this.editMode&&!this.isDraft||(this.timer&&clearTimeout(this.timer),this.timer=setTimeout((()=>this.autosave()),e))}checkEmpty(){this.empty=this.isEmpty(),this.empty||(this.expand=!0)}isEmpty(){var e;if(!this.post)return!0;const t=(null===(e=this.post.text)||void 0===e?void 0:e.replace(/<[^>]+>/,""))||"";return!this.hasAttachments&&!t.length}setState(e){this.state=e}get hasAttachments(){var e;return(null===(e=this.attachments)||void 0===e?void 0:e.length)>0}get hasLoadingAttachments(){var e;return null===(e=this.attachments)||void 0===e?void 0:e.some((e=>null===e||void 0===e?void 0:e.uploading))}get isDraft(){var e,t;return null===(e=this.post)||void 0===e||null===(t=e.params)||void 0===t?void 0:t.draft}get isBusy(){return this.state}get isSaving(){return this.state===h}}}}]);
2//# sourceMappingURL=9245.358b1ec3.chunk.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.