1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29946],{829946:(e,t,r)=>{r.r(t),r.d(t,{Editor:()=>f});var n=r(698064),u=r(567152);r(243557),r(889094),r(977002),r(502892),r(671937);var i=r(129093);r(362199),r(656842),r(911240),r(390487);var l=r(227746),a=r(212115),s=r(615325),o=r(995899),c=r(695155);(0,l.hY)(),(0,l.hY)();var f=(0,a.memo)(e=>{let{onChange:t,content:r,readOnly:f=!1,field:d,inline:m=!1,onFocus:h,id:v,name:p}=e,{tiptap:x={},options:g}=d,{extensions:k=[]}=x,E=(0,a.useMemo)(()=>[n.b.configure(g),...k],[d,k]),T=(0,i.sL)(),R=`${p}${m?"::inline":""}`,C=function({content:e,onChange:t,extensions:r,editable:n=!0,onFocusChange:u,name:c}){let[f,d]=(0,o.d7)(null,50,{leading:!0,maxWait:200}),m=(0,a.useRef)(!1),h=(0,a.useRef)(""),v=(0,a.useRef)(null),p=!!v.current,x=(0,i.CU)(e=>e.state.ui.field.focus===c),g=e=>{v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{h.current===e&&(v.current=null)},200)},k=(0,i.sL)(),E=(0,s.hGv)({extensions:r,content:e,editable:n,immediatelyRender:!1,parseOptions:{preserveWhitespace:"full"},onUpdate:({editor:e})=>{if(m.current||!x){k.getState().setUi({field:{focus:c}});return}let t=e.getHTML(),{from:r,to:n}=e.state.selection;d({from:r,to:n,html:t}),g(t),h.current=t}});return(0,a.useEffect)(()=>{if(!E)return;let e=()=>{null==u||u(E)};return E.on("focus",e),()=>{E.off("focus",e)}},[E,u]),(0,a.useEffect)(()=>{if(f){let{ui:e}=k.getState().state;t(f.html,{field:(0,l.ko)((0,l.IA)({},e.field),{metadata:{from:f.from,to:f.to}})})}},[E,f,t,k,c]),(0,a.useEffect)(()=>{null==E||E.setEditable(n)},[E,n]),(0,a.useEffect)(()=>{var t;if(!E||p||E.getHTML()===e)return;m.current=!0,E.commands.setContent(e,{emitUpdate:!1});let{ui:r}=k.getState().state;void 0!==(null==(t=r.field.metadata)?void 0:t.from)&&E.commands.setTextSelection({from:r.field.metadata.from,to:r.field.metadata.to}),m.current=!1},[e,E,k]),E}({content:r,onChange:t,extensions:E,editable:!f,name:R,onFocusChange:e=>{if(e){let t=T.getState();T.setState({currentRichText:{field:d,editor:e,id:v,inline:m},state:(0,l.ko)((0,l.IA)({},t.state),{ui:(0,l.ko)((0,l.IA)({},t.state.ui),{field:(0,l.ko)((0,l.IA)({},t.state.ui.field),{focus:R})})})}),null==h||h(e)}}}),I=(0,i.CU)(e=>{var t,r;return!m&&(null==(t=e.currentRichText)?void 0:t.id)===v&&(null==(r=e.currentRichText)?void 0:r.inlineComponentId)?e.currentRichText.editor:C});return C?(0,c.jsx)(u.I,(0,l.ko)((0,l.IA)({},e),{editor:C,menu:(0,c.jsx)(u.e,{field:d,editor:I,readOnly:f}),children:(0,c.jsx)(s.$Z$,{editor:C,className:"rich-text"})})):null});f.displayName="Editor"}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.