[{"data":1,"prerenderedAt":1228},["ShallowReactive",2],{"quirekit-doc:\u002Fguide\u002Fpersistence":3,"quirekit-source:recipes\u002Fsave.ts":165,"mdc-uipfhd-key":166},{"id":4,"title":5,"body":6,"description":153,"extension":154,"keywords":155,"locale":156,"meta":157,"navigation":158,"order":159,"path":160,"section":161,"seo":162,"stem":163,"__hash__":164},"docs\u002Fguide\u002Fpersistence.zh-CN.md","保存与恢复",{"type":7,"value":8,"toc":148},"minimark",[9,13,17,24,98,108,111,114,131,135,138,141,144],[10,11,12],"p",{},"Core 提供内容读写，存储位置由应用决定。先从“点击保存，把当前文档写到浏览器”开始，再增加恢复和版本检查。",[14,15,16],"h2",{"id":16},"保存当前内容",[10,18,19,23],{},[20,21,22],"code",{},"editor.getJSON()"," 返回节点、属性和格式。浏览器存储接收字符串，因此需要先序列化：",[25,26,32],"pre",{"className":27,"code":28,"filename":29,"language":30,"meta":31,"style":31},"language-ts shiki shiki-themes github-light github-light github-dark","const snapshot = { version: 1, content: editor.getJSON() }\nlocalStorage.setItem('my-document', JSON.stringify(snapshot))\n","保存一份本地草稿","ts","",[20,33,34,67],{"__ignoreMap":31},[35,36,39,43,47,50,54,57,60,64],"span",{"class":37,"line":38},"line",1,[35,40,42],{"class":41},"sDD9d","const",[35,44,46],{"class":45},"sUNQB"," snapshot",[35,48,49],{"class":41}," =",[35,51,53],{"class":52},"sVPnS"," { version: ",[35,55,56],{"class":45},"1",[35,58,59],{"class":52},", content: editor.",[35,61,63],{"class":62},"sgQzM","getJSON",[35,65,66],{"class":52},"() }\n",[35,68,70,73,76,79,83,86,89,92,95],{"class":37,"line":69},2,[35,71,72],{"class":52},"localStorage.",[35,74,75],{"class":62},"setItem",[35,77,78],{"class":52},"(",[35,80,82],{"class":81},"s-HEn","'my-document'",[35,84,85],{"class":52},", ",[35,87,88],{"class":45},"JSON",[35,90,91],{"class":52},".",[35,93,94],{"class":62},"stringify",[35,96,97],{"class":52},"(snapshot))\n",[10,99,100,103,104,107],{},[20,101,102],{},"version"," 是应用自己的备份版本。以后修改节点结构时，可以识别需要迁移的数据。",[20,105,106],{},"localStorage"," 只属于这个浏览器，不会自动跨设备同步，也不包含图片字节。",[14,109,110],{"id":110},"恢复时先检查内容",[10,112,113],{},"先读取并解析备份，检查版本，再用匹配的 Schema 验证内容。无已保存数据时才创建默认文档；文件损坏或版本不支持时保留原数据，让用户选择恢复方式。",[10,115,116,117,120,121,124,125,130],{},"下面的两个辅助函数演示显式保存和读取。",[20,118,119],{},"recipes\u002Fsave.ts"," 负责存储与基本版本检查，",[20,122,123],{},"recipes\u002Ftypes.ts"," 定义备份结构；完整产品还需要按 Schema 验证节点和属性，见",[126,127,129],"a",{"href":128},"\u002Fbuild\u002Ffiles","文件操作","。",[132,133],"docs-recipe",{"name":134},"recipes\u002Fsave",[14,136,137],{"id":137},"什么时候显示保存成功",[10,139,140],{},"存储操作可能失败，需要捕获错误并显示重试入口。只有实际写入成功，才清除未保存提示。网络保存期间还可能继续输入，因此应确认完成的是哪一版内容，不能让旧请求清除新草稿的未保存状态。",[10,142,143],{},"自动保存可以监听内容变化，合并短时间内的请求；它仍需处理版本、失败和冲突。简单的“下载 JSON”只是生成备份文件，不等于已经接入刷新恢复或服务端同步。",[145,146,147],"style",{},"html pre.shiki code .sDD9d, html code.shiki .sDD9d{--shiki-default:#D73A49;--shiki-light:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sUNQB, html code.shiki .sUNQB{--shiki-default:#005CC5;--shiki-light:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sVPnS, html code.shiki .sVPnS{--shiki-default:#24292E;--shiki-light:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sgQzM, html code.shiki .sgQzM{--shiki-default:#6F42C1;--shiki-light:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .s-HEn, html code.shiki .s-HEn{--shiki-default:#032F62;--shiki-light:#032F62;--shiki-dark:#9ECBFF}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);}",{"title":31,"searchDepth":69,"depth":69,"links":149},[150,151,152],{"id":16,"depth":69,"text":16},{"id":110,"depth":69,"text":110},{"id":137,"depth":69,"text":137},"用 JSON 保存一份文档，理解存储位置、版本和恢复步骤。","md",null,"zh-CN",{},true,5,"\u002Fguide\u002Fpersistence","核心概念",{"title":5,"description":153},"guide\u002Fpersistence.zh-CN","kg-OubaKiWeUPpvPNam9DJABNs55vAcOFRgu9WmvGvs","import type { Editor, JSONContent } from \"@quirekit\u002Fcore\";\nimport type { DocumentSnapshot } from \".\u002Ftypes\";\n\n\u002F**\n * Saves explicitly; storage failure propagates so callers cannot report false success.\n * @param editor - The current document authority.\n * @param storage - Host-selected browser or test storage.\n * @param key - Document-specific storage key.\n *\u002F\nexport function saveDocument(editor: Pick\u003CEditor, \"getJSON\">, storage: Pick\u003CStorage, \"setItem\">, key: string): void {\n  const snapshot: DocumentSnapshot = { version: 1, content: editor.getJSON() };\n  storage.setItem(key, JSON.stringify(snapshot));\n}\n\n\u002F**\n * Reads the versioned envelope; the editor schema remains responsible for content admission.\n * @param storage - The same host storage used for saving.\n * @param key - Document-specific storage key.\n * @returns Saved canonical JSON, or null when this document has not been saved.\n *\u002F\nexport function readDocument(storage: Pick\u003CStorage, \"getItem\">, key: string): JSONContent | null {\n  const source = storage.getItem(key);\n  if (source === null) return null;\n  const value: unknown = JSON.parse(source);\n  if (!value || typeof value !== \"object\" || !(\"version\" in value) || value.version !== 1 || !(\"content\" in value)) {\n    throw new Error(\"Unsupported document snapshot version\");\n  }\n  const content = value.content;\n  if (!content || typeof content !== \"object\" || !(\"type\" in content) || content.type !== \"doc\") {\n    throw new Error(\"Invalid document snapshot\");\n  }\n  return content as JSONContent;\n}\n",{"data":167,"body":168},{},{"type":169,"children":170},"root",[171,1223],{"type":172,"tag":25,"props":173,"children":175},"element",{"className":27,"code":174,"language":30,"meta":31,"style":31},"import type { Editor, JSONContent } from \"@quirekit\u002Fcore\";\nimport type { DocumentSnapshot } from \".\u002Ftypes\";\n\n\u002F**\n * Saves explicitly; storage failure propagates so callers cannot report false success.\n * @param editor - The current document authority.\n * @param storage - Host-selected browser or test storage.\n * @param key - Document-specific storage key.\n *\u002F\nexport function saveDocument(editor: Pick\u003CEditor, \"getJSON\">, storage: Pick\u003CStorage, \"setItem\">, key: string): void {\n  const snapshot: DocumentSnapshot = { version: 1, content: editor.getJSON() };\n  storage.setItem(key, JSON.stringify(snapshot));\n}\n\n\u002F**\n * Reads the versioned envelope; the editor schema remains responsible for content admission.\n * @param storage - The same host storage used for saving.\n * @param key - Document-specific storage key.\n * @returns Saved canonical JSON, or null when this document has not been saved.\n *\u002F\nexport function readDocument(storage: Pick\u003CStorage, \"getItem\">, key: string): JSONContent | null {\n  const source = storage.getItem(key);\n  if (source === null) return null;\n  const value: unknown = JSON.parse(source);\n  if (!value || typeof value !== \"object\" || !(\"version\" in value) || value.version !== 1 || !(\"content\" in value)) {\n    throw new Error(\"Unsupported document snapshot version\");\n  }\n  const content = value.content;\n  if (!content || typeof content !== \"object\" || !(\"type\" in content) || content.type !== \"doc\") {\n    throw new Error(\"Invalid document snapshot\");\n  }\n  return content as JSONContent;\n}\n\n",[176],{"type":172,"tag":20,"props":177,"children":178},{"__ignoreMap":31},[179,216,245,254,264,272,296,318,340,349,482,529,564,573,581,589,598,619,639,657,665,758,790,831,876,997,1030,1039,1061,1152,1181,1189,1215],{"type":172,"tag":35,"props":180,"children":181},{"class":37,"line":38},[182,189,194,200,205,211],{"type":172,"tag":35,"props":183,"children":185},{"style":184},"--shiki-default:#D73A49;--shiki-light:#D73A49;--shiki-dark:#F97583",[186],{"type":187,"value":188},"text","import",{"type":172,"tag":35,"props":190,"children":191},{"style":184},[192],{"type":187,"value":193}," type",{"type":172,"tag":35,"props":195,"children":197},{"style":196},"--shiki-default:#24292E;--shiki-light:#24292E;--shiki-dark:#E1E4E8",[198],{"type":187,"value":199}," { Editor, JSONContent } ",{"type":172,"tag":35,"props":201,"children":202},{"style":184},[203],{"type":187,"value":204},"from",{"type":172,"tag":35,"props":206,"children":208},{"style":207},"--shiki-default:#032F62;--shiki-light:#032F62;--shiki-dark:#9ECBFF",[209],{"type":187,"value":210}," \"@quirekit\u002Fcore\"",{"type":172,"tag":35,"props":212,"children":213},{"style":196},[214],{"type":187,"value":215},";\n",{"type":172,"tag":35,"props":217,"children":218},{"class":37,"line":69},[219,223,227,232,236,241],{"type":172,"tag":35,"props":220,"children":221},{"style":184},[222],{"type":187,"value":188},{"type":172,"tag":35,"props":224,"children":225},{"style":184},[226],{"type":187,"value":193},{"type":172,"tag":35,"props":228,"children":229},{"style":196},[230],{"type":187,"value":231}," { DocumentSnapshot } ",{"type":172,"tag":35,"props":233,"children":234},{"style":184},[235],{"type":187,"value":204},{"type":172,"tag":35,"props":237,"children":238},{"style":207},[239],{"type":187,"value":240}," \".\u002Ftypes\"",{"type":172,"tag":35,"props":242,"children":243},{"style":196},[244],{"type":187,"value":215},{"type":172,"tag":35,"props":246,"children":248},{"class":37,"line":247},3,[249],{"type":172,"tag":35,"props":250,"children":251},{"emptyLinePlaceholder":158},[252],{"type":187,"value":253},"\n",{"type":172,"tag":35,"props":255,"children":257},{"class":37,"line":256},4,[258],{"type":172,"tag":35,"props":259,"children":261},{"style":260},"--shiki-default:#6A737D;--shiki-light:#6A737D;--shiki-dark:#6A737D",[262],{"type":187,"value":263},"\u002F**\n",{"type":172,"tag":35,"props":265,"children":266},{"class":37,"line":159},[267],{"type":172,"tag":35,"props":268,"children":269},{"style":260},[270],{"type":187,"value":271}," * Saves explicitly; storage failure propagates so callers cannot report false success.\n",{"type":172,"tag":35,"props":273,"children":275},{"class":37,"line":274},6,[276,281,286,291],{"type":172,"tag":35,"props":277,"children":278},{"style":260},[279],{"type":187,"value":280}," * ",{"type":172,"tag":35,"props":282,"children":283},{"style":184},[284],{"type":187,"value":285},"@param",{"type":172,"tag":35,"props":287,"children":288},{"style":196},[289],{"type":187,"value":290}," editor",{"type":172,"tag":35,"props":292,"children":293},{"style":260},[294],{"type":187,"value":295}," - The current document authority.\n",{"type":172,"tag":35,"props":297,"children":299},{"class":37,"line":298},7,[300,304,308,313],{"type":172,"tag":35,"props":301,"children":302},{"style":260},[303],{"type":187,"value":280},{"type":172,"tag":35,"props":305,"children":306},{"style":184},[307],{"type":187,"value":285},{"type":172,"tag":35,"props":309,"children":310},{"style":196},[311],{"type":187,"value":312}," storage",{"type":172,"tag":35,"props":314,"children":315},{"style":260},[316],{"type":187,"value":317}," - Host-selected browser or test storage.\n",{"type":172,"tag":35,"props":319,"children":321},{"class":37,"line":320},8,[322,326,330,335],{"type":172,"tag":35,"props":323,"children":324},{"style":260},[325],{"type":187,"value":280},{"type":172,"tag":35,"props":327,"children":328},{"style":184},[329],{"type":187,"value":285},{"type":172,"tag":35,"props":331,"children":332},{"style":196},[333],{"type":187,"value":334}," key",{"type":172,"tag":35,"props":336,"children":337},{"style":260},[338],{"type":187,"value":339}," - Document-specific storage key.\n",{"type":172,"tag":35,"props":341,"children":343},{"class":37,"line":342},9,[344],{"type":172,"tag":35,"props":345,"children":346},{"style":260},[347],{"type":187,"value":348}," *\u002F\n",{"type":172,"tag":35,"props":350,"children":352},{"class":37,"line":351},10,[353,358,363,369,373,379,384,389,394,399,403,408,413,418,422,426,430,435,439,444,448,453,457,463,468,472,477],{"type":172,"tag":35,"props":354,"children":355},{"style":184},[356],{"type":187,"value":357},"export",{"type":172,"tag":35,"props":359,"children":360},{"style":184},[361],{"type":187,"value":362}," function",{"type":172,"tag":35,"props":364,"children":366},{"style":365},"--shiki-default:#6F42C1;--shiki-light:#6F42C1;--shiki-dark:#B392F0",[367],{"type":187,"value":368}," saveDocument",{"type":172,"tag":35,"props":370,"children":371},{"style":196},[372],{"type":187,"value":78},{"type":172,"tag":35,"props":374,"children":376},{"style":375},"--shiki-default:#E36209;--shiki-light:#E36209;--shiki-dark:#FFAB70",[377],{"type":187,"value":378},"editor",{"type":172,"tag":35,"props":380,"children":381},{"style":184},[382],{"type":187,"value":383},":",{"type":172,"tag":35,"props":385,"children":386},{"style":365},[387],{"type":187,"value":388}," Pick",{"type":172,"tag":35,"props":390,"children":391},{"style":196},[392],{"type":187,"value":393},"\u003C",{"type":172,"tag":35,"props":395,"children":396},{"style":365},[397],{"type":187,"value":398},"Editor",{"type":172,"tag":35,"props":400,"children":401},{"style":196},[402],{"type":187,"value":85},{"type":172,"tag":35,"props":404,"children":405},{"style":207},[406],{"type":187,"value":407},"\"getJSON\"",{"type":172,"tag":35,"props":409,"children":410},{"style":196},[411],{"type":187,"value":412},">, ",{"type":172,"tag":35,"props":414,"children":415},{"style":375},[416],{"type":187,"value":417},"storage",{"type":172,"tag":35,"props":419,"children":420},{"style":184},[421],{"type":187,"value":383},{"type":172,"tag":35,"props":423,"children":424},{"style":365},[425],{"type":187,"value":388},{"type":172,"tag":35,"props":427,"children":428},{"style":196},[429],{"type":187,"value":393},{"type":172,"tag":35,"props":431,"children":432},{"style":365},[433],{"type":187,"value":434},"Storage",{"type":172,"tag":35,"props":436,"children":437},{"style":196},[438],{"type":187,"value":85},{"type":172,"tag":35,"props":440,"children":441},{"style":207},[442],{"type":187,"value":443},"\"setItem\"",{"type":172,"tag":35,"props":445,"children":446},{"style":196},[447],{"type":187,"value":412},{"type":172,"tag":35,"props":449,"children":450},{"style":375},[451],{"type":187,"value":452},"key",{"type":172,"tag":35,"props":454,"children":455},{"style":184},[456],{"type":187,"value":383},{"type":172,"tag":35,"props":458,"children":460},{"style":459},"--shiki-default:#005CC5;--shiki-light:#005CC5;--shiki-dark:#79B8FF",[461],{"type":187,"value":462}," string",{"type":172,"tag":35,"props":464,"children":465},{"style":196},[466],{"type":187,"value":467},")",{"type":172,"tag":35,"props":469,"children":470},{"style":184},[471],{"type":187,"value":383},{"type":172,"tag":35,"props":473,"children":474},{"style":459},[475],{"type":187,"value":476}," void",{"type":172,"tag":35,"props":478,"children":479},{"style":196},[480],{"type":187,"value":481}," {\n",{"type":172,"tag":35,"props":483,"children":485},{"class":37,"line":484},11,[486,491,495,499,504,508,512,516,520,524],{"type":172,"tag":35,"props":487,"children":488},{"style":184},[489],{"type":187,"value":490},"  const",{"type":172,"tag":35,"props":492,"children":493},{"style":459},[494],{"type":187,"value":46},{"type":172,"tag":35,"props":496,"children":497},{"style":184},[498],{"type":187,"value":383},{"type":172,"tag":35,"props":500,"children":501},{"style":365},[502],{"type":187,"value":503}," DocumentSnapshot",{"type":172,"tag":35,"props":505,"children":506},{"style":184},[507],{"type":187,"value":49},{"type":172,"tag":35,"props":509,"children":510},{"style":196},[511],{"type":187,"value":53},{"type":172,"tag":35,"props":513,"children":514},{"style":459},[515],{"type":187,"value":56},{"type":172,"tag":35,"props":517,"children":518},{"style":196},[519],{"type":187,"value":59},{"type":172,"tag":35,"props":521,"children":522},{"style":365},[523],{"type":187,"value":63},{"type":172,"tag":35,"props":525,"children":526},{"style":196},[527],{"type":187,"value":528},"() };\n",{"type":172,"tag":35,"props":530,"children":532},{"class":37,"line":531},12,[533,538,542,547,551,555,559],{"type":172,"tag":35,"props":534,"children":535},{"style":196},[536],{"type":187,"value":537},"  storage.",{"type":172,"tag":35,"props":539,"children":540},{"style":365},[541],{"type":187,"value":75},{"type":172,"tag":35,"props":543,"children":544},{"style":196},[545],{"type":187,"value":546},"(key, ",{"type":172,"tag":35,"props":548,"children":549},{"style":459},[550],{"type":187,"value":88},{"type":172,"tag":35,"props":552,"children":553},{"style":196},[554],{"type":187,"value":91},{"type":172,"tag":35,"props":556,"children":557},{"style":365},[558],{"type":187,"value":94},{"type":172,"tag":35,"props":560,"children":561},{"style":196},[562],{"type":187,"value":563},"(snapshot));\n",{"type":172,"tag":35,"props":565,"children":567},{"class":37,"line":566},13,[568],{"type":172,"tag":35,"props":569,"children":570},{"style":196},[571],{"type":187,"value":572},"}\n",{"type":172,"tag":35,"props":574,"children":576},{"class":37,"line":575},14,[577],{"type":172,"tag":35,"props":578,"children":579},{"emptyLinePlaceholder":158},[580],{"type":187,"value":253},{"type":172,"tag":35,"props":582,"children":584},{"class":37,"line":583},15,[585],{"type":172,"tag":35,"props":586,"children":587},{"style":260},[588],{"type":187,"value":263},{"type":172,"tag":35,"props":590,"children":592},{"class":37,"line":591},16,[593],{"type":172,"tag":35,"props":594,"children":595},{"style":260},[596],{"type":187,"value":597}," * Reads the versioned envelope; the editor schema remains responsible for content admission.\n",{"type":172,"tag":35,"props":599,"children":601},{"class":37,"line":600},17,[602,606,610,614],{"type":172,"tag":35,"props":603,"children":604},{"style":260},[605],{"type":187,"value":280},{"type":172,"tag":35,"props":607,"children":608},{"style":184},[609],{"type":187,"value":285},{"type":172,"tag":35,"props":611,"children":612},{"style":196},[613],{"type":187,"value":312},{"type":172,"tag":35,"props":615,"children":616},{"style":260},[617],{"type":187,"value":618}," - The same host storage used for saving.\n",{"type":172,"tag":35,"props":620,"children":622},{"class":37,"line":621},18,[623,627,631,635],{"type":172,"tag":35,"props":624,"children":625},{"style":260},[626],{"type":187,"value":280},{"type":172,"tag":35,"props":628,"children":629},{"style":184},[630],{"type":187,"value":285},{"type":172,"tag":35,"props":632,"children":633},{"style":196},[634],{"type":187,"value":334},{"type":172,"tag":35,"props":636,"children":637},{"style":260},[638],{"type":187,"value":339},{"type":172,"tag":35,"props":640,"children":642},{"class":37,"line":641},19,[643,647,652],{"type":172,"tag":35,"props":644,"children":645},{"style":260},[646],{"type":187,"value":280},{"type":172,"tag":35,"props":648,"children":649},{"style":184},[650],{"type":187,"value":651},"@returns",{"type":172,"tag":35,"props":653,"children":654},{"style":260},[655],{"type":187,"value":656}," Saved canonical JSON, or null when this document has not been saved.\n",{"type":172,"tag":35,"props":658,"children":660},{"class":37,"line":659},20,[661],{"type":172,"tag":35,"props":662,"children":663},{"style":260},[664],{"type":187,"value":348},{"type":172,"tag":35,"props":666,"children":668},{"class":37,"line":667},21,[669,673,677,682,686,690,694,698,702,706,710,715,719,723,727,731,735,739,744,749,754],{"type":172,"tag":35,"props":670,"children":671},{"style":184},[672],{"type":187,"value":357},{"type":172,"tag":35,"props":674,"children":675},{"style":184},[676],{"type":187,"value":362},{"type":172,"tag":35,"props":678,"children":679},{"style":365},[680],{"type":187,"value":681}," readDocument",{"type":172,"tag":35,"props":683,"children":684},{"style":196},[685],{"type":187,"value":78},{"type":172,"tag":35,"props":687,"children":688},{"style":375},[689],{"type":187,"value":417},{"type":172,"tag":35,"props":691,"children":692},{"style":184},[693],{"type":187,"value":383},{"type":172,"tag":35,"props":695,"children":696},{"style":365},[697],{"type":187,"value":388},{"type":172,"tag":35,"props":699,"children":700},{"style":196},[701],{"type":187,"value":393},{"type":172,"tag":35,"props":703,"children":704},{"style":365},[705],{"type":187,"value":434},{"type":172,"tag":35,"props":707,"children":708},{"style":196},[709],{"type":187,"value":85},{"type":172,"tag":35,"props":711,"children":712},{"style":207},[713],{"type":187,"value":714},"\"getItem\"",{"type":172,"tag":35,"props":716,"children":717},{"style":196},[718],{"type":187,"value":412},{"type":172,"tag":35,"props":720,"children":721},{"style":375},[722],{"type":187,"value":452},{"type":172,"tag":35,"props":724,"children":725},{"style":184},[726],{"type":187,"value":383},{"type":172,"tag":35,"props":728,"children":729},{"style":459},[730],{"type":187,"value":462},{"type":172,"tag":35,"props":732,"children":733},{"style":196},[734],{"type":187,"value":467},{"type":172,"tag":35,"props":736,"children":737},{"style":184},[738],{"type":187,"value":383},{"type":172,"tag":35,"props":740,"children":741},{"style":365},[742],{"type":187,"value":743}," JSONContent",{"type":172,"tag":35,"props":745,"children":746},{"style":184},[747],{"type":187,"value":748}," |",{"type":172,"tag":35,"props":750,"children":751},{"style":459},[752],{"type":187,"value":753}," null",{"type":172,"tag":35,"props":755,"children":756},{"style":196},[757],{"type":187,"value":481},{"type":172,"tag":35,"props":759,"children":761},{"class":37,"line":760},22,[762,766,771,775,780,785],{"type":172,"tag":35,"props":763,"children":764},{"style":184},[765],{"type":187,"value":490},{"type":172,"tag":35,"props":767,"children":768},{"style":459},[769],{"type":187,"value":770}," source",{"type":172,"tag":35,"props":772,"children":773},{"style":184},[774],{"type":187,"value":49},{"type":172,"tag":35,"props":776,"children":777},{"style":196},[778],{"type":187,"value":779}," storage.",{"type":172,"tag":35,"props":781,"children":782},{"style":365},[783],{"type":187,"value":784},"getItem",{"type":172,"tag":35,"props":786,"children":787},{"style":196},[788],{"type":187,"value":789},"(key);\n",{"type":172,"tag":35,"props":791,"children":793},{"class":37,"line":792},23,[794,799,804,809,813,818,823,827],{"type":172,"tag":35,"props":795,"children":796},{"style":184},[797],{"type":187,"value":798},"  if",{"type":172,"tag":35,"props":800,"children":801},{"style":196},[802],{"type":187,"value":803}," (source ",{"type":172,"tag":35,"props":805,"children":806},{"style":184},[807],{"type":187,"value":808},"===",{"type":172,"tag":35,"props":810,"children":811},{"style":459},[812],{"type":187,"value":753},{"type":172,"tag":35,"props":814,"children":815},{"style":196},[816],{"type":187,"value":817},") ",{"type":172,"tag":35,"props":819,"children":820},{"style":184},[821],{"type":187,"value":822},"return",{"type":172,"tag":35,"props":824,"children":825},{"style":459},[826],{"type":187,"value":753},{"type":172,"tag":35,"props":828,"children":829},{"style":196},[830],{"type":187,"value":215},{"type":172,"tag":35,"props":832,"children":834},{"class":37,"line":833},24,[835,839,844,848,853,857,862,866,871],{"type":172,"tag":35,"props":836,"children":837},{"style":184},[838],{"type":187,"value":490},{"type":172,"tag":35,"props":840,"children":841},{"style":459},[842],{"type":187,"value":843}," value",{"type":172,"tag":35,"props":845,"children":846},{"style":184},[847],{"type":187,"value":383},{"type":172,"tag":35,"props":849,"children":850},{"style":459},[851],{"type":187,"value":852}," unknown",{"type":172,"tag":35,"props":854,"children":855},{"style":184},[856],{"type":187,"value":49},{"type":172,"tag":35,"props":858,"children":859},{"style":459},[860],{"type":187,"value":861}," JSON",{"type":172,"tag":35,"props":863,"children":864},{"style":196},[865],{"type":187,"value":91},{"type":172,"tag":35,"props":867,"children":868},{"style":365},[869],{"type":187,"value":870},"parse",{"type":172,"tag":35,"props":872,"children":873},{"style":196},[874],{"type":187,"value":875},"(source);\n",{"type":172,"tag":35,"props":877,"children":879},{"class":37,"line":878},25,[880,884,889,894,899,904,909,914,919,924,929,934,938,943,948,953,957,962,966,971,975,979,983,988,992],{"type":172,"tag":35,"props":881,"children":882},{"style":184},[883],{"type":187,"value":798},{"type":172,"tag":35,"props":885,"children":886},{"style":196},[887],{"type":187,"value":888}," (",{"type":172,"tag":35,"props":890,"children":891},{"style":184},[892],{"type":187,"value":893},"!",{"type":172,"tag":35,"props":895,"children":896},{"style":196},[897],{"type":187,"value":898},"value ",{"type":172,"tag":35,"props":900,"children":901},{"style":184},[902],{"type":187,"value":903},"||",{"type":172,"tag":35,"props":905,"children":906},{"style":184},[907],{"type":187,"value":908}," typeof",{"type":172,"tag":35,"props":910,"children":911},{"style":196},[912],{"type":187,"value":913}," value ",{"type":172,"tag":35,"props":915,"children":916},{"style":184},[917],{"type":187,"value":918},"!==",{"type":172,"tag":35,"props":920,"children":921},{"style":207},[922],{"type":187,"value":923}," \"object\"",{"type":172,"tag":35,"props":925,"children":926},{"style":184},[927],{"type":187,"value":928}," ||",{"type":172,"tag":35,"props":930,"children":931},{"style":184},[932],{"type":187,"value":933}," !",{"type":172,"tag":35,"props":935,"children":936},{"style":196},[937],{"type":187,"value":78},{"type":172,"tag":35,"props":939,"children":940},{"style":207},[941],{"type":187,"value":942},"\"version\"",{"type":172,"tag":35,"props":944,"children":945},{"style":184},[946],{"type":187,"value":947}," in",{"type":172,"tag":35,"props":949,"children":950},{"style":196},[951],{"type":187,"value":952}," value) ",{"type":172,"tag":35,"props":954,"children":955},{"style":184},[956],{"type":187,"value":903},{"type":172,"tag":35,"props":958,"children":959},{"style":196},[960],{"type":187,"value":961}," value.version ",{"type":172,"tag":35,"props":963,"children":964},{"style":184},[965],{"type":187,"value":918},{"type":172,"tag":35,"props":967,"children":968},{"style":459},[969],{"type":187,"value":970}," 1",{"type":172,"tag":35,"props":972,"children":973},{"style":184},[974],{"type":187,"value":928},{"type":172,"tag":35,"props":976,"children":977},{"style":184},[978],{"type":187,"value":933},{"type":172,"tag":35,"props":980,"children":981},{"style":196},[982],{"type":187,"value":78},{"type":172,"tag":35,"props":984,"children":985},{"style":207},[986],{"type":187,"value":987},"\"content\"",{"type":172,"tag":35,"props":989,"children":990},{"style":184},[991],{"type":187,"value":947},{"type":172,"tag":35,"props":993,"children":994},{"style":196},[995],{"type":187,"value":996}," value)) {\n",{"type":172,"tag":35,"props":998,"children":1000},{"class":37,"line":999},26,[1001,1006,1011,1016,1020,1025],{"type":172,"tag":35,"props":1002,"children":1003},{"style":184},[1004],{"type":187,"value":1005},"    throw",{"type":172,"tag":35,"props":1007,"children":1008},{"style":184},[1009],{"type":187,"value":1010}," new",{"type":172,"tag":35,"props":1012,"children":1013},{"style":365},[1014],{"type":187,"value":1015}," Error",{"type":172,"tag":35,"props":1017,"children":1018},{"style":196},[1019],{"type":187,"value":78},{"type":172,"tag":35,"props":1021,"children":1022},{"style":207},[1023],{"type":187,"value":1024},"\"Unsupported document snapshot version\"",{"type":172,"tag":35,"props":1026,"children":1027},{"style":196},[1028],{"type":187,"value":1029},");\n",{"type":172,"tag":35,"props":1031,"children":1033},{"class":37,"line":1032},27,[1034],{"type":172,"tag":35,"props":1035,"children":1036},{"style":196},[1037],{"type":187,"value":1038},"  }\n",{"type":172,"tag":35,"props":1040,"children":1042},{"class":37,"line":1041},28,[1043,1047,1052,1056],{"type":172,"tag":35,"props":1044,"children":1045},{"style":184},[1046],{"type":187,"value":490},{"type":172,"tag":35,"props":1048,"children":1049},{"style":459},[1050],{"type":187,"value":1051}," content",{"type":172,"tag":35,"props":1053,"children":1054},{"style":184},[1055],{"type":187,"value":49},{"type":172,"tag":35,"props":1057,"children":1058},{"style":196},[1059],{"type":187,"value":1060}," value.content;\n",{"type":172,"tag":35,"props":1062,"children":1064},{"class":37,"line":1063},29,[1065,1069,1073,1077,1082,1086,1090,1095,1099,1103,1107,1111,1115,1120,1124,1129,1133,1138,1142,1147],{"type":172,"tag":35,"props":1066,"children":1067},{"style":184},[1068],{"type":187,"value":798},{"type":172,"tag":35,"props":1070,"children":1071},{"style":196},[1072],{"type":187,"value":888},{"type":172,"tag":35,"props":1074,"children":1075},{"style":184},[1076],{"type":187,"value":893},{"type":172,"tag":35,"props":1078,"children":1079},{"style":196},[1080],{"type":187,"value":1081},"content ",{"type":172,"tag":35,"props":1083,"children":1084},{"style":184},[1085],{"type":187,"value":903},{"type":172,"tag":35,"props":1087,"children":1088},{"style":184},[1089],{"type":187,"value":908},{"type":172,"tag":35,"props":1091,"children":1092},{"style":196},[1093],{"type":187,"value":1094}," content ",{"type":172,"tag":35,"props":1096,"children":1097},{"style":184},[1098],{"type":187,"value":918},{"type":172,"tag":35,"props":1100,"children":1101},{"style":207},[1102],{"type":187,"value":923},{"type":172,"tag":35,"props":1104,"children":1105},{"style":184},[1106],{"type":187,"value":928},{"type":172,"tag":35,"props":1108,"children":1109},{"style":184},[1110],{"type":187,"value":933},{"type":172,"tag":35,"props":1112,"children":1113},{"style":196},[1114],{"type":187,"value":78},{"type":172,"tag":35,"props":1116,"children":1117},{"style":207},[1118],{"type":187,"value":1119},"\"type\"",{"type":172,"tag":35,"props":1121,"children":1122},{"style":184},[1123],{"type":187,"value":947},{"type":172,"tag":35,"props":1125,"children":1126},{"style":196},[1127],{"type":187,"value":1128}," content) ",{"type":172,"tag":35,"props":1130,"children":1131},{"style":184},[1132],{"type":187,"value":903},{"type":172,"tag":35,"props":1134,"children":1135},{"style":196},[1136],{"type":187,"value":1137}," content.type ",{"type":172,"tag":35,"props":1139,"children":1140},{"style":184},[1141],{"type":187,"value":918},{"type":172,"tag":35,"props":1143,"children":1144},{"style":207},[1145],{"type":187,"value":1146}," \"doc\"",{"type":172,"tag":35,"props":1148,"children":1149},{"style":196},[1150],{"type":187,"value":1151},") {\n",{"type":172,"tag":35,"props":1153,"children":1155},{"class":37,"line":1154},30,[1156,1160,1164,1168,1172,1177],{"type":172,"tag":35,"props":1157,"children":1158},{"style":184},[1159],{"type":187,"value":1005},{"type":172,"tag":35,"props":1161,"children":1162},{"style":184},[1163],{"type":187,"value":1010},{"type":172,"tag":35,"props":1165,"children":1166},{"style":365},[1167],{"type":187,"value":1015},{"type":172,"tag":35,"props":1169,"children":1170},{"style":196},[1171],{"type":187,"value":78},{"type":172,"tag":35,"props":1173,"children":1174},{"style":207},[1175],{"type":187,"value":1176},"\"Invalid document snapshot\"",{"type":172,"tag":35,"props":1178,"children":1179},{"style":196},[1180],{"type":187,"value":1029},{"type":172,"tag":35,"props":1182,"children":1184},{"class":37,"line":1183},31,[1185],{"type":172,"tag":35,"props":1186,"children":1187},{"style":196},[1188],{"type":187,"value":1038},{"type":172,"tag":35,"props":1190,"children":1192},{"class":37,"line":1191},32,[1193,1198,1202,1207,1211],{"type":172,"tag":35,"props":1194,"children":1195},{"style":184},[1196],{"type":187,"value":1197},"  return",{"type":172,"tag":35,"props":1199,"children":1200},{"style":196},[1201],{"type":187,"value":1094},{"type":172,"tag":35,"props":1203,"children":1204},{"style":184},[1205],{"type":187,"value":1206},"as",{"type":172,"tag":35,"props":1208,"children":1209},{"style":365},[1210],{"type":187,"value":743},{"type":172,"tag":35,"props":1212,"children":1213},{"style":196},[1214],{"type":187,"value":215},{"type":172,"tag":35,"props":1216,"children":1218},{"class":37,"line":1217},33,[1219],{"type":172,"tag":35,"props":1220,"children":1221},{"style":196},[1222],{"type":187,"value":572},{"type":172,"tag":145,"props":1224,"children":1225},{},[1226],{"type":187,"value":1227},"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);}",1793045209087]