2026-11-03 01:53:45 +02:00
var $g = Object . defineProperty ; var Po = ( t , e )=>{ for ( var n in e ) $g ( t , n ,{ get : e [ n ], enumerable :! 0 })}; var Ni = {}; Po ( Ni ,{ CommandManager : ()=> On , DECORATION_MANAGER_PLUGIN_KEY : ()=> En , Decoration : ()=> ho , DecorationManager : ()=> Qf , Editor : ()=> Dx , Extendable : ()=> Ai , Extension : ()=> Z , Fragment : ()=> Bx , InlineDecoration : ()=> Sh , InputRule : ()=> ln , MappablePosition : ()=> Ca , Mark : ()=> ie , MarkView : ()=> vx , Node : ()=> W , NodeDecoration : ()=> Ch , NodePos : ()=> kh , NodeView : ()=> Wx , PasteRule : ()=> yr , ResizableNodeView : ()=> Oi , ResizableNodeview : ()=> Vx , Tracker : ()=> Ux , WidgetDecoration : ()=> vh , attrsEqual : ()=> Ma , callOrReturn : ()=> G , canInsertNode : ()=> Ta , combineTransactionSteps : ()=> bi , commands : ()=> jf , createAtomBlockMarkdownSpec : ()=> oh , createBlockMarkdownSpec : ()=> gr , createChainableState : ()=> io , createDocument : ()=> pi , createElement : ()=> Hx , createInlineMarkdownSpec : ()=> ih , createMappablePosition : ()=> Ff , createNodeFromContent : ()=> Rn , createStyleTag : ()=> Zf , createWidgetDecoration : ()=> Px , decodeHtmlEntities : ()=> ax , defaultBlockAt : ()=> pr , deleteProps : ()=> ia , elementFromString : ()=> dr , encodeHtmlEntities : ()=> cx , escapeForRegEx : ()=> Aa , extensions : ()=> Ox , findChildren : ()=> mr , findChildrenInRange : ()=> ha , findDuplicates : ()=> Df , findParentNode : ()=> Ht , findParentNodeClosestToPos : ()=> dt , flattenExtensions : ()=> wi , fromString : ()=> Rf , generateHTML : ()=> aw , generateJSON : ()=> cw , generateText : ()=> dw , getAttributes : ()=> Ci , getAttributesFromExtensions : ()=> ma , getChangedRanges : ()=> Ln , getDebugJSON : ()=> Pf , getExtensionField : ()=> B , getHTMLFromFragment : ()=> lo , getMarkAttributes : ()=> fa , getMarkRange : ()=> yi , getMarkType : ()=> xt , getMarksBetween : ()=> ao , getNodeAtPosition : ()=> wa , getNodeAttributes : ()=> Lf , getNodeType : ()=> ce , getPreviousBlockSibling : ()=> xa , getRenderedAttributes : ()=> zt , getSchema : ()=> ki , getSchemaByResolvedExtensions : ()=> ga , getSchemaTypeByName : ()=> An , getSchemaTypeNameByName : ()=> so , getSplittedAttributes : ()=> no , getStyleProperty : ()=> Ea , getText : ()=> ba , getTextBetween : ()=> ya , getTextContentFromNodes : ()=> $f , getTextSerializersFromSchema : ()=> Si , getUpdatedPosition : ()=> Hf , h : ()=> Hx , injectExtensionAttributesToParseRule : ()=> sa , inputRulesPlugin : ()=> sh , isActive : ()=> vi , isAndroid : ()=> oo , isAtEndOfNode : ()=> ka , isAtStartOfNode : ()=> Sa , isEmptyObject : ()=> Nf , isExtensionRulesEnabled : ()=> la , isFirefox : ()=> dx , isFunction : ()=> pa , isList : ()=> fi , isMacOS : ()=> ua , isMarkActive : ()=> mi , isNodeActive : ()=> ct , isNodeEmpty : ()=> In , isNodeSelection : ()=> co , isNodeViewSelected : ()=> fw , isNumber : ()=> eh , isPlainObject : ()=> eo , isProseMirrorAddMarkStep : ()=> hw , isProseMirrorAddNodeMarkStep : ()=> pw , isProseMirrorAttrStep : ()=> mw , isProseMirrorCellSelection : ()=> gw , isProseMirrorDocAttrStep : ()=> yw , isProseMirrorFragment : ()=> Bf , isProseMirrorNodeSelection : ()=> bw , isProseMirrorRemoveMarkStep : ()=> ww , isProseMirrorRemoveNodeMarkStep : ()=> xw , isProseMirrorReplaceAroundStep : ()=> kw , isProseMirrorReplaceStep : ()=> Sw , isProseMirrorSlice : ()=> Cw , isProseMirrorStep : ()=> Ft , isProseMirrorStepResult : ()=> vw , isRegExp : ()=> gi , isSafari : ()=> Tf , isString : ()=> fx , isTextSelection : ()=> hr , isiOS : ()=> Nn , liveWidgetKeys : ()=> Yf , markInputRule : ()=> Ie , markPasteRule : ()=> Ne , markdown : ()=> Sx , marksEqual : ()=> Cx , mergeAttributes : ()=> L , mergeDeep : ()=> Na , minMax : ()=> wt , nodeInputRule : ()=> po , nodePasteRule : ()=> jx , objectIncludes : ()=> ro , parseAttributes : ()=> Mi , parseIndentedBlocks : ()=> uo , pasteRulesPlugin : ()=> ah , posToDOMRect : ()=> va , removeDuplicates : ()=> If , renderNestedMarkdownContent : ()=> fo , resolveExtensions : ()=> xi , resolveFocusPosition : ()=> hi , rewriteUnknownContent : ()=> Mw , selectionToInsertionEnd : ()=> da , serializeAttributes : ()=> Ti , sortExtensions : ()=> ur , splitExtensions : ()=> Dn , textInputRule : ()=> $x , textPasteRule : ()=> _x , textblockTypeInputRule : ()=> br , updateMarkViewAttributes : ()=> Ra , wrappingInputRule : ()=> Vt }); var _c = Object . defineProperty , $o = ( t , e )=>{ let n = {}; for ( var r in t ) _c ( n , r ,{ get : t [ r ], enumerable :! 0 }); return e || _c ( n , Symbol . toStringTag ,{ value : "Module" }), n }; function Te ( t ){ this . content = t } Te . prototype = { constructor : Te , find : function ( t ){ for ( var e = 0 ; e < this . content . length ; e += 2 ) if ( this . content [ e ] === t ) return e ; return - 1 }, get : function ( t ){ var e = this . find ( t ); return e ==- 1 ? void 0 : this . content [ e + 1 ]}, update : function ( t , e , n ){ var r = n && n != t ? this . remove ( n ) : this , o = r . find ( t ), i = r . content . slice (); return o ==- 1 ? i . p
`)}};Qt.empty=new Qt(!0);var Ks=class{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};function dd(t){let e=[];do e.push(Vg(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Vg(t){let e=[];do e.push(Wg(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Wg(t){let e=Ug(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=jg(t,e);else break;return e}function Kc(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function jg(t,e){let n=Kc(t),r=n;return t.eat(",")&&(t.next!="}"?r=Kc(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function _g(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.isInGroup(e)&&o.push(s)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function Ug(t){if(t.eat("(")){let e=dd(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=_g(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Kg(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,l,a){let c={term:a,to:l};return e[s].push(c),c}function o(s,l){s.forEach(a=>a.to=l)}function i(s,l){if(s.type=="choice")return s.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(s.type=="seq")for(let a=0;;a++){let c=i(s.exprs[a],l);if(a==s.exprs.length-1)return c;o(c,l=n())}else if(s.type=="star"){let a=n();return r(l,a),o(i(s.expr,a),a),[r(a)]}else if(s.type=="plus"){let a=n();return o(i(s.expr,l),a),o(i(s.expr,a),a),[r(a)]}else{if(s.type=="opt")return[r(l)].concat(i(s.expr,l));if(s.type=="range"){let a=l;for(let c=0;c<s.min;c++){let d=n();o(i(s.expr,a),d),a=d}if(s.max==-1)o(i(s.expr,a),a);else for(let c=s.min;c<s.max;c++){let d=n();r(a,d),o(i(s.expr,a),d),a=d}return[r(a)]}else{if(s.type=="name")return[r(l,void 0,s.value)];throw new Error("Unknown expr type")}}}}function ud(t,e){return e-t}function qc(t,e){let n=[];return r(e),n.sort(ud);function r(o){let i=t[o];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(o);for(let s=0;s<i.length;s++){let{term:l,to:a}=i[s];!l&&n.indexOf(a)==-1&&r(a)}}}function qg(t){let e=Object.create(null);return n(qc(t,0));function n(r){let o=[];r.forEach(s=>{t[s].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let d=0;d<o.length;d++)o[d][0]==l&&(c=o[d][1]);qc(t,a).forEach(d=>{c||o.push([l,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let i=e[r.join(",")]=new Qt(r.indexOf(t.length-1)>-1);for(let s=0;s<o.length;s++){let l=o[s][1].sort(ud);i.next.push({type:o[s][0],next:e[l.join(",")]||n(l)})}return i}}function Jg(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],i=!o.validEnd,s=[];for(let l=0;l<o.next.length;l++){let{type:a,next:c}=o.next[l];s.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function fd(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function hd(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let i=t[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function pd(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(` Unsupported attribute $ { o } for $ { n } of type $ { r } `);for(let o in t)t[o].validate&&t[o].validate(e[o])}function md(
` ); else if ( s . linebreakReplacement && /[\r\n]/ . test ( r ) && this . top . findWrapping ( s . linebreakReplacement . create ())){ let l = r . split ( /\r?\n|\r/ ); for ( let a = 0 ; a < l . length ; a ++ ) a && this . insertNode ( s . linebreakReplacement . create (), n , ! 0 ), l [ a ] && this . insertNode ( s . text ( l [ a ]), n , ! /\S/ . test ( l [ a ])); r = "" } else r = r . replace ( /\r?\n|\r/g , " " ); else if ( r = r . replace ( /[ \t\r\n\u000c]+/g , " " ), /^[ \t\r\n\u000c]/ . test ( r ) && this . open == this . nodes . length - 1 ){ let l = o . content [ o . content . length - 1 ], a = e . previousSibling ;( ! l || a && a . nodeName == "BR" || l . isText && /[ \t\r\n\u000c]$/ . test ( l . text )) && ( r = r . slice ( 1 ))} r && this . insertNode ( s . text ( r ), n , ! /\S/ . test ( r )), this . findInText ( e )} else this . findInside ( e )} addElement ( e , n , r ){ let o = this . localPreserveWS , i = this . top ;( e . tagName == "PRE" || /pre/ . test ( e . style && e . style . whiteSpace )) && ( this . localPreserveWS =! 0 ); let s = e . nodeName . toLowerCase (), l ; yd . hasOwnProperty ( s ) && this . parser . normalizeLists && Zg ( e ); let a = this . options . ruleFromNode && this . options . ruleFromNode ( e ) || ( l = this . parser . matchTag ( e , this , r )); e : if ( a ? a . ignore : Qg . hasOwnProperty ( s )) this . findInside ( e ), this . ignoreFallback ( e , n ); else if ( ! a || a . skip || a . closeParent ){ a && a . closeParent ? this . open = Math . max ( 0 , this . open - 1 ) : a && a . skip . nodeType && ( e = a . skip ); let c , d = this . needsBlock ; if ( gd . hasOwnProperty ( s )) i . content . length && i . content [ 0 ]. isInline && this . open && ( this . open -- , i = this . top ), c =! 0 , i . type || ( this . needsBlock =! 0 ); else if ( ! e . firstChild ){ this . leafFallback ( e , n ); break e } let u = a && a . skip ? n : this . readStyles ( e , n ); u && this . addAll ( e , u ), c && this . sync ( i ), this . needsBlock = d } else { let c = this . readStyles ( e , n ); c && this . addElementByRule ( e , a , c , a . consuming ===! 1 ? l : void 0 )} this . localPreserveWS = o } leafFallback ( e , n ){ e . nodeName == "BR" && this . top . type && this . top . type . inlineContent && this . addTextNode ( e . ownerDocument . createTextNode ( `
` ), n )} ignoreFallback ( e , n ){ e . nodeName == "BR" && ( ! this . top . type ||! this . top . type . inlineContent ) && this . findPlace ( this . parser . schema . text ( "-" ), n , ! 0 )} readStyles ( e , n ){ let r = e . style ; if ( r && r . length ) for ( let o = 0 ; o < this . parser . matchedStyles . length ; o ++ ){ let i = this . parser . matchedStyles [ o ], s = r . getPropertyValue ( i ); if ( s ) for ( let l = void 0 ;;){ let a = this . parser . matchStyle ( i , s , this , l ); if ( ! a ) break ; if ( a . ignore ) return null ; if ( a . clearMark ? n = n . filter ( c => ! a . clearMark ( c )) : n = n . concat ( this . parser . schema . marks [ a . mark ]. create ( a . attrs )), a . consuming ===! 1 ) l = a ; else break }} return n } addElementByRule ( e , n , r , o ){ let i , s ; if ( n . node ) if ( s = this . parser . schema . nodes [ n . node ], s . isLeaf ) this . insertNode ( s . create ( n . attrs ), r , e . nodeName == "BR" ) || this . leafFallback ( e , r ); else { let a = this . enter ( s , n . attrs || null , r , n . preserveWhitespace ); a && ( i =! 0 , r = a )} else { let a = this . parser . schema . marks [ n . mark ]; r = r . concat ( a . create ( n . attrs ))} let l = this . top ; if ( s && s . isLeaf ) this . findInside ( e ); else if ( o ) this . addElement ( e , r , o ); else if ( n . getContent ) this . findInside ( e ), n . getContent ( e , this . parser . schema ). forEach ( a => this . insertNode ( a , r , ! 1 )); else { let a = e ; typeof n . contentElement == "string" ? a = e . querySelector ( n . contentElement ) : typeof n . contentElement == "function" ? a = n . contentElement ( e ) : n . contentElement && ( a = n . contentElement ), this . findAround ( e , a , ! 0 ), this . addAll ( a , r ), this . findAround ( e , a , ! 1 )} i && this . sync ( l ) && this . open -- } addAll ( e , n , r , o ){ let i = r || 0 ; for ( let s = r ? e . childNodes [ r ] : e . firstChild , l = o == null ? null : e . childNodes [ o ]; s != l ; s = s . nextSibling , ++ i ) this . findAtPoint ( e , i ), this . addDOM ( s , n ); this . findAtPoint ( e , i )} findPlace ( e , n , r ){ let o , i ; for ( let s = this . open , l = 0 ; s >= 0 ; s -- ){ let a = this . nodes [ s ], c = a . findWrapping ( e ); if ( c && ( ! o || o . length > c . length + l ) && ( o = c , i = a , ! c . length )) break ; if ( a . solid ){ if ( r ) break ; l += 2 }} if ( ! o ) return null ; this . sync ( i ); for ( let s = 0 ; s < o . length ; s ++ ) n = this . enterInner ( o [ s ], null , n , ! 1 ); return n } insertNode ( e , n , r ){ if ( e . isInline && this . needsBlock &&! this . top . type ){ let i = this . textblockFromContext (); i && ( n = this . enterInner ( i , null , n ))} let o = this . findPlace ( e , n , r ); if ( o ){ this . closeExtra (); let i = this . top ; i . match && ( i . match = i . match . matchType ( e . type )); let s = Q . none ; for ( let l of o . concat ( e . marks ))( i . type ? i . type . allowsMarkType ( l . type ) : Yc ( l . type , e . type )) && ( s = l . addToSet ( s )); return i . content . push ( e . mark ( s )), ! 0 } return ! 1 } enter ( e , n , r , o ){ let i = this . findPlace ( e . create ( n ), r , ! 1 ); return i && ( i = this . enterInner ( e , n , r , ! 0 , o )), i } enterInner ( e , n , r , o =! 1 , i ){ this . closeExtra (); let s = this . top ; s . match = s . match && s . match . matchType ( e ); let l = Gc ( e , i , s . options ); s . options & Or && s . content . length == 0 && ( l |= Or ); let a = Q . none ; return r = r . filter ( c =>( s . type ? s . type . allowsMarkType ( c . type ) : Yc ( c . type , e )) ? ( a = c . addToSet ( a ), ! 1 ) :! 0 ), this . nodes . push ( new qn ( e , n , a , o , null , l )), this . open ++ , r } closeExtra ( e =! 1 ){ let n = this . nodes . length - 1 ; if ( n > this . open ){ for (; n > this . open ; n -- ) this . nodes [ n - 1 ]. content . push ( this . nodes [ n ]. finish ( e )); this . nodes . length = this . open + 1 }} finish (){ return this . open = 0 , this . closeExtra ( this . isOpen ), this . nodes [ 0 ]. finish ( !! ( this . isOpen || this . options . topOpen ))} sync ( e ){ for ( let n = this . open ; n >= 0 ; n -- ){ if ( this . nodes [ n ] == e ) return this . open = n , ! 0 ; this . localPreserveWS && ( this . nodes [ n ]. options |= Dr )} return ! 1 } get currentPos (){ this . closeExtra (); let e = 0 ; for ( let n = this . open ; n >= 0 ; n -- ){ let r = this . nodes [ n ]. content ; for ( let o = r . length - 1 ; o >= 0 ; o -- ) e += r [ o ]. nodeSize ; n && e ++ } return e } findAtPoint ( e , n ){ if ( this . find ) for ( let r = 0 ; r < this . find . length ; r ++ ) this . find [ r ]. node == e && this . find [ r ]. offset == n && ( this . find [ r ]. pos = this . currentPos )} findInside ( e ){ if ( this . find ) for ( let n = 0 ; n < this . find . length ; n ++ ) this . find [ n ]. pos == null && e . nodeType == 1 && e . contains ( this . find [ n ]. node ) && ( this . find [ n ]. pos = this . currentPos )} findAround ( e , n , r ){ if ( e != n && this . find ) for ( let o = 0 ; o < this . find . length ; o ++ ) this . find [ o ]. pos == null && e . nodeType == 1 && e . contains ( this . find [ o ]. node ) && n . compareDocumentPosition ( this . find [ o ]. node ) & ( r ? 2 : 4 ) && ( this . find [ o ]. pos = this . currentPos )} findInText ( e ){ if ( this . find ) for ( let n = 0 ; n < this . find . length ; n ++ ) this . find [ n ]. node == e && ( this . find [ n ]. pos = this . currentPos - ( e . nodeValue . length - this . find [ n ]. offset ))} matchesContext ( e ){ if ( e . indexOf ( "|" ) >- 1 ) return e . split ( /\s*\|\s*/ ). some ( this . matchesContext , this ); let n = e . split ( "/" ), r = this . options . context , o =! this . isOpen && ( ! r || r .
`))}})}function hy(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function py(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new ue(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new E(S.from(s),0,0),1,!0))}function Ke(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,d=n-2;c>i;c--,d--){let u=o.node(c),f=o.index(c);if(u.type.spec.isolating)return!1;let h=u.content.cutByIndex(f,u.childCount),p=r&&r[d+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let g=r&&r[d]||u;if(!u.canReplace(f+1,u.childCount)||!g.type.validContent(h))return!1}let l=o.indexAfter(i),a=r&&r[0];return o.node(i).canReplaceWith(l,l,a?a.type:o.node(i+1).type)}function my(t,e,n=1,r){let o=t.doc.resolve(e),i=S.empty,s=S.empty;for(let l=o.depth,a=o.depth-n,c=n-1;l>a;l--,c--){i=S.from(o.node(l).copy(i));let d=r&&r[c];s=S.from(d?d.type.create(d.attrs,s):o.node(l).copy(s))}t.step(new be(e,e,new E(i.append(s),n,n),!0))}function lt(t,e){let n=t.resolve(e),r=n.index();return Ad(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function gy(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let i=e.child(o),s=i.type==r?t.type.schema.nodes.text:i.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(i.marks))return!1}return n.validEnd}function Ad(t,e){return!!(t&&e&&!t.isLeaf&&gy(t,e))}function Zn(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let i,s,l=r.index(o);if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(o+1),l++,s=r.node(o).maybeChild(l)):(i=r.node(o).maybeChild(l-1),s=r.node(o+1)),i&&!i.isTextblock&&Ad(i,s)&&r.node(o).canReplace(l,l+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function yy(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,i=t.doc.resolve(e-n),s=i.node().type;if(o&&s.inlineContent){let d=s.whitespace=="pre",u=!!s.contentMatch.matchType(o);d&&!u?r=!1:!d&&u&&(r=!0)}let l=t.steps.length;if(r===!1){let d=t.doc.resolve(e+n);Td(t,d.node(),d.before(),l)}s.inlineContent&&tl(t,e+n-1,s,i.node().contentMatchAt(i.index()),r==null);let a=t.mapping.slice(l),c=a.map(e-n);if(t.step(new be(c,a.map(e+n,-1),E.empty,!0)),r===!0){let d=t.doc.resolve(c);Md(t,d.node(),d.before(),t.steps.length)}return t}function by(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function Ko(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let s=r.depth;s>=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,a=r.index(s)+(l>0?1:0),c=r.node(s),d=!1;if(i==1)d=c.canReplace(a,a,o);else{let u=c.contentMatchAt(a).findWrapping(o.firstChild.type);d=u&&c.canReplaceWith(a,a,u[0])}if(d)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function Hr(t,e,n=e,r=E.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return Ed(o,i,r)?new be(e,n,r):new Zs(o,i,r).fit()}function Ed(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}var Zs=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=S.empty;for(let o=0;o<=e.depth;o++){let i=e.node(o);this.fro
` ). scrollIntoView ()), ! 0 )}; function hl ( t ){ for ( let e = 0 ; e < t . edgeCount ; e ++ ){ let { type : n } = t . edge ( e ); if ( n . isTextblock &&! n . hasRequiredAttrs ()) return n } return null } var pl = ( t , e )=>{ let { $head : n , $anchor : r } = t . selection ; if ( ! n . parent . type . spec . code ||! n . sameParent ( r )) return ! 1 ; let o = n . node ( - 1 ), i = n . indexAfter ( - 1 ), s = hl ( o . contentMatchAt ( i )); if ( ! s ||! o . canReplaceWith ( i , i , s )) return ! 1 ; if ( e ){ let l = n . after (), a = t . tr . replaceWith ( l , l , s . createAndFill ()); a . setSelection ( z . near ( a . doc . resolve ( l ), 1 )), e ( a . scrollIntoView ())} return ! 0 }, ml = ( t , e )=>{ let n = t . selection ,{ $from : r , $to : o } = n ; if ( n instanceof Ae || r . parent . inlineContent || o . parent . inlineContent ) return ! 1 ; let i = hl ( o . parent . contentMatchAt ( o . indexAfter ())); if ( ! i ||! i . isTextblock ) return ! 1 ; if ( e ){ let s = ( ! r . parentOffset && o . index () < o . parent . childCount ? r : o ). pos , l = t . tr . insert ( s , i . createAndFill ()); l . setSelection ( R . create ( l . doc , s + 1 )), e ( l . scrollIntoView ())} return ! 0 }, gl = ( t , e )=>{ let { $cursor : n } = t . selection ; if ( ! n || n . parent . content . size ) return ! 1 ; if ( n . depth > 1 && n . after () != n . end ( - 1 )){ let i = n . before (); if ( Ke ( t . doc , i )) return e && e ( t . tr . split ( i ). scrollIntoView ()), ! 0 } let r = n . blockRange (), o = r && Rt ( r ); return o == null ?! 1 : ( e && e ( t . tr . lift ( r , o ). scrollIntoView ()), ! 0 )}; function Ty ( t ){ return ( e , n )=>{ let { $from : r , $to : o } = e . selection ; if ( e . selection instanceof $ && e . selection . node . isBlock ) return ! r . parentOffset ||! Ke ( e . doc , r . pos ) ?! 1 : ( n && n ( e . tr . split ( r . pos ). scrollIntoView ()), ! 0 ); if ( ! r . depth ) return ! 1 ; let i = [], s , l , a =! 1 , c =! 1 ; for ( let h = r . depth ;; h -- ) if ( r . node ( h ). isBlock ){ a = r . end ( h ) == r . pos + ( r . depth - h ), c = r . start ( h ) == r . pos - ( r . depth - h ), l = hl ( r . node ( h - 1 ). contentMatchAt ( r . indexAfter ( h - 1 ))); let g = t && t ( o . parent , a , r ); i . unshift ( g || ( a && l ? { type : l } : null )), s = h ; break } else { if ( h == 1 ) return ! 1 ; i . unshift ( null )} let d = e . tr ;( e . selection instanceof R || e . selection instanceof Ae ) && d . deleteSelection (); let u = d . mapping . map ( r . pos ), f = Ke ( d . doc , u , i . length , i ); if ( f || ( i [ 0 ] = l ? { type : l } : null , f = Ke ( d . doc , u , i . length , i )), ! f ) return ! 1 ; if ( d . split ( u , i . length , i ), ! a && c && r . node ( s ). type != l ){ let h = d . mapping . map ( r . before ( s )), p = d . doc . resolve ( h ); l && r . node ( s - 1 ). canReplaceWith ( p . index (), p . index () + 1 , l ) && d . setNodeMarkup ( d . mapping . map ( r . before ( s )), l )} return n && n ( d . scrollIntoView ()), ! 0 }} var Ay = Ty (); var Xd = ( t , e )=>{ let { $from : n , to : r } = t . selection , o , i = n . sharedDepth ( r ); return i == 0 ?! 1 : ( o = n . before ( i ), e && e ( t . tr . setSelection ( $ . create ( t . doc , o ))), ! 0 )}, Ey = ( t , e )=>( e && e ( t . tr . setSelection ( new Ae ( t . doc ))), ! 0 ); function Oy ( t , e , n ){ let r = e . nodeBefore , o = e . nodeAfter , i = e . index (); return ! r ||! o ||! r . type . compatibleContent ( o . type ) ?! 1 :! r . content . size && e . parent . canReplace ( i - 1 , i ) ? ( n && n ( t . tr . delete ( e . pos - r . nodeSize , e . pos ). scrollIntoView ()), ! 0 ) :! e . parent . canReplace ( i , i + 1 ) ||! ( o . isTextblock || lt ( t . doc , e . pos )) ?! 1 : ( n && n ( t . tr . join ( e . pos ). scrollIntoView ()), ! 0 )} function Yd ( t , e , n , r ){ let o = e . nodeBefore , i = e . nodeAfter , s , l , a = o . type . spec . isolating || i . type . spec . isolating ; if ( ! a && Oy ( t , e , n )) return ! 0 ; let c =! a && e . parent . canReplace ( e . index (), e . index () + 1 ); if ( c && ( s = ( l = o . contentMatchAt ( o . childCount )). findWrapping ( i . type )) && l . matchType ( s [ 0 ] || i . type ). validEnd ){ if ( n ){ let h = e . pos + i . nodeSize , p = S . empty ; for ( let y = s . length - 1 ; y >= 0 ; y -- ) p = S . from ( s [ y ]. create ( null , p )); p = S . from ( o . copy ( p )); let g = t . tr . step ( new ue ( e . pos - 1 , h , e . pos , h , new E ( p , 1 , 0 ), s . length , ! 0 )), m = g . doc . resolve ( h + 2 * s . length ); m . nodeAfter && m . nodeAfter . type == o . type && lt ( g . doc , m . pos ) && g . join ( m . pos ), n ( g . scrollIntoView ())} return ! 0 } let d = i . type . spec . isolating || r > 0 && a ? null : z . findFrom ( e , 1 ), u = d && d . $from . blockRange ( d . $to ), f = u && Rt ( u ); if ( f != null && f >= e . depth ) return n && n ( t . tr . lift ( u , f ). scrollIntoView ()), ! 0 ; if ( c && nr ( i , "start" , ! 0 ) && nr ( o , "end" )){ let h = o , p = []; for (; p . push ( h ), ! h . isTextblock ;) h = h . lastChild ; let g = i , m = 1 ; for (; ! g . isTextblock ; g = g . firstChild ) m ++ ; if ( h . canReplace ( h . childCount , h . childCount , g . content )){ if ( n ){ let y = S . empty ; for ( let x = p . length - 1 ; x >= 0 ; x -- ) y = S . from ( p [ x ]. copy ( y )); let w = t . tr . step ( new ue ( e . pos - p . length , e . pos + i . nodeSize , e . pos + m , e . pos + i . nodeSize - m , new E ( y , p . length , 0 ), 0 , ! 0 )); n ( w . scrollIntoView ())} return ! 0 }} return ! 1 } function Qd ( t ){ return function ( e , n ){ let r = e . selection , o = t < 0 ? r . $from : r . $to , i = o . depth ; for (; o . node ( i ). isInline ;){ if ( ! i ) return ! 1 ; i -- } return o . node ( i ). isTextblock ? ( n && n ( e . tr . setSelection ( R . create ( e . doc , t < 0 ? o . start ( i ) : o . end ( i )))), ! 0 ) :! 1 }
`),u&&p==h.nodeValue.length)for(let g=h,m;g;g=g.parentNode){if(m=g.nextSibling){m.nodeName=="BR"&&(l=a={node:m.parentNode,offset:Se(m)+1});break}let y=g.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let g=h.childNodes[p-1];u=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(Ge&&d.focusNode&&d.focusNode!=a.node&&d.focusNode.nodeType==1){let h=d.focusNode.childNodes[d.focusOffset];h&&h.contentEditable=="false"&&(o=!0)}if(!(o||u&&Oe)&&vn(l.node,l.offset,d.anchorNode,d.anchorOffset)&&vn(a.node,a.offset,d.focusNode,d.focusOffset))return;let f=!1;if((c.extend||e==n)&&!(u&&Ge)){c.collapse(l.node,l.offset);try{e!=n&&c.extend(a.node,a.offset),f=!0}catch{}}if(!f){if(e>n){let p=l;l=a,a=p}let h=document.createRange();h.setEnd(a.node,a.offset),h.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o<this.children.length;o++){let i=this.children[o],s=r+i.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let l=r+i.border,a=s-i.border;if(e>=l&&n<=a){this.dirty=e==r||n==s?bn:cu,e==l&&n==a&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=at:i.markDirty(e-l,n-l);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?bn:at}r=s}this.dirty=bn}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?bn:cu;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},Yo=class extends Mn{constructor(e,n,r,o){let i,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.hasAttribute("contenteditable")||(s.contentEditable="false"),s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==Xe&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},Rl=class extends Mn{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}},xn=class t extends Mn{constructor(e,n,r,o,i){super(e,[],r,o),this.mark=n,this.spec=i}static create(e,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=yt.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new t(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&at||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=at&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Xe){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Xe}}slice(e,n,r){let o=t.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=Pl(i,n,s,r)),e>0&&(i=Pl(i,0,e,r));for(let l=0;l<i.length;l++)i[l].parent=o;return o.children=i,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},on=class t extends Mn{constructor(e,n,r,o,i,s,l){super(e,[],i,s),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=l}static create(e,n,r,o,i,s){let l=i.nodeViews[n.type.name],a,c=l&&l(n,i,()=>{if(!a)return s;if(a.parent)return a.parent.posBeforeChild(a)},r,o),d=c&&c.dom,u=c&&c.contentDOM;i
2026-09-28 20:53:46 +03:00
2026-11-03 01:53:45 +02:00
` ); return { dom : a , text : f , slice : e }} function Xl ( t , e , n , r , o ){ let i = o . parent . type . spec . code , s , l ; if ( ! n &&! e ) return null ; let a =!! e && ( r || i ||! n ); if ( a ){ if ( t . someProp ( "transformPastedText" , f =>{ e = f ( e , i || r , t )}), i ) return l = new E ( S . from ( t . state . schema . text ( e . replace ( /\r\n?/g , `
` ))), 0 , 0 ), t . someProp ( "transformPasted" , f =>{ l = f ( l , t , ! 0 )}), l ; let u = t . someProp ( "clipboardTextParser" , f => f ( e , o , r , t )); if ( u ) l = u ; else { let f = o . marks (),{ schema : h } = t . state , p = yt . fromSchema ( h ); s = document . createElement ( "div" ), e . split ( /(?:\r\n?|\n)+/ ). forEach ( g =>{ let m = s . appendChild ( document . createElement ( "p" )); g && m . appendChild ( p . serializeNode ( h . text ( g , f )))})}} else t . someProp ( "transformPastedHTML" , u =>{ n = u ( n , t )}), s = C0 ( n ), Xr && v0 ( s ); let c = s && s . querySelector ( "[data-pm-slice]" ), d = c && /^(\d+) (\d+)(?: -(\d+))? (.*)/ . exec ( c . getAttribute ( "data-pm-slice" ) || "" ); if ( d && d [ 3 ]) for ( let u =+ d [ 3 ]; u > 0 ; u -- ){ let f = s . firstChild ; for (; f && f . nodeType != 1 ;) f = f . nextSibling ; if ( ! f ) break ; s = f } if ( l || ( l = ( t . someProp ( "clipboardParser" ) || t . someProp ( "domParser" ) || Ve . fromSchema ( t . state . schema )). parseSlice ( s ,{ preserveWhitespace :!! ( a || d ), context : o , ruleFromNode ( f ){ return f . nodeName == "BR" &&! f . nextSibling && f . parentNode &&! x0 . test ( f . parentNode . nodeName ) ? { ignore :! 0 } : null }})), d ) l = M0 ( Su ( l , + d [ 1 ], + d [ 2 ]), d [ 4 ]); else if ( l = E . maxOpen ( k0 ( l . content , o ), ! 0 ), l . openStart || l . openEnd ){ let u = 0 , f = 0 ; for ( let h = l . content . firstChild ; u < l . openStart &&! h . type . spec . isolating ; u ++ , h = h . firstChild ); for ( let h = l . content . lastChild ; f < l . openEnd &&! h . type . spec . isolating ; f ++ , h = h . lastChild ); l = Su ( l , u , f )} return t . someProp ( "transformPasted" , u =>{ l = u ( l , t , a )}), l } var x0 = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i ; function k0 ( t , e ){ if ( t . childCount < 2 ) return t ; for ( let n = e . depth ; n >= 0 ; n -- ){ let o = e . node ( n ). contentMatchAt ( e . index ( n )), i , s = []; if ( t . forEach ( l =>{ if ( ! s ) return ; let a = o . findWrapping ( l . type ), c ; if ( ! a ) return s = null ; if ( c = s . length && i . length && Xu ( a , i , l , s [ s . length - 1 ], 0 )) s [ s . length - 1 ] = c ; else { s . length && ( s [ s . length - 1 ] = Yu ( s [ s . length - 1 ], i . length )); let d = Gu ( l , a ); s . push ( d ), o = o . matchType ( d . type ), i = a }}), s ) return S . from ( s )} return t } function Gu ( t , e , n = 0 ){ for ( let r = e . length - 1 ; r >= n ; r -- ) t = e [ r ]. create ( null , S . from ( t )); return t } function Xu ( t , e , n , r , o ){ if ( o < t . length && o < e . length && t [ o ] == e [ o ]){ let i = Xu ( t , e , n , r . lastChild , o + 1 ); if ( i ) return r . copy ( r . content . replaceChild ( r . childCount - 1 , i )); if ( r . contentMatchAt ( r . childCount ). matchType ( o == t . length - 1 ? n . type : t [ o + 1 ])) return r . copy ( r . content . append ( S . from ( Gu ( n , t , o + 1 ))))}} function Yu ( t , e ){ if ( e == 0 ) return t ; let n = t . content . replaceChild ( t . childCount - 1 , Yu ( t . lastChild , e - 1 )), r = t . contentMatchAt ( t . childCount ). fillBefore ( S . empty , ! 0 ); return t . copy ( n . append ( r ))} function zl ( t , e , n , r , o , i ){ let s = e < 0 ? t . firstChild : t . lastChild , l = s . content ; return t . childCount > 1 && ( i = 0 ), o < r - 1 && ( l = zl ( l , e , n , r , o + 1 , i )), o >= n && ( l = e < 0 ? s . contentMatchAt ( 0 ). fillBefore ( l , i <= o ). append ( l ) : l . append ( s . contentMatchAt ( s . childCount ). fillBefore ( S . empty , ! 0 ))), t . replaceChild ( e < 0 ? 0 : t . childCount - 1 , s . copy ( l ))} function Su ( t , e , n ){ return e < t . openStart && ( t = new E ( zl ( t . content , - 1 , e , t . openStart , 0 , t . openEnd ), e , t . openEnd )), n < t . openEnd && ( t = new E ( zl ( t . content , 1 , n , t . openEnd , 0 , 0 ), t . openStart , n )), t } var Qu = { thead : [ "table" ], tbody : [ "table" ], tfoot : [ "table" ], caption : [ "table" ], colgroup : [ "table" ], col : [ "table" , "colgroup" ], tr : [ "table" , "tbody" ], td : [ "table" , "tbody" , "tr" ], th : [ "table" , "tbody" , "tr" ]}; function Zu (){ return document . implementation . createHTMLDocument ( "title" )} var Wr = null ; function S0 ( t ){ let e = window . trustedTypes ; if ( ! e ) return t ; if ( ! Wr ){ if ( Wr = e . defaultPolicy ) try { return Wr . createHTML ( t )} catch {} Wr = e . createPolicy ( "ProseMirrorClipboard" ,{ createHTML : n => n })} return Wr . createHTML ( t )} function C0 ( t ){ let e = /^(\s*<meta [^>]*>)*/ . exec ( t ); e && ( t = t . slice ( e [ 0 ]. length )); let n = Zu (), r = n . body , o = /<([a-z][^>\s]+)/i . exec ( t ), i ; if (( i = o && Qu [ o [ 1 ]. toLowerCase ()]) && ( t = i . map ( s => "<" + s + ">" ). join ( "" ) + t + i . map ( s => "</" + s + ">" ). reverse (). join ( "" )), r . innerHTML = S0 ( t ), i ) for ( let s = 0 ; s < i . length ; s ++ ) r = r . querySelector ( i [ s ]) || r ; for ( let s = 0 ; s < n . styleSheets . length ; s ++ ){ let l = n . styleSheets [ s ]; for ( let a = 0 ; a < l . rules . length ; a ++ ){ let c = l . rules [ a ]; if ( c instanceof CSSStyleRule ){ let d = r . querySelectorAll ( c . selectorText ); for ( let u = 0 ; u < d . length ; u ++ ) d [ u ]. style . cssText += c . style . cssText }}} return r } function v0 ( t ){ let e = t . querySelectorAll ( Ce ? "span:not([class]):not([style])" : "span.Apple-converted-space" ); for ( let n = 0 ; n < e . length ; n ++ ){ let r = e [ n ]; r . childNodes . length == 1 && r . textContent == "\xA0" && r . parentNo
2026-09-28 20:53:46 +03:00
2026-11-03 01:53:45 +02:00
`,textSerializers:s={}}=n||{},l="";return t.nodesBetween(r,o,(a,c,d,u)=>{a.isBlock&&c>r&&(l+=i);let f=s?.[a.type.name];if(f)return d&&(l+=f({node:a,pos:c,parent:d,index:u,range:e})),!1;if(a.isText){var h;l+=a==null||(h=a.text)===null||h===void 0?void 0:h.slice(Math.max(r,c)-c,o-c)}}),l}function ba(t,e){return ya(t,{from:0,to:t.content.size},e)}function Si(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function dw(t,e,n){let{blockSeparator:r=`
2026-09-28 20:53:46 +03:00
2026-11-03 01:53:45 +02:00
`,textSerializers:o={}}=n||{},i=ki(e);return ba(ge.fromJSON(i,t),{blockSeparator:r,textSerializers:{...Si(i),...o}})}function Lf(t,e){let n=ce(e,t.schema),{from:r,to:o}=t.selection,i=[];t.doc.nodesBetween(r,o,l=>{i.push(l)});let s=i.reverse().find(l=>l.type.name===n.name);return s?{...s.attrs}:{}}function Ci(t,e){let n=so(typeof e=="string"?e:e.name,t.schema);return n==="node"?Lf(t,e):n==="mark"?fa(t,e):{}}function If(t,e=JSON.stringify){let n={};return t.filter(r=>{let o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function uw(t){let e=If(t);return e.length===1?e:e.filter((n,r)=>!e.filter((o,i)=>i!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function Ln(t){let{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,i)=>{let s=[];if(o.ranges.length)o.forEach((l,a)=>{s.push({from:l,to:a})});else{let{from:l,to:a}=n[i];if(l===void 0||a===void 0)return;s.push({from:l,to:a})}s.forEach(({from:l,to:a})=>{let c=e.slice(i).map(l,-1),d=e.slice(i).map(a),u=e.invert().map(c,-1),f=e.invert().map(d);r.push({oldRange:{from:u,to:f},newRange:{from:c,to:d}})})}),uw(r)}function Pf(t,e=0){let n=t.type===t.type.schema.topNodeType?0:1,r=e,o=r+t.nodeSize,i=t.marks.map(a=>{let c={type:a.type.name};return Object.keys(a.attrs).length&&(c.attrs={...a.attrs}),c}),s={...t.attrs},l={type:t.type.name,from:r,to:o};return Object.keys(s).length&&(l.attrs=s),i.length&&(l.marks=i),t.content.childCount&&(l.content=[],t.forEach((a,c)=>{var d;(d=l.content)===null||d===void 0||d.push(Pf(a,e+c+n))})),t.text&&(l.text=t.text),l}function ao(t,e,n){let r=[];return t===e?n.resolve(t).marks().forEach(o=>{let i=yi(n.resolve(t),o.type);i&&r.push({mark:o,...i})}):n.nodesBetween(t,e,(o,i)=>{!o||o?.nodeSize===void 0||r.push(...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s})))}),r}var wa=(t,e,n,r=20)=>{let o=t.doc.resolve(n),i=r,s=null;for(;i>0&&s===null;){let l=o.node(i);l?.type.name===e?s=l:i-=1}return[s,i]},xa=t=>{let e=t.depth-1;if(e<0)return null;let n=t.index(e);return n===0?null:t.node(e).child(n-1)};function An(t,e){return e.nodes[t]||e.marks[t]||null}function no(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{let o=t.find(i=>i.type===e&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}var $f=(t,e=500)=>{let n="",r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,i,s,l)=>{var a,c;let d=((a=(c=o.type.spec).toText)===null||a===void 0?void 0:a.call(c,{node:o,pos:i,parent:s,index:l}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?d:d.slice(0,Math.max(0,r-i))}),n};function mi(t,e,n={}){let{empty:r,ranges:o}=t.selection,i=e?xt(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>i?i.name===d.type.name:!0).find(d=>ro(d.attrs,n,{strict:!1}));let s=0,l=[];if(o.forEach(({$from:d,$to:u})=>{let f=d.pos,h=u.pos;t.doc.nodesBetween(f,h,(p,g)=>{if(i&&p.inlineContent&&!p.type.allowsMarkType(i))return!1;if(!p.isText&&!p.marks.length)return;let m=Math.max(f,g),y=Math.min(h,g+p.nodeSize),w=y-m;s+=w,l.push(...p.marks.map(x=>({mark:x,from:m,to:y})))})}),s===0)return!1;let a=l.filter(d=>i?i.name===d.mark.type.name:!0).filter(d=>ro(d.mark.attrs,n,{strict:!1})).reduce((d,u)=>d+u.to-u.from,0),c=l.filter(d=>i?d.mark.type!==i&&d.mark.type.excludes(i):!0).reduce((d,u)=>d+u.to-u.from,0);return(a>0?a+c:a)>=s}function vi(t,e,n={}){if(!e)return ct(t,null,n)||mi(t,null,n);let r=so(e,t.schema);return r==="node"?ct(t,e,n):r==="mark"?mi(t,e,n):!1}var ka=(t,e)=>{let{$from:n,$to:r,$anchor:o}=t.selection;if(e){let i=Ht(l=>l.type.name===e)(t.selection);if(!i)return!1;let s=t.doc.resolve(i.pos+1);return o.pos+1===s.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Sa=t=>{let{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function la(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function fi(t,e){let{nodeExtensions:n}=Dn(e),r=n.find(i=>i.name===t);if(!r)return!1;let o=G(B(r,"group",{name:r.name,options:r.options,storage:r.storage}));return typeof o!="strin
2026-09-28 20:53:46 +03:00
2026-10-19 17:33:22 +03:00
` ); return `::: ${ c }${ g }
2026-09-28 20:53:46 +03:00
2026-10-19 17:33:22 +03:00
${ m }
2026-09-28 20:53:46 +03:00
2026-11-03 01:53:45 +02:00
:::` }}} function xx ( t ){ let e = {}; return rh ( t , "shortcode" ). forEach ( n =>{ n . type === "keyValue" && ( e [ n . name ] = n . value )}), e } function kx ( t ){ return Object . entries ( t ). filter (([, e ])=> e != null ). map (([ e , n ])=> ` ${ e } =" ${ n } "` ). join ( " " )} function ih ( t ){ let { nodeName : e , name : n , getContent : r , parseAttributes : o = xx , serializeAttributes : i = kx , defaultAttributes : s = {}, selfClosing : l =! 1 , allowedAttributes : a } = t , c = n || e , d = f =>{ if ( ! a ) return f ; let h = {}; return a . forEach ( p =>{ let g = typeof p == "string" ? p : p . name , m = typeof p == "string" ? void 0 : p . skipIfDefault ; if ( g in f ){ let y = f [ g ]; if ( m !== void 0 && y === m ) return ; h [ g ] = y }}), h }, u = c . replace ( /[.*+?^${}()|[\]\\]/g , "\\$&" ); return { parseMarkdown : ( f , h )=>{ let p = {... s ,... f . attributes }; if ( l ) return h . createNode ( e , p ); let g = r ? r ( f ) : f . content || "" ; return g ? h . createNode ( e , p ,[ h . createTextNode ( g )]) : h . createNode ( e , p ,[])}, markdownTokenizer : { name : e , level : "inline" , start ( f ){ let h = l ? new RegExp ( `\\[ ${ u } \\s*[^\\]]*\\]` ) : new RegExp ( `\\[ ${ u } \\s*[^\\]]*\\][\\s\\S]*?\\[\\/ ${ u } \\]` ), p = f . match ( h ), g = p ? . index ; return g !== void 0 ? g :- 1 }, tokenize ( f , h , p ){ let g = l ? new RegExp ( `^\\[ ${ u } \\s*([^\\]]*)\\]` ) : new RegExp ( `^\\[ ${ u } \\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/ ${ u } \\]` ), m = f . match ( g ); if ( ! m ) return ; let y = "" , w = "" ; if ( l ){ let [, b ] = m ; w = b } else { let [, b , k ] = m ; w = b , y = k || "" } let x = o ( w . trim ()); return { type : e , raw : m [ 0 ], content : y . trim (), attributes : x }}}, renderMarkdown : f =>{ let h = "" ; r ? h = r ( f ) : f . content && f . content . length > 0 && ( h = f . content . filter ( y => y . type === "text" ). map ( y => y . text ). join ( "" )); let p = d ( f . attrs || {}), g = i ( p ), m = g ? ` ${ g } ` : "" ; return l ? `[ ${ c }${ m } ]` : `[ ${ c }${ m } ] ${ h } [/ ${ c } ]` }}} function uo ( t , e , n ){ let r = t . split ( `
2026-09-28 20:53:46 +03:00
` ), o = [], i = "" , s = 0 , l = e . baseIndentSize || 2 ; for (; s < r . length ;){ let d = r [ s ], u = d . match ( e . itemPattern ); if ( ! u ){ if ( o . length > 0 ) break ; if ( d . trim () === "" ){ s += 1 , i = ` ${ i }${ d }
` ; continue } else return } let f = e . extractItemData ( u ),{ indentLevel : h , mainContent : p } = f ; i = ` ${ i }${ d }
2026-11-03 01:53:45 +02:00
` ; let g = [ p ]; for ( s += 1 ; s < r . length ;){ var a ; let x = r [ s ]; if ( x . trim () === "" ){ var c ; let b = r . slice ( s + 1 ). findIndex ( k => k . trim () !== "" ); if ( b ===- 1 ) break ; if (((( c = r [ s + 1 + b ]. match ( /^(\s*)/ )) === null || c === void 0 || ( c = c [ 1 ]) === null || c === void 0 ? void 0 : c . length ) || 0 ) > h ){ g . push ( x ), i = ` ${ i }${ x }
` , s += 1 ; continue } else break } if (((( a = x . match ( /^(\s*)/ )) === null || a === void 0 || ( a = a [ 1 ]) === null || a === void 0 ? void 0 : a . length ) || 0 ) > h ) g . push ( x ), i = ` ${ i }${ x }
` , s += 1 ; else break } let m , y = g . slice ( 1 ); if ( y . length > 0 ){ let x = y . map ( b => b . slice ( h + l )). join ( `
` ); x . trim () && ( e . customNestedParser ? m = e . customNestedParser ( x ) : m = n . blockTokens ( x ))} let w = e . createToken ( f , m ); o . push ( w )} if ( o . length !== 0 ) return { items : o , raw : i }} function fo ( t , e , n , r ){ if ( ! t ||! Array . isArray ( t . content )) return "" ; let o = typeof n == "function" ? n ( r ) : n ,[ i ,... s ] = t . content , l = ` ${ o }${ e . renderChildren ([ i ]) } ` ; return s && s . length > 0 && s . forEach (( a , c )=>{ var d , u ; let f = ( d = ( u = e . renderChild ) === null || u === void 0 ? void 0 : u . call ( e , a , c + 1 )) !== null && d !== void 0 ? d : e . renderChildren ([ a ]); if ( f != null ){ let h = f . split ( `
2026-09-28 20:53:46 +03:00
` ). map ( p => p ? e . indent ( p ) : e . indent ( "" )). join ( `
` ); l += a . type === "paragraph" ? `
${ h } ` : `
2026-11-03 01:53:45 +02:00
${ h } ` }}), l } var Sx = $o ({ createAtomBlockMarkdownSpec : ()=> oh , createBlockMarkdownSpec : ()=> gr , createInlineMarkdownSpec : ()=> ih , parseAttributes : ()=> Mi , parseIndentedBlocks : ()=> uo , renderNestedMarkdownContent : ()=> fo , serializeAttributes : ()=> Ti }); function Sf ( t ){ return typeof t . type == "string" ? t . type : t . type . name } function Cx ( t , e ){ if ( t . length !== e . length ) return ! 1 ; let n = Array . from ({ length : e . length },()=> ! 1 ); return t . every ( r =>{ let o = Sf ( r ), i = e . findIndex (( s , l )=> ! n [ l ] && o === Sf ( s ) && Ma ( r . attrs , s . attrs )); return i ===- 1 ?! 1 : ( n [ i ] =! 0 , ! 0 )})} function Na ( t , e ){ let n = {... t }; return eo ( t ) && eo ( e ) && Object . keys ( e ). forEach ( r =>{ eo ( e [ r ]) && eo ( t [ r ]) ? n [ r ] = Na ( t [ r ], e [ r ]) : n [ r ] = e [ r ]}), n } function Ra ( t , e , n = {}){ let { state : r } = e ,{ doc : o , tr : i } = r , s = t ; o . descendants (( l , a )=>{ let c = i . mapping . map ( a ), d = i . mapping . map ( a ) + l . nodeSize , u = null ; if ( l . marks . forEach ( h =>{ if ( h !== s ) return ! 1 ; u = h }), ! u ) return ; let f =! 1 ; if ( Object . keys ( n ). forEach ( h =>{ n [ h ] !== u . attrs [ h ] && ( f =! 0 )}), f ){ let h = t . type . create ({... t . attrs ,... n }); i . removeMark ( c , d , t . type ), i . addMark ( c , d , h )}}), i . docChanged && e . view . dispatch ( i )} var vx = class { constructor ( t , e , n ){ this . component = t , this . editor = e . editor , this . options = {... n }, this . mark = e . mark , this . HTMLAttributes = e . HTMLAttributes } get dom (){ return this . editor . view . dom } get contentDOM (){ return null } updateAttributes ( t , e ){ Ra ( e || this . mark , this . editor , t )} ignoreMutation ( t ){ return ! this . dom ||! this . contentDOM ?! 0 : typeof this . options . ignoreMutation == "function" ? this . options . ignoreMutation ({ mutation : t }) : t . type === "selection" || this . dom . contains ( t . target ) && t . type === "childList" && ( Nn () || oo ()) && this . editor . isFocused && [... Array . from ( t . addedNodes ),... Array . from ( t . removedNodes )]. every ( e => e . isContentEditable ) ?! 1 : this . contentDOM === t . target && t . type === "attributes" ?! 0 :! this . contentDOM . contains ( t . target )}}, ln = class { constructor ( t ){ var e ; this . find = t . find , this . handler = t . handler , this . undoable = ( e = t . undoable ) !== null && e !== void 0 ? e :! 0 }}, Mx = ( t , e )=>{ if ( gi ( e )) return e . exec ( t ); let n = e ( t ); if ( ! n ) return null ; let r = [ n . text ]; return r . index = n . index , r . input = t , r . data = n . data , n . replaceWith && ( n . text . includes ( n . replaceWith ) || console . warn ( '[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".' ), r . push ( n . replaceWith )), r }; function di ( t ){ var e ; let { editor : n , from : r , to : o , text : i , rules : s , plugin : l } = t ,{ view : a } = n ; if ( a . composing ) return ! 1 ; let c = a . state . doc . resolve ( r ); if ( c . parent . type . spec . code ||! (( e = c . nodeBefore || c . nodeAfter ) === null || e === void 0 ) && e . marks . find ( f => f . type . spec . code )) return ! 1 ; let d =! 1 , u = $f ( c ) + i ; return s . forEach ( f =>{ if ( d ) return ; let h = Mx ( u , f . find ); if ( ! h ) return ; let p = h [ 0 ]. length - i . length ; if ( p > 0 ){ let k = c . parentOffset - p ; if ( k < 0 || c . parent . textBetween ( k , c . parentOffset ) !== h [ 0 ]. slice ( 0 , p )) return } let g = a . state . tr , m = io ({ state : a . state , transaction : g }), y = { from : r - ( h [ 0 ]. length - i . length ), to : o },{ commands : w , chain : x , can : b } = new On ({ editor : n , state : m }); f . handler ({ state : m , range : y , match : h , commands : w , chain : x , can : b }) === null ||! g . steps . length || ( f . undoable && g . setMeta ( l ,{ transform : g , from : r , to : o , text : i }), a . dispatch ( g ), d =! 0 )}), d } function sh ( t ){ let { editor : e , rules : n } = t , r = new F ({ state : { init (){ return null }, apply ( o , i , s ){ let l = o . getMeta ( r ); if ( l ) return l ; let a = o . getMeta ( "applyInputRules" ); return a && setTimeout (()=>{ let { text : c } = a ; typeof c == "string" ? c = c : c = lo ( S . from ( c ), s . schema ); let { from : d } = a , u = d + c . length ; di ({ editor : e , from : d , to : u , text : c , rules : n , plugin : r })}), o . selectionSet || o . docChanged ? null : i }}, props : { handleTextInput ( o , i , s , l ){ return di ({ editor : e , from : i , to : s , text : l , rules : n , plugin : r })}, handleDOMEvents : { compositionend : o =>( setTimeout (()=>{ let { $cursor : i } = o . state . selection ; i && di ({ editor : e , from : i . pos , to : i . pos , text : "" , rules : n , plugin : r })}), ! 1 )}, handleKeyDown ( o , i ){ if ( i . key !== "Enter" ) return ! 1 ; let { $cursor : s } = o . state . selection ; return s ? di ({ editor : e , from : s . pos , to : s . pos , text : `
` , rules : n , plugin : r }) :! 1 }}, isInputRules :! 0 }); return r } var Ai = class { constructor ( t = {}){ this . type = "extendable" , this . parent = null , this . child = null , this . name = "" , this . config = { name : this . name }, this . config = {... this . config ,... t }, this . name = this . config . name } get options (){ return {... G ( B ( this , "addOptions" ,{ name : this . name }))}} get storage (){ return {... G ( B ( this , "addStorage" ,{ name : this . name , options : this . options }))}} configure ( t = {}){ let e = this . extend ({... this . config , addOptions : ()=> Na ( this . options , t )}); return e . name = this . name , e . parent = this . parent , this . child = null , e } extend ( t = {}){ let e = new this . constructor ({... this . config ,... t }); return e . parent = this , this . child = e , e . name = "name" in t ? t . name : e . parent . name , e }}, ie = class lh extends Ai { constructor (... e ){ super (... e ), this . type = "mark" } static create ( e = {}){ let n = typeof e == "function" ? e () : e ; return new lh ( n )} static handleExit ({ editor : e , mark : n }){ let { tr : r } = e . state , o = e . state . selection . $from ; if ( o . pos === o . end ()){ let i = o . marks (); if ( ! i . find ( l => l ? . type . name === n . name )) return ! 1 ; let s = i . find ( l => l ? . type . name === n . name ); return s && r . removeStoredMark ( s ), r . insertText ( " " , o . pos ), e . view . dispatch ( r ), ! 0 } return ! 1 } configure ( e ){ return super . configure ( e )} extend ( e ){ let n = typeof e == "function" ? e () : e ; return super . extend ( n )}}, yr = class { constructor ( t ){ this . find = t . find , this . handler = t . handler }}, Tx = ( t , e , n )=>{ if ( gi ( e )) return [... t . matchAll ( e )]; let r = e ( t , n ); return r ? r . map ( o =>{ let i = [ o . text ]; return i . index = o . index , i . input = t , i . data = o . data , o . replaceWith && ( o . text . includes ( o . replaceWith ) || console . warn ( '[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".' ), i . push ( o . replaceWith )), i }) : []}; function Ax ( t ){ let { editor : e , state : n , from : r , to : o , rule : i , pasteEvent : s , dropEvent : l } = t ,{ commands : a , chain : c , can : d } = new On ({ editor : e , state : n }), u = []; return n . doc . nodesBetween ( r , o ,( f , h )=>{ var p , g , m , y ; if ( ! (( p = f . type ) === null || p === void 0 || ( p = p . spec ) === null || p === void 0 ) && p . code ||! ( f . isText || f . isTextblock || f . isInline )) return ; let w = ( g = ( m = ( y = f . content ) === null || y === void 0 ? void 0 : y . size ) !== null && m !== void 0 ? m : f . nodeSize ) !== null && g !== void 0 ? g : 0 , x = Math . max ( r , h ), b = Math . min ( o , h + w ); if ( x >= b ) return ; let k = f . isText ? f . text || "" : f . textBetween ( x - h , b - h , void 0 , "\uFFFC" ); Tx ( k , i . find , s ). forEach ( M =>{ if ( M . index === void 0 ) return ; let C = x + M . index + 1 , O = C + M [ 0 ]. length , P = { from : n . tr . mapping . map ( C ), to : n . tr . mapping . map ( O )}, N = i . handler ({ state : n , range : P , match : M , commands : a , chain : c , can : d , pasteEvent : s , dropEvent : l }); u . push ( N )})}), u . every ( f => f !== null )} var ui = null , Ex = t =>{ var e ; let n = new ClipboardEvent ( "paste" ,{ clipboardData : new DataTransfer }); return ( e = n . clipboardData ) === null || e === void 0 || e . setData ( "text/html" , t ), n }; function ah ( t ){ let { editor : e , rules : n } = t , r = null , o =! 1 , i =! 1 , s = typeof ClipboardEvent < "u" ? new ClipboardEvent ( "paste" ) : null , l ; try { l = typeof DragEvent < "u" ? new DragEvent ( "drop" ) : null } catch { l = null } let a = ({ state : c , from : d , to : u , rule : f , pasteEvt : h })=>{ let p = c . tr , g = io ({ state : c , transaction : p }); if ( ! ( ! Ax ({ editor : e , state : g , from : Math . max ( d - 1 , 0 ), to : u . b - 1 , rule : f , pasteEvent : h , dropEvent : l }) ||! p . steps . length )){ try { l = typeof DragEvent < "u" ? new DragEvent ( "drop" ) : null } catch { l = null } return s = typeof ClipboardEvent < "u" ? new ClipboardEvent ( "paste" ) : null , p }}; return n . map ( c => new F ({ view ( d ){ let u = h =>{ var p ; r =! (( p = d . dom . parentElement ) === null || p === void 0 ) && p . contains ( h . target ) ? d . dom . parentElement : null , r && ( ui = e )}, f = ()=>{ ui && ( ui = null )}; return window . addEventListener ( "dragstart" , u ), window . addEventListener ( "dragend" , f ),{ destroy (){ window . removeEventListener ( "dragstart" , u ), window . removeEventListener ( "dragend" , f )}}}, props : { handleDOMEvents : { drop : ( d , u )=>{ if ( i = r === d . dom . parentElement , l = u , ! i ){ let f = ui ; f ? . isEditable && setTimeout (()=>{ let h = f . state . selection ; h && f . commands . deleteRange ({ from : h . from , to : h . to })}, 10 )} return ! 1 }, paste : ( d , u )=>{ var f ; let h = ( f = u . clipboardData ) === null || f === void 0 ? void 0 : f . getData ( "text/html" ); return s = u , o =!! h ? . includes ( "data-pm-slice" ), ! 1 }}}, appendTransaction : ( d , u , f )=>{ let h = d [ 0 ], p = h . getMeta ( "uiEvent" ) === "paste" &&! o , g = h . getMeta ( "uiEvent" ) === "drop" &&! i , m = h . getMeta ( "applyPasteRules" ), y =!! m ; if ( ! p &&! g &&! y ) return ; if ( y ){ let { text : b } = m ; typeof b == "string" ? b = b : b = lo ( S . from ( b ), f . schema ); let { from : k } = m , M = k + b . length , C = Ex ( b ); return a ({ rule :
2026-09-28 20:53:46 +03:00
2026-11-03 01:53:45 +02:00
`)}}})]}}),uh=Z.create({name:"commands",addCommands(){return{...jf}}}),fh=Z.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r;let o=()=>{var i,s,l;if((i=(s=this.editor.options.coreExtensionOptions)===null||s===void 0||(s=s.delete)===null||s===void 0||(l=s.filterTransaction)===null||l===void 0?void 0:l.call(s,t))!==null&&i!==void 0?i:t.getMeta("y-sync$"))return;let a=bi(t.before,[t,...e]);Ln(a).forEach(d=>{a.mapping.mapResult(d.oldRange.from).deletedAfter&&a.mapping.mapResult(d.oldRange.to).deletedBefore&&a.before.nodesBetween(d.oldRange.from,d.oldRange.to,(u,f)=>{let h=f+u.nodeSize-2,p=d.oldRange.from<=f&&h<=d.oldRange.to;this.editor.emit("delete",{type:"node",node:u,from:f,to:h,newFrom:a.mapping.map(f),newTo:a.mapping.map(h),deletedRange:d.oldRange,newRange:d.newRange,partial:!p,editor:this.editor,transaction:t,combinedTransform:a})})});let c=a.mapping;a.steps.forEach((d,u)=>{if(d instanceof Nt){var f,h;let p=c.slice(u).map(d.from,-1),g=c.slice(u).map(d.to),m=c.invert().map(p,-1),y=c.invert().map(g),w=p>0?(f=a.doc.nodeAt(p-1))===null||f===void 0?void 0:f.marks.some(b=>b.eq(d.mark)):!1,x=(h=a.doc.nodeAt(g))===null||h===void 0?void 0:h.marks.some(b=>b.eq(d.mark));this.editor.emit("delete",{type:"mark",mark:d.mark,from:d.from,to:d.to,deletedRange:{from:m,to:y},newRange:{from:p,to:g},partial:!!(x||w),editor:this.editor,transaction:t,combinedTransform:a})}})};!((n=(r=this.editor.options.coreExtensionOptions)===null||r===void 0||(r=r.delete)===null||r===void 0?void 0:r.async)!==null&&n!==void 0)||n?setTimeout(o,0):o()}}),hh=Z.create({name:"drop",addProseMirrorPlugins(){return[new F({key:new j("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),ph=Z.create({name:"editable",addProseMirrorPlugins(){return[new F({key:new j("editable"),props:{editable:()=>this.editor.options.editable}})]}}),mh=new j("focusEvents"),gh=Z.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new F({key:mh,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;let r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;let r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),yh=Z.create({name:"keymap",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{let{selection:a,doc:c}=l,{empty:d,$anchor:u}=a,{pos:f,parent:h}=u,p=u.parent.isTextblock&&f>0?l.doc.resolve(f-1):u,g=p.parent.type.spec.isolating,m=u.pos-u.parentOffset,y=g&&p.parent.childCount===1?m===u.pos:z.atStart(c).from===f;return!d||!h.type.isTextblock||h.textContent.length||!y||y&&u.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Nn()||ua()?i:o},addProseMirrorPlugins(){return[new F({key:new j("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(h=>h.getMeta("composition")))return;let r=t.some(h=>h.docChanged)&&!e.doc.eq(n.doc),o=t.some(h=>h.getMeta("preventClearDocument"));if(!r||o)return;let{empty:i,from:s,to:l}=e.selection,a=z.atStart(e.doc).from,c=z.atEnd(e.doc).to;if(i||!(s===a&&l===c)||!In(n.doc))return;let d=n.tr,u=io({state:n,transaction:d}),{commands:f}=new On({editor:this.editor,state:u});if(f.clearNodes(),!!d.steps.length)return d}}
2026-09-28 20:53:46 +03:00
position: relative;
}
.ProseMirror {
word-wrap: break-word;
white-space: pre-wrap;
white-space: break-spaces;
-webkit-font-variant-ligatures: none;
font-variant-ligatures: none;
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
}
.ProseMirror [contenteditable="false"] {
white-space: normal;
}
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
white-space: pre-wrap;
}
.ProseMirror pre {
white-space: pre-wrap;
}
img.ProseMirror-separator {
display: inline !important;
border: none !important;
margin: 0 !important;
width: 0 !important;
height: 0 !important;
}
.ProseMirror-gapcursor {
display: none;
pointer-events: none;
position: absolute;
margin: 0;
}
.ProseMirror-gapcursor:after {
content: "";
display: block;
position: absolute;
top: -2px;
width: 20px;
border-top: 1px solid black;
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
}
@keyframes ProseMirror-cursor-blink {
to {
visibility: hidden;
}
}
.ProseMirror-hideselection *::selection {
background: transparent;
}
.ProseMirror-hideselection *::-moz-selection {
background: transparent;
}
.ProseMirror-hideselection * {
caret-color: transparent;
}
.ProseMirror-focused .ProseMirror-gapcursor {
display: block;
2026-11-03 01:53:45 +02:00
}` , Dx = class extends Yw { constructor ( t = {}){ super (), this . css = null , this . className = "tiptap" , this . editorView = null , this . isFocused =! 1 , this . destroyed =! 1 , this . isInitialized =! 1 , this . extensionStorage = {}, this . instanceId = Math . random (). toString ( 36 ). slice ( 2 , 9 ), this . hasWarnedStaleDecorationRead =! 1 , this . options = { element : typeof document < "u" ? document . createElement ( "div" ) : null , content : "" , injectCSS :! 0 , injectNonce : void 0 , extensions : [], autofocus :! 1 , editable :! 0 , textDirection : void 0 , editorProps : {}, parseOptions : {}, coreExtensionOptions : {}, enableInputRules :! 0 , enablePasteRules :! 0 , enableCoreExtensions :! 0 , enableContentCheck :! 1 , emitContentError :! 1 , onBeforeCreate : ()=> null , onCreate : ()=> null , onMount : ()=> null , onUnmount : ()=> null , onUpdate : ()=> null , onSelectionUpdate : ()=> null , onTransaction : ()=> null , onFocus : ()=> null , onBlur : ()=> null , onDestroy : ()=> null , onContentError : ({ error : n })=>{ throw n }, onPaste : ()=> null , onDrop : ()=> null , onDelete : ()=> null , enableExtensionDispatchTransaction :! 0 }, this . isCapturingTransaction =! 1 , this . capturedTransaction = null , this . utils = { getUpdatedPosition : Hf , createMappablePosition : Ff }, this . setOptions ( t ), this . createExtensionManager (), this . createCommandManager (), this . createSchema (), this . on ( "beforeCreate" , this . options . onBeforeCreate ), this . emit ( "beforeCreate" ,{ editor : this }), this . on ( "mount" , this . options . onMount ), this . on ( "unmount" , this . options . onUnmount ), this . on ( "contentError" , this . options . onContentError ), this . on ( "create" , this . options . onCreate ), this . on ( "update" , this . options . onUpdate ), this . on ( "selectionUpdate" , this . options . onSelectionUpdate ), this . on ( "transaction" , this . options . onTransaction ), this . on ( "focus" , this . options . onFocus ), this . on ( "blur" , this . options . onBlur ), this . on ( "destroy" , this . options . onDestroy ), this . on ( "drop" ,({ event : n , slice : r , moved : o })=> this . options . onDrop ( n , r , o )), this . on ( "paste" ,({ event : n , slice : r })=> this . options . onPaste ( n , r )), this . on ( "delete" , this . options . onDelete ); let e = this . createDoc (); if ( ! this . editorState ){ let n = hi ( e , this . options . autofocus ); this . editorState = tr . create ({ doc : e , schema : this . schema , selection : n || void 0 })} Nx ( this . schema ), this . options . element && this . mount ( this . options . element )} mount ( t ){ if ( typeof document > "u" ) throw new Error ( "[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment." ); this . createView ( t ), this . emit ( "mount" ,{ editor : this }), this . css &&! document . head . contains ( this . css ) && document . head . appendChild ( this . css ), window . setTimeout (()=>{ this . isDestroyed || ( this . options . autofocus !==! 1 && this . options . autofocus !== null && this . commands . focus ( this . options . autofocus ), this . emit ( "create" ,{ editor : this }), this . isInitialized =! 0 )}, 0 )} unmount (){ if ( this . editorView ){ this . editorState = this . editorView . state ; let t = this . editorView . dom ; t ? . editor && delete t . editor , this . editorView . destroy ()} if ( this . editorView = null , this . isInitialized =! 1 , this . css &&! document . querySelectorAll ( `. ${ this . className } ` ). length ) try { typeof this . css . remove == "function" ? this . css . remove () : this . css . parentNode && this . css . parentNode . removeChild ( this . css )} catch ( t ){ console . warn ( "Failed to remove CSS element:" , t )} this . css = null , this . emit ( "unmount" ,{ editor : this })} get storage (){ return this . extensionStorage } get commands (){ return this . commandManager . commands } chain (){ return this . commandManager ? this . commandManager . chain () : On . createFakeChain ()} can (){ return this . commandManager ? this . commandManager . can () : On . createFallbackCan ()} injectCSS (){ this . options . injectCSS && typeof document < "u" && ( this . css = Zf ( Rx , this . options . injectNonce ))} setOptions ( t = {}){ this . options = {... this . options ,... t }, ! ( ! this . editorView ||! this . state || this . isDestroyed ) && ( this . options . editorProps && this . view . setProps ( this . options . editorProps ), this . view . updateState ( this . state ))} setEditable ( t , e =! 0 ){ this . setOptions ({ editable : t }), e && this . emit ( "update" ,{ editor : this , transaction : this . state . tr , appendedTransactions : []})} get isEditable (){ return this . options . editable && this . view && this . view . editable } get view (){ return this . editorView ? this . editorView : new Proxy ({ state : this . editorState , updateState : t =>{ this . editorState = t }, dispatch : t =>{ this . dispatchTransaction ( t )}, composing :! 1 , dragging : null , editable :! 0 , isDestroyed :! 1 },{ get : ( t , e )=>
2026-09-28 20:53:46 +03:00
2026-11-03 01:53:45 +02:00
`,textSerializers:n={}}=t||{};return ba(this.state.doc,{blockSeparator:e,textSerializers:{...Si(this.schema),...n}})}get isEmpty(){return In(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var t,e;return(t=(e=this.editorView)===null||e===void 0?void 0:e.isDestroyed)!==null&&t!==void 0?t:!0}$node(t,e){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelectorAll(t,e))||null}$pos(t){let e=this.state.doc.resolve(t),n=t>0&&e.nodeAfter&&!e.nodeAfter.isText&&e.nodeAfter.isAtom?e.nodeAfter:null;return new kh(e,this,!1,n)}get $doc(){return this.$pos(0)}},ho=class{static Inline(t,e,n={},r){return new Sh(t,e,n,r)}static Node(t,e,n={},r){return new Ch(t,e,n,r)}static Widget(t,e,n){let{key:r,...o}=n;return new vh(t,e,r,o)}},Sh=class extends ho{constructor(t,e,n={},r){super(),this.kind="inline",this.from=t,this.to=e,this.attrs=n,this.spec=r}get anchor(){return this.from}toPMDecoration(t){let e=t?{...this.spec,extensionName:t}:this.spec;return re.inline(this.from,this.to,this.attrs,e)}},Ch=class extends ho{constructor(t,e,n={},r){super(),this.kind="node",this.from=t,this.to=e,this.attrs=n,this.spec=r}get anchor(){return this.from}toPMDecoration(t){let e=t?{...this.spec,extensionName:t}:this.spec;return re.node(this.from,this.to,this.attrs,e)}},vh=class extends ho{constructor(t,e,n,r){super(),this.kind="widget",this.pos=t,this.render=e,this.key=n,this.spec=r}get anchor(){return this.pos}toPMDecoration(t){let e=t?{...this.spec,key:this.key,extensionName:t}:{...this.spec,key:this.key};return re.widget(this.pos,this.render,e)}};function Lx(t,e){let n=t,r=n[e];if(!r){r={renderers:new Map,props:new Map,pendingProps:new Map,flushScheduled:!1},n[e]=r;let o=r;t.on("destroy",()=>{o.pendingProps.clear(),o.renderers.forEach(i=>i.destroy()),o.renderers.clear(),o.props.clear()})}return r}function Ix(t){t.flushScheduled=!1;for(let[e,n]of t.pendingProps){let r=t.renderers.get(e);r&&(r.updateProps(n),t.props.set(e,{...n}))}t.pendingProps.clear()}function Px(t){let{editor:e,pos:n,key:r,props:o,cacheKey:i,context:s,create:l,materialize:a,side:c,relaxedSide:d,marks:u,stopEvent:f,ignoreSelection:h,destroy:p}=t,g=Lx(e,i);if(g.renderers.has(r)){var m;let w=(m=g.pendingProps.get(r))!==null&&m!==void 0?m:g.props.get(r);(!w||!Ma(w,o))&&(g.pendingProps.set(r,o),g.flushScheduled||(g.flushScheduled=!0,queueMicrotask(()=>Ix(g))))}let y=(w,x)=>{let b={...o,...s(x)},k=g.renderers.get(r);return k?k.updateProps(b):(k=l(b),g.renderers.set(r,k),g.props.set(r,{...o})),a(k)};return ho.Widget(n,y,{key:r,side:c,relaxedSide:d,marks:u,stopEvent:f,ignoreSelection:h,destroy:w=>{if(!Yf(e).has(r))try{var x;(x=g.renderers.get(r))===null||x===void 0||x.destroy(),g.renderers.delete(r),g.props.delete(r),g.pendingProps.delete(r)}finally{p?.(w)}}})}function Ie(t){return new ln({find:t.find,handler:({state:e,range:n,match:r})=>{let o=G(t.getAttributes,void 0,r);if(o===!1||o===null)return null;let{tr:i}=e,s=r[r.length-1],l=r[0];if(s){let a=l.search(/\S/),c=n.from+l.indexOf(s),d=c+s.length;if(ao(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(h=>h===t.type&&h!==f.mark.type)).filter(f=>f.to>c).length)return null;d<n.to&&i.delete(d,n.to),c>n.from&&i.delete(n.from+a,c);let u=n.from+a+s.length;i.addMark(n.from+a,u,t.type.create(o||{})),i.removeStoredMark(t.type)}},undoable:t.undoable})}function po(t){return new ln({find:t.find,handler:({state:e,range:n,match:r})=>{let o=G(t.getAttributes,void 0,r)||{},{tr:i}=e,s=n.from,l=n.to,a=t.type.create(o);if(r[1]){let c=s+r[0].lastIndexOf(r[1]);c>l?c=l:l=c+r[1].length;let d=r[0][r[0].length-1];i.insertText(d,s+r[0].length-1),i.replaceWith(c,l,a)}else if(r[0]){let c=t.type.isInline?s:s-1;i.insert(c,t.type.create(o)).delete(i.mapping.map(s),i.mapping.map(l))}i.scrollIntoView()},undoable:t.undoable})}function br(t){return new ln({f
2026-09-28 20:53:46 +03:00
` ). map ( c => c . trim () === "" ? n : ` ${ n } ${ c } ` ); r . push ( a . join ( `
` ))}), r . join ( `
${ n }
2026-11-03 01:53:45 +02:00
` )}, addCommands (){ return { setBlockquote : ()=>({ commands : t })=> t . wrapIn ( this . name ), toggleBlockquote : ()=>({ commands : t })=> t . toggleWrap ( this . name ), unsetBlockquote : ()=>({ commands : t })=> t . lift ( this . name )}}, addKeyboardShortcuts (){ return { "Mod-Shift-b" : ()=> this . editor . commands . toggleBlockquote (), Backspace : ()=> wk ( this . editor , this . type )}}, addInputRules (){ return [ Vt ({ find : xk , type : this . type })]}}), Jh = kk ; var Sk = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/ , Ck = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g , vk = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/ , Mk = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g , Tk = ie . create ({ name : "bold" , addOptions (){ return { HTMLAttributes : {}}}, parseHTML (){ return [{ tag : "strong" },{ tag : "b" , getAttrs : t => t . style . fontWeight !== "normal" && null },{ style : "font-weight=400" , clearMark : t => t . type . name === this . name },{ style : "font-weight" , getAttrs : t => /^ ( bold ( er ) ?| [ 5 - 9 ] \ d { 2 ,}) $ / . test ( t ) && null }]}, renderHTML ({ HTMLAttributes : t }){ return wr ( "strong" ,{... L ( this . options . HTMLAttributes , t ), children : wr ( "slot" ,{})})}, markdownTokenName : "strong" , parseMarkdown : ( t , e )=> e . applyMark ( "bold" , e . parseInline ( t . tokens || [])), markdownOptions : { htmlReopen : { open : "<strong>" , close : "</strong>" }}, renderMarkdown : ( t , e )=> `** ${ e . renderChildren ( t ) } **` , addCommands (){ return { setBold : ()=>({ commands : t })=> t . setMark ( this . name ), toggleBold : ()=>({ commands : t })=> t . toggleMark ( this . name ), unsetBold : ()=>({ commands : t })=> t . unsetMark ( this . name )}}, addKeyboardShortcuts (){ return { "Mod-b" : ()=> this . editor . commands . toggleBold (), "Mod-B" : ()=> this . editor . commands . toggleBold ()}}, addInputRules (){ return [ Ie ({ find : Sk , type : this . type }), Ie ({ find : vk , type : this . type })]}, addPasteRules (){ return [ Ne ({ find : Ck , type : this . type }), Ne ({ find : Mk , type : this . type })]}}), Gh = Tk ; var Ak = t =>{ let e = /`([^`]+)`(?!`)$/ . exec ( t ); return ! e || e . index > 0 && t [ e . index - 1 ] === "`" ? null : { index : e . index , text : e [ 0 ], replaceWith : e [ 1 ]}}, Ek = t =>{ let e = /`([^`]+)`(?!`)/g , n = [], r ; for (;( r = e . exec ( t )) !== null ;) r . index > 0 && t [ r . index - 1 ] === "`" || n . push ({ index : r . index , text : r [ 0 ], replaceWith : r [ 1 ]}); return n }, Ok = ie . create ({ name : "code" , addOptions (){ return { HTMLAttributes : {}}}, excludes : "_" , code :! 0 , exitable :! 0 , parseHTML (){ return [{ tag : "code" }]}, renderHTML ({ HTMLAttributes : t }){ return [ "code" , L ( this . options . HTMLAttributes , t ), 0 ]}, markdownTokenName : "codespan" , parseMarkdown : ( t , e )=> e . applyMark ( "code" ,[{ type : "text" , text : t . text || "" }]), renderMarkdown : ( t , e )=> t . content ? `\` ${ e . renderChildren ( t . content ) } \`` : "" , addCommands (){ return { setCode : ()=>({ commands : t })=> t . setMark ( this . name ), toggleCode : ()=>({ commands : t })=> t . toggleMark ( this . name ), unsetCode : ()=>({ commands : t })=> t . unsetMark ( this . name )}}, addKeyboardShortcuts (){ return { "Mod-e" : ()=> this . editor . commands . toggleCode ()}}, addInputRules (){ return [ Ie ({ find : Ak , type : this . type })]}, addPasteRules (){ return [ Ne ({ find : Ek , type : this . type })]}}), Xh = Ok ; var ja = 4 , Nk = /^```([a-z]+)?[\s\n]$/ , Rk = /^~~~([a-z]+)?[\s\n]$/ , Dk = W . create ({ name : "codeBlock" , addOptions (){ return { languageClassPrefix : "language-" , exitOnTripleEnter :! 0 , exitOnArrowDown :! 0 , exitOnArrowUp :! 0 , defaultLanguage : null , enableTabIndentation :! 1 , tabSize : ja , HTMLAttributes : {}}}, content : "text*" , marks : "" , group : "block" , code :! 0 , defining :! 0 , addAttributes (){ return { language : { default : this . options . defaultLanguage , parseHTML : t =>{ var e ; let { languageClassPrefix : n } = this . options ; if ( ! n ) return null ; let r = [...(( e = t . firstElementChild ) === null || e === void 0 ? void 0 : e . classList ) || []]. filter ( o => o . startsWith ( n )). map ( o => o . replace ( n , "" ))[ 0 ]; return r || null }, rendered :! 1 }}}, parseHTML (){ return [{ tag : "pre" , preserveWhitespace : "full" }]}, renderHTML ({ node : t , HTMLAttributes : e }){ return [ "pre" , L ( this . options . HTMLAttributes , e ),[ "code" ,{ class : t . attrs . language ? this . options . languageClassPrefix + t . attrs . language : null }, 0 ]]}, markdownTokenName : "code" , parseMarkdown : ( t , e )=>{ var n , r ; return (( n = t . raw ) === null || n === void 0 ? void 0 : n . startsWith ( "```" )) ===! 1 && (( r = t . raw ) === null || r === void 0 ? void 0 : r . startsWith ( "~~~" )) ===! 1 && t . codeBlockStyle !== "indented" ? [] : e . createNode ( "codeBlock" ,{ language : t . lang || null }, t . text ? [ e . createTextNode ( t . text )] : [])}, renderMarkdown : ( t , e )=>{ var n ; let r = "" , o = (( n = t . attrs ) === null || n === void 0 ? void 0 : n . language ) || "" ; return t . content ? r = [ `\`\`\` ${ o } ` , e . renderChil
2026-09-28 20:53:46 +03:00
`):r=` \ `\`\` ${ o }
2026-11-03 01:53:45 +02:00
\`\`\`` , r }, addCommands (){ return { setCodeBlock : t =>({ commands : e })=> e . setNode ( this . name , t ), toggleCodeBlock : t =>({ commands : e })=> e . toggleNode ( this . name , "paragraph" , t )}}, addKeyboardShortcuts (){ return { "Mod-Alt-c" : ()=> this . editor . commands . toggleCodeBlock (), Backspace : ()=>{ let { empty : t , $anchor : e } = this . editor . state . selection , n = e . pos === 1 ; return ! t || e . parent . type . name !== this . name ?! 1 : n ||! e . parent . textContent . length ? this . editor . commands . clearNodes () :! 1 }, Tab : ({ editor : t })=>{ var e ; if ( ! this . options . enableTabIndentation ) return ! 1 ; let n = ( e = this . options . tabSize ) !== null && e !== void 0 ? e : ja ,{ state : r } = t ,{ selection : o } = r ,{ $from : i , empty : s } = o ; if ( i . parent . type !== this . type ) return ! 1 ; let l = " " . repeat ( n ); return s ? t . commands . insertContent ( l ) : t . commands . command (({ tr : a })=>{ let { from : c , to : d } = o , u = r . doc . textBetween ( c , d , `
2026-09-28 20:53:46 +03:00
` , `
` ). split ( `
` ). map ( f => l + f ). join ( `
2026-11-03 01:53:45 +02:00
` ); return a . replaceWith ( c , d , r . schema . text ( u )), ! 0 })}, "Shift-Tab" : ({ editor : t })=>{ var e ; if ( ! this . options . enableTabIndentation ) return ! 1 ; let n = ( e = this . options . tabSize ) !== null && e !== void 0 ? e : ja ,{ state : r } = t ,{ selection : o } = r ,{ $from : i , empty : s } = o ; return i . parent . type !== this . type ?! 1 : s ? t . commands . command (({ tr : l })=>{ var a ; let { pos : c } = i , d = i . start (), u = i . end (), f = r . doc . textBetween ( d , u , `
2026-09-28 20:53:46 +03:00
` , `
` ). split ( `
2026-11-03 01:53:45 +02:00
` ), h = 0 , p = 0 , g = c - d ; for ( let x = 0 ; x < f . length ; x += 1 ){ if ( p + f [ x ]. length >= g ){ h = x ; break } p += f [ x ]. length + 1 } let m = (( a = f [ h ]. match ( /^ */ )) === null || a === void 0 ? void 0 : a [ 0 ]) || "" , y = Math . min ( m . length , n ); if ( y === 0 ) return ! 0 ; let w = d ; for ( let x = 0 ; x < h ; x += 1 ) w += f [ x ]. length + 1 ; return l . delete ( w , w + y ), c - w <= y && l . setSelection ( R . create ( l . doc , w )), ! 0 }) : t . commands . command (({ tr : l })=>{ let { from : a , to : c } = o , d = r . doc . textBetween ( a , c , `
2026-09-28 20:53:46 +03:00
` , `
` ). split ( `
` ). map ( u =>{ var f ; let h = (( f = u . match ( /^ */ )) === null || f === void 0 ? void 0 : f [ 0 ]) || "" , p = Math . min ( h . length , n ); return u . slice ( p )}). join ( `
` ); return l . replaceWith ( a , c , r . schema . text ( d )), ! 0 })}, Enter : ({ editor : t })=>{ if ( ! this . options . exitOnTripleEnter ) return ! 1 ; let { state : e } = t ,{ selection : n } = e ,{ $from : r , empty : o } = n ; if ( ! o || r . parent . type !== this . type ) return ! 1 ; let i = r . parentOffset === r . parent . nodeSize - 2 , s = r . parent . textContent . endsWith ( `
2026-11-03 01:53:45 +02:00
` ); return ! i ||! s ?! 1 : t . chain (). command (({ tr : l })=>( l . delete ( r . pos - 2 , r . pos ), ! 0 )). exitCode (). run ()}, ArrowUp : ({ editor : t })=>{ if ( ! this . options . exitOnArrowUp ) return ! 1 ; let { state : e } = t ,{ selection : n } = e ,{ $from : r , empty : o } = n ; if ( ! o || r . parent . type !== this . type || r . parentOffset !== 0 ) return ! 1 ; let i = r . before (); return i > 0 ?! 1 : t . commands . insertDefaultBlock ({ pos : i })}, ArrowDown : ({ editor : t })=>{ if ( ! this . options . exitOnArrowDown ) return ! 1 ; let { state : e } = t ,{ selection : n , doc : r } = e ,{ $from : o , empty : i } = n ; if ( ! i || o . parent . type !== this . type || o . parentOffset !== o . parent . nodeSize - 2 ) return ! 1 ; let s = o . after (); return s === void 0 ?! 1 : r . nodeAt ( s ) ? t . commands . command (({ tr : l })=>( l . setSelection ( z . near ( r . resolve ( s ))), ! 0 )) : t . commands . exitCode ()}}}, addInputRules (){ return [ br ({ find : Nk , type : this . type , getAttributes : t =>({ language : t [ 1 ]})}), br ({ find : Rk , type : this . type , getAttributes : t =>({ language : t [ 1 ]})})]}, addProseMirrorPlugins (){ return [ new F ({ key : new j ( "codeBlockVSCodeHandler" ), props : { handlePaste : ( t , e )=>{ if ( ! e . clipboardData || this . editor . isActive ( this . type . name )) return ! 1 ; let n = e . clipboardData . getData ( "text/plain" ), r = e . clipboardData . getData ( "vscode-editor-data" ), o = r ? JSON . parse ( r ) : void 0 , i = o ? . mode ; if ( ! n ||! i ) return ! 1 ; let { tr : s , schema : l } = t . state , a = l . text ( n . replace ( /\r\n?/g , `
` )); return s . replaceSelectionWith ( this . type . create ({ language : i }, a )), s . selection . $from . parent . type !== this . type && s . setSelection ( R . near ( s . doc . resolve ( Math . max ( 0 , s . selection . from - 2 )))), s . setMeta ( "paste" , ! 0 ), t . dispatch ( s ), ! 0 }}})]}}), Yh = Dk ; var Qh = W . create ({ name : "customBlock" , group : "block" , atom :! 0 , defining :! 0 , draggable :! 0 , selectable :! 0 , isolating :! 0 , allowGapCursor :! 0 , inline :! 1 , addNodeView (){ return ({ editor : t , node : e , getPos : n , HTMLAttributes : r , decorations : o , extension : i })=>{ let s = document . createElement ( "div" ); s . setAttribute ( "data-config" , JSON . stringify ( e . attrs . config )), s . setAttribute ( "data-id" , e . attrs . id ), s . setAttribute ( "data-testid" , "rich-editor-custom-block" ), s . setAttribute ( "data-type" , "customBlock" ), i . options . hasMinimalCustomBlockControls && e . attrs . preview && s . classList . add ( "fi-fo-rich-editor-custom-block-minimal" ); let l = document . createElement ( "div" ); if ( l . className = "fi-fo-rich-editor-custom-block-header fi-not-prose" , s . appendChild ( l ), t . isEditable && typeof e . attrs . config == "object" && e . attrs . config !== null && Object . keys ( e . attrs . config ). length > 0 ){ let c = document . createElement ( "div" ); c . className = "fi-fo-rich-editor-custom-block-edit-btn-ctn" , l . appendChild ( c ); let d = document . createElement ( "button" ); d . className = "fi-icon-btn" , d . dataset . testid = "rich-editor-custom-block-edit-button" , d . type = "button" , i . options . editCustomBlockButtonLabel && d . setAttribute ( "aria-label" , i . options . editCustomBlockButtonLabel ), d . innerHTML = i . options . editCustomBlockButtonIconHtml , d . addEventListener ( "click" ,()=>{ t . commands . setNodeSelection ( n ()), i . options . editCustomBlockUsing ( e . attrs . id , e . attrs . config )}), c . appendChild ( d )} let a = document . createElement ( "p" ); if ( a . className = "fi-fo-rich-editor-custom-block-heading" , a . textContent = e . attrs . label , l . appendChild ( a ), t . isEditable ){ let c = document . createElement ( "div" ); c . className = "fi-fo-rich-editor-custom-block-delete-btn-ctn" , l . appendChild ( c ); let d = document . createElement ( "button" ); d . className = "fi-icon-btn" , d . dataset . testid = "rich-editor-custom-block-delete-button" , d . type = "button" , i . options . deleteCustomBlockButtonLabel && d . setAttribute ( "aria-label" , i . options . deleteCustomBlockButtonLabel ), d . innerHTML = i . options . deleteCustomBlockButtonIconHtml , d . addEventListener ( "click" ,()=> t . chain (). focus (). setNodeSelection ( n ()). deleteSelection (). run ()), c . appendChild ( d )} if ( e . attrs . preview ){ let c = document . createElement ( "div" ), d = [ "fi-fo-rich-editor-custom-block-preview" ]; e . attrs . shouldApplyProseStylingToPreview || d . push ( "fi-not-prose" ), c . className = d . join ( " " ), c . innerHTML = new TextDecoder (). decode ( Uint8Array . from ( atob ( e . attrs . preview ), u => u . charCodeAt ( 0 ))), s . appendChild ( c )} return { dom : s , stopEvent : c => c . target instanceof Element && l . contains ( c . target . closest ( "button" ))}}}, addOptions (){ return { deleteCustomBlockButtonIconHtml : null , deleteCustomBlockButtonLabel : null , editCustomBlockButtonIconHtml : null , editCustomBlockButtonLabel : null , editCustomBlockUsing : ()=>{}, getCustomBlockPreviewsUsing : async ()=>[], hasMinimalCustomBlockControls :! 1 , insertCustomBlockUsing : ()=>{}}}, addAttributes (){ return { config : { default : null , parseHTML : t => JSON . parse ( t . getAttribute ( "data-config" )), renderHTML : t => t . config ? { "data-config" : JSON . stringify ( t . config )} : {}}, id : { default : null , parseHTML : t => t . getAttribute ( "data-id" ), renderHTML : t => t . id ? { "data-id" : t . id } : {}}, label : { default : null , parseHTML : ()=> null , rendered :! 1 }, preview : { default : null , parseHTML : ()=> null , rendered :! 1 }, shouldApplyProseStylingToPreview : { default :! 1 , parseHTML : ()=> ! 1 , rendered :! 1 }}}, parseHTML (){ return [{ tag : `div[data-type=" ${ this . name } "]` }]}, renderHTML ({ HTMLAttributes : t }){ return [ "div" , L ({ "data-type" : "customBlock" }, t )]}, addKeyboardShortcuts (){ return { Backspace : ()=> this . editor . commands . command (({ state : t })=>{ let e =! 1 ,{ selection : n } = t ,{ empty : r , anchor : o } = n ; return r ? ( t . doc . nodesBetween ( o - 1 , o , i =>{ if ( i . type . name === this . name ) return e =! 0 , ! 1 }), e ) :! 1 })}}, addProseMirrorPlugins (){ let { getCustomBlockPreviewsUsing : t , insertCustomBlockUsing : e } = this . options , n = new Map , r = new Set , o = s => JSON . stringify ([ s . attrs . id , s . attrs . config ]), i = async s =>{ if ( this . editor . isDestroyed ) return ; let l = [], a = [], c = new Map ; if ( s . state . doc . descendants ( u =>{ if ( u . type . name !== this . name ) return ; let f = o ( u ); if ( u . attrs . previ
2026-09-28 20:53:46 +03:00
2026-11-03 01:53:45 +02:00
`):""}),rp=Ik;var Pk=12,ip=(t,e)=>{let n=dt(t.$from,o=>o.type.name===e),r=t.node?.type.name==="gridColumn"?{node:t.node,pos:t.from,depth:t.$from.depth+1}:dt(t.$from,o=>o.type.name==="gridColumn");return n&&r&&r.depth===n.depth+1?{grid:n,column:r}:null},sp=t=>Math.max(1,Number(t.attrs["data-col-span"])||1),lp=(t,e)=>e?lp(e,t%e):t,$k=t=>{let e=!0;return t.forEach(n=>{sp(n)!==1&&(e=!1)}),e},op=({tr:t,dispatch:e,editor:n,gridNodeName:r,shouldInsertAfter:o})=>{let i=ip(t.selection,r);if(!i||!$k(i.grid.node)||i.grid.node.childCount>=Pk)return!1;if(e){let s=n.schema.nodes.gridColumn.createAndFill({"data-col-span":1}),l=o?i.column.pos+i.column.node.nodeSize:i.column.pos;t.setNodeMarkup(i.grid.pos,void 0,{...i.grid.node.attrs,"data-cols":i.grid.node.childCount+1}).insert(l,s).scrollIntoView()}return!0},ap=W.create({name:"grid",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,content:"gridColumn+",addOptions(){return{HTMLAttributes:{class:"grid-layout"}}},addAttributes(){return{"data-cols":{default:2,parseHTML:t=>t.getAttribute("data-cols")},"data-from-breakpoint":{default:"md",parseHTML:t=>t.getAttribute("data-from-breakpoint")},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:` -- cols : repeat ( $ { Math . max ( 1 , Number ( t [ "data-cols" ]) || 1 )}, minmax ( 0 , 1 fr )) `})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("grid-layout")&&null}]},renderHTML({HTMLAttributes:t}){return["div",L(this.options.HTMLAttributes,t),0]},addCommands(){return{addGridColumnBefore:()=>({tr:t,dispatch:e,editor:n})=>op({tr:t,dispatch:e,editor:n,gridNodeName:this.name,shouldInsertAfter:!1}),addGridColumnAfter:()=>({tr:t,dispatch:e,editor:n})=>op({tr:t,dispatch:e,editor:n,gridNodeName:this.name,shouldInsertAfter:!0}),deleteGridColumn:()=>({tr:t,dispatch:e})=>{let n=ip(t.selection,this.name);if(!n||n.grid.node.childCount<=1)return!1;if(e){let r=[];n.grid.node.forEach((s,l)=>{let a=n.grid.pos+1+l;a!==n.column.pos&&r.push({column:s,position:a,span:sp(s)})});let o=r.map(s=>s.span).reduce(lp),i=r.reduce((s,l)=>s+l.span/o,0);r.forEach(({column:s,position:l,span:a})=>{t.setNodeMarkup(l,void 0,{...s.attrs,"data-col-span":a/o})}),t.setNodeMarkup(n.grid.pos,void 0,{...n.grid.node.attrs,"data-cols":i}).delete(n.column.pos,n.column.pos+n.column.node.nodeSize).setSelection(R.near(t.doc.resolve(n.column.pos))).scrollIntoView()}return!0},deleteGrid:()=>({tr:t,dispatch:e})=>{let n=dt(t.selection.$from,r=>r.type.name===this.name);if(!n)return!1;if(e){let r=[];n.node.forEach(o=>{o.forEach(i=>r.push(i))}),t.replaceWith(n.pos,n.pos+n.node.nodeSize,r).setSelection(R.near(t.doc.resolve(n.pos))).scrollIntoView()}return!0},insertGrid:({columns:t=[1,1],fromBreakpoint:e,coordinates:n=null}={})=>({tr:r,dispatch:o,editor:i})=>{let s=i.schema.nodes.gridColumn,l=Array.isArray(t)&&t.length?t:[1,1],a=[];for(let u=0;u<l.length;u+=1)a.push(s.createAndFill({"data-col-span":Number(l[u]??1)||1}));let c=l.map(u=>Number(u)||1).reduce((u,f)=>u+f,0),d=i.schema.nodes.grid.createChecked({"data-cols":c,"data-from-breakpoint":e},a);if(o){let u=r.selection.anchor+1;[null,void 0].includes(n?.from)?r.replaceSelectionWith(d).scrollIntoView().setSelection(R.near(r.doc.resolve(u))):r.replaceRangeWith(n.from,n.to,d).scrollIntoView().setSelection(R.near(r.doc.resolve(n.from)))}return!0}}}});var cp=W.create({name:"gridColumn",content:"block+",isolating:!0,addOptions(){return{HTMLAttributes:{class:"grid-layout-col"}}},addAttributes(){return{"data-col-span":{default:1,parseHTML:t=>t.getAttribute("data-col-span"),renderHTML:t=>({"data-col-span":t["data-col-span"]??1})},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>{let e=Math.max(1,Number(t["data-col-span"])||1);return{style:` -- col - span : span $ { e } / span $ { e } `}}}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("grid-layout-col")&&null}]},renderHTML({HTMLAttributes:t}){return["div",L(this.options.HTMLAttributes,t),0]}});var Bk=W.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplac
2026-09-28 20:53:46 +03:00
` }, renderMarkdown : ()=> `
2026-11-03 01:53:45 +02:00
` , parseMarkdown : ()=>({ type : "hardBreak" }), addCommands (){ return { setHardBreak : ()=>({ commands : t , chain : e , state : n , editor : r })=> t . first ([()=> t . exitCode (),()=> t . command (()=>{ let { selection : o , storedMarks : i } = n ; if ( o . $from . parent . type . spec . isolating ) return ! 1 ; let { keepMarks : s } = this . options ,{ splittableMarks : l } = r . extensionManager , a = i || o . $to . parentOffset && o . $from . marks (); return e (). insertContent ({ type : this . name }). command (({ tr : c , dispatch : d })=>{ if ( d && a && s ){ let u = a . filter ( f => l . includes ( f . type . name )); c . ensureMarks ( u )} return ! 0 }). scrollIntoView (). run ()})])}}, addKeyboardShortcuts (){ return { "Mod-Enter" : ()=> this . editor . commands . setHardBreak (), "Shift-Enter" : ()=> this . editor . commands . setHardBreak ()}}}), dp = Bk ; var zk = W . create ({ name : "heading" , addOptions (){ return { levels : [ 1 , 2 , 3 , 4 , 5 , 6 ], HTMLAttributes : {}}}, content : "inline*" , group : "block" , defining :! 0 , addAttributes (){ return { level : { default : 1 , rendered :! 1 }}}, parseHTML (){ return this . options . levels . map ( t =>({ tag : `h ${ t } ` , attrs : { level : t }}))}, renderHTML ({ node : t , HTMLAttributes : e }){ return [ `h ${ this . options . levels . includes ( t . attrs . level ) ? t . attrs . level : this . options . levels [ 0 ] } ` , L ( this . options . HTMLAttributes , e ), 0 ]}, parseMarkdown : ( t , e )=> e . createNode ( "heading" ,{ level : t . depth || 1 }, e . parseInline ( t . tokens || [])), renderMarkdown : ( t , e )=>{ var n ; let r =! (( n = t . attrs ) === null || n === void 0 ) && n . level ? parseInt ( t . attrs . level , 10 ) : 1 , o = "#" . repeat ( r ); return t . content ? ` ${ o } ${ e . renderChildren ( t . content ) } ` : "" }, addCommands (){ return { setHeading : t =>({ commands : e })=> this . options . levels . includes ( t . level ) ? e . setNode ( this . name , t ) :! 1 , toggleHeading : t =>({ commands : e })=> this . options . levels . includes ( t . level ) ? e . toggleNode ( this . name , "paragraph" , t ) :! 1 }}, addKeyboardShortcuts (){ return this . options . levels . reduce (( t , e )=>({... t ,[ `Mod-Alt- ${ e } ` ] : ()=> this . editor . commands . toggleHeading ({ level : e })}),{})}, addInputRules (){ return this . options . levels . map ( t => br ({ find : new RegExp ( `^(#{ ${ Math . min (... this . options . levels ) } , ${ t } })\\s$` ), type : this . type , getAttributes : { level : t }}))}}), up = zk ; var Hk = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/ , Fk = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g , Vk = ie . create ({ name : "highlight" , addOptions (){ return { multicolor :! 1 , HTMLAttributes : {}}}, addAttributes (){ return this . options . multicolor ? { color : { default : null , parseHTML : t => t . getAttribute ( "data-color" ) || Ea ( t , "background-color" ) || t . style . backgroundColor , renderHTML : t => t . color ? { "data-color" : t . color , style : `background-color: ${ t . color } ; color: inherit` } : {}}} : {}}, parseHTML (){ return [{ tag : "mark" }]}, renderHTML ({ HTMLAttributes : t }){ return [ "mark" , L ( this . options . HTMLAttributes , t ), 0 ]}, renderMarkdown : ( t , e )=> `== ${ e . renderChildren ( t ) } ==` , parseMarkdown : ( t , e )=> e . applyMark ( "highlight" , e . parseInline ( t . tokens || [])), markdownTokenizer : { name : "highlight" , level : "inline" , start : t => t . indexOf ( "==" ), tokenize ( t , e , n ){ let r = /^(==)([^=]+)(==)/ . exec ( t ); if ( r ){ let o = r [ 2 ]. trim (), i = n . inlineTokens ( o ); return { type : "highlight" , raw : r [ 0 ], text : o , tokens : i }}}}, addCommands (){ return { setHighlight : t =>({ commands : e })=> e . setMark ( this . name , t ), toggleHighlight : t =>({ commands : e })=> e . toggleMark ( this . name , t ), unsetHighlight : ()=>({ commands : t })=> t . unsetMark ( this . name )}}, addKeyboardShortcuts (){ return { "Mod-Shift-h" : ()=> this . editor . commands . toggleHighlight ()}}, addInputRules (){ return [ Ie ({ find : Hk , type : this . type })]}, addPasteRules (){ return [ Ne ({ find : Fk , type : this . type })]}}), fp = Vk ; var Wk = W . create ({ name : "horizontalRule" , addOptions (){ return { HTMLAttributes : {}, nextNodeType : "paragraph" }}, group : "block" , parseHTML (){ return [{ tag : "hr" }]}, renderHTML ({ HTMLAttributes : t }){ return [ "hr" , L ( this . options . HTMLAttributes , t )]}, markdownTokenName : "hr" , parseMarkdown : ( t , e )=> e . createNode ( "horizontalRule" ), renderMarkdown : ()=> "---" , addCommands (){ return { setHorizontalRule : ()=>({ chain : t , state : e })=>{ if ( ! Ta ( e , e . schema . nodes [ this . name ])) return ! 1 ; let { selection : n } = e ,{ $to : r } = n , o = t (); return co ( n ) ? o . insertContentAt ( r . pos ,{ type : this . name }) : o . insertContent ({ type : this . name }), o . command (({ state : i , tr : s , dispatch : l })=>{ if ( l ){ let { $to : a } = s . selection , c = a . end (); if ( a . nodeAfter ) a . nodeAfter . isTextblock ? s . setSelection ( R . create ( s . doc , a . pos + 1 )) : a . nodeAfter . isBlock ? s . setSelection ( $ . create ( s . doc , a . pos )) : s . setSelection ( R . create ( s . doc , a . pos )); else { le
`,nS="\uFE0F",rS="\u200D",Ja="\uFFFC",$i=null,Bi=null;function oS(t=[]){let e={};Be.groups=e;let n=new Be;$i==null&&($i=kp(Xk)),Bi==null&&(Bi=kp(Yk)),T(n,"'",ts),T(n,"{",xo),T(n,"}",ko),T(n,"[",Fi),T(n,"]",Vi),T(n,"(",Wi),T(n,")",ji),T(n,"<",_i),T(n,">",Ui),T(n,"\uFF08",Ki),T(n,"\uFF09",qi),T(n,"\u300C",Ji),T(n,"\u300D",Gi),T(n,"\u300E",Xi),T(n,"\u300F",Yi),T(n,"\uFF1C",Qi),T(n,"\uFF1E",Zi),T(n,"&",es),T(n,"*",ns),T(n,"@",cn),T(n,"` ",is),T(n," ^ ",ss),T(n," : ",Hn),T(n," , ",sc),T(n," $ ",ls),T(n," . ",Ct),T(n," = ",as),T(n," ! ",lc),T(n," - ",Qe),T(n," % ",So),T(n," | ",cs),T(n," + ",ds),T(n," # ",us),T(n," ? ",Co),T(n,'" ',ac),T(n,"/",vt),T(n,";",cc),T(n,"~",vo),T(n,"_",fs),T(n,"\\",rs),T(n,"\u30FB",Ap);let r=le(n,jt,oc,{[Xa]:!0});le(r,jt,r);let o=le(r,Wt,Mp,{[wo]:!0}),i=le(r,yo,Tp,{[bo]:!0}),s=le(n,Wt,_t,{[Ya]:!0});le(s,jt,o),le(s,Wt,s),le(o,jt,o),le(o,Wt,o);let l=le(n,yo,ec,{[Qa]:!0});le(l,Wt),le(l,jt,i),le(l,yo,l),le(i,jt,i),le(i,Wt),le(i,yo,i);let a=T(n,qa,ic,{[_a]:!0}),c=T(n,xp,rc,{[_a]:!0}),d=le(n,Ka,rc,{[_a]:!0});T(n,Ja,d),T(c,qa,a),T(c,Ja,d),le(c,Ka,d),T(d,xp),T(d,qa),le(d,Ka,d),T(d,Ja,d);let u=le(n,Ua,Ep,{[vp]:!0});T(u,"#"),le(u,Ua,u),T(u,nS,u);let f=T(u,rS);T(f,"#"),le(f,Ua,u);let h=[[Wt,s],[jt,o]],p=[[Wt,null],[yo,l],[jt,i]];for(let g=0;g<$i.length;g++)an(n,$i[g],tc,_t,h);for(let g=0;g<Bi.length;g++)an(n,Bi[g],nc,ec,p);zn(tc,{tld:!0,ascii:!0},e),zn(nc,{utld:!0,alpha:!0},e),an(n,"file",Hi,_t,h),an(n,"mailto",Hi,_t,h),an(n,"http",xr,_t,h),an(n,"https",xr,_t,h),an(n,"ftp",xr,_t,h),an(n,"ftps",xr,_t,h),zn(Hi,{scheme:!0,ascii:!0},e),zn(xr,{slashscheme:!0,ascii:!0},e),t=t.sort((g,m)=>g[0]>m[0]?1:-1);for(let g=0;g<t.length;g++){let m=t[g][0],w=t[g][1]?{[Qk]:!0}:{[Zk]:!0};m.indexOf("-")>=0?w[Za]=!0:Wt.test(m)?jt.test(m)?w[wo]=!0:w[Ya]=!0:w[Xa]=!0,wp(n,m,m,w)}return wp(n,"localhost",Mo,{ascii:!0}),n.jd=new Be(hs),{start:n,tokens:Object.assign({groups:e},Op)}}function Np(t,e){let n=iS(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,o=[],i=0,s=0;for(;s<r;){let l=t,a=null,c=0,d=null,u=-1,f=-1;for(;s<r&&(a=l.go(n[s]));)l=a,l.accepts()?(u=0,f=0,d=l):u>=0&&(u+=n[s].length,f++),c+=n[s].length,i+=n[s].length,s++;i-=u,s-=f,c-=u,o.push({t:d.t,v:e.slice(i-c,i),s:i-c,e:i})}return o}function iS(t){let e=[],n=t.length,r=0;for(;r<n;){let o=t.charCodeAt(r),i,s=o<55296||o>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function an(t,e,n,r,o){let i,s=e.length;for(let l=0;l<s-1;l++){let a=e[l];t.j[a]?i=t.j[a]:(i=new Be(r),i.jr=o.slice(),t.j[a]=i),t=i}return i=new Be(n),i.jr=o.slice(),t.j[e[s-1]]=i,i}function kp(t){let e=[],n=[],r=0,o="0123456789";for(;r<t.length;){let i=0;for(;o.indexOf(t[r+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+i),10);s>0;s--)n.pop();r+=i}else n.push(t[r]),r++}return e}var To={defaultProtocol:"http",events:null,format:Sp,formatHref:Sp,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function dc(t,e=null){let n=Object.assign({},To);t&&(n=Object.assign(n,t instanceof dc?t.o:t));let r=n.ignoreTags,o=[];for(let i=0;i<r.length;i++)o.push(r[i].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}dc.prototype={o:To,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){let r=e!=null,o=this.o[t];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:To[t],typeof o=="function"&&r&&(o=o(e,n))):typeof o=="function"&&r&&(o=o(e,n.t,n)),o)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){let e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function Sp(t){return t}function Rp(t,e){this.t="token",this.v=t,this.tk=e}Rp.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){let e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"\u2026":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk
2026-09-28 20:53:46 +03:00
1. Must only contain digits, lowercase ASCII letters or "-"
2. Cannot start or end with "-"
2026-11-03 01:53:45 +02:00
3. "-" cannot repeat`);oe.customSchemes.push([t,e])}function fS(){oe.scanner=oS(oe.customSchemes);for(let t=0;t<oe.tokenQueue.length;t++)oe.tokenQueue[t][1]({scanner:oe.scanner});oe.parser=aS(oe.scanner.tokens);for(let t=0;t<oe.pluginQueue.length;t++)oe.pluginQueue[t][1]({scanner:oe.scanner,parser:oe.parser});return oe.initialized=!0,oe}function ms(t){return oe.initialized||fS(),cS(oe.parser.start,t,Np(oe.scanner.start,t))}ms.scan=Np;function fc(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}let r=new dc(n),o=ms(t),i=[];for(let s=0;s<o.length;s++){let l=o[s];l.isLink&&(!e||l.t===e)&&r.check(l)&&i.push(l.toFormattedObject(r))}return i}var hc="[\0- \xA0\u1680\u180E\u2000-\u2029\u205F\u3000]",hS=new RegExp(hc),pS=new RegExp(`${hc}$`),mS=new RegExp(hc,"g");function gS(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function yS(t){return new F({key:new j("autolink"),appendTransaction:(e,n,r)=>{let o=e.some(a=>a.docChanged)&&!n.doc.eq(r.doc),i=e.some(a=>a.getMeta("preventAutolink"));if(!o||i)return;let{tr:s}=r,l=bi(n.doc,[...e]);if(Ln(l).forEach(({newRange:a})=>{let c=ha(r.doc,a,f=>f.isTextblock),d,u;if(c.length>1)d=c[0],u=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(c.length){let f=r.doc.textBetween(a.from,a.to," "," ");if(!pS.test(f))return;d=c[0],u=r.doc.textBetween(d.pos,a.to,void 0," ")}if(d&&u){let f=u.split(hS).filter(Boolean);if(f.length<=0)return!1;let h=f[f.length-1],p=d.pos+u.lastIndexOf(h);if(!h)return!1;let g=ms(h).map(m=>m.toObject(t.defaultProtocol));if(!gS(g))return!1;g.filter(m=>m.isLink).map(m=>({...m,from:p+m.start+1,to:p+m.end+1})).filter(m=>r.schema.marks.code?!r.doc.rangeHasMark(m.from,m.to,r.schema.marks.code):!0).filter(m=>t.validate(m.value)).filter(m=>t.shouldAutoLink(m.value)).forEach(m=>{ao(m.from,m.to,r.doc).some(y=>y.mark.type===t.type)||s.addMark(m.from,m.to,t.type.create({href:m.href}))})}}),!!s.steps.length)return s}})}function bS(t){return new F({key:new j("handleClickLink"),props:{handleClick:(e,n,r)=>{if(r.button!==0||!e.editable)return!1;let o=null;if(r.target instanceof HTMLAnchorElement)o=r.target;else{let a=r.target;if(!a)return!1;let c=t.editor.view.dom;o=a.closest("a"),o&&!c.contains(o)&&(o=null)}if(!o)return!1;let i=!1;if(t.enableClickSelection&&(i=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){var s,l;let a=Ci(e.state,t.type.name),c=(s=o.href)!==null&&s!==void 0?s:a.href,d=(l=o.target)!==null&&l!==void 0?l:a.target;c&&(window.open(c,d),i=!0)}return i}}})}var wS=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["' ])(. *? ) \ 3 | “ (. *? ) ” | ‘ (. *? ) ’ )) ? \ ) $ / , xS = /\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘ (.*?)’ ))?\)/g ; function Lp ( t , e ){ let n = 0 ; for ( let r = e - 1 ; r >= 0 && t [ r ] === "\\" ; r -= 1 ) n += 1 ; return n % 2 === 1 } function kS ( t , e ){ let n = 0 , r = 0 ; for (; r < e ;){ if ( t [ r ] !== "`" ){ r += 1 ; continue } if ( n === 0 && Lp ( t , r )){ r += 1 ; continue } let o = 0 ; for (; r < e && t [ r ] === "`" ;) o += 1 , r += 1 ; n === 0 ? n = o : o === n && ( n = 0 )} return n > 0 } function Ip ( t , e , n ){ var r , o ; let [, i , s ] = e ; return ( e . index ? t [ e . index - 1 ] : void 0 ) === "!" || Lp ( t ,( r = e . index ) !== null && r !== void 0 ? r : 0 ) || kS ( t ,( o = e . index ) !== null && o !== void 0 ? o : 0 ) ?! 1 :!! i . trim () && n ( s )} function Pp ( t ){ var e , n ; let [ r , o , i ,, s , l , a ] = t , c = ( e = s ?? l ) !== null && e !== void 0 ? e : a ; return { index : ( n = t . index ) !== null && n !== void 0 ? n : 0 , text : r , replaceWith : o , data : { href : i , title : c || null , markdown :! 0 }}} function SS ( t , e ){ return t . index < e . index + e . text . length && e . index < t . index + t . text . length } function $p ( t ){ var e , n , r ; return { href : ( e = t . data ) === null || e === void 0 ? void 0 : e . href , title : ( n = ( r = t . data ) === null || r === void 0 ? void 0 : r . title ) !== null && n !== void 0 ? n : null }} function CS ( t ){ let e = Ie ({ find : n =>{ let r = wS . exec ( n ); return ! r ||! Ip ( n , r , t . isAllowedHref ) ? null : Pp ( r )}, type : t . type , getAttributes : $p }); return new ln ({ find : e . find , handler : n =>{ let r = e . handler ( n ); return r !== null && n . state . tr . steps . length && n . state . tr . setMeta ( "preventAutolink" , ! 0 ), r }})} function vS ( t ){ let e = Ne ({ find : n =>{ var r , o ; let i = []; for ( let l of n . matchAll ( xS )) Ip ( n , l , t . isAllowedHref ) && i . push ( Pp ( l )); let s = (( r
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(AS,this.editor.getAttributes(zp)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Vt({find:Hp,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Vt({find:Hp,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(zp),editor:this.editor})),[t]}}),ES=(t,e,n)=>{let{selection:r}=t;if(!r.empty)return null;let{$from:o}=r;if(!o.parent.isTextblock||o.parentOffset!==o.parent.content.size)return null;let i=-1;for(let h=o.depth;h>0;h-=1)if(o.node(h).type.name===e){i=h;break}if(i<0)return null;let s=o.node(i),l=o.index(i);if(l+1>=s.childCount)return null;let a=s.child(l+1);if(!n.includes(a.type.name))return null;let c=t.schema.nodes[e],d=!1;if(a.forEach(h=>{h.type===c&&h.childCount>1&&(d=!0)}),!d)return null;let u=t.doc.resolve(o.after()).nodeAfter;if(!u||!n.includes(u.type.name))return null;let f=[];return u.forEach(h=>{f.push(h)}),f.length===0?null:{listItemDepth:i,nestedList:u,nestedListPos:o.after(),insertPos:o.after(i),items:f}},OS=(t,e,n,r)=>{let o=ES(t,n,r);if(!o)return!1;let{selection:i}=t,{nestedList:s,nestedListPos:l,insertPos:a,items:c}=o,d=t.tr;d.delete(l,l+s.nodeSize);let u=d.mapping.map(a);return d.insert(u,S.from(c)),d.setSelection(i.map(d.doc,d.mapping)),e&&e(d),!0},NS=(t,e,n)=>OS(t.state,t.view.dispatch,e,n),Up=(t,e)=>Z.create({name:` $ { t } BranchingDeleteKeymap `,priority:101,addKeyboardShortcuts(){let n=()=>NS(this.editor,t,e);return{Delete:n,"Mod-Delete":n}}}),Kp=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],gs="abcdefghijklmnopqrstuvwxyz",qp=String.raw` \ d +| [ ivxlcdmIVXLCDM ] +| $ { "[a-zA-Z]{1,2}" } `;function bs(t){let e=t,n="";for(let[r,o]of Kp)for(;e>=r;)n+=o,e-=r;return n}function gc(t){return bs(t).toUpperCase()}function Jp(t){let e=t.toLowerCase(),n=0,r=0;for(;n<e.length;){let o=!1;for(let[i,s]of Kp)if(e.startsWith(s,n)){r+=i,n+=s.length,o=!0;break}if(!o)return 0}return r}function RS(t){if(!/^[ivxlcdmIVXLCDM]+$/.test(t))return!1;let e=Jp(t);return e<=0?!1:(t===t.toLowerCase()?bs(e):gc(e))===t}function DS(t){let e=t.toLowerCase();if(e.length===1)return e.charCodeAt(0)-97+1;if(e.length===2){let n=e.charCodeAt(0)-97,r=e.charCodeAt(1)-97;return(n+1)*26+r+1}return 0}function ys(t){if(t<=26)return gs[t-1];let e=Math.floor((t-1)/26)-1,n=(t-1)%26;return e<0?gs[n]:gs[e]+gs[n]}function ws(t){if(!(!t||/^\d+$/.test(t))){if(RS(t))return t===t.toLowerCase()?"i":"I";if(/^[a-z]{1,2}$/.test(t))return"a";if(/^[A-Z]{1,2}$/.test(t))return"A"}}function yc(t){if(/^\d+$/.test(t))return parseInt(t,10);let e=ws(t);if(e==="i"||e==="I")return Jp(t);if(e==="a"||e==="A"){let r=DS(t);return r>0?r:1}let n=parseInt(t,10);return Number.isNaN(n)?1:n}function LS(t,e){if(t==="numeric")return String(e);switch(t){case"a":return ys(e);case"A":return ys(e).toUpperCase();case"i":return bs(e);case"I":return gc(e);default:return String(e)}}function IS(t){var e;if(t.length===0)return!1;let n=(e=ws(t[0]))!==null&&e!==void 0?e:"numeric",r=yc(t[0]);if(r<1)return!1;for(let o=0;o<t.length;o++){let i=LS(n,r+o);if(t[o]!==i)return!1}return!0}function PS(t){return{type:ws(t),start:yc(t)}}function $S(t){let{type:e,start:n}=PS(t),r={};return e&&(r.type=e),n!==1&&(r.start=n),r}function BS(t,e,n=". "){let r=e+1;if(!t||t==="1")return` $ { r } $ { n } `;switch(t){case"a":return` $ { ys ( r )} $ { n } `;case"A":return` $ { ys ( r ). toUpperCase ()} $ { n } `;case"i":return` $ { bs ( r )} $ { n } `;case"I":return` $ { gc ( r )} $ { n } `;default:return` $ { r } $ { n } `}}function zS(t){var e,n;let r=(e=t.tokens)===null||e===void 0?void 0:e[0];return!!(t.text&&((n=t.tokens)===null||n===void 0?void 0:n.length)===1&&r?.type==="list"&&r.ordered&&r.raw===t.text)}function HS(t,e){return e.toke
2026-10-19 17:33:22 +03:00
` ). trim (), contentLines : p , raw : m . join ( `
2026-11-03 01:53:45 +02:00
` )}), r = g , n = g } return [ e , r ]} var YS = new RegExp ( `^( ${ qp } )([.)])\\s+(.+)$` ); function QS ( t ){ let e = t . split ( `
` ). filter ( r => r . trim (). length > 0 ); if ( e . length === 0 ) return null ; let n = []; for ( let r of e ){ let o = r . trim (). match ( YS ); if ( ! o ) return null ; n . push ({ marker : o [ 1 ], content : o [ 3 ]})} return IS ( n . map ( r => r . marker )) ? { type : "orderedList" , attrs : $S ( n [ 0 ]. marker ), content : n . map ( r =>({ type : "listItem" , content : [{ type : "paragraph" , content : [{ type : "text" , text : r . content }]}]}))} : null } function Xp ( t , e , n ){ let r = [], o = 0 ; for (; o < t . length ;){ let i = t [ o ]; if ( i . indent === e ){ let { paragraphLines : s , blockLines : l } = GS ( i . contentLines ), a = s . join ( `
2026-09-28 20:53:46 +03:00
` ). trim (), c = []; a && c . push ({ type : "paragraph" , raw : a , tokens : n . inlineTokens ( a )}); let d = l . join ( `
2026-11-03 01:53:45 +02:00
` ). trim (); if ( d ){ let h = n . blockTokens ( d ); c . push (... h )} let u = o + 1 , f = []; for (; u < t . length && t [ u ]. indent > e ;) f . push ( t [ u ]), u += 1 ; if ( f . length > 0 ){ let h = Xp ( f , Math . min (... f . map ( p => p . indent )), n ); c . push ({ type : "list" , ordered :! 0 , start : f [ 0 ]. number , typeMarker : f [ 0 ]. type , items : h , raw : f . map ( p => p . raw ). join ( `
` )})} r . push ({ type : "list_item" , raw : i . raw , tokens : c }), o = u } else o += 1 } return r } function ZS ( t , e ){ return t . map ( n =>{ if ( n . type !== "list_item" ) return e . parseChildren ([ n ])[ 0 ]; let r = []; return n . tokens && n . tokens . length > 0 && n . tokens . forEach ( o =>{ if ( o . type === "paragraph" || o . type === "list" || o . type === "blockquote" || o . type === "code" ) r . push (... e . parseChildren ([ o ])); else if ( o . type === "text" && o . tokens ){ let i = e . parseChildren ([ o ]); r . push ({ type : "paragraph" , content : i })} else { let i = e . parseChildren ([ o ]); i . length > 0 && r . push (... i )}}),{ type : "listItem" , content : r }})} var e1 = "listItem" , Wp = "textStyle" , jp = /^(\d+)\.\s$/ ; function _p ( t ){ let e = t . match ( /list-style-type\s*:\s*([^;]+)/i ); if ( ! e ) return null ; switch ( e [ 1 ]. trim (). toLowerCase ()){ case "upper-roman" : return "I" ; case "lower-roman" : return "i" ; case "upper-alpha" : case "upper-latin" : return "A" ; case "lower-alpha" : case "lower-latin" : return "a" ; default : return null }} var xc = W . create ({ name : "orderedList" , addOptions (){ return { itemTypeName : "listItem" , HTMLAttributes : {}, keepMarks :! 1 , keepAttributes :! 1 }}, group : "block list" , content (){ return ` ${ this . options . itemTypeName } +` }, addAttributes (){ return { start : { default : 1 , parseHTML : t => t . hasAttribute ( "start" ) ? parseInt ( t . getAttribute ( "start" ) || "" , 10 ) : 1 }, type : { default : null , parseHTML : t =>{ let e = t . getAttribute ( "type" ); if ( e ) return e ; let n = t . getAttribute ( "style" ); if ( n ){ let o = _p ( n ); if ( o ) return o } let r = t . querySelector ( "li" ); if ( r ){ let o = r . getAttribute ( "style" ); if ( o ){ let i = _p ( o ); if ( i ) return i }} return null }}}}, parseHTML (){ return [{ tag : "ol" }]}, renderHTML ({ HTMLAttributes : t }){ let { start : e , type : n ,... r } = t , o = L ( this . options . HTMLAttributes , r ); return e !== 1 && ( o . start = e ), n && n !== "1" && ( o . type = n ),[ "ol" , o , 0 ]}, markdownTokenName : "list" , parseMarkdown : ( t , e )=>{ if ( t . type !== "list" ||! t . ordered ) return []; let n = t . start || 1 , r = t . typeMarker , o = t . items ? ZS ( t . items , e ) : [], i = {}; return n !== 1 && ( i . start = n ), r && ( i . type = r ), Object . keys ( i ). length > 0 ? { type : "orderedList" , attrs : i , content : o } : { type : "orderedList" , content : o }}, renderMarkdown : ( t , e )=> t . content ? e . renderChildren ( t . content , `
2026-09-28 20:53:46 +03:00
` ) : "" , markdownTokenizer : { name : "orderedList" , level : "block" , start : ()=> - 1 , tokenize : ( t , e , n )=>{ var r , o ; let i = t . split ( `
2026-11-03 01:53:45 +02:00
` ),[ s , l ] = XS ( i ); if ( s . length === 0 ) return ; let a = Xp ( s , s [ 0 ]. indent , n ); if ( a . length !== 0 ) return { type : "list" , ordered :! 0 , start : (( r = s [ 0 ]) === null || r === void 0 ? void 0 : r . number ) || 1 , typeMarker : ( o = s [ 0 ]) === null || o === void 0 ? void 0 : o . type , items : a , raw : i . slice ( 0 , l ). join ( `
` )}}}, markdownOptions : { indentsContent :! 0 }, addCommands (){ return { toggleOrderedList : ()=>({ commands : t , chain : e })=> this . options . keepAttributes ? e (). toggleList ( this . name , this . options . itemTypeName , this . options . keepMarks ). updateAttributes ( e1 , this . editor . getAttributes ( Wp )). run () : t . toggleList ( this . name , this . options . itemTypeName , this . options . keepMarks )}}, addKeyboardShortcuts (){ return { "Mod-Shift-7" : ()=> this . editor . commands . toggleOrderedList ()}}, addProseMirrorPlugins (){ return [ new F ({ props : { handlePaste : ( t , e )=>{ var n , r ; let o = ( n = e . clipboardData ) === null || n === void 0 ? void 0 : n . getData ( "text/html" ); if ( o ? . trim ()) return ! 1 ; let i = ( r = e . clipboardData ) === null || r === void 0 ? void 0 : r . getData ( "text/plain" ); if ( ! i ) return ! 1 ; let s = QS ( i ); if ( ! s ) return ! 1 ; try { let l = t . state . schema . nodeFromJSON ( s ), a = t . state . tr . replaceSelectionWith ( l ); return t . dispatch ( a ), ! 0 } catch { return ! 1 }}}})]}, addInputRules (){ let t = ( n , r )=>( ! r . attrs . type || r . attrs . type === "1" ) && r . childCount + r . attrs . start ===+ n [ 1 ], e = Vt ({ find : jp , type : this . type , getAttributes : n =>({ start :+ n [ 1 ]}), joinPredicate : t }); return ( this . options . keepMarks || this . options . keepAttributes ) && ( e = Vt ({ find : jp , type : this . type , keepMarks : this . options . keepMarks , keepAttributes : this . options . keepAttributes , getAttributes : n =>({ start :+ n [ 1 ],... this . editor . getAttributes ( Wp )}), joinPredicate : t , editor : this . editor })),[ e ]}}), t1 = /^\s*(\[([( |x])?\])\s$/ , n1 = "position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0" , r1 = ( t , e , n )=>{ var r ; return ( n == null || ( r = n . checkboxLabel ) === null || r === void 0 ? void 0 : r . call ( n , t , e )) || `Task item checkbox for ${ t . textContent || "empty task item" } ` }, o1 = W . create ({ name : "taskItem" , addOptions (){ return { nested :! 1 , HTMLAttributes : {}, taskListTypeName : "taskList" , a11y : void 0 }}, content (){ return this . options . nested ? "paragraph block*" : "paragraph+" }, defining :! 0 , addAttributes (){ return { checked : { default :! 1 , keepOnSplit :! 1 , parseHTML : t =>{ let e = t . getAttribute ( "data-checked" ); return e === "" || e === "true" }, renderHTML : t =>({ "data-checked" : t . checked })}}}, parseHTML (){ return [{ tag : `li[data-type=" ${ this . name } "]` , priority : 51 , contentElement : t =>{ var e ; return ( e = t . querySelector ( "div" )) !== null && e !== void 0 ? e : t }}]}, renderHTML ({ node : t , HTMLAttributes : e }){ return [ "li" , L ( this . options . HTMLAttributes , e ,{ "data-type" : this . name }),[ "label" ,[ "input" ,{ type : "checkbox" , checked : t . attrs . checked ? "checked" : null }],[ "span" ]],[ "div" , 0 ]]}, parseMarkdown : ( t , e )=>{ let n = []; if ( t . tokens && t . tokens . length > 0 ? n . push ( e . createNode ( "paragraph" ,{}, e . parseInline ( t . tokens ))) : t . text ? n . push ( e . createNode ( "paragraph" ,{},[ e . createNode ( "text" ,{ text : t . text })])) : n . push ( e . createNode ( "paragraph" ,{},[])), t . nestedTokens && t . nestedTokens . length > 0 ){ let r = e . parseChildren ( t . nestedTokens ); n . push (... r )} return e . createNode ( "taskItem" ,{ checked : t . checked ||! 1 }, n )}, renderMarkdown : ( t , e )=>{ var n ; let r = `- [ ${ ! (( n = t . attrs ) === null || n === void 0 ) && n . checked ? "x" : " " } ] ` ; return fo ( t , e , r )}, addExtensions (){ return this . options . nested ? [ Up ( this . name ,[ this . options . taskListTypeName ])] : []}, addKeyboardShortcuts (){ let t = { Enter : ()=> this . editor . commands . splitListItem ( this . name ), "Shift-Tab" : ()=> this . editor . commands . liftListItem ( this . name )}; return this . options . nested ? {... t , Tab : ()=> this . editor . commands . sinkListItem ( this . name )} : t }, addNodeView (){ return ({ node : t , HTMLAttributes : e , getPos : n , editor : r })=>{ let o = document . createElement ( "li" ), i = document . createElement ( "label" ), s = document . createElement ( "span" ), l = document . createElement ( "input" ), a = document . createElement ( "div" ); s . style . cssText = n1 ; let c = u =>{ let f = r1 ( u , u . attrs . checked , this . options . a11y ); l . setAttribute ( "aria-label" , f ), s . textContent = f }; c ( t ), i . contentEditable = "false" , l . type = "checkbox" , l . addEventListener ( "mousedown" , u => u . preventDefault ()), l . addEventListener ( "change" , u =>{ if ( ! r . isEditable &&! this . options . onReadOnlyChecked ){ l . checked =! l . checked ; return } let { checked : f } = u . target ; r . isEditable && typeof n == "function" && r . chain (). focus ( void 0 ,{ scrollIntoView :! 1 }). command (({ tr : h })=>{ let p = n (); if ( typeof p != "number" ) return ! 1 ; let g = h . doc . nodeAt ( p ); return h . setNodeMarkup ( p , void 0 ,{... g ? . attrs , checked : f }), ! 0 }). run (), ! r . isEditable && this . options . onReadOnlyChecked && ( this . options . o
`):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;let n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))===null||e===void 0?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){let r=i=>{let s=uo(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,a)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:a}),customNestedParser:r},n);if(s){let l={type:"taskList",raw:s.raw,items:s.items},a=i.slice(s.raw.length);return a.trim()?[l,...n.blockTokens(a)]:[l]}return n.blockTokens(i)},o=uo(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,s)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:n.inlineTokens(i.mainContent),nestedTokens:s}),customNestedParser:r},n);if(o)return{type:"taskList",raw:o.raw,items:o.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),nA=Z.create({name:"listKit",addExtensions(){let t=[];return this.options.bulletList!==!1&&t.push(mc.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(bc.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(_S.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(xc.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(o1.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(i1.configure(this.options.taskList)),t}});var Yp=(t,e,n={})=>{t?.dispatchEvent(new CustomEvent(e,{composed:!0,cancelable:!0,detail:n}))},kc=({files:t,acceptedTypes:e,acceptedTypesValidationMessage:n,maxSize:r,maxSizeValidationMessage:o})=>{for(let i of t){if(e&&!e.includes(i.type))return n;if(r&&i.size>+r*1024)return o}return null},s1=()=>("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)),l1=({editor:t,acceptedTypes:e,acceptedTypesValidationMessage:n,get$WireUsing:r,getFileAttachmentUrlUsing:o,key:i,maxSize:s,maxSizeValidationMessage:l,statePath:a,uploadingMessage:c})=>{let d=new Set,u,f=!1;t.on("destroy",()=>{f=!0,d.forEach(m=>m())});let h=m=>{let y=m.dom.closest("form");d.size||(u=t.isEditable);let w=()=>{d.delete(w)&&(!f&&!d.size&&(t.setEditable(u),m.dom.dispatchEvent(new CustomEvent("rich-editor-uploaded-file",{bubbles:!0,detail:{key:i,livewireId:r().id}}))),Yp(y,"form-processing-finished"))};return d.add(w),t.setEditable(!1),Yp(y,"form-processing-started",{message:c}),m.dom.dispatchEvent(new CustomEvent("rich-editor-uploading-file",{bubbles:!0,detail:{key:i,livewireId:r().id}})),{finish:w,isCurrent:()=>!f&&d.has(w)}},p=(m,y)=>new Promise(w=>{let x=s1();r().upload(` componentFileAttachments . $ { a }. $ { x } `,m,async()=>{if(!y.isCurrent()){w(null);return}try{let b=await o(x);w(b?{id:x,src:b}:null)}catch{w(null)}},()=>w(null),()=>{},()=>w(null))}).catch(()=>null),g=async(m,y,w)=>{let x=h(m);try{(await Promise.allSettled(y.map(async k=>{let M=await p(k,x);!M||!x.isCurrent()||t.chain().insertContentAt(w(),{type:"image",attrs:M}).run()}))).forEach(k=>{k.status==="rejected"&&console.error("Failed to insert uploaded file attachment",k.reason)})}finally{x.finish()}};return new F({key:new j("localFiles"),props:{handleDrop(m,y){if(!y.dataTransfer?.files.length)return!1;let w=Array.from(y.dataTransfer.files),x=kc({files:w,acceptedTypes:e,acceptedTypesValidationMessage:n,maxSize:s,maxSizeValidationMessage:l});if(x)return m.dom.dispatchEvent(new CustomEvent("rich-editor-file-validation-message",{bubbles:!0,detail:{key:i,livewireId:r().id,validationMessage:x}})),!1;if(!w.length)return!1;y.preventDefault(),y.stopPropagation();let b=m.posAtCoords({left:y.cli
` ); return /\s/ . test ( r )}) :! 1 } function B1 ( t ){ return ()=>{ let e = t . state . selection . $anchor . pos ,{ top : n , right : r , bottom : o , left : i } = t . view . coordsAtPos ( e ); try { return new DOMRect ( i , n , r - i , o - n )} catch { return null }}} function z1 ( t , e , n , r ){ return n ? ()=>{ let o = r . getState ( t . state ), i = o ? . decorationId , s = e . dom . querySelector ( `[data-decoration-id=" ${ i } "]` ); return s ? . getBoundingClientRect () || null } : B1 ( t )} function H1 ({ match : t , dismissedRange : e , state : n , transaction : r , editor : o , shouldResetDismissed : i , effectiveAllowSpaces : s }){ return i ? .({ editor : o , state : n , range : e , match : t , transaction : r , allowSpaces : s }) ?! 1 : s ? t . range . from === e . from : t . range . from === e . from &&! $1 ( r )} function F1 ({ view : t , pluginKeyRef : e }){ let n = t . state . tr . setMeta ( e ,{ exit :! 0 }); t . dispatch ( n )} function V1 ({ pluginKey : t , decorationTag : e , decorationClass : n , decorationContent : r , decorationEmptyClass : o , renderer : i , dispatchExit : s }){ return { handleKeyDown ( l , a ){ var c ; let d = t . getState ( l . state ); if ( ! d . active ) return ! 1 ; if ( a . key === "Escape" || a . key === "Esc" ){ var u ; return i == null || ( u = i . onKeyDown ) === null || u === void 0 || u . call ( i ,{ view : l , event : a , range : d . range }), s ( l ), ! 0 } return ( i == null || ( c = i . onKeyDown ) === null || c === void 0 ? void 0 : c . call ( i ,{ view : l , event : a , range : d . range })) ||! 1 }, decorations ( l ){ let { active : a , range : c , decorationId : d , query : u } = t . getState ( l ); if ( ! a ) return null ; let f =! u ? . length , h = [ n ]; return f && h . push ( o ), Y . create ( l . doc ,[ re . inline ( c . from , c . to ,{ nodeName : e , class : h . join ( " " ), "data-decoration-id" : d || void 0 , "data-decoration-content" : r })])}}} function W1 ({ editor : t , char : e , effectiveAllowSpaces : n , allowToIncludeChar : r , allowedPrefixes : o , startOfLine : i , findSuggestionMatch : s , allow : l , shouldShow : a , shouldKeepDismissed : c , pluginKey : d }){ return { init (){ return { active :! 1 , range : { from : 0 , to : 0 }, query : null , text : null , composing :! 1 , dismissedRange : null }}, apply ( u , f , h , p ){ let { isEditable : g } = t ,{ composing : m } = t . view ,{ selection : y } = u ,{ empty : w , from : x } = y , b = {... f }, k = u . getMeta ( d ); if ( k && k . exit ) return b . active =! 1 , b . decorationId = null , b . range = { from : 0 , to : 0 }, b . query = null , b . text = null , b . dismissedRange = f . active ? {... f . range } : f . dismissedRange , b ; if ( b . composing = m , u . docChanged && b . dismissedRange !== null && ( b . dismissedRange = { from : u . mapping . map ( b . dismissedRange . from ), to : u . mapping . map ( b . dismissedRange . to )}), g && ( w || t . view . composing )){( x < f . range . from || x > f . range . to ) &&! m &&! f . composing && ( b . active =! 1 ); let M = s ({ char : e , allowSpaces : n , allowToIncludeChar : r , allowedPrefixes : o , startOfLine : i , $position : y . $from }), C = `id_ ${ Math . floor ( Math . random () * 4294967295 ) } ` ; M && l ({ editor : t , state : p , range : M . range , isActive : f . active }) && ( ! a || a ({ editor : t , range : M . range , query : M . query , text : M . text , transaction : u })) ? ( b . dismissedRange !== null &&! c ({ match : M , dismissedRange : b . dismissedRange , state : p , transaction : u }) && ( b . dismissedRange = null ), b . dismissedRange === null ? ( b . active =! 0 , b . decorationId = f . decorationId || C , b . range = M . range , b . query = M . query , b . text = M . text ) : b . active =! 1 ) : ( M || ( b . dismissedRange = null ), b . active =! 1 )} else b . active =! 1 ; return b . active || ( b . decorationId = null , b . range = { from : 0 , to : 0 }, b . query = null , b . text = null ), b }}} function j1 ({ editor : t , items : e }){ let n = null , r = null , o = null , i = ()=>{ r !== null && ( clearTimeout ( r ), r = null ), o ? .(), o = null }, s = c => new Promise ( d =>{ o = d , r = setTimeout (()=>{ r = null ; let u = o ; o = null , u ? .()}, c )}), l = ()=>{ n ? . abort (), i (), n = null }; return { abort : l , fetch : async ( c , d )=>{ l (), n = new AbortController ; let u = n ; if ( d > 0 && await s ( d ), n !== u || u . signal . aborted ) return { status : "aborted" }; try { let f = await e ({ editor : t , query : c , signal : u . signal }); return n !== u || u . signal . aborted ? { status : "aborted" } : { status : "resolved" , items : f }} catch { return n !== u || u . signal . aborted ? { status : "aborted" } : { status : "error" }}}}} function _1 ({ placement : t , offset : e , flip : n , floatingUi : r }){ var o , i , s , l ; let a = [ Os ({ mainAxis : ( o = e . mainAxis ) !== null && o !== void 0 ? o : 4 , crossAxis : ( i = e . crossAxis ) !== null && i !== void 0 ? i : 0 })]; return n && a . push ( Mr ()), ! ( r == null || ( s = r . middleware ) === null || s === void 0 ) && s . length && a . push (... r . middleware ),{ placement : t , strategy : ( l = r ? . strategy ) !== null && l !== void 0 ? l : "absolute" , middleware : a }} function U1 ( t ){ if ( t instanceof HTMLElement ) return t ; if ( typeof t == "string" ) try { let e = document . querySelector ( t ); if ( e ) return e } catch { return document . body } return document . body } function K1 ({ getReferenceRect : t , contextElement : e , config : n , co
2026-10-19 17:33:22 +03:00
`).map(e=>!e.includes("|")||!e.includes("` ")?e:nv(e)).join(`
2026-11-03 01:53:45 +02:00
`)}function ov(t){return(t||"").replace(/\s+/g," ").trim()}function iv(t,e,n={}){var r;let o=(r=n.cellLineSeparator)!==null&&r!==void 0?r:" ";if(!t||!t.content||t.content.length===0)return"";let i=[];t.content.forEach(p=>{let g=[];p.content&&p.content.forEach(m=>{let y="";m.content&&Array.isArray(m.content)&&m.content.length>1?y=m.content.map(k=>e.renderChildren(k)).join(o):y=m.content?e.renderChildren(m.content):"";let w=ov(y.split(o).join(`
`).replace(/[ \t]*\r?\n[ \t]*/g," < br > ")),x=m.type===" tableHeader ",b=UC(m.attrs);g.push({text:w,isHeader:x,align:b})}),i.push(g)});let s=i.reduce((p,g)=>Math.max(p,g.length),0);if(s===0)return"";let l=Array.from({length:s}).fill(0);i.forEach(p=>{for(let m=0;m<s;m+=1){var g;let y=(((g=p[m])===null||g===void 0?void 0:g.text)||"").length;y>l[m]&&(l[m]=y),l[m]<3&&(l[m]=3)}});let a=(p,g)=>p+" ".repeat(Math.max(0,g-p.length)),c=i[0],d=c.some(p=>p.isHeader),u=Array.from({length:s}).fill(null);i.forEach(p=>{for(let m=0;m<s;m+=1){var g;!u[m]&&(!((g=p[m])===null||g===void 0)&&g.align)&&(u[m]=p[m].align)}});let f=`
2026-10-19 17:33:22 +03:00
`,h=Array.from({length:s}).map((p,g)=>d&&c[g]&&c[g].text||"");return f+=`| ${h.map((p,g)=>a(p,l[g])).join(" | ")} |
`,f+=`| ${l.map((p,g)=>{let m=Math.max(3,p),y=u[g];return y===" left "?`:${" - ".repeat(m)}`:y===" right "?`${" - ".repeat(m)}:`:y===" center "?`:${" - ".repeat(m)}:`:" - ".repeat(m)}).join(" | ")} |
`,(d?i.slice(1):i).forEach(p=>{f+=`| ${Array.from({length:s}).fill(0).map((g,m)=>a(p[m]&&p[m].text||"",l[m])).join(" | ")} |
2026-11-03 01:53:45 +02:00
`}),f}var sv=W.create({name:" table ",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:YC,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:" tableRow + ",tableRole:" table ",isolating:!0,group:" block ",parseHTML(){return[{tag:" table "}]},renderHTML({node:t,HTMLAttributes:e}){let{colgroup:n,tableWidth:r,tableMinWidth:o}=QC(t,this.options.cellMinWidth),i=e.style;function s(){return i||(r?`width: ${r}`:`min-width: ${o}`)}let l=[" table ",L(this.options.HTMLAttributes,e,{style:s()}),n,[" tbody ",0]];return this.options.renderWrapper?[" div ",{class:" tableWrapper "},l]:l},parseMarkdown:(t,e)=>{let n=[],r=Array.isArray(t.align)?t.align:[];if(t.header){let o=[];t.header.forEach((i,s)=>{var l;let a=Fs((l=r[s])!==null&&l!==void 0?l:i.align),c=a?{align:a}:{};o.push(e.createNode(" tableHeader ",c,[{type:" paragraph ",content:e.parseInline(i.tokens)}]))}),n.push(e.createNode(" tableRow ",{},o))}return t.rows&&t.rows.forEach(o=>{let i=[];o.forEach((s,l)=>{var a;let c=Fs((a=r[l])!==null&&a!==void 0?a:s.align),d=c?{align:c}:{};i.push(e.createNode(" tableCell ",d,[{type:" paragraph ",content:e.parseInline(s.tokens)}]))}),n.push(e.createNode(" tableRow ",{},i))}),e.createNode(" table ",void 0,n)},renderMarkdown:(t,e)=>iv(t,e),markdownTokenizer:{name:" table ",level:" block ",start:t=>{let e=t.split(`
2026-09-28 20:53:46 +03:00
`);if(e.length<2)return-1;let n=e[1];return!/^[ \t|:]*-[ \t|:-]*$/.test(n)||!n.includes(" | ")?-1:e[0].includes(" | ")?0:-1},tokenize(t,e,n){let r=t.indexOf(`
`),o=r>=0?t.slice(0,r):t,i=o.split(`
2026-10-19 17:33:22 +03:00
`);if(i.length<2)return;let s=i[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(s)||!s.includes(" | "))return;let l=rv(o);if(l===o)return;let a=n.blockTokens(l)[0];if(a?.type!==" table "||!a.raw)return;let c=a.raw.split(`
2026-09-28 20:53:46 +03:00
`).length,d=t.split(`
`).slice(0,c).join(`
2026-11-03 01:53:45 +02:00
`);return{...a,raw:d}}},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:o,editor:i})=>{let s=ev(i.schema,t,e,n);if(o){let l=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(R.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>lg(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>ag(t,e),deleteColumn:()=>({state:t,dispatch:e})=>{let n=dt(t.selection.$from,r=>r.type.name===" table ");return cg(t,e&&(r=>{n&&Cg(r,n.pos),e(r)}))},addRowBefore:()=>({state:t,dispatch:e})=>ug(t,e),addRowAfter:()=>({state:t,dispatch:e})=>fg(t,e),deleteRow:()=>({state:t,dispatch:e})=>{let n=dt(t.selection.$from,r=>r.type.name===" table ");return hg(t,e&&(r=>{n&&Cg(r,n.pos),e(r)}))},deleteTable:()=>({state:t,dispatch:e})=>gg(t,e),mergeCells:()=>({state:t,dispatch:e})=>Hc(t,e),splitCell:()=>({state:t,dispatch:e})=>Fc(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Ar(" column ")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Ar(" row ")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>mg(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>Hc(t,e)?!0:Fc(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>pg(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>Vc(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>Vc(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&zc(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){let r=te.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1," Shift - Tab ":()=>this.editor.commands.goToPreviousCell(),Backspace:Hs," Mod - Backspace ":Hs,Delete:Hs," Mod - Delete ":Hs}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[bg({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],xg({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){let t=this.options.resizable&&this.editor.isEditable,e=this.options.View;return t||!e?null:({node:n,view:r,HTMLAttributes:o})=>{let i=L(this.options.HTMLAttributes,o);return new e(n,this.options.cellMinWidth,r,i)}},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{tableRole:G(B(t," tableRole ",e))}}}),Eg=Z.create({name:" tableKit ",addExtensions(){let t=[];return this.options.table!==!1&&t.push(sv.configure(this.options.table)),this.options.tableCell!==!1&&t.push(JC.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(GC.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(XC.configure(this.options.tableRow)),t}});var lv=W.create({name:" text ",group:" inline ",parseMarkdown:t=>({type:" text ",text:t.text||""}),renderMarkdown:t=>t.text||""}),Og=lv;var av=Z.create({name:" textAlign ",addOptions(){return{types:[],alignments:[" left "," center "," right "," justify "],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{let e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).some(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e," textAlign ")).some(e=>e),toggleTextAlign:t=>({editor:e,commands:n})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?n.unsetTextAlign():n.setTextAlign(t):!1}},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 ")," Mod - Shift - j ":()=>this.editor.commands.setTextAlign(" justify " )}}}), Ng =