PageSourceSearch

https://discours.netlify.app/scripts/tiptap-editor-acde05ca.js

js discours.netlify.app collected 2026-10-03 10:40:00 UTC 26,165 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkdiscours_io_frontend=globalThis.webpackChunkdiscours_io_frontend||[]).push([[1,45,263],{6823(t,e,r){function n(t){const e=t.includes("?")?"&":"?";return`${t}${e}editorProtocol=${o}`}r.d(e,{NP:()=>a,Wu:()=>n,iv:()=>o});const o="2",a="X-Editor-Protocol"},36090(t,e,r){async function n(t={}){function e(t,e){try{return t()}catch(t){return window.__sentry&&window.__sentry.captureException(t,{tags:{tiptap_extension:e}}),null}}const{element:n,content:o="",editable:M=!0,placeholder:D="Начните писать...",userId:Z="anonymous",userName:tt="Гость",userSlug:et=null,userAvatar:ut=null,userColor:dt,onUpdate:ct,onSelectionUpdate:gt,onFocus:pt,onBlur:ft,collaboration:mt=null,getLanguageToolPrivacyState:ht=null,uploadService:wt=null,notificationService:yt=null}=t;if(mt&&mt.serverUrl&&mt.documentName&&!rt)try{nt||(nt=Promise.all([r.e(316),r.e(272),r.e(197)]).then(r.bind(r,41315))),rt=await nt}catch(t){(0,p.UT)("[editor] Collab bundle failed to load, falling back to non-collab mode:",t),rt=null,nt=null}const St=dt||function(t){if(!t||"anonymous"===t)return lt[Math.floor(Math.random()*lt.length)];let e=0;for(let r=0;r<t.length;r++)e=(e<<5)-e+t.charCodeAt(r),e&=e;const r=Math.abs(e)%lt.length;return lt[r]}(Z),vt=a.YY.create({name:"autolinkUndoFix",priority:1e3,addProseMirrorPlugins:()=>[new i.k_({filterTransaction:t=>{t.getMeta("history$")&&t.setMeta("preventAutolink",!0);const e=t.getMeta("y-sync$");return e&&e.isUndoRedoOperation&&t.setMeta("preventAutolink",!0),!0}})]}),At=[f.C,m.y,h.i,w._,y.r,S.h,v.f,Y.UC,G.H,l.A.configure({history:!(mt&&rt),blockquote:!0,heading:!1}),V.q.configure({levels:[2,3,4]}),u.K.configure({openOnClick:!1,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer"}}),vt,d.A.configure({placeholder:D,showOnlyCurrent:!1,emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty"}),c.A,g.A.extend({addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right")}}}).configure({types:["heading","paragraph"],alignments:["left","center","right"]}),A._g,b.i,e(()=>_.dr,"ImageBubbleMenu"),C.Q,e(()=>E.GD,"DiscoursKeyboard"),e(()=>T.P,"SearchReplace"),k.tW,e(()=>W.Mn,"FootnoteTooltip"),x.r.configure({uploadService:wt,notificationService:yt}),e(()=>I.M,"LinkBubbleMenu"),P.M,U.r.configure({userId:Z,userName:tt,userSlug:et,userAvatar:ut}),R.SuggestionAdd,R.SuggestionDelete,R.SuggestionFormat,L.P,F.W9,B.o5,j.HtmlCleaner,e(()=>H.a2,"WordCount"),e(()=>N.n.configure({enabled:!1,getPrivacyState:ht}),"LanguageTool"),e(()=>O.mV,"TocGenerator"),K.FT,X.H,z.V,e(()=>q.c,"LinkPasteHandler"),...at?[]:[e(()=>Q.A.configure({dragHandleWidth:it.WIDTH,scrollTreshold:it.SCROLL_THRESHOLD,excludedTags:it.EXCLUDED_TAGS}),"GlobalDragHandle")],J.A].filter(Boolean);let _t=null,bt=null,Ct=null,Et=null,Tt=null,xt=null;if(mt&&mt.serverUrl&&mt.documentName&&rt){const{Y:t,HocuspocusProvider:e,Collaboration:r,CollaborationCursor:n}=rt;bt=new t.Doc,"function"==typeof xt&&window.removeEventListener("error",xt,!0),xt=function(t){t&&t.target instanceof WebSocket&&-1!==(t.target.url||"").indexOf(mt.serverUrl)&&t.stopImmediatePropagation()},window.addEventListener("error",xt,!0),_t=new e({url:mt.serverUrl,name:mt.documentName,token:mt.token,parameters:{editorProtocol:s.iv},document:bt,preserveConnection:!1,maxAttempts:5,delay:1e3,factor:2,maxDelay:3e4,onSynced:({state:t})=>{!0===t&&mt.onSynced&&mt.onSynced()},onDisconnect:()=>{(0,p.UT)("[Tiptap] Collaboration disconnected"),mt.onDisconnect&&mt.onDisconnect()},onConnect:()=>{mt.onConnect&&mt.onConnect()},onStatus:t=>{mt.onStatus&&mt.onStatus(t)},onClose:t=>{(0,p.UT)("[Tiptap] WebSocket closed:",t?.code,t?.reason),mt.onClose&&mt.onClose(t)},onAuthenticationFailed:t=>{(0,p.UT)("[Tiptap] Authentication failed:",t?.reason),mt.onAuthenticationFailed&&mt.onAuthenticationFailed(t)},onMessage:t=>{}}),ot&&(Ct=(t,e)=>{},bt.on("update",Ct)),"undefined"!=typeof window&&window.DISCOURS_DEBUG_YJS&&(window._yjsUpdateCount||(window._yjsUpdateCount=0,window._yjsUpdateStart=Date.now()),Et=(t,e)=>{window._yjsUpdateCount++;const r=(Date.now()-window._yjsUpdateStart)/1e3;window._yjsUpdateCount%20==0&&(window._yjsUpdateCount/r).toFixed(2)},bt.on("update",Et),Tt=()=>{window._awarenessCount||(window._awarenessCount=0,window._awarenessStart=Date.now()),window._awarenessCount++;const t=(Date.now()-window._awarenessStart)/1e3;window._awarenessCount%20==0&&(window._awarenessCount/t).toFixed(2)},_t.awareness.on("change",Tt)),At.push(r.configure({document:bt})),st||At.push(n.configure({provider:_t,user:{name:tt,color:St,id:"anonymous"!==Z?Z:null,slug:et||null,avatar:ut&&(ut.startsWith("http://")||ut.startsWith("https://"))?ut:null},selectionRender:t=>({style:`background-color: ${t.color}55`,class:"ProseMirror-yjs-selection"}),render:t=>{const e=document.createElement("span");e.classList.add("collaboration-cursor__caret"),e.style.borderColor=t.color,e.style.willChange="transform";let r=t.color.replace("#","");3===r.length&&(r=r[0]+r[0]+r[1]+r[1]+r[2]+r[2]);const n=(.2126*(parseInt(r.substring(0,2),16)||0)+.7152*(parseInt(r.substring(2,4),16)||0)+.0722*(parseInt(r.substring(4,6),16)||0))/255,o=document.createElement("div");return o.classList.add("collaboration-cursor__label"),o.style.backgroundColor=t.color,o.style.color=n>.55?"#1a1a1a":"#fff",o.textContent=t.name,o.style.animation="cursor-label-fade 0.3s ease-out 2s forwards",e.appendChild(o),e}}))}const It=n.addEventListener.bind(n);let Mt;n.addEventListener=function(t,e,r){return"mousewheel"===t&&("boolean"==typeof r?r={capture:r,passive:!0}:r?"object"==typeof r&&(r=Object.assign({},r,{passive:!0})):r={passive:!0}),It(t,e,r)};let Dt=null;try{Mt=new a.KE({element:n,editable:M,content:mt&&rt?"":o||"",extensions:At,editorProps:{attributes:{class:"tiptap-editor-content"}},onCreate:({editor:t})=>{try{mt||setTimeout(()=>{t&&!t.isDestroyed&&t.clearUndoHistory&&t.clearUndoHistory()},0)}catch(t){}},onUpdate:({editor:t,transaction:e})=>{try{ct&&t&&!t.isDestroyed&&ct(t,e)}catch(t){}},onSelectionUpdate:({editor:t})=>{try{if(gt&&t&&!t.isDestroyed){const{from:e,to:r,empty:n}=t.state.selection;gt({from:e,to:r,empty:n,hasSelection:!n,selectedText:n?"":t.state.doc.textBetween(e,r)})}}catch(t){}},onFocus:({editor:t})=>{try{pt&&t&&!t.isDestroyed&&pt(t)}catch(t){}},onBlur:({editor:t})=>{try{ft&&t&&!t.isDestroyed&&ft(t)}catch(t){}},onTransaction:({transaction:t})=>{if("undefined"!=typeof window&&window.DISCOURS_DEBUG_TRANSACTIONS&&(window._tiptapLastTransaction=t,window._tiptapTxCount||(window._tiptapTxCount=0,window._tiptapTxStart=Date.now(),window._tiptapDebugInterval=setInterval(()=>{const t=(Date.now()-window._tiptapTxStart)/1e3;(window._tiptapTxCount/t).toFixed(2),window},5e3)),window._tiptapTxCount++,window._tiptapTxCount%50==0)){Date.now(),window;window}}})}catch(t){Dt=t}finally{n.addEventListener=It}if(Dt)return window.__sentry&&window.__sentry.captureException(Dt,{tags:{component:"tiptap_editor_init"}}),yt&&yt.error("Редактор не&nbsp;загрузился&nbsp;— обновите страницу или&nbsp;попробуйте&nbsp;снова",{delay:0}),null;
1const kt=(0,R.createSuggestionModePlugin)({userId:Z});Mt.registerPlugin(kt),Mt.notificationService=yt,Mt.setSuggestionMode=t=>{if(Mt.isDestroyed)return;const{tr:e}=Mt.state;e.setMeta(R.suggestionModePluginKey,{enabled:t}),Mt.view.dispatch(e)},Mt.isSuggestionMode=()=>{if(Mt.isDestroyed)return!1;const t=R.suggestionModePluginKey.getState(Mt.state);return!!t&&t.enabled},Mt.setUserId=t=>{if(Mt.isDestroyed)return;const{tr:e}=Mt.state;e.setMeta(R.suggestionModePluginKey,{userId:t}),Mt.view.dispatch(e)},Mt.getSuggestionUserId=()=>{const t=R.suggestionModePluginKey.getState(Mt.state);return t?t.userId:null},Mt.isCollaborative=()=>!!_t,Mt.getProvider=()=>_t,Mt.getYDoc=()=>bt;let Wt=null;"undefined"!=typeof window&&(Wt=()=>{if(!_t)return null;const t=[];return _t.awareness.getStates().forEach((e,r)=>{t.push({clientId:r,self:r===_t.awareness.clientID,user:e.user&&e.user.name||null,hasCursor:!(!e.cursor||null==e.cursor.anchor)})}),{synced:_t.synced,authorizedScope:_t.authorizedScope,clients:t}},window.__discoursCollabDebug=Wt),Mt.resolveRelativePosition=t=>{if(!bt||!rt)return null;try{const e=rt.Y.createAbsolutePositionFromRelativePosition(t,bt);return e?e.index:null}catch(t){return null}};let Pt=0,Ut=[];Mt.beginPendingMediaUpload=()=>{Mt.isDestroyed||(Pt+=1)},Mt.endPendingMediaUpload=()=>{if(Pt>0&&(Pt-=1),0===Pt&&Ut.length>0){const t=Ut;Ut=[],t.forEach(t=>{try{t(!0)}catch(t){}})}},Mt.hasPendingMediaUploads=()=>Pt>0,Mt.waitForPendingMediaUploads=(t=3e4)=>0===Pt?Promise.resolve(!0):new Promise(e=>{const r=setTimeout(()=>{Ut=Ut.filter(t=>t!==n),e(!1)},t),n=t=>{clearTimeout(r),e(!!t)};Ut.push(n)}),Mt.clearUndoHistory=()=>
1{if(Mt.isDestroyed)return!1;if(_t){try{const t=Mt.state.plugins;for(let e=0;e<t.length;e++){const r=t[e].getState(Mt.state);if(r&&r.undoManager)return r.undoManager.clear(),!0}}catch(t){(0,p.UT)("[TipTap] Не удалось очистить collab undo-стек:",t)}return!1}return!!Mt.commands.clearHistory&&(Mt.commands.clearHistory(),!0)},Mt.getCommentsMap=()=>{if(bt)try{return bt.getMap("comments")}catch(t){(0,p.UT)("[getCommentsMap] Y.js fallback (teardown?):",t)}return Mt._localCommentsMap||(Mt._localCommentsMap=new Map),Mt._localCommentsMap},Mt.getSuggestionsMap=()=>{if(bt)try{return bt.getMap("suggestions")}catch(t){(0,p.UT)("[getSuggestionsMap] Y.js fallback (teardown?):",t)}return Mt._localSuggestionsMap||(Mt._localSuggestionsMap=new Map),Mt._localSuggestionsMap},Mt.acceptAllSuggestions=()=>R.suggestionCommands.acceptAllSuggestions(Mt),Mt.rejectAllSuggestions=()=>R.suggestionCommands.rejectAllSuggestions(Mt),Mt.toggleFormatSuggestion=(t,e)=>R.suggestionCommands.toggleFormatSuggestion(Mt,t,e),Mt.setLinkSuggestion=t=>R.suggestionCommands.setLinkSuggestion(Mt,t),Mt.removeLinkSuggestion=()=>R.suggestionCommands.removeLinkSuggestion(Mt),Mt.recordBlockFormatSuggestion=(t,e)=>R.suggestionCommands.recordBlockFormatSuggestion(Mt,t,e),Mt.revertBlockFormat=(t,e,r,n,o,a)=>R.suggestionCommands.revertBlockFormat(Mt,t,e,r,n,o,a),Mt.enforceBlockFormatExclusion=(t,e)=>R.suggestionCommands.enforceBlockFormatExclusion(Mt,t,e),Mt.markRangeForDeletion=(t,e)=>R.suggestionCommands.markRangeForDeletion(Mt,t,e),Mt.smartToggleFormat=(t,e={})=>Mt.isSuggestionMode()?Mt.toggleFormatSuggestion(t,e):Mt.chain().focus().toggleMark(t,e).run(),Mt.smartSetLink=t=>Mt.isSuggestionMode()?Mt.setLinkSuggestion(t):Mt.chain().focus().setLink({href:t}).run(),Mt.smartRemoveLink=()=>Mt.isSuggestionMode()?Mt.removeLinkSuggestion():Mt.chain().focus().unsetLink().run();const Lt=Mt.destroy.bind(Mt);return Mt.destroy=()=>{try{"undefined"!=typeof window&&window._tiptapDebugInterval&&(clearInterval(window._tiptapDebugInterval),window._tiptapDebugInterval=null,window._tiptapTxCount=0,window._tiptapTxStart=null)}catch(t){}try{"function"==typeof Tt&&_t&&_t.awareness&&_t.awareness.off("change",Tt),_t&&("function"==typeof xt&&(window.removeEventListener("error",xt,!0),xt=null),_t.destroy())}catch(t){}finally{"undefined"!=typeof window&&Wt&&window.__discoursCollabDebug===Wt&&(window.__discoursCollabDebug=null),Wt=null}try{"function"==typeof Ct&&bt&&bt.off("update",Ct),"function"==typeof Et&&bt&&bt.off("update",Et),bt&&bt.destroy()}catch(t){}try{"undefined"!=typeof window&&(void 0!==window._yjsUpdateCount&&(window._yjsUpdateCount=0,window._yjsUpdateStart=null),void 0!==window._awarenessCount&&(window._awarenessCount=0,window._awarenessStart=null),delete window._tiptapLastTransaction,window._tiptapDebugInterval&&(clearInterval(window._tiptapDebugInterval),delete window._tiptapDebugInterval),delete window._tiptapTxCount,delete window._tiptapTxStart)}catch(t){}Mt._localCommentsMap&&(Mt._localCommentsMap.clear(),Mt._localCommentsMap=null),Mt._localSuggestionsMap&&(Mt._localSuggestionsMap.clear(),Mt._localSuggestionsMap=null),Pt=0;const t=Ut;Ut=[],t.forEach(t=>{try{t(!1)}catch(t){}}),rt=null,nt=null;try{Lt()}catch(t){}},Mt}function o(t="id"){return`${t}_${Date.now()}_${Math.random().toString(36).substring(2,11)}`}r.r(e),r.d(e,{EMBED_PROVIDERS:()=>K.F3,EXITABLE_BLOCK_TYPES:()=>Z.EXITABLE_BLOCK_TYPES,Editor:()=>a.KE,IMAGE_ALIGNMENT_CLASSES:()=>A.Rh,ImageGallery:()=>b.i,SpoilerBlock:()=>C.Q,WRAPPER_TYPES:()=>Z.WRAPPER_TYPES,applyTypography:()=>B.yd,applyTypographySync:()=>B.rX,applyTypographyToHtml:()=>B.mD,applyTypographyToHtmlSync:()=>B.fl,cleanHtml:()=>j.cleanHtml,countCharacters:()=>H.wZ,countWords:()=>H.rj,createFootnote:()=>k.h_,createTiptapEditor:()=>n,createTocBlockContent:()=>Y.db,default:()=>ut,extractAll:()=>tt.extractAll,extractComments:()=>tt.extractComments,extractHeadings:()=>O.HV,extractSuggestions:()=>tt.extractSuggestions,findActiveWrapper:()=>Z.findActiveWrapper,findAllWrappersInSelection:()=>Z.findAllWrappersInSelection,generateId:()=>o,generateTocHtml:()=>O.t8,getFootnotes:()=>k.WQ,getReadingTime:()=>H.Wo,getValidationErrorMessage:()=>Z.getValidationErrorMessage,getYoutubeEmbedUrl:()=>K.Eq,isContentLikelyDuplicated:()=>et.py,isValidEmbedUrl:()=>K.TE,liftAllWrappers:()=>Z.liftAllWrappers,liftWrapper:()=>Z.liftWrapper,openFootnoteEditor:()=>M.openFootnoteEditor,openHtmlEditor:()=>D.openHtmlEditor,parseEmbedUrl:()=>K.US,parseYoutubeUrl:()=>K.s4,preloadTypograf:()=>B.uT,setWrapper:()=>Z.setWrapper,suggestionCommands:()=>R.suggestionCommands,toggleWrapperWithExclusion:()=>Z.toggleWrapperWithExclusion,validateContentForWrapper:()=>Z.validateContentForWrapper});var a=r(52781),s=r(6823),i=r(42845),l=r(65427),u=r(45765),d=r(98005),c=r(37594),g=r(94341),p=r(40154),f=r(81968),m=r(69204),h=r(2312),w=r(82953),y=r(40312),S=r(9962),v=r(16654),A=r(66586),_=r(65912),b=r(90036),C=r(47996),E=r(67194),T=r(2
11),x=r(60152),I=r(60667),M=r(61849),D=r(26855),k=r(54844),W=r(66590),P=r(69527),U=r(39396),L=r(6436),F=r(13240),R=r(46508),B=r(18509),j=r(35282),H=r(15090),N=r(68929),O=r(63092),Y=r(57484),G=r(69718),V=r(88971),K=r(55079),z=r(84159),X=r(12347),q=r(28555),Q=r(95691),J=r(42023),Z=r(99159),tt=r(60150),et=r(7573);let rt=null,nt=null;const ot="undefined"!=typeof window&&window.DISCOURS_DEBUG,at="undefined"!=typeof window&&window.DISCOURS_DISABLE_DRAG_HANDLE,st="undefined"!=typeof window&&window.DISCOURS_DISABLE_COLLAB_CURSOR,it={WIDTH:24,SCROLL_THRESHOLD:100,EXCLUDED_TAGS:["figure","hr"]},lt=["#958DF1","#F98181","#FBBC88","#FAF594","#70CFF8","#94FADB","#B9F18D","#C3E2C2","#EAECCC","#AFC8AD"],ut={createTiptapEditor:n,generateId:o,extractAll:tt.extractAll,extractComments:tt.extractComments,extractSuggestions:tt.extractSuggestions,getFootnotes:k.WQ,openFootnoteEditor:M.openFootnoteEditor,openHtmlEditor:D.openHtmlEditor,createFootnote:k.h_,applyTypography:B.yd,applyTypographyToHtml:B.mD,applyTypographySync:B.rX,applyTypographyToHtmlSync:B.fl,preloadTypograf:B.uT,cleanHtml:j.cleanHtml,countWords:H.rj,countCharacters:H.wZ,getReadingTime:H.Wo,extractHeadings:O.HV,generateTocHtml:O.t8,createTocBlockContent:Y.db,parseEmbedUrl:K.US,parseYoutubeUrl:K.s4,getYoutubeEmbedUrl:K.Eq,isValidEmbedUrl:K.TE,EMBED_PROVIDERS:K.F3,IMAGE_ALIGNMENT_CLASSES:A.Rh,ImageGallery:b.i,SpoilerBlock:C.Q,WRAPPER_TYPES:Z.WRAPPER_TYPES,EXITABLE_BLOCK_TYPES:Z.EXITABLE_BLOCK_TYPES,validateContentForWrapper:Z.validateContentForWrapper,getValidationErrorMessage:Z.getValidationErrorMessage,findActiveWrapper:Z.findActiveWrapper,findAllWrappersInSelection:Z.findAllWrappersInSelection,liftWrapper:Z.liftWrapper,liftAllWrappers:Z.liftAllWrappers,setWrapper:Z.setWrapper,toggleWrapperWithExclusion:Z.toggleWrapperWithExclusion}},49088(t,e,r){function n(){if(g)return null;if(u)return u;try{return u=new Worker(new URL(r.p+r.u(748),r.b)),u.addEventListener("message",function(t){var e=t.data;if(0!==e.id||"ready"!==e.result){var r=c.get(e.id);r&&(c.delete(e.id),e.error?r.reject(new Error(e.error)):r.resolve(e.result))}}),u.addEventListener("error",function(t){g=!0,u=null,c.forEach(function(t){t.reject(new Error("Worker error"))}),c.clear(),clearTimeout(p),p=setTimeout(function(){g=!1},6e4)}),u}catch(t){return g=!0,null}}function o(t,e){if(!t)return Promise.resolve(t);var r=n();if(!r)return Promise.reject(new Error("Worker unavailable"));var o=++d;return new Promise(function(n,a){var s=setTimeout(function(){c.delete(o),a(new Error("Worker timeout"))},1e4);c.set(o,{resolve:function(t){clearTimeout(s),n(t)},reject:function(t){clearTimeout(s),a(t)}}),r.postMessage({id:o,action:"execute",text:t,config:e||null})})}function a(t,e){if(!t||0===t.length)return Promise.resolve([]);var r=n();if(!r)return Promise.reject(new Error("Worker unavailable"));var o=++d;return new Promise(function(n,a){var s=setTimeout(function(){c.delete(o),a(new Error("Worker batch timeout"))},15e3);c.set(o,{resolve:function(t){clearTimeout(s),n(t)},reject:function(t){clearTimeout(s),a(t)}}),r.postMessage({id:o,action:"executeBatch",texts:t,config:e||null})})}function s(){return!g&&"undefined"!=typeof Worker}function i(){g||n()}function l(){u&&(u.terminate(),u=null),g=!1,c.forEach(function(t){t.reject(new Error("Worker terminated"))}),c.clear(),clearTimeout(p),p=null}r.d(e,{EG:()=>l,MN:()=>a,Sz:()=>s,YP:()=>i,gl:()=>o});let u=null,d=0,c=new Map,g=!1,p=null},60150(t,e,r){function n(t,e){if("string"==typeof e)return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}function o(t,e,r){if("paragraphBreak"===t)return"Добавить абзац";if("link"===t)return("add"===e?"Добавить":"Удалить")+" ссылку"+(r?": "+r:"");switch(t){case"heading":return"Заголовок "+(r||"");case"alignment":return"выравнивание "+({center:"по центру",right:"по правому краю",left:"по левому краю"}[r]||r||"");case"bulletList":return"маркированный список";case"orderedList":return"нумерованный список";case"blockquote":return"цитата";case"taSub":return"подвёрстка";case"taBorderSub":return"подвёрстка с рамкой";case"taQuotation":return"цитата из источника";case"taEpigraph":return"эпиграф";case"taSelectionFrame":return"рамка выделения"}
1return{bold:"жирный",italic:"курсив",underline:"подчёркивание",strike:"зачёркивание",code:"код",subscript:"подстрочный",superscript:"надстрочный",lead:"лид",highlight:"выделение"}[t]||t}function a(t,e){for(var r=0;r<e.length;r++){var n=t[e[r]];if("string"==typeof n&&n.trim())return n.trim()}return""}function s(t){if(null==t)return"";if("string"==typeof t)return t.trim();if("number"==typeof t||"boolean"==typeof t)return String(t);if("object"!=typeof t)return"";var e,r=a(t,T),n=a(t,x),o=n?(e=String(n).split("?")[0].split("#")[0]).split("/").pop()||e:"";return r&&o?r+" ("+o+")":r||o}function i(t,e){return e>0?t+" … и ещё "+e:t}function l(t,e){for(var r,n,o=[],a=0;a<t.length;a++){var s=o.concat([t[a]]).join(" · ");if(o.length&&i(s,e-(o.length+1)).length>100)break;o.push(t[a])}if(!o.length)return"";if(1===o.length){var l=100-i("",e-1).length;o[0]=(r=o[0],n=Math.max(l,12),r.length<=n?r:r.slice(0,Math.max(n-1,1)).replace(/\s+$/,"")+"…")}return i(o.join(" · "),e-o.length)}function u(t,e){for(var r=[],n=0,o=0;o<e.length;o++){var a=e[o];if(!(a>=t.length||(n++,r.length>=4))){var i=s(t[a]);r.push("№"+(a+1)+(i?" "+i:""))}}return n?l(r,n):""}function d(t){try{return JSON.stringify(t)}catch(t){return""}}function c(t){var e=[],r=!1,n=function t(n){return n&&"object"==typeof n?-1!==e.indexOf(n)||e.length>=32?(r=!0,null):(e.push(n),Array.isArray(n)?o=n.map(t):(o={},Object.keys(n).sort().forEach(function(e){o[e]=t(n[e])})),e.pop(),o):n;var o}(t);return r?"":d(n)}function g(t){return null==t?"":"string"==typeof t?t:"number"==typeof t||"boolean"==typeof t?String(t):Array.isArray(t)?(e=t).length?l(e.slice(0,4).map(function(t,e){return s(t)||"элемент "+(e+1)}),e.length):"":"object"==typeof t?s(t)||d(t):"";var e}function p(t,e){if(t===e)return!0;var r=null==t||""===t,n=null==e||""===e;if(r||n)return r&&n;if("object"!=typeof t||"object"!=typeof e)return!1;var o=c(t),a=c(e);return""!==o&&o===a}function f(t,e){const r={before:g(t),after:g(e)};if(r.before!==r.after)return r;if(!Array.isArray(t)||!Array.isArray(e))return r;const n=function(t,e){for(var r=Math.max(t.length,e.length),n=[],o=0;o<r;o++)p(t[o],e[o])||n.push(o);return n.length&&n.length!==r?n:null}(t,e);if(!n)return r;const o={before:u(t,n),after:u(e,n)};return o.before===o.after?r:o}function m(t,e){if(!e||"object"!=typeof e||Array.isArray(e))return[];const r=t&&t.attrs||{},o=[];for(const t of Object.keys(e)){if((0,A.Yu)(t))continue;const a=n(r,t);if(p(a,e[t]))continue;const s=f(a,e[t]);o.push({key:t,label:n(E,t)||t,before:s.before,after:s.after})}return o}function h(t){switch(t.type.name){case"discoursImage":return"картинки";case"socialEmbed":{const e=(t.attrs.providerName||t.attrs.provider||"").toLowerCase();return e.includes("youtube")||e.includes("vimeo")||e.includes("rutube")?"видео":"медиа"}case"footnote":return"сноски";case"imageGallery":return"галереи";case"spoilerBlock":return"спойлера";case"pdfViewer":return"документа";default:return t.type.name}}function w(t){const{doc:e}=t.state,r=_.get(t);if(r&&r.version===e)return r.data;const a=new Map,s=new Map,i=new Map,l=new Map,u=new Map,d=[],c=[];e.descendants((t,e)=>{if(t.marks)for(let r=0;r<t.marks.length;r++){const n=t.marks[r],u=n.type.name;if("comment"===u){const r=n.attrs.commentId,o=a.get(r);o?(o.to=e+t.nodeSize,o.quotedText+=t.text||""):a.set(r,{commentId:r,resolved:n.attrs.resolved,from:e,to:e+t.nodeSize,quotedText:t.text||"",authorId:n.attrs.authorId||null,authorName:n.attrs.authorName||null,authorSlug:n.attrs.authorSlug||null,authorAvatar:n.attrs.authorAvatar||null})}else if("suggestionAdd"===u){const r=n.attrs.suggestionId,o=s.get(r);o?(o.to=e+t.nodeSize,o.text+=t.text||""):s.set(r,{suggestionId:r,authorId:n.attrs.authorId,authorName:n.attrs.authorName||null,authorSlug:n.attrs.authorSlug||null,authorAvatar:n.attrs.authorAvatar||null,createdAt:n.attrs.createdAt,type:"add",from:e,to:e+t.nodeSize,text:t.text||""})}else if("suggestionDelete"===u){const r=n.attrs.suggestionId,o=i.get(r);o?(o.to=e+t.nodeSize,o.text+=t.text||""):i.set(r,{suggestionId:r,authorId:n.attrs.authorId,authorName:n.attrs.authorName||null,authorSlug:n.attrs.authorSlug||null,authorAvatar:n.attrs.authorAvatar||null,createdAt:n.attrs.createdAt,type:"delete",from:e,to:e+t.nodeSize,text:t.text||""})}else if("suggestionFormat"===u){const r=n.attrs.suggestionId,a=l.get(r),s=t.text||"",i="paragraphBreak"===n.attrs.formatType?s.replace(v.PARAGRAPH_BREAK_MARKER,""):s;a?(a.to=e+t.nodeSize,a.text+=i):l.set(r,{suggestionId:r,authorId:n.attrs.authorId,authorName:n.attrs.authorName||null,authorSlug:n.attrs.authorSlug||null,authorAvatar:n.attrs.authorAvatar||null,createdAt:n.attrs.createdAt,type:"format",formatType:n.attrs.formatType,formatAction:n.attrs.formatAction,formatValue:n.attrs.formatValue,originalValue:n.attrs.originalValue||null,formatDescription:o(n.attrs.formatType,n.attrs.formatAction,n.attrs.formatValue),from:e,to:e+t.nodeSize,text:i})}}const r=n(C,t.attrs&&t.attrs.suggestionType);if(t.attrs&&t.attrs.suggestionId&&r&&!u.has(t.attrs.suggestionId)&&u.set(t.attrs.suggestionId,{suggestionId:t.attrs.suggestionId,authorId:t.attrs.suggestionAuthorId,createdAt:t.attrs.suggestionCreatedAt,type:r,from:e,to:e+t.nodeSize,text:"",isNode:!0,nodeType:t.type.name,nodeDescription:h(t),nextAttrs:t.attrs&&t.attrs.suggestionNextAttrs||null,updateChanges:"node-update"===r?m(t,t.attrs.suggestionNextAttrs):[]}),t.isText)for(let r=0;r<t.text.length;r++)c.push(e+r),d.push(t.text[r])});const g=Array.from(a.values()),p=Array.from(s.values()),f=Array.from(i.values()),w=Array.from(l.values()),y=Array.from(u.values()),S={comments:g,suggestions:{adds:p,deletes:f,formats:w,nodeSuggestions:y,all:[...p,...f,...w,...y]},textIndex:{text:d.join(""),posMap:c}};return _.set(t,{version:e,data:S}),"undefined"!=typeof process&&process,S}function y(t){return w(t).comments.map(function(t){return Object.assign({},t)})}function S(t){function e(t){return t.map(function(t){return Object.assign({},t)})}var{doc:r}=t.state,n=b.get(t);if(n&&n.version===r&&n.data)return n.data;for(var o=w(t).suggestions,a=e(o.adds),s=e(o.deletes),i=e(o.formats),l=e(o.nodeSuggestions),u=[],d=new Set,c=new Set,g=new Map,p=new Map,f=0;f<a.length;f++){var m=a[f];m.suggestionId&&(g.set(m.authorId+":"+m.from,m),p.set(m.authorId+":"+m.to,m))}for(var h=0;h<s.length;h++){var y=s[h];if(y.suggestionId){var S=g.get(y.authorId+":"+y.to)||p.get(y.authorId+":"+y.from);S&&!d.has(S.suggestionId)&&(u.push({suggestionId:y.suggestionId,type:"replace",authorId:y.authorId,authorName:y.authorName||S.authorName||null,authorSlug:y.authorSlug||S.authorSlug||null,authorAvatar:y.authorAvatar||S.authorAvatar||null,createdAt:y.createdAt<S.createdAt?y.createdAt:S.createdAt,from:Math.min(y.from,S.from),to:Math.max(y.to,S.to),deleteText:y.text,addText:S.text,text:y.text+" → "+S.text,_addSuggestionId:S.suggestionId}),d.add(S.suggestionId),c.add(y.suggestionId))}}u.length>0&&(a=a.filter(function(t){return!d.has(t.suggestionId)}),s=s.filter(function(t){return!c.has(t.suggestionId)}));var v={adds:a,deletes:s,replaces:u,formats:i,nodeSuggestions:l,all:[].concat(a,s,u,i,l)};return b.set(t,{version:r,data:v}),v}r.r(e),r.d(e,{extractAll:()=>w,extractComments:()=>y,extractSuggestions:()=>S});var v=r(46508),A=r(43592);const _=new WeakMap,b=new WeakMap,C={add:"node-add",delete:"node-delete",update:"node-update",[A.Uq]:"node-update"},E={src:"файл",alt:"описание",title:"заголовок",caption:"подпись",content:"текст",href:"ссылка",provider:"источник",providerName:"источник",images:"изображения"};var T=["caption","title","alt","label","name","text"],x=["src","url","href"]},87263(t,e,r){function n(t){var e=Math.floor(t)||0,r=Math.floor(e/3600),n=Math.floor(e%3600/60),o=e%60;return r>0?r+":"+String(n).padStart(2,"0")+":"+String(o).padStart(2,"0"):n+":"+String(o).padStart(2,"0")}r.d(e,{E:()=>n})}}]);

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.