@confidencesystemsinc/sdk 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +21 -21
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -603,4 +603,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
603
603
|
`||s===`\r
|
|
604
604
|
`?r.push(Lo()):s===" "?r.push(ta()):r.push(rt(s))}this.insertNodes(r)}insertText(t){const n=this.anchor,r=this.focus,o=this.format,i=this.style;let s=n,a=r;!this.isCollapsed()&&r.isBefore(n)&&(s=r,a=n),s.type==="element"&&(function(m,y,b,v){const w=m.getNode(),A=w.getChildAtIndex(m.offset),k=rt();if(k.setFormat(b),k.setStyle(v),Bd(A))A.splice(0,0,[k]);else{const _=Ye(w)?Tt().append(k):k;A===null?w.append(_):A.insertBefore(_)}m.is(y)&&y.set(k.__key,0,"text"),m.set(k.__key,0,"text")})(s,a,o,i),a.type==="element"&&$o(a,Yt(nr(a,"next")));const c=s.offset;let l=a.offset;const f=this.getNodes(),u=f.length;let d=f[0];X(d)||U(26);const h=d.getTextContent().length,p=d.getParentOrThrow();let g=f[u-1];if(u===1&&a.type==="element"&&(l=h,a.set(s.key,l,"text")),this.isCollapsed()&&c===h&&(Wn(d)||!d.canInsertTextAfter()||!p.canInsertTextAfter()&&d.getNextSibling()===null)){let m=d.getNextSibling();if(X(m)&&m.canInsertTextBefore()&&!Wn(m)||(m=rt(),m.setFormat(o),m.setStyle(i),p.canInsertTextAfter()?d.insertAfter(m):p.insertAfter(m)),m.select(0,0),d=m,t!=="")return void this.insertText(t)}else if(this.isCollapsed()&&c===0&&(Wn(d)||!d.canInsertTextBefore()||!p.canInsertTextBefore()&&d.getPreviousSibling()===null)){let m=d.getPreviousSibling();if(X(m)&&!Wn(m)||(m=rt(),m.setFormat(o),p.canInsertTextBefore()?d.insertBefore(m):p.insertBefore(m)),m.select(),d=m,t!=="")return void this.insertText(t)}else if(d.isSegmented()&&c!==h){const m=rt(d.getTextContent());m.setFormat(o),d.replace(m),d=m}else if(!this.isCollapsed()&&t!==""){const m=g.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||R(m)&&(!m.canInsertTextBefore()||!m.canInsertTextAfter()))return this.insertText(""),ex(this.anchor,this.focus,null),void this.insertText(t)}if(u===1){if(wo(d)){const v=rt(t);return v.select(),void d.replace(v)}const m=d.getFormat(),y=d.getStyle();if(c!==l||m===o&&y===i){if(Xv(d)){const v=rt(t);return v.setFormat(o),v.setStyle(i),v.select(),void d.replace(v)}}else{if(d.getTextContent()!==""){const v=rt(t);if(v.setFormat(o),v.setStyle(i),v.select(),c===0)d.insertBefore(v,!1);else{const[w]=d.splitText(c);w.insertAfter(v,!1)}return void(v.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length))}d.setFormat(o),d.setStyle(i)}const b=l-c;d=d.spliceText(c,b,t,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=t.length:(this.format=m,this.style=y))}else{const m=new Set([...d.getParentKeys(),...g.getParentKeys()]),y=R(d)?d:d.getParentOrThrow();let b=R(g)?g:g.getParentOrThrow(),v=g;if(!y.is(b)&&b.isInline())do v=b,b=b.getParentOrThrow();while(b.isInline());if(a.type==="text"&&(l!==0||g.getTextContent()==="")||a.type==="element"&&g.getIndexWithinParent()<l)if(X(g)&&!wo(g)&&l!==g.getTextContentSize()){if(g.isSegmented()){const E=rt(g.getTextContent());g.replace(E),g=E}Ye(a.getNode())||a.type!=="text"||(g=g.spliceText(0,l,"")),m.add(g.__key)}else{const E=g.getParentOrThrow();E.canBeEmpty()||E.getChildrenSize()!==1?g.remove():E.remove()}else m.add(g.__key);const w=b.getChildren(),A=new Set(f),k=y.is(b),_=y.isInline()&&d.getNextSibling()===null?y:d;for(let E=w.length-1;E>=0;E--){const N=w[E];if(N.is(d)||R(N)&&N.isParentOf(d))break;N.isAttached()&&(!A.has(N)||N.is(v)?k||_.insertAfter(N,!1):N.remove())}if(!k){let E=b,N=null;for(;E!==null;){const P=E.getChildren(),I=P.length;(I===0||P[I-1].is(N))&&(m.delete(E.__key),N=E),E=E.getParent()}}if(wo(d))if(c===h)d.select();else{const E=rt(t);E.select(),d.replace(E)}else d=d.spliceText(c,h-c,t,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length);for(let E=1;E<u;E++){const N=f[E],P=N.__key;m.has(P)||N.remove()}}}removeText(){const t=Z()===this;Ha(this,N6(dg(this))),t&&Z()!==this&&Pt(this)}formatText(t,n=null){if(this.isCollapsed())return this.toggleFormat(t),void ut(null);const r=this.getNodes(),o=[];for(const w of r)X(w)&&o.push(w);const i=w=>{r.forEach(A=>{if(R(A)){const k=A.getFormatFlags(t,w);A.setTextFormat(k)}})},s=o.length;if(s===0)return this.toggleFormat(t),ut(null),void i(n);const a=this.anchor,c=this.focus,l=this.isBackward(),f=l?c:a,u=l?a:c;let d=0,h=o[0],p=f.type==="element"?0:f.offset;if(f.type==="text"&&p===h.getTextContentSize()&&(d=1,h=o[1],p=0),h==null)return;const g=h.getFormatFlags(t,n);i(g);const m=s-1;let y=o[m];const b=u.type==="text"?u.offset:y.getTextContentSize();if(h.is(y)){if(p===b)return;if(Wn(h)||p===0&&b===h.getTextContentSize())h.setFormat(g);else{const w=h.splitText(p,b),A=p===0?w[0]:w[1];A.setFormat(g),f.type==="text"&&f.set(A.__key,0,"text"),u.type==="text"&&u.set(A.__key,b-p,"text")}return void(this.format=g)}p===0||Wn(h)||([,h]=h.splitText(p),p=0),h.setFormat(g);const v=y.getFormatFlags(t,g);b>0&&(b===y.getTextContentSize()||Wn(y)||([y]=y.splitText(b)),y.setFormat(v));for(let w=d+1;w<m;w++){const A=o[w],k=A.getFormatFlags(t,v);A.setFormat(k)}f.type==="text"&&f.set(h.__key,p,"text"),u.type==="text"&&u.set(y.__key,b,"text"),this.format=g|v}insertNodes(t){if(t.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();const p=Z();return $(p)||U(134),p.insertNodes(t)}const n=(this.isBackward()?this.focus:this.anchor).getNode(),r=at(n,yr),o=t[t.length-1];if(R(r)&&"__language"in r){if("__language"in t[0])this.insertText(t[0].getTextContent());else{const p=Zl(this);r.splice(p,0,t),o.selectEnd()}return}if(!t.some(p=>(R(p)||Te(p))&&!p.isInline())){R(r)||U(211,n.constructor.name,n.getType());const p=Zl(this);return r.splice(p,0,t),void o.selectEnd()}const i=(function(p){const g=Tt();let m=null;for(let y=0;y<p.length;y++){const b=p[y],v=xo(b);if(v||Te(b)&&b.isInline()||R(b)&&b.isInline()||X(b)||b.isParentRequired()){if(m===null&&(m=b.createParentElementNode(),g.append(m),v))continue;m!==null&&m.append(b)}else g.append(b),m=null}return g})(t),s=i.getLastDescendant(),a=i.getChildren(),c=!R(r)||!r.isEmpty()?this.insertParagraph():null,l=a[a.length-1];let f=a[0];var u;R(u=f)&&yr(u)&&!u.isEmpty()&&R(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(R(r)||U(211,n.constructor.name,n.getType()),r.append(...f.getChildren()),f=a[1]),f&&(r===null&&U(212,n.constructor.name,n.getType()),(function(p,g){const m=g.getParentOrThrow().getLastChild();let y=g;const b=[g];for(;y!==m;)y.getNextSibling()||U(140),y=y.getNextSibling(),b.push(y);let v=p;for(const w of b)v=v.insertAfter(w)})(r,f));const d=at(s,yr);c&&R(d)&&(c.canMergeWhenEmpty()||yr(l))&&(d.append(...c.getChildren()),c.remove()),R(r)&&r.isEmpty()&&r.remove(),s.selectEnd();const h=R(r)?r.getLastChild():null;xo(h)&&d!==r&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=Tt();return We().splice(this.anchor.offset,0,[s]),s.select(),s}const t=Zl(this),n=at(this.anchor.getNode(),yr);R(n)||U(213);const r=n.getChildAtIndex(t),o=r?[r,...r.getNextSiblings()]:[],i=n.insertNewAfter(this,!1);return i?(i.append(...o),i.selectStart(),i):null}insertLineBreak(t){const n=Lo();if(this.insertNodes([n]),t){const r=n.getParentOrThrow(),o=n.getIndexWithinParent();r.select(o,o)}}extract(){const t=[...this.getNodes()],n=t.length;let r=t[0],o=t[n-1];const[i,s]=Ou(this),a=this.isBackward(),[c,l]=a?[this.focus,this.anchor]:[this.anchor,this.focus],[f,u]=a?[s,i]:[i,s];if(n===0)return[];if(n===1){if(X(r)&&!this.isCollapsed()){const d=r.splitText(f,u),h=f===0?d[0]:d[1];return h?(c.set(h.getKey(),0,"text"),l.set(h.getKey(),h.getTextContentSize(),"text"),[h]):[]}return[r]}if(X(r)&&(f===r.getTextContentSize()?t.shift():f!==0&&([,r]=r.splitText(f),t[0]=r,c.set(r.getKey(),0,"text"))),X(o)){const d=o.getTextContent().length;u===0?t.pop():u!==d&&([o]=o.splitText(u),t[t.length-1]=o,l.set(o.getKey(),o.getTextContentSize(),"text"))}return t}modify(t,n,r){if(Ym(this,t,n,r))return;const o=t==="move",i=Re(),s=en(Xt(i));if(!s)return;const a=i._blockCursorElement,c=i._rootElement,l=this.focus.getNode();if(c===null||a===null||!R(l)||l.isInline()||l.canBeEmpty()||Ru(a,i,c),this.dirty){let f=Do(i,this.anchor.key),u=Do(i,this.focus.key);this.anchor.type==="text"&&(f=Di(f)),this.focus.type==="text"&&(u=Di(u)),f&&u&&ix(s,f,this.anchor.offset,u,this.focus.offset)}if((function(f,u,d,h){f.modify(u,d,h)})(s,t,n?"backward":"forward",r),s.rangeCount>0){const f=s.getRangeAt(0),u=this.anchor.getNode(),d=Ye(u)?u:h6(u);if(this.applyDOMRange(f),this.dirty=!0,!o){const h=this.getNodes(),p=[];let g=!1;for(let m=0;m<h.length;m++){const y=h[m];Lu(y,d)?p.push(y):g=!0}if(g&&p.length>0)if(n){const m=p[0];R(m)?m.selectStart():m.getParentOrThrow().selectStart()}else{const m=p[p.length-1];R(m)?m.selectEnd():m.getParentOrThrow().selectEnd()}s.anchorNode===f.startContainer&&s.anchorOffset===f.startOffset||(function(m){const y=m.focus,b=m.anchor,v=b.key,w=b.offset,A=b.type;b.set(y.key,y.offset,y.type,!0),y.set(v,w,A,!0)})(this)}}r==="lineboundary"&&Ym(this,t,n,r,"decorators")}forwardDeletion(t,n,r){if(!r&&(t.type==="element"&&R(n)&&t.offset===n.getChildrenSize()||t.type==="text"&&t.offset===n.getTextContentSize())){const o=n.getParent(),i=n.getNextSibling()||(o===null?null:o.getNextSibling());if(R(i)&&i.isShadowRoot())return!0}return!1}deleteCharacter(t){const n=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let o=r.getNode();if(this.forwardDeletion(r,o,t))return;const i=rh(nr(r,t?"previous":"next"));if(i.getTextSlices().every(a=>a===null||a.distance===0)){let a={type:"initial"};for(const c of i.iterNodeCarets("shadowRoot"))if(Tn(c)){if(!c.origin.isInline()){if(c.origin.isShadowRoot()){if(a.type==="merge-block")break;if(R(i.anchor.origin)&&i.anchor.origin.isEmpty()){const l=Yt(c);Ha(this,Fr(l,l)),i.anchor.origin.remove()}return}a.type!=="merge-next-block"&&a.type!=="merge-block"||(a={block:a.block,caret:c,type:"merge-block"})}}else{if(a.type==="merge-block")break;if(ji(c)){if(R(c.origin)){if(c.origin.isInline()){if(!c.origin.isParentOf(i.anchor.origin))break}else a={block:c.origin,type:"merge-next-block"};continue}if(Te(c.origin)){if(!c.origin.isIsolated())if(a.type==="merge-next-block"&&(c.origin.isKeyboardSelectable()||!c.origin.isInline())&&R(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();const l=ox();l.add(c.origin.getKey()),Pt(l)}else c.origin.remove();return}break}}if(a.type==="merge-block"){const{caret:c,block:l}=a;return Ha(this,Fr(!c.origin.isEmpty()&&l.isEmpty()?oh(xt(l,c.direction)):i.anchor,c)),this.removeText()}}const s=this.focus;if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&r.offset===0&&Bm(this,r.getNode()))return}else{const a=s.type==="text"?s.getNode():null;if(o=r.type==="text"?r.getNode():null,a!==null&&a.isSegmented()){const c=s.offset,l=a.getTextContentSize();if(a.is(o)||t&&c!==l||!t&&c!==0)return void Wm(a,t,c)}else if(o!==null&&o.isSegmented()){const c=r.offset,l=o.getTextContentSize();if(o.is(a)||t&&c!==0||!t&&c!==l)return void Wm(o,t,c)}(function(c,l){const f=c.anchor,u=c.focus,d=f.getNode(),h=u.getNode();if(d===h&&f.type==="text"&&u.type==="text"){const p=f.offset,g=u.offset,m=p<g,y=m?p:g,b=m?g:p,v=b-1;y!==v&&(function(w){return!(kx(w)||Z3(w))})(d.getTextContent().slice(y,b))&&(l?u.set(u.key,v,u.type):f.set(f.key,v,f.type))}})(this,t)}}if(this.removeText(),t&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&Ye(r.getParent())&&r.getPreviousSibling()===null&&Bm(this,r)}}deleteLine(t){this.isCollapsed()&&this.modify("extend",t,"lineboundary"),this.isCollapsed()?this.deleteCharacter(t):this.removeText()}deleteWord(t){if(this.isCollapsed()){const n=this.anchor,r=n.getNode();if(this.forwardDeletion(n,r,t))return;this.modify("extend",t,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function ot(e){return e instanceof Jc}function Um(e){const t=e.offset;if(e.type==="text")return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function Ou(e){const t=e.getStartEndPoints();if(t===null)return[0,0];const[n,r]=t;return n.type==="element"&&r.type==="element"&&n.key===r.key&&n.offset===r.offset?[0,0]:[Um(n),Um(r)]}function Bm(e,t){for(let n=t;n;n=n.getParent()){if(R(n)){if(n.collapseAtStart(e))return!0;if(jt(n))break}if(n.getPreviousSibling())break}return!1}const Z3=(()=>{try{const e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("👍"))return t}catch{}return()=>!1})();function Wm(e,t,n){const r=e,o=r.getTextContent().split(/(?=\s)/g),i=o.length;let s=0,a=0;for(let l=0;l<i;l++){const f=l===i-1;if(a=s,s+=o[l].length,t&&s===n||s>n||f){o.splice(l,1),f&&(a=void 0);break}}const c=o.join("").trim();c===""?r.remove():(r.setTextContent(c),r.select(a,a))}function Km(e,t,n,r){let o,i=t;if(pt(e)){let s=!1;const a=e.childNodes,c=a.length,l=r._blockCursorElement;i===c&&(s=!0,i=c-1);let f=a[i],u=!1;if(f===l)f=a[i+1],u=!0;else if(l!==null){const d=l.parentNode;e===d&&t>Array.prototype.indexOf.call(d.children,l)&&i--}if(o=li(f),X(o))i=Pr(o,s?"next":"previous");else{let d=li(e);if(d===null)return null;if(R(d)){const h=r.getElementByKey(d.getKey());h===null&&U(214),[d,i]=d.getDOMSlot(h).resolveChildIndex(d,h,e,t),R(d)||U(215),s&&i>=d.getChildrenSize()&&(i=Math.max(0,d.getChildrenSize()-1));let g=d.getChildAtIndex(i);if(R(g)&&(function(m,y,b){const v=m.getParent();return b===null||v===null||!v.canBeEmpty()||v!==b.getNode()})(g,0,n)){const m=s?g.getLastDescendant():g.getFirstDescendant();m===null?d=g:(g=m,d=R(g)?g:g.getParentOrThrow()),i=0}X(g)?(o=g,d=null,i=Pr(g,s?"next":"previous")):g!==d&&s&&!u&&(R(d)||U(216),i=Math.min(d.getChildrenSize(),i+1))}else{const h=d.getIndexWithinParent();i=t===0&&Te(d)&&li(e)===d?h:h+1,d=d.getParentOrThrow()}if(R(d))return Pn(d.__key,i,"element")}}else o=li(e);return X(o)?Pn(o.__key,Pr(o,i,"clamp"),"text"):null}function Hm(e,t,n){const r=e.offset,o=e.getNode();if(r===0){const i=o.getPreviousSibling(),s=o.getParent();if(t){if((n||!t)&&i===null&&R(s)&&s.isInline()){const a=s.getPreviousSibling();X(a)&&e.set(a.__key,a.getTextContent().length,"text")}}else R(i)&&!n&&i.isInline()?e.set(i.__key,i.getChildrenSize(),"element"):X(i)&&e.set(i.__key,i.getTextContent().length,"text")}else if(r===o.getTextContent().length){const i=o.getNextSibling(),s=o.getParent();if(t&&R(i)&&i.isInline())e.set(i.__key,0,"element");else if((n||t)&&i===null&&R(s)&&s.isInline()&&!s.canInsertTextAfter()){const a=s.getNextSibling();X(a)&&e.set(a.__key,0,"text")}}}function ex(e,t,n){if(e.type==="text"&&t.type==="text"){const r=e.isBefore(t),o=e.is(t);Hm(e,r,o),Hm(t,!r,o),o&&t.set(e.key,e.offset,e.type);const i=Re();if(i.isComposing()&&i._compositionKey!==e.key&&$(n)){const s=n.anchor,a=n.focus;e.set(s.key,s.offset,s.type,!0),t.set(a.key,a.offset,a.type,!0)}}}function tx(e,t,n,r,o,i){if(e===null||n===null||!oa(o,e,n))return null;const s=Km(e,t,$(i)?i.anchor:null,o);if(s===null)return null;const a=Km(n,r,$(i)?i.focus:null,o);if(a===null)return null;if(s.type==="element"&&a.type==="element"){const c=li(e),l=li(n);if(Te(c)&&Te(l))return null}return ex(s,a,i),[s,a]}function Pu(e){return R(e)&&!e.isInline()}function nx(e,t,n,r,o,i){const s=Wr(),a=new Wo(Pn(e,t,o),Pn(n,r,i),0,"");return a.dirty=!0,s._selection=a,a}function rx(){const e=Pn("root",0,"element"),t=Pn("root",0,"element");return new Wo(e,t,0,"")}function ox(){return new Jc(new Set)}function jd(e,t,n,r){const o=n._window;if(o===null)return null;const i=r||o.event,s=i?i.type:void 0,a=s==="selectionchange",c=!du&&(a||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&i&&i.detail===3||s==="drop"||s===void 0);let l,f,u,d;if($(e)&&!c)return e.clone();if(t===null)return null;if(l=t.anchorNode,f=t.focusNode,u=t.anchorOffset,d=t.focusOffset,(a||s===void 0)&&$(e)&&!oa(n,l,f))return e.clone();const h=tx(l,u,f,d,n,e);if(h===null)return null;const[p,g]=h;return new Wo(p,g,$(e)?e.format:0,$(e)?e.style:"")}function Z(){return Wr()._selection}function Gi(){return Re()._editorState._selection}function pc(e,t,n,r=1){const o=e.anchor,i=e.focus,s=o.getNode(),a=i.getNode();if(!t.is(s)&&!t.is(a))return;const c=t.__key;if(e.isCollapsed()){const l=o.offset;if(n<=l&&r>0||n<l&&r<0){const f=Math.max(0,l+r);o.set(c,f,"element"),i.set(c,f,"element"),qm(e)}}else{const l=e.isBackward(),f=l?i:o,u=f.getNode(),d=l?o:i,h=d.getNode();if(t.is(u)){const p=f.offset;(n<=p&&r>0||n<p&&r<0)&&f.set(c,Math.max(0,p+r),"element")}if(t.is(h)){const p=d.offset;(n<=p&&r>0||n<p&&r<0)&&d.set(c,Math.max(0,p+r),"element")}}qm(e)}function qm(e){const t=e.anchor,n=t.offset,r=e.focus,o=r.offset,i=t.getNode(),s=r.getNode();if(e.isCollapsed()){if(!R(i))return;const a=i.getChildrenSize(),c=n>=a,l=c?i.getChildAtIndex(a-1):i.getChildAtIndex(n);if(X(l)){let f=0;c&&(f=l.getTextContentSize()),t.set(l.__key,f,"text"),r.set(l.__key,f,"text")}return}if(R(i)){const a=i.getChildrenSize(),c=n>=a,l=c?i.getChildAtIndex(a-1):i.getChildAtIndex(n);if(X(l)){let f=0;c&&(f=l.getTextContentSize()),t.set(l.__key,f,"text")}}if(R(s)){const a=s.getChildrenSize(),c=o>=a,l=c?s.getChildAtIndex(a-1):s.getChildAtIndex(o);if(X(l)){let f=0;c&&(f=l.getTextContentSize()),r.set(l.__key,f,"text")}}}function mc(e,t,n,r,o){let i=null,s=0,a=null;r!==null?(i=r.__key,X(r)?(s=r.getTextContentSize(),a="text"):R(r)&&(s=r.getChildrenSize(),a="element")):o!==null&&(i=o.__key,X(o)?a="text":R(o)&&(a="element")),i!==null&&a!==null?e.set(i,s,a):(s=t.getIndexWithinParent(),s===-1&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function Vm(e,t,n,r,o){e.type==="text"?e.set(n,e.offset+(t?0:o),"text"):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function ix(e,t,n,r,o){try{e.setBaseAndExtent(t,n,r,o)}catch{}}function J3(e,t,n,r,o,i,s){const a=r.anchorNode,c=r.focusNode,l=r.anchorOffset,f=r.focusOffset,u=document.activeElement;if(o.has($3)&&u!==i||u!==null&&Hd(u))return;if(!$(t))return void(e!==null&&oa(n,a,c)&&r.removeAllRanges());const d=t.anchor,h=t.focus,p=d.key,g=h.key,m=Do(n,p),y=Do(n,g),b=d.offset,v=h.offset,w=t.format,A=t.style,k=t.isCollapsed();let _=m,E=y,N=!1;if(d.type==="text"){_=Di(m);const Y=d.getNode();N=Y.getFormat()!==w||Y.getStyle()!==A}else $(e)&&e.anchor.type==="text"&&(N=!0);var P,I,W,j,z;if(h.type==="text"&&(E=Di(y)),_!==null&&E!==null&&(k&&(e===null||N||$(e)&&(e.format!==w||e.style!==A))&&(P=w,I=A,W=b,j=p,z=performance.now(),Kv=[P,I,W,j,z]),l!==b||f!==v||a!==_||c!==E||r.type==="Range"&&k||(u!==null&&i.contains(u)||o.has(W3)||i.focus({preventScroll:!0}),d.type==="element"))){if(ix(r,_,b,E,v),!o.has(U3)&&t.isCollapsed()&&i!==null&&i===document.activeElement){const Y=$(t)&&t.anchor.type==="element"?_.childNodes[b]||null:r.rangeCount>0?r.getRangeAt(0):null;if(Y!==null){let Q;if(Y instanceof Text){const oe=document.createRange();oe.selectNode(Y),Q=oe.getBoundingClientRect()}else Q=Y.getBoundingClientRect();(function(oe,M,re){const L=Tx(re),F=Zd(L);if(L===null||F===null)return;let{top:K,bottom:B}=M,J=0,V=0,ee=re;for(;ee!==null;){const te=ee===L.body;if(te)J=0,V=Xt(oe).innerHeight;else{const ye=ee.getBoundingClientRect();J=ye.top,V=ye.bottom}let pe=0;if(K<J?pe=-(J-K):B>V&&(pe=B-V),pe!==0)if(te)F.scrollBy(0,pe);else{const ye=ee.scrollTop;ee.scrollTop+=pe;const me=ee.scrollTop-ye;K-=me,B-=me}if(te)break;ee=ia(ee)}})(n,Q,i)}}ku=!0}}function sx(e){let t=Z()||Gi();t===null&&(t=We().selectEnd()),t.insertNodes(e)}function Zl(e){let t=e;e.isCollapsed()||t.removeText();const n=Z();$(n)&&(t=n),$(t)||U(161);const r=t.anchor;let o=r.getNode(),i=r.offset;for(;!yr(o);){const s=o;if([o,i]=X3(o,i),s.is(o))break}return i}function X3(e,t){const n=e.getParent();if(!n){const o=Tt();return We().append(o),o.select(),[We(),0]}if(X(e)){const o=e.splitText(t);if(o.length===0)return[n,e.getIndexWithinParent()];const i=t===0?0:1;return[n,o[0].getIndexWithinParent()+i]}if(!R(e)||t===0)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const o=new Wo(Pn(e.__key,t,"element"),Pn(e.__key,t,"element"),0,""),i=e.insertNewAfter(o);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function Ym(e,t,n,r,o="decorators-and-blocks"){if(t==="move"&&r==="character"&&!e.isCollapsed()){const[f,u]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return u.set(f.key,f.offset,f.type),!0}const i=nr(e.focus,n?"previous":"next"),s=r==="lineboundary",a=t==="move";let c=i,l=o==="decorators-and-blocks";if(!Lx(c)){for(const f of c){l=!1;const{origin:u}=f;if(!Te(u)||u.isIsolated()||(c=f,!s||!u.isInline()))break}if(l)for(const f of rh(i).iterNodeCarets(t==="extend"?"shadowRoot":"root")){if(Tn(f))f.origin.isInline()||(c=f);else{if(R(f.origin))continue;Te(f.origin)&&!f.origin.isInline()&&(c=f)}break}}if(c===i)return!1;if(a&&!s&&Te(c.origin)&&c.origin.isKeyboardSelectable()){const f=ox();return f.add(c.origin.getKey()),Pt(f),!0}return c=Yt(c),a&&$o(e.anchor,c),$o(e.focus,c),l||!s}let it=null,st=null,Ft=!1,Jl=!1,Wa=0;const Qm={characterData:!0,childList:!0,subtree:!0};function na(){return Ft||it!==null&&it._readOnly}function bt(){Ft&&U(13)}function ax(){Wa>99&&U(14)}function Wr(){return it===null&&U(195,cx()),it}function Re(){return st===null&&U(196,cx()),st}function cx(){let e=0;const t=new Set,n=Ro.version;if(typeof window<"u")for(const o of document.querySelectorAll("[contenteditable]")){const i=el(o);if(qd(i))e++;else if(i){let s=String(i.constructor.version||"<0.17.1");s===n&&(s+=" (separately built, likely a bundler configuration issue)"),t.add(s)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),r}function e6(){return st}function Gm(e,t,n){const r=t.__type,o=gx(e,r);let i=n.get(r);i===void 0&&(i=Array.from(o.transforms),n.set(r,i));const s=i.length;for(let a=0;a<s&&(i[a](t),t.isAttached());a++);}function Zm(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function lx(e,t){if(!t)return;const n=e._updateTags;let r=t;Array.isArray(t)||(r=[t]);for(const o of r)n.add(o)}function t6(e){return zd(e,Re()._nodes)}function zd(e,t){const n=e.type,r=t.get(n);r===void 0&&U(17,n);const o=r.klass;e.type!==o.getType()&&U(18,o.name);const i=o.importJSON(e),s=e.children;if(R(i)&&Array.isArray(s))for(let a=0;a<s.length;a++){const c=zd(s[a],t);i.append(c)}return i}function Jm(e,t,n){const r=it,o=Ft,i=st;it=t,Ft=!0,st=e;try{return n()}finally{it=r,Ft=o,st=i}}function Qn(e,t){const n=e._pendingEditorState,r=e._rootElement,o=e._headless||r===null;if(n===null)return;const i=e._editorState,s=i._selection,a=n._selection,c=e._dirtyType!==0,l=it,f=Ft,u=st,d=e._updating,h=e._observer;let p=null;if(e._pendingEditorState=null,e._editorState=n,!o&&c&&h!==null){st=e,it=n,Ft=!1,e._updating=!0;try{const k=e._dirtyType,_=e._dirtyElements,E=e._dirtyLeaves;h.disconnect(),p=v3(i,n,e,k,_,E)}catch(k){if(k instanceof Error&&e._onError(k),Jl)throw k;return px(e,null,r,n),vv(e),e._dirtyType=2,Jl=!0,Qn(e,i),void(Jl=!1)}finally{h.observe(r,Qm),e._updating=d,it=l,Ft=f,st=u}}n._readOnly||(n._readOnly=!0);const g=e._dirtyLeaves,m=e._dirtyElements,y=e._normalizedNodes,b=e._updateTags,v=e._deferred;c&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),(function(k,_){const E=k._decorators;let N=k._pendingDecorators||E;const P=_._nodeMap;let I;for(I in N)P.has(I)||(N===E&&(N=Ax(k)),delete N[I])})(e,n);const w=o?null:en(Xt(e));if(e._editable&&w!==null&&(c||a===null||a.dirty||!a.is(s))&&r!==null&&!b.has(B3)){st=e,it=n;try{if(h!==null&&h.disconnect(),c||a===null||a.dirty){const k=e._blockCursorElement;k!==null&&Ru(k,e,r),J3(s,a,e,w,b,r)}(function(k,_,E){let N=k._blockCursorElement;if($(E)&&E.isCollapsed()&&E.anchor.type==="element"&&_.contains(document.activeElement)){const P=E.anchor,I=P.getNode(),W=P.offset;let j=!1,z=null;if(W===I.getChildrenSize())ef(I.getChildAtIndex(W-1))&&(j=!0);else{const Y=I.getChildAtIndex(W);if(Y!==null&&ef(Y)){const Q=Y.getPreviousSibling();(Q===null||ef(Q))&&(j=!0,z=k.getElementByKey(Y.__key))}}if(j){const Y=k.getElementByKey(I.__key);return N===null&&(k._blockCursorElement=N=(function(Q){const oe=Q.theme,M=document.createElement("div");M.contentEditable="false",M.setAttribute("data-lexical-cursor","true");let re=oe.blockCursor;if(re!==void 0){if(typeof re=="string"){const L=pv(re);re=oe.blockCursor=L}re!==void 0&&M.classList.add(...re)}return M})(k._config)),_.style.caretColor="transparent",void(z===null?Y.appendChild(N):Y.insertBefore(N,z))}}N!==null&&Ru(N,k,_)})(e,r,a)}finally{h!==null&&h.observe(r,Qm),st=u,it=l}}p!==null&&(function(k,_,E,N,P){const I=Array.from(k._listeners.mutation),W=I.length;for(let j=0;j<W;j++){const[z,Y]=I[j];for(const Q of Y){const oe=_.get(Q);oe!==void 0&&z(oe,{dirtyLeaves:N,prevEditorState:P,updateTags:E})}}})(e,p,b,g,i),$(a)||a===null||s!==null&&s.is(a)||e.dispatchCommand(Qc,void 0);const A=e._pendingDecorators;A!==null&&(e._decorators=A,e._pendingDecorators=null,As("decorator",e,!0,A)),(function(k,_,E){const N=ng(_),P=ng(E);N!==P&&As("textcontent",k,!0,P)})(e,t||i,n),As("update",e,!0,{dirtyElements:m,dirtyLeaves:g,editorState:n,mutatedNodes:p,normalizedNodes:y,prevEditorState:t||i,tags:b}),(function(k,_){if(k._deferred=[],_.length!==0){const E=k._updating;k._updating=!0;try{for(let N=0;N<_.length;N++)_[N]()}finally{k._updating=E}}})(e,v),(function(k){const _=k._updates;if(_.length!==0){const E=_.shift();if(E){const[N,P]=E;Xc(k,N,P)}}})(e)}function As(e,t,n,...r){const o=t._updating;t._updating=n;try{const i=Array.from(t._listeners[e]);for(let s=0;s<i.length;s++)i[s].apply(null,r)}finally{t._updating=o}}function Xm(e,t){const n=e._updates;let r=t||!1;for(;n.length!==0;){const o=n.shift();if(o){const[i,s]=o,a=e._pendingEditorState;let c;s!==void 0&&(c=s.onUpdate,s.skipTransforms&&(r=!0),s.discrete&&(a===null&&U(191),a._flushSync=!0),c&&e._deferred.push(c),lx(e,s.tag)),a==null?Xc(e,i,s):i()}}return r}function Xc(e,t,n){const r=e._updateTags;let o,i=!1,s=!1;n!==void 0&&(o=n.onUpdate,lx(e,n.tag),i=n.skipTransforms||!1,s=n.discrete||!1),o&&e._deferred.push(o);const a=e._editorState;let c=e._pendingEditorState,l=!1;(c===null||c._readOnly)&&(c=e._pendingEditorState=ux(c||a),l=!0),c._flushSync=s;const f=it,u=Ft,d=st,h=e._updating;it=c,Ft=!1,e._updating=!0,st=e;const p=e._headless||e.getRootElement()===null;Wd(null);try{l&&(p?a._selection!==null&&(c._selection=a._selection.clone()):c._selection=(function(b,v){const w=b.getEditorState()._selection,A=en(Xt(b));return $(w)||w==null?jd(w,A,b,v):w.clone()})(e,n&&n.event||null));const m=e._compositionKey;t(),i=Xm(e,i),(function(b,v){const w=v.getEditorState()._selection,A=b._selection;if($(A)){const k=A.anchor,_=A.focus;let E;if(k.type==="text"&&(E=k.getNode(),E.selectionTransform(w,A)),_.type==="text"){const N=_.getNode();E!==N&&N.selectionTransform(w,A)}}})(c,e),e._dirtyType!==0&&(i?(function(b,v){const w=v._dirtyLeaves,A=b._nodeMap;for(const k of w){const _=A.get(k);X(_)&&_.isAttached()&&_.isSimpleText()&&!_.isUnmergeable()&&Nm(_)}})(c,e):(function(b,v){const w=v._dirtyLeaves,A=v._dirtyElements,k=b._nodeMap,_=Er(),E=new Map;let N=w,P=N.size,I=A,W=I.size;for(;P>0||W>0;){if(P>0){v._dirtyLeaves=new Set;for(const j of N){const z=k.get(j);X(z)&&z.isAttached()&&z.isSimpleText()&&!z.isUnmergeable()&&Nm(z),z!==void 0&&Zm(z,_)&&Gm(v,z,E),w.add(j)}if(N=v._dirtyLeaves,P=N.size,P>0){Wa++;continue}}v._dirtyLeaves=new Set,v._dirtyElements=new Map,I.delete("root")&&I.set("root",!0);for(const j of I){const z=j[0],Y=j[1];if(A.set(z,Y),!Y)continue;const Q=k.get(z);Q!==void 0&&Zm(Q,_)&&Gm(v,Q,E)}N=v._dirtyLeaves,P=N.size,I=v._dirtyElements,W=I.size,Wa++}v._dirtyLeaves=w,v._dirtyElements=A})(c,e),Xm(e),(function(b,v,w,A){const k=b._nodeMap,_=v._nodeMap,E=[];for(const[N]of A){const P=_.get(N);P!==void 0&&(P.isAttached()||(R(P)&&gv(P,N,k,_,E,A),k.has(N)||A.delete(N),E.push(N)))}for(const N of E)_.delete(N);for(const N of w){const P=_.get(N);P===void 0||P.isAttached()||(k.has(N)||w.delete(N),_.delete(N))}})(a,c,e._dirtyLeaves,e._dirtyElements)),m!==e._compositionKey&&(c._flushSync=!0);const y=c._selection;if($(y)){const b=c._nodeMap,v=y.anchor.key,w=y.focus.key;b.get(v)!==void 0&&b.get(w)!==void 0||U(19)}else ot(y)&&y._nodes.size===0&&(c._selection=null)}catch(m){return m instanceof Error&&e._onError(m),e._pendingEditorState=a,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void Qn(e)}finally{it=f,Ft=u,st=d,e._updating=h,Wa=0}e._dirtyType!==0||e._deferred.length>0||(function(m,y){const b=y.getEditorState()._selection,v=m._selection;if(v!==null){if(v.dirty||!v.is(b))return!0}else if(b!==null)return!0;return!1})(c,e)?c._flushSync?(c._flushSync=!1,Qn(e)):l&&a6(()=>{Qn(e)}):(c._flushSync=!1,l&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function Sn(e,t,n){st===e&&n===void 0?t():Xc(e,t,n)}class Cs{constructor(t,n,r){D(this,"element");D(this,"before");D(this,"after");this.element=t,this.before=n||null,this.after=r||null}withBefore(t){return new Cs(this.element,t,this.after)}withAfter(t){return new Cs(this.element,this.before,t)}withElement(t){return this.element===t?this:new Cs(t,this.before,this.after)}insertChild(t){const n=this.before||this.getManagedLineBreak();return n!==null&&n.parentElement!==this.element&&U(222),this.element.insertBefore(t,n),this}removeChild(t){return t.parentElement!==this.element&&U(223),this.element.removeChild(t),this}replaceChild(t,n){return n.parentElement!==this.element&&U(224),this.element.replaceChild(t,n),this}getFirstChild(){const t=this.after?this.after.nextSibling:this.element.firstChild;return t===this.before||t===this.getManagedLineBreak()?null:t}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){if(t===null)this.removeManagedLineBreak();else{const n=t==="decorator"&&(ea||Vi||Xs);this.insertManagedLineBreak(n)}}removeManagedLineBreak(){const t=this.getManagedLineBreak();if(t){const n=this.element,r=t.nodeName==="IMG"?t.nextSibling:null;r&&n.removeChild(r),n.removeChild(t),n.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){const n=this.getManagedLineBreak();if(n){if(t===(n.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,o=this.before,i=document.createElement("br");if(r.insertBefore(i,o),t){const s=document.createElement("img");s.setAttribute("data-lexical-linebreak","true"),s.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",s.alt="",r.insertBefore(s,i),r.__lexicalLineBreak=s}else r.__lexicalLineBreak=i}getFirstChildOffset(){let t=0;for(let n=this.after;n!==null;n=n.previousSibling)t++;return t}resolveChildIndex(t,n,r,o){if(r===this.element){const c=this.getFirstChildOffset();return[t,Math.min(c+t.getChildrenSize(),Math.max(c,o))]}const i=eg(n,r);i.push(o);const s=eg(n,this.element);let a=t.getIndexWithinParent();for(let c=0;c<s.length;c++){const l=i[c],f=s[c];if(l===void 0||l<f)break;if(l>f){a+=1;break}}return[t.getParentOrThrow(),a]}}function eg(e,t){const n=[];let r=t;for(;r!==e&&r!==null;r=r.parentNode){let o=0;for(let i=r.previousSibling;i!==null;i=i.previousSibling)o++;n.push(o)}return r!==e&&U(225),n.reverse()}class Mn extends cn{constructor(n){super(n);D(this,"__first");D(this,"__last");D(this,"__size");D(this,"__format");D(this,"__style");D(this,"__indent");D(this,"__dir");D(this,"__textFormat");D(this,"__textStyle");this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(n){super.afterCloneFrom(n),this.__key===n.__key&&(this.__first=n.__first,this.__last=n.__last,this.__size=n.__size),this.__indent=n.__indent,this.__format=n.__format,this.__style=n.__style,this.__dir=n.__dir,this.__textFormat=n.__textFormat,this.__textStyle=n.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const n=this.getFormat();return a3[n]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const n=[];let r=this.getFirstChild();for(;r!==null;)n.push(r),r=r.getNextSibling();return n}getChildrenKeys(){const n=[];let r=this.getFirstChild();for(;r!==null;)n.push(r.__key),r=r.getNextSibling();return n}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const n=Re()._dirtyElements;return n!==null&&n.has(this.__key)}isLastChild(){const n=this.getLatest(),r=this.getParentOrThrow().getLastChild();return r!==null&&r.is(n)}getAllTextNodes(){const n=[];let r=this.getFirstChild();for(;r!==null;){if(X(r)&&n.push(r),R(r)){const o=r.getAllTextNodes();n.push(...o)}r=r.getNextSibling()}return n}getFirstDescendant(){let n=this.getFirstChild();for(;R(n);){const r=n.getFirstChild();if(r===null)break;n=r}return n}getLastDescendant(){let n=this.getLastChild();for(;R(n);){const r=n.getLastChild();if(r===null)break;n=r}return n}getDescendantByIndex(n){const r=this.getChildren(),o=r.length;if(n>=o){const s=r[o-1];return R(s)&&s.getLastDescendant()||s||null}const i=r[n];return R(i)&&i.getFirstDescendant()||i||null}getFirstChild(){const n=this.getLatest().__first;return n===null?null:Xe(n)}getFirstChildOrThrow(){const n=this.getFirstChild();return n===null&&U(45,this.__key),n}getLastChild(){const n=this.getLatest().__last;return n===null?null:Xe(n)}getLastChildOrThrow(){const n=this.getLastChild();return n===null&&U(96,this.__key),n}getChildAtIndex(n){const r=this.getChildrenSize();let o,i;if(n<r/2){for(o=this.getFirstChild(),i=0;o!==null&&i<=n;){if(i===n)return o;o=o.getNextSibling(),i++}return null}for(o=this.getLastChild(),i=r-1;o!==null&&i>=n;){if(i===n)return o;o=o.getPreviousSibling(),i--}return null}getTextContent(){let n="";const r=this.getChildren(),o=r.length;for(let i=0;i<o;i++){const s=r[i];n+=s.getTextContent(),R(s)&&i!==o-1&&!s.isInline()&&(n+=Dr)}return n}getTextContentSize(){let n=0;const r=this.getChildren(),o=r.length;for(let i=0;i<o;i++){const s=r[i];n+=s.getTextContentSize(),R(s)&&i!==o-1&&!s.isInline()&&(n+=2)}return n}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(n){if(n!==""){const r=wm[n];return(this.getFormat()&r)!==0}return!1}hasTextFormat(n){const r=Po[n];return(this.getTextFormat()&r)!==0}getFormatFlags(n,r){return gc(this.getLatest().__textFormat,n,r)}getTextStyle(){return this.getLatest().__textStyle}select(n,r){bt();const o=Z();let i=n,s=r;const a=this.getChildrenSize();if(!this.canBeEmpty()){if(n===0&&r===0){const l=this.getFirstChild();if(X(l)||R(l))return l.select(0,0)}else if(!(n!==void 0&&n!==a||r!==void 0&&r!==a)){const l=this.getLastChild();if(X(l)||R(l))return l.select()}}i===void 0&&(i=a),s===void 0&&(s=a);const c=this.__key;return $(o)?(o.anchor.set(c,i,"element"),o.focus.set(c,s,"element"),o.dirty=!0,o):nx(c,i,c,s,"element","element")}selectStart(){const n=this.getFirstDescendant();return n?n.selectStart():this.select()}selectEnd(){const n=this.getLastDescendant();return n?n.selectEnd():this.select()}clear(){const n=this.getWritable();return this.getChildren().forEach(r=>r.remove()),n}append(...n){return this.splice(this.getChildrenSize(),0,n)}setDirection(n){const r=this.getWritable();return r.__dir=n,r}setFormat(n){return this.getWritable().__format=n!==""?wm[n]:0,this}setStyle(n){return this.getWritable().__style=n||"",this}setTextFormat(n){const r=this.getWritable();return r.__textFormat=n,r}setTextStyle(n){const r=this.getWritable();return r.__textStyle=n,r}setIndent(n){return this.getWritable().__indent=n,this}splice(n,r,o){hc(this)&&U(324,this.__key,this.__type);const i=this.getChildrenSize(),s=this.getWritable();n+r<=i||U(226,String(n),String(r),String(i));const a=s.__key,c=[],l=[],f=this.getChildAtIndex(n+r);let u=null,d=i-r+o.length;if(n!==0)if(n===i)u=this.getLastChild();else{const p=this.getChildAtIndex(n);p!==null&&(u=p.getPreviousSibling())}if(r>0){let p=u===null?this.getFirstChild():u.getNextSibling();for(let g=0;g<r;g++){p===null&&U(100);const m=p.getNextSibling(),y=p.__key;Ao(p.getWritable()),l.push(y),p=m}}let h=u;for(const p of o){h!==null&&p.is(h)&&(u=h=h.getPreviousSibling());const g=p.getWritable();g.__parent===a&&d--,Ao(g);const m=p.__key;if(h===null)s.__first=m,g.__prev=null;else{const y=h.getWritable();y.__next=m,g.__prev=y.__key}p.__key===a&&U(76),g.__parent=a,c.push(m),h=p}if(n+r===i)h!==null&&(h.getWritable().__next=null,s.__last=h.__key);else if(f!==null){const p=f.getWritable();if(h!==null){const g=h.getWritable();p.__prev=h.__key,g.__next=f.__key}else p.__prev=null}if(s.__size=d,l.length){const p=Z();if($(p)){const g=new Set(l),m=new Set(c),{anchor:y,focus:b}=p;tg(y,g,m)&&mc(y,y.getNode(),this,u,f),tg(b,g,m)&&mc(b,b.getNode(),this,u,f),d!==0||this.canBeEmpty()||jt(this)||this.remove()}}return s}getDOMSlot(n){return new Cs(n)}exportDOM(n){const{element:r}=super.exportDOM(n);if(pt(r)){const o=this.getIndent();o>0&&(r.style.paddingInlineStart=40*o+"px");const i=this.getDirection();i&&(r.dir=i)}return{element:r}}exportJSON(){const n={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},r=this.getTextFormat(),o=this.getTextStyle();return r===0&&o===""||jt(this)||this.getChildren().some(X)||(r!==0&&(n.textFormat=r),o!==""&&(n.textStyle=o)),n}updateFromJSON(n){return super.updateFromJSON(n).setFormat(n.format).setIndent(n.indent).setDirection(n.direction).setTextFormat(n.textFormat||0).setTextStyle(n.textStyle||"")}insertNewAfter(n,r){return null}canIndent(){return!0}collapseAtStart(n){return!1}excludeFromCopy(n){return!1}canReplaceWith(n){return!0}canInsertAfter(n){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(n){return!1}extractWithChild(n,r,o){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(n,r){const o=this.getDOMSlot(n);let i=o.getFirstChild();for(let s=this.getFirstChild();s;s=s.getNextSibling()){const a=r.getElementByKey(s.getKey());a!==null&&(i==null?(o.insertChild(a),i=a):i!==a&&o.replaceChild(a,i),i=i.nextSibling)}}}function R(e){return e instanceof Mn}function tg(e,t,n){let r=e.getNode();for(;r;){const o=r.__key;if(t.has(o)&&!n.has(o))return!0;r=r.getParent()}return!1}class fx extends cn{decorate(t,n){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Te(e){return e instanceof fx}class Zi extends Mn{constructor(){super("root");D(this,"__cachedText");this.__cachedText=null}static getType(){return"root"}static clone(){return new Zi}getTopLevelElementOrThrow(){U(51)}getTextContent(){const n=this.__cachedText;return!na()&&Re()._dirtyType!==0||n===null?super.getTextContent():n}remove(){U(52)}replace(n){U(53)}insertBefore(n){U(54)}insertAfter(n){U(55)}updateDOM(n,r){return!1}splice(n,r,o){for(const i of o)R(i)||Te(i)||U(282);return super.splice(n,r,o)}static importJSON(n){return We().updateFromJSON(n)}collapseAtStart(){return!0}}function Ye(e){return e instanceof Zi}function ux(e){return new ra(new Map(e._nodeMap))}function $d(){return new ra(new Map([["root",new Zi]]))}function dx(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&U(130,n.name),R(e)){const r=t.children;Array.isArray(r)||U(59,n.name);const o=e.getChildren();for(let i=0;i<o.length;i++){const s=dx(o[i]);r.push(s)}}return t}function n6(e){return e instanceof ra}class ra{constructor(t,n){D(this,"_nodeMap");D(this,"_selection");D(this,"_flushSync");D(this,"_readOnly");this._nodeMap=t,this._selection=n||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(t,n){return Jm(n&&n.editor||null,this,t)}clone(t){const n=new ra(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return Jm(null,this,()=>({root:dx(We())}))}}class Ud extends Mn{static getType(){return"artificial"}createDOM(t){return document.createElement("div")}}class Ji extends Mn{static getType(){return"paragraph"}static clone(t){return new Ji(t.__key)}createDOM(t){const n=document.createElement("p"),r=bi(t.theme,"paragraph");return r!==void 0&&n.classList.add(...r),n}updateDOM(t,n,r){return!1}static importDOM(){return{p:t=>({conversion:r6,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(pt(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r)}return{element:n}}static importJSON(t){return Tt().updateFromJSON(t)}exportJSON(){const t=super.exportJSON();if(t.textFormat===void 0||t.textStyle===void 0){const n=this.getChildren().find(X);n?(t.textFormat=n.getFormat(),t.textStyle=n.getStyle()):(t.textFormat=this.getTextFormat(),t.textStyle=this.getTextStyle())}return t}insertNewAfter(t,n){const r=Tt();r.setTextFormat(t.format),r.setTextStyle(t.style);const o=this.getDirection();return r.setDirection(o),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,n),r}collapseAtStart(){const t=this.getChildren();if(t.length===0||X(t[0])&&t[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function r6(e){const t=Tt();return e.style&&(t.setFormat(e.style.textAlign),b6(e,t)),{node:t}}function Tt(){return Kr(new Ji)}function Bd(e){return e instanceof Ji}const we=0,Gn=1,o6=3,hx=4;function px(e,t,n,r){const o=e._keyToDOMMap;o.clear(),e._editorState=$d(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;const i=e._observer;i!==null&&(i.disconnect(),e._observer=null),t!==null&&(t.textContent=""),n!==null&&(n.textContent="",o.set("root",n))}function i6(e){const t=new Set,n=new Set;let r=e;for(;r;){const{ownNodeConfig:o}=rl(r),i=r.transform;if(!n.has(i)){n.add(i);const s=r.transform();s&&t.add(s)}if(o){const s=o.$transform;s&&t.add(s),r=o.extends}else{const s=Object.getPrototypeOf(r);r=s.prototype instanceof cn&&s!==cn?s:void 0}}return t}function mx(e){const t=e||{},n=e6(),r=t.theme||{},o=e===void 0?n:t.parentEditor||null,i=t.disableEvents||!1,s=$d(),a=t.namespace||(o!==null?o._config.namespace:_x()),c=t.editorState,l=[Zi,Br,Yi,Qi,Ji,Ud,...t.nodes||[]],{onError:f,html:u}=t,d=t.editable===void 0||t.editable;let h;if(e===void 0&&n!==null)h=n._nodes;else{h=new Map;for(let g=0;g<l.length;g++){let m=l[g],y=null,b=null;if(typeof m!="function"){const A=m;m=A.replace,y=A.with,b=A.withKlass||null}rl(m);const v=m.getType(),w=i6(m);h.set(v,{exportDOM:u&&u.export?u.export.get(m):void 0,klass:m,replace:y,replaceWithKlass:b,sharedNodeState:p3(l[g]),transforms:w})}}const p=new Ro(s,o,h,{disableEvents:i,namespace:a,theme:r},f||console.error,(function(g,m){const y=new Map,b=new Set,v=w=>{Object.keys(w).forEach(A=>{let k=y.get(A);k===void 0&&(k=[],y.set(A,k)),k.push(w[A])})};return g.forEach(w=>{const A=w.klass.importDOM;if(A==null||b.has(A))return;b.add(A);const k=A.call(w.klass);k!==null&&v(k)}),m&&v(m),y})(h,u?u.import:void 0),d,e);return c!==void 0&&(p._pendingEditorState=c,p._dirtyType=2),(function(g){g.registerCommand(Ev,M3,we),g.registerCommand(Sv,I3,we),g.registerCommand(Tv,L3,we),g.registerCommand(Nv,R3,we),g.registerCommand(Ov,D3,we)})(p),p}class Ro{constructor(t,n,r,o,i,s,a,c){D(this,"_headless");D(this,"_parentEditor");D(this,"_rootElement");D(this,"_editorState");D(this,"_pendingEditorState");D(this,"_compositionKey");D(this,"_deferred");D(this,"_keyToDOMMap");D(this,"_updates");D(this,"_updating");D(this,"_listeners");D(this,"_commands");D(this,"_nodes");D(this,"_decorators");D(this,"_pendingDecorators");D(this,"_config");D(this,"_dirtyType");D(this,"_cloneNotNeeded");D(this,"_dirtyLeaves");D(this,"_dirtyElements");D(this,"_normalizedNodes");D(this,"_updateTags");D(this,"_observer");D(this,"_key");D(this,"_onError");D(this,"_htmlConversions");D(this,"_window");D(this,"_editable");D(this,"_blockCursorElement");D(this,"_createEditorArgs");this._createEditorArgs=c,this._parentEditor=n,this._rootElement=null,this._editorState=t,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=o,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=_x(),this._onError=i,this._htmlConversions=s,this._editable=a,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(t){const n=this._listeners.update;return n.add(t),()=>{n.delete(t)}}registerEditableListener(t){const n=this._listeners.editable;return n.add(t),()=>{n.delete(t)}}registerDecoratorListener(t){const n=this._listeners.decorator;return n.add(t),()=>{n.delete(t)}}registerTextContentListener(t){const n=this._listeners.textcontent;return n.add(t),()=>{n.delete(t)}}registerRootListener(t){const n=this._listeners.root;return t(this._rootElement,null),n.add(t),()=>{t(null,this._rootElement),n.delete(t)}}registerCommand(t,n,r){r===void 0&&U(35);const o=this._commands;o.has(t)||o.set(t,[new Set,new Set,new Set,new Set,new Set]);const i=o.get(t);i===void 0&&U(36,String(t));const s=i[r];return s.add(n),()=>{s.delete(n),i.every(a=>a.size===0)&&o.delete(t)}}registerMutationListener(t,n,r){const o=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,i=this._listeners.mutation;let s=i.get(n);s===void 0&&(s=new Set,i.set(n,s)),s.add(o);const a=r&&r.skipInitialization;return a!==void 0&&a||this.initializeMutationListener(n,o),()=>{s.delete(o),s.size===0&&i.delete(n)}}getRegisteredNode(t){const n=this._nodes.get(t.getType());return n===void 0&&U(37,t.name),n}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,n){const r=this._editorState,o=lg(r).get(n.getType());if(!o)return;const i=new Map;for(const s of o.keys())i.set(s,"created");i.size>0&&t(i,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,n){const r=this.getRegisteredNode(t);return r.transforms.add(n),r}registerNodeTransform(t,n){const r=this.registerNodeTransformToKlass(t,n),o=[r],i=r.replaceWithKlass;if(i!=null){const s=this.registerNodeTransformToKlass(i,n);o.push(s)}return(function(s,a){const c=lg(s.getEditorState()),l=[];for(const f of a){const u=c.get(f);u&&l.push(u)}l.length!==0&&s.update(()=>{for(const f of l)for(const u of f.keys()){const d=Xe(u);d&&d.markDirty()}},s._pendingEditorState===null?{tag:vo}:void 0)})(this,o.map(s=>s.klass.getType())),()=>{o.forEach(s=>s.transforms.delete(n))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,n){return ie(this,t,n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){const n=this._rootElement;if(t!==n){const r=bi(this._config.theme,"root"),o=this._pendingEditorState||this._editorState;if(this._rootElement=t,px(this,n,t,o),n!==null&&(this._config.disableEvents||F3(n),r!=null&&n.classList.remove(...r)),t!==null){const i=Zd(t),s=t.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=i,this._dirtyType=2,vv(this),this._updateTags.add(vo),Qn(this),this._config.disableEvents||(function(a,c){const l=a.ownerDocument;Cu.set(a,l);const f=uc.get(l)??0;f<1&&l.addEventListener("selectionchange",Qv),uc.set(l,f+1),a.__lexicalEditor=c;const u=Yv(a);for(let d=0;d<Au.length;d++){const[h,p]=Au[d],g=typeof p=="function"?m=>{Dm(m)||(Rm(m),(c.isEditable()||h==="click")&&p(m,c))}:m=>{if(Dm(m))return;Rm(m);const y=c.isEditable();switch(h){case"cut":return y&&ie(c,Dd,m);case"copy":return ie(c,Zc,m);case"paste":return y&&ie(c,Gc,m);case"dragstart":return y&&ie(c,$v,m);case"dragover":return y&&ie(c,Uv,m);case"dragend":return y&&ie(c,E3,m);case"focus":return y&&ie(c,N3,m);case"blur":return y&&ie(c,O3,m);case"drop":return y&&ie(c,zv,m)}};a.addEventListener(h,g),u.push(()=>{a.removeEventListener(h,g)})}})(t,this),r!=null&&t.classList.add(...r)}else this._window=null,this._updateTags.add(vo),Qn(this);As("root",this,!1,t,n)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,n){t.isEmpty()&&U(38);let r=t;r._readOnly&&(r=ux(t),r._selection=t._selection?t._selection.clone():null),bv(this);const o=this._pendingEditorState,i=this._updateTags,s=n!==void 0?n.tag:null;o===null||o.isEmpty()||(s!=null&&i.add(s),Qn(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,s!=null&&i.add(s),this._updating||Qn(this)}parseEditorState(t,n){return(function(r,o,i){const s=$d(),a=it,c=Ft,l=st,f=o._dirtyElements,u=o._dirtyLeaves,d=o._cloneNotNeeded,h=o._dirtyType;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,it=s,Ft=!1,st=o,Wd(null);try{const p=o._nodes;zd(r.root,p),i&&i(),s._readOnly=!0}catch(p){p instanceof Error&&o._onError(p)}finally{o._dirtyElements=f,o._dirtyLeaves=u,o._cloneNotNeeded=d,o._dirtyType=h,it=a,Ft=c,st=l}return s})(typeof t=="string"?JSON.parse(t):t,this,n)}read(t){return Qn(this),this.getEditorState().read(t,{editor:this})}update(t,n){(function(r,o,i){r._updating?r._updates.push([o,i]):Xc(r,o,i)})(this,t,n)}focus(t,n={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Sn(this,()=>{const o=Z(),i=We();o!==null?o.dirty||Pt(o.clone()):i.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?i.selectStart():i.selectEnd()),u6("focus"),d6(()=>{r.removeAttribute("autocapitalize"),t&&t()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const t=this._rootElement;t!==null&&t.blur();const n=en(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,As("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}}D(Ro,"version");Ro.version="0.39.0+prod.esm";let Mu=null;function Wd(e){Mu=e}let s6=1;function gx(e,t){const n=Kd(e,t);return n===void 0&&U(30,t),n}function Kd(e,t){return e._nodes.get(t)}const a6=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e)};function yx(e){return Te(Fi(e))}function Hd(e){const t=document.activeElement;if(!pt(t))return!1;const n=t.nodeName;return Te(Fi(e))&&(n==="INPUT"||n==="TEXTAREA"||t.contentEditable==="true"&&el(t)==null)}function oa(e,t,n){const r=e.getRootElement();try{return r!==null&&r.contains(t)&&r.contains(n)&&t!==null&&!Hd(t)&&bx(t)===e}catch{return!1}}function qd(e){return e instanceof Ro}function bx(e){let t=e;for(;t!=null;){const n=el(t);if(qd(n))return n;t=ia(t)}return null}function el(e){return e?e.__lexicalEditor:null}function wo(e){return Xv(e)||e.isToken()}function Wn(e){return wo(e)||e.isSegmented()}function lr(e){return Xi(e)&&e.nodeType===3}function vx(e){return Xi(e)&&e.nodeType===9}function Di(e){let t=e;for(;t!=null;){if(lr(t))return t;t=t.firstChild}return null}function gc(e,t,n){const r=Po[t];if(n!==null&&(e&r)===(n&r))return e;let o=e^r;return t==="subscript"?o&=-65:t==="superscript"?o&=-33:t==="lowercase"?(o&=-513,o&=-1025):t==="uppercase"?(o&=-257,o&=-1025):t==="capitalize"&&(o&=-257,o&=-513),o}function xx(e){return X(e)||xo(e)||Te(e)}function c6(e,t){const n=(function(){const s=Mu;return Mu=null,s})();if((t=t||n&&n.__key)!=null)return void(e.__key=t);bt(),ax();const r=Re(),o=Wr(),i=""+s6++;o._nodeMap.set(i,e),R(e)?r._dirtyElements.set(i,!0):r._dirtyLeaves.add(i),r._cloneNotNeeded.add(i),r._dirtyType=1,e.__key=i}function Ao(e){const t=e.getParent();if(t!==null){const n=e.getWritable(),r=t.getWritable(),o=e.getPreviousSibling(),i=e.getNextSibling(),s=i!==null?i.__key:null,a=o!==null?o.__key:null,c=o!==null?o.getWritable():null,l=i!==null?i.getWritable():null;o===null&&(r.__first=s),i===null&&(r.__last=a),c!==null&&(c.__next=s),l!==null&&(l.__prev=a),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function yc(e){ax(),hc(e)&&U(323,e.__key,e.__type);const t=e.getLatest(),n=t.__parent,r=Wr(),o=Re(),i=r._nodeMap,s=o._dirtyElements;n!==null&&(function(c,l,f){let u=c;for(;u!==null;){if(f.has(u))return;const d=l.get(u);if(d===void 0)break;f.set(u,!1),u=d.__parent}})(n,i,s);const a=t.__key;o._dirtyType=1,R(e)?s.set(a,!0):o._dirtyLeaves.add(a)}function ut(e){bt();const t=Re(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){const r=Xe(n);r!==null&&r.getWritable()}if(e!==null){const r=Xe(e);r!==null&&r.getWritable()}}}function Er(){return na()?null:Re()._compositionKey}function Xe(e,t){const n=(t||Wr())._nodeMap.get(e);return n===void 0?null:n}function wx(e,t){const n=tl(e,Re());return n!==void 0?Xe(n,t):null}function tl(e,t){return e[`__lexicalKey_${t._key}`]}function Fi(e,t){let n=e;for(;n!=null;){const r=wx(n,t);if(r!==null)return r;n=ia(n)}return null}function Ax(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function ng(e){return e.read(()=>We().getTextContent())}function We(){return Cx(Wr())}function Cx(e){return e._nodeMap.get("root")}function Pt(e){bt();const t=Wr();e!==null&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function li(e){const t=Re(),n=(function(r,o){let i=r;for(;i!=null;){const s=tl(i,o);if(s!==void 0)return s;i=ia(i)}return null})(e,t);return n===null?e===t.getRootElement()?Xe("root"):null:Xe(n)}function kx(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function Vd(e){const t=[];let n=e;for(;n!==null;)t.push(n),n=n._parentEditor;return t}function _x(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function Ex(e){return lr(e)?e.nodeValue:null}function Yd(e,t,n){const r=en(Xt(t));if(r===null)return;const o=r.anchorNode;let{anchorOffset:i,focusOffset:s}=r;if(o!==null){let a=Ex(o);const c=Fi(o);if(a!==null&&X(c)){if(a===Vc&&n){const l=n.length;a=n,i=l,s=l}a!==null&&Qd(c,a,i,s,e)}}}function Qd(e,t,n,r,o){let i=e;if(i.isAttached()&&(o||!i.isDirty())){const s=i.isComposing();let a=t;(s||o)&&t[t.length-1]===Vc&&(a=t.slice(0,-1));const c=i.getTextContent();if(o||a!==c){if(a===""){if(ut(null),Xs||Vi||ea)i.remove();else{const g=Re();setTimeout(()=>{g.update(()=>{i.isAttached()&&i.remove()})},20)}return}const l=i.getParent(),f=Gi(),u=i.getTextContentSize(),d=Er(),h=i.getKey();if(i.isToken()||d!==null&&h===d&&!s||$(f)&&(l!==null&&!l.canInsertTextBefore()&&f.anchor.offset===0||f.anchor.key===e.__key&&f.anchor.offset===0&&!i.canInsertTextBefore()&&!s||f.focus.key===e.__key&&f.focus.offset===u&&!i.canInsertTextAfter()&&!s))return void i.markDirty();const p=Z();if(!$(p)||n===null||r===null)return void rg(i,a,p);if(p.setTextNodeRange(i,n,i,r),i.isSegmented()){const g=rt(i.getTextContent());i.replace(g),i=g}rg(i,a,p)}}}function rg(e,t,n){if(e.setTextContent(t),$(n)){const r=e.getKey();for(const o of["anchor","focus"]){const i=n[o];i.type==="text"&&i.key===r&&(i.offset=Pr(e,i.offset,"clamp"))}}}function Ea(e,t,n){const r=t[n]||!1;return r==="any"||r===e[n]}function l6(e,t){return Ea(e,t,"altKey")&&Ea(e,t,"ctrlKey")&&Ea(e,t,"shiftKey")&&Ea(e,t,"metaKey")}function Ie(e,t,n){return l6(e,n)&&e.key.toLowerCase()===t.toLowerCase()}const Un={ctrlKey:!sn,metaKey:sn},og={altKey:sn,ctrlKey:!sn};function ig(e){return e.key==="Backspace"}function sg(e){return Ie(e,"a",Un)}function f6(e){const t=We();if($(e)){const n=e.anchor,r=e.focus,o=n.getNode().getTopLevelElementOrThrow().getParentOrThrow();return n.set(o.getKey(),0,"element"),r.set(o.getKey(),o.getChildrenSize(),"element"),Ri(e),e}{const n=t.select(0,t.getChildrenSize());return Pt(Ri(n)),n}}function bi(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;const o=e[t];if(typeof o=="string"){const i=pv(o);return n[t]=i,i}return o}function Gd(e,t,n,r,o){if(n.size===0)return;const i=r.__type,s=r.__key,a=t.get(i);a===void 0&&U(33,i);const c=a.klass;let l=e.get(c);l===void 0&&(l=new Map,e.set(c,l));const f=l.get(s),u=f==="destroyed"&&o==="created";(f===void 0||u)&&l.set(s,u?"updated":o)}function ag(e,t,n){const r=e.getParent();let o=n,i=e;return r!==null&&(t&&n===0?(o=i.getIndexWithinParent(),i=r):t||n!==i.getChildrenSize()||(o=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(t?o-1:o)}function Iu(e,t){const n=e.offset;if(e.type==="element")return ag(e.getNode(),t,n);{const r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){const o=t?r.getPreviousSibling():r.getNextSibling();return o===null?ag(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):o}}return null}function Sx(e){const t=Xt(e).event,n=t&&t.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function ie(e,t,n){return(function(r,o,i){const s=Vd(r);for(let a=4;a>=0;a--)for(let c=0;c<s.length;c++){const l=s[c],f=l._commands.get(o);if(f!==void 0){const u=f[a];if(u!==void 0){const d=Array.from(u),h=d.length;let p=!1;if(Sn(l,()=>{for(let g=0;g<h;g++)if(d[g](i,r))return void(p=!0)}),p)return p}}}return!1})(e,t,n)}function nl(e){return!Ye(e)&&!e.isLastChild()&&!e.isInline()}function Do(e,t){const n=e._keyToDOMMap.get(t);return n===void 0&&U(75,t),n}function ia(e){const t=e.assignedSlot||e.parentElement;return Du(t)?t.host:t}function Tx(e){return vx(e)?e:pt(e)?e.ownerDocument:null}function u6(e){bt(),Re()._updateTags.add(e)}function d6(e){bt(),Re()._deferred.push(e)}function Lu(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function Zd(e){const t=Tx(e);return t?t.defaultView:null}function Xt(e){const t=e._window;return t===null&&U(78),t}function h6(e){let t=e.getParentOrThrow();for(;t!==null;){if(jt(t))return t;t=t.getParentOrThrow()}return t}function jt(e){return Ye(e)||R(e)&&e.isShadowRoot()}function Kr(e){const t=Re(),n=e.getType(),r=Kd(t,n);r===void 0&&U(200,e.constructor.name,n);const{replace:o,replaceWithKlass:i}=r;if(o!==null){const s=o(e),a=s.constructor;return i!==null?s instanceof i||U(201,i.name,i.getType(),a.name,a.getType(),e.constructor.name,n):s instanceof e.constructor&&a!==e.constructor||U(202,a.name,a.getType(),e.constructor.name,n),s.__key===e.__key&&U(203,e.constructor.name,n,a.name,a.getType()),s}return e}function Xl(e,t){!Ye(e.getParent())||R(t)||Te(t)||U(99)}function p6(e){const t=Xe(e);return t===null&&U(63,e),t}function ef(e){return(Te(e)||R(e)&&!e.canBeEmpty())&&!e.isInline()}function Ru(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;r!==null&&r.removeChild(e)}function en(e){return dn?(e||window).getSelection():null}function m6(e){const t=Zd(e);return t?t.getSelection():null}function Nx(e){return pt(e)&&e.tagName==="A"}function pt(e){return Xi(e)&&e.nodeType===1}function Xi(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function Du(e){return Xi(e)&&e.nodeType===11}function Fu(e){const t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return e.nodeName.match(t)!==null}function bc(e){const t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return e.nodeName.match(t)!==null}function yr(e){if(Te(e)&&!e.isInline())return!0;if(!R(e)||jt(e))return!1;const t=e.getFirstChild(),n=t===null||xo(t)||X(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&n}function Jd(){return Re()}const cg=new WeakMap,g6=new Map;function lg(e){if(!e._readOnly&&e.isEmpty())return g6;e._readOnly||U(192);let t=cg.get(e);return t||(t=(function(n){const r=new Map;for(const[o,i]of n._nodeMap){const s=i.__type;let a=r.get(s);a||(a=new Map,r.set(s,a)),a.set(o,i)}return r})(e),cg.set(e,t)),t}function Ox(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function y6(e){return(t=Ox(e))[Gv]=!0,t;var t}function b6(e,t){const n=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(n/40);t.setIndent(r)}function v6(e){return e.__lexicalUnmanaged===!0}function us(e,t){return(function(n,r){return Object.prototype.hasOwnProperty.call(n,r)})(e,t)&&e[t]!==cn[t]}function rl(e){const t=Am in e.prototype?e.prototype[Am]():void 0,n=(function(s){if(!(s===cn||s.prototype instanceof cn)){let a="<unknown>",c="<unknown>";try{a=s.getType()}catch{}try{Ro.version&&(c=JSON.parse(Ro.version))}catch{}U(290,s.name,a,c)}return s===fx||s===Mn||s===cn})(e),r=!n&&us(e,"getType")?e.getType():void 0;let o,i=r;if(t)if(r)o=t[r];else for(const[s,a]of Object.entries(t))i=s,o=a;if(!n&&i&&(us(e,"getType")||(e.getType=()=>i),us(e,"clone")||(e.clone=s=>(Wd(s),new e)),us(e,"importJSON")||(e.importJSON=o&&o.$importJSON||(s=>new e().updateFromJSON(s))),!us(e,"importDOM")&&o)){const{importDOM:s}=o;s&&(e.importDOM=()=>s)}return{ownNodeConfig:o,ownNodeType:i}}const at=(e,t)=>{let n=e;for(;n!=null&&!Ye(n);){if(t(n))return n;n=n.getParent()}return null},x6={next:"previous",previous:"next"};class Xd{constructor(t){D(this,"origin");this.origin=t}[Symbol.iterator](){return Px({hasNext:ji,initial:this.getAdjacentCaret(),map:t=>t,step:t=>t.getAdjacentCaret()})}getAdjacentCaret(){return xt(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return xt(this.origin,this.direction)}remove(){const t=this.getNodeAtCaret();return t&&t.remove(),this}replaceOrInsert(t,n){const r=this.getNodeAtCaret();return t.is(this.origin)||t.is(r)||(r===null?this.insert(t):r.replace(t,n)),this}splice(t,n,r="next"){const o=r===this.direction?n:Array.from(n).reverse();let i=this;const s=this.getParentAtCaret(),a=new Map;for(let c=i.getAdjacentCaret();c!==null&&a.size<t;c=c.getAdjacentCaret()){const l=c.origin.getWritable();a.set(l.getKey(),l)}for(const c of o){if(a.size>0){const l=i.getNodeAtCaret();if(l){if(a.delete(l.getKey()),a.delete(c.getKey()),!(l.is(c)||i.origin.is(c))){const f=c.getParent();f&&f.is(s)&&c.remove(),l.replace(c)}}else l===null&&U(263,Array.from(a).join(" "))}else i.insert(c);i=xt(c,this.direction)}for(const c of a.values())c.remove();return this}}class zs extends Xd{constructor(){super(...arguments);D(this,"type","child")}getLatest(){const n=this.origin.getLatest();return n===this.origin?this:fn(n,this.direction)}getParentCaret(n="root"){return xt(eh(this.getParentAtCaret(),n),this.direction)}getFlipped(){const n=es(this.direction);return xt(this.getNodeAtCaret(),n)||fn(this.origin,n)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(n){return n instanceof zs&&this.direction===n.direction&&this.origin.is(n.origin)}isSamePointCaret(n){return this.isSameNodeCaret(n)}}const w6={root:Ye,shadowRoot:jt};function es(e){return x6[e]}function eh(e,t="root"){return w6[t](e)?null:e}class Fo extends Xd{constructor(){super(...arguments);D(this,"type","sibling")}getLatest(){const n=this.origin.getLatest();return n===this.origin?this:xt(n,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return R(this.origin)?fn(this.origin,this.direction):null}getParentCaret(n="root"){return xt(eh(this.getParentAtCaret(),n),this.direction)}getFlipped(){const n=es(this.direction);return xt(this.getNodeAtCaret(),n)||fn(this.origin.getParentOrThrow(),n)}isSamePointCaret(n){return n instanceof Fo&&this.direction===n.direction&&this.origin.is(n.origin)}isSameNodeCaret(n){return(n instanceof Fo||n instanceof jo)&&this.direction===n.direction&&this.origin.is(n.origin)}}class jo extends Xd{constructor(n,r){super(n);D(this,"type","text");D(this,"offset");this.offset=r}getLatest(){const n=this.origin.getLatest();return n===this.origin?this:zo(n,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(n="root"){return xt(eh(this.getParentAtCaret(),n),this.direction)}getFlipped(){return zo(this.origin,es(this.direction),this.offset)}isSamePointCaret(n){return n instanceof jo&&this.direction===n.direction&&this.origin.is(n.origin)&&this.offset===n.offset}isSameNodeCaret(n){return(n instanceof Fo||n instanceof jo)&&this.direction===n.direction&&this.origin.is(n.origin)}getSiblingCaret(){return xt(this.origin,this.direction)}}function Or(e){return e instanceof jo}function ji(e){return e instanceof Fo}function Tn(e){return e instanceof zs}const A6={next:class extends jo{constructor(){super(...arguments);D(this,"direction","next")}getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends jo{constructor(){super(...arguments);D(this,"direction","previous")}getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},C6={next:class extends Fo{constructor(){super(...arguments);D(this,"direction","next")}getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends Fo{constructor(){super(...arguments);D(this,"direction","previous")}getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},k6={next:class extends zs{constructor(){super(...arguments);D(this,"direction","next")}getNodeAtCaret(){return this.origin.getFirstChild()}insert(t){return this.origin.splice(0,0,[t]),this}},previous:class extends zs{constructor(){super(...arguments);D(this,"direction","previous")}getNodeAtCaret(){return this.origin.getLastChild()}insert(t){return this.origin.splice(this.origin.getChildrenSize(),0,[t]),this}}};function xt(e,t){return e?new C6[t](e):null}function zo(e,t,n){return e?new A6[t](e,Pr(e,n)):null}function Pr(e,t,n="error"){const r=e.getTextContentSize();let o=t==="next"?r:t==="previous"?0:t;return(o<0||o>r)&&(n!=="clamp"&&dv(284,String(t),String(r),e.getKey()),o=o<0?0:r),o}function fg(e,t){return new E6(e,t)}function fn(e,t){return R(e)?new k6[t](e):null}function _6(e){return e&&e.getChildCaret()||e}function th(e){return e&&_6(e.getAdjacentCaret())}class nh{constructor(t,n,r){D(this,"type","node-caret-range");D(this,"direction");D(this,"anchor");D(this,"focus");this.anchor=t,this.focus=n,this.direction=r}getLatest(){const t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new nh(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const t=o=>{const i=this[o].getLatest();return Or(i)?(function(s,a){const{direction:c,origin:l}=s,f=Pr(l,a==="focus"?es(c):c);return fg(s,f-s.offset)})(i,o):null},n=t("anchor"),r=t("focus");if(n&&r){const{caret:o}=n,{caret:i}=r;if(o.isSameNodeCaret(i))return[fg(o,i.offset-o.offset),null]}return[n,r]}iterNodeCarets(t="root"){const n=Or(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),o=Or(r),i=s=>s.isSameNodeCaret(r)?null:th(s)||s.getParentCaret(t);return Px({hasNext:s=>s!==null&&!(o&&r.isSameNodeCaret(s)),initial:n.isSameNodeCaret(r)?null:i(n),map:s=>s,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class E6{constructor(t,n){D(this,"type","slice");D(this,"caret");D(this,"distance");this.caret=t,this.distance=n}getSliceIndices(){const{distance:t,caret:{offset:n}}=this,r=n+t;return r<n?[r,n]:[n,r]}getTextContent(){const[t,n]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(t,n)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:t,direction:n}}=this,[r,o]=this.getSliceIndices(),i=t.getTextContent();return zo(t.setTextContent(i.slice(0,r)+i.slice(o)),n,r)}}function rh(e){return Fr(e,xt(We(),e.direction))}function S6(e){return Fr(e,e)}function Fr(e,t){return e.direction!==t.direction&&U(265),new nh(e,t,e.direction)}function Px(e){const{initial:t,hasNext:n,step:r,map:o}=e;let i=t;return{[Symbol.iterator](){return this},next(){if(!n(i))return{done:!0,value:void 0};const s={done:!1,value:o(i)};return i=r(i),s}}}function Mx(e,t){const n=Ka(e.origin,t.origin);switch(n===null&&U(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{const r=e.type==="text",o=t.type==="text";return r&&o?(function(i,s){return Math.sign(i-s)})(e.offset,t.offset):e.type===t.type?0:r?-1:o?1:e.type==="child"?-1:1}case"ancestor":return e.type==="child"?-1:1;case"descendant":return t.type==="child"?1:-1;case"branch":return Ix(n)}}function Ix(e){const{a:t,b:n}=e,r=t.__key,o=n.__key;let i=t,s=n;for(;i&&s;i=i.getNextSibling(),s=s.getNextSibling()){if(i.__key===o)return-1;if(s.__key===r)return 1}return i===null?1:-1}function Sa(e,t){return t.is(e)}function ug(e){return R(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function Ka(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};const n=new Map;for(let[r,o]=ug(e);r;o=r,r=r.getParent())n.set(r,o);for(let[r,o]=ug(t);r;o=r,r=r.getParent()){const i=n.get(r);if(i!==void 0)return i===null?(Sa(e,r)||U(276),{commonAncestor:r,type:"ancestor"}):o===null?(Sa(t,r)||U(277),{commonAncestor:r,type:"descendant"}):((R(i)||Sa(e,i))&&(R(o)||Sa(t,o))&&r.is(i.getParent())&&r.is(o.getParent())||U(278),{a:i,b:o,commonAncestor:r,type:"branch"})}return null}function nr(e,t){const{type:n,key:r,offset:o}=e,i=p6(e.key);return n==="text"?(X(i)||U(266,i.getType(),r),zo(i,t,o)):(R(i)||U(267,i.getType(),r),O6(i,e.offset,t))}function $o(e,t){const{origin:n,direction:r}=t,o=r==="next";Or(t)?e.set(n.getKey(),t.offset,"text"):ji(t)?X(n)?e.set(n.getKey(),Pr(n,r),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(o?1:0),"element"):(Tn(t)&&R(n)||U(268),e.set(n.getKey(),o?0:n.getChildrenSize(),"element"))}function T6(e){const t=Z(),n=$(t)?t:rx();return Ha(n,e),Pt(n),n}function Ha(e,t){$o(e.anchor,t.anchor),$o(e.focus,t.focus)}function dg(e){const{anchor:t,focus:n}=e,r=nr(t,"next"),o=nr(n,"next"),i=Mx(r,o)<=0?"next":"previous";return Fr(zi(r,i),zi(o,i))}function oh(e){const{direction:t,origin:n}=e,r=xt(n,es(t)).getNodeAtCaret();return r?xt(r,t):fn(n.getParentOrThrow(),t)}function hg(e,t="root"){const n=[e];for(let r=Tn(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(oh(r));return n}function tf(e){return!!e&&e.origin.isAttached()}function N6(e,t="removeEmptySlices"){if(e.isCollapsed())return e;const n="root",r="next";let o=t;const i=Rx(e,r),s=hg(i.anchor,n),a=hg(i.focus.getFlipped(),n),c=new Set,l=[];for(const p of i.iterNodeCarets(n))if(Tn(p))c.add(p.origin.getKey());else if(ji(p)){const{origin:g}=p;R(g)&&!c.has(g.getKey())||l.push(g)}for(const p of l)p.remove();for(const p of i.getTextSlices()){if(!p)continue;const{origin:g}=p.caret,m=g.getTextContentSize(),y=oh(xt(g,r)),b=g.getMode();if(Math.abs(p.distance)===m&&o==="removeEmptySlices"||b==="token"&&p.distance!==0)y.remove();else if(p.distance!==0){o="removeEmptySlices";let v=p.removeTextSlice();const w=p.caret.origin;if(b==="segmented"){const A=v.origin,k=rt(A.getTextContent()).setStyle(A.getStyle()).setFormat(A.getFormat());y.replaceOrInsert(k),v=zo(k,r,v.offset)}w.is(s[0].origin)&&(s[0]=v),w.is(a[0].origin)&&(a[0]=v.getFlipped())}}let f,u;for(const p of s)if(tf(p)){f=Yt(p);break}for(const p of a)if(tf(p)){u=Yt(p);break}const d=(function(p,g,m){if(!p||!g)return null;const y=p.getParentAtCaret(),b=g.getParentAtCaret();if(!y||!b)return null;const v=y.getParents().reverse();v.push(y);const w=b.getParents().reverse();w.push(b);const A=Math.min(v.length,w.length);let k;for(k=0;k<A&&v[k]===w[k];k++);const _=(P,I)=>{let W;for(let j=k;j<P.length;j++){const z=P[j];if(jt(z))return;!W&&I(z)&&(W=z)}return W},E=_(v,yr),N=E&&_(w,P=>m.has(P.getKey())&&yr(P));return E&&N?[E,N]:null})(f,u,c);if(d){const[p,g]=d;fn(p,"previous").splice(0,g.getChildren()),g.remove()}const h=[f,u,...s,...a].find(tf);if(h)return S6(zi(Yt(h),e.direction));U(269,JSON.stringify(s.map(p=>p.origin.__key)))}function Yt(e){const t=(function(o){let i=o;for(;Tn(i);){const s=th(i);if(!Tn(s))break;i=s}return i})(e.getLatest()),{direction:n}=t;if(X(t.origin))return Or(t)?t:zo(t.origin,n,n);const r=t.getAdjacentCaret();return ji(r)&&X(r.origin)?zo(r.origin,n,es(n)):t}function Lx(e){return Or(e)&&e.offset!==Pr(e.origin,e.direction)}function zi(e,t){return e.direction===t?e:e.getFlipped()}function Rx(e,t){return e.direction===t?e:Fr(zi(e.focus,t),zi(e.anchor,t))}function O6(e,t,n){let r=fn(e,"next");for(let o=0;o<t;o++){const i=r.getAdjacentCaret();if(i===null)break;r=i}return zi(r,n)}function P6(...e){return e}function M6(e,t){if(!t||e===t)return e;for(const n in t)if(e[n]!==t[n])return{...e,...t};return e}const Dx=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,I6=Dx?T.useLayoutEffect:T.useEffect,Ta={tag:vo};function L6({initialConfig:e,children:t}){const n=T.useMemo(()=>{const{theme:r,namespace:o,nodes:i,onError:s,editorState:a,html:c}=e,l=VT(null,r),f=mx({editable:e.editable,html:c,namespace:o,nodes:i,onError:u=>s(u,f),theme:r});return(function(u,d){if(d!==null){if(d===void 0)u.update(()=>{const h=We();if(h.isEmpty()){const p=Tt();h.append(p);const g=Dx?document.activeElement:null;(Z()!==null||g!==null&&g===u.getRootElement())&&p.select()}},Ta);else if(d!==null)switch(typeof d){case"string":{const h=u.parseEditorState(d);u.setEditorState(h,Ta);break}case"object":u.setEditorState(d,Ta);break;case"function":u.update(()=>{We().isEmpty()&&d(u)},Ta)}}})(f,a),[f,l]},[]);return I6(()=>{const r=e.editable,[o]=n;o.setEditable(r===void 0||r)},[]),x.jsx(uv.Provider,{value:n,children:t})}const R6=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?T.useLayoutEffect:T.useEffect;function D6(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function F6(){return(function(e){const[t]=ht(),n=T.useMemo(()=>e(t),[t,e]),[r,o]=T.useState(()=>n.initialValueFn()),i=T.useRef(r);return R6(()=>{const{initialValueFn:s,subscribe:a}=n,c=s();return i.current!==c&&(i.current=c,o(c)),a(l=>{i.current=l,o(l)})},[n,e]),r})(D6)}function j6(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const ju=new Map;function Fx(e){const t={};if(!e)return t;const n=e.split(";");for(const r of n)if(r!==""){const[o,i]=r.split(/:([^]+)/);o&&i&&(t[o.trim()]=i.trim())}return t}function pg(e){let t=ju.get(e);return t===void 0&&(t=Fx(e),ju.set(e,t)),t}function jx(e){const t=Jd().getElementByKey(e.getKey());if(t===null)return null;const n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function zx(e){return jx(Ye(e)?e:e.getParentOrThrow())}function mg(e){const t=zx(e);return t!==null&&t.direction==="rtl"}function $x(e,t,n="self"){const r=e.getStartEndPoints();if(t.isSelected(e)&&!Wn(t)&&r!==null){const[o,i]=r,s=e.isBackward(),a=o.getNode(),c=i.getNode(),l=t.is(a),f=t.is(c);if(l||f){const[u,d]=Ou(e),h=a.is(c),p=t.is(s?c:a),g=t.is(s?a:c);let m,y=0;h?(y=u>d?d:u,m=u>d?u:d):p?(y=s?d:u,m=void 0):g&&(y=0,m=s?u:d);const b=t.__text.slice(y,m);b!==t.__text&&(n==="clone"&&(t=y6(t)),t.__text=b)}}return t}function gg(e){if(e.type==="text")return e.offset===e.getNode().getTextContentSize();const t=e.getNode();return R(t)||j6(177),e.offset===t.getChildrenSize()}function z6(e){const t=e.getStyle(),n=Fx(t);ju.set(t,n)}function Ux(e){const t=Bx(e);return t!==null&&t.writingMode==="vertical-rl"}function Bx(e){const t=e.anchor.getNode();return R(t)?jx(t):zx(t)}function yg(e,t){let n=Ux(e)?!t:t;Wx(e)&&(n=!n);const r=nr(e.focus,n?"previous":"next");if(Lx(r))return!1;for(const o of rh(r)){if(Tn(o))return!o.origin.isInline();if(!R(o.origin)){if(Te(o.origin))return!0;break}}return!1}function $6(e,t,n,r){e.modify(t?"extend":"move",n,r)}function Wx(e){const t=Bx(e);return t!==null&&t.direction==="rtl"}function bg(e,t,n){const r=Wx(e);let o;o=Ux(e)||r?!n:n,$6(e,t,o,"character")}function U6(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Kx=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,B6=Kx&&"documentMode"in document?document.documentMode:null;!(!Kx||!("InputEvent"in window)||B6)&&"getTargetRanges"in new window.InputEvent("input");function Hx(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}function un(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function ih(e,...t){const n=Hx(...t);n.length>0&&e.classList.add(...n)}function qx(e,...t){const n=Hx(...t);n.length>0&&e.classList.remove(...n)}function W6(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function K6(e){const t=at(e,n=>R(n)&&!n.isInline());return R(t)||U6(4,e.__key),t}function Sr(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}const H6=Symbol.for("preact-signals");function ol(){if(Mr>1)return void Mr--;let e,t=!1;for(;ks!==void 0;){let n=ks;for(ks=void 0,zu++;n!==void 0;){const r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&Vx(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=r}}if(zu=0,Mr--,t)throw e}function q6(e){if(Mr>0)return e();Mr++;try{return e()}finally{ol()}}let Pe,ks;function vg(e){const t=Pe;Pe=void 0;try{return e()}finally{Pe=t}}let Mr=0,zu=0,qa=0;function xg(e){if(Pe===void 0)return;let t=e.n;return t===void 0||t.t!==Pe?(t={i:0,S:e,p:Pe.s,n:void 0,t:Pe,e:void 0,x:void 0,r:t},Pe.s!==void 0&&(Pe.s.n=t),Pe.s=t,e.n=t,32&Pe.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Pe.s,t.n=void 0,Pe.s.n=t,Pe.s=t),t):void 0}function kt(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched,this.name=t==null?void 0:t.name}function V6(e,t){return new kt(e,t)}function Vx(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function wg(e){for(let t=e.s;t!==void 0;t=t.n){const n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Yx(e){let t,n=e.s;for(;n!==void 0;){const r=n.p;n.i===-1?(n.S.U(n),r!==void 0&&(r.n=n.n),n.n!==void 0&&(n.n.p=r)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=r}e.s=t}function ti(e,t){kt.call(this,void 0),this.x=e,this.s=void 0,this.g=qa-1,this.f=4,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched,this.name=t==null?void 0:t.name}function Qx(e){const t=e.u;if(e.u=void 0,typeof t=="function"){Mr++;const n=Pe;Pe=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,sh(e),r}finally{Pe=n,ol()}}}function sh(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Qx(e)}function Y6(e){if(Pe!==this)throw new Error("Out-of-order effect");Yx(this),Pe=e,this.f&=-2,8&this.f&&sh(this),ol()}function ai(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=t==null?void 0:t.name}function $s(e,t){const n=new ai(e,t);try{n.c()}catch(o){throw n.d(),o}const r=n.d.bind(n);return r[Symbol.dispose]=r,r}function Gx(e,t={}){const n={};for(const r in e){const o=t[r],i=V6(o===void 0?e[r]:o);n[r]=i}return n}kt.prototype.brand=H6,kt.prototype.h=function(){return!0},kt.prototype.S=function(e){const t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t!==void 0?t.e=e:vg(()=>{var n;(n=this.W)==null||n.call(this)}))},kt.prototype.U=function(e){if(this.t!==void 0){const t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&vg(()=>{var r;(r=this.Z)==null||r.call(this)}))}},kt.prototype.subscribe=function(e){return $s(()=>{const t=this.value,n=Pe;Pe=void 0;try{e(t)}finally{Pe=n}},{name:"sub"})},kt.prototype.valueOf=function(){return this.value},kt.prototype.toString=function(){return this.value+""},kt.prototype.toJSON=function(){return this.value},kt.prototype.peek=function(){const e=Pe;Pe=void 0;try{return this.value}finally{Pe=e}},Object.defineProperty(kt.prototype,"value",{get(){const e=xg(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(zu>100)throw new Error("Cycle detected");this.v=e,this.i++,qa++,Mr++;try{for(let t=this.t;t!==void 0;t=t.x)t.t.N()}finally{ol()}}}}),ti.prototype=new kt,ti.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===qa))return!0;if(this.g=qa,this.f|=1,this.i>0&&!Vx(this))return this.f&=-2,!0;const e=Pe;try{wg(this),Pe=this;const t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return Pe=e,Yx(this),this.f&=-2,!0},ti.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let t=this.s;t!==void 0;t=t.n)t.S.S(t)}kt.prototype.S.call(this,e)},ti.prototype.U=function(e){if(this.t!==void 0&&(kt.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let t=this.s;t!==void 0;t=t.n)t.S.U(t)}},ti.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(ti.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const e=xg(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),ai.prototype.c=function(){const e=this.S();try{if(8&this.f||this.x===void 0)return;const t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},ai.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Qx(this),wg(this),Mr++;const e=Pe;return Pe=this,Y6.bind(this,e)},ai.prototype.N=function(){2&this.f||(this.f|=2,this.o=ks,ks=this)},ai.prototype.d=function(){this.f|=8,1&this.f||sh(this)},ai.prototype.dispose=function(){this.d()};function Q6(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}function Fe(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Zx(e,t){if(e&&t&&!Array.isArray(t)&&typeof e=="object"&&typeof t=="object"){const n=e,r=t;for(const o in r)n[o]=Zx(n[o],r[o]);return e}return t}const ah=0,$u=1,Jx=2,nf=3,Na=4,ni=5,rf=6,ds=7;function of(e){return e.id===ah}function Xx(e){return e.id===Jx}function G6(e){return(function(t){return t.id===$u})(e)||Fe(305,String(e.id),String($u)),Object.assign(e,{id:Jx})}const Z6=new Set;class J6{constructor(t,n){D(this,"builder");D(this,"configs");D(this,"_dependency");D(this,"_peerNameSet");D(this,"extension");D(this,"state");D(this,"_signal");this.builder=t,this.extension=n,this.configs=new Set,this.state={id:ah}}mergeConfigs(){let t=this.extension.config||{};const n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):M6;for(const r of this.configs)t=n(t,r);return t}init(t){const n=this.state;Xx(n)||Fe(306,String(n.id));const r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},o={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=(function(a,c,l){return Object.assign(a,{config:c,id:nf,registerState:l})})(n,this.mergeConfigs(),r);let s;this.state=i,this.extension.init&&(s=this.extension.init(t,i.config,r)),this.state=(function(a,c,l){return Object.assign(a,{id:Na,initResult:c,registerState:l})})(i,s,o)}build(t){const n=this.state;let r;n.id!==Na&&Fe(307,String(n.id),String(ni)),this.extension.build&&(r=this.extension.build(t,n.config,n.registerState));const o={...n.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=(function(i,s,a){return Object.assign(i,{id:ni,output:s,registerState:a})})(n,r,o)}register(t,n){this._signal=n;const r=this.state;r.id!==ni&&Fe(308,String(r.id),String(ni));const o=this.extension.register&&this.extension.register(t,r.config,r.registerState);return this.state=(function(i){return Object.assign(i,{id:rf})})(r),()=>{const i=this.state;i.id!==ds&&Fe(309,String(r.id),String(ds)),this.state=(function(s){return Object.assign(s,{id:ni})})(i),o&&o()}}afterRegistration(t){const n=this.state;let r;return n.id!==rf&&Fe(310,String(n.id),String(rf)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(t,n.config,n.registerState)),this.state=(function(o){return Object.assign(o,{id:ds})})(n),r}getSignal(){return this._signal===void 0&&Fe(311),this._signal}getInitResult(){this.extension.init===void 0&&Fe(312,this.extension.name);const t=this.state;return(function(n){return n.id>=Na})(t)||Fe(313,String(t.id),String(Na)),t.initResult}getInitPeer(t){const n=this.builder.extensionNameMap.get(t);return n?n.getExtensionInitDependency():void 0}getExtensionInitDependency(){const t=this.state;return(function(n){return n.id>=nf})(t)||Fe(314,String(t.id),String(nf)),{config:t.config}}getPeer(t){const n=this.builder.extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}getInitDependency(t){const n=this.builder.getExtensionRep(t);return n===void 0&&Fe(315,this.extension.name,t.name),n.getExtensionInitDependency()}getDependency(t){const n=this.builder.getExtensionRep(t);return n===void 0&&Fe(315,this.extension.name,t.name),n.getExtensionDependency()}getState(){const t=this.state;return(function(n){return n.id>=ds})(t)||Fe(316,String(t.id),String(ds)),t}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||Z6}getPeerNameSet(){let t=this._peerNameSet;return t||(t=new Set((this.extension.peerDependencies||[]).map(([n])=>n)),this._peerNameSet=t),t}getExtensionDependency(){if(!this._dependency){const t=this.state;(function(n){return n.id>=ni})(t)||Fe(317,this.extension.name),this._dependency={config:t.config,init:t.initResult,output:t.output}}return this._dependency}}const Ag={tag:vo};function X6(){const e=We();e.isEmpty()&&e.append(Tt())}const eN={config:{setOptions:Ag,updateOptions:Ag},init:({$initialEditorState:e=X6})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){const o=r.getInitResult();if(!o.initialized){o.initialized=!0;const{$initialEditorState:i}=o;if(n6(i))e.setEditorState(i,n);else if(typeof i=="function")e.update(()=>{i(e)},t);else if(i&&(typeof i=="string"||typeof i=="object")){const s=e.parseEditorState(i);e.setEditorState(s,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[Zi,Br,Yi,Qi,Ji]},Cg=Symbol.for("@lexical/extension/LexicalBuilder");function kg(){}function tN(e){throw e}function Oa(e){return Array.isArray(e)?e:[e]}const sf="0.39.0+prod.esm";class vi{constructor(t){D(this,"roots");D(this,"extensionNameMap");D(this,"outgoingConfigEdges");D(this,"incomingEdges");D(this,"conflicts");D(this,"_sortedExtensionReps");D(this,"PACKAGE_VERSION");this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=sf,this.roots=t;for(const n of t)this.addExtension(n)}static fromExtensions(t){const n=[Oa(eN)];for(const r of t)n.push(Oa(r));return new vi(n)}static maybeFromEditor(t){const n=t[Cg];return n&&(n.PACKAGE_VERSION!==sf&&Fe(292,n.PACKAGE_VERSION,sf),n instanceof vi||Fe(293)),n}static fromEditor(t){const n=vi.maybeFromEditor(t);return n===void 0&&Fe(294),n}constructEditor(){const{$initialEditorState:t,onError:n,...r}=this.buildCreateEditorArgs(),o=Object.assign(mx({...r,...n?{onError:i=>{n(i,o)}}:{}}),{[Cg]:this});for(const i of this.sortedExtensionReps())i.build(o);return o}buildEditor(){let t=kg;function n(){try{t()}finally{t=kg}}const r=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return t=un(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(t){return this.extensionNameMap.has(t)}getExtensionRep(t){const n=this.extensionNameMap.get(t.name);if(n)return n.extension!==t&&Fe(295,t.name),n}addEdge(t,n,r){const o=this.outgoingConfigEdges.get(t);o?o.set(n,r):this.outgoingConfigEdges.set(t,new Map([[n,r]]));const i=this.incomingEdges.get(n);i?i.add(t):this.incomingEdges.set(n,new Set([t]))}addExtension(t){this._sortedExtensionReps!==void 0&&Fe(296);const n=Oa(t),[r]=n;typeof r.name!="string"&&Fe(297,typeof r.name);let o=this.extensionNameMap.get(r.name);if(o!==void 0&&o.extension!==r&&Fe(298,r.name),!o){o=new J6(this,r),this.extensionNameMap.set(r.name,o);const i=this.conflicts.get(r.name);typeof i=="string"&&Fe(299,r.name,i);for(const s of r.conflictsWith||[])this.extensionNameMap.has(s)&&Fe(299,r.name,s),this.conflicts.set(s,r.name);for(const s of r.dependencies||[]){const a=Oa(s);this.addEdge(r.name,a[0].name,a.slice(1)),this.addExtension(a)}for(const[s,a]of r.peerDependencies||[])this.addEdge(r.name,s,a?[a]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const t=[],n=(r,o)=>{let i=r.state;if(Xx(i))return;const s=r.extension.name;var a;of(i)||Fe(300,s,o||"[unknown]"),of(a=i)||Fe(304,String(a.id),String(ah)),i=Object.assign(a,{id:$u}),r.state=i;const c=this.outgoingConfigEdges.get(s);if(c)for(const l of c.keys()){const f=this.extensionNameMap.get(l);f&&n(f,s)}i=G6(i),r.state=i,t.push(r)};for(const r of this.extensionNameMap.values())of(r.state)&&n(r);for(const r of t)for(const[o,i]of this.outgoingConfigEdges.get(r.extension.name)||[])if(i.length>0){const s=this.extensionNameMap.get(o);if(s)for(const a of i)s.configs.add(a)}for(const[r,...o]of this.roots)if(o.length>0){const i=this.extensionNameMap.get(r.name);i===void 0&&Fe(301,r.name);for(const s of o)i.configs.add(s)}return this._sortedExtensionReps=t,this._sortedExtensionReps}registerEditor(t){const n=this.sortedExtensionReps(),r=new AbortController,o=[()=>r.abort()],i=r.signal;for(const s of n){const a=s.register(t,i);a&&o.push(a)}for(const s of n){const a=s.afterRegistration(t);a&&o.push(a)}return un(...o)}buildCreateEditorArgs(){const t={},n=new Set,r=new Map,o=new Map,i={},s={},a=this.sortedExtensionReps();for(const f of a){const{extension:u}=f;if(u.onError!==void 0&&(t.onError=u.onError),u.disableEvents!==void 0&&(t.disableEvents=u.disableEvents),u.parentEditor!==void 0&&(t.parentEditor=u.parentEditor),u.editable!==void 0&&(t.editable=u.editable),u.namespace!==void 0&&(t.namespace=u.namespace),u.$initialEditorState!==void 0&&(t.$initialEditorState=u.$initialEditorState),u.nodes)for(const d of Q6(u)){if(typeof d!="function"){const h=r.get(d.replace);h&&Fe(302,u.name,d.replace.name,h.extension.name),r.set(d.replace,f)}n.add(d)}if(u.html){if(u.html.export)for(const[d,h]of u.html.export.entries())o.set(d,h);u.html.import&&Object.assign(i,u.html.import)}u.theme&&Zx(s,u.theme)}Object.keys(s).length>0&&(t.theme=s),n.size&&(t.nodes=[...n]);const c=Object.keys(i).length>0,l=o.size>0;(c||l)&&(t.html={},c&&(t.html.import=i),l&&(t.html.export=o));for(const f of a)f.init(t);return t.onError||(t.onError=tN),t}}function nN(e,t){const n=vi.fromEditor(e).extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}const rN={name:"@lexical/react/ReactProvider"};function oN(){return We().getTextContent()}function iN(e,t=!0){if(e)return!1;let n=oN();return t&&(n=n.trim()),n===""}function sN(e){if(!iN(e,!1))return!1;const t=We().getChildren(),n=t.length;if(n>1)return!1;for(let r=0;r<n;r++){const o=t[r];if(Te(o))return!1;if(R(o)){if(!Bd(o)||o.__indent!==0)return!1;const i=o.getChildren(),s=i.length;for(let a=0;a<s;a++){const c=i[r];if(!X(c))return!1}}}return!0}function e1(e){return()=>sN(e)}function aN(e){const t=window.location.origin,n=r=>{if(r.origin!==t)return;const o=e.getRootElement();if(document.activeElement!==o)return;const i=r.data;if(typeof i=="string"){let s;try{s=JSON.parse(i)}catch{return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){const a=s.payload;if(a&&a.functionId==="makeChanges"){const c=a.args;if(c){const[l,f,u,d,h]=c;e.update(()=>{const p=Z();if($(p)){const g=p.anchor;let m=g.getNode(),y=0,b=0;if(X(m)&&l>=0&&f>=0&&(y=l,b=l+f,p.setTextNodeRange(m,y,m,b)),y===b&&u===""||(p.insertRawText(u),m=g.getNode()),X(m)){y=d,b=d+h;const v=m.getTextContentSize();y=y>v?v:y,b=b>v?v:b,p.setTextNodeRange(m,y,m,b)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}function t1(e,t){const n=vx(t)?t.body.childNodes:t.childNodes;let r=[];const o=[];for(const i of n)if(!o1.has(i.nodeName)){const s=i1(i,e,o,!1);s!==null&&(r=r.concat(s))}return(function(i){for(const s of i)s.getNextSibling()instanceof Ud&&s.insertAfter(Lo());for(const s of i){const a=s.getChildren();for(const c of a)s.insertBefore(c);s.remove()}})(o),r}function n1(e,t){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),r=We().getChildren();for(let o=0;o<r.length;o++)r1(e,r[o],n,t);return n.innerHTML}function r1(e,t,n,r=null){let o=r===null||t.isSelected(r);const i=R(t)&&t.excludeFromCopy("html");let s=t;r!==null&&X(t)&&(s=$x(r,t,"clone"));const a=R(s)?s.getChildren():[],c=Kd(e,s.getType());let l;l=c&&c.exportDOM!==void 0?c.exportDOM(e,s):s.exportDOM(e);const{element:f,after:u}=l;if(!f)return!1;const d=document.createDocumentFragment();for(let h=0;h<a.length;h++){const p=a[h],g=r1(e,p,d,r);!o&&R(t)&&g&&t.extractWithChild(p,r,"html")&&(o=!0)}if(o&&!i){if((pt(f)||Du(f))&&f.append(d),n.append(f),u){const h=u.call(s,f);h&&(Du(f)?f.replaceChildren(h):f.replaceWith(h))}}else n.append(d);return o}const o1=new Set(["STYLE","SCRIPT"]);function i1(e,t,n,r,o=new Map,i){let s=[];if(o1.has(e.nodeName))return s;let a=null;const c=(function(p,g){const{nodeName:m}=p,y=g._htmlConversions.get(m.toLowerCase());let b=null;if(y!==void 0)for(const v of y){const w=v(p);w!==null&&(b===null||(b.priority||0)<=(w.priority||0))&&(b=w)}return b!==null?b.conversion:null})(e,t),l=c?c(e):null;let f=null;if(l!==null){f=l.after;const p=l.node;if(a=Array.isArray(p)?p[p.length-1]:p,a!==null){for(const[,g]of o)if(a=g(a,i),!a)break;a&&s.push(...Array.isArray(p)?p:[a])}l.forChild!=null&&o.set(e.nodeName,l.forChild)}const u=e.childNodes;let d=[];const h=(a==null||!jt(a))&&(a!=null&&Pu(a)||r);for(let p=0;p<u.length;p++)d.push(...i1(u[p],t,n,h,new Map(o),a));return f!=null&&(d=f(d)),bc(e)&&(d=cN(e,d,h?()=>{const p=new Ud;return n.push(p),p}:Tt)),a==null?d.length>0?s=s.concat(d):bc(e)&&(function(p){return p.nextSibling==null||p.previousSibling==null?!1:Fu(p.nextSibling)&&Fu(p.previousSibling)})(e)&&(s=s.concat(Lo())):R(a)&&a.append(...d),s}function cN(e,t,n){const r=e.style.textAlign,o=[];let i=[];for(let s=0;s<t.length;s++){const a=t[s];if(Pu(a))r&&!a.getFormat()&&a.setFormat(r),o.push(a);else if(i.push(a),s===t.length-1||s<t.length-1&&Pu(t[s+1])){const c=n();c.setFormat(r),c.append(...i),o.push(c),i=[]}}return o}function vc(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function lN(e,t=Z()){return t==null&&vc(166),$(t)&&t.isCollapsed()||t.getNodes().length===0?"":n1(e,t)}function fN(e,t=Z()){return t==null&&vc(166),$(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(uN(e,t))}function _g(e,t,n){const r=e.getData("application/x-lexical-editor");if(r)try{const a=JSON.parse(r);if(a.namespace===n._config.namespace&&Array.isArray(a.nodes))return Eg(n,dN(a.nodes),t)}catch(a){console.error(a)}const o=e.getData("text/html"),i=e.getData("text/plain");if(o&&i!==o)try{const a=new DOMParser().parseFromString((function(c){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:l=>l}).createHTML(c):c})(o),"text/html");return Eg(n,t1(n,a),t)}catch(a){console.error(a)}const s=i||e.getData("text/uri-list");if(s!=null)if($(t)){const a=s.split(/(\r?\n|\t)/);a[a.length-1]===""&&a.pop();for(let c=0;c<a.length;c++){const l=Z();if($(l)){const f=a[c];f===`
|
|
605
605
|
`||f===`\r
|
|
606
|
-
`?l.insertParagraph():f===" "?l.insertNodes([ta()]):l.insertText(f)}}}else t.insertRawText(s)}function Eg(e,t,n){e.dispatchCommand(x3,{nodes:t,selection:n})||(n.insertNodes(t),(function(r){if($(r)&&r.isCollapsed()){const o=r.anchor;let i=null;const s=nr(o,"previous");if(s)if(Or(s))i=s.origin;else{const a=Fr(s,fn(We(),"next").getFlipped());for(const c of a){if(X(c.origin)){i=c.origin;break}if(R(c.origin)&&!c.origin.isInline())break}}if(i&&X(i)){const a=i.getFormat(),c=i.getStyle();r.format===a&&r.style===c||(r.format=a,r.style=c,r.dirty=!0)}}})(n))}function s1(e,t,n,r=[]){let o=t===null||n.isSelected(t);const i=R(n)&&n.excludeFromCopy("html");let s=n;t!==null&&X(s)&&(s=$x(t,s,"clone"));const a=R(s)?s.getChildren():[],c=(function(l){const f=l.exportJSON(),u=l.constructor;if(f.type!==u.getType()&&vc(58,u.name),R(l)){const d=f.children;Array.isArray(d)||vc(59,u.name)}return f})(s);X(s)&&s.getTextContentSize()===0&&(o=!1);for(let l=0;l<a.length;l++){const f=a[l],u=s1(e,t,f,c.children);!o&&R(n)&&u&&n.extractWithChild(f,t,"clone")&&(o=!0)}if(o&&!i)r.push(c);else if(Array.isArray(c.children))for(let l=0;l<c.children.length;l++){const f=c.children[l];r.push(f)}return o}function uN(e,t){const n=[],r=We().getChildren();for(let o=0;o<r.length;o++)s1(e,t,r[o],n);return{namespace:e._config.namespace,nodes:n}}function dN(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],o=t6(r);X(o)&&z6(o),t.push(o)}return t}let ri=null;async function Sg(e,t,n){if(ri!==null)return!1;if(t!==null)return new Promise((l,f)=>{e.update(()=>{l(Tg(e,t,n))})});const r=e.getRootElement(),o=e._window||window,i=o.document,s=en(o);if(r===null||s===null)return!1;const a=i.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(i.createTextNode("#")),r.append(a);const c=new Range;return c.setStart(a,0),c.setEnd(a,1),s.removeAllRanges(),s.addRange(c),new Promise((l,f)=>{const u=e.registerCommand(Zc,d=>(Sr(d,ClipboardEvent)&&(u(),ri!==null&&(o.clearTimeout(ri),ri=null),l(Tg(e,d,n))),!0),hx);ri=o.setTimeout(()=>{u(),ri=null,l(!1)},50),i.execCommand("copy"),a.remove()})}function Tg(e,t,n){if(n===void 0){const o=en(e._window),i=Z();if(!i||i.isCollapsed()||!o)return!1;const s=o.anchorNode,a=o.focusNode;if(s!==null&&a!==null&&!oa(e,s,a))return!1;n=hN(i)}t.preventDefault();const r=t.clipboardData;return r!==null&&(pN(r,n),!0)}const a1=[["text/html",lN],["application/x-lexical-editor",fN]];function hN(e=Z()){const t={"text/plain":e?e.getTextContent():""};if(e){const n=Jd();for(const[r,o]of a1){const i=o(n,e);i!==null&&(t[r]=i)}}return t}function pN(e,t){for(const[n]of a1)t[n]===void 0&&e.setData(n,"");for(const n in t){const r=t[n];r!==void 0&&e.setData(n,r)}}function Ng(e,t){if(document.caretRangeFromPoint!==void 0){const n=document.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const n=document.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}const Ko=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,mN=Ko&&"documentMode"in document?document.documentMode:null,gN=Ko&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),yN=!(!Ko||!("InputEvent"in window)||mN)&&"getTargetRanges"in new window.InputEvent("input"),bN=Ko&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Og=Ko&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,vN=Ko&&/^(?=.*Chrome).*/i.test(navigator.userAgent),xN=Ko&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&gN&&!vN,Pg=he("DRAG_DROP_PASTE_FILE");function Pa(e){let t=null;if(Sr(e,DragEvent)?t=e.dataTransfer:Sr(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];const n=t.types,r=n.includes("Files"),o=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),o]}function Mg(e){const t=Z();if(!$(t))return!1;const n=new Set,r=t.getNodes();for(let o=0;o<r.length;o++){const i=r[o],s=i.getKey();if(n.has(s))continue;const a=at(i,l=>R(l)&&!l.isInline());if(a===null)continue;const c=a.getKey();a.canIndent()&&!n.has(c)&&(n.add(c),e(a))}return n.size>0}function Ig(e){const t=Fi(e);return Te(t)}function af(e){for(const t of["lowercase","uppercase","capitalize"])e.hasFormat(t)&&e.toggleFormat(t)}function wN(e){return un(e.registerCommand(Md,t=>{const n=Z();return!!ot(n)&&(n.clear(),!0)},we),e.registerCommand(bo,t=>{const n=Z();return $(n)?(n.deleteCharacter(t),!0):!!ot(n)&&(n.deleteNodes(),!0)},we),e.registerCommand(Rs,t=>{const n=Z();return!!$(n)&&(n.deleteWord(t),!0)},we),e.registerCommand(Ds,t=>{const n=Z();return!!$(n)&&(n.deleteLine(t),!0)},we),e.registerCommand(gi,t=>{const n=Z();if(typeof t=="string")n!==null&&n.insertText(t);else{if(n===null)return!1;const r=t.dataTransfer;if(r!=null)_g(r,n,e);else if($(n)){const o=t.data;return o&&n.insertText(o),!0}}return!0},we),e.registerCommand(xu,()=>{const t=Z();return!!$(t)&&(t.removeText(),!0)},we),e.registerCommand(kn,t=>{const n=Z();return!!$(n)&&(n.formatText(t),!0)},we),e.registerCommand(_3,t=>{const n=Z();if(!$(n)&&!ot(n))return!1;const r=n.getNodes();for(const o of r){const i=at(o,s=>R(s)&&!s.isInline());i!==null&&i.setFormat(t)}return!0},we),e.registerCommand(mi,t=>{const n=Z();return!!$(n)&&(n.insertLineBreak(t),!0)},we),e.registerCommand(Ls,()=>{const t=Z();return!!$(t)&&(t.insertParagraph(),!0)},we),e.registerCommand(C3,()=>(sx([ta()]),!0),we),e.registerCommand(k3,()=>Mg(t=>{const n=t.getIndent();t.setIndent(n+1)}),we),e.registerCommand(Mm,()=>Mg(t=>{const n=t.getIndent();n>0&&t.setIndent(Math.max(0,n-1))}),we),e.registerCommand(Iv,t=>{const n=Z();if(ot(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),r[0].selectPrevious(),!0}else if($(n)){const r=Iu(n.focus,!0);if(!t.shiftKey&&Te(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),t.preventDefault(),!0}return!1},we),e.registerCommand(Lv,t=>{const n=Z();if(ot(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),r[0].selectNext(0,0),!0}else if($(n)){if((function(o){const i=o.focus;return i.key==="root"&&i.offset===We().getChildrenSize()})(n))return t.preventDefault(),!0;const r=Iu(n.focus,!1);if(!t.shiftKey&&Te(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),t.preventDefault(),!0}return!1},we),e.registerCommand(Mv,t=>{const n=Z();if(ot(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),mg(r[0])?r[0].selectNext(0,0):r[0].selectPrevious(),!0}if(!$(n))return!1;if(yg(n,!0)){const r=t.shiftKey;return t.preventDefault(),bg(n,r,!0),!0}return!1},we),e.registerCommand(Pv,t=>{const n=Z();if(ot(n)){const o=n.getNodes();if(o.length>0)return t.preventDefault(),mg(o[0])?o[0].selectPrevious():o[0].selectNext(0,0),!0}if(!$(n))return!1;const r=t.shiftKey;return!!yg(n,!1)&&(t.preventDefault(),bg(n,r,!1),!0)},we),e.registerCommand(Dv,t=>{if(Ig(t.target))return!1;const n=Z();if($(n)){if((function(r){if(!r.isCollapsed())return!1;const{anchor:o}=r;if(o.offset!==0)return!1;const i=o.getNode();if(Ye(i))return!1;const s=K6(i);return s.getIndent()>0&&(s.is(i)||i.is(s.getFirstDescendant()))})(n))return t.preventDefault(),e.dispatchCommand(Mm,void 0);if(Og&&navigator.language==="ko-KR")return!1}else if(!ot(n))return!1;return t.preventDefault(),e.dispatchCommand(bo,!0)},we),e.registerCommand(Fv,t=>{if(Ig(t.target))return!1;const n=Z();return!(!$(n)&&!ot(n))&&(t.preventDefault(),e.dispatchCommand(bo,!1))},we),e.registerCommand(Fs,t=>{const n=Z();if(!$(n))return!1;if(af(n),t!==null){if((Og||bN||xN)&&yN)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(mi,!1)}return e.dispatchCommand(Ls,void 0)},we),e.registerCommand(Rd,()=>{const t=Z();return!!$(t)&&(e.blur(),!0)},we),e.registerCommand(zv,t=>{const[,n]=Pa(t);if(n.length>0){const o=Ng(t.clientX,t.clientY);if(o!==null){const{offset:i,node:s}=o,a=Fi(s);if(a!==null){const c=rx();if(X(a))c.anchor.set(a.getKey(),i,"text"),c.focus.set(a.getKey(),i,"text");else{const f=a.getParentOrThrow().getKey(),u=a.getIndexWithinParent()+1;c.anchor.set(f,u,"element"),c.focus.set(f,u,"element")}const l=Ri(c);Pt(l)}e.dispatchCommand(Pg,n)}return t.preventDefault(),!0}const r=Z();return!!$(r)},we),e.registerCommand($v,t=>{const[n]=Pa(t),r=Z();return!(n&&!$(r))},we),e.registerCommand(Uv,t=>{const[n]=Pa(t),r=Z();if(n&&!$(r))return!1;const o=Ng(t.clientX,t.clientY);if(o!==null){const i=Fi(o.node);Te(i)&&t.preventDefault()}return!0},we),e.registerCommand(wu,()=>(f6(),!0),we),e.registerCommand(Zc,t=>(Sg(e,Sr(t,ClipboardEvent)?t:null),!0),we),e.registerCommand(Dd,t=>((async function(n,r){await Sg(r,Sr(n,ClipboardEvent)?n:null),r.update(()=>{const o=Z();$(o)?o.removeText():ot(o)&&o.getNodes().forEach(i=>i.remove())})})(t,e),!0),we),e.registerCommand(Gc,t=>{const[,n,r]=Pa(t);return n.length>0&&!r?(e.dispatchCommand(Pg,n),!0):Xi(t.target)&&Hd(t.target)?!1:Z()!==null&&((function(o,i){o.preventDefault(),i.update(()=>{const s=Z(),a=Sr(o,InputEvent)||Sr(o,KeyboardEvent)?null:o.clipboardData;a!=null&&s!==null&&_g(a,s,i)},{tag:z3})})(t,e),!0)},we),e.registerCommand(Rv,t=>{const n=Z();return $(n)&&af(n),!1},we),e.registerCommand(jv,t=>{const n=Z();return $(n)&&af(n),!1},we))}function AN(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const ch=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?T.useLayoutEffect:T.useEffect;function CN({editor:e,ErrorBoundary:t}){return(function(n,r){const[o,i]=T.useState(()=>n.getDecorators());return ch(()=>n.registerDecoratorListener(s=>{Nn.flushSync(()=>{i(s)})}),[n]),T.useEffect(()=>{i(n.getDecorators())},[n]),T.useMemo(()=>{const s=[],a=Object.keys(o);for(let c=0;c<a.length;c++){const l=a[c],f=x.jsx(r,{onError:d=>n._onError(d),children:x.jsx(T.Suspense,{fallback:null,children:o[l]})}),u=n.getElementByKey(l);u!==null&&s.push(Nn.createPortal(f,u,l))}return s},[r,o,n])})(e,t)}function kN({editor:e,ErrorBoundary:t}){return(function(n){const r=vi.maybeFromEditor(n);if(r&&r.hasExtensionByName(rN.name)){for(const o of["@lexical/plain-text","@lexical/rich-text"])r.hasExtensionByName(o)&&AN(320,o);return!0}return!1})(e)?null:x.jsx(CN,{editor:e,ErrorBoundary:t})}function Lg(e){return e.getEditorState().read(e1(e.isComposing()))}function _N({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){const[r]=ht();return(function(o){ch(()=>un(wN(o),aN(o)),[o])})(r),x.jsxs(x.Fragment,{children:[e,x.jsx(EN,{content:t}),x.jsx(kN,{editor:r,ErrorBoundary:n})]})}function EN({content:e}){const[t]=ht(),n=(function(o){const[i,s]=T.useState(()=>Lg(o));return ch(()=>{function a(){const c=Lg(o);s(c)}return a(),un(o.registerUpdateListener(()=>{a()}),o.registerEditableListener(()=>{a()}))},[o]),i})(t),r=F6();return n?typeof e=="function"?e(r):e:null}function SN(e,t,n,r,o){if(e===null||n.size===0&&r.size===0&&!o)return 0;const i=t._selection,s=e._selection;if(o)return 1;if(!($(i)&&$(s)&&s.isCollapsed()&&i.isCollapsed()))return 0;const a=(function(y,b,v){const w=y._nodeMap,A=[];for(const k of b){const _=w.get(k);_!==void 0&&A.push(_)}for(const[k,_]of v){if(!_)continue;const E=w.get(k);E===void 0||Ye(E)||A.push(E)}return A})(t,n,r);if(a.length===0)return 0;if(a.length>1){const y=t._nodeMap,b=y.get(i.anchor.key),v=y.get(s.anchor.key);return b&&v&&!e._nodeMap.has(b.__key)&&X(b)&&b.__text.length===1&&i.anchor.offset===1?2:0}const c=a[0],l=e._nodeMap.get(c.__key);if(!X(l)||!X(c)||l.__mode!==c.__mode)return 0;const f=l.__text,u=c.__text;if(f===u)return 0;const d=i.anchor,h=s.anchor;if(d.key!==h.key||d.type!=="text")return 0;const p=d.offset,g=h.offset,m=u.length-f.length;return m===1&&g===p-1?2:m===-1&&g===p+1?3:m===-1&&g===p?4:0}function TN(e,t){let n=Date.now(),r=0;return(o,i,s,a,c,l)=>{const f=Date.now();if(l.has(Nu))return r=0,n=f,2;const u=SN(o,i,a,c,e.isComposing()),d=(()=>{const h=s===null||s.editor===e,p=l.has(j3);if(!p&&h&&l.has(vo))return 0;if(o===null)return 1;const g=i._selection;if(!(a.size>0||c.size>0))return g!==null?0:2;const m=typeof t=="number"?t:t.peek();return p===!1&&u!==0&&u===r&&f<n+m&&h||a.size===1&&(function(y,b,v){const w=b._nodeMap.get(y),A=v._nodeMap.get(y),k=b._selection,_=v._selection;return!($(k)&&$(_)&&k.anchor.type==="element"&&k.focus.type==="element"&&_.anchor.type==="text"&&_.focus.type==="text"||!X(w)||!X(A)||w.__parent!==A.__parent)&&JSON.stringify(b.read(()=>w.exportJSON()))===JSON.stringify(v.read(()=>A.exportJSON()))})(Array.from(a)[0],o,i)?0:1})();return n=f,r=u,d}}function Rg(e){e.undoStack=[],e.redoStack=[],e.current=null}function c1(e,t,n){const r=TN(e,n);return un(e.registerCommand(Id,()=>((function(i,s){const a=s.redoStack,c=s.undoStack;if(c.length!==0){const l=s.current,f=c.pop();l!==null&&(a.push(l),i.dispatchCommand(Aa,!0)),c.length===0&&i.dispatchCommand(Ca,!1),s.current=f||null,f&&f.editor.setEditorState(f.editorState,{tag:Nu})}})(e,t),!0),we),e.registerCommand(Ld,()=>((function(i,s){const a=s.redoStack,c=s.undoStack;if(a.length!==0){const l=s.current;l!==null&&(c.push(l),i.dispatchCommand(Ca,!0));const f=a.pop();a.length===0&&i.dispatchCommand(Aa,!1),s.current=f||null,f&&f.editor.setEditorState(f.editorState,{tag:Nu})}})(e,t),!0),we),e.registerCommand(S3,()=>(Rg(t),!1),we),e.registerCommand(T3,()=>(Rg(t),e.dispatchCommand(Aa,!1),e.dispatchCommand(Ca,!1),!0),we),e.registerUpdateListener(({editorState:i,prevEditorState:s,dirtyLeaves:a,dirtyElements:c,tags:l})=>{const f=t.current,u=t.redoStack,d=t.undoStack,h=f===null?null:f.editorState;if(f!==null&&i===h)return;const p=r(s,i,f,a,c,l);if(p===1)u.length!==0&&(t.redoStack=[],e.dispatchCommand(Aa,!1)),f!==null&&(d.push({...f}),e.dispatchCommand(Ca,!0));else if(p===2)return;t.current={editor:e,editorState:i}}))}function l1(){return{current:null,redoStack:[],undoStack:[]}}const cf={build:(e,{delay:t,createInitialHistoryState:n,disabled:r})=>Gx({delay:t,disabled:r,historyState:n(e)}),config:{createInitialHistoryState:l1,delay:300,disabled:typeof window>"u"},name:"@lexical/history/History",register:(e,t,n)=>{const r=n.getOutput();return $s(()=>r.disabled.value?void 0:c1(e,r.historyState.value,r.delay))}};P6(cf,{createInitialHistoryState:()=>{throw new Error("SharedHistory did not inherit parent history")},disabled:!0});function NN({delay:e,externalHistoryState:t}){const[n]=ht();return(function(r,o,i=1e3){const s=T.useMemo(()=>o||l1(),[o]);T.useEffect(()=>c1(r,s,i),[i,r,s])})(n,t,e),null}const f1=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?T.useLayoutEffect:T.useEffect;function ON({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:o,ariaErrorMessage:i,ariaExpanded:s,ariaInvalid:a,ariaLabel:c,ariaLabelledBy:l,ariaMultiline:f,ariaOwns:u,ariaRequired:d,autoCapitalize:h,className:p,id:g,role:m="textbox",spellCheck:y=!0,style:b,tabIndex:v,"data-testid":w,...A},k){const[_,E]=T.useState(e.isEditable()),N=T.useCallback(I=>{I&&I.ownerDocument&&I.ownerDocument.defaultView?e.setRootElement(I):e.setRootElement(null)},[e]),P=T.useMemo(()=>(function(...I){return W=>{for(const j of I)typeof j=="function"?j(W):j!=null&&(j.current=W)}})(k,N),[N,k]);return f1(()=>(E(e.isEditable()),e.registerEditableListener(I=>{E(I)})),[e]),x.jsx("div",{"aria-activedescendant":_?t:void 0,"aria-autocomplete":_?n:"none","aria-controls":_?r:void 0,"aria-describedby":o,...i!=null?{"aria-errormessage":i}:{},"aria-expanded":_&&m==="combobox"?!!s:void 0,...a!=null?{"aria-invalid":a}:{},"aria-label":c,"aria-labelledby":l,"aria-multiline":f,"aria-owns":_?u:void 0,"aria-readonly":!_||void 0,"aria-required":d,autoCapitalize:h,className:p,contentEditable:_,"data-testid":w,id:g,ref:P,role:m,spellCheck:y,style:b,tabIndex:v,...A})}const PN=T.forwardRef(ON);function Dg(e){return e.getEditorState().read(e1(e.isComposing()))}const MN=T.forwardRef(IN);function IN(e,t){const{placeholder:n,...r}=e,[o]=ht();return x.jsxs(x.Fragment,{children:[x.jsx(PN,{editor:o,...r,ref:t}),n!=null&&x.jsx(LN,{editor:o,content:n})]})}function LN({content:e,editor:t}){const n=(function(s){const[a,c]=T.useState(()=>Dg(s));return f1(()=>{function l(){const f=Dg(s);c(f)}return l(),un(s.registerUpdateListener(()=>{l()}),s.registerEditableListener(()=>{l()}))},[s]),a})(t),[r,o]=T.useState(t.isEditable());if(T.useLayoutEffect(()=>(o(t.isEditable()),t.registerEditableListener(s=>{o(s)})),[t]),!n)return null;let i=null;return typeof e=="function"?i=e(r):e!==null&&(i=e),i===null?null:x.jsx("div",{"aria-hidden":!0,children:i})}const RN=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?T.useLayoutEffect:T.useEffect;function DN({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){const[r]=ht();return RN(()=>{if(n)return r.registerUpdateListener(({editorState:o,dirtyElements:i,dirtyLeaves:s,prevEditorState:a,tags:c})=>{t&&i.size===0&&s.size===0||e&&c.has(vo)||a.isEmpty()||n(o,r,c)})},[r,e,t,n]),null}const FN=T.createContext(null),lf={didCatch:!1,error:null};class jN extends T.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=lf}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(...t){var r,o;const{error:n}=this.state;n!==null&&((o=(r=this.props).onReset)==null||o.call(r,{args:t,reason:"imperative-api"}),this.setState(lf))}componentDidCatch(t,n){var r,o;(o=(r=this.props).onError)==null||o.call(r,t,n)}componentDidUpdate(t,n){var i,s;const{didCatch:r}=this.state,{resetKeys:o}=this.props;r&&n.error!==null&&zN(t.resetKeys,o)&&((s=(i=this.props).onReset)==null||s.call(i,{next:o,prev:t.resetKeys,reason:"keys"}),this.setState(lf))}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:i,error:s}=this.state;let a=t;if(i){const c={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")a=n(c);else if(r)a=T.createElement(r,c);else if(o!==void 0)a=o;else throw s}return T.createElement(FN.Provider,{value:{didCatch:i,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}function zN(e=[],t=[]){return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function $N({children:e,onError:t}){return x.jsx(jN,{fallback:x.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t,children:e})}const UN={paragraph:"cnf:m-0",list:{ol:"cnf:list-decimal cnf:pl-4",ul:"cnf:list-disc cnf:pl-4"},text:{bold:"cnf:font-semibold",italic:"cnf:italic",underline:"cnf:underline",strikethrough:"cnf:line-through",code:"cnf:font-mono"},link:"cnf:text-blue-600 cnf:hover:text-blue-600 cnf:underline cnf:cursor-pointer"};function Tr(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Uu(e){let t=1,n=e.getParent();for(;n!=null;){if(Se(n)){const r=n.getParent();if(ve(r)){t++,n=r.getParent();continue}Tr(40)}return t}return t}function Bu(e){let t=e.getParent();ve(t)||Tr(40);let n=t;for(;n!==null;)n=n.getParent(),ve(n)&&(t=n);return t}function u1(e){let t=[];const n=e.getChildren().filter(Se);for(let r=0;r<n.length;r++){const o=n[r],i=o.getFirstChild();ve(i)?t=t.concat(u1(i)):t.push(o)}return t}function wn(e){return Se(e)&&ve(e.getFirstChild())}function Fg(e){return Zt().append(e)}function d1(e,t){return Se(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function jg(e){const t=Z();if(t!==null){let n=t.getNodes();if($(t)){const o=t.getStartEndPoints();o===null&&Tr(143);const[i]=o,s=i.getNode(),a=s.getParent();if(jt(s)){const c=s.getFirstChild();if(c)n=c.selectStart().getNodes();else{const l=Tt();s.append(l),n=l.select().getNodes()}}else if(d1(s,n)){const c=Bt(e);if(jt(a)){s.replace(c);const l=Zt();R(s)&&(l.setFormat(s.getFormatType()),l.setIndent(s.getIndent())),c.append(l)}else if(Se(s)){const l=s.getParentOrThrow();Uo(c,l.getChildren()),l.replace(c)}return}}const r=new Set;for(let o=0;o<n.length;o++){const i=n[o];if(R(i)&&i.isEmpty()&&!Se(i)&&!r.has(i.getKey())){zg(i,e);continue}let s=xx(i)?i.getParent():Se(i)&&i.isEmpty()?i:null;for(;s!=null;){const a=s.getKey();if(ve(s)){if(!r.has(a)){const c=Bt(e);Uo(c,s.getChildren()),s.replace(c),r.add(a)}break}{const c=s.getParent();if(jt(c)&&!r.has(a)){r.add(a),zg(s,e);break}s=c}}}}}function Uo(e,t){e.splice(e.getChildrenSize(),0,t)}function zg(e,t){if(ve(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),o=Zt();let i;if(Uo(o,e.getChildren()),ve(n)&&t===n.getListType())n.append(o),ve(r)&&t===r.getListType()&&(Uo(n,r.getChildren()),r.remove()),i=n;else if(ve(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(o),i=r;else{const s=Bt(t);s.append(o),e.replace(s),i=s}return o.setFormat(e.getFormatType()),o.setIndent(e.getIndent()),e.remove(),i}function lh(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&wn(n)&&wn(r)&&(lh(n.getFirstChild(),r.getFirstChild()),r.remove());const o=t.getChildren();o.length>0&&e.append(...o),t.remove()}function BN(){const e=Z();if($(e)){const t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(d1(r,n))t.add(Bu(r));else for(let o=0;o<n.length;o++){const i=n[o];if(xx(i)){const s=W6(i,ts);s!=null&&t.add(Bu(s))}}for(const o of t){let i=o;const s=u1(o);for(const a of s){const c=Tt().setTextStyle(e.style).setTextFormat(e.format);Uo(c,a.getChildren()),i.insertAfter(c),i=c,a.__key===e.anchor.key&&$o(e.anchor,Yt(fn(c,"next"))),a.__key===e.focus.key&&$o(e.focus,Yt(fn(c,"next"))),a.remove()}o.remove()}}}function h1(e){const t=e.getListType()!=="check";let n=e.getStart();for(const r of e.getChildren())Se(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),ve(r.getFirstChild())||n++)}function WN(e){const t=new Set;if(wn(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),o=e.getPreviousSibling();if(wn(r)&&wn(o)){const i=o.getFirstChild();if(ve(i)){i.append(e);const s=r.getFirstChild();ve(s)&&(Uo(i,s.getChildren()),r.remove(),t.add(r.getKey()))}}else if(wn(r)){const i=r.getFirstChild();if(ve(i)){const s=i.getFirstChild();s!==null&&s.insertBefore(e)}}else if(wn(o)){const i=o.getFirstChild();ve(i)&&i.append(e)}else if(ve(n)){const i=Zt().setTextFormat(e.getTextFormat()).setTextStyle(e.getTextStyle()),s=Bt(n.getListType()).setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle());i.append(s),s.append(e),o?o.insertAfter(i):r?r.insertBefore(i):n.append(i)}}function KN(e){if(wn(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(ve(n?n.getParent():void 0)&&Se(n)&&ve(t)){const r=t?t.getFirstChild():void 0,o=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(o))n.insertAfter(e),t.isEmpty()&&n.remove();else{const i=t.getListType(),s=Zt(),a=Bt(i);s.append(a),e.getPreviousSiblings().forEach(f=>a.append(f));const c=Zt(),l=Bt(i);c.append(l),Uo(l,e.getNextSiblings()),n.insertBefore(s),n.insertAfter(c),n.replace(e)}}}function HN(){const e=Z();if(!$(e)||!e.isCollapsed())return!1;const t=e.anchor.getNode();if(!Se(t)||t.getChildrenSize()!==0)return!1;const n=Bu(t),r=t.getParent();ve(r)||Tr(40);const o=r.getParent();let i;if(jt(o))i=Tt(),n.insertAfter(i);else{if(!Se(o))return!1;i=Zt(),o.insertAfter(i)}i.setTextStyle(e.style).setTextFormat(e.format).select();const s=t.getNextSiblings();if(s.length>0){const a=Bt(r.getListType());if(Se(i)){const c=Zt();c.append(a),i.insertAfter(c)}else i.insertAfter(a);a.append(...s)}return(function(a){let c=a;for(;c.getNextSibling()==null&&c.getPreviousSibling()==null;){const l=c.getParent();if(l==null||!Se(l)&&!ve(l))break;c=l}c.remove()})(t),!0}function xc(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}class ts extends Mn{constructor(n=1,r=void 0,o){super(o);D(this,"__value");D(this,"__checked");this.__value=n===void 0?1:n,this.__checked=r}$config(){return this.config("listitem",{$transform:n=>{if(n.__checked==null)return;const r=n.getParent();ve(r)&&r.getListType()!=="check"&&n.getChecked()!=null&&n.setChecked(void 0)},extends:Mn,importDOM:{li:()=>({conversion:qN,priority:0})}})}afterCloneFrom(n){super.afterCloneFrom(n),this.__value=n.__value,this.__checked=n.__checked}createDOM(n){const r=document.createElement("li");return this.updateListItemDOM(null,r,n),r}updateListItemDOM(n,r,o){(function(a,c,l){const f=c.getParent();!ve(f)||f.getListType()!=="check"||ve(c.getFirstChild())?(a.removeAttribute("role"),a.removeAttribute("tabIndex"),a.removeAttribute("aria-checked")):(a.setAttribute("role","checkbox"),a.setAttribute("tabIndex","-1"),l&&c.__checked===l.__checked||a.setAttribute("aria-checked",c.getChecked()?"true":"false"))})(r,this,n),r.value=this.__value,(function(a,c,l){const f=[],u=[],d=c.list,h=d?d.listitem:void 0;let p;if(d&&d.nested&&(p=d.nested.listitem),h!==void 0&&f.push(...xc(h)),d){const g=l.getParent(),m=ve(g)&&g.getListType()==="check",y=l.getChecked();m&&!y||u.push(d.listitemUnchecked),m&&y||u.push(d.listitemChecked),m&&f.push(y?d.listitemChecked:d.listitemUnchecked)}if(p!==void 0){const g=xc(p);l.getChildren().some(m=>ve(m))?f.push(...g):u.push(...g)}u.length>0&&qx(a,...u),f.length>0&&ih(a,...f)})(r,o.theme,this);const i=n?n.__style:"",s=this.__style;i!==s&&(s===""?r.removeAttribute("style"):r.style.cssText=s),(function(a,c,l){const f=pg(c.__textStyle);for(const u in f)a.style.setProperty(`--listitem-marker-${u}`,f[u]);if(l)for(const u in pg(l.__textStyle))u in f||a.style.removeProperty(`--listitem-marker-${u}`)})(r,this,n)}updateDOM(n,r,o){const i=r;return this.updateListItemDOM(n,i,o),!1}updateFromJSON(n){return super.updateFromJSON(n).setValue(n.value).setChecked(n.checked)}exportDOM(n){const r=this.createDOM(n._config),o=this.getFormatType();o&&(r.style.textAlign=o);const i=this.getDirection();return i&&(r.dir=i),{element:r}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...n){for(let r=0;r<n.length;r++){const o=n[r];if(R(o)&&this.canMergeWith(o)){const i=o.getChildren();this.append(...i),o.remove()}else super.append(o)}return this}replace(n,r){if(Se(n))return super.replace(n);this.setIndent(0);const o=this.getParentOrThrow();if(!ve(o))return n;if(o.__first===this.getKey())o.insertBefore(n);else if(o.__last===this.getKey())o.insertAfter(n);else{const i=Bt(o.getListType());let s=this.getNextSibling();for(;s;){const a=s;s=s.getNextSibling(),i.append(a)}o.insertAfter(n),n.insertAfter(i)}return r&&(R(n)||Tr(139),this.getChildren().forEach(i=>{n.append(i)})),this.remove(),o.getChildrenSize()===0&&o.remove(),n}insertAfter(n,r=!0){const o=this.getParentOrThrow();if(ve(o)||Tr(39),Se(n))return super.insertAfter(n,r);const i=this.getNextSiblings();if(o.insertAfter(n,r),i.length!==0){const s=Bt(o.getListType());i.forEach(a=>s.append(a)),n.insertAfter(s,r)}return n}remove(n){const r=this.getPreviousSibling(),o=this.getNextSibling();super.remove(n),r&&o&&wn(r)&&wn(o)&&(lh(r.getFirstChild(),o.getFirstChild()),o.remove())}insertNewAfter(n,r=!0){const o=Zt().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(o,r),o}collapseAtStart(n){const r=Tt();this.getChildren().forEach(a=>r.append(a));const o=this.getParentOrThrow(),i=o.getParentOrThrow(),s=Se(i);if(o.getChildrenSize()===1)if(s)o.remove(),i.select();else{o.insertBefore(r),o.remove();const a=n.anchor,c=n.focus,l=r.getKey();a.type==="element"&&a.getNode().is(this)&&a.set(l,a.offset,"element"),c.type==="element"&&c.getNode().is(this)&&c.set(l,c.offset,"element")}else o.insertBefore(r),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(n){const r=this.getWritable();return r.__value=n,r}getChecked(){const n=this.getLatest();let r;const o=this.getParent();return ve(o)&&(r=o.getListType()),r==="check"?!!n.__checked:void 0}setChecked(n){const r=this.getWritable();return r.__checked=n,r}toggleChecked(){const n=this.getWritable();return n.setChecked(!n.__checked)}getIndent(){const n=this.getParent();if(n===null||!this.isAttached())return this.getLatest().__indent;let r=n.getParentOrThrow(),o=0;for(;Se(r);)r=r.getParentOrThrow().getParentOrThrow(),o++;return o}setIndent(n){typeof n!="number"&&Tr(117),(n=Math.floor(n))>=0||Tr(199);let r=this.getIndent();for(;r!==n;)r<n?(WN(this),r++):(KN(this),r--);return this}canInsertAfter(n){return Se(n)}canReplaceWith(n){return Se(n)}canMergeWith(n){return Se(n)||Bd(n)}extractWithChild(n,r){if(!$(r))return!1;const o=r.anchor.getNode(),i=r.focus.getNode();return this.isParentOf(o)&&this.isParentOf(i)&&this.getTextContent().length===r.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Bt("bullet")}canMergeWhenEmpty(){return!0}}function qN(e){if(e.classList.contains("task-list-item")){for(const n of e.children)if(n.tagName==="INPUT")return $g(n)}if(e.classList.contains("joplin-checkbox")){for(const n of e.children)if(n.classList.contains("checkbox-wrapper")&&n.children.length>0&&n.children[0].tagName==="INPUT")return $g(n.children[0])}const t=e.getAttribute("aria-checked");return{node:Zt(t==="true"||t!=="false"&&void 0)}}function $g(e){return e.getAttribute("type")!=="checkbox"?{node:null}:{node:Zt(e.hasAttribute("checked"))}}function Zt(e){return Kr(new ts(void 0,e))}function Se(e){return e instanceof ts}class sa extends Mn{constructor(n="number",r=1,o){super(o);D(this,"__tag");D(this,"__start");D(this,"__listType");const i=YN[n]||n;this.__listType=i,this.__tag=i==="number"?"ol":"ul",this.__start=r}$config(){return this.config("list",{$transform:n=>{(function(r){const o=r.getNextSibling();ve(o)&&r.getListType()===o.getListType()&&lh(r,o)})(n),h1(n)},extends:Mn,importDOM:{ol:()=>({conversion:Bg,priority:0}),ul:()=>({conversion:Bg,priority:0})}})}afterCloneFrom(n){super.afterCloneFrom(n),this.__listType=n.__listType,this.__tag=n.__tag,this.__start=n.__start}getTag(){return this.getLatest().__tag}setListType(n){const r=this.getWritable();return r.__listType=n,r.__tag=n==="number"?"ol":"ul",r}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(n){const r=this.getWritable();return r.__start=n,r}createDOM(n,r){const o=this.__tag,i=document.createElement(o);return this.__start!==1&&i.setAttribute("start",String(this.__start)),i.__lexicalListType=this.__listType,Ug(i,n.theme,this),i}updateDOM(n,r,o){return n.__tag!==this.__tag||n.__listType!==this.__listType||(Ug(r,o.theme,this),!1)}updateFromJSON(n){return super.updateFromJSON(n).setListType(n.listType).setStart(n.start)}exportDOM(n){const r=this.createDOM(n._config,n);return pt(r)&&(this.__start!==1&&r.setAttribute("start",String(this.__start)),this.__listType==="check"&&r.setAttribute("__lexicalListType","check")),{element:r}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(n,r,o){let i=o;for(let s=0;s<o.length;s++){const a=o[s];Se(a)||(i===o&&(i=[...o]),i[s]=Zt().append(!R(a)||ve(a)||a.isInline()?a:rt(a.getTextContent())))}return super.splice(n,r,i)}extractWithChild(n){return Se(n)}}function Ug(e,t,n){const r=[],o=[],i=t.list;if(i!==void 0){const s=i[`${n.__tag}Depth`]||[],a=Uu(n)-1,c=a%s.length,l=s[c],f=i[n.__tag];let u;const d=i.nested,h=i.checklist;if(d!==void 0&&d.list&&(u=d.list),f!==void 0&&r.push(f),h!==void 0&&n.__listType==="check"&&r.push(h),l!==void 0){r.push(...xc(l));for(let p=0;p<s.length;p++)p!==c&&o.push(n.__tag+p)}if(u!==void 0){const p=xc(u);a>1?r.push(...p):o.push(...p)}}o.length>0&&qx(e,...o),r.length>0&&ih(e,...r)}function VN(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(Se(r)){t.push(r);const o=r.getChildren();o.length>1&&o.forEach(i=>{ve(i)&&t.push(Fg(i))})}else t.push(Fg(r))}return t}function Bg(e){const t=e.nodeName.toLowerCase();let n=null;return t==="ol"?n=Bt("number",e.start):t==="ul"&&(n=(function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(const o of r.childNodes)if(pt(o)&&o.hasAttribute("aria-checked"))return!0;return!1})(e)?Bt("check"):Bt("bullet")),{after:VN,node:n}}const YN={ol:"number",ul:"bullet"};function Bt(e="number",t=1){return Kr(new sa(e,t))}function ve(e){return e instanceof sa}const QN=he("UPDATE_LIST_START_COMMAND"),p1=he("INSERT_UNORDERED_LIST_COMMAND"),m1=he("INSERT_ORDERED_LIST_COMMAND"),Wu=he("REMOVE_LIST_COMMAND");function GN(e){return un(e.registerCommand(m1,()=>(jg("number"),!0),Gn),e.registerCommand(QN,t=>{const{listNodeKey:n,newStart:r}=t,o=Xe(n);return!!ve(o)&&(o.getListType()==="number"&&(o.setStart(r),h1(o)),!0)},Gn),e.registerCommand(p1,()=>(jg("bullet"),!0),Gn),e.registerCommand(Wu,()=>(BN(),!0),Gn),e.registerCommand(Ls,()=>HN(),Gn),e.registerNodeTransform(ts,t=>{const n=t.getFirstChild();if(n){if(X(n)){const r=n.getStyle(),o=n.getFormat();t.getTextStyle()!==r&&t.setTextStyle(r),t.getTextFormat()!==o&&t.setTextFormat(o)}}else{const r=Z();$(r)&&(r.style!==t.getTextStyle()||r.format!==t.getTextFormat())&&r.isCollapsed()&&t.is(r.anchor.getNode())&&t.setTextStyle(r.style).setTextFormat(r.format)}}),e.registerNodeTransform(Br,t=>{const n=t.getParent();if(Se(n)&&t.is(n.getFirstChild())){const r=t.getStyle(),o=t.getFormat();r===n.getTextStyle()&&o===n.getTextFormat()||n.setTextStyle(r).setTextFormat(o)}}))}function ZN(e){const t=n=>{const r=n.getParent();if(ve(n.getFirstChild())||!ve(r))return;const o=at(n,i=>Se(i)&&ve(i.getParent())&&Se(i.getPreviousSibling()));if(o===null&&n.getIndent()>0)n.setIndent(0);else if(Se(o)){const i=o.getPreviousSibling();if(Se(i)){const s=(function(c){let l=c,f=l.getFirstChild();for(;ve(f);){const u=f.getLastChild();if(!Se(u))break;l=u,f=l.getFirstChild()}return l})(i),a=s.getParent();if(ve(a)){const c=Uu(a);c+1<Uu(r)&&n.setIndent(c)}}}};return e.registerNodeTransform(sa,n=>{const r=[n];for(;r.length>0;){const o=r.shift();if(ve(o)){for(const i of o.getChildren())if(Se(i)){t(i);const s=i.getFirstChild();ve(s)&&r.push(s)}}}})}const JN=new Set(["http:","https:","mailto:","sms:","tel:"]);class Ho extends Mn{constructor(n="",r={},o){super(o);D(this,"__url");D(this,"__target");D(this,"__rel");D(this,"__title");const{target:i=null,rel:s=null,title:a=null}=r;this.__url=n,this.__target=i,this.__rel=s,this.__title=a}static getType(){return"link"}static clone(n){return new Ho(n.__url,{rel:n.__rel,target:n.__target,title:n.__title},n.__key)}createDOM(n){const r=document.createElement("a");return this.updateLinkDOM(null,r,n),ih(r,n.theme.link),r}updateLinkDOM(n,r,o){if(Nx(r)){n&&n.__url===this.__url||(r.href=this.sanitizeUrl(this.__url));for(const i of["target","rel","title"]){const s=`__${i}`,a=this[s];n&&n[s]===a||(a?r[i]=a:r.removeAttribute(i))}}}updateDOM(n,r,o){return this.updateLinkDOM(n,r,o),!1}static importDOM(){return{a:n=>({conversion:XN,priority:1})}}static importJSON(n){return Co().updateFromJSON(n)}updateFromJSON(n){return super.updateFromJSON(n).setURL(n.url).setRel(n.rel||null).setTarget(n.target||null).setTitle(n.title||null)}sanitizeUrl(n){n=Hg(n);try{const r=new URL(Hg(n));if(!JN.has(r.protocol))return"about:blank"}catch{return n}return n}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(n){const r=this.getWritable();return r.__url=n,r}getTarget(){return this.getLatest().__target}setTarget(n){const r=this.getWritable();return r.__target=n,r}getRel(){return this.getLatest().__rel}setRel(n){const r=this.getWritable();return r.__rel=n,r}getTitle(){return this.getLatest().__title}setTitle(n){const r=this.getWritable();return r.__title=n,r}insertNewAfter(n,r=!0){const o=Co(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(o,r),o}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(n,r,o){if(!$(r))return!1;const i=r.anchor.getNode(),s=r.focus.getNode();return this.isParentOf(i)&&this.isParentOf(s)&&r.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function XN(e){let t=null;if(Nx(e)){const n=e.textContent;(n!==null&&n!==""||e.children.length>0)&&(t=Co(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function Co(e="",t){return Kr(new Ho(e,t))}function ft(e){return e instanceof Ho}class il extends Ho{constructor(n="",r={},o){super(n,r,o);D(this,"__isUnlinked");this.__isUnlinked=r.isUnlinked!==void 0&&r.isUnlinked!==null&&r.isUnlinked}static getType(){return"autolink"}static clone(n){return new il(n.__url,{isUnlinked:n.__isUnlinked,rel:n.__rel,target:n.__target,title:n.__title},n.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(n){const r=this.getWritable();return r.__isUnlinked=n,r}createDOM(n){return this.__isUnlinked?document.createElement("span"):super.createDOM(n)}updateDOM(n,r,o){return super.updateDOM(n,r,o)||n.__isUnlinked!==this.__isUnlinked}static importJSON(n){return Wg().updateFromJSON(n)}updateFromJSON(n){return super.updateFromJSON(n).setIsUnlinked(n.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(n,r=!0){const o=this.getParentOrThrow().insertNewAfter(n,r);if(R(o)){const i=Wg(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return o.append(i),i}return null}}function Wg(e="",t){return Kr(new il(e,t))}function so(e){return e instanceof il}const $i=he("TOGGLE_LINK_COMMAND");function Kg(e,t){if(e.type==="element"){const n=e.getNode();return R(n)||(function(r,...o){const i=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",r);for(const a of o)s.append("v",a);throw i.search=s.toString(),Error(`Minified Lexical error #${r}; visit ${i.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(252),n.getChildren()[e.offset+t]||null}return null}function ff(e,t={}){let n;if(e&&typeof e=="object"){const{url:f,...u}=e;n=f,t={...u,...t}}else n=e;const{target:r,title:o}=t,i=t.rel===void 0?"noreferrer":t.rel,s=Z();if(s===null||!$(s)&&!ot(s))return;if(ot(s)){const f=s.getNodes();return f.length===0?void 0:void f.forEach(u=>{if(n===null){const d=at(u,h=>!so(h)&&ft(h));d&&(d.insertBefore(u),d.getChildren().length===0&&d.remove())}else{const d=at(u,h=>!so(h)&&ft(h));if(d)d.setURL(n),r!==void 0&&d.setTarget(r),i!==void 0&&d.setRel(i);else{const h=Co(n,{rel:i,target:r});u.insertBefore(h),h.append(u)}}})}const a=s.extract();if(n===null){const f=new Set;return void a.forEach(u=>{const d=u.getParent();if(ft(d)&&!so(d)){const h=d.getKey();if(f.has(h))return;(function(p,g){const m=new Set(g.filter(_=>p.isParentOf(_)).map(_=>_.getKey())),y=p.getChildren(),b=y.filter(_=>m.has(_.getKey()));if(b.length===y.length)return y.forEach(_=>p.insertBefore(_)),void p.remove();const v=y.findIndex(_=>m.has(_.getKey())),w=y.findLastIndex(_=>m.has(_.getKey())),A=v===0,k=w===y.length-1;if(A)b.forEach(_=>p.insertBefore(_));else if(k)for(let _=b.length-1;_>=0;_--)p.insertAfter(b[_]);else{for(let E=b.length-1;E>=0;E--)p.insertAfter(b[E]);const _=y.slice(w+1);if(_.length>0){const E=Co(p.getURL(),{rel:p.getRel(),target:p.getTarget(),title:p.getTitle()});b[b.length-1].insertAfter(E),_.forEach(N=>E.append(N))}}})(d,a),f.add(h)}})}const c=new Set,l=f=>{c.has(f.getKey())||(c.add(f.getKey()),f.setURL(n),r!==void 0&&f.setTarget(r),i!==void 0&&f.setRel(i),o!==void 0&&f.setTitle(o))};if(a.length===1){const f=a[0],u=at(f,ft);if(u!==null)return l(u)}(function(f){const u=Z();if(!$(u))return f();const d=Ri(u),h=d.isBackward(),p=Kg(d.anchor,h?-1:0),g=Kg(d.focus,h?0:-1);if(f(),p||g){const m=Z();if($(m)){const y=m.clone();if(p){const b=p.getParent();b&&y.anchor.set(b.getKey(),p.getIndexWithinParent()+(h?1:0),"element")}if(g){const b=g.getParent();b&&y.focus.set(b.getKey(),g.getIndexWithinParent()+(h?0:1),"element")}Pt(Ri(y))}}})(()=>{let f=null;for(const u of a){if(!u.isAttached())continue;const d=at(u,ft);if(d){l(d);continue}if(R(u)){if(!u.isInline())continue;if(ft(u)){if(!(so(u)||f!==null&&f.getParentOrThrow().isParentOf(u))){l(u),f=u;continue}for(const p of u.getChildren())u.insertBefore(p);u.remove();continue}}const h=u.getPreviousSibling();ft(h)&&h.is(f)?h.append(u):(f=Co(n,{rel:i,target:r,title:o}),u.insertAfter(f),f.append(u))}})}const e5=/^\+?[0-9\s()-]{5,}$/;function Hg(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:e5.test(e)?`tel:${e}`:`https://${e}`}function t5(e,t){return un($s(()=>e.registerCommand($i,n=>{const r=t.validateUrl.peek(),o=t.attributes.peek();if(n===null)return ff(null),!0;if(typeof n=="string")return!(r!==void 0&&!r(n))&&(ff(n,o),!0);{const{url:i,target:s,rel:a,title:c}=n;return ff(i,{...o,rel:a,target:s,title:c}),!0}},Gn)),$s(()=>{const n=t.validateUrl.value;if(!n)return;const r=t.attributes.value;return e.registerCommand(Gc,o=>{const i=Z();if(!$(i)||i.isCollapsed()||!Sr(o,ClipboardEvent)||o.clipboardData===null)return!1;const s=o.clipboardData.getData("text");return!!n(s)&&!i.getNodes().some(a=>R(a))&&(e.dispatchCommand($i,{...r,url:s}),o.preventDefault(),!0)},Gn)}))}function n5({commentType:e,onCommentTypeChange:t,isCommentTypeEditable:n=!0,actions:r,setIsLinkEditMode:o,onAddAttachments:i}){const[s]=ht(),[a,c]=T.useState({bold:!1,italic:!1,underline:!1,strikethrough:!1,code:!1}),[l,f]=T.useState(null),u=T.useRef(null),d=T.useRef(null),h=fh[e];T.useLayoutEffect(()=>s.registerUpdateListener(({editorState:b})=>{b.read(()=>{const v=Z();if(!$(v))return;c({bold:v.hasFormat("bold"),italic:v.hasFormat("italic"),underline:v.hasFormat("underline"),strikethrough:v.hasFormat("strikethrough"),code:v.hasFormat("code")});let w=v.anchor.getNode(),A=null;for(;w;){if(ve(w)){const k=w.getListType();A=k==="bullet"||k==="number"?k:null;break}if(Se(w)){w=w.getParent();continue}w=w.getParent()}f(A)})}),[s]);const p=b=>{s.dispatchCommand(kn,b)},g=()=>{l!=="bullet"?s.dispatchCommand(p1,void 0):s.dispatchCommand(Wu,void 0)},m=()=>{l!=="number"?s.dispatchCommand(m1,void 0):s.dispatchCommand(Wu,void 0)},y=()=>{s.update(()=>{const b=Z();if(!$(b))return;["bold","italic","underline","strikethrough","code"].forEach(w=>{b.hasFormat(w)&&s.dispatchCommand(kn,w)})})};return x.jsxs("div",{className:_e("cnf:flex cnf:items-center cnf:w-full",r?"cnf:justify-between":"cnf:justify-end"),children:[x.jsxs("div",{className:"cnf:flex cnf:items-center cnf:gap-1",children:[x.jsx(uu,{placement:"top-start",minWidth:"fit-content",title:"text formatting menu",trigger:x.jsx(je,{category:"link",size:"smallCollapse",color:"gray400",children:x.jsx(Ce,{icon:PS})}),children:x.jsxs("ul",{className:"cnf:flex cnf:items-start cnf:flex-col",children:[x.jsx("li",{className:"cnf:flex cnf:items-center cnf:w-full",children:x.jsxs("button",{type:"button",title:"Bold",onClick:()=>p("bold"),className:_e("cnf:cursor-pointer cnf:w-full cnf:h-full cnf:justify-start cnf:text-left cnf:p-2 cnf:hover:bg-gray-100",a.bold?"cnf:text-white cnf:bg-primary-600 cnf:hover:bg-primary-700":"cnf:text-gray-400 cnf:hover:text-gray-400"),children:[x.jsx(Ce,{icon:CS,className:"cnf:mr-2"}),"Bold"]})}),x.jsx("li",{className:"cnf:flex cnf:items-center cnf:w-full",children:x.jsxs("button",{type:"button",title:"Italic",onClick:()=>p("italic"),className:_e("cnf:cursor-pointer cnf:w-full cnf:h-full cnf:justify-start cnf:text-left cnf:p-2 cnf:hover:bg-gray-100",a.italic?"cnf:text-white cnf:bg-primary-600 cnf:hover:bg-primary-700":"cnf:text-gray-400 cnf:hover:text-gray-400"),children:[x.jsx(Ce,{icon:ES,className:"cnf:mr-2"}),"Italic"]})}),x.jsx("li",{className:"cnf:flex cnf:items-center cnf:w-full",children:x.jsxs("button",{type:"button",title:"Underline",onClick:()=>p("underline"),className:_e("cnf:cursor-pointer cnf:w-full cnf:h-full cnf:justify-start cnf:text-left cnf:p-2 cnf:hover:bg-gray-100",a.underline?"cnf:text-white cnf:bg-primary-600 cnf:hover:bg-primary-700":"cnf:text-gray-400 cnf:hover:text-gray-400"),children:[x.jsx(Ce,{icon:AS,className:"cnf:mr-2"}),"Underline"]})}),x.jsx("li",{className:"cnf:flex cnf:items-center cnf:w-full",children:x.jsxs("button",{type:"button",title:"Strikethrough",onClick:()=>p("strikethrough"),className:_e("cnf:cursor-pointer cnf:w-full cnf:h-full cnf:justify-start cnf:text-left cnf:p-2 cnf:hover:bg-gray-100",a.strikethrough?"cnf:text-white cnf:bg-primary-600 cnf:hover:bg-primary-700":"cnf:text-gray-400 cnf:hover:text-gray-400"),children:[x.jsx(Ce,{icon:wS,className:"cnf:mr-2"}),"Strikethrough"]})}),x.jsx("li",{className:"cnf:flex cnf:items-center cnf:w-full",children:x.jsxs("button",{type:"button",title:"Monospace",onClick:()=>p("code"),className:_e("cnf:cursor-pointer cnf:w-full cnf:h-full cnf:justify-start cnf:text-left cnf:p-2 cnf:hover:bg-gray-100",a.code?"cnf:text-white cnf:bg-primary-600 cnf:hover:bg-primary-700":"cnf:text-gray-400 cnf:hover:text-gray-400"),children:[x.jsx(Ce,{icon:TS,className:"cnf:mr-2"}),"Monospace"]})}),x.jsx("hr",{className:"cnf:w-full cnf:border-gray-200"}),x.jsx("li",{className:"cnf:flex cnf:items-center cnf:w-full",children:x.jsxs("button",{type:"button",title:"Clear formatting",onClick:y,className:"cnf:cursor-pointer cnf:w-full cnf:h-full cnf:justify-start cnf:text-left cnf:p-2 cnf:text-gray-400 cnf:hover:text-gray-400 cnf:hover:bg-gray-100",children:[x.jsx(Ce,{icon:_S,className:"cnf:mr-2"}),"Clear formatting"]})})]})}),x.jsx(je,{category:"link",size:"smallCollapse",color:"gray400",title:"Format bullet list",onClick:g,children:x.jsx(Ce,{icon:MS})}),x.jsx(je,{category:"link",size:"smallCollapse",color:"gray400",title:"Format numbered list",onClick:m,children:x.jsx(Ce,{icon:SS})}),x.jsx(je,{category:"link",size:"smallCollapse",color:"gray400",title:"Format link",onClick:()=>{o(!0),s.dispatchCommand($i,"https://")},children:x.jsx(Ce,{icon:OS})}),i&&x.jsxs(x.Fragment,{children:[x.jsx(je,{category:"link",size:"smallCollapse",color:"gray400",title:"Add image",className:"cnf:border-l-1 cnf:border-gray-200 cnf:rounded-none",onClick:()=>{var b;(b=u.current)==null||b.click()},children:x.jsx(Ce,{icon:kS})}),x.jsx(je,{category:"link",size:"smallCollapse",color:"gray400",title:"Add file",onClick:()=>{var b;(b=d.current)==null||b.click()},children:x.jsx(Ce,{icon:NS})})]}),n&&x.jsx(uu,{placement:"top-end",title:"comment type menu",trigger:x.jsx(je,{category:"link",size:"smallCollapse",className:`${h.iconColor} cnf:border-l-1 cnf:border-gray-200 cnf:rounded-none`,children:x.jsx(Ce,{icon:h.icon})}),children:x.jsx("ul",{className:"cnf:flex cnf:items-center cnf:justify-between cnf:gap-2 cnf:p-3",children:y1.map(b=>x.jsx("li",{children:x.jsx(je,{category:"link",size:"none",title:b.title,className:_e(b.color,e===b.type?b.color:"cnf:text-gray-400"),onClick:()=>t==null?void 0:t(b.type),children:x.jsx(Ce,{icon:b.icon})})},b.type))})})]}),r,x.jsx("input",{type:"file",hidden:!0,id:"image-input",multiple:!0,ref:u,accept:"image/*",onChange:b=>{const v=b.target.files;v&&(i==null||i(v))}}),x.jsx("input",{type:"file",hidden:!0,id:"file-input",multiple:!0,ref:d,accept:"*",onChange:b=>{const v=b.target.files;v&&(i==null||i(v))}})]})}function r5({hasStrictIndent:e=!1}){const[t]=ht();return T.useEffect(()=>{if(!t.hasNodes([sa,ts]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[t]),T.useEffect(()=>{if(e)return ZN(t)},[t,e]),(function(n){T.useEffect(()=>GN(n),[n])})(t),null}function o5({validateUrl:e,attributes:t}){const[n]=ht();return T.useEffect(()=>{if(!n.hasNodes([Ho]))throw new Error("LinkPlugin: LinkNode not registered on editor")}),T.useEffect(()=>t5(n,Gx({attributes:t,validateUrl:e})),[n,e,t]),null}const i5=new Set(["http:","https:","mailto:","sms:","tel:"]);function qg(e){try{const t=new URL(e);if(!i5.has(t.protocol))return"about:blank"}catch{return e}return e}function Vg(e,t,n,r=10,o=5){const i=n.parentElement;if(e===null||!i){t.style.opacity="0",t.style.transform="translate(-10000px, -10000px)";return}const s=t.getBoundingClientRect(),a=n.getBoundingClientRect(),c=i.getBoundingClientRect();let l=e.top-r,f=e.left-o;l<c.top&&(l+=s.height+e.height+r*2),f+s.width>c.right&&(f=c.right-s.width-o),l-=a.top,f-=a.left,t.style.opacity="1",t.style.transform=`translate(${f}px, ${l}px)`}function wc(e){const t=e.anchor,n=e.focus,r=e.anchor.getNode(),o=e.focus.getNode();return r===o?r:e.isBackward()?gg(n)?r:o:gg(t)?r:o}function s5({editor:e,isLink:t,setIsLink:n,anchorElem:r,isLinkEditMode:o,setIsLinkEditMode:i}){const s=T.useRef(null),[a,c]=T.useState(""),[l,f]=T.useState("https://"),[u,d]=T.useState(null),h=T.useCallback(()=>{var A,k;const m=Z();if($(m)){const _=wc(m),E=at(_,ft);E?c(E.getURL()):ft(_)?c(_.getURL()):c(""),o&&f(a)}else if(ot(m)){const _=m.getNodes();if(_.length>0){const E=_[0],N=E.getParent();ft(N)?c(N.getURL()):ft(E)?c(E.getURL()):c(""),o&&f(a)}}const y=s.current,b=en(e._window),v=document.activeElement;if(y===null)return;const w=e.getRootElement();if(m!==null&&w!==null&&e.isEditable()){let _;if(ot(m)){const E=m.getNodes();if(E.length>0){const N=e.getElementByKey(E[0].getKey());N&&(_=N.getBoundingClientRect())}}else b!==null&&w.contains(b.anchorNode)&&(_=(k=(A=b.focusNode)==null?void 0:A.parentElement)==null?void 0:k.getBoundingClientRect());_&&(_.y+=40,Vg(_,y,r)),d(m)}else(!v||v.className!=="link-input")&&(w!==null&&Vg(null,y,r),d(null),i(!1),c(""));return!0},[r,e,i,o,a]);T.useEffect(()=>{const m=r.parentElement,y=()=>{e.getEditorState().read(()=>{h()})};return window.addEventListener("resize",y),m&&m.addEventListener("scroll",y),()=>{window.removeEventListener("resize",y),m&&m.removeEventListener("scroll",y)}},[r.parentElement,e,h]),T.useEffect(()=>un(e.registerUpdateListener(({editorState:m})=>{m.read(()=>{h()})}),e.registerCommand(Qc,()=>(h(),!0),Gn),e.registerCommand(Rd,()=>t?(n(!1),!0):!1,o6)),[e,h,n,t]),T.useEffect(()=>{e.getEditorState().read(()=>{h()})},[e,h]),T.useEffect(()=>{const m=s.current;if(m===null)return;const y=b=>{!m.contains(b.relatedTarget)&&t&&(n(!1),i(!1))};return m.addEventListener("focusout",y),()=>{m.removeEventListener("focusout",y)}},[n,i,t]);const p=m=>{m.key==="Enter"?g(m):m.key==="Escape"&&(m.preventDefault(),i(!1))},g=m=>{m.preventDefault(),u!==null&&(a!==""&&e.update(()=>{e.dispatchCommand($i,qg(l));const y=Z();if($(y)){const b=wc(y).getParent();if(so(b)){const v=Co(b.getURL(),{rel:b.__rel,target:b.__target,title:b.__title});b.replace(v,!0)}}}),f("https://"),i(!1))};return x.jsx("div",{ref:s,className:"cnf:absolute cnf:flex cnf:top-0 cnf:left-0 cnf:shadow-lg cnf:bg-white cnf:z-10 cnf:rounded-sm cnf:w-full cnf:max-w-400",children:t?o?x.jsxs("div",{className:"cnf:flex cnf:justify-between cnf:w-full cnf:items-center cnf:p-2",children:[x.jsx(Ny,{containerClassName:"cnf:px-0 cnf:mr-2",autoFocus:!0,className:"cnf:mt-0",value:l,onChange:m=>{f(m.target.value)},onKeyDown:m=>{p(m)}}),x.jsxs("div",{className:"cnf:flex cnf:justify-center cnf:items-center cnf:gap-4",children:[x.jsx(je,{size:"none",category:"link",color:"gray400",tabIndex:0,onMouseDown:m=>m.preventDefault(),onClick:()=>{i(!1)},children:x.jsx(Ce,{icon:Dc})}),x.jsx(je,{size:"none",category:"link",color:"gray400",tabIndex:0,onMouseDown:m=>m.preventDefault(),onClick:g,children:x.jsx(Ce,{icon:zy})})]})]}):x.jsxs("div",{className:"cnf:flex cnf:justify-between cnf:w-full cnf:items-center cnf:p-2",children:[x.jsx("a",{href:qg(a),target:"_blank",rel:"noopener noreferrer",children:a}),x.jsxs("div",{className:"cnf:flex cnf:items-center cnf:gap-4",children:[x.jsx(je,{size:"none",category:"link",color:"gray400",tabIndex:0,onMouseDown:m=>m.preventDefault(),onClick:()=>{f(a),i(!0)},children:x.jsx(Ce,{icon:QC})}),x.jsx(je,{size:"none",category:"link",color:"gray400",tabIndex:0,onMouseDown:m=>m.preventDefault(),onClick:()=>e.dispatchCommand($i,null),children:x.jsx(Ce,{icon:sk})})]})]}):null})}function a5(e,t,n,r){const[o,i]=T.useState(e),[s,a]=T.useState(!1);return T.useEffect(()=>{function c(){const l=Z();if($(l)){const f=wc(l),u=at(f,ft),d=at(f,so);if(!(u||d)){a(!1);return}const h=l.getNodes().filter(p=>!xo(p)).find(p=>{const g=at(p,ft),m=at(p,so);return u&&!u.is(g)||g&&!g.is(u)||d&&!d.is(m)||m&&(!m.is(d)||m.getIsUnlinked())});a(!h)}else if(ot(l)){const f=l.getNodes();if(f.length===0){a(!1);return}const u=f[0],d=u.getParent();ft(d)||ft(u)?a(!0):a(!1)}}return un(e.registerUpdateListener(({editorState:l})=>{l.read(()=>{c()})}),e.registerCommand(Qc,(l,f)=>(c(),i(f),!1),hx),e.registerCommand(Md,l=>{const f=Z();if($(f)){const u=wc(f),d=at(u,ft);if(ft(d)&&(l.metaKey||l.ctrlKey))return window.open(d.getURL(),"_blank"),!0}return!1},Gn))},[e]),Nn.createPortal(x.jsx(s5,{editor:o,isLink:s,anchorElem:t,setIsLink:a,isLinkEditMode:n,setIsLinkEditMode:r}),t)}function c5({anchorElem:e=document.body,isLinkEditMode:t,setIsLinkEditMode:n}){const[r]=ht();return a5(r,e,t,n)}const l5=({url:e,onDelete:t})=>x.jsxs("div",{className:"cnf:relative",children:[x.jsx("img",{src:e,alt:"Thumbnail",width:75,height:75,className:"cnf:w-[75px] cnf:h-[75px] cnf:object-cover cnf:rounded-lg cnf:border cnf:border-gray-200"}),x.jsx(je,{size:"smallCollapse",title:"Delete attachment",onClick:t,className:"cnf:absolute cnf:top-1 cnf:left-1 cnf:w-[20px] cnf:h-[20px] cnf:rounded-full",color:"secondary",children:x.jsx(Ce,{icon:jy})})]}),f5=({onRemoveFile:e,type:t,label:n})=>{const r=t.toLowerCase(),o=Ib(r);return x.jsxs("div",{className:"cnf:relative cnf:flex cnf:items-center cnf:justify-center cnf:rounded cnf:border cnf:border-gray-200",children:[x.jsx(je,{size:"smallCollapse",color:"secondary",className:"cnf:absolute cnf:top-1 cnf:left-1 cnf:w-[20px] cnf:h-[20px] cnf:rounded-full",title:"Remove file",onClick:e,children:x.jsx(Ce,{icon:jy})}),x.jsxs("div",{className:"cnf:flex cnf:items-center cnf:justify-center cnf:mx-2",children:[x.jsx("span",{className:"cnf:text-primary-600 cnf:my-2",children:x.jsx(Ce,{icon:o,size:"3x",className:"cnf:text-primary-600"})}),x.jsx("span",{className:"cnf:font-bold cnf:p-2",children:n})]})]})},u5=({clearKey:e})=>{const[t]=ht(),n=T.useRef(e);return T.useEffect(()=>{n.current!==e&&(t.update(()=>{We().clear()}),n.current=e)},[e,t]),null},d5=({isOpen:e})=>{const[t]=ht(),n=T.useRef(!1);return T.useEffect(()=>{if(!e){n.current=!1;return}if(n.current)return;const r=()=>{const o=t.getRootElement();if(!o){requestAnimationFrame(r);return}n.current=!0;const i=window.scrollX,s=window.scrollY;try{o.focus({preventScroll:!0})}catch{o.focus()}requestAnimationFrame(()=>window.scrollTo(i,s)),setTimeout(()=>window.scrollTo(i,s),0)};r()},[t,e]),null},h5=({initialValue:e})=>{const[t]=ht(),n=T.useCallback((o,i)=>{const a=new DOMParser().parseFromString(i,"text/html");return t1(o,a)},[]),r=T.useRef(!1);return T.useEffect(()=>{!r.current&&e&&(t.update(()=>{We().clear(),sx(n(t,e))}),r.current=!0)},[t,e,n]),null},p5=({onChange:e})=>{const[t]=ht();return x.jsx(DN,{onChange:n=>{n.read(()=>{const r=n1(t,null);e(r)})}})},m5=({onAddAttachments:e})=>{const[t]=ht();return T.useEffect(()=>{if(!e)return;const n=t.getRootElement();if(!n)return;const r=o=>{const i=o.clipboardData;if(!i)return;const s=i.items;let a=!1;for(let c=0;c<s.length;c++){const l=s[c];if(l.kind==="file"&&l.type.startsWith("image/")){a=!0;break}}if(a){for(let c=0;c<s.length;c++){const l=s[c];if(l.kind==="file"&&l.type.startsWith("image/")){const f=l.getAsFile();if(f){const u=Date.now(),d=f.type.split("/")[1]||"png",h=`image_${u}.${d}`,p=new File([f],h,{type:f.type});e==null||e([p])}}}o.preventDefault(),o.stopPropagation()}};return n.addEventListener("paste",r,!0),()=>{n.removeEventListener("paste",r,!0)}},[t,e]),null},g5=({onSubmit:e})=>{const[t]=ht();return T.useEffect(()=>{if(e)return t.registerCommand(Fs,n=>n&&!n.shiftKey?(n.preventDefault(),e(),!0):!1,1)},[t,e]),null},y5=({setIsLinkEditMode:e})=>{const[t]=ht();return T.useEffect(()=>{const n=t.getRootElement();if(!n)return;const r=o=>{const i=o.metaKey||o.ctrlKey,s=o.key==="k"||o.key==="K";i&&s&&t.getEditorState().read(()=>{const a=Z();$(a)&&!a.isCollapsed()&&(o.preventDefault(),e(!0),t.dispatchCommand($i,"https://"))})};return n.addEventListener("keydown",r),()=>{n.removeEventListener("keydown",r)}},[t,e]),null};function g1({attachments:e,clearKey:t=0,inputFieldClassName:n="",containerClassName:r="",initialValue:o,onChange:i,commentType:s,onCommentTypeChange:a,isCommentTypeEditable:c=!0,actions:l,onAddAttachments:f,onRemoveAttachment:u,onSubmit:d,isOpen:h}){const p={namespace:"comment-editor",theme:UN,nodes:[sa,ts,Ho],onError:A=>{console.error(A)}},[g,m]=T.useState(null),[y,b]=T.useState(!1),v=A=>{A!==null&&m(A)},w=fh[s];return x.jsx("div",{className:r,children:x.jsxs(L6,{initialConfig:p,children:[x.jsxs("div",{className:"cnf:relative",children:[x.jsx(_N,{contentEditable:x.jsx("div",{ref:v,children:x.jsx(MN,{className:_e("cnf:p-3 cnf:outline-none cnf:border-0 cnf:w-full cnf:border-t cnf:border-gray-200 cnf:rounded-none cnf:border-l-3",w.bg,w.border,w.fontColor,n)})}),placeholder:x.jsx("div",{className:"cnf:absolute cnf:top-3 cnf:left-4 cnf:text-gray-400 cnf:pointer-events-none",children:"Type comment…"}),ErrorBoundary:$N}),x.jsx(r5,{}),x.jsx(o5,{}),g&&x.jsx(c5,{anchorElem:g,isLinkEditMode:y,setIsLinkEditMode:b}),x.jsx(NN,{}),x.jsx(h5,{initialValue:o}),x.jsx(p5,{onChange:i}),x.jsx(g5,{onSubmit:d}),x.jsx(y5,{setIsLinkEditMode:b}),x.jsx(u5,{clearKey:t}),x.jsx(m5,{onAddAttachments:f}),x.jsx(d5,{isOpen:h})]}),e&&e.length>0&&x.jsx("div",{className:"cnf:flex cnf:flex-wrap cnf:justify-start cnf:gap-2 cnf:p-4",children:e.map(A=>md(A.type)?x.jsx(l5,{url:A.url,onDelete:()=>u==null?void 0:u(A.originFile)},A.originFile.name):x.jsx(f5,{type:A.type,label:A.name,onRemoveFile:()=>u==null?void 0:u(A.originFile)},A.originFile.name))}),x.jsx("div",{className:"cnf:border-t cnf:border-gray-200 cnf:p-2 cnf:flex cnf:justify-end",children:x.jsx(n5,{commentType:s,onCommentTypeChange:a,isCommentTypeEditable:c,actions:l,setIsLinkEditMode:b,onAddAttachments:f})})]})})}const b5=({asset:e,onSetActiveSrc:t})=>x.jsxs("div",{className:"cnf:relative cnf:border cnf:border-gray-200 cnf:rounded-md cnf:h-[110px] cnf:w-full cnf:hover:border-primary-500",children:[x.jsx("img",{src:za(e),onClick:()=>t(za(e)),onKeyDown:n=>{n.key==="Enter"&&t(za(e))},alt:e.name,className:"cnf:w-full cnf:h-full cnf:object-cover cnf:rounded-md cnf:object-center cnf:cursor-zoom-in"}),(e==null?void 0:e.uploading)&&x.jsx("div",{className:"cnf:absolute cnf:bottom-2 cnf:w-full cnf:max-w-md cnf:mx-auto cnf:px-2",children:x.jsx("div",{className:"cnf:relative cnf:h-2 cnf:overflow-hidden cnf:rounded-full cnf:bg-gray-200",children:x.jsx("div",{className:"cnf:absolute cnf:left-0 cnf:top-0 cnf:h-full cnf:w-1/3 cnf:rounded-full cnf:bg-blue-500 cnf:animate-progress"})})})]}),v5=({asset:e})=>{var r,o;const t=((o=(r=e==null?void 0:e.mimeType)==null?void 0:r.split("/").pop())==null?void 0:o.toLowerCase())||"",n=Ib(t);return x.jsxs("div",{className:"cnf:flex cnf:gap-2",children:[(e==null?void 0:e.uploading)&&x.jsx("div",{className:"cnf:flex cnf:items-center cnf:justify-center",children:x.jsx("div",{className:"cnf:h-4 cnf:w-4 cnf:rounded-full cnf:border-2 cnf:border-gray-300 cnf:border-t-blue-500 cnf:animate-spin"})}),x.jsx(Ce,{icon:n,size:"lg",className:"cnf:text-primary-600"}),x.jsx("a",{href:za(e),className:"cnf:text-sm cnf:text-blue-600 cnf:underline",download:!0,target:"_blank",rel:"noopener noreferrer",children:e.name})]})},x5=({commentType:e=dt.INFO,author:t,username:n,comment:r,createdDate:o,onDelete:i,onEdit:s,hasAssets:a,taskAssets:c,taskVerified:l})=>{const u={[dt.INFO]:{bg:"cnf:bg-primary-100",border:"cnf:border-primary-200",icon:Dy,iconColor:"cnf:text-primary-600 cnf:hover:text-primary-600",text:"cnf:text-primary-900"},[dt.WARNING]:{bg:"cnf:bg-warning-100",border:"cnf:border-warning-200",icon:My,iconColor:"cnf:text-warning-600 cnf:hover:text-warning-600",text:"cnf:text-warning-900"},[dt.DANGER]:{bg:"cnf:bg-danger-100",border:"cnf:border-danger-200",icon:$y,iconColor:"cnf:text-danger-600 cnf:hover:text-danger-600",text:"cnf:text-danger-900"},[dt.SUCCESS]:{bg:"cnf:bg-success-100",border:"cnf:border-success-200",icon:Ly,iconColor:"cnf:text-success-600 cnf:hover:text-success-600",text:"cnf:text-success-900"}}[e],d=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(o||"")).replace(",",""),[h,p]=T.useState(!1),[g,m]=T.useState(zl(r)),[y,b]=T.useState(e),[v,w]=T.useState(""),A=()=>{p(!0)},k=()=>{const N=iu.sanitize(g);s(N,y),p(!1)},_=N=>{const P=iu.sanitize(g);b(N),s(P,N),p(!1)},E=()=>{p(!1)};return x.jsxs("div",{className:"cnf:flex cnf:items-start cnf:space-x-4 cnf:w-full",children:[x.jsx(KT,{alt:t}),x.jsxs("div",{className:"cnf:flex-1 cnf:min-w-0",children:[x.jsxs("div",{className:`cnf:border ${u.border} cnf:rounded-sm ${u.bg} cnf:shadow-sm cnf:flex cnf:flex-col cnf:items-start cnf:justify-between cnf:w-full`,children:[x.jsx("div",{className:"cnf:p-3 cnf:flex cnf:flex-col cnf:items-start cnf:justify-between cnf:w-full",children:x.jsxs("div",{className:"cnf:w-full",children:[x.jsxs("div",{className:"cnf:flex cnf:items-center cnf:mb-2 cnf:justify-between",children:[x.jsxs("div",{children:[x.jsx(Ce,{icon:u.icon,size:"lg",className:`cnf:mr-2 ${u.iconColor}`}),x.jsx("span",{className:`cnf:font-semibold cnf:text-sm ${u.text}`,children:t})]}),x.jsx(qT,{commentType:e,taskVerified:l,isUsernameAuthor:n.trim()===t.trim(),onEdit:A,onSaveCommentType:_,onDelete:i})]}),h?x.jsx(g1,{inputFieldClassName:"cnf:bg-white cnf:border-0 cnf:rounded-sm",containerClassName:"cnf:bg-white cnf:border-0 cnf:rounded-sm",onChange:m,commentType:e,isCommentTypeEditable:!1,initialValue:zl(r),actions:x.jsxs("div",{className:"cnf:flex cnf:items-center cnf:gap-2",children:[x.jsx(je,{category:"outline",size:"smallCollapse",color:"secondary",onClick:E,title:"Cancel edit",children:"Cancel"}),x.jsx(je,{category:"solid",size:"smallCollapse",color:"primary",onClick:k,title:"Save edit",disabled:$a(g),children:"Save"})]})}):x.jsx("div",{className:`cnf:text-sm ${u.text}`,dangerouslySetInnerHTML:{__html:zl(r)}})]})}),a&&c&&(c==null?void 0:c.length)>0&&x.jsx("div",{className:`${u.border} cnf:border-t cnf:w-full cnf:p-2 cnf:flex cnf:gap-2 cnf:flex-wrap`,children:c.map(N=>x.jsx(T.Fragment,{children:md(N.mimeType)?x.jsx(b5,{asset:N,onSetActiveSrc:w}):x.jsx(v5,{asset:N})},N.assetId))})]}),x.jsxs("div",{className:"cnf:flex cnf:gap-2 cnf:my-1",children:[o&&x.jsx("time",{dateTime:o,className:"cnf:text-xs cnf:text-gray-500 cnf:opacity-60",children:d}),l&&x.jsxs("span",{className:"cnf:text-xs cnf:text-success-600 cnf:font-semibold cnf:flex cnf:items-center cnf:gap-1",children:[x.jsx(Ce,{icon:Ry}),"Comment Required"]})]})]}),x.jsx(_T,{plugins:[BT],open:!!v,zoom:{maxZoomPixelRatio:2},close:()=>w(""),styles:{root:{zIndex:9999999999}},carousel:{finite:!0,preload:0},controller:{closeOnBackdropClick:!0},slides:[{src:v}]})]})},fh={[dt.INFO]:{icon:lk,bg:"cnf:bg-primary-100",border:"cnf:border-l-primary-500",iconColor:"cnf:text-primary-600 cnf:hover:text-primary-700",fontColor:"cnf:text-primary-900"},[dt.WARNING]:{icon:GC,bg:"cnf:bg-warning-100",border:"cnf:border-l-warning-500",iconColor:"cnf:text-warning-600 cnf:hover:text-warning-700",fontColor:"cnf:text-warning-900"},[dt.DANGER]:{icon:dk,bg:"cnf:bg-danger-100",border:"cnf:border-l-danger-500",iconColor:"cnf:text-danger-600 cnf:hover:text-danger-700",fontColor:"cnf:text-danger-900"},[dt.SUCCESS]:{icon:Ry,bg:"cnf:bg-success-100",border:"cnf:border-l-success-500",iconColor:"cnf:text-success-600 cnf:hover:text-success-700",fontColor:"cnf:text-success-900"}},y1=Object.entries(fh).map(([e,t])=>({type:e,icon:t.icon,color:t.iconColor,title:`Change comment type to ${e}`})),w5=({comments:e,onClose:t,isOpen:n,taskName:r,taskInstanceId:o,isLoading:i,playbookInstanceId:s,taskVerification:a})=>{const[c,l]=T.useState(""),[f,u]=T.useState(dt.INFO),[d,h]=T.useState(0),[p,g]=T.useState([]),m=T.useRef(null),{username:y}=b1(),{manageComment:b}=h4({playbookInstanceId:s}),v=()=>{const P=p.length,W=p.some(z=>!md(z.mimeType))?"Attachment":"Image",j=P>1?"s":"";return`<p class="cnf:m-0"><span style="white-space: pre-wrap;">${W}${j} added.</span></p>`},w=P=>{const I=Array.from(P).map((W,j)=>o4(W,p.length+j+1));g(W=>[...W,...I])},A=P=>{g(I=>I.filter(W=>W.originFile!==P))},k=P=>{u(P)},_=async()=>{if(!p.length&&$a(c)||!o)return;p.length>0&&g([]);const P=iu.sanitize(c);l(""),h(I=>I+1),await b({action:"add",comment:p.length>0&&$a(c)?v():P,username:y||"",commentType:f,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,hasAssets:p.length>0,taskInstanceId:o,taskVerified:a,attachments:p}),u(dt.INFO)},E=async P=>{o&&await b({username:y||"",action:"delete",taskVerified:!1,taskInstanceId:o,commentId:P})},N=async({commentId:P,comment:I,commentType:W,hasAssets:j,isAlreadyVerified:z})=>{o&&await b({action:"edit",username:y||"",...I&&{comment:I},taskInstanceId:o,commentId:P,hasAssets:j,taskVerified:z,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,commentType:W})};return T.useLayoutEffect(()=>{m.current&&n&&!i&&e.length>0&&(m.current.scrollTop=m.current.scrollHeight)},[n,i,e.length]),x.jsxs("div",{className:_e("cnf:transition-all cnf:duration-300 cnf:fixed cnf:bg-white cnf:right-0 cnf:bottom-0 cnf:h-[100vh] cnf:z-[9999999998] cnf:flex cnf:flex-col cnf:min-w-[270px] cnf:max-w-[420px] cnf:w-[calc(100vw-1rem)] cnf:border cnf:border-gray-200 cnf:rounded-t-sm cnf:overflow-hidden",n?"cnf:translate-y-0 cnf:opacity-100":"cnf:translate-y-full cnf:opacity-0 cnf:pointer-events-none"),children:[x.jsxs("div",{className:"cnf:flex cnf:items-center cnf:justify-between cnf:gap-2 cnf:border-b cnf:border-gray-200 cnf:px-2 cnf:py-4 cnf:w-full",children:[x.jsx("h6",{className:"cnf:font-semibold cnf:text-gray-900 cnf:truncate cnf:max-w-[300px]",children:r}),x.jsx(je,{color:"grayLight",size:"smallCollapse",rounded:"none",title:"Close comment box",onClick:t,children:x.jsx(Ce,{icon:Dc,className:"cnf:size-4 cnf:text-gray-300"})})]}),x.jsxs("div",{ref:m,className:"cnf:flex cnf:flex-col cnf:flex-1 cnf:overflow-y-auto",children:[x.jsxs("div",{className:"cnf:flex cnf:flex-col cnf:justify-end cnf:flex-1 cnf:gap-4 cnf:p-4 cnf:pb-[102px]",children:[i&&x.jsx("div",{className:"cnf:flex cnf:flex-col cnf:gap-3",children:[1,2,3].map(P=>x.jsx("div",{className:"cnf:h-16 cnf:animate-pulse cnf:rounded-lg cnf:bg-gray-100"},P))}),(e==null?void 0:e.length)>0&&!i&&e.map(P=>x.jsx(x5,{username:y||"",onDelete:()=>E(P.commentId),onEdit:(I,W)=>N({commentId:P.commentId,comment:I,commentType:W,hasAssets:P.hasAssets,isAlreadyVerified:P.taskVerified}),...P},P.commentId)),(e==null?void 0:e.length)===0&&!i&&x.jsxs("div",{className:"cnf:flex cnf:flex-1 cnf:flex-col cnf:items-center cnf:justify-end cnf:gap-3 cnf:text-center cnf:mb-1",children:[x.jsx("img",{src:n4,className:"cnf:opacity-70",alt:"Empty"}),x.jsx("p",{className:"cnf:text-gray-400",children:"There is no discussion in this Task."})]})]}),x.jsx(g1,{attachments:p,onChange:l,containerClassName:"cnf:fixed cnf:bottom-0 cnf:left-0 cnf:right-0 cnf:bg-white",clearKey:d,commentType:f,onCommentTypeChange:k,onAddAttachments:w,onRemoveAttachment:A,onSubmit:_,isOpen:n,actions:x.jsx(je,{category:"link",size:"normalCollapse",title:"Send comment",onClick:_,disabled:$a(c)&&p.length===0,children:x.jsx(Ce,{icon:IS})})})]})]})},Ku=T.createContext({comments:[],openTaskDetails:null,username:void 0,setOpenTaskDetails:()=>{},prefetchQuery:e=>{}}),b1=()=>{if(!T.useContext(Ku))throw new Error("useCommentContext must be used within a CommentProvider");return T.useContext(Ku)},A5=({playbookInstanceId:e,children:t,username:n})=>{const[r,o]=T.useState({taskInstanceId:null,taskName:"",taskVerification:!1}),{taskInstanceId:i,taskName:s,taskVerification:a}=r||{taskInstanceId:null,taskName:"",taskVerification:!1},{comments:c,isLoading:l,prefetchQuery:f}=l4({taskInstanceId:i||0,enabled:i!==null,username:n});return x.jsxs(Ku.Provider,{value:{comments:c,openTaskDetails:r,setOpenTaskDetails:o,prefetchQuery:f,username:n},children:[t,Nn.createPortal(x.jsxs("div",{id:"cnfdnc-comment-box-root",children:[x.jsx("style",{children:kc}),x.jsx("div",{className:"confidence-playbook",children:x.jsx(w5,{playbookInstanceId:e,comments:c,onClose:()=>o(null),isOpen:!!i,taskName:s,taskInstanceId:i,isLoading:l,taskVerification:a})})]}),LS)]})},C5={[Be.OPEN]:"cnf:border-[#C1C5C8] cnf:bg-[#F0F1F2]",[Be.IN_PROGRESS]:"cnf:bg-[#E6F2FF] cnf:border-[#94C8FF]",[Be.IN_REVIEW]:"cnf:bg-[#EAF6EC] cnf:border-[#A5DAB1]",[Be.COMPLETED]:"cnf:bg-[#EAF6EC] cnf:border-[#A5DAB1]"},Bn={PHOTO:"photo",SCREENSHOT:"screenshot",COMMENT:"comment",NO_VERIFICATION:null},k5=({task:e,step:t,playbookType:n,onButtonClick:r,viewMode:o="card",canStart:i=!1,isExpanded:s=!1,toggleExpanded:a,playbookId:c,taskStyle:l,listStickyTopBase:f})=>{const[u,d]=T.useState(!1),{taskDetails:h,prefetchQuery:p}=DE({taskId:e.taskId,playbookId:c,enabled:s}),{setOpenTaskDetails:g,prefetchQuery:m}=b1(),{buttons:y}=Bw({taskStatus:e.workflowStatus,canStart:i}),b=T.useMemo(()=>e.imageRequired===0?Bn.NO_VERIFICATION:e.imageRequired===1?Bn.SCREENSHOT:e.imageRequired===2?Bn.PHOTO:e.imageRequired===4?Bn.COMMENT:null,[e.imageRequired]),v=async w=>{try{d(!0),await r(w)}finally{d(!1)}};if(o==="list"){const w=T.useMemo(()=>e.workflowStatus===Be.COMPLETED?"success":e.workflowStatus===Be.IN_PROGRESS?"primary":"default",[e.workflowStatus]),A=T.useMemo(()=>{const k=[];return y.forEach(_=>{_==="START"&&k.push({id:"START",color:"primary",action:"Start",to:Be.IN_PROGRESS}),_==="COMPLETE"&&(!e.taskVerified&&b===Bn.COMMENT&&k.push({id:"ADD_COMMENT",color:"danger",action:"Add Comment",to:"Required"}),k.push({id:"COMPLETE",color:"success",action:"Complete",to:Be.COMPLETED,disabled:!e.taskVerified&&b===Bn.COMMENT}))}),k},[y,b,e.taskVerified]);return x.jsxs("div",{className:_e("cnf:flex cnf:flex-col"),children:[x.jsxs("div",{className:_e("cnf:flex cnf:items-center cnf:gap-3 cnf:p-2 cnf:border-gray-200",e.sequenceOrder>0&&"cnf:border-t",s&&"cnf:bg-white cnf:rounded-md cnf:border cnf:border-t-none cnf:shadow-sm cnf:sticky"),style:{top:s?f:0},children:[x.jsx("div",{className:"cnf:text-gray-200 cnf:text-base",children:e.sequenceOrder+1}),x.jsx("div",{onClick:()=>{a==null||a(!s)},onMouseOver:p,className:_e("cnf:flex-1 cnf:truncate cnf:cursor-pointer",s&&"cnf:font-medium",e.workflowStatus===Be.COMPLETED&&"cnf:text-secondary-400 cnf:line-through"),style:{color:e.workflowStatus===Be.IN_PROGRESS&&(l==null?void 0:l.titleColor)||"#1C232D"},children:e.taskInstanceName}),x.jsx(hS,{taskVerified:e.taskVerified,verificationType:b,title:e.workflowStatus,variant:w,transitions:A,onClick:k=>{if(k===fi.ADD_COMMENT){g({taskInstanceId:e.taskInstanceId,taskName:e.taskInstanceName,taskVerification:!0});return}r(k)}}),x.jsx(Yp,{onMouseOver:()=>m(e.taskInstanceId),commentsCount:(e==null?void 0:e.numberOfComments)||0,commentType:(e==null?void 0:e.recentCommentType)||dt.INFO,onClick:()=>g({taskInstanceId:e.taskInstanceId,taskName:e.taskInstanceName,taskVerification:!1})})]}),(h==null?void 0:h.description)&&x.jsx("div",{className:_e(!s&&"cnf:hidden","cnf:border-gray-200 cnf:border cnf:p-2 cnf:mx-4 cnf:mb-4 cnf:border-t-none cnf:-mt-[1px] cnf:bg-gray-100 cnf:rounded-b-md"),children:x.jsx(Vp,{description:(h==null?void 0:h.description)||""})})]})}return x.jsxs("div",{className:Es("cnf:flex cnf:items-stretch cnf:rounded-sm cnf:overflow-hidden cnf:border",C5[e.workflowStatus]),children:[x.jsx(yS,{playbookType:n,status:e.workflowStatus,step:t}),x.jsxs("div",{className:"cnf:flex cnf:w-full cnf:flex-col cnf:overflow-x-hidden cnf:flex-1 cnf:p-2",children:[n==="Sequential"&&x.jsx("div",{className:"cnf:-mb-3 cnf:self-end cnf:pr-2 cnf:pt-2",children:x.jsx(vS,{status:e.workflowStatus})}),x.jsxs("div",{className:"cnf:space-y-2 cnf:divide-y cnf:divide-black/10 cnf:flex cnf:flex-col cnf:flex-1",children:[x.jsx("div",{className:_e("cnf:text-lg cnf:font-medium cnf:flex-1 cnf:pb-1"),style:{color:e.workflowStatus==="Completed"?"#1C232D":(l==null?void 0:l.titleColor)||"#1C232D"},children:e.taskInstanceName}),b?x.jsxs("div",{className:"cnf:flex cnf:items-center cnf:gap-2 cnf:text-sm cnf:pb-2",children:[x.jsx(Ce,{icon:Iy,className:"cnf:size-4"}),x.jsxs("div",{children:[x.jsx("span",{className:"cnf:font-medium",children:b===Bn.PHOTO?"Photo":b===Bn.SCREENSHOT?"Screenshot":"Comment"})," ","required"]})]}):x.jsx(x.Fragment,{})]}),(h==null?void 0:h.description)&&x.jsx("div",{className:_e(!s&&"cnf:hidden"),children:x.jsx(Vp,{description:(h==null?void 0:h.description)||""})}),(y.length>0||e.hasDescription)&&x.jsxs("div",{className:"cnf:flex cnf:items-center cnf:justify-end cnf:gap-4 cnf:border-t cnf:border-black/10 cnf:pt-2",children:[x.jsx("div",{className:"cnf:flex-1",children:x.jsx(FE,{buttons:y,onButtonClick:v,disabled:u})}),x.jsx(Yp,{onMouseOver:()=>m(e.taskInstanceId),commentsCount:(e==null?void 0:e.numberOfComments)||0,commentType:(e==null?void 0:e.recentCommentType)||dt.INFO,onClick:()=>g({taskInstanceId:e.taskInstanceId,taskName:e.taskInstanceName,taskVerification:!1})}),a&&x.jsx(je,{size:"smallCollapse",onMouseOver:p,category:"link",onClick:()=>{a()},title:s?"Hide task description":"Show task description",children:x.jsx(Ce,{icon:Fy,className:Es("cnf:cursor-pointer cnf:text-[#0069D9]",s?"cnf:rotate-180":"")})})]})]})]})},v1=T.forwardRef(({title:e,className:t,playbookStyle:n,...r},o)=>{var i,s,a;return x.jsx("div",{ref:o,className:_e("cnf:border-b cnf:border-gray-200 cnf:flex cnf:items-center",t),style:{backgroundColor:((i=n==null?void 0:n.whiteLabel)==null?void 0:i.titleBackgroundColor)||"#f8f9fa"},...r,children:x.jsx("div",{className:_e("cnf:text-xl cnf:min-h-16 cnf:p-4 cnf:font-medium cnf:flex-1",{"cnf:text-dark":!((s=n==null?void 0:n.whiteLabel)!=null&&s.titleTextColor)}),style:{color:(a=n==null?void 0:n.whiteLabel)==null?void 0:a.titleTextColor},children:e})})});v1.displayName="PlaybookHeader";const _5=kc.replace(/:root,\s*:host/g,":host"),E5=({playbookInstanceId:e,playbookMode:t,playbookStyle:n,defaultExpanded:r=!0})=>{const{playbook:o,actions:i}=$w(e);if(!o)return x.jsx("div",{});const s=async(a,c)=>{var l;if(a===fi.COMPLETE){const f=(l=o.tasks.find(u=>u.taskInstanceId===c))==null?void 0:l.sequenceOrder;if(f===void 0){console.error("Task not found in playbook");return}return i.completeTask(c,f)}if(a===fi.START)return i.startTask(c)};return x.jsx("div",{className:"confidence-playbook",children:x.jsx(x1,{playbook:o,playbookMode:t,onTaskButtonClick:s,playbookStyle:n,defaultExpanded:r})})},S5=({className:e,children:t,numberOfTasks:n,playbookMode:r})=>x.jsxs("div",{className:_e("cnf:w-full cnf:p-4",e),children:[n&&x.jsxs("div",{className:_e(r==="card"&&"cnf:mb-4"),children:[x.jsx("span",{className:"cnf:font-medium",children:"Tasks"})," (",n,")"]}),x.jsx("div",{className:_e(r==="card"&&"cnf:space-y-4"),children:t})]}),x1=({playbook:e,playbookMode:t,onTaskButtonClick:n,playbookStyle:r,defaultExpanded:o=!0})=>{var y,b,v,w,A;const{playbookInstanceName:i,tasks:s}=e,a=T.useRef(null),[c,l]=T.useState(0),[f,u]=T.useState(()=>{const k=M2(e.playbookInstanceId);return k!==null?k:o}),d=()=>{u(k=>{const _=!k;return P2(e.playbookInstanceId,_),_})},{isTaskExpanded:h,toggleTaskExpanded:p,isAtLeastOneTaskExpanded:g}=T0(e.playbookInstanceId,{onTaskExpanded:()=>{var k;l(((k=a.current)==null?void 0:k.offsetHeight)||0)}});T.useEffect(()=>{if(g){if(!a.current)throw new Error("Playbook header ref is not set");new ResizeObserver(_=>{var E;for(const N of _)N.contentRect&&l(((E=a.current)==null?void 0:E.offsetHeight)||0)}).observe(a.current)}return()=>{a.current&&new ResizeObserver(()=>{}).unobserve(a.current)}},[g]);const m=T.useMemo(()=>{const k=s.filter(_=>_.workflowStatus===Be.COMPLETED).sort((_,E)=>E.sequenceOrder-_.sequenceOrder)[0];return k?k.sequenceOrder+1:0},[s]);return x.jsxs("div",{className:_e(!(r!=null&&r.overlay)&&"cnf:min-h-screen",(r==null?void 0:r.overlay)&&"cnf:fixed cnf:bottom-0 cnf:z-[9999999997] cnf:flex","cnf:transition-all cnf:duration-300 cnf:ease-in-out "),...(r==null?void 0:r.overlay)&&{style:{width:"100%",maxWidth:f?((y=r.overlay.size)==null?void 0:y.width)||450:"2.25rem",height:((b=r.overlay.size)==null?void 0:b.height)||"calc(100vh - 4rem)",maxHeight:"calc(100vh - 4rem)",right:((v=r.overlay.offset)==null?void 0:v.right)!==void 0?r.overlay.offset.right:r.overlay.position==="right"?32:void 0,left:((w=r.overlay.offset)==null?void 0:w.left)!==void 0?r.overlay.offset.left:r.overlay.position==="left"?32:void 0}},children:[(r==null?void 0:r.overlay)&&x.jsx("div",{onClick:d,className:_e("cnf:size-9 cnf:relative cnf:p-1 cnf:top-3 cnf:z-[9999999997] cnf:border-none cnf:rounded-l-sm cnf:cursor-pointer"),style:{backgroundColor:((A=r==null?void 0:r.whiteLabel)==null?void 0:A.primaryColor)||"#007BFF",boxShadow:"0px 3px 3px 0px #00000040"},children:x.jsx("img",{src:h0,alt:"Confidence Logo",className:"cnf:w-full cnf:h-full cnf:object-contain"})}),x.jsxs("div",{className:_e("cnf:flex cnf:flex-col cnf:flex-1 cnf:bg-gray-50",(r==null?void 0:r.overlay)&&"cnf:border cnf:border-gray-200 cnf:shadow-2xl cnf:rounded-t-sm cnf:overflow-y-auto"),children:[x.jsx(v1,{title:i,className:_e("cnf:top-0 cnf:sticky cnf:z-2"),playbookStyle:r,ref:a}),x.jsx(S5,{playbookMode:t,numberOfTasks:e.numberofTasks,children:s.map((k,_)=>{var E;return x.jsx(k5,{task:k,step:_+1,viewMode:t,playbookId:e.playbookId,canStart:k.sequenceOrder===m,onButtonClick:N=>n(N,k.taskInstanceId),playbookType:"Non-Sequential",taskStyle:{titleColor:(E=r==null?void 0:r.whiteLabel)==null?void 0:E.primaryColor},isExpanded:h(k.taskInstanceId),toggleExpanded:()=>p(k.taskInstanceId),listStickyTopBase:c||104},k.taskId)})})]})]})},T5=({email:e,playbookId:t,playbookMode:n,playbookStyle:r,bank:o="public-sdk",timezone:i="America/Los_Angeles",persistKey:s,defaultExpanded:a=!0})=>{const[c,l]=T.useState(null);return T.useEffect(()=>{(async()=>{const f=q0(t,s);if(f&&f.email===e){l(f.playbookInstanceId);return}const{playbookInstanceId:u,errorCode:d,details:h,message:p}=await N0({bank:o,email:e,timezone:i,playbookUid:t})||{};if(d)throw new Error(`Error initiating playbook: ${p} (Code: ${d}) - Details: ${h}`);if(!u)throw new Error("No playbook instance ID returned from initiation");H0(t,u,e,s),l(u)})()},[]),c?x.jsx(Hr,{playbookInstanceId:c,playbookMode:n,playbookStyle:r,username:e,defaultExpanded:a}):null},N5=({playbookId:e,playbookMode:t="list",playbookStyle:n,btnLabel:r="Start Playbook",btnColor:o="primary",persistKey:i,defaultExpanded:s=!0})=>{const[a,c]=T.useState(null),[l,f]=T.useState(void 0);return T.useEffect(()=>{const u=q0(e,i);u&&(c(u.playbookInstanceId),f(u.email))},[e,i]),x.jsxs(x.Fragment,{children:[x.jsxs(Ac.div,{children:[x.jsx(WC,{playbookId:e,disabled:!!a,onInitiated:(u,d)=>{H0(e,u,d,i),c(u),f(d)},btnLabel:r,btnColor:o}),x.jsx("style",{type:"text/css",children:_5})]}),a&&x.jsx(Hr,{playbookInstanceId:a,playbookMode:t,playbookStyle:n,username:l,defaultExpanded:s})]})},Hr=({playbookInstanceId:e,playbookMode:t,playbookStyle:n,username:r,defaultExpanded:o=!0})=>(console.log("Starting ConfidencePlaybook with instance ID:",e,r),x.jsx(E0,{children:x.jsx(A5,{playbookInstanceId:e,username:r,children:x.jsx(E5,{playbookInstanceId:e,playbookMode:t,playbookStyle:n,defaultExpanded:o})})}));Hr.Context=E0;Hr.View=x1;Hr.AutoInstantiated=T5;Hr.WithInstantiateButton=N5;const w1=kc.replace(/:root,\s*:host/g,":host"),A1=e=>Nn.createPortal(x.jsxs(Ac.div,{style:{position:"relative",zIndex:2147483646},children:[x.jsx("style",{children:w1}),x.jsx(Hr,{...e})]}),document.body),O5=e=>Nn.createPortal(x.jsxs(Ac.div,{style:{position:"relative",zIndex:2147483646},children:[x.jsx("style",{children:w1}),x.jsx(Hr.AutoInstantiated,{...e})]}),document.body);A1.AutoInstantiated=O5;exports.ConfidencePlaybook=A1;
|
|
606
|
+
`?l.insertParagraph():f===" "?l.insertNodes([ta()]):l.insertText(f)}}}else t.insertRawText(s)}function Eg(e,t,n){e.dispatchCommand(x3,{nodes:t,selection:n})||(n.insertNodes(t),(function(r){if($(r)&&r.isCollapsed()){const o=r.anchor;let i=null;const s=nr(o,"previous");if(s)if(Or(s))i=s.origin;else{const a=Fr(s,fn(We(),"next").getFlipped());for(const c of a){if(X(c.origin)){i=c.origin;break}if(R(c.origin)&&!c.origin.isInline())break}}if(i&&X(i)){const a=i.getFormat(),c=i.getStyle();r.format===a&&r.style===c||(r.format=a,r.style=c,r.dirty=!0)}}})(n))}function s1(e,t,n,r=[]){let o=t===null||n.isSelected(t);const i=R(n)&&n.excludeFromCopy("html");let s=n;t!==null&&X(s)&&(s=$x(t,s,"clone"));const a=R(s)?s.getChildren():[],c=(function(l){const f=l.exportJSON(),u=l.constructor;if(f.type!==u.getType()&&vc(58,u.name),R(l)){const d=f.children;Array.isArray(d)||vc(59,u.name)}return f})(s);X(s)&&s.getTextContentSize()===0&&(o=!1);for(let l=0;l<a.length;l++){const f=a[l],u=s1(e,t,f,c.children);!o&&R(n)&&u&&n.extractWithChild(f,t,"clone")&&(o=!0)}if(o&&!i)r.push(c);else if(Array.isArray(c.children))for(let l=0;l<c.children.length;l++){const f=c.children[l];r.push(f)}return o}function uN(e,t){const n=[],r=We().getChildren();for(let o=0;o<r.length;o++)s1(e,t,r[o],n);return{namespace:e._config.namespace,nodes:n}}function dN(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],o=t6(r);X(o)&&z6(o),t.push(o)}return t}let ri=null;async function Sg(e,t,n){if(ri!==null)return!1;if(t!==null)return new Promise((l,f)=>{e.update(()=>{l(Tg(e,t,n))})});const r=e.getRootElement(),o=e._window||window,i=o.document,s=en(o);if(r===null||s===null)return!1;const a=i.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(i.createTextNode("#")),r.append(a);const c=new Range;return c.setStart(a,0),c.setEnd(a,1),s.removeAllRanges(),s.addRange(c),new Promise((l,f)=>{const u=e.registerCommand(Zc,d=>(Sr(d,ClipboardEvent)&&(u(),ri!==null&&(o.clearTimeout(ri),ri=null),l(Tg(e,d,n))),!0),hx);ri=o.setTimeout(()=>{u(),ri=null,l(!1)},50),i.execCommand("copy"),a.remove()})}function Tg(e,t,n){if(n===void 0){const o=en(e._window),i=Z();if(!i||i.isCollapsed()||!o)return!1;const s=o.anchorNode,a=o.focusNode;if(s!==null&&a!==null&&!oa(e,s,a))return!1;n=hN(i)}t.preventDefault();const r=t.clipboardData;return r!==null&&(pN(r,n),!0)}const a1=[["text/html",lN],["application/x-lexical-editor",fN]];function hN(e=Z()){const t={"text/plain":e?e.getTextContent():""};if(e){const n=Jd();for(const[r,o]of a1){const i=o(n,e);i!==null&&(t[r]=i)}}return t}function pN(e,t){for(const[n]of a1)t[n]===void 0&&e.setData(n,"");for(const n in t){const r=t[n];r!==void 0&&e.setData(n,r)}}function Ng(e,t){if(document.caretRangeFromPoint!==void 0){const n=document.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const n=document.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}const Ko=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,mN=Ko&&"documentMode"in document?document.documentMode:null,gN=Ko&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),yN=!(!Ko||!("InputEvent"in window)||mN)&&"getTargetRanges"in new window.InputEvent("input"),bN=Ko&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Og=Ko&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,vN=Ko&&/^(?=.*Chrome).*/i.test(navigator.userAgent),xN=Ko&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&gN&&!vN,Pg=he("DRAG_DROP_PASTE_FILE");function Pa(e){let t=null;if(Sr(e,DragEvent)?t=e.dataTransfer:Sr(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];const n=t.types,r=n.includes("Files"),o=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),o]}function Mg(e){const t=Z();if(!$(t))return!1;const n=new Set,r=t.getNodes();for(let o=0;o<r.length;o++){const i=r[o],s=i.getKey();if(n.has(s))continue;const a=at(i,l=>R(l)&&!l.isInline());if(a===null)continue;const c=a.getKey();a.canIndent()&&!n.has(c)&&(n.add(c),e(a))}return n.size>0}function Ig(e){const t=Fi(e);return Te(t)}function af(e){for(const t of["lowercase","uppercase","capitalize"])e.hasFormat(t)&&e.toggleFormat(t)}function wN(e){return un(e.registerCommand(Md,t=>{const n=Z();return!!ot(n)&&(n.clear(),!0)},we),e.registerCommand(bo,t=>{const n=Z();return $(n)?(n.deleteCharacter(t),!0):!!ot(n)&&(n.deleteNodes(),!0)},we),e.registerCommand(Rs,t=>{const n=Z();return!!$(n)&&(n.deleteWord(t),!0)},we),e.registerCommand(Ds,t=>{const n=Z();return!!$(n)&&(n.deleteLine(t),!0)},we),e.registerCommand(gi,t=>{const n=Z();if(typeof t=="string")n!==null&&n.insertText(t);else{if(n===null)return!1;const r=t.dataTransfer;if(r!=null)_g(r,n,e);else if($(n)){const o=t.data;return o&&n.insertText(o),!0}}return!0},we),e.registerCommand(xu,()=>{const t=Z();return!!$(t)&&(t.removeText(),!0)},we),e.registerCommand(kn,t=>{const n=Z();return!!$(n)&&(n.formatText(t),!0)},we),e.registerCommand(_3,t=>{const n=Z();if(!$(n)&&!ot(n))return!1;const r=n.getNodes();for(const o of r){const i=at(o,s=>R(s)&&!s.isInline());i!==null&&i.setFormat(t)}return!0},we),e.registerCommand(mi,t=>{const n=Z();return!!$(n)&&(n.insertLineBreak(t),!0)},we),e.registerCommand(Ls,()=>{const t=Z();return!!$(t)&&(t.insertParagraph(),!0)},we),e.registerCommand(C3,()=>(sx([ta()]),!0),we),e.registerCommand(k3,()=>Mg(t=>{const n=t.getIndent();t.setIndent(n+1)}),we),e.registerCommand(Mm,()=>Mg(t=>{const n=t.getIndent();n>0&&t.setIndent(Math.max(0,n-1))}),we),e.registerCommand(Iv,t=>{const n=Z();if(ot(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),r[0].selectPrevious(),!0}else if($(n)){const r=Iu(n.focus,!0);if(!t.shiftKey&&Te(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),t.preventDefault(),!0}return!1},we),e.registerCommand(Lv,t=>{const n=Z();if(ot(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),r[0].selectNext(0,0),!0}else if($(n)){if((function(o){const i=o.focus;return i.key==="root"&&i.offset===We().getChildrenSize()})(n))return t.preventDefault(),!0;const r=Iu(n.focus,!1);if(!t.shiftKey&&Te(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),t.preventDefault(),!0}return!1},we),e.registerCommand(Mv,t=>{const n=Z();if(ot(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),mg(r[0])?r[0].selectNext(0,0):r[0].selectPrevious(),!0}if(!$(n))return!1;if(yg(n,!0)){const r=t.shiftKey;return t.preventDefault(),bg(n,r,!0),!0}return!1},we),e.registerCommand(Pv,t=>{const n=Z();if(ot(n)){const o=n.getNodes();if(o.length>0)return t.preventDefault(),mg(o[0])?o[0].selectPrevious():o[0].selectNext(0,0),!0}if(!$(n))return!1;const r=t.shiftKey;return!!yg(n,!1)&&(t.preventDefault(),bg(n,r,!1),!0)},we),e.registerCommand(Dv,t=>{if(Ig(t.target))return!1;const n=Z();if($(n)){if((function(r){if(!r.isCollapsed())return!1;const{anchor:o}=r;if(o.offset!==0)return!1;const i=o.getNode();if(Ye(i))return!1;const s=K6(i);return s.getIndent()>0&&(s.is(i)||i.is(s.getFirstDescendant()))})(n))return t.preventDefault(),e.dispatchCommand(Mm,void 0);if(Og&&navigator.language==="ko-KR")return!1}else if(!ot(n))return!1;return t.preventDefault(),e.dispatchCommand(bo,!0)},we),e.registerCommand(Fv,t=>{if(Ig(t.target))return!1;const n=Z();return!(!$(n)&&!ot(n))&&(t.preventDefault(),e.dispatchCommand(bo,!1))},we),e.registerCommand(Fs,t=>{const n=Z();if(!$(n))return!1;if(af(n),t!==null){if((Og||bN||xN)&&yN)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(mi,!1)}return e.dispatchCommand(Ls,void 0)},we),e.registerCommand(Rd,()=>{const t=Z();return!!$(t)&&(e.blur(),!0)},we),e.registerCommand(zv,t=>{const[,n]=Pa(t);if(n.length>0){const o=Ng(t.clientX,t.clientY);if(o!==null){const{offset:i,node:s}=o,a=Fi(s);if(a!==null){const c=rx();if(X(a))c.anchor.set(a.getKey(),i,"text"),c.focus.set(a.getKey(),i,"text");else{const f=a.getParentOrThrow().getKey(),u=a.getIndexWithinParent()+1;c.anchor.set(f,u,"element"),c.focus.set(f,u,"element")}const l=Ri(c);Pt(l)}e.dispatchCommand(Pg,n)}return t.preventDefault(),!0}const r=Z();return!!$(r)},we),e.registerCommand($v,t=>{const[n]=Pa(t),r=Z();return!(n&&!$(r))},we),e.registerCommand(Uv,t=>{const[n]=Pa(t),r=Z();if(n&&!$(r))return!1;const o=Ng(t.clientX,t.clientY);if(o!==null){const i=Fi(o.node);Te(i)&&t.preventDefault()}return!0},we),e.registerCommand(wu,()=>(f6(),!0),we),e.registerCommand(Zc,t=>(Sg(e,Sr(t,ClipboardEvent)?t:null),!0),we),e.registerCommand(Dd,t=>((async function(n,r){await Sg(r,Sr(n,ClipboardEvent)?n:null),r.update(()=>{const o=Z();$(o)?o.removeText():ot(o)&&o.getNodes().forEach(i=>i.remove())})})(t,e),!0),we),e.registerCommand(Gc,t=>{const[,n,r]=Pa(t);return n.length>0&&!r?(e.dispatchCommand(Pg,n),!0):Xi(t.target)&&Hd(t.target)?!1:Z()!==null&&((function(o,i){o.preventDefault(),i.update(()=>{const s=Z(),a=Sr(o,InputEvent)||Sr(o,KeyboardEvent)?null:o.clipboardData;a!=null&&s!==null&&_g(a,s,i)},{tag:z3})})(t,e),!0)},we),e.registerCommand(Rv,t=>{const n=Z();return $(n)&&af(n),!1},we),e.registerCommand(jv,t=>{const n=Z();return $(n)&&af(n),!1},we))}function AN(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const ch=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?T.useLayoutEffect:T.useEffect;function CN({editor:e,ErrorBoundary:t}){return(function(n,r){const[o,i]=T.useState(()=>n.getDecorators());return ch(()=>n.registerDecoratorListener(s=>{Nn.flushSync(()=>{i(s)})}),[n]),T.useEffect(()=>{i(n.getDecorators())},[n]),T.useMemo(()=>{const s=[],a=Object.keys(o);for(let c=0;c<a.length;c++){const l=a[c],f=x.jsx(r,{onError:d=>n._onError(d),children:x.jsx(T.Suspense,{fallback:null,children:o[l]})}),u=n.getElementByKey(l);u!==null&&s.push(Nn.createPortal(f,u,l))}return s},[r,o,n])})(e,t)}function kN({editor:e,ErrorBoundary:t}){return(function(n){const r=vi.maybeFromEditor(n);if(r&&r.hasExtensionByName(rN.name)){for(const o of["@lexical/plain-text","@lexical/rich-text"])r.hasExtensionByName(o)&&AN(320,o);return!0}return!1})(e)?null:x.jsx(CN,{editor:e,ErrorBoundary:t})}function Lg(e){return e.getEditorState().read(e1(e.isComposing()))}function _N({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){const[r]=ht();return(function(o){ch(()=>un(wN(o),aN(o)),[o])})(r),x.jsxs(x.Fragment,{children:[e,x.jsx(EN,{content:t}),x.jsx(kN,{editor:r,ErrorBoundary:n})]})}function EN({content:e}){const[t]=ht(),n=(function(o){const[i,s]=T.useState(()=>Lg(o));return ch(()=>{function a(){const c=Lg(o);s(c)}return a(),un(o.registerUpdateListener(()=>{a()}),o.registerEditableListener(()=>{a()}))},[o]),i})(t),r=F6();return n?typeof e=="function"?e(r):e:null}function SN(e,t,n,r,o){if(e===null||n.size===0&&r.size===0&&!o)return 0;const i=t._selection,s=e._selection;if(o)return 1;if(!($(i)&&$(s)&&s.isCollapsed()&&i.isCollapsed()))return 0;const a=(function(y,b,v){const w=y._nodeMap,A=[];for(const k of b){const _=w.get(k);_!==void 0&&A.push(_)}for(const[k,_]of v){if(!_)continue;const E=w.get(k);E===void 0||Ye(E)||A.push(E)}return A})(t,n,r);if(a.length===0)return 0;if(a.length>1){const y=t._nodeMap,b=y.get(i.anchor.key),v=y.get(s.anchor.key);return b&&v&&!e._nodeMap.has(b.__key)&&X(b)&&b.__text.length===1&&i.anchor.offset===1?2:0}const c=a[0],l=e._nodeMap.get(c.__key);if(!X(l)||!X(c)||l.__mode!==c.__mode)return 0;const f=l.__text,u=c.__text;if(f===u)return 0;const d=i.anchor,h=s.anchor;if(d.key!==h.key||d.type!=="text")return 0;const p=d.offset,g=h.offset,m=u.length-f.length;return m===1&&g===p-1?2:m===-1&&g===p+1?3:m===-1&&g===p?4:0}function TN(e,t){let n=Date.now(),r=0;return(o,i,s,a,c,l)=>{const f=Date.now();if(l.has(Nu))return r=0,n=f,2;const u=SN(o,i,a,c,e.isComposing()),d=(()=>{const h=s===null||s.editor===e,p=l.has(j3);if(!p&&h&&l.has(vo))return 0;if(o===null)return 1;const g=i._selection;if(!(a.size>0||c.size>0))return g!==null?0:2;const m=typeof t=="number"?t:t.peek();return p===!1&&u!==0&&u===r&&f<n+m&&h||a.size===1&&(function(y,b,v){const w=b._nodeMap.get(y),A=v._nodeMap.get(y),k=b._selection,_=v._selection;return!($(k)&&$(_)&&k.anchor.type==="element"&&k.focus.type==="element"&&_.anchor.type==="text"&&_.focus.type==="text"||!X(w)||!X(A)||w.__parent!==A.__parent)&&JSON.stringify(b.read(()=>w.exportJSON()))===JSON.stringify(v.read(()=>A.exportJSON()))})(Array.from(a)[0],o,i)?0:1})();return n=f,r=u,d}}function Rg(e){e.undoStack=[],e.redoStack=[],e.current=null}function c1(e,t,n){const r=TN(e,n);return un(e.registerCommand(Id,()=>((function(i,s){const a=s.redoStack,c=s.undoStack;if(c.length!==0){const l=s.current,f=c.pop();l!==null&&(a.push(l),i.dispatchCommand(Aa,!0)),c.length===0&&i.dispatchCommand(Ca,!1),s.current=f||null,f&&f.editor.setEditorState(f.editorState,{tag:Nu})}})(e,t),!0),we),e.registerCommand(Ld,()=>((function(i,s){const a=s.redoStack,c=s.undoStack;if(a.length!==0){const l=s.current;l!==null&&(c.push(l),i.dispatchCommand(Ca,!0));const f=a.pop();a.length===0&&i.dispatchCommand(Aa,!1),s.current=f||null,f&&f.editor.setEditorState(f.editorState,{tag:Nu})}})(e,t),!0),we),e.registerCommand(S3,()=>(Rg(t),!1),we),e.registerCommand(T3,()=>(Rg(t),e.dispatchCommand(Aa,!1),e.dispatchCommand(Ca,!1),!0),we),e.registerUpdateListener(({editorState:i,prevEditorState:s,dirtyLeaves:a,dirtyElements:c,tags:l})=>{const f=t.current,u=t.redoStack,d=t.undoStack,h=f===null?null:f.editorState;if(f!==null&&i===h)return;const p=r(s,i,f,a,c,l);if(p===1)u.length!==0&&(t.redoStack=[],e.dispatchCommand(Aa,!1)),f!==null&&(d.push({...f}),e.dispatchCommand(Ca,!0));else if(p===2)return;t.current={editor:e,editorState:i}}))}function l1(){return{current:null,redoStack:[],undoStack:[]}}const cf={build:(e,{delay:t,createInitialHistoryState:n,disabled:r})=>Gx({delay:t,disabled:r,historyState:n(e)}),config:{createInitialHistoryState:l1,delay:300,disabled:typeof window>"u"},name:"@lexical/history/History",register:(e,t,n)=>{const r=n.getOutput();return $s(()=>r.disabled.value?void 0:c1(e,r.historyState.value,r.delay))}};P6(cf,{createInitialHistoryState:()=>{throw new Error("SharedHistory did not inherit parent history")},disabled:!0});function NN({delay:e,externalHistoryState:t}){const[n]=ht();return(function(r,o,i=1e3){const s=T.useMemo(()=>o||l1(),[o]);T.useEffect(()=>c1(r,s,i),[i,r,s])})(n,t,e),null}const f1=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?T.useLayoutEffect:T.useEffect;function ON({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:o,ariaErrorMessage:i,ariaExpanded:s,ariaInvalid:a,ariaLabel:c,ariaLabelledBy:l,ariaMultiline:f,ariaOwns:u,ariaRequired:d,autoCapitalize:h,className:p,id:g,role:m="textbox",spellCheck:y=!0,style:b,tabIndex:v,"data-testid":w,...A},k){const[_,E]=T.useState(e.isEditable()),N=T.useCallback(I=>{I&&I.ownerDocument&&I.ownerDocument.defaultView?e.setRootElement(I):e.setRootElement(null)},[e]),P=T.useMemo(()=>(function(...I){return W=>{for(const j of I)typeof j=="function"?j(W):j!=null&&(j.current=W)}})(k,N),[N,k]);return f1(()=>(E(e.isEditable()),e.registerEditableListener(I=>{E(I)})),[e]),x.jsx("div",{"aria-activedescendant":_?t:void 0,"aria-autocomplete":_?n:"none","aria-controls":_?r:void 0,"aria-describedby":o,...i!=null?{"aria-errormessage":i}:{},"aria-expanded":_&&m==="combobox"?!!s:void 0,...a!=null?{"aria-invalid":a}:{},"aria-label":c,"aria-labelledby":l,"aria-multiline":f,"aria-owns":_?u:void 0,"aria-readonly":!_||void 0,"aria-required":d,autoCapitalize:h,className:p,contentEditable:_,"data-testid":w,id:g,ref:P,role:m,spellCheck:y,style:b,tabIndex:v,...A})}const PN=T.forwardRef(ON);function Dg(e){return e.getEditorState().read(e1(e.isComposing()))}const MN=T.forwardRef(IN);function IN(e,t){const{placeholder:n,...r}=e,[o]=ht();return x.jsxs(x.Fragment,{children:[x.jsx(PN,{editor:o,...r,ref:t}),n!=null&&x.jsx(LN,{editor:o,content:n})]})}function LN({content:e,editor:t}){const n=(function(s){const[a,c]=T.useState(()=>Dg(s));return f1(()=>{function l(){const f=Dg(s);c(f)}return l(),un(s.registerUpdateListener(()=>{l()}),s.registerEditableListener(()=>{l()}))},[s]),a})(t),[r,o]=T.useState(t.isEditable());if(T.useLayoutEffect(()=>(o(t.isEditable()),t.registerEditableListener(s=>{o(s)})),[t]),!n)return null;let i=null;return typeof e=="function"?i=e(r):e!==null&&(i=e),i===null?null:x.jsx("div",{"aria-hidden":!0,children:i})}const RN=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?T.useLayoutEffect:T.useEffect;function DN({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){const[r]=ht();return RN(()=>{if(n)return r.registerUpdateListener(({editorState:o,dirtyElements:i,dirtyLeaves:s,prevEditorState:a,tags:c})=>{t&&i.size===0&&s.size===0||e&&c.has(vo)||a.isEmpty()||n(o,r,c)})},[r,e,t,n]),null}const FN=T.createContext(null),lf={didCatch:!1,error:null};class jN extends T.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=lf}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(...t){var r,o;const{error:n}=this.state;n!==null&&((o=(r=this.props).onReset)==null||o.call(r,{args:t,reason:"imperative-api"}),this.setState(lf))}componentDidCatch(t,n){var r,o;(o=(r=this.props).onError)==null||o.call(r,t,n)}componentDidUpdate(t,n){var i,s;const{didCatch:r}=this.state,{resetKeys:o}=this.props;r&&n.error!==null&&zN(t.resetKeys,o)&&((s=(i=this.props).onReset)==null||s.call(i,{next:o,prev:t.resetKeys,reason:"keys"}),this.setState(lf))}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:i,error:s}=this.state;let a=t;if(i){const c={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")a=n(c);else if(r)a=T.createElement(r,c);else if(o!==void 0)a=o;else throw s}return T.createElement(FN.Provider,{value:{didCatch:i,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}function zN(e=[],t=[]){return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function $N({children:e,onError:t}){return x.jsx(jN,{fallback:x.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t,children:e})}const UN={paragraph:"cnf:m-0",list:{ol:"cnf:list-decimal cnf:pl-4",ul:"cnf:list-disc cnf:pl-4"},text:{bold:"cnf:font-semibold",italic:"cnf:italic",underline:"cnf:underline",strikethrough:"cnf:line-through",code:"cnf:font-mono"},link:"cnf:text-blue-600 cnf:hover:text-blue-600 cnf:underline cnf:cursor-pointer"};function Tr(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Uu(e){let t=1,n=e.getParent();for(;n!=null;){if(Se(n)){const r=n.getParent();if(ve(r)){t++,n=r.getParent();continue}Tr(40)}return t}return t}function Bu(e){let t=e.getParent();ve(t)||Tr(40);let n=t;for(;n!==null;)n=n.getParent(),ve(n)&&(t=n);return t}function u1(e){let t=[];const n=e.getChildren().filter(Se);for(let r=0;r<n.length;r++){const o=n[r],i=o.getFirstChild();ve(i)?t=t.concat(u1(i)):t.push(o)}return t}function wn(e){return Se(e)&&ve(e.getFirstChild())}function Fg(e){return Zt().append(e)}function d1(e,t){return Se(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function jg(e){const t=Z();if(t!==null){let n=t.getNodes();if($(t)){const o=t.getStartEndPoints();o===null&&Tr(143);const[i]=o,s=i.getNode(),a=s.getParent();if(jt(s)){const c=s.getFirstChild();if(c)n=c.selectStart().getNodes();else{const l=Tt();s.append(l),n=l.select().getNodes()}}else if(d1(s,n)){const c=Bt(e);if(jt(a)){s.replace(c);const l=Zt();R(s)&&(l.setFormat(s.getFormatType()),l.setIndent(s.getIndent())),c.append(l)}else if(Se(s)){const l=s.getParentOrThrow();Uo(c,l.getChildren()),l.replace(c)}return}}const r=new Set;for(let o=0;o<n.length;o++){const i=n[o];if(R(i)&&i.isEmpty()&&!Se(i)&&!r.has(i.getKey())){zg(i,e);continue}let s=xx(i)?i.getParent():Se(i)&&i.isEmpty()?i:null;for(;s!=null;){const a=s.getKey();if(ve(s)){if(!r.has(a)){const c=Bt(e);Uo(c,s.getChildren()),s.replace(c),r.add(a)}break}{const c=s.getParent();if(jt(c)&&!r.has(a)){r.add(a),zg(s,e);break}s=c}}}}}function Uo(e,t){e.splice(e.getChildrenSize(),0,t)}function zg(e,t){if(ve(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),o=Zt();let i;if(Uo(o,e.getChildren()),ve(n)&&t===n.getListType())n.append(o),ve(r)&&t===r.getListType()&&(Uo(n,r.getChildren()),r.remove()),i=n;else if(ve(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(o),i=r;else{const s=Bt(t);s.append(o),e.replace(s),i=s}return o.setFormat(e.getFormatType()),o.setIndent(e.getIndent()),e.remove(),i}function lh(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&wn(n)&&wn(r)&&(lh(n.getFirstChild(),r.getFirstChild()),r.remove());const o=t.getChildren();o.length>0&&e.append(...o),t.remove()}function BN(){const e=Z();if($(e)){const t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(d1(r,n))t.add(Bu(r));else for(let o=0;o<n.length;o++){const i=n[o];if(xx(i)){const s=W6(i,ts);s!=null&&t.add(Bu(s))}}for(const o of t){let i=o;const s=u1(o);for(const a of s){const c=Tt().setTextStyle(e.style).setTextFormat(e.format);Uo(c,a.getChildren()),i.insertAfter(c),i=c,a.__key===e.anchor.key&&$o(e.anchor,Yt(fn(c,"next"))),a.__key===e.focus.key&&$o(e.focus,Yt(fn(c,"next"))),a.remove()}o.remove()}}}function h1(e){const t=e.getListType()!=="check";let n=e.getStart();for(const r of e.getChildren())Se(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),ve(r.getFirstChild())||n++)}function WN(e){const t=new Set;if(wn(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),o=e.getPreviousSibling();if(wn(r)&&wn(o)){const i=o.getFirstChild();if(ve(i)){i.append(e);const s=r.getFirstChild();ve(s)&&(Uo(i,s.getChildren()),r.remove(),t.add(r.getKey()))}}else if(wn(r)){const i=r.getFirstChild();if(ve(i)){const s=i.getFirstChild();s!==null&&s.insertBefore(e)}}else if(wn(o)){const i=o.getFirstChild();ve(i)&&i.append(e)}else if(ve(n)){const i=Zt().setTextFormat(e.getTextFormat()).setTextStyle(e.getTextStyle()),s=Bt(n.getListType()).setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle());i.append(s),s.append(e),o?o.insertAfter(i):r?r.insertBefore(i):n.append(i)}}function KN(e){if(wn(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(ve(n?n.getParent():void 0)&&Se(n)&&ve(t)){const r=t?t.getFirstChild():void 0,o=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(o))n.insertAfter(e),t.isEmpty()&&n.remove();else{const i=t.getListType(),s=Zt(),a=Bt(i);s.append(a),e.getPreviousSiblings().forEach(f=>a.append(f));const c=Zt(),l=Bt(i);c.append(l),Uo(l,e.getNextSiblings()),n.insertBefore(s),n.insertAfter(c),n.replace(e)}}}function HN(){const e=Z();if(!$(e)||!e.isCollapsed())return!1;const t=e.anchor.getNode();if(!Se(t)||t.getChildrenSize()!==0)return!1;const n=Bu(t),r=t.getParent();ve(r)||Tr(40);const o=r.getParent();let i;if(jt(o))i=Tt(),n.insertAfter(i);else{if(!Se(o))return!1;i=Zt(),o.insertAfter(i)}i.setTextStyle(e.style).setTextFormat(e.format).select();const s=t.getNextSiblings();if(s.length>0){const a=Bt(r.getListType());if(Se(i)){const c=Zt();c.append(a),i.insertAfter(c)}else i.insertAfter(a);a.append(...s)}return(function(a){let c=a;for(;c.getNextSibling()==null&&c.getPreviousSibling()==null;){const l=c.getParent();if(l==null||!Se(l)&&!ve(l))break;c=l}c.remove()})(t),!0}function xc(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}class ts extends Mn{constructor(n=1,r=void 0,o){super(o);D(this,"__value");D(this,"__checked");this.__value=n===void 0?1:n,this.__checked=r}$config(){return this.config("listitem",{$transform:n=>{if(n.__checked==null)return;const r=n.getParent();ve(r)&&r.getListType()!=="check"&&n.getChecked()!=null&&n.setChecked(void 0)},extends:Mn,importDOM:{li:()=>({conversion:qN,priority:0})}})}afterCloneFrom(n){super.afterCloneFrom(n),this.__value=n.__value,this.__checked=n.__checked}createDOM(n){const r=document.createElement("li");return this.updateListItemDOM(null,r,n),r}updateListItemDOM(n,r,o){(function(a,c,l){const f=c.getParent();!ve(f)||f.getListType()!=="check"||ve(c.getFirstChild())?(a.removeAttribute("role"),a.removeAttribute("tabIndex"),a.removeAttribute("aria-checked")):(a.setAttribute("role","checkbox"),a.setAttribute("tabIndex","-1"),l&&c.__checked===l.__checked||a.setAttribute("aria-checked",c.getChecked()?"true":"false"))})(r,this,n),r.value=this.__value,(function(a,c,l){const f=[],u=[],d=c.list,h=d?d.listitem:void 0;let p;if(d&&d.nested&&(p=d.nested.listitem),h!==void 0&&f.push(...xc(h)),d){const g=l.getParent(),m=ve(g)&&g.getListType()==="check",y=l.getChecked();m&&!y||u.push(d.listitemUnchecked),m&&y||u.push(d.listitemChecked),m&&f.push(y?d.listitemChecked:d.listitemUnchecked)}if(p!==void 0){const g=xc(p);l.getChildren().some(m=>ve(m))?f.push(...g):u.push(...g)}u.length>0&&qx(a,...u),f.length>0&&ih(a,...f)})(r,o.theme,this);const i=n?n.__style:"",s=this.__style;i!==s&&(s===""?r.removeAttribute("style"):r.style.cssText=s),(function(a,c,l){const f=pg(c.__textStyle);for(const u in f)a.style.setProperty(`--listitem-marker-${u}`,f[u]);if(l)for(const u in pg(l.__textStyle))u in f||a.style.removeProperty(`--listitem-marker-${u}`)})(r,this,n)}updateDOM(n,r,o){const i=r;return this.updateListItemDOM(n,i,o),!1}updateFromJSON(n){return super.updateFromJSON(n).setValue(n.value).setChecked(n.checked)}exportDOM(n){const r=this.createDOM(n._config),o=this.getFormatType();o&&(r.style.textAlign=o);const i=this.getDirection();return i&&(r.dir=i),{element:r}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...n){for(let r=0;r<n.length;r++){const o=n[r];if(R(o)&&this.canMergeWith(o)){const i=o.getChildren();this.append(...i),o.remove()}else super.append(o)}return this}replace(n,r){if(Se(n))return super.replace(n);this.setIndent(0);const o=this.getParentOrThrow();if(!ve(o))return n;if(o.__first===this.getKey())o.insertBefore(n);else if(o.__last===this.getKey())o.insertAfter(n);else{const i=Bt(o.getListType());let s=this.getNextSibling();for(;s;){const a=s;s=s.getNextSibling(),i.append(a)}o.insertAfter(n),n.insertAfter(i)}return r&&(R(n)||Tr(139),this.getChildren().forEach(i=>{n.append(i)})),this.remove(),o.getChildrenSize()===0&&o.remove(),n}insertAfter(n,r=!0){const o=this.getParentOrThrow();if(ve(o)||Tr(39),Se(n))return super.insertAfter(n,r);const i=this.getNextSiblings();if(o.insertAfter(n,r),i.length!==0){const s=Bt(o.getListType());i.forEach(a=>s.append(a)),n.insertAfter(s,r)}return n}remove(n){const r=this.getPreviousSibling(),o=this.getNextSibling();super.remove(n),r&&o&&wn(r)&&wn(o)&&(lh(r.getFirstChild(),o.getFirstChild()),o.remove())}insertNewAfter(n,r=!0){const o=Zt().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(o,r),o}collapseAtStart(n){const r=Tt();this.getChildren().forEach(a=>r.append(a));const o=this.getParentOrThrow(),i=o.getParentOrThrow(),s=Se(i);if(o.getChildrenSize()===1)if(s)o.remove(),i.select();else{o.insertBefore(r),o.remove();const a=n.anchor,c=n.focus,l=r.getKey();a.type==="element"&&a.getNode().is(this)&&a.set(l,a.offset,"element"),c.type==="element"&&c.getNode().is(this)&&c.set(l,c.offset,"element")}else o.insertBefore(r),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(n){const r=this.getWritable();return r.__value=n,r}getChecked(){const n=this.getLatest();let r;const o=this.getParent();return ve(o)&&(r=o.getListType()),r==="check"?!!n.__checked:void 0}setChecked(n){const r=this.getWritable();return r.__checked=n,r}toggleChecked(){const n=this.getWritable();return n.setChecked(!n.__checked)}getIndent(){const n=this.getParent();if(n===null||!this.isAttached())return this.getLatest().__indent;let r=n.getParentOrThrow(),o=0;for(;Se(r);)r=r.getParentOrThrow().getParentOrThrow(),o++;return o}setIndent(n){typeof n!="number"&&Tr(117),(n=Math.floor(n))>=0||Tr(199);let r=this.getIndent();for(;r!==n;)r<n?(WN(this),r++):(KN(this),r--);return this}canInsertAfter(n){return Se(n)}canReplaceWith(n){return Se(n)}canMergeWith(n){return Se(n)||Bd(n)}extractWithChild(n,r){if(!$(r))return!1;const o=r.anchor.getNode(),i=r.focus.getNode();return this.isParentOf(o)&&this.isParentOf(i)&&this.getTextContent().length===r.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Bt("bullet")}canMergeWhenEmpty(){return!0}}function qN(e){if(e.classList.contains("task-list-item")){for(const n of e.children)if(n.tagName==="INPUT")return $g(n)}if(e.classList.contains("joplin-checkbox")){for(const n of e.children)if(n.classList.contains("checkbox-wrapper")&&n.children.length>0&&n.children[0].tagName==="INPUT")return $g(n.children[0])}const t=e.getAttribute("aria-checked");return{node:Zt(t==="true"||t!=="false"&&void 0)}}function $g(e){return e.getAttribute("type")!=="checkbox"?{node:null}:{node:Zt(e.hasAttribute("checked"))}}function Zt(e){return Kr(new ts(void 0,e))}function Se(e){return e instanceof ts}class sa extends Mn{constructor(n="number",r=1,o){super(o);D(this,"__tag");D(this,"__start");D(this,"__listType");const i=YN[n]||n;this.__listType=i,this.__tag=i==="number"?"ol":"ul",this.__start=r}$config(){return this.config("list",{$transform:n=>{(function(r){const o=r.getNextSibling();ve(o)&&r.getListType()===o.getListType()&&lh(r,o)})(n),h1(n)},extends:Mn,importDOM:{ol:()=>({conversion:Bg,priority:0}),ul:()=>({conversion:Bg,priority:0})}})}afterCloneFrom(n){super.afterCloneFrom(n),this.__listType=n.__listType,this.__tag=n.__tag,this.__start=n.__start}getTag(){return this.getLatest().__tag}setListType(n){const r=this.getWritable();return r.__listType=n,r.__tag=n==="number"?"ol":"ul",r}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(n){const r=this.getWritable();return r.__start=n,r}createDOM(n,r){const o=this.__tag,i=document.createElement(o);return this.__start!==1&&i.setAttribute("start",String(this.__start)),i.__lexicalListType=this.__listType,Ug(i,n.theme,this),i}updateDOM(n,r,o){return n.__tag!==this.__tag||n.__listType!==this.__listType||(Ug(r,o.theme,this),!1)}updateFromJSON(n){return super.updateFromJSON(n).setListType(n.listType).setStart(n.start)}exportDOM(n){const r=this.createDOM(n._config,n);return pt(r)&&(this.__start!==1&&r.setAttribute("start",String(this.__start)),this.__listType==="check"&&r.setAttribute("__lexicalListType","check")),{element:r}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(n,r,o){let i=o;for(let s=0;s<o.length;s++){const a=o[s];Se(a)||(i===o&&(i=[...o]),i[s]=Zt().append(!R(a)||ve(a)||a.isInline()?a:rt(a.getTextContent())))}return super.splice(n,r,i)}extractWithChild(n){return Se(n)}}function Ug(e,t,n){const r=[],o=[],i=t.list;if(i!==void 0){const s=i[`${n.__tag}Depth`]||[],a=Uu(n)-1,c=a%s.length,l=s[c],f=i[n.__tag];let u;const d=i.nested,h=i.checklist;if(d!==void 0&&d.list&&(u=d.list),f!==void 0&&r.push(f),h!==void 0&&n.__listType==="check"&&r.push(h),l!==void 0){r.push(...xc(l));for(let p=0;p<s.length;p++)p!==c&&o.push(n.__tag+p)}if(u!==void 0){const p=xc(u);a>1?r.push(...p):o.push(...p)}}o.length>0&&qx(e,...o),r.length>0&&ih(e,...r)}function VN(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(Se(r)){t.push(r);const o=r.getChildren();o.length>1&&o.forEach(i=>{ve(i)&&t.push(Fg(i))})}else t.push(Fg(r))}return t}function Bg(e){const t=e.nodeName.toLowerCase();let n=null;return t==="ol"?n=Bt("number",e.start):t==="ul"&&(n=(function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(const o of r.childNodes)if(pt(o)&&o.hasAttribute("aria-checked"))return!0;return!1})(e)?Bt("check"):Bt("bullet")),{after:VN,node:n}}const YN={ol:"number",ul:"bullet"};function Bt(e="number",t=1){return Kr(new sa(e,t))}function ve(e){return e instanceof sa}const QN=he("UPDATE_LIST_START_COMMAND"),p1=he("INSERT_UNORDERED_LIST_COMMAND"),m1=he("INSERT_ORDERED_LIST_COMMAND"),Wu=he("REMOVE_LIST_COMMAND");function GN(e){return un(e.registerCommand(m1,()=>(jg("number"),!0),Gn),e.registerCommand(QN,t=>{const{listNodeKey:n,newStart:r}=t,o=Xe(n);return!!ve(o)&&(o.getListType()==="number"&&(o.setStart(r),h1(o)),!0)},Gn),e.registerCommand(p1,()=>(jg("bullet"),!0),Gn),e.registerCommand(Wu,()=>(BN(),!0),Gn),e.registerCommand(Ls,()=>HN(),Gn),e.registerNodeTransform(ts,t=>{const n=t.getFirstChild();if(n){if(X(n)){const r=n.getStyle(),o=n.getFormat();t.getTextStyle()!==r&&t.setTextStyle(r),t.getTextFormat()!==o&&t.setTextFormat(o)}}else{const r=Z();$(r)&&(r.style!==t.getTextStyle()||r.format!==t.getTextFormat())&&r.isCollapsed()&&t.is(r.anchor.getNode())&&t.setTextStyle(r.style).setTextFormat(r.format)}}),e.registerNodeTransform(Br,t=>{const n=t.getParent();if(Se(n)&&t.is(n.getFirstChild())){const r=t.getStyle(),o=t.getFormat();r===n.getTextStyle()&&o===n.getTextFormat()||n.setTextStyle(r).setTextFormat(o)}}))}function ZN(e){const t=n=>{const r=n.getParent();if(ve(n.getFirstChild())||!ve(r))return;const o=at(n,i=>Se(i)&&ve(i.getParent())&&Se(i.getPreviousSibling()));if(o===null&&n.getIndent()>0)n.setIndent(0);else if(Se(o)){const i=o.getPreviousSibling();if(Se(i)){const s=(function(c){let l=c,f=l.getFirstChild();for(;ve(f);){const u=f.getLastChild();if(!Se(u))break;l=u,f=l.getFirstChild()}return l})(i),a=s.getParent();if(ve(a)){const c=Uu(a);c+1<Uu(r)&&n.setIndent(c)}}}};return e.registerNodeTransform(sa,n=>{const r=[n];for(;r.length>0;){const o=r.shift();if(ve(o)){for(const i of o.getChildren())if(Se(i)){t(i);const s=i.getFirstChild();ve(s)&&r.push(s)}}}})}const JN=new Set(["http:","https:","mailto:","sms:","tel:"]);class Ho extends Mn{constructor(n="",r={},o){super(o);D(this,"__url");D(this,"__target");D(this,"__rel");D(this,"__title");const{target:i=null,rel:s=null,title:a=null}=r;this.__url=n,this.__target=i,this.__rel=s,this.__title=a}static getType(){return"link"}static clone(n){return new Ho(n.__url,{rel:n.__rel,target:n.__target,title:n.__title},n.__key)}createDOM(n){const r=document.createElement("a");return this.updateLinkDOM(null,r,n),ih(r,n.theme.link),r}updateLinkDOM(n,r,o){if(Nx(r)){n&&n.__url===this.__url||(r.href=this.sanitizeUrl(this.__url));for(const i of["target","rel","title"]){const s=`__${i}`,a=this[s];n&&n[s]===a||(a?r[i]=a:r.removeAttribute(i))}}}updateDOM(n,r,o){return this.updateLinkDOM(n,r,o),!1}static importDOM(){return{a:n=>({conversion:XN,priority:1})}}static importJSON(n){return Co().updateFromJSON(n)}updateFromJSON(n){return super.updateFromJSON(n).setURL(n.url).setRel(n.rel||null).setTarget(n.target||null).setTitle(n.title||null)}sanitizeUrl(n){n=Hg(n);try{const r=new URL(Hg(n));if(!JN.has(r.protocol))return"about:blank"}catch{return n}return n}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(n){const r=this.getWritable();return r.__url=n,r}getTarget(){return this.getLatest().__target}setTarget(n){const r=this.getWritable();return r.__target=n,r}getRel(){return this.getLatest().__rel}setRel(n){const r=this.getWritable();return r.__rel=n,r}getTitle(){return this.getLatest().__title}setTitle(n){const r=this.getWritable();return r.__title=n,r}insertNewAfter(n,r=!0){const o=Co(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(o,r),o}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(n,r,o){if(!$(r))return!1;const i=r.anchor.getNode(),s=r.focus.getNode();return this.isParentOf(i)&&this.isParentOf(s)&&r.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function XN(e){let t=null;if(Nx(e)){const n=e.textContent;(n!==null&&n!==""||e.children.length>0)&&(t=Co(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function Co(e="",t){return Kr(new Ho(e,t))}function ft(e){return e instanceof Ho}class il extends Ho{constructor(n="",r={},o){super(n,r,o);D(this,"__isUnlinked");this.__isUnlinked=r.isUnlinked!==void 0&&r.isUnlinked!==null&&r.isUnlinked}static getType(){return"autolink"}static clone(n){return new il(n.__url,{isUnlinked:n.__isUnlinked,rel:n.__rel,target:n.__target,title:n.__title},n.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(n){const r=this.getWritable();return r.__isUnlinked=n,r}createDOM(n){return this.__isUnlinked?document.createElement("span"):super.createDOM(n)}updateDOM(n,r,o){return super.updateDOM(n,r,o)||n.__isUnlinked!==this.__isUnlinked}static importJSON(n){return Wg().updateFromJSON(n)}updateFromJSON(n){return super.updateFromJSON(n).setIsUnlinked(n.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(n,r=!0){const o=this.getParentOrThrow().insertNewAfter(n,r);if(R(o)){const i=Wg(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return o.append(i),i}return null}}function Wg(e="",t){return Kr(new il(e,t))}function so(e){return e instanceof il}const $i=he("TOGGLE_LINK_COMMAND");function Kg(e,t){if(e.type==="element"){const n=e.getNode();return R(n)||(function(r,...o){const i=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",r);for(const a of o)s.append("v",a);throw i.search=s.toString(),Error(`Minified Lexical error #${r}; visit ${i.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(252),n.getChildren()[e.offset+t]||null}return null}function ff(e,t={}){let n;if(e&&typeof e=="object"){const{url:f,...u}=e;n=f,t={...u,...t}}else n=e;const{target:r,title:o}=t,i=t.rel===void 0?"noreferrer":t.rel,s=Z();if(s===null||!$(s)&&!ot(s))return;if(ot(s)){const f=s.getNodes();return f.length===0?void 0:void f.forEach(u=>{if(n===null){const d=at(u,h=>!so(h)&&ft(h));d&&(d.insertBefore(u),d.getChildren().length===0&&d.remove())}else{const d=at(u,h=>!so(h)&&ft(h));if(d)d.setURL(n),r!==void 0&&d.setTarget(r),i!==void 0&&d.setRel(i);else{const h=Co(n,{rel:i,target:r});u.insertBefore(h),h.append(u)}}})}const a=s.extract();if(n===null){const f=new Set;return void a.forEach(u=>{const d=u.getParent();if(ft(d)&&!so(d)){const h=d.getKey();if(f.has(h))return;(function(p,g){const m=new Set(g.filter(_=>p.isParentOf(_)).map(_=>_.getKey())),y=p.getChildren(),b=y.filter(_=>m.has(_.getKey()));if(b.length===y.length)return y.forEach(_=>p.insertBefore(_)),void p.remove();const v=y.findIndex(_=>m.has(_.getKey())),w=y.findLastIndex(_=>m.has(_.getKey())),A=v===0,k=w===y.length-1;if(A)b.forEach(_=>p.insertBefore(_));else if(k)for(let _=b.length-1;_>=0;_--)p.insertAfter(b[_]);else{for(let E=b.length-1;E>=0;E--)p.insertAfter(b[E]);const _=y.slice(w+1);if(_.length>0){const E=Co(p.getURL(),{rel:p.getRel(),target:p.getTarget(),title:p.getTitle()});b[b.length-1].insertAfter(E),_.forEach(N=>E.append(N))}}})(d,a),f.add(h)}})}const c=new Set,l=f=>{c.has(f.getKey())||(c.add(f.getKey()),f.setURL(n),r!==void 0&&f.setTarget(r),i!==void 0&&f.setRel(i),o!==void 0&&f.setTitle(o))};if(a.length===1){const f=a[0],u=at(f,ft);if(u!==null)return l(u)}(function(f){const u=Z();if(!$(u))return f();const d=Ri(u),h=d.isBackward(),p=Kg(d.anchor,h?-1:0),g=Kg(d.focus,h?0:-1);if(f(),p||g){const m=Z();if($(m)){const y=m.clone();if(p){const b=p.getParent();b&&y.anchor.set(b.getKey(),p.getIndexWithinParent()+(h?1:0),"element")}if(g){const b=g.getParent();b&&y.focus.set(b.getKey(),g.getIndexWithinParent()+(h?0:1),"element")}Pt(Ri(y))}}})(()=>{let f=null;for(const u of a){if(!u.isAttached())continue;const d=at(u,ft);if(d){l(d);continue}if(R(u)){if(!u.isInline())continue;if(ft(u)){if(!(so(u)||f!==null&&f.getParentOrThrow().isParentOf(u))){l(u),f=u;continue}for(const p of u.getChildren())u.insertBefore(p);u.remove();continue}}const h=u.getPreviousSibling();ft(h)&&h.is(f)?h.append(u):(f=Co(n,{rel:i,target:r,title:o}),u.insertAfter(f),f.append(u))}})}const e5=/^\+?[0-9\s()-]{5,}$/;function Hg(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:e5.test(e)?`tel:${e}`:`https://${e}`}function t5(e,t){return un($s(()=>e.registerCommand($i,n=>{const r=t.validateUrl.peek(),o=t.attributes.peek();if(n===null)return ff(null),!0;if(typeof n=="string")return!(r!==void 0&&!r(n))&&(ff(n,o),!0);{const{url:i,target:s,rel:a,title:c}=n;return ff(i,{...o,rel:a,target:s,title:c}),!0}},Gn)),$s(()=>{const n=t.validateUrl.value;if(!n)return;const r=t.attributes.value;return e.registerCommand(Gc,o=>{const i=Z();if(!$(i)||i.isCollapsed()||!Sr(o,ClipboardEvent)||o.clipboardData===null)return!1;const s=o.clipboardData.getData("text");return!!n(s)&&!i.getNodes().some(a=>R(a))&&(e.dispatchCommand($i,{...r,url:s}),o.preventDefault(),!0)},Gn)}))}function n5({commentType:e,onCommentTypeChange:t,isCommentTypeEditable:n=!0,actions:r,setIsLinkEditMode:o,onAddAttachments:i}){const[s]=ht(),[a,c]=T.useState({bold:!1,italic:!1,underline:!1,strikethrough:!1,code:!1}),[l,f]=T.useState(null),u=T.useRef(null),d=T.useRef(null),h=fh[e];T.useLayoutEffect(()=>s.registerUpdateListener(({editorState:b})=>{b.read(()=>{const v=Z();if(!$(v))return;c({bold:v.hasFormat("bold"),italic:v.hasFormat("italic"),underline:v.hasFormat("underline"),strikethrough:v.hasFormat("strikethrough"),code:v.hasFormat("code")});let w=v.anchor.getNode(),A=null;for(;w;){if(ve(w)){const k=w.getListType();A=k==="bullet"||k==="number"?k:null;break}if(Se(w)){w=w.getParent();continue}w=w.getParent()}f(A)})}),[s]);const p=b=>{s.dispatchCommand(kn,b)},g=()=>{l!=="bullet"?s.dispatchCommand(p1,void 0):s.dispatchCommand(Wu,void 0)},m=()=>{l!=="number"?s.dispatchCommand(m1,void 0):s.dispatchCommand(Wu,void 0)},y=()=>{s.update(()=>{const b=Z();if(!$(b))return;["bold","italic","underline","strikethrough","code"].forEach(w=>{b.hasFormat(w)&&s.dispatchCommand(kn,w)})})};return x.jsxs("div",{className:_e("cnf:flex cnf:items-center cnf:w-full",r?"cnf:justify-between":"cnf:justify-end"),children:[x.jsxs("div",{className:"cnf:flex cnf:items-center cnf:gap-1",children:[x.jsx(uu,{placement:"top-start",minWidth:"fit-content",title:"text formatting menu",trigger:x.jsx(je,{category:"link",size:"smallCollapse",color:"gray400",children:x.jsx(Ce,{icon:PS})}),children:x.jsxs("ul",{className:"cnf:flex cnf:items-start cnf:flex-col",children:[x.jsx("li",{className:"cnf:flex cnf:items-center cnf:w-full",children:x.jsxs("button",{type:"button",title:"Bold",onClick:()=>p("bold"),className:_e("cnf:cursor-pointer cnf:w-full cnf:h-full cnf:justify-start cnf:text-left cnf:p-2 cnf:hover:bg-gray-100",a.bold?"cnf:text-white cnf:bg-primary-600 cnf:hover:bg-primary-700":"cnf:text-gray-400 cnf:hover:text-gray-400"),children:[x.jsx(Ce,{icon:CS,className:"cnf:mr-2"}),"Bold"]})}),x.jsx("li",{className:"cnf:flex cnf:items-center cnf:w-full",children:x.jsxs("button",{type:"button",title:"Italic",onClick:()=>p("italic"),className:_e("cnf:cursor-pointer cnf:w-full cnf:h-full cnf:justify-start cnf:text-left cnf:p-2 cnf:hover:bg-gray-100",a.italic?"cnf:text-white cnf:bg-primary-600 cnf:hover:bg-primary-700":"cnf:text-gray-400 cnf:hover:text-gray-400"),children:[x.jsx(Ce,{icon:ES,className:"cnf:mr-2"}),"Italic"]})}),x.jsx("li",{className:"cnf:flex cnf:items-center cnf:w-full",children:x.jsxs("button",{type:"button",title:"Underline",onClick:()=>p("underline"),className:_e("cnf:cursor-pointer cnf:w-full cnf:h-full cnf:justify-start cnf:text-left cnf:p-2 cnf:hover:bg-gray-100",a.underline?"cnf:text-white cnf:bg-primary-600 cnf:hover:bg-primary-700":"cnf:text-gray-400 cnf:hover:text-gray-400"),children:[x.jsx(Ce,{icon:AS,className:"cnf:mr-2"}),"Underline"]})}),x.jsx("li",{className:"cnf:flex cnf:items-center cnf:w-full",children:x.jsxs("button",{type:"button",title:"Strikethrough",onClick:()=>p("strikethrough"),className:_e("cnf:cursor-pointer cnf:w-full cnf:h-full cnf:justify-start cnf:text-left cnf:p-2 cnf:hover:bg-gray-100",a.strikethrough?"cnf:text-white cnf:bg-primary-600 cnf:hover:bg-primary-700":"cnf:text-gray-400 cnf:hover:text-gray-400"),children:[x.jsx(Ce,{icon:wS,className:"cnf:mr-2"}),"Strikethrough"]})}),x.jsx("li",{className:"cnf:flex cnf:items-center cnf:w-full",children:x.jsxs("button",{type:"button",title:"Monospace",onClick:()=>p("code"),className:_e("cnf:cursor-pointer cnf:w-full cnf:h-full cnf:justify-start cnf:text-left cnf:p-2 cnf:hover:bg-gray-100",a.code?"cnf:text-white cnf:bg-primary-600 cnf:hover:bg-primary-700":"cnf:text-gray-400 cnf:hover:text-gray-400"),children:[x.jsx(Ce,{icon:TS,className:"cnf:mr-2"}),"Monospace"]})}),x.jsx("hr",{className:"cnf:w-full cnf:border-gray-200"}),x.jsx("li",{className:"cnf:flex cnf:items-center cnf:w-full",children:x.jsxs("button",{type:"button",title:"Clear formatting",onClick:y,className:"cnf:cursor-pointer cnf:w-full cnf:h-full cnf:justify-start cnf:text-left cnf:p-2 cnf:text-gray-400 cnf:hover:text-gray-400 cnf:hover:bg-gray-100",children:[x.jsx(Ce,{icon:_S,className:"cnf:mr-2"}),"Clear formatting"]})})]})}),x.jsx(je,{category:"link",size:"smallCollapse",color:"gray400",title:"Format bullet list",onClick:g,children:x.jsx(Ce,{icon:MS})}),x.jsx(je,{category:"link",size:"smallCollapse",color:"gray400",title:"Format numbered list",onClick:m,children:x.jsx(Ce,{icon:SS})}),x.jsx(je,{category:"link",size:"smallCollapse",color:"gray400",title:"Format link",onClick:()=>{o(!0),s.dispatchCommand($i,"https://")},children:x.jsx(Ce,{icon:OS})}),i&&x.jsxs(x.Fragment,{children:[x.jsx(je,{category:"link",size:"smallCollapse",color:"gray400",title:"Add image",className:"cnf:border-l-1 cnf:border-gray-200 cnf:rounded-none",onClick:()=>{var b;(b=u.current)==null||b.click()},children:x.jsx(Ce,{icon:kS})}),x.jsx(je,{category:"link",size:"smallCollapse",color:"gray400",title:"Add file",onClick:()=>{var b;(b=d.current)==null||b.click()},children:x.jsx(Ce,{icon:NS})})]}),n&&x.jsx(uu,{placement:"top-end",title:"comment type menu",trigger:x.jsx(je,{category:"link",size:"smallCollapse",className:`${h.iconColor} cnf:border-l-1 cnf:border-gray-200 cnf:rounded-none`,children:x.jsx(Ce,{icon:h.icon})}),children:x.jsx("ul",{className:"cnf:flex cnf:items-center cnf:justify-between cnf:gap-2 cnf:p-3",children:y1.map(b=>x.jsx("li",{children:x.jsx(je,{category:"link",size:"none",title:b.title,className:_e(b.color,e===b.type?b.color:"cnf:text-gray-400"),onClick:()=>t==null?void 0:t(b.type),children:x.jsx(Ce,{icon:b.icon})})},b.type))})})]}),r,x.jsx("input",{type:"file",hidden:!0,id:"image-input",multiple:!0,ref:u,accept:"image/*",onChange:b=>{const v=b.target.files;v&&(i==null||i(v))}}),x.jsx("input",{type:"file",hidden:!0,id:"file-input",multiple:!0,ref:d,accept:"*",onChange:b=>{const v=b.target.files;v&&(i==null||i(v))}})]})}function r5({hasStrictIndent:e=!1}){const[t]=ht();return T.useEffect(()=>{if(!t.hasNodes([sa,ts]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[t]),T.useEffect(()=>{if(e)return ZN(t)},[t,e]),(function(n){T.useEffect(()=>GN(n),[n])})(t),null}function o5({validateUrl:e,attributes:t}){const[n]=ht();return T.useEffect(()=>{if(!n.hasNodes([Ho]))throw new Error("LinkPlugin: LinkNode not registered on editor")}),T.useEffect(()=>t5(n,Gx({attributes:t,validateUrl:e})),[n,e,t]),null}const i5=new Set(["http:","https:","mailto:","sms:","tel:"]);function qg(e){try{const t=new URL(e);if(!i5.has(t.protocol))return"about:blank"}catch{return e}return e}function Vg(e,t,n,r=10,o=5){const i=n.parentElement;if(e===null||!i){t.style.opacity="0",t.style.transform="translate(-10000px, -10000px)";return}const s=t.getBoundingClientRect(),a=n.getBoundingClientRect(),c=i.getBoundingClientRect();let l=e.top-r,f=e.left-o;l<c.top&&(l+=s.height+e.height+r*2),f+s.width>c.right&&(f=c.right-s.width-o),l-=a.top,f-=a.left,t.style.opacity="1",t.style.transform=`translate(${f}px, ${l}px)`}function wc(e){const t=e.anchor,n=e.focus,r=e.anchor.getNode(),o=e.focus.getNode();return r===o?r:e.isBackward()?gg(n)?r:o:gg(t)?r:o}function s5({editor:e,isLink:t,setIsLink:n,anchorElem:r,isLinkEditMode:o,setIsLinkEditMode:i}){const s=T.useRef(null),[a,c]=T.useState(""),[l,f]=T.useState("https://"),[u,d]=T.useState(null),h=T.useCallback(()=>{var A,k;const m=Z();if($(m)){const _=wc(m),E=at(_,ft);E?c(E.getURL()):ft(_)?c(_.getURL()):c(""),o&&f(a)}else if(ot(m)){const _=m.getNodes();if(_.length>0){const E=_[0],N=E.getParent();ft(N)?c(N.getURL()):ft(E)?c(E.getURL()):c(""),o&&f(a)}}const y=s.current,b=en(e._window),v=document.activeElement;if(y===null)return;const w=e.getRootElement();if(m!==null&&w!==null&&e.isEditable()){let _;if(ot(m)){const E=m.getNodes();if(E.length>0){const N=e.getElementByKey(E[0].getKey());N&&(_=N.getBoundingClientRect())}}else b!==null&&w.contains(b.anchorNode)&&(_=(k=(A=b.focusNode)==null?void 0:A.parentElement)==null?void 0:k.getBoundingClientRect());_&&(_.y+=40,Vg(_,y,r)),d(m)}else(!v||v.className!=="link-input")&&(w!==null&&Vg(null,y,r),d(null),i(!1),c(""));return!0},[r,e,i,o,a]);T.useEffect(()=>{const m=r.parentElement,y=()=>{e.getEditorState().read(()=>{h()})};return window.addEventListener("resize",y),m&&m.addEventListener("scroll",y),()=>{window.removeEventListener("resize",y),m&&m.removeEventListener("scroll",y)}},[r.parentElement,e,h]),T.useEffect(()=>un(e.registerUpdateListener(({editorState:m})=>{m.read(()=>{h()})}),e.registerCommand(Qc,()=>(h(),!0),Gn),e.registerCommand(Rd,()=>t?(n(!1),!0):!1,o6)),[e,h,n,t]),T.useEffect(()=>{e.getEditorState().read(()=>{h()})},[e,h]),T.useEffect(()=>{const m=s.current;if(m===null)return;const y=b=>{!m.contains(b.relatedTarget)&&t&&(n(!1),i(!1))};return m.addEventListener("focusout",y),()=>{m.removeEventListener("focusout",y)}},[n,i,t]);const p=m=>{m.key==="Enter"?g(m):m.key==="Escape"&&(m.preventDefault(),i(!1))},g=m=>{m.preventDefault(),u!==null&&(a!==""&&e.update(()=>{e.dispatchCommand($i,qg(l));const y=Z();if($(y)){const b=wc(y).getParent();if(so(b)){const v=Co(b.getURL(),{rel:b.__rel,target:b.__target,title:b.__title});b.replace(v,!0)}}}),f("https://"),i(!1))};return x.jsx("div",{ref:s,className:"cnf:absolute cnf:flex cnf:top-0 cnf:left-0 cnf:shadow-lg cnf:bg-white cnf:z-10 cnf:rounded-sm cnf:w-full cnf:max-w-400",children:t?o?x.jsxs("div",{className:"cnf:flex cnf:justify-between cnf:w-full cnf:items-center cnf:p-2",children:[x.jsx(Ny,{containerClassName:"cnf:px-0 cnf:mr-2",autoFocus:!0,className:"cnf:mt-0",value:l,onChange:m=>{f(m.target.value)},onKeyDown:m=>{p(m)}}),x.jsxs("div",{className:"cnf:flex cnf:justify-center cnf:items-center cnf:gap-4",children:[x.jsx(je,{size:"none",category:"link",color:"gray400",tabIndex:0,onMouseDown:m=>m.preventDefault(),onClick:()=>{i(!1)},children:x.jsx(Ce,{icon:Dc})}),x.jsx(je,{size:"none",category:"link",color:"gray400",tabIndex:0,onMouseDown:m=>m.preventDefault(),onClick:g,children:x.jsx(Ce,{icon:zy})})]})]}):x.jsxs("div",{className:"cnf:flex cnf:justify-between cnf:w-full cnf:items-center cnf:p-2",children:[x.jsx("a",{href:qg(a),target:"_blank",rel:"noopener noreferrer",children:a}),x.jsxs("div",{className:"cnf:flex cnf:items-center cnf:gap-4",children:[x.jsx(je,{size:"none",category:"link",color:"gray400",tabIndex:0,onMouseDown:m=>m.preventDefault(),onClick:()=>{f(a),i(!0)},children:x.jsx(Ce,{icon:QC})}),x.jsx(je,{size:"none",category:"link",color:"gray400",tabIndex:0,onMouseDown:m=>m.preventDefault(),onClick:()=>e.dispatchCommand($i,null),children:x.jsx(Ce,{icon:sk})})]})]}):null})}function a5(e,t,n,r){const[o,i]=T.useState(e),[s,a]=T.useState(!1);return T.useEffect(()=>{function c(){const l=Z();if($(l)){const f=wc(l),u=at(f,ft),d=at(f,so);if(!(u||d)){a(!1);return}const h=l.getNodes().filter(p=>!xo(p)).find(p=>{const g=at(p,ft),m=at(p,so);return u&&!u.is(g)||g&&!g.is(u)||d&&!d.is(m)||m&&(!m.is(d)||m.getIsUnlinked())});a(!h)}else if(ot(l)){const f=l.getNodes();if(f.length===0){a(!1);return}const u=f[0],d=u.getParent();ft(d)||ft(u)?a(!0):a(!1)}}return un(e.registerUpdateListener(({editorState:l})=>{l.read(()=>{c()})}),e.registerCommand(Qc,(l,f)=>(c(),i(f),!1),hx),e.registerCommand(Md,l=>{const f=Z();if($(f)){const u=wc(f),d=at(u,ft);if(ft(d)&&(l.metaKey||l.ctrlKey))return window.open(d.getURL(),"_blank"),!0}return!1},Gn))},[e]),Nn.createPortal(x.jsx(s5,{editor:o,isLink:s,anchorElem:t,setIsLink:a,isLinkEditMode:n,setIsLinkEditMode:r}),t)}function c5({anchorElem:e=document.body,isLinkEditMode:t,setIsLinkEditMode:n}){const[r]=ht();return a5(r,e,t,n)}const l5=({url:e,onDelete:t})=>x.jsxs("div",{className:"cnf:relative",children:[x.jsx("img",{src:e,alt:"Thumbnail",width:75,height:75,className:"cnf:w-[75px] cnf:h-[75px] cnf:object-cover cnf:rounded-lg cnf:border cnf:border-gray-200"}),x.jsx(je,{size:"smallCollapse",title:"Delete attachment",onClick:t,className:"cnf:absolute cnf:top-1 cnf:left-1 cnf:w-[20px] cnf:h-[20px] cnf:rounded-full",color:"secondary",children:x.jsx(Ce,{icon:jy})})]}),f5=({onRemoveFile:e,type:t,label:n})=>{const r=t.toLowerCase(),o=Ib(r);return x.jsxs("div",{className:"cnf:relative cnf:flex cnf:items-center cnf:justify-center cnf:rounded cnf:border cnf:border-gray-200",children:[x.jsx(je,{size:"smallCollapse",color:"secondary",className:"cnf:absolute cnf:top-1 cnf:left-1 cnf:w-[20px] cnf:h-[20px] cnf:rounded-full",title:"Remove file",onClick:e,children:x.jsx(Ce,{icon:jy})}),x.jsxs("div",{className:"cnf:flex cnf:items-center cnf:justify-center cnf:mx-2",children:[x.jsx("span",{className:"cnf:text-primary-600 cnf:my-2",children:x.jsx(Ce,{icon:o,size:"3x",className:"cnf:text-primary-600"})}),x.jsx("span",{className:"cnf:font-bold cnf:p-2",children:n})]})]})},u5=({clearKey:e})=>{const[t]=ht(),n=T.useRef(e);return T.useEffect(()=>{n.current!==e&&(t.update(()=>{We().clear()}),n.current=e)},[e,t]),null},d5=({isOpen:e})=>{const[t]=ht(),n=T.useRef(!1);return T.useEffect(()=>{if(!e){n.current=!1;return}if(n.current)return;const r=()=>{const o=t.getRootElement();if(!o){requestAnimationFrame(r);return}n.current=!0;const i=window.scrollX,s=window.scrollY;try{o.focus({preventScroll:!0})}catch{o.focus()}requestAnimationFrame(()=>window.scrollTo(i,s)),setTimeout(()=>window.scrollTo(i,s),0)};r()},[t,e]),null},h5=({initialValue:e})=>{const[t]=ht(),n=T.useCallback((o,i)=>{const a=new DOMParser().parseFromString(i,"text/html");return t1(o,a)},[]),r=T.useRef(!1);return T.useEffect(()=>{!r.current&&e&&(t.update(()=>{We().clear(),sx(n(t,e))}),r.current=!0)},[t,e,n]),null},p5=({onChange:e})=>{const[t]=ht();return x.jsx(DN,{onChange:n=>{n.read(()=>{const r=n1(t,null);e(r)})}})},m5=({onAddAttachments:e})=>{const[t]=ht();return T.useEffect(()=>{if(!e)return;const n=t.getRootElement();if(!n)return;const r=o=>{const i=o.clipboardData;if(!i)return;const s=i.items;let a=!1;for(let c=0;c<s.length;c++){const l=s[c];if(l.kind==="file"&&l.type.startsWith("image/")){a=!0;break}}if(a){for(let c=0;c<s.length;c++){const l=s[c];if(l.kind==="file"&&l.type.startsWith("image/")){const f=l.getAsFile();if(f){const u=Date.now(),d=f.type.split("/")[1]||"png",h=`image_${u}.${d}`,p=new File([f],h,{type:f.type});e==null||e([p])}}}o.preventDefault(),o.stopPropagation()}};return n.addEventListener("paste",r,!0),()=>{n.removeEventListener("paste",r,!0)}},[t,e]),null},g5=({onSubmit:e})=>{const[t]=ht();return T.useEffect(()=>{if(e)return t.registerCommand(Fs,n=>n&&!n.shiftKey?(n.preventDefault(),e(),!0):!1,1)},[t,e]),null},y5=({setIsLinkEditMode:e})=>{const[t]=ht();return T.useEffect(()=>{const n=t.getRootElement();if(!n)return;const r=o=>{const i=o.metaKey||o.ctrlKey,s=o.key==="k"||o.key==="K";i&&s&&t.getEditorState().read(()=>{const a=Z();$(a)&&!a.isCollapsed()&&(o.preventDefault(),e(!0),t.dispatchCommand($i,"https://"))})};return n.addEventListener("keydown",r),()=>{n.removeEventListener("keydown",r)}},[t,e]),null};function g1({attachments:e,clearKey:t=0,inputFieldClassName:n="",containerClassName:r="",initialValue:o,onChange:i,commentType:s,onCommentTypeChange:a,isCommentTypeEditable:c=!0,actions:l,onAddAttachments:f,onRemoveAttachment:u,onSubmit:d,isOpen:h}){const p={namespace:"comment-editor",theme:UN,nodes:[sa,ts,Ho],onError:A=>{console.error(A)}},[g,m]=T.useState(null),[y,b]=T.useState(!1),v=A=>{A!==null&&m(A)},w=fh[s];return x.jsx("div",{className:r,children:x.jsxs(L6,{initialConfig:p,children:[x.jsxs("div",{className:"cnf:relative",children:[x.jsx(_N,{contentEditable:x.jsx("div",{ref:v,children:x.jsx(MN,{className:_e("cnf:p-3 cnf:outline-none cnf:border-0 cnf:w-full cnf:border-t cnf:border-gray-200 cnf:rounded-none cnf:border-l-3",w.bg,w.border,w.fontColor,n)})}),placeholder:x.jsx("div",{className:"cnf:absolute cnf:top-3 cnf:left-4 cnf:text-gray-400 cnf:pointer-events-none",children:"Type comment…"}),ErrorBoundary:$N}),x.jsx(r5,{}),x.jsx(o5,{}),g&&x.jsx(c5,{anchorElem:g,isLinkEditMode:y,setIsLinkEditMode:b}),x.jsx(NN,{}),x.jsx(h5,{initialValue:o}),x.jsx(p5,{onChange:i}),x.jsx(g5,{onSubmit:d}),x.jsx(y5,{setIsLinkEditMode:b}),x.jsx(u5,{clearKey:t}),x.jsx(m5,{onAddAttachments:f}),x.jsx(d5,{isOpen:h})]}),e&&e.length>0&&x.jsx("div",{className:"cnf:flex cnf:flex-wrap cnf:justify-start cnf:gap-2 cnf:p-4",children:e.map(A=>md(A.type)?x.jsx(l5,{url:A.url,onDelete:()=>u==null?void 0:u(A.originFile)},A.originFile.name):x.jsx(f5,{type:A.type,label:A.name,onRemoveFile:()=>u==null?void 0:u(A.originFile)},A.originFile.name))}),x.jsx("div",{className:"cnf:border-t cnf:border-gray-200 cnf:p-2 cnf:flex cnf:justify-end",children:x.jsx(n5,{commentType:s,onCommentTypeChange:a,isCommentTypeEditable:c,actions:l,setIsLinkEditMode:b,onAddAttachments:f})})]})})}const b5=({asset:e,onSetActiveSrc:t})=>x.jsxs("div",{className:"cnf:relative cnf:border cnf:border-gray-200 cnf:rounded-md cnf:h-[110px] cnf:w-full cnf:hover:border-primary-500",children:[x.jsx("img",{src:za(e),onClick:()=>t(za(e)),onKeyDown:n=>{n.key==="Enter"&&t(za(e))},alt:e.name,className:"cnf:w-full cnf:h-full cnf:object-cover cnf:rounded-md cnf:object-center cnf:cursor-zoom-in"}),(e==null?void 0:e.uploading)&&x.jsx("div",{className:"cnf:absolute cnf:bottom-2 cnf:w-full cnf:max-w-md cnf:mx-auto cnf:px-2",children:x.jsx("div",{className:"cnf:relative cnf:h-2 cnf:overflow-hidden cnf:rounded-full cnf:bg-gray-200",children:x.jsx("div",{className:"cnf:absolute cnf:left-0 cnf:top-0 cnf:h-full cnf:w-1/3 cnf:rounded-full cnf:bg-blue-500 cnf:animate-progress"})})})]}),v5=({asset:e})=>{var r,o;const t=((o=(r=e==null?void 0:e.mimeType)==null?void 0:r.split("/").pop())==null?void 0:o.toLowerCase())||"",n=Ib(t);return x.jsxs("div",{className:"cnf:flex cnf:gap-2",children:[(e==null?void 0:e.uploading)&&x.jsx("div",{className:"cnf:flex cnf:items-center cnf:justify-center",children:x.jsx("div",{className:"cnf:h-4 cnf:w-4 cnf:rounded-full cnf:border-2 cnf:border-gray-300 cnf:border-t-blue-500 cnf:animate-spin"})}),x.jsx(Ce,{icon:n,size:"lg",className:"cnf:text-primary-600"}),x.jsx("a",{href:za(e),className:"cnf:text-sm cnf:text-blue-600 cnf:underline",download:!0,target:"_blank",rel:"noopener noreferrer",children:e.name})]})},x5=({commentType:e=dt.INFO,author:t,username:n,comment:r,createdDate:o,onDelete:i,onEdit:s,hasAssets:a,taskAssets:c,taskVerified:l})=>{const u={[dt.INFO]:{bg:"cnf:bg-primary-100",border:"cnf:border-primary-200",icon:Dy,iconColor:"cnf:text-primary-600 cnf:hover:text-primary-600",text:"cnf:text-primary-900"},[dt.WARNING]:{bg:"cnf:bg-warning-100",border:"cnf:border-warning-200",icon:My,iconColor:"cnf:text-warning-600 cnf:hover:text-warning-600",text:"cnf:text-warning-900"},[dt.DANGER]:{bg:"cnf:bg-danger-100",border:"cnf:border-danger-200",icon:$y,iconColor:"cnf:text-danger-600 cnf:hover:text-danger-600",text:"cnf:text-danger-900"},[dt.SUCCESS]:{bg:"cnf:bg-success-100",border:"cnf:border-success-200",icon:Ly,iconColor:"cnf:text-success-600 cnf:hover:text-success-600",text:"cnf:text-success-900"}}[e],d=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(o||"")).replace(",",""),[h,p]=T.useState(!1),[g,m]=T.useState(zl(r)),[y,b]=T.useState(e),[v,w]=T.useState(""),A=()=>{p(!0)},k=()=>{const N=iu.sanitize(g);s(N,y),p(!1)},_=N=>{const P=iu.sanitize(g);b(N),s(P,N),p(!1)},E=()=>{p(!1)};return x.jsxs("div",{className:"cnf:flex cnf:items-start cnf:space-x-4 cnf:w-full",children:[x.jsx(KT,{alt:t}),x.jsxs("div",{className:"cnf:flex-1 cnf:min-w-0",children:[x.jsxs("div",{className:`cnf:border ${u.border} cnf:rounded-sm ${u.bg} cnf:shadow-sm cnf:flex cnf:flex-col cnf:items-start cnf:justify-between cnf:w-full`,children:[x.jsx("div",{className:"cnf:p-3 cnf:flex cnf:flex-col cnf:items-start cnf:justify-between cnf:w-full",children:x.jsxs("div",{className:"cnf:w-full",children:[x.jsxs("div",{className:"cnf:flex cnf:items-center cnf:mb-2 cnf:justify-between",children:[x.jsxs("div",{children:[x.jsx(Ce,{icon:u.icon,size:"lg",className:`cnf:mr-2 ${u.iconColor}`}),x.jsx("span",{className:`cnf:font-semibold cnf:text-sm ${u.text}`,children:t})]}),x.jsx(qT,{commentType:e,taskVerified:l,isUsernameAuthor:n.trim()===t.trim(),onEdit:A,onSaveCommentType:_,onDelete:i})]}),h?x.jsx(g1,{inputFieldClassName:"cnf:bg-white cnf:border-0 cnf:rounded-sm",containerClassName:"cnf:bg-white cnf:border-0 cnf:rounded-sm",onChange:m,commentType:e,isCommentTypeEditable:!1,initialValue:zl(r),actions:x.jsxs("div",{className:"cnf:flex cnf:items-center cnf:gap-2",children:[x.jsx(je,{category:"outline",size:"smallCollapse",color:"secondary",onClick:E,title:"Cancel edit",children:"Cancel"}),x.jsx(je,{category:"solid",size:"smallCollapse",color:"primary",onClick:k,title:"Save edit",disabled:$a(g),children:"Save"})]})}):x.jsx("div",{className:`cnf:text-sm ${u.text}`,dangerouslySetInnerHTML:{__html:zl(r)}})]})}),a&&c&&(c==null?void 0:c.length)>0&&x.jsx("div",{className:`${u.border} cnf:border-t cnf:w-full cnf:p-2 cnf:flex cnf:gap-2 cnf:flex-wrap`,children:c.map(N=>x.jsx(T.Fragment,{children:md(N.mimeType)?x.jsx(b5,{asset:N,onSetActiveSrc:w}):x.jsx(v5,{asset:N})},N.assetId))})]}),x.jsxs("div",{className:"cnf:flex cnf:gap-2 cnf:my-1",children:[o&&x.jsx("time",{dateTime:o,className:"cnf:text-xs cnf:text-gray-500 cnf:opacity-60",children:d}),l&&x.jsxs("span",{className:"cnf:text-xs cnf:text-success-600 cnf:font-semibold cnf:flex cnf:items-center cnf:gap-1",children:[x.jsx(Ce,{icon:Ry}),"Comment Required"]})]})]}),x.jsx(_T,{plugins:[BT],open:!!v,zoom:{maxZoomPixelRatio:2},close:()=>w(""),styles:{root:{zIndex:9999999999}},carousel:{finite:!0,preload:0},controller:{closeOnBackdropClick:!0},slides:[{src:v}]})]})},fh={[dt.INFO]:{icon:lk,bg:"cnf:bg-primary-100",border:"cnf:border-l-primary-500",iconColor:"cnf:text-primary-600 cnf:hover:text-primary-700",fontColor:"cnf:text-primary-900"},[dt.WARNING]:{icon:GC,bg:"cnf:bg-warning-100",border:"cnf:border-l-warning-500",iconColor:"cnf:text-warning-600 cnf:hover:text-warning-700",fontColor:"cnf:text-warning-900"},[dt.DANGER]:{icon:dk,bg:"cnf:bg-danger-100",border:"cnf:border-l-danger-500",iconColor:"cnf:text-danger-600 cnf:hover:text-danger-700",fontColor:"cnf:text-danger-900"},[dt.SUCCESS]:{icon:Ry,bg:"cnf:bg-success-100",border:"cnf:border-l-success-500",iconColor:"cnf:text-success-600 cnf:hover:text-success-700",fontColor:"cnf:text-success-900"}},y1=Object.entries(fh).map(([e,t])=>({type:e,icon:t.icon,color:t.iconColor,title:`Change comment type to ${e}`})),w5=({comments:e,onClose:t,isOpen:n,taskName:r,taskInstanceId:o,isLoading:i,playbookInstanceId:s,taskVerification:a})=>{const[c,l]=T.useState(""),[f,u]=T.useState(dt.INFO),[d,h]=T.useState(0),[p,g]=T.useState([]),m=T.useRef(null),{username:y}=b1(),{manageComment:b}=h4({playbookInstanceId:s}),v=()=>{const P=p.length,W=p.some(z=>!md(z.mimeType))?"Attachment":"Image",j=P>1?"s":"";return`<p class="cnf:m-0"><span style="white-space: pre-wrap;">${W}${j} added.</span></p>`},w=P=>{const I=Array.from(P).map((W,j)=>o4(W,p.length+j+1));g(W=>[...W,...I])},A=P=>{g(I=>I.filter(W=>W.originFile!==P))},k=P=>{u(P)},_=async()=>{if(!p.length&&$a(c)||!o)return;p.length>0&&g([]);const P=iu.sanitize(c);l(""),h(I=>I+1),await b({action:"add",comment:p.length>0&&$a(c)?v():P,username:y||"",commentType:f,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,hasAssets:p.length>0,taskInstanceId:o,taskVerified:a,attachments:p}),u(dt.INFO)},E=async P=>{o&&await b({username:y||"",action:"delete",taskVerified:!1,taskInstanceId:o,commentId:P})},N=async({commentId:P,comment:I,commentType:W,hasAssets:j,isAlreadyVerified:z})=>{o&&await b({action:"edit",username:y||"",...I&&{comment:I},taskInstanceId:o,commentId:P,hasAssets:j,taskVerified:z,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,commentType:W})};return T.useLayoutEffect(()=>{m.current&&n&&!i&&e.length>0&&(m.current.scrollTop=m.current.scrollHeight)},[n,i,e.length]),x.jsxs("div",{className:_e("cnf:transition-all cnf:duration-300 cnf:fixed cnf:bg-white cnf:right-0 cnf:bottom-0 cnf:h-[100vh] cnf:z-[9999999998] cnf:flex cnf:flex-col cnf:min-w-[270px] cnf:max-w-[420px] cnf:w-[calc(100vw-1rem)] cnf:border cnf:border-gray-200 cnf:rounded-t-sm cnf:overflow-hidden",n?"cnf:translate-y-0 cnf:opacity-100":"cnf:translate-y-full cnf:opacity-0 cnf:pointer-events-none"),children:[x.jsxs("div",{className:"cnf:flex cnf:items-center cnf:justify-between cnf:gap-2 cnf:border-b cnf:border-gray-200 cnf:px-2 cnf:py-4 cnf:w-full",children:[x.jsx("h6",{className:"cnf:font-semibold cnf:text-gray-900 cnf:truncate cnf:max-w-[300px]",children:r}),x.jsx(je,{color:"grayLight",size:"smallCollapse",rounded:"none",title:"Close comment box",onClick:t,children:x.jsx(Ce,{icon:Dc,className:"cnf:size-4 cnf:text-gray-300"})})]}),x.jsxs("div",{ref:m,className:"cnf:flex cnf:flex-col cnf:flex-1 cnf:overflow-y-auto",children:[x.jsxs("div",{className:"cnf:flex cnf:flex-col cnf:justify-end cnf:flex-1 cnf:gap-4 cnf:p-4 cnf:pb-[102px]",children:[i&&x.jsx("div",{className:"cnf:flex cnf:flex-col cnf:gap-3",children:[1,2,3].map(P=>x.jsx("div",{className:"cnf:h-16 cnf:animate-pulse cnf:rounded-lg cnf:bg-gray-100"},P))}),(e==null?void 0:e.length)>0&&!i&&e.map(P=>x.jsx(x5,{username:y||"",onDelete:()=>E(P.commentId),onEdit:(I,W)=>N({commentId:P.commentId,comment:I,commentType:W,hasAssets:P.hasAssets,isAlreadyVerified:P.taskVerified}),...P},P.commentId)),(e==null?void 0:e.length)===0&&!i&&x.jsxs("div",{className:"cnf:flex cnf:flex-1 cnf:flex-col cnf:items-center cnf:justify-end cnf:gap-3 cnf:text-center cnf:mb-1",children:[x.jsx("img",{src:n4,className:"cnf:opacity-70",alt:"Empty"}),x.jsx("p",{className:"cnf:text-gray-400",children:"There is no discussion in this Task."})]})]}),x.jsx(g1,{attachments:p,onChange:l,containerClassName:"cnf:fixed cnf:bottom-0 cnf:left-0 cnf:right-0 cnf:bg-white",clearKey:d,commentType:f,onCommentTypeChange:k,onAddAttachments:w,onRemoveAttachment:A,onSubmit:_,isOpen:n,actions:x.jsx(je,{category:"link",size:"normalCollapse",title:"Send comment",onClick:_,disabled:$a(c)&&p.length===0,children:x.jsx(Ce,{icon:IS})})})]})]})},A5=kc.replace(/:root,\s*:host/g,":host"),Ku=T.createContext({comments:[],openTaskDetails:null,username:void 0,setOpenTaskDetails:()=>{},prefetchQuery:e=>{}}),b1=()=>{if(!T.useContext(Ku))throw new Error("useCommentContext must be used within a CommentProvider");return T.useContext(Ku)},C5=({playbookInstanceId:e,children:t,username:n})=>{const[r,o]=T.useState({taskInstanceId:null,taskName:"",taskVerification:!1}),{taskInstanceId:i,taskName:s,taskVerification:a}=r||{taskInstanceId:null,taskName:"",taskVerification:!1},{comments:c,isLoading:l,prefetchQuery:f}=l4({taskInstanceId:i||0,enabled:i!==null,username:n});return x.jsxs(Ku.Provider,{value:{comments:c,openTaskDetails:r,setOpenTaskDetails:o,prefetchQuery:f,username:n},children:[t,Nn.createPortal(x.jsxs("div",{id:"cnfdnc-comment-box-root",children:[x.jsx("style",{children:A5}),x.jsx("div",{className:"confidence-playbook",children:x.jsx(w5,{playbookInstanceId:e,comments:c,onClose:()=>o(null),isOpen:!!i,taskName:s,taskInstanceId:i,isLoading:l,taskVerification:a})})]}),LS)]})},k5={[Be.OPEN]:"cnf:border-[#C1C5C8] cnf:bg-[#F0F1F2]",[Be.IN_PROGRESS]:"cnf:bg-[#E6F2FF] cnf:border-[#94C8FF]",[Be.IN_REVIEW]:"cnf:bg-[#EAF6EC] cnf:border-[#A5DAB1]",[Be.COMPLETED]:"cnf:bg-[#EAF6EC] cnf:border-[#A5DAB1]"},Bn={PHOTO:"photo",SCREENSHOT:"screenshot",COMMENT:"comment",NO_VERIFICATION:null},_5=({task:e,step:t,playbookType:n,onButtonClick:r,viewMode:o="card",canStart:i=!1,isExpanded:s=!1,toggleExpanded:a,playbookId:c,taskStyle:l,listStickyTopBase:f})=>{const[u,d]=T.useState(!1),{taskDetails:h,prefetchQuery:p}=DE({taskId:e.taskId,playbookId:c,enabled:s}),{setOpenTaskDetails:g,prefetchQuery:m}=b1(),{buttons:y}=Bw({taskStatus:e.workflowStatus,canStart:i}),b=T.useMemo(()=>e.imageRequired===0?Bn.NO_VERIFICATION:e.imageRequired===1?Bn.SCREENSHOT:e.imageRequired===2?Bn.PHOTO:e.imageRequired===4?Bn.COMMENT:null,[e.imageRequired]),v=async w=>{try{d(!0),await r(w)}finally{d(!1)}};if(o==="list"){const w=T.useMemo(()=>e.workflowStatus===Be.COMPLETED?"success":e.workflowStatus===Be.IN_PROGRESS?"primary":"default",[e.workflowStatus]),A=T.useMemo(()=>{const k=[];return y.forEach(_=>{_==="START"&&k.push({id:"START",color:"primary",action:"Start",to:Be.IN_PROGRESS}),_==="COMPLETE"&&(!e.taskVerified&&b===Bn.COMMENT&&k.push({id:"ADD_COMMENT",color:"danger",action:"Add Comment",to:"Required"}),k.push({id:"COMPLETE",color:"success",action:"Complete",to:Be.COMPLETED,disabled:!e.taskVerified&&b===Bn.COMMENT}))}),k},[y,b,e.taskVerified]);return x.jsxs("div",{className:_e("cnf:flex cnf:flex-col"),children:[x.jsxs("div",{className:_e("cnf:flex cnf:items-center cnf:gap-3 cnf:p-2 cnf:border-gray-200",e.sequenceOrder>0&&"cnf:border-t",s&&"cnf:bg-white cnf:rounded-md cnf:border cnf:border-t-none cnf:shadow-sm cnf:sticky"),style:{top:s?f:0},children:[x.jsx("div",{className:"cnf:text-gray-200 cnf:text-base",children:e.sequenceOrder+1}),x.jsx("div",{onClick:()=>{a==null||a(!s)},onMouseOver:p,className:_e("cnf:flex-1 cnf:truncate cnf:cursor-pointer",s&&"cnf:font-medium",e.workflowStatus===Be.COMPLETED&&"cnf:text-secondary-400 cnf:line-through"),style:{color:e.workflowStatus===Be.IN_PROGRESS&&(l==null?void 0:l.titleColor)||"#1C232D"},children:e.taskInstanceName}),x.jsx(hS,{taskVerified:e.taskVerified,verificationType:b,title:e.workflowStatus,variant:w,transitions:A,onClick:k=>{if(k===fi.ADD_COMMENT){g({taskInstanceId:e.taskInstanceId,taskName:e.taskInstanceName,taskVerification:!0});return}r(k)}}),x.jsx(Yp,{onMouseOver:()=>m(e.taskInstanceId),commentsCount:(e==null?void 0:e.numberOfComments)||0,commentType:(e==null?void 0:e.recentCommentType)||dt.INFO,onClick:()=>g({taskInstanceId:e.taskInstanceId,taskName:e.taskInstanceName,taskVerification:!1})})]}),(h==null?void 0:h.description)&&x.jsx("div",{className:_e(!s&&"cnf:hidden","cnf:border-gray-200 cnf:border cnf:p-2 cnf:mx-4 cnf:mb-4 cnf:border-t-none cnf:-mt-[1px] cnf:bg-gray-100 cnf:rounded-b-md"),children:x.jsx(Vp,{description:(h==null?void 0:h.description)||""})})]})}return x.jsxs("div",{className:Es("cnf:flex cnf:items-stretch cnf:rounded-sm cnf:overflow-hidden cnf:border",k5[e.workflowStatus]),children:[x.jsx(yS,{playbookType:n,status:e.workflowStatus,step:t}),x.jsxs("div",{className:"cnf:flex cnf:w-full cnf:flex-col cnf:overflow-x-hidden cnf:flex-1 cnf:p-2",children:[n==="Sequential"&&x.jsx("div",{className:"cnf:-mb-3 cnf:self-end cnf:pr-2 cnf:pt-2",children:x.jsx(vS,{status:e.workflowStatus})}),x.jsxs("div",{className:"cnf:space-y-2 cnf:divide-y cnf:divide-black/10 cnf:flex cnf:flex-col cnf:flex-1",children:[x.jsx("div",{className:_e("cnf:text-lg cnf:font-medium cnf:flex-1 cnf:pb-1"),style:{color:e.workflowStatus==="Completed"?"#1C232D":(l==null?void 0:l.titleColor)||"#1C232D"},children:e.taskInstanceName}),b?x.jsxs("div",{className:"cnf:flex cnf:items-center cnf:gap-2 cnf:text-sm cnf:pb-2",children:[x.jsx(Ce,{icon:Iy,className:"cnf:size-4"}),x.jsxs("div",{children:[x.jsx("span",{className:"cnf:font-medium",children:b===Bn.PHOTO?"Photo":b===Bn.SCREENSHOT?"Screenshot":"Comment"})," ","required"]})]}):x.jsx(x.Fragment,{})]}),(h==null?void 0:h.description)&&x.jsx("div",{className:_e(!s&&"cnf:hidden"),children:x.jsx(Vp,{description:(h==null?void 0:h.description)||""})}),(y.length>0||e.hasDescription)&&x.jsxs("div",{className:"cnf:flex cnf:items-center cnf:justify-end cnf:gap-4 cnf:border-t cnf:border-black/10 cnf:pt-2",children:[x.jsx("div",{className:"cnf:flex-1",children:x.jsx(FE,{buttons:y,onButtonClick:v,disabled:u})}),x.jsx(Yp,{onMouseOver:()=>m(e.taskInstanceId),commentsCount:(e==null?void 0:e.numberOfComments)||0,commentType:(e==null?void 0:e.recentCommentType)||dt.INFO,onClick:()=>g({taskInstanceId:e.taskInstanceId,taskName:e.taskInstanceName,taskVerification:!1})}),a&&x.jsx(je,{size:"smallCollapse",onMouseOver:p,category:"link",onClick:()=>{a()},title:s?"Hide task description":"Show task description",children:x.jsx(Ce,{icon:Fy,className:Es("cnf:cursor-pointer cnf:text-[#0069D9]",s?"cnf:rotate-180":"")})})]})]})]})},v1=T.forwardRef(({title:e,className:t,playbookStyle:n,...r},o)=>{var i,s,a;return x.jsx("div",{ref:o,className:_e("cnf:border-b cnf:border-gray-200 cnf:flex cnf:items-center",t),style:{backgroundColor:((i=n==null?void 0:n.whiteLabel)==null?void 0:i.titleBackgroundColor)||"#f8f9fa"},...r,children:x.jsx("div",{className:_e("cnf:text-xl cnf:min-h-16 cnf:p-4 cnf:font-medium cnf:flex-1",{"cnf:text-dark":!((s=n==null?void 0:n.whiteLabel)!=null&&s.titleTextColor)}),style:{color:(a=n==null?void 0:n.whiteLabel)==null?void 0:a.titleTextColor},children:e})})});v1.displayName="PlaybookHeader";const E5=kc.replace(/:root,\s*:host/g,":host"),S5=({playbookInstanceId:e,playbookMode:t,playbookStyle:n,defaultExpanded:r=!0})=>{const{playbook:o,actions:i}=$w(e);if(!o)return x.jsx("div",{});const s=async(a,c)=>{var l;if(a===fi.COMPLETE){const f=(l=o.tasks.find(u=>u.taskInstanceId===c))==null?void 0:l.sequenceOrder;if(f===void 0){console.error("Task not found in playbook");return}return i.completeTask(c,f)}if(a===fi.START)return i.startTask(c)};return x.jsx("div",{className:"confidence-playbook",children:x.jsx(x1,{playbook:o,playbookMode:t,onTaskButtonClick:s,playbookStyle:n,defaultExpanded:r})})},T5=({className:e,children:t,numberOfTasks:n,playbookMode:r})=>x.jsxs("div",{className:_e("cnf:w-full cnf:p-4",e),children:[n&&x.jsxs("div",{className:_e(r==="card"&&"cnf:mb-4"),children:[x.jsx("span",{className:"cnf:font-medium",children:"Tasks"})," (",n,")"]}),x.jsx("div",{className:_e(r==="card"&&"cnf:space-y-4"),children:t})]}),x1=({playbook:e,playbookMode:t,onTaskButtonClick:n,playbookStyle:r,defaultExpanded:o=!0})=>{var y,b,v,w,A;const{playbookInstanceName:i,tasks:s}=e,a=T.useRef(null),[c,l]=T.useState(0),[f,u]=T.useState(()=>{const k=M2(e.playbookInstanceId);return k!==null?k:o}),d=()=>{u(k=>{const _=!k;return P2(e.playbookInstanceId,_),_})},{isTaskExpanded:h,toggleTaskExpanded:p,isAtLeastOneTaskExpanded:g}=T0(e.playbookInstanceId,{onTaskExpanded:()=>{var k;l(((k=a.current)==null?void 0:k.offsetHeight)||0)}});T.useEffect(()=>{if(g){if(!a.current)throw new Error("Playbook header ref is not set");new ResizeObserver(_=>{var E;for(const N of _)N.contentRect&&l(((E=a.current)==null?void 0:E.offsetHeight)||0)}).observe(a.current)}return()=>{a.current&&new ResizeObserver(()=>{}).unobserve(a.current)}},[g]);const m=T.useMemo(()=>{const k=s.filter(_=>_.workflowStatus===Be.COMPLETED).sort((_,E)=>E.sequenceOrder-_.sequenceOrder)[0];return k?k.sequenceOrder+1:0},[s]);return x.jsxs("div",{className:_e(!(r!=null&&r.overlay)&&"cnf:min-h-screen",(r==null?void 0:r.overlay)&&"cnf:fixed cnf:bottom-0 cnf:z-[9999999997] cnf:flex","cnf:transition-all cnf:duration-300 cnf:ease-in-out "),...(r==null?void 0:r.overlay)&&{style:{width:"100%",maxWidth:f?((y=r.overlay.size)==null?void 0:y.width)||450:"2.25rem",height:((b=r.overlay.size)==null?void 0:b.height)||"calc(100vh - 4rem)",maxHeight:"calc(100vh - 4rem)",right:((v=r.overlay.offset)==null?void 0:v.right)!==void 0?r.overlay.offset.right:r.overlay.position==="right"?32:void 0,left:((w=r.overlay.offset)==null?void 0:w.left)!==void 0?r.overlay.offset.left:r.overlay.position==="left"?32:void 0}},children:[(r==null?void 0:r.overlay)&&x.jsx("div",{onClick:d,className:_e("cnf:size-9 cnf:relative cnf:p-1 cnf:top-3 cnf:z-[9999999997] cnf:border-none cnf:rounded-l-sm cnf:cursor-pointer"),style:{backgroundColor:((A=r==null?void 0:r.whiteLabel)==null?void 0:A.primaryColor)||"#007BFF",boxShadow:"0px 3px 3px 0px #00000040"},children:x.jsx("img",{src:h0,alt:"Confidence Logo",className:"cnf:w-full cnf:h-full cnf:object-contain"})}),x.jsxs("div",{className:_e("cnf:flex cnf:flex-col cnf:flex-1 cnf:bg-gray-50",(r==null?void 0:r.overlay)&&"cnf:border cnf:border-gray-200 cnf:shadow-2xl cnf:rounded-t-sm cnf:overflow-y-auto"),children:[x.jsx(v1,{title:i,className:_e("cnf:top-0 cnf:sticky cnf:z-2"),playbookStyle:r,ref:a}),x.jsx(T5,{playbookMode:t,numberOfTasks:e.numberofTasks,children:s.map((k,_)=>{var E;return x.jsx(_5,{task:k,step:_+1,viewMode:t,playbookId:e.playbookId,canStart:k.sequenceOrder===m,onButtonClick:N=>n(N,k.taskInstanceId),playbookType:"Non-Sequential",taskStyle:{titleColor:(E=r==null?void 0:r.whiteLabel)==null?void 0:E.primaryColor},isExpanded:h(k.taskInstanceId),toggleExpanded:()=>p(k.taskInstanceId),listStickyTopBase:c||104},k.taskId)})})]})]})},N5=({email:e,playbookId:t,playbookMode:n,playbookStyle:r,bank:o="public-sdk",timezone:i="America/Los_Angeles",persistKey:s,defaultExpanded:a=!0})=>{const[c,l]=T.useState(null);return T.useEffect(()=>{(async()=>{const f=q0(t,s);if(f&&f.email===e){l(f.playbookInstanceId);return}const{playbookInstanceId:u,errorCode:d,details:h,message:p}=await N0({bank:o,email:e,timezone:i,playbookUid:t})||{};if(d)throw new Error(`Error initiating playbook: ${p} (Code: ${d}) - Details: ${h}`);if(!u)throw new Error("No playbook instance ID returned from initiation");H0(t,u,e,s),l(u)})()},[]),c?x.jsx(Hr,{playbookInstanceId:c,playbookMode:n,playbookStyle:r,username:e,defaultExpanded:a}):null},O5=({playbookId:e,playbookMode:t="list",playbookStyle:n,btnLabel:r="Start Playbook",btnColor:o="primary",persistKey:i,defaultExpanded:s=!0})=>{const[a,c]=T.useState(null),[l,f]=T.useState(void 0);return T.useEffect(()=>{const u=q0(e,i);u&&(c(u.playbookInstanceId),f(u.email))},[e,i]),x.jsxs(x.Fragment,{children:[x.jsxs(Ac.div,{children:[x.jsx(WC,{playbookId:e,disabled:!!a,onInitiated:(u,d)=>{H0(e,u,d,i),c(u),f(d)},btnLabel:r,btnColor:o}),x.jsx("style",{type:"text/css",children:E5})]}),a&&x.jsx(Hr,{playbookInstanceId:a,playbookMode:t,playbookStyle:n,username:l,defaultExpanded:s})]})},Hr=({playbookInstanceId:e,playbookMode:t,playbookStyle:n,username:r,defaultExpanded:o=!0})=>(console.log("Starting ConfidencePlaybook with instance ID:",e,r),x.jsx(E0,{children:x.jsx(C5,{playbookInstanceId:e,username:r,children:x.jsx(S5,{playbookInstanceId:e,playbookMode:t,playbookStyle:n,defaultExpanded:o})})}));Hr.Context=E0;Hr.View=x1;Hr.AutoInstantiated=N5;Hr.WithInstantiateButton=O5;const w1=kc.replace(/:root,\s*:host/g,":host"),A1=e=>Nn.createPortal(x.jsxs(Ac.div,{style:{position:"relative",zIndex:2147483646},children:[x.jsx("style",{children:w1}),x.jsx(Hr,{...e})]}),document.body),P5=e=>Nn.createPortal(x.jsxs(Ac.div,{style:{position:"relative",zIndex:2147483646},children:[x.jsx("style",{children:w1}),x.jsx(Hr.AutoInstantiated,{...e})]}),document.body);A1.AutoInstantiated=P5;exports.ConfidencePlaybook=A1;
|
package/dist/index.js
CHANGED
|
@@ -22882,7 +22882,7 @@ const D5 = ({
|
|
|
22882
22882
|
]
|
|
22883
22883
|
}
|
|
22884
22884
|
);
|
|
22885
|
-
}, od = Bn({
|
|
22885
|
+
}, U5 = Dc.replace(/:root,\s*:host/g, ":host"), od = Bn({
|
|
22886
22886
|
comments: [],
|
|
22887
22887
|
openTaskDetails: null,
|
|
22888
22888
|
username: void 0,
|
|
@@ -22895,7 +22895,7 @@ const D5 = ({
|
|
|
22895
22895
|
if (!Fn(od))
|
|
22896
22896
|
throw new Error("useCommentContext must be used within a CommentProvider");
|
|
22897
22897
|
return Fn(od);
|
|
22898
|
-
},
|
|
22898
|
+
}, B5 = ({
|
|
22899
22899
|
playbookInstanceId: e,
|
|
22900
22900
|
children: t,
|
|
22901
22901
|
username: n
|
|
@@ -22927,7 +22927,7 @@ const D5 = ({
|
|
|
22927
22927
|
t,
|
|
22928
22928
|
qr(
|
|
22929
22929
|
/* @__PURE__ */ re("div", { id: "cnfdnc-comment-box-root", children: [
|
|
22930
|
-
/* @__PURE__ */ E("style", { children:
|
|
22930
|
+
/* @__PURE__ */ E("style", { children: U5 }),
|
|
22931
22931
|
/* @__PURE__ */ E("div", { className: "confidence-playbook", children: /* @__PURE__ */ E(
|
|
22932
22932
|
$5,
|
|
22933
22933
|
{
|
|
@@ -22947,7 +22947,7 @@ const D5 = ({
|
|
|
22947
22947
|
]
|
|
22948
22948
|
}
|
|
22949
22949
|
);
|
|
22950
|
-
},
|
|
22950
|
+
}, j5 = {
|
|
22951
22951
|
[Ke.OPEN]: "cnf:border-[#C1C5C8] cnf:bg-[#F0F1F2]",
|
|
22952
22952
|
[Ke.IN_PROGRESS]: "cnf:bg-[#E6F2FF] cnf:border-[#94C8FF]",
|
|
22953
22953
|
[Ke.IN_REVIEW]: "cnf:bg-[#EAF6EC] cnf:border-[#A5DAB1]",
|
|
@@ -22957,7 +22957,7 @@ const D5 = ({
|
|
|
22957
22957
|
SCREENSHOT: "screenshot",
|
|
22958
22958
|
COMMENT: "comment",
|
|
22959
22959
|
NO_VERIFICATION: null
|
|
22960
|
-
},
|
|
22960
|
+
}, W5 = ({
|
|
22961
22961
|
task: e,
|
|
22962
22962
|
step: t,
|
|
22963
22963
|
playbookType: n,
|
|
@@ -23093,7 +23093,7 @@ const D5 = ({
|
|
|
23093
23093
|
{
|
|
23094
23094
|
className: Fs(
|
|
23095
23095
|
"cnf:flex cnf:items-stretch cnf:rounded-sm cnf:overflow-hidden cnf:border",
|
|
23096
|
-
|
|
23096
|
+
j5[e.workflowStatus]
|
|
23097
23097
|
),
|
|
23098
23098
|
children: [
|
|
23099
23099
|
/* @__PURE__ */ E(
|
|
@@ -23210,7 +23210,7 @@ const D5 = ({
|
|
|
23210
23210
|
}
|
|
23211
23211
|
);
|
|
23212
23212
|
Lx.displayName = "PlaybookHeader";
|
|
23213
|
-
const
|
|
23213
|
+
const K5 = Dc.replace(/:root,\s*:host/g, ":host"), H5 = ({
|
|
23214
23214
|
playbookInstanceId: e,
|
|
23215
23215
|
playbookMode: t,
|
|
23216
23216
|
playbookStyle: n,
|
|
@@ -23241,7 +23241,7 @@ const W5 = Dc.replace(/:root,\s*:host/g, ":host"), K5 = ({
|
|
|
23241
23241
|
defaultExpanded: r
|
|
23242
23242
|
}
|
|
23243
23243
|
) }) : /* @__PURE__ */ E("div", {});
|
|
23244
|
-
},
|
|
23244
|
+
}, V5 = ({
|
|
23245
23245
|
className: e,
|
|
23246
23246
|
children: t,
|
|
23247
23247
|
numberOfTasks: n,
|
|
@@ -23356,14 +23356,14 @@ const W5 = Dc.replace(/:root,\s*:host/g, ":host"), K5 = ({
|
|
|
23356
23356
|
}
|
|
23357
23357
|
),
|
|
23358
23358
|
/* @__PURE__ */ E(
|
|
23359
|
-
|
|
23359
|
+
V5,
|
|
23360
23360
|
{
|
|
23361
23361
|
playbookMode: t,
|
|
23362
23362
|
numberOfTasks: e.numberofTasks,
|
|
23363
23363
|
children: s.map((k, C) => {
|
|
23364
23364
|
var _;
|
|
23365
23365
|
return /* @__PURE__ */ E(
|
|
23366
|
-
|
|
23366
|
+
W5,
|
|
23367
23367
|
{
|
|
23368
23368
|
task: k,
|
|
23369
23369
|
step: C + 1,
|
|
@@ -23390,7 +23390,7 @@ const W5 = Dc.replace(/:root,\s*:host/g, ":host"), K5 = ({
|
|
|
23390
23390
|
]
|
|
23391
23391
|
}
|
|
23392
23392
|
);
|
|
23393
|
-
},
|
|
23393
|
+
}, q5 = ({
|
|
23394
23394
|
email: e,
|
|
23395
23395
|
playbookId: t,
|
|
23396
23396
|
playbookMode: n,
|
|
@@ -23434,7 +23434,7 @@ const W5 = Dc.replace(/:root,\s*:host/g, ":host"), K5 = ({
|
|
|
23434
23434
|
defaultExpanded: a
|
|
23435
23435
|
}
|
|
23436
23436
|
) : null;
|
|
23437
|
-
},
|
|
23437
|
+
}, Y5 = ({
|
|
23438
23438
|
playbookId: e,
|
|
23439
23439
|
playbookMode: t = "list",
|
|
23440
23440
|
playbookStyle: n,
|
|
@@ -23463,7 +23463,7 @@ const W5 = Dc.replace(/:root,\s*:host/g, ":host"), K5 = ({
|
|
|
23463
23463
|
btnColor: o
|
|
23464
23464
|
}
|
|
23465
23465
|
),
|
|
23466
|
-
/* @__PURE__ */ E("style", { type: "text/css", children:
|
|
23466
|
+
/* @__PURE__ */ E("style", { type: "text/css", children: K5 })
|
|
23467
23467
|
] }),
|
|
23468
23468
|
a && /* @__PURE__ */ E(
|
|
23469
23469
|
to,
|
|
@@ -23487,12 +23487,12 @@ const W5 = Dc.replace(/:root,\s*:host/g, ":host"), K5 = ({
|
|
|
23487
23487
|
e,
|
|
23488
23488
|
r
|
|
23489
23489
|
), /* @__PURE__ */ E(B0, { children: /* @__PURE__ */ E(
|
|
23490
|
-
|
|
23490
|
+
B5,
|
|
23491
23491
|
{
|
|
23492
23492
|
playbookInstanceId: e,
|
|
23493
23493
|
username: r,
|
|
23494
23494
|
children: /* @__PURE__ */ E(
|
|
23495
|
-
|
|
23495
|
+
H5,
|
|
23496
23496
|
{
|
|
23497
23497
|
playbookInstanceId: e,
|
|
23498
23498
|
playbookMode: t,
|
|
@@ -23504,16 +23504,16 @@ const W5 = Dc.replace(/:root,\s*:host/g, ":host"), K5 = ({
|
|
|
23504
23504
|
) }));
|
|
23505
23505
|
to.Context = B0;
|
|
23506
23506
|
to.View = Rx;
|
|
23507
|
-
to.AutoInstantiated =
|
|
23508
|
-
to.WithInstantiateButton =
|
|
23509
|
-
const Dx = Dc.replace(/:root,\s*:host/g, ":host"),
|
|
23507
|
+
to.AutoInstantiated = q5;
|
|
23508
|
+
to.WithInstantiateButton = Y5;
|
|
23509
|
+
const Dx = Dc.replace(/:root,\s*:host/g, ":host"), Q5 = (e) => qr(
|
|
23510
23510
|
// SelfShadowComponent z-index is 2147483646 to ensure it is always on top of other elements (except CommentBoxRoot)
|
|
23511
23511
|
/* @__PURE__ */ re(Lc.div, { style: { position: "relative", zIndex: 2147483646 }, children: [
|
|
23512
23512
|
/* @__PURE__ */ E("style", { children: Dx }),
|
|
23513
23513
|
/* @__PURE__ */ E(to, { ...e })
|
|
23514
23514
|
] }),
|
|
23515
23515
|
document.body
|
|
23516
|
-
),
|
|
23516
|
+
), G5 = (e) => qr(
|
|
23517
23517
|
// SelfShadowComponent z-index is 2147483646 to ensure it is always on top of other elements (except CommentBoxRoot)
|
|
23518
23518
|
/* @__PURE__ */ re(Lc.div, { style: { position: "relative", zIndex: 2147483646 }, children: [
|
|
23519
23519
|
/* @__PURE__ */ E("style", { children: Dx }),
|
|
@@ -23521,7 +23521,7 @@ const Dx = Dc.replace(/:root,\s*:host/g, ":host"), Y5 = (e) => qr(
|
|
|
23521
23521
|
] }),
|
|
23522
23522
|
document.body
|
|
23523
23523
|
);
|
|
23524
|
-
|
|
23524
|
+
Q5.AutoInstantiated = G5;
|
|
23525
23525
|
export {
|
|
23526
|
-
|
|
23526
|
+
Q5 as ConfidencePlaybook
|
|
23527
23527
|
};
|