1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f238a537-273f-53d4-b93f-c0d08d0b8f73")}catch(e){}}(); 3import{j as i}from"./heroUI-B_ljU1QU.js";import{a as o,u as v}from"./i18n-B1Tl-FS8.js";import{u as F,d as U,r as b}from"./blocknote-H0go5Ala.js";import{H as k,r as J}from"./Header-DbkCPLBF.js";import{S as M}from"./ScaledModal-BhjXAmpD.js";import{F as R}from"./Form-BDmckLpW.js";import{b as T,i as w,C as B}from"./App-NouI1Fy-.js";import{u as G}from"./useGetNote-BlVKAID2.js";import"./excalidraw-ClE5B34E.js";import"./percentages-BXMCSKIN-CQaZ_nn0.js";import"./utils-Ck-GfcmJ.js";import"./Icon-Bn1Of1X8.js";import"./file-text-D_rPaBmV.js";import"./check-CwC0fwRx.js";import"./arrow-up-right-DPds2Qak.js";import"./triangle-alert-yCytgbHH.js";import"./plus-BtuFysVt.js";import"./EmbedSnippet-ESlrhsZR.js";import"./SidePanel-uFYaj6EA.js";import"./ShareSuccess-Bt_3nuE0.js";import"./utils-DYhWlTq6.js";import"./InputText-CPgxvznP.js";import"./useForm-D_u_jxF8.js";import"./PageHeader-gutvdt0U.js";import"./app-CNhMxvwe.js";const H=({fields:m,noteId:d})=>{const{fetchApi:l,isLoading:a,responseApi:c}=T({url:`/user/note/${d}/update`,method:"POST",data:m||{},headers:{Accept:"application/json, application/xml, text/plain, text/html, *.*"},contentType:"multipart/form-data"}),f=o.useCallback(()=>{l()},[l]);return{updateResponse:c,updateLoading:a,fetchUpdateNote:f}},mt=m=>{const{t:d,i18n:l}=v(),{navigate:a,location:c}=m,{addNotification:f}=w(),[s,p]=o.useState(null),{state:h,dispatch:x}=B(),[C,N]=o.useState(!1),E=()=>N(!0),r=c.pathname.split("/")[2],{getNote:j,responseGetNote:u}=G({noteId:r}),{fetchUpdateNote:L,updateLoading:O,updateResponse:g}=H({fields:s,noteId:r}),e=F({dictionary:l.language?.split("-")[0]==="ro"?J:b.en,initialContent:null}),S=()=>{N(!1)};o.useEffect(()=>{if(r){const t=h.notes.data.find(n=>n.uuid.toString()===r.toString());if(!s&&t){p({title:t.title,note_json:t.note_json});try{e.replaceBlocks(e.document,JSON.parse(t.note_json))}catch(n){console.error("â Error updating editor content:",n)}}else t||j()}},[r,h.notes.data,s,j,e]),o.useEffect(()=>{if(e.document&&u){if(u.error){a("/404");return}const t=u.note;p({...t});try{e.replaceBlocks(e.document,JSON.parse(t.note_json))}catch(n){console.error("â Error updating editor content:",n)}}},[u,e,a]);const y=o.useCallback(t=>{S(),x({type:"updateNote",payload:t}),f({description:d("notes.update.successMessage"),settings:{type:"success",duration:2e3}})},[x,a]);o.useEffect(()=>{if(g?.success){const t=g.note;y(t)}},[g,y]);const _=t=>{p(n=>({...n,note_json:JSON.stringify(e.document),...t}))},A=()=>{p({...s,note_json:JSON.stringify(e.document)}),o.startTransition(()=>{E()})};return i.jsxs("div",{className:"w-full",children:[i.jsx(k,{navigate:a,saveAction:A,location:c,textAction:d("globals.update"),note:{noteId:r}}),i.jsx("div",{className:"mx-auto mt-[100px] max-w-[800px]",children:i.jsx(U,{editor:e,theme:"light",content:s?.note_json})}),i.jsx(M,{location:c.pathname,modalOpen:C,handleClose:S,children:i.jsx(R,{isLoading:O,callFetch:L,handleChangeFields:_,fieldsState:{title:s?.title},isUpdate:!0})})]})};export{mt as default}; 4 5//# debugId=f238a537-273f-53d4-b93f-c0d08d0b8f73
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.