[{"data":1,"prerenderedAt":1163},["ShallowReactive",2],{"text-diagram-doc:\u002Fen\u002Fguide\u002Fpersistence":3,"text-diagram-source:recipes\u002Fsession.ts":248,"mdc--mhn3bc-key":249},{"id":4,"title":5,"body":6,"description":236,"extension":237,"keywords":238,"locale":239,"meta":240,"navigation":241,"order":242,"path":243,"section":244,"seo":245,"stem":246,"__hash__":247},"docs\u002Fguide\u002Fpersistence.en.md","Save and restore",{"type":7,"value":8,"toc":228},"minimark",[9,18,23,41,52,61,65,68,94,134,138,141,145,214,217,221],[10,11,12,13,17],"p",{},"A structured host saves ",[14,15,16],"code",{},"TextDiagramEmbed",": protocol version, stable id, title, source language\u002Ftext\u002Frevision and the matching PNG. A new draft may have no preview. A saved object should carry a preview generated from that exact source.",[19,20,22],"h2",{"id":21},"save-source-and-image-together","Save source and image together",[10,24,25,28,29,32,33,36,37,40],{},[14,26,27],{},"createTextDiagram"," creates revision 0. ",[14,30,31],{},"renderTextDiagram"," creates a source-bound snapshot, ",[14,34,35],{},"rasterizeTextDiagram"," generates its PNG, and ",[14,38,39],{},"prepareTextDiagramSave"," proposes a complete object with revision + 1. The workbench manages this pipeline already.",[10,42,43,46,47,51],{},[14,44,45],{},"readTextDiagram"," validates unknown input and returns an immutable copy. It rejects extra fields, accessors and noncanonical values. It validates structure and size; ",[48,49,50],"strong",{},"it does not re-render to prove that the PNG matches the source",". Structural validation alone does not make an untrusted image a verified diagram projection.",[10,53,54,57,58,60],{},[14,55,56],{},"serializeTextDiagram"," provides a stable comparison string. After parsing JSON, validate it again with ",[14,59,45],{}," before passing it to a host.",[19,62,64],{"id":63},"a-complete-local-host","A complete local host",[10,66,67],{},"When a user opens a diagram, the workbench eventually returns an edited result. The application must save it and check that another action has not changed the original while the dialog was open.",[10,69,70,73,74,77,78,81,82,85,86,89,90,93],{},[14,71,72],{},"createDiagramSession(initial, persist)"," maintains the accepted version of one diagram. ",[14,75,76],{},"read()"," returns the current diagram. ",[14,79,80],{},"capture()"," records the opening version and supplies ",[14,83,84],{},"commit()"," to accept a result and ",[14,87,88],{},"release()"," to end that edit. The application supplies a synchronous ",[14,91,92],{},"persist"," callback, such as a local-storage write. If it throws, the accepted revision remains unchanged and success is not reported.",[95,96,97,110],"table",{},[98,99,100],"thead",{},[101,102,103,107],"tr",{},[104,105,106],"th",{},"File",[104,108,109],{},"Purpose",[111,112,113,124],"tbody",{},[101,114,115,121],{},[116,117,118],"td",{},[14,119,120],{},"recipes\u002Fsession.ts",[116,122,123],{},"Compare opening and current versions, call storage, then update the accepted diagram",[101,125,126,131],{},[116,127,128],{},[14,129,130],{},"shared\u002Ftypes.ts",[116,132,133],{},"Shared types for the edit request and session",[135,136],"docs-recipe",{"name":137},"recipes\u002Fsession",[10,139,140],{},"The workbench supplies an object with a matching preview. A production host must also check that the target exists, remains editable and still maps to a valid position at commit time. Classic, Block and MSFE own those editor semantics. This example does not implement collaboration or cross-tab synchronization.",[19,142,144],{"id":143},"four-acceptance-results","Four acceptance results",[95,146,147,160],{},[98,148,149],{},[101,150,151,154,157],{},[104,152,153],{},"Result",[104,155,156],{},"Meaning",[104,158,159],{},"UI behavior",[111,161,162,175,188,201],{},[101,163,164,169,172],{},[116,165,166],{},[14,167,168],{},"saved",[116,170,171],{},"Host atomically accepted source and preview",[116,173,174],{},"Report success",[101,176,177,182,185],{},[116,178,179],{},[14,180,181],{},"conflict",[116,183,184],{},"Content changed after the captured baseline",[116,186,187],{},"Keep draft; explain conflict",[101,189,190,195,198],{},[116,191,192],{},[14,193,194],{},"readonly",[116,196,197],{},"Writes are no longer allowed",[116,199,200],{},"Keep draft; explain read-only state",[101,202,203,208,211],{},[116,204,205],{},[14,206,207],{},"missing",[116,209,210],{},"Target was removed or released",[116,212,213],{},"Keep draft; explain missing target",[10,215,216],{},"Storage failures can throw. The workbench displays failure and allows retry. This contract does not provide asynchronous server confirmation, automatic merging or backend retry; those belong to the host's persistence strategy.",[19,218,220],{"id":219},"markdown-hosts","Markdown hosts",[10,222,223,224,227],{},"Use ",[14,225,226],{},"textDiagramMarkdown(language, source)"," to generate a standard fence. It chooses a delimiter longer than any backtick run in the source, preventing an accidental closing fence. Markdown retains language and source, without a structured id, title, PNG or revision. Its source host owns editing and conflict detection.",{"title":229,"searchDepth":230,"depth":230,"links":231},"",2,[232,233,234,235],{"id":21,"depth":230,"text":22},{"id":63,"depth":230,"text":64},{"id":143,"depth":230,"text":144},{"id":219,"depth":230,"text":220},"Keep source authoritative, commit its matching preview atomically and reject stale or released requests.","md",null,"en",{},true,4,"\u002Fen\u002Fguide\u002Fpersistence","Integration",{"title":5,"description":236},"guide\u002Fpersistence.en","7fY-C3zd4VvkZKRKG4hWEWFjFCHpFfMN9T58v5NVPAM","import { readTextDiagram, serializeTextDiagram, type TextDiagramEmbed } from \"@quirekit\u002Ftext-diagram\";\nimport type { DiagramSession } from \"..\u002Fshared\u002Ftypes\";\n\n\u002F**\n * Creates a single-object host with compare-and-save semantics.\n * @param initial - Validated persisted object or new draft.\n * @param persist - Optional synchronous storage write; throwing leaves the baseline unchanged.\n * @returns A host whose requests cannot overwrite a newer accepted revision.\n *\u002F\nexport function createDiagramSession(initial: TextDiagramEmbed, persist?: (next: TextDiagramEmbed) => void): DiagramSession {\n  let current = readTextDiagram(initial);\n  return {\n    \u002F** @returns The immutable accepted revision. *\u002F\n    read() { return current; },\n    \u002F** @returns A detached baseline with explicit commit and release callbacks. *\u002F\n    capture() {\n      const baseline = current, expected = serializeTextDiagram(baseline);\n      let released = false;\n      return {\n        document: baseline,\n        \u002F** @param proposal - Source and preview proposed by the workbench. @returns Atomic host acceptance. *\u002F\n        commit(proposal) {\n          if (released) return \"missing\";\n          if (serializeTextDiagram(current) !== expected) return \"conflict\";\n          const next = readTextDiagram(proposal);\n          if (next.id !== baseline.id || next.document.revision !== baseline.document.revision + 1 || !next.preview) {\n            throw new TypeError(\"Invalid diagram save\");\n          }\n          \u002F\u002F Storage must succeed before publishing the new revision to the UI.\n          persist?.(next);\n          current = next;\n          return \"saved\";\n        },\n        \u002F** Closes this target without changing the accepted object. *\u002F\n        release() { released = true; },\n      };\n    },\n  };\n}\n",{"data":250,"body":251},{},{"type":252,"children":253},"root",[254,1157],{"type":255,"tag":256,"props":257,"children":261},"element","pre",{"className":258,"code":259,"language":260,"meta":229,"style":229},"language-ts shiki shiki-themes github-light github-light github-dark","import { readTextDiagram, serializeTextDiagram, type TextDiagramEmbed } from \"@quirekit\u002Ftext-diagram\";\nimport type { DiagramSession } from \"..\u002Fshared\u002Ftypes\";\n\n\u002F**\n * Creates a single-object host with compare-and-save semantics.\n * @param initial - Validated persisted object or new draft.\n * @param persist - Optional synchronous storage write; throwing leaves the baseline unchanged.\n * @returns A host whose requests cannot overwrite a newer accepted revision.\n *\u002F\nexport function createDiagramSession(initial: TextDiagramEmbed, persist?: (next: TextDiagramEmbed) => void): DiagramSession {\n  let current = readTextDiagram(initial);\n  return {\n    \u002F** @returns The immutable accepted revision. *\u002F\n    read() { return current; },\n    \u002F** @returns A detached baseline with explicit commit and release callbacks. *\u002F\n    capture() {\n      const baseline = current, expected = serializeTextDiagram(baseline);\n      let released = false;\n      return {\n        document: baseline,\n        \u002F** @param proposal - Source and preview proposed by the workbench. @returns Atomic host acceptance. *\u002F\n        commit(proposal) {\n          if (released) return \"missing\";\n          if (serializeTextDiagram(current) !== expected) return \"conflict\";\n          const next = readTextDiagram(proposal);\n          if (next.id !== baseline.id || next.document.revision !== baseline.document.revision + 1 || !next.preview) {\n            throw new TypeError(\"Invalid diagram save\");\n          }\n          \u002F\u002F Storage must succeed before publishing the new revision to the UI.\n          persist?.(next);\n          current = next;\n          return \"saved\";\n        },\n        \u002F** Closes this target without changing the accepted object. *\u002F\n        release() { released = true; },\n      };\n    },\n  };\n}\n\n","ts",[262],{"type":255,"tag":14,"props":263,"children":264},{"__ignoreMap":229},[265,310,340,349,358,367,391,413,431,440,548,577,590,608,632,649,663,706,733,746,755,787,810,837,881,908,974,1007,1016,1025,1039,1057,1075,1084,1093,1121,1130,1139,1148],{"type":255,"tag":266,"props":267,"children":270},"span",{"class":268,"line":269},"line",1,[271,278,284,289,294,299,305],{"type":255,"tag":266,"props":272,"children":274},{"style":273},"--shiki-default:#D73A49;--shiki-light:#D73A49;--shiki-dark:#F97583",[275],{"type":276,"value":277},"text","import",{"type":255,"tag":266,"props":279,"children":281},{"style":280},"--shiki-default:#24292E;--shiki-light:#24292E;--shiki-dark:#E1E4E8",[282],{"type":276,"value":283}," { readTextDiagram, serializeTextDiagram, ",{"type":255,"tag":266,"props":285,"children":286},{"style":273},[287],{"type":276,"value":288},"type",{"type":255,"tag":266,"props":290,"children":291},{"style":280},[292],{"type":276,"value":293}," TextDiagramEmbed } ",{"type":255,"tag":266,"props":295,"children":296},{"style":273},[297],{"type":276,"value":298},"from",{"type":255,"tag":266,"props":300,"children":302},{"style":301},"--shiki-default:#032F62;--shiki-light:#032F62;--shiki-dark:#9ECBFF",[303],{"type":276,"value":304}," \"@quirekit\u002Ftext-diagram\"",{"type":255,"tag":266,"props":306,"children":307},{"style":280},[308],{"type":276,"value":309},";\n",{"type":255,"tag":266,"props":311,"children":312},{"class":268,"line":230},[313,317,322,327,331,336],{"type":255,"tag":266,"props":314,"children":315},{"style":273},[316],{"type":276,"value":277},{"type":255,"tag":266,"props":318,"children":319},{"style":273},[320],{"type":276,"value":321}," type",{"type":255,"tag":266,"props":323,"children":324},{"style":280},[325],{"type":276,"value":326}," { DiagramSession } ",{"type":255,"tag":266,"props":328,"children":329},{"style":273},[330],{"type":276,"value":298},{"type":255,"tag":266,"props":332,"children":333},{"style":301},[334],{"type":276,"value":335}," \"..\u002Fshared\u002Ftypes\"",{"type":255,"tag":266,"props":337,"children":338},{"style":280},[339],{"type":276,"value":309},{"type":255,"tag":266,"props":341,"children":343},{"class":268,"line":342},3,[344],{"type":255,"tag":266,"props":345,"children":346},{"emptyLinePlaceholder":241},[347],{"type":276,"value":348},"\n",{"type":255,"tag":266,"props":350,"children":351},{"class":268,"line":242},[352],{"type":255,"tag":266,"props":353,"children":355},{"style":354},"--shiki-default:#6A737D;--shiki-light:#6A737D;--shiki-dark:#6A737D",[356],{"type":276,"value":357},"\u002F**\n",{"type":255,"tag":266,"props":359,"children":361},{"class":268,"line":360},5,[362],{"type":255,"tag":266,"props":363,"children":364},{"style":354},[365],{"type":276,"value":366}," * Creates a single-object host with compare-and-save semantics.\n",{"type":255,"tag":266,"props":368,"children":370},{"class":268,"line":369},6,[371,376,381,386],{"type":255,"tag":266,"props":372,"children":373},{"style":354},[374],{"type":276,"value":375}," * ",{"type":255,"tag":266,"props":377,"children":378},{"style":273},[379],{"type":276,"value":380},"@param",{"type":255,"tag":266,"props":382,"children":383},{"style":280},[384],{"type":276,"value":385}," initial",{"type":255,"tag":266,"props":387,"children":388},{"style":354},[389],{"type":276,"value":390}," - Validated persisted object or new draft.\n",{"type":255,"tag":266,"props":392,"children":394},{"class":268,"line":393},7,[395,399,403,408],{"type":255,"tag":266,"props":396,"children":397},{"style":354},[398],{"type":276,"value":375},{"type":255,"tag":266,"props":400,"children":401},{"style":273},[402],{"type":276,"value":380},{"type":255,"tag":266,"props":404,"children":405},{"style":280},[406],{"type":276,"value":407}," persist",{"type":255,"tag":266,"props":409,"children":410},{"style":354},[411],{"type":276,"value":412}," - Optional synchronous storage write; throwing leaves the baseline unchanged.\n",{"type":255,"tag":266,"props":414,"children":416},{"class":268,"line":415},8,[417,421,426],{"type":255,"tag":266,"props":418,"children":419},{"style":354},[420],{"type":276,"value":375},{"type":255,"tag":266,"props":422,"children":423},{"style":273},[424],{"type":276,"value":425},"@returns",{"type":255,"tag":266,"props":427,"children":428},{"style":354},[429],{"type":276,"value":430}," A host whose requests cannot overwrite a newer accepted revision.\n",{"type":255,"tag":266,"props":432,"children":434},{"class":268,"line":433},9,[435],{"type":255,"tag":266,"props":436,"children":437},{"style":354},[438],{"type":276,"value":439}," *\u002F\n",{"type":255,"tag":266,"props":441,"children":443},{"class":268,"line":442},10,[444,449,454,460,465,471,476,481,486,490,495,500,505,509,513,518,523,529,534,538,543],{"type":255,"tag":266,"props":445,"children":446},{"style":273},[447],{"type":276,"value":448},"export",{"type":255,"tag":266,"props":450,"children":451},{"style":273},[452],{"type":276,"value":453}," function",{"type":255,"tag":266,"props":455,"children":457},{"style":456},"--shiki-default:#6F42C1;--shiki-light:#6F42C1;--shiki-dark:#B392F0",[458],{"type":276,"value":459}," createDiagramSession",{"type":255,"tag":266,"props":461,"children":462},{"style":280},[463],{"type":276,"value":464},"(",{"type":255,"tag":266,"props":466,"children":468},{"style":467},"--shiki-default:#E36209;--shiki-light:#E36209;--shiki-dark:#FFAB70",[469],{"type":276,"value":470},"initial",{"type":255,"tag":266,"props":472,"children":473},{"style":273},[474],{"type":276,"value":475},":",{"type":255,"tag":266,"props":477,"children":478},{"style":456},[479],{"type":276,"value":480}," TextDiagramEmbed",{"type":255,"tag":266,"props":482,"children":483},{"style":280},[484],{"type":276,"value":485},", ",{"type":255,"tag":266,"props":487,"children":488},{"style":456},[489],{"type":276,"value":92},{"type":255,"tag":266,"props":491,"children":492},{"style":273},[493],{"type":276,"value":494},"?:",{"type":255,"tag":266,"props":496,"children":497},{"style":280},[498],{"type":276,"value":499}," (",{"type":255,"tag":266,"props":501,"children":502},{"style":467},[503],{"type":276,"value":504},"next",{"type":255,"tag":266,"props":506,"children":507},{"style":273},[508],{"type":276,"value":475},{"type":255,"tag":266,"props":510,"children":511},{"style":456},[512],{"type":276,"value":480},{"type":255,"tag":266,"props":514,"children":515},{"style":280},[516],{"type":276,"value":517},") ",{"type":255,"tag":266,"props":519,"children":520},{"style":273},[521],{"type":276,"value":522},"=>",{"type":255,"tag":266,"props":524,"children":526},{"style":525},"--shiki-default:#005CC5;--shiki-light:#005CC5;--shiki-dark:#79B8FF",[527],{"type":276,"value":528}," void",{"type":255,"tag":266,"props":530,"children":531},{"style":280},[532],{"type":276,"value":533},")",{"type":255,"tag":266,"props":535,"children":536},{"style":273},[537],{"type":276,"value":475},{"type":255,"tag":266,"props":539,"children":540},{"style":456},[541],{"type":276,"value":542}," DiagramSession",{"type":255,"tag":266,"props":544,"children":545},{"style":280},[546],{"type":276,"value":547}," {\n",{"type":255,"tag":266,"props":549,"children":551},{"class":268,"line":550},11,[552,557,562,567,572],{"type":255,"tag":266,"props":553,"children":554},{"style":273},[555],{"type":276,"value":556},"  let",{"type":255,"tag":266,"props":558,"children":559},{"style":280},[560],{"type":276,"value":561}," current ",{"type":255,"tag":266,"props":563,"children":564},{"style":273},[565],{"type":276,"value":566},"=",{"type":255,"tag":266,"props":568,"children":569},{"style":456},[570],{"type":276,"value":571}," readTextDiagram",{"type":255,"tag":266,"props":573,"children":574},{"style":280},[575],{"type":276,"value":576},"(initial);\n",{"type":255,"tag":266,"props":578,"children":580},{"class":268,"line":579},12,[581,586],{"type":255,"tag":266,"props":582,"children":583},{"style":273},[584],{"type":276,"value":585},"  return",{"type":255,"tag":266,"props":587,"children":588},{"style":280},[589],{"type":276,"value":547},{"type":255,"tag":266,"props":591,"children":593},{"class":268,"line":592},13,[594,599,603],{"type":255,"tag":266,"props":595,"children":596},{"style":354},[597],{"type":276,"value":598},"    \u002F** ",{"type":255,"tag":266,"props":600,"children":601},{"style":273},[602],{"type":276,"value":425},{"type":255,"tag":266,"props":604,"children":605},{"style":354},[606],{"type":276,"value":607}," The immutable accepted revision. *\u002F\n",{"type":255,"tag":266,"props":609,"children":611},{"class":268,"line":610},14,[612,617,622,627],{"type":255,"tag":266,"props":613,"children":614},{"style":456},[615],{"type":276,"value":616},"    read",{"type":255,"tag":266,"props":618,"children":619},{"style":280},[620],{"type":276,"value":621},"() { ",{"type":255,"tag":266,"props":623,"children":624},{"style":273},[625],{"type":276,"value":626},"return",{"type":255,"tag":266,"props":628,"children":629},{"style":280},[630],{"type":276,"value":631}," current; },\n",{"type":255,"tag":266,"props":633,"children":635},{"class":268,"line":634},15,[636,640,644],{"type":255,"tag":266,"props":637,"children":638},{"style":354},[639],{"type":276,"value":598},{"type":255,"tag":266,"props":641,"children":642},{"style":273},[643],{"type":276,"value":425},{"type":255,"tag":266,"props":645,"children":646},{"style":354},[647],{"type":276,"value":648}," A detached baseline with explicit commit and release callbacks. *\u002F\n",{"type":255,"tag":266,"props":650,"children":652},{"class":268,"line":651},16,[653,658],{"type":255,"tag":266,"props":654,"children":655},{"style":456},[656],{"type":276,"value":657},"    capture",{"type":255,"tag":266,"props":659,"children":660},{"style":280},[661],{"type":276,"value":662},"() {\n",{"type":255,"tag":266,"props":664,"children":666},{"class":268,"line":665},17,[667,672,677,682,687,692,696,701],{"type":255,"tag":266,"props":668,"children":669},{"style":273},[670],{"type":276,"value":671},"      const",{"type":255,"tag":266,"props":673,"children":674},{"style":525},[675],{"type":276,"value":676}," baseline",{"type":255,"tag":266,"props":678,"children":679},{"style":273},[680],{"type":276,"value":681}," =",{"type":255,"tag":266,"props":683,"children":684},{"style":280},[685],{"type":276,"value":686}," current, ",{"type":255,"tag":266,"props":688,"children":689},{"style":525},[690],{"type":276,"value":691},"expected",{"type":255,"tag":266,"props":693,"children":694},{"style":273},[695],{"type":276,"value":681},{"type":255,"tag":266,"props":697,"children":698},{"style":456},[699],{"type":276,"value":700}," serializeTextDiagram",{"type":255,"tag":266,"props":702,"children":703},{"style":280},[704],{"type":276,"value":705},"(baseline);\n",{"type":255,"tag":266,"props":707,"children":709},{"class":268,"line":708},18,[710,715,720,724,729],{"type":255,"tag":266,"props":711,"children":712},{"style":273},[713],{"type":276,"value":714},"      let",{"type":255,"tag":266,"props":716,"children":717},{"style":280},[718],{"type":276,"value":719}," released ",{"type":255,"tag":266,"props":721,"children":722},{"style":273},[723],{"type":276,"value":566},{"type":255,"tag":266,"props":725,"children":726},{"style":525},[727],{"type":276,"value":728}," false",{"type":255,"tag":266,"props":730,"children":731},{"style":280},[732],{"type":276,"value":309},{"type":255,"tag":266,"props":734,"children":736},{"class":268,"line":735},19,[737,742],{"type":255,"tag":266,"props":738,"children":739},{"style":273},[740],{"type":276,"value":741},"      return",{"type":255,"tag":266,"props":743,"children":744},{"style":280},[745],{"type":276,"value":547},{"type":255,"tag":266,"props":747,"children":749},{"class":268,"line":748},20,[750],{"type":255,"tag":266,"props":751,"children":752},{"style":280},[753],{"type":276,"value":754},"        document: baseline,\n",{"type":255,"tag":266,"props":756,"children":758},{"class":268,"line":757},21,[759,764,768,773,778,782],{"type":255,"tag":266,"props":760,"children":761},{"style":354},[762],{"type":276,"value":763},"        \u002F** ",{"type":255,"tag":266,"props":765,"children":766},{"style":273},[767],{"type":276,"value":380},{"type":255,"tag":266,"props":769,"children":770},{"style":280},[771],{"type":276,"value":772}," proposal",{"type":255,"tag":266,"props":774,"children":775},{"style":354},[776],{"type":276,"value":777}," - Source and preview proposed by the workbench. ",{"type":255,"tag":266,"props":779,"children":780},{"style":273},[781],{"type":276,"value":425},{"type":255,"tag":266,"props":783,"children":784},{"style":354},[785],{"type":276,"value":786}," Atomic host acceptance. *\u002F\n",{"type":255,"tag":266,"props":788,"children":790},{"class":268,"line":789},22,[791,796,800,805],{"type":255,"tag":266,"props":792,"children":793},{"style":456},[794],{"type":276,"value":795},"        commit",{"type":255,"tag":266,"props":797,"children":798},{"style":280},[799],{"type":276,"value":464},{"type":255,"tag":266,"props":801,"children":802},{"style":467},[803],{"type":276,"value":804},"proposal",{"type":255,"tag":266,"props":806,"children":807},{"style":280},[808],{"type":276,"value":809},") {\n",{"type":255,"tag":266,"props":811,"children":813},{"class":268,"line":812},23,[814,819,824,828,833],{"type":255,"tag":266,"props":815,"children":816},{"style":273},[817],{"type":276,"value":818},"          if",{"type":255,"tag":266,"props":820,"children":821},{"style":280},[822],{"type":276,"value":823}," (released) ",{"type":255,"tag":266,"props":825,"children":826},{"style":273},[827],{"type":276,"value":626},{"type":255,"tag":266,"props":829,"children":830},{"style":301},[831],{"type":276,"value":832}," \"missing\"",{"type":255,"tag":266,"props":834,"children":835},{"style":280},[836],{"type":276,"value":309},{"type":255,"tag":266,"props":838,"children":840},{"class":268,"line":839},24,[841,845,849,853,858,863,868,872,877],{"type":255,"tag":266,"props":842,"children":843},{"style":273},[844],{"type":276,"value":818},{"type":255,"tag":266,"props":846,"children":847},{"style":280},[848],{"type":276,"value":499},{"type":255,"tag":266,"props":850,"children":851},{"style":456},[852],{"type":276,"value":56},{"type":255,"tag":266,"props":854,"children":855},{"style":280},[856],{"type":276,"value":857},"(current) ",{"type":255,"tag":266,"props":859,"children":860},{"style":273},[861],{"type":276,"value":862},"!==",{"type":255,"tag":266,"props":864,"children":865},{"style":280},[866],{"type":276,"value":867}," expected) ",{"type":255,"tag":266,"props":869,"children":870},{"style":273},[871],{"type":276,"value":626},{"type":255,"tag":266,"props":873,"children":874},{"style":301},[875],{"type":276,"value":876}," \"conflict\"",{"type":255,"tag":266,"props":878,"children":879},{"style":280},[880],{"type":276,"value":309},{"type":255,"tag":266,"props":882,"children":884},{"class":268,"line":883},25,[885,890,895,899,903],{"type":255,"tag":266,"props":886,"children":887},{"style":273},[888],{"type":276,"value":889},"          const",{"type":255,"tag":266,"props":891,"children":892},{"style":525},[893],{"type":276,"value":894}," next",{"type":255,"tag":266,"props":896,"children":897},{"style":273},[898],{"type":276,"value":681},{"type":255,"tag":266,"props":900,"children":901},{"style":456},[902],{"type":276,"value":571},{"type":255,"tag":266,"props":904,"children":905},{"style":280},[906],{"type":276,"value":907},"(proposal);\n",{"type":255,"tag":266,"props":909,"children":911},{"class":268,"line":910},26,[912,916,921,925,930,935,940,944,949,954,959,964,969],{"type":255,"tag":266,"props":913,"children":914},{"style":273},[915],{"type":276,"value":818},{"type":255,"tag":266,"props":917,"children":918},{"style":280},[919],{"type":276,"value":920}," (next.id ",{"type":255,"tag":266,"props":922,"children":923},{"style":273},[924],{"type":276,"value":862},{"type":255,"tag":266,"props":926,"children":927},{"style":280},[928],{"type":276,"value":929}," baseline.id ",{"type":255,"tag":266,"props":931,"children":932},{"style":273},[933],{"type":276,"value":934},"||",{"type":255,"tag":266,"props":936,"children":937},{"style":280},[938],{"type":276,"value":939}," next.document.revision ",{"type":255,"tag":266,"props":941,"children":942},{"style":273},[943],{"type":276,"value":862},{"type":255,"tag":266,"props":945,"children":946},{"style":280},[947],{"type":276,"value":948}," baseline.document.revision ",{"type":255,"tag":266,"props":950,"children":951},{"style":273},[952],{"type":276,"value":953},"+",{"type":255,"tag":266,"props":955,"children":956},{"style":525},[957],{"type":276,"value":958}," 1",{"type":255,"tag":266,"props":960,"children":961},{"style":273},[962],{"type":276,"value":963}," ||",{"type":255,"tag":266,"props":965,"children":966},{"style":273},[967],{"type":276,"value":968}," !",{"type":255,"tag":266,"props":970,"children":971},{"style":280},[972],{"type":276,"value":973},"next.preview) {\n",{"type":255,"tag":266,"props":975,"children":977},{"class":268,"line":976},27,[978,983,988,993,997,1002],{"type":255,"tag":266,"props":979,"children":980},{"style":273},[981],{"type":276,"value":982},"            throw",{"type":255,"tag":266,"props":984,"children":985},{"style":273},[986],{"type":276,"value":987}," new",{"type":255,"tag":266,"props":989,"children":990},{"style":456},[991],{"type":276,"value":992}," TypeError",{"type":255,"tag":266,"props":994,"children":995},{"style":280},[996],{"type":276,"value":464},{"type":255,"tag":266,"props":998,"children":999},{"style":301},[1000],{"type":276,"value":1001},"\"Invalid diagram save\"",{"type":255,"tag":266,"props":1003,"children":1004},{"style":280},[1005],{"type":276,"value":1006},");\n",{"type":255,"tag":266,"props":1008,"children":1010},{"class":268,"line":1009},28,[1011],{"type":255,"tag":266,"props":1012,"children":1013},{"style":280},[1014],{"type":276,"value":1015},"          }\n",{"type":255,"tag":266,"props":1017,"children":1019},{"class":268,"line":1018},29,[1020],{"type":255,"tag":266,"props":1021,"children":1022},{"style":354},[1023],{"type":276,"value":1024},"          \u002F\u002F Storage must succeed before publishing the new revision to the UI.\n",{"type":255,"tag":266,"props":1026,"children":1028},{"class":268,"line":1027},30,[1029,1034],{"type":255,"tag":266,"props":1030,"children":1031},{"style":456},[1032],{"type":276,"value":1033},"          persist",{"type":255,"tag":266,"props":1035,"children":1036},{"style":280},[1037],{"type":276,"value":1038},"?.(next);\n",{"type":255,"tag":266,"props":1040,"children":1042},{"class":268,"line":1041},31,[1043,1048,1052],{"type":255,"tag":266,"props":1044,"children":1045},{"style":280},[1046],{"type":276,"value":1047},"          current ",{"type":255,"tag":266,"props":1049,"children":1050},{"style":273},[1051],{"type":276,"value":566},{"type":255,"tag":266,"props":1053,"children":1054},{"style":280},[1055],{"type":276,"value":1056}," next;\n",{"type":255,"tag":266,"props":1058,"children":1060},{"class":268,"line":1059},32,[1061,1066,1071],{"type":255,"tag":266,"props":1062,"children":1063},{"style":273},[1064],{"type":276,"value":1065},"          return",{"type":255,"tag":266,"props":1067,"children":1068},{"style":301},[1069],{"type":276,"value":1070}," \"saved\"",{"type":255,"tag":266,"props":1072,"children":1073},{"style":280},[1074],{"type":276,"value":309},{"type":255,"tag":266,"props":1076,"children":1078},{"class":268,"line":1077},33,[1079],{"type":255,"tag":266,"props":1080,"children":1081},{"style":280},[1082],{"type":276,"value":1083},"        },\n",{"type":255,"tag":266,"props":1085,"children":1087},{"class":268,"line":1086},34,[1088],{"type":255,"tag":266,"props":1089,"children":1090},{"style":354},[1091],{"type":276,"value":1092},"        \u002F** Closes this target without changing the accepted object. *\u002F\n",{"type":255,"tag":266,"props":1094,"children":1096},{"class":268,"line":1095},35,[1097,1102,1107,1111,1116],{"type":255,"tag":266,"props":1098,"children":1099},{"style":456},[1100],{"type":276,"value":1101},"        release",{"type":255,"tag":266,"props":1103,"children":1104},{"style":280},[1105],{"type":276,"value":1106},"() { released ",{"type":255,"tag":266,"props":1108,"children":1109},{"style":273},[1110],{"type":276,"value":566},{"type":255,"tag":266,"props":1112,"children":1113},{"style":525},[1114],{"type":276,"value":1115}," true",{"type":255,"tag":266,"props":1117,"children":1118},{"style":280},[1119],{"type":276,"value":1120},"; },\n",{"type":255,"tag":266,"props":1122,"children":1124},{"class":268,"line":1123},36,[1125],{"type":255,"tag":266,"props":1126,"children":1127},{"style":280},[1128],{"type":276,"value":1129},"      };\n",{"type":255,"tag":266,"props":1131,"children":1133},{"class":268,"line":1132},37,[1134],{"type":255,"tag":266,"props":1135,"children":1136},{"style":280},[1137],{"type":276,"value":1138},"    },\n",{"type":255,"tag":266,"props":1140,"children":1142},{"class":268,"line":1141},38,[1143],{"type":255,"tag":266,"props":1144,"children":1145},{"style":280},[1146],{"type":276,"value":1147},"  };\n",{"type":255,"tag":266,"props":1149,"children":1151},{"class":268,"line":1150},39,[1152],{"type":255,"tag":266,"props":1153,"children":1154},{"style":280},[1155],{"type":276,"value":1156},"}\n",{"type":255,"tag":1158,"props":1159,"children":1160},"style",{},[1161],{"type":276,"value":1162},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",1793045389922]