1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`20260924-39003-d97a9715`},e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:textmagic-web-app":!0});var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`fac9599c-8017-4156-ab07-0b5802f70d24`,e._sentryDebugIdIdentifier=`sentry-dbid-fac9599c-8017-4156-ab07-0b5802f70d24`)}catch{}})();import{G as e,H as t,K as n,U as r,u as i}from"./CjlEYjhI.js";function a(e){let{char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:a,startOfLine:o,$position:s}=e,c=n&&!r,l=i(t),u=RegExp(`\\s${l}$`),d=o?`^`:``,f=r?``:l,p=RegExp(c?`${d}${l}.*?(?=\\s${f}|$)`:`${d}(?:^)?${l}[^\\s${f}]*`,`gm`),m=s.nodeBefore?.isText&&s.nodeBefore.text;if(!m)return null;let h=s.pos-m.length,g=Array.from(m.matchAll(p)).pop();if(!g||g.input===void 0||g.index===void 0)return null;let _=g.input.slice(Math.max(0,g.index-1),g.index),v=RegExp(`^[${a?.join(``)}\0]?$`).test(_);if(a!==null&&!v)return null;let y=h+g.index,b=y+g[0].length;return c&&u.test(m.slice(b-1,b+1))&&(g[0]+=` `,b+=1),y<s.pos&&b>=s.pos?{range:{from:y,to:b},query:g[0].slice(t.length),text:g[0]}:null}var o=new n(`suggestion`);function s({pluginKey:n=o,editor:i,char:s=`@`,allowSpaces:c=!1,allowToIncludeChar:l=!1,allowedPrefixes:u=[` `],startOfLine:d=!1,decorationTag:f=`span`,decorationClass:p=`suggestion`,decorationContent:m=``,decorationEmptyClass:h=`is-empty`,command:g=()=>null,items:_=()=>[],render:v=()=>({}),allow:y=()=>!0,findSuggestionMatch:b=a,shouldShow:x}){let S,C=v?.(),w=()=>{let e=i.state.selection.$anchor.pos,{top:t,right:n,bottom:r,left:a}=i.view.coordsAtPos(e);try{return new DOMRect(a,t,n-a,r-t)}catch{return null}},T=(e,t)=>t?()=>{let t=n.getState(i.state)?.decorationId;return e.dom.querySelector(`[data-decoration-id="${t}"]`)?.getBoundingClientRect()||null}:w;function E(e,t){var r;try{let t=n.getState(e.state),a=t?.decorationId?e.dom.querySelector(`[data-decoration-id="${t.decorationId}"]`):null,o={editor:i,range:t?.range||{from:0,to:0},query:t?.query||null,text:t?.text||null,items:[],command:e=>g({editor:i,range:t?.range||{from:0,to:0},props:e}),decorationNode:a,clientRect:T(e,a)};(r=C?.onExit)==null||r.call(C,o)}catch{}let a=e.state.tr.setMeta(t,{exit:!0});e.dispatch(a)}let D=new e({key:n,view(){return{update:async(e,t)=>{var n,r,a,o,s;let c=this.key?.getState(t),l=this.key?.getState(e.state),u=c.active&&l.active&&c.range.from!==l.range.from,d=!c.active&&l.active,f=c.active&&!l.active,p=!d&&!f&&c.query!==l.query,m=d||u&&p,h=p||u,v=f||u&&p;if(!m&&!h&&!v)return;let y=v&&!m?c:l,b=e.dom.querySelector(`[data-decoration-id="${y.decorationId}"]`);S={editor:i,range:y.range,query:y.query,text:y.text,items:[],command:e=>g({editor:i,range:y.range,props:e}),decorationNode:b,clientRect:T(e,b)},m&&((n=C?.onBeforeStart)==null||n.call(C,S)),h&&((r=C?.onBeforeUpdate)==null||r.call(C,S)),(h||m)&&(S.items=await _({editor:i,query:y.query})),v&&((a=C?.onExit)==null||a.call(C,S)),h&&((o=C?.onUpdate)==null||o.call(C,S)),m&&((s=C?.onStart)==null||s.call(C,S))},destroy:()=>{var e;S&&((e=C?.onExit)==null||e.call(C,S))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(e,t,r,a){let{isEditable:o}=i,{composing:f}=i.view,{selection:p}=e,{empty:m,from:h}=p,g={...t},_=e.getMeta(n);if(_&&_.exit)return g.active=!1,g.decorationId=null,g.range={from:0,to:0},g.query=null,g.text=null,g;if(g.composing=f,o&&(m||i.view.composing)){(h<t.range.from||h>t.range.to)&&!f&&!t.composing&&(g.active=!1);let n=b({char:s,allowSpaces:c,allowToIncludeChar:l,allowedPrefixes:u,startOfLine:d,$position:p.$from}),r=`id_${Math.floor(Math.random()*4294967295)}`;n&&y({editor:i,state:a,range:n.range,isActive:t.active})&&(!x||x({editor:i,range:n.range,query:n.query,text:n.text,transaction:e}))?(g.active=!0,g.decorationId=t.decorationId?t.decorationId:r,g.range=n.range,g.query=n.query,g.text=n.text):g.active=!1}else g.active=!1;return g.active||(g.decorationId=null,g.range={from:0,to:0},g.query=null,g.text=null),g}},props:{handleKeyDown(e,t){var r;let{active:a,range:o}=D.getState(e.state);if(!a)return!1;if(t.key===`Escape`||t.key===`Esc`){let a=D.getState(e.state),o=S?.decorationNode??null??(a?.decorationId?e.dom.querySelector(`[data-decoration-id="${a.decorationId}"]`):null);if((C?.onKeyDown)?.call(C,{view:e,event:t,range:a.range}))return!0;let s={editor:i,range:a.range,query:a.query,text:a.text,items:[],command:e=>g({editor:i,range:a.range,props:e}),decorationNode:o,clientRect:o?()=>o.getBoundingClientRect()||null:null};return(r=C?.onExit)==null||r.call(C,s),E(e,n),!0}return(C?.onKeyDown)?.call(C,{view:e,event:t,range:o})||!1},decorations(e){let{active:n,range:i,decorationId:a,query:o}=D.getState(e);if(!n)return null;let s=!o?.length,c=[p];return s&&c.push(h),r.create(e.doc,[t.inline(i.from,i.to,{nodeName:f,class:c.join(` `),"data-decoration-id":a,"data-decoration-content":m})])}}});return D}export{a as n,s as t};
2//# sourceMappingURL=BVKjzvb12.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.