@jxsuite/studio 6.0.0 → 6.1.1

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.
Files changed (208) hide show
  1. package/dist/chunks/2020-va2wwra4.js +4 -0
  2. package/dist/chunks/adapter-f93pafd7.js +4 -0
  3. package/dist/chunks/{cf-account-picker-bb2yq946.js → cf-account-picker-af1h381v.js} +3 -3
  4. package/dist/chunks/cf-settings-125tdm0w.js +4 -0
  5. package/dist/chunks/components-ax2f1fnn.js +4 -0
  6. package/dist/chunks/content-source-108aqtk1.js +4 -0
  7. package/dist/chunks/{convert-to-repeater-vqkt7s3s.js → convert-to-repeater-ry5rmppr.js} +3 -3
  8. package/dist/chunks/editor-pfgdmkb0.js +4 -0
  9. package/dist/chunks/entry-commands-t0k1q0kx.js +4 -0
  10. package/dist/chunks/{extension-sections-8beq9ac3.js → extension-sections-6mwh2hf8.js} +3 -3
  11. package/dist/chunks/file-ops-meej5mqf.js +4 -0
  12. package/dist/chunks/files-44vp8a2s.js +4 -0
  13. package/dist/chunks/format-host-7q1petb9.js +4 -0
  14. package/dist/chunks/fs-events-h2mwnxaz.js +4 -0
  15. package/dist/chunks/git-panel-zngbymvd.js +4 -0
  16. package/dist/chunks/{grid-view-ca10def6.js → grid-view-sx9vynsp.js} +15 -15
  17. package/dist/chunks/icons-p44xhjf0.js +4 -0
  18. package/dist/chunks/iframe-host-qk3ycq87.js +4 -0
  19. package/dist/chunks/{index-9ydfe04y.js → index-2veqmnhr.js} +3 -3
  20. package/dist/chunks/index-wkyfjeqz.js +4 -0
  21. package/dist/chunks/{javascript-d9pqgc2p.js → javascript-8nbvs12s.js} +3 -3
  22. package/dist/chunks/jsonMode-s8kt9dsj.js +13 -0
  23. package/dist/chunks/jx-validate-psgd7vsx.js +4 -0
  24. package/dist/chunks/layers-panel-1kq2jyfk.js +4 -0
  25. package/dist/chunks/layers-xd92fg8d.js +4 -0
  26. package/dist/chunks/lit-html-ac4cwwr4.js +4 -0
  27. package/dist/chunks/media-picker-0svzkdyb.js +4 -0
  28. package/dist/chunks/menu-5c55ea3d.js +4 -0
  29. package/dist/chunks/{monaco-binding-62dtmgbf.js → monaco-binding-z6r70pdt.js} +3 -3
  30. package/dist/chunks/monaco-buffer-fz6gq5y7.js +4 -0
  31. package/dist/chunks/monaco-setup-q4axkgj7.js +4 -0
  32. package/dist/chunks/notify-0xgtn8q1.js +4 -0
  33. package/dist/chunks/platform-v1qctbe6.js +4 -0
  34. package/dist/chunks/publish-panel-ym1fmgq5.js +4 -0
  35. package/dist/chunks/quick-search-a54e6t5n.js +4 -0
  36. package/dist/chunks/references-gmqp82fs.js +4 -0
  37. package/dist/chunks/right-panel-v7t9awbk.js +4 -0
  38. package/dist/chunks/section-registry-vhyf3zsr.js +4 -0
  39. package/dist/chunks/studio-0bhx5hz6.js +5 -0
  40. package/dist/chunks/studio-0k1ddnyy.js +6 -0
  41. package/dist/chunks/studio-1b04pd0j.js +64 -0
  42. package/dist/chunks/{studio-sxc0zvpt.js → studio-1q1sh2ax.js} +3 -3
  43. package/dist/chunks/studio-4dwbj6gb.js +5 -0
  44. package/dist/chunks/studio-4tanh828.js +5 -0
  45. package/dist/chunks/{studio-fqq890ap.js → studio-55h4mstj.js} +3 -3
  46. package/dist/chunks/studio-5tnvjkz4.js +5 -0
  47. package/dist/chunks/studio-60dqgb0c.js +5 -0
  48. package/dist/chunks/studio-61dp09qg.js +9 -0
  49. package/dist/chunks/studio-63epcrj2.js +5 -0
  50. package/dist/chunks/studio-74k29dy9.js +5 -0
  51. package/dist/chunks/{studio-qa73881a.js → studio-7vg6jcd3.js} +4 -4
  52. package/dist/chunks/studio-7zx31knw.js +9 -0
  53. package/dist/chunks/studio-8bxk97km.js +5 -0
  54. package/dist/chunks/{studio-edbtvcd1.js → studio-8grwxtqk.js} +4 -4
  55. package/dist/chunks/studio-933e30n4.js +5 -0
  56. package/dist/chunks/{studio-rr4xkv81.js → studio-98wnwhbg.js} +4 -4
  57. package/dist/chunks/studio-9mccjwjh.js +14 -0
  58. package/dist/chunks/studio-a2ke1e4t.js +5 -0
  59. package/dist/chunks/studio-e3a2a6v3.js +4 -0
  60. package/dist/chunks/{studio-pwqfmt4p.js → studio-e81q1vb9.js} +4 -4
  61. package/dist/chunks/{studio-7pgy3xaf.js → studio-epgrmqqm.js} +4 -4
  62. package/dist/chunks/studio-g1shz58g.js +5 -0
  63. package/dist/chunks/studio-gf0fz03c.js +5 -0
  64. package/dist/chunks/studio-gjtpe62q.js +6 -0
  65. package/dist/chunks/{studio-tzegmy4w.js → studio-gkskhg7m.js} +4 -4
  66. package/dist/chunks/studio-gx4dnjzd.js +5 -0
  67. package/dist/chunks/{studio-8xcwewjq.js → studio-h46vtzk8.js} +4 -4
  68. package/dist/chunks/studio-j03zga3y.js +9 -0
  69. package/dist/chunks/{studio-4r0sjtx8.js → studio-jhpxeckz.js} +4 -4
  70. package/dist/chunks/{studio-zd4kayn2.js → studio-k01r7ykp.js} +4 -4
  71. package/dist/chunks/{studio-03wwfvyt.js → studio-kggey1jt.js} +4 -4
  72. package/dist/chunks/{studio-hnvnfbdv.js → studio-kk7h30ne.js} +6 -6
  73. package/dist/chunks/{studio-01qza1n3.js → studio-kt1zqney.js} +4 -4
  74. package/dist/chunks/{studio-r3kaka4d.js → studio-m3cwhvye.js} +4 -4
  75. package/dist/chunks/{studio-evwgp1ym.js → studio-mcayt6hz.js} +4 -4
  76. package/dist/chunks/{studio-5vy2wfm5.js → studio-myjcghv3.js} +4 -4
  77. package/dist/chunks/studio-n8bxwc3y.js +4 -0
  78. package/dist/chunks/{studio-ztvcxm3w.js → studio-ngm8gvpb.js} +4 -4
  79. package/dist/chunks/{studio-01kbbqg3.js → studio-nj5a01jy.js} +196 -196
  80. package/dist/chunks/{studio-xkfs0dp2.js → studio-pcgz8heb.js} +4 -4
  81. package/dist/chunks/{studio-0bbxhhce.js → studio-pre0skq6.js} +4 -4
  82. package/dist/chunks/{studio-n78gjfy8.js → studio-qcsq0t15.js} +4 -4
  83. package/dist/chunks/studio-qkstvve9.js +5 -0
  84. package/dist/chunks/studio-qv1pwd3c.js +5 -0
  85. package/dist/chunks/{studio-rmn2dz59.js → studio-rc6dvxjb.js} +5 -5
  86. package/dist/chunks/{studio-st75kn99.js → studio-rv11kfwa.js} +7 -7
  87. package/dist/chunks/studio-s8dmmz66.js +5 -0
  88. package/dist/chunks/studio-sp5xzbj4.js +6 -0
  89. package/dist/chunks/{studio-tmeq6mjb.js → studio-szsjbj0g.js} +4 -4
  90. package/dist/chunks/studio-t1xzawhr.js +16 -0
  91. package/dist/chunks/{studio-mk00zd5d.js → studio-t6b6qe31.js} +4 -4
  92. package/dist/chunks/{studio-bftp4n4b.js → studio-tdcprbqb.js} +4 -4
  93. package/dist/chunks/{studio-ge5fqjth.js → studio-vrmcjf9g.js} +5 -5
  94. package/dist/chunks/studio-vyc0b4he.js +10 -0
  95. package/dist/chunks/{studio-semd1s8s.js → studio-w0cgf6jg.js} +4 -4
  96. package/dist/chunks/{studio-gp02nqnw.js → studio-w3hskzqk.js} +4 -4
  97. package/dist/chunks/{studio-1wvfxkyy.js → studio-wszjyh0j.js} +4 -4
  98. package/dist/chunks/studio-xgrgcdyh.js +9 -0
  99. package/dist/chunks/{studio-y7jehjrp.js → studio-xz2yxfcb.js} +4 -4
  100. package/dist/chunks/{studio-aje966s9.js → studio-y6n42tgs.js} +4 -4
  101. package/dist/chunks/{studio-yr04mv2j.js → studio-yb560vxr.js} +4 -4
  102. package/dist/chunks/{studio-tp642n5g.js → studio-yn9f8vtx.js} +4 -4
  103. package/dist/chunks/studio-yw05w8f0.js +7 -0
  104. package/dist/chunks/{studio-cbr9czkn.js → studio-z16sgavc.js} +4 -4
  105. package/dist/chunks/studio-zey7zsdw.js +12 -0
  106. package/dist/chunks/{studio-1q6amtph.js → studio-zyqn40w4.js} +4 -4
  107. package/dist/chunks/tsMode-2frah6h1.js +14 -0
  108. package/dist/chunks/workspace-zt81g1ms.js +4 -0
  109. package/dist/chunks/ws-client-n2bh4hkf.js +4 -0
  110. package/dist/iframe-entry.js +13 -13
  111. package/dist/manifest.json +62 -62
  112. package/dist/studio.js +87 -87
  113. package/dist/workers/ts.worker.js +3 -3
  114. package/package.json +10 -10
  115. package/src/canvas/canvas-render.ts +4 -1
  116. package/src/canvas/canvas-utils.ts +73 -15
  117. package/src/canvas/iframe-host.ts +67 -21
  118. package/src/canvas/iframe-inline-edit.ts +22 -4
  119. package/src/canvas/iframe-interaction.ts +7 -1
  120. package/src/canvas/iframe-protocol.ts +3 -0
  121. package/src/canvas/iframe-render.ts +5 -2
  122. package/src/commands/defaults.ts +4 -1
  123. package/src/commands/live-context.ts +3 -1
  124. package/src/editor/shortcuts.ts +55 -27
  125. package/src/files/media-paths.ts +3 -1
  126. package/src/new-project/add-repo-modal.ts +459 -59
  127. package/src/panels/editors.ts +3 -1
  128. package/src/panels/style-panel.ts +36 -11
  129. package/src/platforms/cloud.ts +95 -18
  130. package/src/platforms/devserver.ts +47 -12
  131. package/src/publish/pages-service.ts +7 -0
  132. package/src/publish/publish-panel.ts +16 -2
  133. package/src/studio.ts +14 -2
  134. package/src/surfaces/add-repo.json +721 -224
  135. package/src/surfaces/add-repo.ts +196 -31
  136. package/src/surfaces/library-pane.ts +6 -0
  137. package/src/surfaces/rail.json +126 -73
  138. package/src/surfaces/rail.ts +31 -5
  139. package/src/tabs/typing.ts +31 -0
  140. package/src/types.ts +42 -3
  141. package/src/utils/edit-display.ts +30 -1
  142. package/src/utils/project-dir.ts +24 -0
  143. package/src/workspace/workspace.ts +7 -0
  144. package/dist/chunks/2020-cs2sb9t1.js +0 -4
  145. package/dist/chunks/adapter-y5gdq19c.js +0 -4
  146. package/dist/chunks/cf-settings-20dznc3j.js +0 -4
  147. package/dist/chunks/components-q037dya7.js +0 -4
  148. package/dist/chunks/content-source-t0q184js.js +0 -4
  149. package/dist/chunks/editor-j5sq149q.js +0 -4
  150. package/dist/chunks/entry-commands-fxzgcc4k.js +0 -4
  151. package/dist/chunks/file-ops-2n77759h.js +0 -4
  152. package/dist/chunks/files-fjy7zpxt.js +0 -4
  153. package/dist/chunks/format-host-wj3mf3n8.js +0 -4
  154. package/dist/chunks/fs-events-7kcgn4e9.js +0 -4
  155. package/dist/chunks/git-panel-7z2mpt2d.js +0 -4
  156. package/dist/chunks/icons-qbh8akb1.js +0 -4
  157. package/dist/chunks/iframe-host-a0zjd6xp.js +0 -4
  158. package/dist/chunks/index-m0x5ztax.js +0 -4
  159. package/dist/chunks/jsonMode-800yvbem.js +0 -13
  160. package/dist/chunks/jx-validate-zc9zp77s.js +0 -4
  161. package/dist/chunks/layers-p677nrh5.js +0 -4
  162. package/dist/chunks/layers-panel-y4w1dq90.js +0 -4
  163. package/dist/chunks/lit-html-cfn61dn7.js +0 -4
  164. package/dist/chunks/media-picker-xg7yjpz9.js +0 -4
  165. package/dist/chunks/menu-fpekzj6w.js +0 -4
  166. package/dist/chunks/monaco-buffer-nn4dtx27.js +0 -4
  167. package/dist/chunks/monaco-setup-tj13ndtm.js +0 -4
  168. package/dist/chunks/notify-ahs57a2z.js +0 -4
  169. package/dist/chunks/platform-v9xyfkbx.js +0 -4
  170. package/dist/chunks/publish-panel-xtbfgg2r.js +0 -4
  171. package/dist/chunks/quick-search-d3a6m7j3.js +0 -4
  172. package/dist/chunks/references-99ws0b0m.js +0 -4
  173. package/dist/chunks/right-panel-31vbk5xp.js +0 -4
  174. package/dist/chunks/section-registry-b2yzp9sw.js +0 -4
  175. package/dist/chunks/studio-1a99w39s.js +0 -5
  176. package/dist/chunks/studio-3ck2a5c4.js +0 -10
  177. package/dist/chunks/studio-4fde4a0x.js +0 -5
  178. package/dist/chunks/studio-4jj9gme2.js +0 -6
  179. package/dist/chunks/studio-4m50vh74.js +0 -16
  180. package/dist/chunks/studio-4xppwncr.js +0 -4
  181. package/dist/chunks/studio-5d7wfmnp.js +0 -5
  182. package/dist/chunks/studio-5e9zsamh.js +0 -9
  183. package/dist/chunks/studio-5gs9th4b.js +0 -5
  184. package/dist/chunks/studio-7qvs7v0m.js +0 -5
  185. package/dist/chunks/studio-84rtc120.js +0 -5
  186. package/dist/chunks/studio-aekhcdzw.js +0 -7
  187. package/dist/chunks/studio-aqmph6k4.js +0 -5
  188. package/dist/chunks/studio-c6zdm25z.js +0 -9
  189. package/dist/chunks/studio-capk0583.js +0 -9
  190. package/dist/chunks/studio-chdmwwzw.js +0 -5
  191. package/dist/chunks/studio-cp1gbff9.js +0 -14
  192. package/dist/chunks/studio-cqmtbg2p.js +0 -5
  193. package/dist/chunks/studio-e47215hh.js +0 -5
  194. package/dist/chunks/studio-fbx6twps.js +0 -6
  195. package/dist/chunks/studio-fthwn4kf.js +0 -5
  196. package/dist/chunks/studio-g8dsj3d2.js +0 -6
  197. package/dist/chunks/studio-gjknvzam.js +0 -9
  198. package/dist/chunks/studio-hjbg8d5y.js +0 -12
  199. package/dist/chunks/studio-nbxqcgvf.js +0 -5
  200. package/dist/chunks/studio-t1eedsyx.js +0 -4
  201. package/dist/chunks/studio-vavmwshr.js +0 -5
  202. package/dist/chunks/studio-x5g1xk77.js +0 -5
  203. package/dist/chunks/studio-x92tgnee.js +0 -64
  204. package/dist/chunks/studio-xg1942as.js +0 -5
  205. package/dist/chunks/studio-zev8ssp1.js +0 -5
  206. package/dist/chunks/tsMode-k9s9fcag.js +0 -14
  207. package/dist/chunks/workspace-5vmgsagj.js +0 -4
  208. package/dist/chunks/ws-client-0ja08haa.js +0 -4
@@ -1,9 +0,0 @@
1
- import{$v}from"./studio-cp1gbff9.js";import{v}from"./studio-fqq890ap.js";import{Nl,Cv,u}from"./studio-x5g1xk77.js";import{Di,qo,y}from"./studio-4m50vh74.js";import{st}from"./studio-pwqfmt4p.js";import{lt,bi,Il,Ou,hr,kC,IC}from"./studio-5gs9th4b.js";import{D,Lc}from"./studio-tp642n5g.js";import{T,R}from"./studio-7qvs7v0m.js";import{me}from"./studio-0bbxhhce.js";var qg={$sections:[{label:"Headings",elements:[{tag:"h1",text:"Code Is Poetry"},{tag:"h2",text:"Code Is Poetry"},{tag:"h3",text:"Code Is Poetry"},{tag:"h4",text:"Code Is Poetry"},{tag:"h5",text:"Code Is Poetry"},{tag:"h6",text:"Code Is Poetry"}]},{label:"Paragraph",elements:[{tag:"p",text:"In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing."}]},{label:"List",elements:[{tag:"ul",children:[{tag:"li",text:"Alice."},{tag:"li",text:"The White Rabbit."},{tag:"li",text:"The Cheshire Cat."},{tag:"li",text:"The Mad Hatter."},{tag:"li",text:"The Queen of Hearts."}]},{tag:"ol",children:[{tag:"li",text:"First item"},{tag:"li",text:"Second item"},{tag:"li",text:"Third item"}]}]},{label:"Quote",elements:[{tag:"blockquote",children:[{tag:"p",text:"In quoting others, we cite ourselves.",style:"font-size:1.25em;font-style:italic"},{tag:"p",text:"— Julio Cortázar"}]}]},{label:"Code",elements:[{tag:"pre",children:[{tag:"code",text:`// A "block" is the abstract term used
2
- // to describe units of markup that
3
- // when composed together, form the
4
- // content or layout of a page.
5
- registerBlockType( name, settings );`}]}]},{label:"Inline",elements:[{tag:"a",text:"Visit the documentation",attributes:{href:"#"}},{tag:"strong",text:"Bold text emphasis"},{tag:"em",text:"Italic text emphasis"},{tag:"small",text:"Fine print and legal text"},{tag:"mark",text:"Highlighted text"},{tag:"code",text:"const x = 42;"},{tag:"abbr",text:"HTML",attributes:{title:"HyperText Markup Language"}},{tag:"sub",text:"subscript"},{tag:"sup",text:"superscript"}]},{label:"Form",elements:[{tag:"input",attributes:{type:"text",placeholder:"Enter text…"}},{tag:"button",text:"Click Me"},{tag:"select",children:[{tag:"option",text:"Option 1"},{tag:"option",text:"Option 2"},{tag:"option",text:"Option 3"}]},{tag:"textarea",attributes:{placeholder:"Enter longer text…",rows:"3"}}]},{label:"Table",elements:[{tag:"table",children:[{tag:"thead",children:[{tag:"tr",children:[{tag:"th",text:"Name"},{tag:"th",text:"Role"},{tag:"th",text:"Status"}]}]},{tag:"tbody",children:[{tag:"tr",children:[{tag:"td",text:"Alice"},{tag:"td",text:"Developer"},{tag:"td",text:"Active"}]},{tag:"tr",children:[{tag:"td",text:"Bob"},{tag:"td",text:"Designer"},{tag:"td",text:"Away"}]},{tag:"tr",children:[{tag:"td",text:"Carol"},{tag:"td",text:"Manager"},{tag:"td",text:"Active"}]}]}]}]},{label:"Interactive",elements:[{tag:"details",attributes:{open:""},children:[{tag:"summary",text:"Click to expand details"},{tag:"p",text:"Additional detail content revealed when the disclosure widget is toggled open."}]}]},{label:"Media",elements:[{tag:"img",attributes:{alt:"Placeholder image"},style:"width:100%;max-width:400px;height:200px;background:#e0e0e0;display:block;border-radius:4px"},{tag:"video",attributes:{controls:""},style:"width:100%;max-width:400px;height:200px;background:#e0e0e0;display:block;border-radius:4px"},{tag:"audio",attributes:{controls:""},style:"width:100%"}]}],$variables:{color:{label:"Color",prefix:"--color-",placeholder:"#007acc"},font:{label:"Font",prefix:"--font-",placeholder:"system-ui, sans-serif"},size:{label:"Size",prefix:"--size-",placeholder:"16px"},other:{label:"Other",prefix:"--",placeholder:"value"}}};var O={$schema:"https://jxsuite.com/schema/v1",$id:"StudioStylebookChrome",$description:"The bar across the top of the Project Styles canvas: the filter that narrows the specimen catalogue, and the toggle that reduces it to the elements this file has already styled. Both are shell state rather than document state — the adapter owns which — and the two names come in as values, because the surface is called Project Styles and the canvas view it draws is the wire word `stylebook`; nothing a reader sees here may be spelled from that. **The bar IS the kit's toolbar now.** It used to write `role=\"toolbar\"` and its own `aria-label` on a `<div>`, which is a role with none of the behaviour under it: two controls, two tab stops, and no arrow key between them. `jx-action-group` is not the element for it — that one roves `jx-action-button` and this bar's first control is a `jx-textfield` — so `jx-toolbar` is, and the field keeps its own arrows while its caret still has text to walk (ui.md §5.5).",tagName:"jx-toolbar",attributes:{part:"chrome"},$props:{label:{$ref:"#/state/title"}},style:{$description:'What `.sb-chrome` said in `styles/overlays.css`, plus the six inline declarations the template carried beside it, plus `.tb-toggle` — all three go dead with this conversion, and none of them is shared with another surface. Three repairs on the way. The bar is one element rather than a positioned box wrapping a `role="toolbar"` row that declared the same flex layout again. The flex layout is not declared here EITHER any more: `display: flex`, `align-items: center`, the `--jx-space-2` gap, the sans face and the foreground colour are all `jx-toolbar`\'s own, so what is left below is only what a positioned BAND is. And `.tb-toggle` read `var(--spectrum-font-size-50, 11px)`, which the kit spells `--jx-text-sm` at the same value; the rest of its drawing is a `jx-action-button` reaching in through `part="control"`, because what it has to look like is a small bordered chip and every fill and control height the kit draws would otherwise have to be taken back off.',position:"absolute",top:"0",left:"0",right:"0",zIndex:"15",flexShrink:"0",padding:"var(--jx-space-2) var(--jx-space-3)",background:"var(--bg-panel)",borderBottom:"1px solid var(--border)",'& [part="filter"]':{flex:"1",maxWidth:"200px"},'& [part="customized"] > [part="control"]':{$description:"Bordered, unfilled and dimmed until it is on, which is what says it is a filter rather than an action: the catalogue it narrows is the thing the reader is looking at, so the control has to be quieter than its subject.",padding:"3px var(--jx-space-3)",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"transparent",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",":hover":{background:"var(--hover-bg)"}},'& [part="customized"][data-selected] > [part="control"]':{$description:"`data-selected` and not `selected`: the kit reflects the pressed state as a data attribute (`jx-action-button.json`), and the property this document binds never reaches the attribute of the same name.",borderColor:"var(--accent)",background:"var(--accent-15)",color:"var(--accent)"}},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{size:"sm",type:"search",clearable:!0,label:{$ref:"#/state/filterLabel"},placeholder:"Filter…",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",$description:"`onchange` and not `onclick`: a `toggles` button owns its own pressed state and says so with `change` (`jx-action-button.json`), and an `onclick` written here would replace the element's own click handler on the same property — the toggle would stop flipping and stop announcing `aria-pressed`.",attributes:{part:"customized"},$props:{size:"sm",toggles:!0,selected:{$ref:"#/state/customizedOnly"},label:{$ref:"#/state/customizedLabel"},hint:{$ref:"#/state/customizedHint"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/toggleCustomized"},value:[]}]},children:[{tagName:"span",textContent:"${state.customizedLabel}"}]}]};T("stylebook-chrome",O);function z(e,o){let t=document.createElement("div");t.style.display="contents";let n=v({...e,...o}),r=null,s=!1;function i(){s=!0,R("stylebook-chrome",n,t).then((d)=>{s=!1,r=d})}return i(),{host:t,update(d){if(Object.assign(n,d),s||r!==null&&t.contains(r.root))return;r?.dispose(),r=null,t.textContent="",i()}}}function E(e){return!e.startsWith(":")&&!e.startsWith(".")&&!e.startsWith("&")&&!e.startsWith("[")&&!e.startsWith("@")&&!e.startsWith("--")}function w(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}var M="& .element-card-preview";function Wg(e){let o=e,t={},n=(r)=>{let s={};for(let[i,d]of Object.entries(r))if(i!=="@--")s[i]=d;return s};for(let[r,s]of Object.entries(o)){if(!w(s)){t[r]=s;continue}if(r==="@--")continue;if($v(r)){t[r]=s;continue}if(r.startsWith("@")){let i={};for(let[d,g]of Object.entries(s))if(w(g)&&E(d))i[`${M} ${d}`]=n(g);else i[d]=g;t[r]=i;continue}if(E(r)){t[`${M} ${r}`]=n(s);continue}t[r]=s}return t}function I(e,o){let t=o.split(" "),n=e;for(let r of t){if(!w(n))return null;n=n[r]}return w(n)?n:null}function J(e,o){let t=e,n=I(t,o);if(n&&Object.keys(n).length>0)return!0;for(let[r,s]of Object.entries(t)){if(!r.startsWith("@")||!w(s))continue;let i=I(s,o);if(i&&Object.keys(i).length>0)return!0}return!1}function _(e){let o=new Map,t=new Map,n=e.filter.toLowerCase(),r=(a,c,h)=>{let p=a.tag===h?h:`${h} ${a.tag}`;o.set(Il(c),p);let m=a.children??[];for(let[l,C]of m.entries())r(C,[...c,"children",l],h)},s=(a)=>{let c={...a.attributes};if(a.style)c.style=a.style;return{tagName:a.tag,...a.text?{textContent:a.text}:{},...Object.keys(c).length>0?{attributes:c}:{},...a.children?{children:a.children.map(s)}:{}}},i=(a,c,h,p,m)=>{o.set(Il(p),a),o.set(Il([...p,"children",0]),a);let l=[...p,"children",0,"children",0];if(m)r(m,l,a);else o.set(Il(l),a);if(!t.has(a))t.set(a,p);return{attributes:{class:"element-card"},children:[{attributes:{class:"element-card-preview"},children:[h],tagName:"div"},{attributes:{class:"element-card-label"},tagName:"div",textContent:c}],tagName:"div"}},d=[],g=(a,c)=>({attributes:{class:"sb-section"},children:[{attributes:{class:"sb-label"},tagName:"div",textContent:a},{attributes:{class:"sb-body"},children:c,tagName:"div"}],tagName:"div"}),f=()=>["children",d.length,"children",1];for(let a of e.meta.$sections){let c=a.elements;if(n)c=c.filter((m)=>m.tag.includes(n)||a.label.toLowerCase().includes(n));if(e.customizedOnly)c=c.filter((m)=>J(e.effectiveStyle,m.tag));if(c.length===0)continue;let h=f(),p=c.map((m,l)=>i(m.tag,`<${m.tag}>`,s(m),[...h,"children",l],m));d.push(g(a.label,p))}let b=[];{let a=e.components;if(n)a=a.filter((c)=>c.tagName.toLowerCase().includes(n));if(e.customizedOnly)a=a.filter((c)=>J(e.effectiveStyle,c.tagName));if(a.length>0){let c=f(),h=a.map((p,m)=>{let l=[...c,"children",m];if(p.source!=="npm"&&p.path?.endsWith(".json")){b.push({$ref:`/${e.projectRoot?`${e.projectRoot}/`:""}${p.path}`.replace(/^\/+/,"/")});let j={};for(let k of p.props??[])if(k.default!==void 0&&k.default!=="false"&&k.default!=="''")j[k.name]=String(k.default).replaceAll(/^'|'$/g,"");let q={tagName:p.tagName,...Object.keys(j).length>0?{attributes:j}:{}};return i(p.tagName,`<${p.tagName}>`,q,l,null)}let V={attributes:{class:"sb-fallback"},tagName:"div",textContent:`<${p.tagName}>`};return i(p.tagName,`<${p.tagName}>`,V,l,null)});d.push(g("Components",h))}}if(d.length===0)d.push({attributes:{class:"sb-empty"},tagName:"div",textContent:e.customizedOnly?"No customized elements":"No matching elements"});return{doc:{...b.length>0?{$elements:b}:{},$media:e.effectiveMedia,attributes:{class:"sb-root"},children:d,style:Wg(e.effectiveStyle),tagName:"div"},pathToTag:o,tagToCardPath:t}}var Vg="Project Styles",WS="stylebook",Qy=[{id:"color",prefix:"--color-",title:"Colors"},{id:"font",prefix:"--font-",title:"Fonts"},{id:"size",prefix:"--size-",title:"Sizes & Spacing"},{id:"other",prefix:"--",title:"Other"}];function L(e){if(e.startsWith("--color"))return"color";if(e.startsWith("--font"))return"font";if(e.startsWith("--size")||e.startsWith("--spacing")||e.startsWith("--radius"))return"size";return"other"}function j_(e){let o=L(e);if(o==="other")return e;let{prefix:t}=Qy.find((n)=>n.id===o);return Cv(e,t)}function U(e){if(!e)return[];let o=[];for(let[t,n]of Object.entries(e)){if(!t.startsWith("--"))continue;if(typeof n!=="string"&&typeof n!=="number")continue;o.push({group:L(t),label:j_(t),name:t,value:n})}return o}function VS(e){let o=U(e);return Qy.map((t)=>({group:t,tokens:o.filter((n)=>n.group===t.id)}))}function US(e){if(!e)return[];let{featureQueries:o,sizeBreakpoints:t}=hr(e),n=[],r=[];for(let{name:i,query:d}of o){let g=Ou(d);if(g)n.push({key:`@${i}`,kind:"scheme",label:g==="dark"?"Dark":"Light",name:i,scheme:g});else r.push({key:`@${i}`,kind:"feature",label:`@${i}`,name:i})}let s=t.map(({name:i})=>({key:`@${i}`,kind:"size",label:`@${i}`,name:i}));return[...n,...s,...r]}function A(e,o){let t=e[o.key];return t&&typeof t==="object"?t:void 0}function Ug(e,o,t){let n=A(e,o)?.[t];return typeof n==="string"||typeof n==="number"?n:void 0}function H_(e,o,t,n){if(n){let s=e[o.key]??={};s[t]=n;return}let r=A(e,o);if(!r)return;if(delete r[t],Object.keys(r).length===0)delete e[o.key]}function qS(e,o,t,n=[]){let r=new Set(n.map((s)=>s.name));return o.filter((s)=>!r.has(s.name)&&Ug(e,s,t)===void 0)}var W=new WeakMap;function K(e){let o={customizedHint:"Show only the elements this file has already styled",customizedLabel:"Customized",customizedOnly:y.stylebook.customizedOnly,filter:y.stylebook.filter,filterLabel:`Filter the ${Vg} catalogue`,title:Vg},t=W.get(e);if(t)return t.update(o),t.host;let n=z(o,{setFilter:(r)=>{y.stylebook.filter=r},toggleCustomized:()=>{y.stylebook.customizedOnly=!y.stylebook.customizedOnly}});return W.set(e,n),n.host}async function GS(e,o){let t=e.wrap,n=lt(e.paneId),r=y.stylebook.filter.toLowerCase(),{customizedOnly:s}=y.stylebook,i=Di(n?.doc.document?.$media),{sizeBreakpoints:d,baseWidth:g}=hr(i),f=d.length>0,b=K(e);t.style.overflow="hidden";let S=[];if(f){S.push({displayName:bi("--"),name:"base",width:g});for(let l of d)S.push({displayName:bi(l.name),name:l.name,width:l.width})}let a;if(!f){let l=i&&i["--"],C=l?`${bi("--")} (${g}px)`:null;a=[o.canvasPanelEntry(l?"base":null,C,!l,l?g:void 0)]}else a=S.map((l)=>o.canvasPanelEntry(l.name,`${l.displayName} (${l.width}px)`,!1,l.width));if(!await o.drawStage(e,{frame:"boards",framePart:"panzoom",frameVars:"--boards-inset:40px",handles:"hidden",hug:!1,innerPart:"boards",lead:"chrome",panels:a.map((l)=>l.item)},a))return;let h=o.stageHost(e,"chrome-host");if(h&&h.firstChild!==b)h.replaceChildren(b);let p=_({components:st,customizedOnly:Boolean(s),effectiveMedia:i??{},effectiveStyle:qo(n?.doc.document?.style),filter:r,meta:qg,projectRoot:D?.projectRoot??null}),{panels:m}=e;for(let{panel:l}of a)m.push(l),kC(e.renderGeneration,p,l.canvas,l._width);if(f)o.updateActivePanelHeaders(e);o.applyTransform(e),o.observeCenterUntilStable(e)}function wu(e,o,{panCanvas:t=!1}={}){if(y.stylebook.selection=e,Lc(u.value,{selection:[[]],ui:{activeSelector:e,rightTab:"style",...o!==void 0?{activeMedia:o}:{}}}),e&&t)IC(e)}var Q=8,ew=[{id:"properties",title:"Content"},{id:"style",title:"Style"},{id:"events",title:"Logic"},{id:"assistant",title:"Assistant"}];function tw(){return{saveDocument:()=>{},undo:()=>{},redo:()=>{},openInBrowser:()=>{},buildSite:()=>{},closeDocument:()=>{},duplicateSelection:()=>{},deleteSelection:()=>{},selectParent:()=>{},toggleDock:()=>{},toggleZen:()=>{},openPalette:()=>{},openProject:()=>{},newWindow:()=>{},panelRoster:[],focusPanel:()=>{},focusInspectorTab:()=>{},cycleRegion:()=>{}}}var x=(e)=>e.document.open,P=(e)=>e.selection.count>0&&e.editor.kind==="canvas",N=(e)=>!e.selection.isRoot&&e.selection.paths.every((o)=>Nl(o)),B="an element selected on the canvas that has a sibling position: not the document root, a repeater's template or a switch case",H=(e)=>e.map((o)=>`[${o.join(", ")}]`).join(" and ");function Jh(e){return[{id:"file.save",title:"Save",category:"File",level:"document",icon:"floppy-disk",keybinding:"mod+s",menus:["commandbar/primary","statusbar/document","palette"],group:"1_file",undo:"none",when:x,requires:"an open document",run:()=>e.saveDocument()},{id:"document.close",title:"Close Document",category:"Document",level:"document",keybinding:"mod+w",menus:["context/tab","palette"],group:"1_file",when:x,requires:"an open document",run:()=>e.closeDocument()},{id:"view.openInBrowser",title:"Open in Browser",category:"View",level:"document",icon:"arrow-square-out",keybinding:"mod+shift+o",menus:["commandbar/primary","statusbar/document","palette"],group:"2_output",when:(t)=>t.project.isSite,enablement:x,requires:"a page to preview",run:()=>e.openInBrowser()},{id:"project.buildSite",title:"Build Site",category:"Project",level:"project",menus:["commandbar/overflow","palette"],group:"2_output",when:(t)=>t.project.isSite,requires:"a site project",run:()=>e.buildSite()},{id:"edit.undo",title:"Undo",category:"Edit",level:"document",icon:"arrow-u-up-left",keybinding:"mod+z",menus:["commandbar/primary","palette"],group:"1_history",when:x,enablement:(t)=>t.document.canUndo,requires:"a change to undo",run:()=>e.undo()},{id:"edit.redo",title:"Redo",category:"Edit",level:"document",icon:"arrow-u-up-right",keybinding:["mod+shift+z","mod+y"],menus:["commandbar/primary","palette"],group:"1_history",when:x,enablement:(t)=>t.document.canRedo,requires:"a change to redo",run:()=>e.redo()},{id:"selection.duplicate",title:"Duplicate",category:"Selection",level:"selection",keyScope:"canvas",keybinding:"mod+d",menus:["blockbar","context/element","context/layer","outline/row","palette"],group:"3_structure",undo:"document",when:P,enablement:N,requires:B,aiTool:{name:"duplicate_node",description:"Duplicate elements in the document, inserting each copy after its original, as one undoable step. The copies become the selection.",report:({after:t})=>{let n=t.selection.paths.length;return`Duplicated ${n} element${n===1?"":"s"}; the ${n===1?"copy is":"copies are"} selected at ${H(t.selection.paths)}.`}},run:()=>e.duplicateSelection()},{id:"selection.repeat",title:"Repeat...",category:"Selection",level:"selection",keyScope:"canvas",menus:["context/element","palette"],group:"3_structure",undo:"document",when:P,enablement:(t)=>N(t)&&!t.selection.isRepeater,requires:"an element with a sibling position that is not already a repeater",run:()=>{(me("vqkt7s3s"),import("./convert-to-repeater-vqkt7s3s.js")).then(({convertToRepeater:t})=>t())}},{id:"selection.delete",title:"Delete",category:"Selection",level:"selection",keyScope:"canvas",keybinding:["delete","backspace"],menus:["blockbar","context/element","context/layer","outline/row","palette"],group:"9_danger",destructive:!0,undo:"document",when:P,enablement:N,requires:B,aiTool:{name:"delete_node",description:"Delete elements from the document as one undoable step.",report:({before:t,after:n})=>{let r=t.selection.paths.length;return`Deleted ${r} element${r===1?"":"s"} at ${H(t.selection.paths)} in one undo step; the selection is now ${n.selection.count===0?"empty":"elsewhere"}.`}},run:()=>e.deleteSelection()},{id:"selection.selectParent",title:"Select Parent",category:"Selection",level:"selection",keyScope:"canvas",keybinding:["escape","arrowleft"],menus:["palette"],group:"2_navigate",when:P,requires:"an element selection",run:()=>e.selectParent()},{id:"view.toggleNavigator",title:"Toggle Navigator Dock",category:"View",level:"application",keybinding:"mod+b",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleDock("navigator")},{id:"view.toggleInspector",title:"Toggle Inspector Dock",category:"View",level:"application",keybinding:"mod+alt+b",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleDock("inspector")},{id:"view.zen",title:"Zen Mode",category:"View",level:"application",keybinding:"mod+.",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleZen()},{id:"palette.open",title:"Open Command Center",category:"View",level:"application",keybinding:"mod+k",menus:["palette"],group:"5_palette",run:()=>e.openPalette("picker")},{id:"palette.openFiles",title:"Go to File…",category:"File",level:"application",keybinding:"mod+p",menus:["palette"],group:"5_palette",run:()=>e.openPalette("files")},{id:"palette.openCommands",title:"Run Command…",category:"View",level:"application",keybinding:"mod+shift+p",menus:["palette"],group:"5_palette",run:()=>e.openPalette("commands")},{id:"palette.openNodes",title:"Go to Symbol in Document…",category:"Selection",level:"document",menus:["palette"],group:"5_palette",when:x,requires:"an open document",run:()=>e.openPalette("nodes")},{id:"project.open",title:"Open Project…",category:"Project",level:"project",keybinding:"mod+o",menus:["commandbar/overflow","statusbar/project","palette"],group:"1_file",run:()=>e.openProject()},{id:"view.newWindow",title:"New Window",category:"View",level:"application",keybinding:"mod+shift+n",menus:["commandbar/overflow","palette"],group:"1_file",when:(t)=>t.capability.windowControls,requires:"a host that can hold more than one window",run:()=>e.newWindow()},{id:"project.openRecent",title:"Open Recent…",category:"Project",level:"project",menus:["commandbar/overflow","statusbar/project","palette"],group:"1_file",run:()=>e.openPalette("projects")},...Z(e),...Y(e),{id:"view.cycleRegion",title:"Focus Next Region",category:"View",level:"application",keybinding:"f6",menus:["palette"],group:"4_docks",run:()=>e.cycleRegion(1)},{id:"view.cycleRegionBack",title:"Focus Previous Region",category:"View",level:"application",keybinding:"shift+f6",menus:["palette"],group:"4_docks",run:()=>e.cycleRegion(-1)}]}function Z(e){let o=0;return e.panelRoster.map((t)=>{let n={id:`panel.focus.${t.id}`,title:`Show ${t.title}`,category:"View",level:"application",menus:["palette"],group:"4_docks",requires:"an open project",when:(r)=>r.project.open&&(t.when?.(r)??!0),run:()=>e.focusPanel(t.id)};if(t.rail!==!1&&o<Q)o+=1,n.keybinding=`mod+${o}`;return n})}function Y(e){return ew.map((o,t)=>({id:`inspector.focus.${o.id}`,title:`Show ${o.title}`,category:"View",level:"document",keybinding:`mod+shift+${t+1}`,menus:["palette"],group:"4_docks",requires:"an open document",when:(r)=>r.document.open,run:()=>e.focusInspectorTab(o.id)}))}
6
- export{Wg,Vg,WS,Qy,j_,VS,US,Ug,H_,qS,qg,GS,wu,ew,tw,Jh};
7
-
8
- //# debugId=672B287246E1308B64756E2164756E21
9
- //# sourceMappingURL=studio-gjknvzam.js.map
@@ -1,12 +0,0 @@
1
- import{ae}from"./studio-0bbxhhce.js";var xe=ae(function(Rr){Object.defineProperty(Rr,"__esModule",{value:!0});Rr.regexpCode=Rr.getEsmExportName=Rr.getProperty=Rr.safeStringify=Rr.stringify=Rr.strConcat=Rr.addCodeArg=Rr.str=Rr._=Rr.nil=Rr._Code=Rr.Name=Rr.IDENTIFIER=Rr._CodeOrName=void 0;class Le{}Rr._CodeOrName=Le;Rr.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class pe extends Le{constructor(e){super();if(!Rr.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}Rr.Name=pe;class U extends Le{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,r)=>`${t}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,r)=>{if(r instanceof pe)t[r.str]=(t[r.str]||0)+1;return t},{})}}Rr._Code=U;Rr.nil=new U("");function Or(e,...t){let r=[e[0]],n=0;while(n<t.length)Nt(r,t[n]),r.push(e[++n]);return new U(r)}Rr._=Or;var Ot=new U("+");function Nr(e,...t){let r=[Pe(e[0])],n=0;while(n<t.length)r.push(Ot),Nt(r,t[n]),r.push(Ot,Pe(e[++n]));return Li(r),new U(r)}Rr.str=Nr;function Nt(e,t){if(t instanceof U)e.push(...t._items);else if(t instanceof pe)e.push(t);else e.push(Bi(t))}Rr.addCodeArg=Nt;function Li(e){let t=1;while(t<e.length-1){if(e[t]===Ot){let r=Gi(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function Gi(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof pe||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof pe))return`"${e}${t.slice(1)}`;return}function Ji(e,t){return t.emptyStr()?e:e.emptyStr()?t:Nr`${e}${t}`}Rr.strConcat=Ji;function Bi(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Pe(Array.isArray(e)?e.join(","):e)}function Wi(e){return new U(Pe(e))}Rr.stringify=Wi;function Pe(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Rr.safeStringify=Pe;function Qi(e){return typeof e=="string"&&Rr.IDENTIFIER.test(e)?new U(`.${e}`):Or`[${e}]`}Rr.getProperty=Qi;function Zi(e){if(typeof e=="string"&&Rr.IDENTIFIER.test(e))return new U(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Rr.getEsmExportName=Zi;function Xi(e){return new U(e.toString())}Rr.regexpCode=Xi});var jt=ae(function(jr){Object.defineProperty(jr,"__esModule",{value:!0});jr.ValueScope=jr.ValueScopeName=jr.Scope=jr.varKinds=jr.UsedValueState=void 0;var D=xe();class Ir extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Je;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Je||(jr.UsedValueState=Je={}));jr.varKinds={const:new D.Name("const"),let:new D.Name("let"),var:new D.Name("var")};class It{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof D.Name?e:this.name(e)}name(e){return new D.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}jr.Scope=It;class Tt extends D.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=D._`.${new D.Name(t)}[${r}]`}}jr.ValueScopeName=Tt;var la=D._`\n`;class Tr extends It{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?la:D.nil}}get(){return this._scope}name(e){return new Tt(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:s}=n,o=(r=t.key)!==null&&r!==void 0?r:t.ref,i=this._values[s];if(i){let d=i.get(o);if(d)return d}else i=this._values[s]=new Map;i.set(o,n);let a=this._scope[s]||(this._scope[s]=[]),c=a.length;return a[c]=t.ref,n.setValue(t,{property:s,itemIndex:c}),n}getValue(e,t){let r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(r)=>{if(r.scopePath===void 0)throw Error(`CodeGen: name "${r}" has no value`);return D._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,(n)=>{if(n.value===void 0)throw Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,r)}_reduceValues(e,t,r={},n){let s=D.nil;for(let o in e){let i=e[o];if(!i)continue;let a=r[o]=r[o]||new Map;i.forEach((c)=>{if(a.has(c))return;a.set(c,Je.Started);let d=t(c);if(d){let u=this.opts.es5?jr.varKinds.var:jr.varKinds.const;s=D._`${s}${u} ${c} = ${d};${this.opts._n}`}else if(d=n===null||n===void 0?void 0:n(c))s=D._`${s}${d}${this.opts._n}`;else throw new Ir(c);a.set(c,Je.Completed)})}return s}}jr.ValueScope=Tr});var Rt=ae(function(A){Object.defineProperty(A,"__esModule",{value:!0});A.or=A.and=A.not=A.CodeGen=A.operators=A.varKinds=A.ValueScopeName=A.ValueScope=A.Scope=A.Name=A.regexpCode=A.stringify=A.getProperty=A.nil=A.strConcat=A.str=A._=void 0;var P=xe(),K=jt(),Y=xe();Object.defineProperty(A,"_",{enumerable:!0,get:function(){return Y._}});Object.defineProperty(A,"str",{enumerable:!0,get:function(){return Y.str}});Object.defineProperty(A,"strConcat",{enumerable:!0,get:function(){return Y.strConcat}});Object.defineProperty(A,"nil",{enumerable:!0,get:function(){return Y.nil}});Object.defineProperty(A,"getProperty",{enumerable:!0,get:function(){return Y.getProperty}});Object.defineProperty(A,"stringify",{enumerable:!0,get:function(){return Y.stringify}});Object.defineProperty(A,"regexpCode",{enumerable:!0,get:function(){return Y.regexpCode}});Object.defineProperty(A,"Name",{enumerable:!0,get:function(){return Y.Name}});var Ye=jt();Object.defineProperty(A,"Scope",{enumerable:!0,get:function(){return Ye.Scope}});Object.defineProperty(A,"ValueScope",{enumerable:!0,get:function(){return Ye.ValueScope}});Object.defineProperty(A,"ValueScopeName",{enumerable:!0,get:function(){return Ye.ValueScopeName}});Object.defineProperty(A,"varKinds",{enumerable:!0,get:function(){return Ye.varKinds}});A.operators={GT:new P._Code(">"),GTE:new P._Code(">="),LT:new P._Code("<"),LTE:new P._Code("<="),EQ:new P._Code("==="),NEQ:new P._Code("!=="),NOT:new P._Code("!"),OR:new P._Code("||"),AND:new P._Code("&&"),ADD:new P._Code("+")};class ee{optimizeNodes(){return this}optimizeNames(e,t){return this}}class Dr extends ee{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?K.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=_e(this.rhs,e,t);return this}get names(){return this.rhs instanceof P._CodeOrName?this.rhs.names:{}}}class At extends ee{constructor(e,t,r){super();this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof P.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=_e(this.rhs,e,t),this}get names(){let e=this.lhs instanceof P.Name?{}:{...this.lhs.names};return Xe(e,this.rhs)}}class Ar extends At{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Mr extends ee{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class Fr extends ee{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class Vr extends ee{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class zr extends ee{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=_e(this.code,e,t),this}get names(){return this.code instanceof P._CodeOrName?this.code.names:{}}}class et extends ee{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,n=r.length;while(n--){let s=r[n];if(s.optimizeNames(e,t))continue;ma(e,s.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>oe(e,t.names),{})}}class te extends et{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Ur extends et{}class ke extends te{}ke.kind="else";class Q extends te{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let r=t.optimizeNodes();t=this.else=Array.isArray(r)?new ke(r):r}if(t){if(e===!1)return t instanceof Q?t:t.nodes;if(this.nodes.length)return this;return new Q(Jr(e),t instanceof Q?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=_e(this.condition,e,t),this}get names(){let e=super.names;if(Xe(e,this.condition),this.else)oe(e,this.else.names);return e}}Q.kind="if";class me extends te{}me.kind="for";class Kr extends me{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iteration=_e(this.iteration,e,t),this}get names(){return oe(super.names,this.iteration.names)}}class Hr extends me{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?K.varKinds.var:this.varKind,{name:r,from:n,to:s}=this;return`for(${t} ${r}=${n}; ${r}<${s}; ${r}++)`+super.render(e)}get names(){let e=Xe(super.names,this.from);return Xe(e,this.to)}}class Ct extends me{constructor(e,t,r,n){super();this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=_e(this.iterable,e,t),this}get names(){return oe(super.names,this.iterable.names)}}class Be extends te{constructor(e,t,r){super();this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}Be.kind="func";class We extends et{render(e){return"return "+super.render(e)}}We.kind="return";class Lr extends te{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(n=this.finally)===null||n===void 0||n.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)oe(e,this.catch.names);if(this.finally)oe(e,this.finally.names);return e}}class Qe extends te{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Qe.kind="catch";class Ze extends te{render(e){return"finally"+super.render(e)}}Ze.kind="finally";class Gr{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
2
- `:""},this._extScope=e,this._scope=new K.Scope({parent:e}),this._nodes=[new Ur]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){let s=this._scope.toName(t);if(r!==void 0&&n)this._constants[s.str]=r;return this._leafNode(new Dr(e,s,r)),s}const(e,t,r){return this._def(K.varKinds.const,e,t,r)}let(e,t,r){return this._def(K.varKinds.let,e,t,r)}var(e,t,r){return this._def(K.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new At(e,t,r))}add(e,t){return this._leafNode(new Ar(e,A.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==P.nil)this._leafNode(new zr(e));return this}object(...e){let t=["{"];for(let[r,n]of e){if(t.length>1)t.push(",");if(t.push(r),r!==n||this.opts.es5)t.push(":"),P.addCodeArg(t,n)}return t.push("}"),new P._Code(t)}if(e,t,r){if(this._blockNode(new Q(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Q(e))}else(){return this._elseNode(new ke)}endIf(){return this._endBlockNode(Q,ke)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new Kr(e),t)}forRange(e,t,r,n,s=this.opts.es5?K.varKinds.var:K.varKinds.let){let o=this._scope.toName(e);return this._for(new Hr(s,o,t,r),()=>n(o))}forOf(e,t,r,n=K.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=t instanceof P.Name?t:this.var("_arr",t);return this.forRange("_i",0,P._`${o}.length`,(i)=>{this.var(s,P._`${o}[${i}]`),r(s)})}return this._for(new Ct("of",n,s,t),()=>r(s))}forIn(e,t,r,n=this.opts.es5?K.varKinds.var:K.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,P._`Object.keys(${t})`,r);let s=this._scope.toName(e);return this._for(new Ct("in",n,s,t),()=>r(s))}endFor(){return this._endBlockNode(me)}label(e){return this._leafNode(new Mr(e))}break(e){return this._leafNode(new Fr(e))}return(e){let t=new We;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(We)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new Lr;if(this._blockNode(n),this.code(e),t){let s=this.name("e");this._currNode=n.catch=new Qe(s),t(s)}if(r)this._currNode=n.finally=new Ze,this.code(r);return this._endBlockNode(Qe,Ze)}throw(e){return this._leafNode(new Vr(e))}block(e,t){if(this._blockStarts.push(this._nodes.length),e)this.code(e).endBlock(t);return this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||e!==void 0&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=P.nil,r,n){if(this._blockNode(new Be(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(Be)}optimize(e=1){while(e-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof Q))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}}A.CodeGen=Gr;function oe(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Xe(e,t){return t instanceof P._CodeOrName?oe(e,t.names):e}function _e(e,t,r){if(e instanceof P.Name)return n(e);if(!s(e))return e;return new P._Code(e._items.reduce((o,i)=>{if(i instanceof P.Name)i=n(i);if(i instanceof P._Code)o.push(...i._items);else o.push(i);return o},[]));function n(o){let i=r[o.str];if(i===void 0||t[o.str]!==1)return o;return delete t[o.str],i}function s(o){return o instanceof P._Code&&o._items.some((i)=>i instanceof P.Name&&t[i.str]===1&&r[i.str]!==void 0)}}function ma(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function Jr(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:P._`!${Dt(e)}`}A.not=Jr;var _a=Br(A.operators.AND);function ga(...e){return e.reduce(_a)}A.and=ga;var ya=Br(A.operators.OR);function $a(...e){return e.reduce(ya)}A.or=$a;function Br(e){return(t,r)=>t===P.nil?r:r===P.nil?t:P._`${Dt(t)} ${e} ${Dt(r)}`}function Dt(e){return e instanceof P.Name?e:P._`(${e})`}});var nn=ae(function(sn){Object.defineProperty(sn,"__esModule",{value:!0});sn.checkStrictMode=sn.getErrorPath=sn.Type=sn.useFunc=sn.setEvaluated=sn.evaluatedPropsToName=sn.mergeEvaluated=sn.eachItem=sn.unescapeJsonPointer=sn.escapeJsonPointer=sn.escapeFragment=sn.unescapeFragment=sn.schemaRefOrVal=sn.schemaHasRulesButRef=sn.schemaHasRules=sn.checkUnknownRules=sn.alwaysValidSchema=sn.toHash=void 0;var O=Rt(),ba=xe();function Sa(e){let t={};for(let r of e)t[r]=!0;return t}sn.toHash=Sa;function Pa(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return Xr(e,t),!Yr(t,e.self.RULES.all)}sn.alwaysValidSchema=Pa;function Xr(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;let s=n.RULES.keywords;for(let o in t)if(!s[o])rn(e,`unknown keyword: "${o}"`)}sn.checkUnknownRules=Xr;function Yr(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}sn.schemaHasRules=Yr;function xa(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}sn.schemaHasRulesButRef=xa;function ka({topSchemaRef:e,schemaPath:t},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return O._`${r}`}return O._`${e}${t}${O.getProperty(n)}`}sn.schemaRefOrVal=ka;function Oa(e){return en(decodeURIComponent(e))}sn.unescapeFragment=Oa;function Na(e){return encodeURIComponent(Ft(e))}sn.escapeFragment=Na;function Ft(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}sn.escapeJsonPointer=Ft;function en(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}sn.unescapeJsonPointer=en;function Ra(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}sn.eachItem=Ra;function Qr({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,o,i,a)=>{let c=i===void 0?o:i instanceof O.Name?(o instanceof O.Name?e(s,o,i):t(s,o,i),i):o instanceof O.Name?(t(s,i,o),o):r(o,i);return a===O.Name&&!(c instanceof O.Name)?n(s,c):c}}sn.mergeEvaluated={props:Qr({mergeNames:(e,t,r)=>e.if(O._`${r} !== true && ${t} !== undefined`,()=>{e.if(O._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,O._`${r} || {}`).code(O._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(O._`${r} !== true`,()=>{if(t===!0)e.assign(r,!0);else e.assign(r,O._`${r} || {}`),Vt(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:tn}),items:Qr({mergeNames:(e,t,r)=>e.if(O._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,O._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(O._`${r} !== true`,()=>e.assign(r,t===!0?!0:O._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function tn(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",O._`{}`);if(t!==void 0)Vt(e,r,t);return r}sn.evaluatedPropsToName=tn;function Vt(e,t,r){Object.keys(r).forEach((n)=>e.assign(O._`${t}${O.getProperty(n)}`,!0))}sn.setEvaluated=Vt;var Zr={};function qa(e,t){return e.scopeValue("func",{ref:t,code:Zr[t.code]||(Zr[t.code]=new ba._Code(t.code))})}sn.useFunc=qa;var Mt;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Mt||(sn.Type=Mt={}));function Ia(e,t,r){if(e instanceof O.Name){let n=t===Mt.Num;return r?n?O._`"[" + ${e} + "]"`:O._`"['" + ${e} + "']"`:n?O._`"/" + ${e}`:O._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?O.getProperty(e).toString():"/"+Ft(e)}sn.getErrorPath=Ia;function rn(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}sn.checkStrictMode=rn});var kl=ae(function(an){Object.defineProperty(an,"__esModule",{value:!0});var I=Rt(),Qa={data:new I.Name("data"),valCxt:new I.Name("valCxt"),instancePath:new I.Name("instancePath"),parentData:new I.Name("parentData"),parentDataProperty:new I.Name("parentDataProperty"),rootData:new I.Name("rootData"),dynamicAnchors:new I.Name("dynamicAnchors"),vErrors:new I.Name("vErrors"),errors:new I.Name("errors"),this:new I.Name("this"),self:new I.Name("self"),scope:new I.Name("scope"),json:new I.Name("json"),jsonPos:new I.Name("jsonPos"),jsonLen:new I.Name("jsonLen"),jsonPart:new I.Name("jsonPart")};an.default=Qa});var Oe=ae(function(ln){Object.defineProperty(ln,"__esModule",{value:!0});ln.extendErrors=ln.resetErrorsCount=ln.reportExtraError=ln.reportError=ln.keyword$DataError=ln.keywordError=void 0;var x=Rt(),rt=nn(),j=kl();ln.keywordError={message:({keyword:e})=>x.str`must pass "${e}" keyword validation`};ln.keyword$DataError={message:({keyword:e,schemaType:t})=>t?x.str`"${e}" keyword must be ${t} ($data)`:x.str`"${e}" keyword is invalid ($data)`};function Xa(e,t=ln.keywordError,r,n){let{it:s}=e,{gen:o,compositeRule:i,allErrors:a}=s,c=un(e,t,r);if(n!==null&&n!==void 0?n:i||a)cn(o,c);else dn(s,x._`[${c}]`)}ln.reportError=Xa;function Ya(e,t=ln.keywordError,r){let{it:n}=e,{gen:s,compositeRule:o,allErrors:i}=n,a=un(e,t,r);if(cn(s,a),!(o||i))dn(n,j.default.vErrors)}ln.reportExtraError=Ya;function ec(e,t){e.assign(j.default.errors,t),e.if(x._`${j.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(x._`${j.default.vErrors}.length`,t),()=>e.assign(j.default.vErrors,null)))}ln.resetErrorsCount=ec;function tc({gen:e,keyword:t,schemaValue:r,data:n,errsCount:s,it:o}){if(s===void 0)throw Error("ajv implementation error");let i=e.name("err");e.forRange("i",s,j.default.errors,(a)=>{if(e.const(i,x._`${j.default.vErrors}[${a}]`),e.if(x._`${i}.instancePath === undefined`,()=>e.assign(x._`${i}.instancePath`,x.strConcat(j.default.instancePath,o.errorPath))),e.assign(x._`${i}.schemaPath`,x.str`${o.errSchemaPath}/${t}`),o.opts.verbose)e.assign(x._`${i}.schema`,r),e.assign(x._`${i}.data`,n)})}ln.extendErrors=tc;function cn(e,t){let r=e.const("err",t);e.if(x._`${j.default.vErrors} === null`,()=>e.assign(j.default.vErrors,x._`[${r}]`),x._`${j.default.vErrors}.push(${r})`),e.code(x._`${j.default.errors}++`)}function dn(e,t){let{gen:r,validateName:n,schemaEnv:s}=e;if(s.$async)r.throw(x._`new ${e.ValidationError}(${t})`);else r.assign(x._`${n}.errors`,t),r.return(!1)}var ie={keyword:new x.Name("keyword"),schemaPath:new x.Name("schemaPath"),params:new x.Name("params"),propertyName:new x.Name("propertyName"),message:new x.Name("message"),schema:new x.Name("schema"),parentSchema:new x.Name("parentSchema")};function un(e,t,r){let{createErrors:n}=e.it;if(n===!1)return x._`{}`;return rc(e,t,r)}function rc(e,t,r={}){let{gen:n,it:s}=e,o=[nc(s,r),sc(e,r)];return oc(e,t,o),n.object(...o)}function nc({errorPath:e},{instancePath:t}){let r=t?x.str`${e}${rt.getErrorPath(t,rt.Type.Str)}`:e;return[j.default.instancePath,x.strConcat(j.default.instancePath,r)]}function sc({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let s=n?t:x.str`${t}/${e}`;if(r)s=x.str`${s}${rt.getErrorPath(r,rt.Type.Str)}`;return[ie.schemaPath,s]}function oc(e,{params:t,message:r},n){let{keyword:s,data:o,schemaValue:i,it:a}=e,{opts:c,propertyName:d,topSchemaRef:u,schemaPath:l}=a;if(n.push([ie.keyword,s],[ie.params,typeof t=="function"?t(e):t||x._`{}`]),c.messages)n.push([ie.message,typeof r=="function"?r(e):r]);if(c.verbose)n.push([ie.schema,i],[ie.parentSchema,x._`${u}${l}`],[j.default.data,o]);if(d)n.push([ie.propertyName,d])}});var _n=ae(function(pn){Object.defineProperty(pn,"__esModule",{value:!0});pn.boolOrEmptySchema=pn.topBoolOrEmptySchema=void 0;var uc=Oe(),lc=Rt(),fc=kl(),hc={message:"boolean schema is false"};function pc(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)hn(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(fc.default.data);else t.assign(lc._`${n}.errors`,null),t.return(!0)}pn.topBoolOrEmptySchema=pc;function mc(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),hn(e);else r.var(t,!0)}pn.boolOrEmptySchema=mc;function hn(e,t){let{gen:r,data:n}=e;uc.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},hc,void 0,t)}});var Ut=ae(function(gn){Object.defineProperty(gn,"__esModule",{value:!0});gn.getRules=gn.isJSONType=void 0;var gc=["string","number","integer","boolean","null","object","array"],yc=new Set(gc);function $c(e){return typeof e=="string"&&yc.has(e)}gn.isJSONType=$c;function vc(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}gn.getRules=vc});var Kt=ae(function(wn){Object.defineProperty(wn,"__esModule",{value:!0});wn.shouldUseRule=wn.shouldUseGroup=wn.schemaHasRulesForType=void 0;function Ec({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&$n(e,n)}wn.schemaHasRulesForType=Ec;function $n(e,t){return t.rules.some((r)=>vn(e,r))}wn.shouldUseGroup=$n;function vn(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some((n)=>e[n]!==void 0))}wn.shouldUseRule=vn});var Ne=ae(function(xn){Object.defineProperty(xn,"__esModule",{value:!0});xn.reportTypeError=xn.checkDataTypes=xn.checkDataType=xn.coerceAndCheckDataType=xn.getJSONTypes=xn.getSchemaTypes=xn.DataType=void 0;var Pc=Ut(),xc=Kt(),kc=Oe(),b=Rt(),bn=nn(),ge;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(ge||(xn.DataType=ge={}));function Oc(e){let t=Sn(e.type);if(t.includes("null")){if(e.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(e.nullable===!0)t.push("null")}return t}xn.getSchemaTypes=Oc;function Sn(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(Pc.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}xn.getJSONTypes=Sn;function Nc(e,t){let{gen:r,data:n,opts:s}=e,o=Rc(t,s.coerceTypes),i=t.length>0&&!(o.length===0&&t.length===1&&xc.schemaHasRulesForType(e,t[0]));if(i){let a=Lt(t,n,s.strictNumbers,ge.Wrong);r.if(a,()=>{if(o.length)qc(e,t,o);else Gt(e)})}return i}xn.coerceAndCheckDataType=Nc;var Pn=new Set(["string","number","integer","boolean","null"]);function Rc(e,t){return t?e.filter((r)=>Pn.has(r)||t==="array"&&r==="array"):[]}function qc(e,t,r){let{gen:n,data:s,opts:o}=e,i=n.let("dataType",b._`typeof ${s}`),a=n.let("coerced",b._`undefined`);if(o.coerceTypes==="array")n.if(b._`${i} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,b._`${s}[0]`).assign(i,b._`typeof ${s}`).if(Lt(t,s,o.strictNumbers),()=>n.assign(a,s)));n.if(b._`${a} !== undefined`);for(let d of r)if(Pn.has(d)||d==="array"&&o.coerceTypes==="array")c(d);n.else(),Gt(e),n.endIf(),n.if(b._`${a} !== undefined`,()=>{n.assign(s,a),Ic(e,a)});function c(d){switch(d){case"string":n.elseIf(b._`${i} == "number" || ${i} == "boolean"`).assign(a,b._`"" + ${s}`).elseIf(b._`${s} === null`).assign(a,b._`""`);return;case"number":n.elseIf(b._`${i} == "boolean" || ${s} === null
3
- || (${i} == "string" && ${s} && ${s} == +${s})`).assign(a,b._`+${s}`);return;case"integer":n.elseIf(b._`${i} === "boolean" || ${s} === null
4
- || (${i} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,b._`+${s}`);return;case"boolean":n.elseIf(b._`${s} === "false" || ${s} === 0 || ${s} === null`).assign(a,!1).elseIf(b._`${s} === "true" || ${s} === 1`).assign(a,!0);return;case"null":n.elseIf(b._`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(a,null);return;case"array":n.elseIf(b._`${i} === "string" || ${i} === "number"
5
- || ${i} === "boolean" || ${s} === null`).assign(a,b._`[${s}]`)}}}function Ic({gen:e,parentData:t,parentDataProperty:r},n){e.if(b._`${t} !== undefined`,()=>e.assign(b._`${t}[${r}]`,n))}function Ht(e,t,r,n=ge.Correct){let s=n===ge.Correct?b.operators.EQ:b.operators.NEQ,o;switch(e){case"null":return b._`${t} ${s} null`;case"array":o=b._`Array.isArray(${t})`;break;case"object":o=b._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=i(b._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=i();break;default:return b._`typeof ${t} ${s} ${e}`}return n===ge.Correct?o:b.not(o);function i(a=b.nil){return b.and(b._`typeof ${t} == "number"`,a,r?b._`isFinite(${t})`:b.nil)}}xn.checkDataType=Ht;function Lt(e,t,r,n){if(e.length===1)return Ht(e[0],t,r,n);let s,o=bn.toHash(e);if(o.array&&o.object){let i=b._`typeof ${t} != "object"`;s=o.null?i:b._`!${t} || ${i}`,delete o.null,delete o.array,delete o.object}else s=b.nil;if(o.number)delete o.integer;for(let i in o)s=b.and(s,Ht(i,t,r,n));return s}xn.checkDataTypes=Lt;var Tc={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?b._`{type: ${e}}`:b._`{type: ${t}}`};function Gt(e){let t=jc(e);kc.reportError(t,Tc)}xn.reportTypeError=Gt;function jc(e){let{gen:t,data:r,schema:n}=e,s=bn.schemaRefOrVal(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}});var qn=ae(function(Nn){Object.defineProperty(Nn,"__esModule",{value:!0});Nn.assignDefaults=void 0;var ye=Rt(),zc=nn();function Uc(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let s in r)On(e,s,r[s].default);else if(t==="array"&&Array.isArray(n))n.forEach((s,o)=>On(e,o,s.default))}Nn.assignDefaults=Uc;function On(e,t,r){let{gen:n,compositeRule:s,data:o,opts:i}=e;if(r===void 0)return;let a=ye._`${o}${ye.getProperty(t)}`;if(s){zc.checkStrictMode(e,`default is ignored for: ${a}`);return}let c=ye._`${a} === undefined`;if(i.useDefaults==="empty")c=ye._`${c} || ${a} === null || ${a} === ""`;n.if(c,ye._`${a} = ${ye.stringify(r)}`)}});var V=ae(function(jn){Object.defineProperty(jn,"__esModule",{value:!0});jn.validateUnion=jn.validateArray=jn.usePattern=jn.callValidateCode=jn.schemaProperties=jn.allSchemaProperties=jn.noPropertyInData=jn.propertyInData=jn.isOwnProperty=jn.hasPropFunc=jn.reportMissingProp=jn.checkMissingProp=jn.checkReportMissingProp=void 0;var N=Rt(),Jt=nn(),re=kl(),Kc=nn();function Hc(e,t){let{gen:r,data:n,it:s}=e;r.if(Wt(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:N._`${t}`},!0),e.error()})}jn.checkReportMissingProp=Hc;function Lc({gen:e,data:t,it:{opts:r}},n,s){return N.or(...n.map((o)=>N.and(Wt(e,t,o,r.ownProperties),N._`${s} = ${o}`)))}jn.checkMissingProp=Lc;function Gc(e,t){e.setParams({missingProperty:t},!0),e.error()}jn.reportMissingProp=Gc;function In(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:N._`Object.prototype.hasOwnProperty`})}jn.hasPropFunc=In;function Bt(e,t,r){return N._`${In(e)}.call(${t}, ${r})`}jn.isOwnProperty=Bt;function Jc(e,t,r,n){let s=N._`${t}${N.getProperty(r)} !== undefined`;return n?N._`${s} && ${Bt(e,t,r)}`:s}jn.propertyInData=Jc;function Wt(e,t,r,n){let s=N._`${t}${N.getProperty(r)} === undefined`;return n?N.or(s,N.not(Bt(e,t,r))):s}jn.noPropertyInData=Wt;function Tn(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}jn.allSchemaProperties=Tn;function Bc(e,t){return Tn(t).filter((r)=>!Jt.alwaysValidSchema(e,t[r]))}jn.schemaProperties=Bc;function Wc({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:o},it:i},a,c,d){let u=d?N._`${e}, ${t}, ${n}${s}`:t,l=[[re.default.instancePath,N.strConcat(re.default.instancePath,o)],[re.default.parentData,i.parentData],[re.default.parentDataProperty,i.parentDataProperty],[re.default.rootData,re.default.rootData]];if(i.opts.dynamicRef)l.push([re.default.dynamicAnchors,re.default.dynamicAnchors]);let _=N._`${u}, ${r.object(...l)}`;return c!==N.nil?N._`${a}.call(${c}, ${_})`:N._`${a}(${_})`}jn.callValidateCode=Wc;var Qc=N._`new RegExp`;function Zc({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,o=s(r,n);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:N._`${s.code==="new RegExp"?Qc:Kc.useFunc(e,s)}(${r}, ${n})`})}jn.usePattern=Zc;function Xc(e){let{gen:t,data:r,keyword:n,it:s}=e,o=t.name("valid");if(s.allErrors){let a=t.let("valid",!0);return i(()=>t.assign(a,!1)),a}return t.var(o,!0),i(()=>t.break()),o;function i(a){let c=t.const("len",N._`${r}.length`);t.forRange("i",0,c,(d)=>{e.subschema({keyword:n,dataProp:d,dataPropType:Jt.Type.Num},o),t.if(N.not(o),a)})}}jn.validateArray=Xc;function Yc(e){let{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((c)=>Jt.alwaysValidSchema(s,c))&&!s.opts.unevaluated)return;let i=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,d)=>{let u=e.subschema({keyword:n,schemaProp:d,compositeRule:!0},a);if(t.assign(i,N._`${i} || ${a}`),!e.mergeValidEvaluated(u,a))t.if(N.not(i))})),e.result(i,()=>e.reset(),()=>e.error(!0))}jn.validateUnion=Yc});var Vn=ae(function(Mn){Object.defineProperty(Mn,"__esModule",{value:!0});Mn.validateKeywordUsage=Mn.validSchemaType=Mn.funcKeywordCode=Mn.macroKeywordCode=void 0;var C=Rt(),ce=kl(),fd=V(),hd=Oe();function pd(e,t){let{gen:r,keyword:n,schema:s,parentSchema:o,it:i}=e,a=t.macro.call(i.self,s,o,i),c=An(r,n,a);if(i.opts.validateSchema!==!1)i.self.validateSchema(a,!0);let d=r.name("valid");e.subschema({schema:a,schemaPath:C.nil,errSchemaPath:`${i.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},d),e.pass(d,()=>e.error(!0))}Mn.macroKeywordCode=pd;function md(e,t){var r;let{gen:n,keyword:s,schema:o,parentSchema:i,$data:a,it:c}=e;gd(c,t);let d=!a&&t.compile?t.compile.call(c.self,o,i,c):t.validate,u=An(n,s,d),l=n.let("valid");e.block$data(l,_),e.ok((r=t.valid)!==null&&r!==void 0?r:l);function _(){if(t.errors===!1){if(f(),t.modifying)Dn(e);m(()=>e.error())}else{let g=t.async?p():h();if(t.modifying)Dn(e);m(()=>_d(e,g))}}function p(){let g=n.let("ruleErrs",null);return n.try(()=>f(C._`await `),(v)=>n.assign(l,!1).if(C._`${v} instanceof ${c.ValidationError}`,()=>n.assign(g,C._`${v}.errors`),()=>n.throw(v))),g}function h(){let g=C._`${u}.errors`;return n.assign(g,null),f(C.nil),g}function f(g=t.async?C._`await `:C.nil){let v=c.opts.passContext?ce.default.this:ce.default.self,S=!(("compile"in t)&&!a||t.schema===!1);n.assign(l,C._`${g}${fd.callValidateCode(e,u,v,S)}`,t.modifying)}function m(g){var v;n.if(C.not((v=t.valid)!==null&&v!==void 0?v:l),g)}}Mn.funcKeywordCode=md;function Dn(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,C._`${n.parentData}[${n.parentDataProperty}]`))}function _d(e,t){let{gen:r}=e;r.if(C._`Array.isArray(${t})`,()=>{r.assign(ce.default.vErrors,C._`${ce.default.vErrors} === null ? ${t} : ${ce.default.vErrors}.concat(${t})`).assign(ce.default.errors,C._`${ce.default.vErrors}.length`),hd.extendErrors(e)},()=>e.error())}function gd({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function An(e,t,r){if(r===void 0)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:C.stringify(r)})}function yd(e,t,r=!1){return!t.length||t.some((n)=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}Mn.validSchemaType=yd;function $d({schema:e,opts:t,self:r,errSchemaPath:n},s,o){if(Array.isArray(s.keyword)?!s.keyword.includes(o):s.keyword!==o)throw Error("ajv implementation error");let i=s.dependencies;if(i===null||i===void 0?void 0:i.some((a)=>!Object.prototype.hasOwnProperty.call(e,a)))throw Error(`parent schema must have dependencies of ${o}: ${i.join(",")}`);if(s.validateSchema){if(!s.validateSchema(e[o])){let c=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw Error(c)}}}Mn.validateKeywordUsage=$d});var Hn=ae(function(Un){Object.defineProperty(Un,"__esModule",{value:!0});Un.extendSubschemaMode=Un.extendSubschemaData=Un.getSubschema=void 0;var B=Rt(),zn=nn();function bd(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:o,topSchemaRef:i}){if(t!==void 0&&n!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:B._`${e.schemaPath}${B.getProperty(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:B._`${e.schemaPath}${B.getProperty(t)}${B.getProperty(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${zn.escapeFragment(r)}`}}if(n!==void 0){if(s===void 0||o===void 0||i===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:i,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')}Un.getSubschema=bd;function Sd(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:o,propertyName:i}){if(s!==void 0&&r!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:d,dataPathArr:u,opts:l}=t,_=a.let("data",B._`${t.data}${B.getProperty(r)}`,!0);c(_),e.errorPath=B.str`${d}${zn.getErrorPath(r,n,l.jsPropertySyntax)}`,e.parentDataProperty=B._`${r}`,e.dataPathArr=[...u,e.parentDataProperty]}if(s!==void 0){let d=s instanceof B.Name?s:a.let("data",s,!0);if(c(d),i!==void 0)e.propertyName=i}if(o)e.dataTypes=o;function c(d){e.data=d,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,d]}}Un.extendSubschemaData=Sd;function Pd(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:o}){if(n!==void 0)e.compositeRule=n;if(s!==void 0)e.createErrors=s;if(o!==void 0)e.allErrors=o;e.jtdDiscriminator=t,e.jtdMetadata=r}Un.extendSubschemaMode=Pd});var Qt=ae(function(hm,Ln){Ln.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){var i=o[s];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}});var Jn=ae(function(pm,Gn){var ne=Gn.exports=function(e,t,r){if(typeof t=="function")r=t,t={};r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};nt(t,n,s,e,"",e)};ne.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};ne.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};ne.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};ne.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function nt(e,t,r,n,s,o,i,a,c,d){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,o,i,a,c,d);for(var u in n){var l=n[u];if(Array.isArray(l)){if(u in ne.arrayKeywords)for(var _=0;_<l.length;_++)nt(e,t,r,l[_],s+"/"+u+"/"+_,o,s,u,n,_)}else if(u in ne.propsKeywords){if(l&&typeof l=="object")for(var p in l)nt(e,t,r,l[p],s+"/"+u+"/"+Od(p),o,s,u,n,p)}else if(u in ne.keywords||e.allKeys&&!(u in ne.skipKeywords))nt(e,t,r,l,s+"/"+u,o,s,u,n)}r(n,s,o,i,a,c,d)}}function Od(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Re=ae(function(Zn){Object.defineProperty(Zn,"__esModule",{value:!0});Zn.getSchemaRefs=Zn.resolveUrl=Zn.normalizeId=Zn._getFullPath=Zn.getFullPath=Zn.inlineRef=void 0;var Nd=nn(),Rd=Qt(),qd=Jn(),Id=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Td(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!Zt(e);if(!t)return!1;return Bn(e)<=t}Zn.inlineRef=Td;var jd=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Zt(e){for(let t in e){if(jd.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Zt))return!0;if(typeof r=="object"&&Zt(r))return!0}return!1}function Bn(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,Id.has(r))continue;if(typeof e[r]=="object")Nd.eachItem(e[r],(n)=>t+=Bn(n));if(t===1/0)return 1/0}return t}function Wn(e,t="",r){if(r!==!1)t=$e(t);let n=e.parse(t);return Qn(e,n)}Zn.getFullPath=Wn;function Qn(e,t){return e.serialize(t).split("#")[0]+"#"}Zn._getFullPath=Qn;var Cd=/#\/?$/;function $e(e){return e?e.replace(Cd,""):""}Zn.normalizeId=$e;function Dd(e,t,r){return r=$e(r),e.resolve(t,r)}Zn.resolveUrl=Dd;var Ad=/^[a-z_][-a-z0-9._]*$/i;function Md(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=$e(e[r]||t),o={"":s},i=Wn(n,s,!1),a={},c=new Set;return qd(e,{allKeys:!0},(l,_,p,h)=>{if(h===void 0)return;let f=i+_,m=o[h];if(typeof l[r]=="string")m=g.call(this,l[r]);v.call(this,l.$anchor),v.call(this,l.$dynamicAnchor),o[_]=m;function g(S){let k=this.opts.uriResolver.resolve;if(S=$e(m?k(m,S):S),c.has(S))throw u(S);c.add(S);let E=this.refs[S];if(typeof E=="string")E=this.refs[E];if(typeof E=="object")d(l,E.schema,S);else if(S!==$e(f))if(S[0]==="#")d(l,a[S],S),a[S]=l;else this.refs[S]=f;return S}function v(S){if(typeof S=="string"){if(!Ad.test(S))throw Error(`invalid anchor "${S}"`);g.call(this,`#${S}`)}}}),a;function d(l,_,p){if(_!==void 0&&!Rd(l,_))throw u(p)}function u(l){return Error(`reference "${l}" resolves to more than one schema`)}}Zn.getSchemaRefs=Md});var wf=ae(function(hs){Object.defineProperty(hs,"__esModule",{value:!0});hs.getData=hs.KeywordCxt=hs.validateFunctionCode=void 0;var rs=_n(),ns=Ne(),Xt=Kt(),st=Ne(),Hd=qn(),qe=Vn(),Yt=Hn(),y=Rt(),w=kl(),Ld=Re(),Z=nn(),Ie=Oe();function Gd(e){if(is(e)){if(as(e),os(e)){Wd(e);return}}ss(e,()=>rs.topBoolOrEmptySchema(e))}hs.validateFunctionCode=Gd;function ss({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},o){if(s.code.es5)e.func(t,y._`${w.default.data}, ${w.default.valCxt}`,n.$async,()=>{e.code(y._`"use strict"; ${Yn(r,s)}`),Bd(e,s),e.code(o)});else e.func(t,y._`${w.default.data}, ${Jd(s)}`,n.$async,()=>e.code(Yn(r,s)).code(o))}function Jd(e){return y._`{${w.default.instancePath}="", ${w.default.parentData}, ${w.default.parentDataProperty}, ${w.default.rootData}=${w.default.data}${e.dynamicRef?y._`, ${w.default.dynamicAnchors}={}`:y.nil}}={}`}function Bd(e,t){e.if(w.default.valCxt,()=>{if(e.var(w.default.instancePath,y._`${w.default.valCxt}.${w.default.instancePath}`),e.var(w.default.parentData,y._`${w.default.valCxt}.${w.default.parentData}`),e.var(w.default.parentDataProperty,y._`${w.default.valCxt}.${w.default.parentDataProperty}`),e.var(w.default.rootData,y._`${w.default.valCxt}.${w.default.rootData}`),t.dynamicRef)e.var(w.default.dynamicAnchors,y._`${w.default.valCxt}.${w.default.dynamicAnchors}`)},()=>{if(e.var(w.default.instancePath,y._`""`),e.var(w.default.parentData,y._`undefined`),e.var(w.default.parentDataProperty,y._`undefined`),e.var(w.default.rootData,w.default.data),t.dynamicRef)e.var(w.default.dynamicAnchors,y._`{}`)})}function Wd(e){let{schema:t,opts:r,gen:n}=e;ss(e,()=>{if(r.$comment&&t.$comment)ds(e);if(eu(e),n.let(w.default.vErrors,null),n.let(w.default.errors,0),r.unevaluated)Qd(e);cs(e),nu(e)});return}function Qd(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",y._`${r}.evaluated`),t.if(y._`${e.evaluated}.dynamicProps`,()=>t.assign(y._`${e.evaluated}.props`,y._`undefined`)),t.if(y._`${e.evaluated}.dynamicItems`,()=>t.assign(y._`${e.evaluated}.items`,y._`undefined`))}function Yn(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?y._`/*# sourceURL=${r} */`:y.nil}function Zd(e,t){if(is(e)){if(as(e),os(e)){Xd(e,t);return}}rs.boolOrEmptySchema(e,t)}function os({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function is(e){return typeof e.schema!="boolean"}function Xd(e,t){let{schema:r,gen:n,opts:s}=e;if(s.$comment&&r.$comment)ds(e);tu(e),ru(e);let o=n.const("_errs",w.default.errors);cs(e,o),n.var(t,y._`${o} === ${w.default.errors}`)}function as(e){Z.checkUnknownRules(e),Yd(e)}function cs(e,t){if(e.opts.jtd)return es(e,[],!1,t);let r=ns.getSchemaTypes(e.schema),n=ns.coerceAndCheckDataType(e,r);es(e,r,!n,t)}function Yd(e){let{schema:t,errSchemaPath:r,opts:n,self:s}=e;if(t.$ref&&n.ignoreKeywordsWithRef&&Z.schemaHasRulesButRef(t,s.RULES))s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function eu(e){let{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema)Z.checkStrictMode(e,"default is ignored in the schema root")}function tu(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=Ld.resolveUrl(e.opts.uriResolver,e.baseId,t)}function ru(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function ds({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){let o=r.$comment;if(s.$comment===!0)e.code(y._`${w.default.self}.logger.log(${o})`);else if(typeof s.$comment=="function"){let i=y.str`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code(y._`${w.default.self}.opts.$comment(${o}, ${i}, ${a}.schema)`)}}function nu(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:o}=e;if(r.$async)t.if(y._`${w.default.errors} === 0`,()=>t.return(w.default.data),()=>t.throw(y._`new ${s}(${w.default.vErrors})`));else{if(t.assign(y._`${n}.errors`,w.default.vErrors),o.unevaluated)su(e);t.return(y._`${w.default.errors} === 0`)}}function su({gen:e,evaluated:t,props:r,items:n}){if(r instanceof y.Name)e.assign(y._`${t}.props`,r);if(n instanceof y.Name)e.assign(y._`${t}.items`,n)}function es(e,t,r,n){let{gen:s,schema:o,data:i,allErrors:a,opts:c,self:d}=e,{RULES:u}=d;if(o.$ref&&(c.ignoreKeywordsWithRef||!Z.schemaHasRulesButRef(o,u))){s.block(()=>ls(e,"$ref",u.all.$ref.definition));return}if(!c.jtd)ou(e,t);s.block(()=>{for(let _ of u.rules)l(_);l(u.post)});function l(_){if(!Xt.shouldUseGroup(o,_))return;if(_.type){if(s.if(st.checkDataType(_.type,i,c.strictNumbers)),ts(e,_),t.length===1&&t[0]===_.type&&r)s.else(),st.reportTypeError(e);s.endIf()}else ts(e,_);if(!a)s.if(y._`${w.default.errors} === ${n||0}`)}}function ts(e,t){let{gen:r,schema:n,opts:{useDefaults:s}}=e;if(s)Hd.assignDefaults(e,t.type);r.block(()=>{for(let o of t.rules)if(Xt.shouldUseRule(n,o))ls(e,o.keyword,o.definition,t.type)})}function ou(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(iu(e,t),!e.opts.allowUnionTypes)au(e,t);cu(e,e.dataTypes)}function iu(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!us(e.dataTypes,r))er(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),uu(e,t)}function au(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))er(e,"use allowUnionTypes to allow union type keyword")}function cu(e,t){let r=e.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&Xt.shouldUseRule(e.schema,s)){let{type:o}=s.definition;if(o.length&&!o.some((i)=>du(t,i)))er(e,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function du(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function us(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function uu(e,t){let r=[];for(let n of e.dataTypes)if(us(t,n))r.push(n);else if(t.includes("integer")&&n==="number")r.push("integer");e.dataTypes=r}function er(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,Z.checkStrictMode(e,t,e.opts.strictTypes)}class tr{constructor(e,t,r){if(qe.validateKeywordUsage(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=Z.schemaRefOrVal(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",fs(this.$data,e));else if(this.schemaCode=this.schemaValue,!qe.validSchemaType(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);if("code"in t?t.trackErrors:t.errors!==!1)this.errsCount=e.gen.const("_errs",w.default.errors)}result(e,t,r){this.failResult(y.not(e),t,r)}failResult(e,t,r){if(this.gen.if(e),r)r();else this.error();if(t){if(this.gen.else(),t(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(e,t){this.failResult(y.not(e),void 0,t)}fail(e){if(e===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(e),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail(y._`${t} !== undefined && (${y.or(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?Ie.reportExtraError:Ie.reportError)(this,this.def.error,t)}$dataError(){Ie.reportError(this,this.def.$dataError||Ie.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');Ie.resetErrorsCount(this.gen,this.errsCount)}ok(e){if(!this.allErrors)this.gen.if(e)}setParams(e,t){if(t)Object.assign(this.params,e);else this.params=e}block$data(e,t,r=y.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=y.nil,t=y.nil){if(!this.$data)return;let{gen:r,schemaCode:n,schemaType:s,def:o}=this;if(r.if(y.or(y._`${n} === undefined`,t)),e!==y.nil)r.assign(e,!0);if(s.length||o.validateSchema){if(r.elseIf(this.invalid$data()),this.$dataError(),e!==y.nil)r.assign(e,!1)}r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:n,it:s}=this;return y.or(o(),i());function o(){if(r.length){if(!(t instanceof y.Name))throw Error("ajv implementation error");let a=Array.isArray(r)?r:[r];return y._`${st.checkDataTypes(a,t,s.opts.strictNumbers,st.DataType.Wrong)}`}return y.nil}function i(){if(n.validateSchema){let a=e.scopeValue("validate$data",{ref:n.validateSchema});return y._`!${a}(${t})`}return y.nil}}subschema(e,t){let r=Yt.getSubschema(this.it,e);Yt.extendSubschemaData(r,this.it,e),Yt.extendSubschemaMode(r,e);let n={...this.it,...r,items:void 0,props:void 0};return Zd(n,t),n}mergeEvaluated(e,t){let{it:r,gen:n}=this;if(!r.opts.unevaluated)return;if(r.props!==!0&&e.props!==void 0)r.props=Z.mergeEvaluated.props(n,e.props,r.props,t);if(r.items!==!0&&e.items!==void 0)r.items=Z.mergeEvaluated.items(n,e.items,r.items,t)}mergeValidEvaluated(e,t){let{it:r,gen:n}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return n.if(t,()=>this.mergeEvaluated(e,y.Name)),!0}}hs.KeywordCxt=tr;function ls(e,t,r,n){let s=new tr(e,r,t);if("code"in r)r.code(s,n);else if(s.$data&&r.validate)qe.funcKeywordCode(s,r);else if("macro"in r)qe.macroKeywordCode(s,r);else if(r.compile||r.validate)qe.funcKeywordCode(s,r)}var lu=/^\/(?:[^~]|~0|~1)*$/,fu=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function fs(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,o;if(e==="")return w.default.rootData;if(e[0]==="/"){if(!lu.test(e))throw Error(`Invalid JSON-pointer: ${e}`);s=e,o=w.default.rootData}else{let d=fu.exec(e);if(!d)throw Error(`Invalid JSON-pointer: ${e}`);let u=+d[1];if(s=d[2],s==="#"){if(u>=t)throw Error(c("property/index",u));return n[t-u]}if(u>t)throw Error(c("data",u));if(o=r[t-u],!s)return o}let i=o,a=s.split("/");for(let d of a)if(d)o=y._`${o}${y.getProperty(Z.unescapeJsonPointer(d))}`,i=y._`${i} && ${o}`;return i;function c(d,u){return`Cannot access ${d} ${u} levels up, current level is ${t}`}}hs.getData=fs});var Og=ae(function(_s){Object.defineProperty(_s,"__esModule",{value:!0});class ms extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}_s.default=ms});var xf=ae(function(ys){Object.defineProperty(ys,"__esModule",{value:!0});var rr=Re();class gs extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`);this.missingRef=rr.resolveUrl(e,t,r),this.missingSchema=rr.normalizeId(rr.getFullPath(e,this.missingRef))}}ys.default=gs});var Hy=ae(function(ws){Object.defineProperty(ws,"__esModule",{value:!0});ws.resolveSchema=ws.getCompilingSchema=ws.resolveRef=ws.compileSchema=ws.SchemaEnv=void 0;var H=Rt(),gu=Og(),de=kl(),L=Re(),$s=nn(),yu=wf();class Te{constructor(e){var t;this.refs={},this.dynamicAnchors={};let r;if(typeof e.schema=="object")r=e.schema;this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:L.normalizeId(r===null||r===void 0?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r===null||r===void 0?void 0:r.$async,this.refs={}}}ws.SchemaEnv=Te;function sr(e){let t=vs.call(this,e);if(t)return t;let r=L.getFullPath(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:o}=this.opts,i=new H.CodeGen(this.scope,{es5:n,lines:s,ownProperties:o}),a;if(e.$async)a=i.scopeValue("Error",{ref:gu.default,code:H._`require("ajv/dist/runtime/validation_error").default`});let c=i.scopeName("validate");e.validateName=c;let d={gen:i,allErrors:this.opts.allErrors,data:de.default.data,parentData:de.default.parentData,parentDataProperty:de.default.parentDataProperty,dataNames:[de.default.data],dataPathArr:[H.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:H.stringify(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:H.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:H._`""`,opts:this.opts,self:this},u;try{this._compilations.add(e),yu.validateFunctionCode(d),i.optimize(this.opts.code.optimize);let l=i.toString();if(u=`${i.scopeRefs(de.default.scope)}return ${l}`,this.opts.code.process)u=this.opts.code.process(u,e);let p=Function(`${de.default.self}`,`${de.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=e.schema,p.schemaEnv=e,e.$async)p.$async=!0;if(this.opts.code.source===!0)p.source={validateName:c,validateCode:l,scopeValues:i._values};if(this.opts.unevaluated){let{props:h,items:f}=d;if(p.evaluated={props:h instanceof H.Name?void 0:h,items:f instanceof H.Name?void 0:f,dynamicProps:h instanceof H.Name,dynamicItems:f instanceof H.Name},p.source)p.source.evaluated=H.stringify(p.evaluated)}return e.validate=p,e}catch(l){if(delete e.validate,delete e.validateName,u)this.logger.error("Error compiling schema, function code:",u);throw l}finally{this._compilations.delete(e)}}ws.compileSchema=sr;function $u(e,t,r){var n;r=L.resolveUrl(this.opts.uriResolver,t,r);let s=e.refs[r];if(s)return s;let o=Eu.call(this,e,r);if(o===void 0){let i=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;if(i)o=new Te({schema:i,schemaId:a,root:e,baseId:t})}if(o===void 0)return;return e.refs[r]=vu.call(this,o)}ws.resolveRef=$u;function vu(e){if(L.inlineRef(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:sr.call(this,e)}function vs(e){for(let t of this._compilations)if(wu(t,e))return t}ws.getCompilingSchema=vs;function wu(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Eu(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||ot.call(this,e,t)}function ot(e,t){let r=this.opts.uriResolver.parse(t),n=L._getFullPath(this.opts.uriResolver,r),s=L.getFullPath(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return nr.call(this,r,e);let o=L.normalizeId(n),i=this.refs[o]||this.schemas[o];if(typeof i=="string"){let a=ot.call(this,e,i);if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;return nr.call(this,r,a)}if(typeof(i===null||i===void 0?void 0:i.schema)!=="object")return;if(!i.validate)sr.call(this,i);if(o===L.normalizeId(t)){let{schema:a}=i,{schemaId:c}=this.opts,d=a[c];if(d)s=L.resolveUrl(this.opts.uriResolver,s,d);return new Te({schema:a,schemaId:c,root:e,baseId:s})}return nr.call(this,r,i)}ws.resolveSchema=ot;var bu=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function nr(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let c=r[$s.unescapeFragment(a)];if(c===void 0)return;r=c;let d=typeof r==="object"&&r[this.opts.schemaId];if(!bu.has(a)&&d)t=L.resolveUrl(this.opts.uriResolver,t,d)}let o;if(typeof r!="boolean"&&r.$ref&&!$s.schemaHasRulesButRef(r,this.RULES)){let a=L.resolveUrl(this.opts.uriResolver,t,r.$ref);o=ot.call(this,n,a)}let{schemaId:i}=this.opts;if(o=o||new Te({schema:r,schemaId:i,root:n,baseId:t}),o.schema!==o.root.schema)return o;return}});var bs=ae(function(vm,Ou){Ou.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var ur=ae(function(wm,Rs){var Nu=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),ir=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),ue=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),ar=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Ps=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),cr=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),Ru=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),M=Array(256);for(let t=0;t<256;t++)M[t]="%"+"0123456789ABCDEF"[t>>4]+"0123456789ABCDEF"[t&15];function T(e){if(e<2048)return M[192|e>>6]+M[128|e&63];if(e<65536)return M[224|e>>12]+M[128|e>>6&63]+M[128|e&63];return M[240|e>>18]+M[128|e>>12&63]+M[128|e>>6&63]+M[128|e&63]}function qu(e){let t="",r=0,n=0;for(n=0;n<e.length;n++){if(r=e[n].charCodeAt(0),r===48)continue;if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}var Iu=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),Tu=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),ju=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),Cu=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Du(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++){if(ju(e[t]))continue;if(e[t]==="%"&&t+2<e.length&&ue(e.slice(t+1,t+3))){t+=2;continue}return!1}return!0}function Ss(e){let t=-1,r=0,n=-1,s=0;for(let a=0;a<e.length;a++)if(e[a]==="0"){if(n===-1)n=a;if(s++,s>r)r=s,t=n}else n=-1,s=0;if(r<2)return e.join(":");let o=e.slice(0,t).join(":"),i=e.slice(t+r).join(":");return o+"::"+i}function Au(e){let t=e.indexOf("::");if(t!==-1&&e.indexOf("::",t+1)!==-1)return;let r=t===-1?e.split(":"):e.slice(0,t).split(":"),n=t===-1?[]:e.slice(t+2).split(":");if(t!==-1){if(r.length===1&&r[0]==="")r.length=0;if(n.length===1&&n[0]==="")n.length=0}let s=r.concat(n),o=0;for(let a=0;a<s.length;a++){let c=s[a];if(c==="")return;if(c.indexOf(".")!==-1){if(a!==s.length-1||t!==-1&&n.length===0||!ir(c))return;o+=2;continue}if(!Iu(c))return;s[a]=parseInt(c,16).toString(16),o++}if(t===-1){if(o!==8)return;return Ss(s)}if(o>=8)return;let i=s.slice(0,r.length);for(let a=o;a<8;a++)i.push("0");for(let a=r.length;a<s.length;a++)i.push(s[a]);return Ss(i)}function or(e){let t=e[0]==="["&&e[e.length-1]==="]";if((e[0]==="["||e[e.length-1]==="]")&&!t)return{host:e,isIPV6:!1,error:!0};let n=t?e.slice(1,-1):e;if(t&&Tu(n))return n=n.toLowerCase(),{host:`[${n}]`,escapedHost:n,isIPV6:!1,isIPVFuture:!0};if(Mu(n,":")<2)return{host:e,isIPV6:!1,error:t};let s="",o=n.indexOf("%");if(o!==-1){let a=n.slice(o,o+3).toLowerCase()==="%25"?3:1;if(s=n.slice(o+a),!Du(s))return{host:e,isIPV6:!1,error:!0};n=n.slice(0,o)}let i=Au(n);if(i===void 0)return{host:e,isIPV6:!1,error:!0};return{host:i+(s?"%"+s:""),escapedHost:i+(s?"%25"+s:""),isIPV6:!0}}function Mu(e,t){let r=0;for(let n=0;n<e.length;n++)if(e[n]===t)r++;return r}function Fu(e){let t=e,r=[],n=-1,s=0;while(s=t.length){if(s===1)if(t===".")break;else if(t==="/"){r.push("/");break}else{r.push(t);break}else if(s===2){if(t[0]==="."){if(t[1]===".")break;else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."||t[1]==="/"){r.push("/");break}}}else if(s===3){if(t==="/.."){if(r.length!==0)r.pop();r.push("/");break}}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."){if(t[3]==="/"){if(t=t.slice(3),r.length!==0)r.pop();continue}}}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}var Vu={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},zu=/[@/?#:]/g,Uu=/[@/?#]/g;function xs(e,t){let r=t?Uu:zu;return r.lastIndex=0,e.replace(r,(n)=>Vu[n])}function ks(e,t=!1){if(e.indexOf("%")===-1)return e;let r="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){let s=e.slice(n+1,n+3);if(ue(s)){let o=s.toUpperCase(),i=String.fromCharCode(parseInt(o,16));if(t&&ar(i))r+=i;else r+="%"+o;n+=2;continue}}r+=e[n]}return r}function Ku(e){let t="";for(let r=0;r<e.length;r++){let n=e[r];if(n==="%"&&r+2<e.length){let s=e.slice(r+1,r+3);if(ue(s)){let o=s.toUpperCase(),i=String.fromCharCode(parseInt(o,16));if(i!=="."&&ar(i))t+=i;else t+="%"+o;r+=2;continue}}if(Ps(n))t+=n;else{let s=e.charCodeAt(r);if(s<128)t+=Ns(s)?n:M[s];else if(s<55296||s>57343)t+=T(s);else if(s<=56319&&r+1<e.length){let o=e.charCodeAt(r+1);if(o>=56320&&o<=57343)t+=T(65536+(s-55296<<10)+(o-56320)),r++;else t+=T(65533)}else t+=T(65533)}}return t}function Hu(e,t=!1){let r="",n=t&&e[0]!=="/";for(let s=0;s<e.length;s++){let o=e[s];if(o==="%"&&s+2<e.length){let i=e.slice(s+1,s+3);if(ue(i)){r+="%"+i.toUpperCase(),s+=2;continue}}if(o==="/")n=!1;if(Ps(o)&&(o!==":"||!n))r+=o;else{let i=e.charCodeAt(s);if(i<128)r+=M[i];else if(i<55296||i>57343)r+=T(i);else if(i<=56319&&s+1<e.length){let a=e.charCodeAt(s+1);if(a>=56320&&a<=57343)r+=T(65536+(i-55296<<10)+(a-56320)),s++;else r+=T(65533)}else r+=T(65533)}}return r}function dr(e,t){let r="";for(let n=0;n<e.length;n++){let s=e[n];if(s==="%"&&n+2<e.length){let o=e.slice(n+1,n+3);if(ue(o)){r+="%"+o.toUpperCase(),n+=2;continue}}if(t(s))r+=s;else{let o=e.charCodeAt(n);if(o<128)r+=M[o];else if(o<55296||o>57343)r+=T(o);else if(o<=56319&&n+1<e.length){let i=e.charCodeAt(n+1);if(i>=56320&&i<=57343)r+=T(65536+(o-55296<<10)+(i-56320)),n++;else r+=T(65533)}else r+=T(65533)}}return r}function Os(e){return dr(e,Ru)}function Lu(e){return dr(e,cr)}function Gu(e){return dr(e,cr)}function Ns(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===42||e===43||e===45||e===46||e===47||e===64||e===95}function Ju(e){let t="";for(let r=0;r<e.length;r++){let n=e[r];if(n==="%"&&r+2<e.length){let s=e.slice(r+1,r+3);if(ue(s)){let o=s.toUpperCase(),i=String.fromCharCode(parseInt(o,16));if(ar(i))t+=i;else t+="%"+o;r+=2;continue}}if(cr(n))t+=n;else{let s=e.charCodeAt(r);if(s<128)t+=Ns(s)?n:M[s];else if(s<55296||s>57343)t+=T(s);else if(s<=56319&&r+1<e.length){let o=e.charCodeAt(r+1);if(o>=56320&&o<=57343)t+=T(65536+(s-55296<<10)+(o-56320)),r++;else t+=T(65533)}else t+=T(65533)}}return t}function Bu(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let n=e.slice(r+1,r+3);if(ue(n)){t+="%"+n.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t}function Wu(e){let t=[];if(e.userinfo!==void 0)t.push(Os(e.userinfo)),t.push("@");if(e.host!==void 0){let r=e.host;if(!ir(r)){let n=or(r);if(n.isIPV6!==!0&&n.isIPVFuture!==!0)r=ks(r,!0),n=or(r);if(n.isIPV6===!0||n.isIPVFuture===!0)r=`[${n.escapedHost}]`;else r=xs(r,!1)}t.push(r)}if(typeof e.port==="number"||typeof e.port==="string")t.push(":"),t.push(String(e.port));return t.length?t.join(""):void 0}Rs.exports={nonSimpleDomain:Cu,recomposeAuthority:Wu,reescapeHostDelimiters:xs,normalizePercentEncoding:ks,normalizePathEncoding:Ku,serializePathEncoding:Hu,normalizeQueryFragmentEncoding:Ju,encodeUserinfo:Os,encodeQuery:Lu,encodeFragment:Gu,escapePreservingEscapes:Bu,removeDotSegments:Fu,isIPv4:ir,isUUID:Nu,normalizeIPv6:or,stringArrayToHexStripped:qu}});var Cs=ae(function(Em,js){var{isUUID:Qu}=ur(),Zu=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,Xu=["http","https","ws","wss","urn","urn:uuid"];function Yu(e){return Xu.indexOf(e)!==-1}function lr(e){if(e.secure===!0)return!0;else if(e.secure===!1)return!1;else if(e.scheme)return e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S");else return!1}function qs(e){if(!e.host)e.error=e.error||"HTTP URIs must have a host.";return e}function Is(e){let t=String(e.scheme).toLowerCase()==="https";if(e.port===(t?443:80)||e.port==="")e.port=void 0;if(!e.path)e.path="/";return e}function el(e){return e.secure=lr(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function tl(e){if(e.port===(lr(e)?443:80)||e.port==="")e.port=void 0;if(typeof e.secure==="boolean")e.scheme=e.secure?"wss":"ws",e.secure=void 0;if(e.resourceName){let t=e.resourceName.indexOf("?"),r=t===-1?e.resourceName:e.resourceName.slice(0,t);e.path=r&&r!=="/"?r:void 0,e.query=t===-1?void 0:e.resourceName.slice(t+1),e.resourceName=void 0}return e.fragment=void 0,e}function rl(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(Zu);if(r&&r[0]===e.path){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let s=`${n}:${t.nid||e.nid}`,o=fr(s);if(e.path=void 0,o)e=o.parse(e,t)}else e.error=e.error||"URN can not be parsed.";return e}function nl(e,t){if(e.nid===void 0)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),s=`${r}:${t.nid||n}`,o=fr(s);if(o)e=o.serialize(e,t);let i=e,a=e.nss;return i.path=`${n||t.nid}:${a}`,t.skipEscape=!0,i}function sl(e,t){let r=e;if(r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!Qu(r.uuid)))r.error=r.error||"UUID is not valid.";return r}function ol(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var Ts={scheme:"http",domainHost:!0,parse:qs,serialize:Is},il={scheme:"https",domainHost:Ts.domainHost,parse:qs,serialize:Is},it={scheme:"ws",domainHost:!0,parse:el,serialize:tl},al={scheme:"wss",domainHost:it.domainHost,parse:it.parse,serialize:it.serialize},cl={scheme:"urn",parse:rl,serialize:nl,skipNormalize:!0},dl={scheme:"urn:uuid",parse:sl,serialize:ol,skipNormalize:!0},at={http:Ts,https:il,ws:it,wss:al,urn:cl,"urn:uuid":dl};Object.setPrototypeOf(at,null);function fr(e){return e&&(at[e]||at[e.toLowerCase()])||void 0}js.exports={wsIsSecure:lr,SCHEMES:at,isValidSchemeName:Yu,getSchemeHandler:fr}});var Bs=ae(function(bm,ut){var{normalizeIPv6:Vs,removeDotSegments:Ce,recomposeAuthority:ul,normalizePercentEncoding:zs,normalizePathEncoding:ll,serializePathEncoding:Ds,normalizeQueryFragmentEncoding:As,encodeQuery:fl,encodeFragment:hl,reescapeHostDelimiters:pl,isIPv4:Us,nonSimpleDomain:ml}=ur(),{SCHEMES:Ks,getSchemeHandler:hr}=Cs(),Hs=/^[A-Za-z][A-Za-z0-9+.-]*$/u;function Ms(e){let t=unescape(String(e));if(!Hs.test(t))throw TypeError("URI scheme is malformed.");return t}function _l(e,t){if(typeof e==="string")e=Sl(e,t);else if(typeof e==="object")e=dt(le(e,t),t);return e}function gl(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:s,malformedAuthorityOrPort:o,malformedPercentEncoding:i,malformedSchemeSpecific:a,malformedHost:c,malformedScheme:d}=ct(e,n),{parsed:u,malformedAuthorityOrPort:l,malformedPercentEncoding:_,malformedSchemeSpecific:p,malformedHost:h,malformedScheme:f}=ct(t,n);if(o||l||i||_||a||p||c||h||d||f)throw Error(s.error||u.error||"URI is malformed.");let m=Ls(s,u,n,!0),g=hr(r&&r.scheme||m.scheme),v=m.host,S=v!==void 0&&v!==""&&(Us(v)||Vs(v).isIPV6);Gs(m,r||{},g,S);let k=v&&v.indexOf("%")!==-1&&!/\P{ASCII}/u.test(v);if(m.error&&!k)throw Error(m.error);return n.skipEscape=!0,le(m,n)}function Ls(e,t,r,n){let s={};if(!n)e=dt(le(e,r),r),t=dt(le(t,r),r);if(r=r||{},!r.tolerant&&t.scheme)s.scheme=t.scheme,s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=Ce(t.path||""),s.query=t.query;else{if(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=Ce(t.path||""),s.query=t.query;else{if(!t.path)if(s.path=e.path,t.query!==void 0)s.query=t.query;else s.query=e.query;else{if(t.path[0]==="/")s.path=Ce(t.path);else{if((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path)s.path="/"+t.path;else if(!e.path)s.path=t.path;else s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path;s.path=Ce(s.path)}s.query=t.query}s.userinfo=e.userinfo,s.host=e.host,s.port=e.port}s.scheme=e.scheme}return s.fragment=t.fragment,s}function yl(e,t,r){let n=Fs(e,r),s=Fs(t,r);return n!==void 0&&s!==void 0&&n===s}function le(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),s=[];if(r.scheme)r.scheme=Ms(r.scheme);let o=hr(n.scheme||r.scheme);if(o&&o.serialize)o.serialize(r,n);let i=r.userinfo!==void 0||r.host!==void 0||r.port!==void 0,a=!n.skipEscape&&r.scheme===void 0&&!i;if(r.path!==void 0)if(!n.skipEscape)r.path=Ds(r.path,a);else r.path=zs(r.path);if(n.reference!=="suffix"&&r.scheme)r.scheme=Ms(r.scheme),s.push(r.scheme,":");let c=ul(r);if(c!==void 0){if(n.reference!=="suffix")s.push("//");if(s.push(c),r.path&&r.path[0]!=="/")s.push("/")}if(r.path!==void 0){let d=r.path;if(!n.absolutePath&&(!o||!o.absolutePath))d=Ce(d);if(a)d=Ds(d,!0);if(c===void 0&&d[0]==="/"&&d[1]==="/")d="/%2F"+d.slice(2);s.push(d)}if(r.query!==void 0)s.push("?",fl(r.query));if(r.fragment!==void 0)s.push("#",hl(r.fragment));return s.join("")}var $l=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,vl=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,wl=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function El(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port==="number"&&(e.port<0||e.port>65535))return"URI port is malformed.";return}function je(e){if(e===void 0)return!1;let t=e.indexOf("%");while(t!==-1){if(t+2>=e.length||!/^[\da-f]{2}$/iu.test(e.slice(t+1,t+3)))return!0;t=e.indexOf("%",t+3)}return!1}function bl(e){let t=e[4];return je(e[3])||t!==void 0&&!(t[0]==="["&&t[t.length-1]==="]")&&je(t)||je(e[6])||je(e[7])||je(e[8])}function Gs(e,t,r,n){if(!t.unicodeSupport&&(!r||!r.unicodeSupport)&&e.host&&e.host[0]!=="["&&(t.domainHost||r&&r.domainHost)&&n===!1&&ml(e.host))try{e.host=new URL("http://"+e.host).hostname}catch(s){return e.error=e.error||"Host's domain name can not be converted to ASCII: "+s,!0}return!1}function ct(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=!1,o=!1,i=!1,a=!1,c=!1,d=!1,u=!1;if(r.reference==="suffix")if(r.scheme)e=r.scheme+":"+e;else e="//"+e;let l=e.match(vl);if(l!==null&&l[1].indexOf("\\")!==-1)n.error="URI authority must not contain a literal backslash.",s=!0;let _=e.match(wl);if(_!==null){let h=_[1],f=h.replace(/[\t\n\r]/g,"");if(f.length>=2){if(f.slice(0,2)!=="//")n.error=n.error||"URI authority must not contain a literal backslash.",s=!0;else if(h.length!==f.length)n.error=n.error||"URI authority introducer must not contain whitespace.",s=!0}}let p=e.match($l);if(p){if(n.scheme=p[1],n.userinfo=p[3],n.host=p[4],n.port=parseInt(p[5],10),n.path=p[6]||"",n.query=p[7],n.fragment=p[8],n.scheme!==void 0){let m=unescape(n.scheme);if(Hs.test(m))n.scheme=m.toLowerCase();else n.error=n.error||"URI scheme is malformed.",d=!0}if(o=bl(p),o)n.error=n.error||"URI contains malformed percent-encoding.";if(isNaN(n.port))n.port=p[5];let h=El(n,p);if(h!==void 0)n.error=n.error||h,s=!0;if(n.host)if(Us(n.host)===!1){let g=n.host[0]==="["&&n.host[n.host.length-1]==="]",v=Vs(n.host);if(u=v.isIPV6||v.isIPVFuture===!0,c=g&&v.error===!0,n.host=u?v.host:v.host.toLowerCase(),c)n.error=n.error||"URI host is malformed.",s=!0}else u=!0;if(n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path)n.reference="same-document";else if(n.scheme===void 0)n.reference="relative";else if(n.fragment===void 0)n.reference="absolute";else n.reference="uri";if(r.reference&&r.reference!=="suffix"&&r.reference!==n.reference)n.error=n.error||"URI is not a "+r.reference+" reference.";let f=hr(r.scheme||n.scheme);if(a=Gs(n,r,f,u),!f||f&&!f.skipNormalize){if(e.indexOf("%")!==-1){if(n.host!==void 0&&!c){let m=u?n.host:zs(n.host,!0);n.host=pl(m,u)}}if(n.path)n.path=ll(n.path);if(n.query)n.query=As(n.query);if(n.fragment)n.fragment=As(n.fragment)}if(f&&f.parse){if(f.parse(n,r),f===Ks.urn&&n.nid===void 0)i=!0}}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:s,malformedPercentEncoding:o,malformedSchemeSpecific:i,malformedHost:a,malformedScheme:d}}function dt(e,t){return ct(e,t).parsed}function Sl(e,t){return Js(e,t).normalized}function Js(e,t){let{parsed:r,malformedAuthorityOrPort:n,malformedPercentEncoding:s,malformedSchemeSpecific:o,malformedHost:i,malformedScheme:a}=ct(e,t);return{normalized:n||s||o||i||a?e:le(r,t),malformedAuthorityOrPort:n,malformedPercentEncoding:s,malformedSchemeSpecific:o,malformedHost:i,malformedScheme:a}}function Fs(e,t){if(typeof e!=="string"&&typeof e!=="object")return;let r;try{r=typeof e==="string"?e:le(e,t)}catch{return}let{normalized:n,malformedAuthorityOrPort:s,malformedPercentEncoding:o,malformedSchemeSpecific:i,malformedHost:a,malformedScheme:c}=Js(r,t);return s||o||i||a||c?void 0:n}var pr={SCHEMES:Ks,normalize:_l,resolve:gl,resolveComponent:Ls,equal:yl,serialize:le,parse:dt};ut.exports=pr;ut.exports.default=pr;ut.exports.fastUri=pr});var Zs=ae(function(Qs){Object.defineProperty(Qs,"__esModule",{value:!0});var Ws=Bs();Ws.code='require("ajv/dist/runtime/uri").default';Qs.default=Ws});var s_=ae(function(X){Object.defineProperty(X,"__esModule",{value:!0});X.CodeGen=X.Name=X.nil=X.stringify=X.str=X._=X.KeywordCxt=void 0;var xl=wf();Object.defineProperty(X,"KeywordCxt",{enumerable:!0,get:function(){return xl.KeywordCxt}});var ve=Rt();Object.defineProperty(X,"_",{enumerable:!0,get:function(){return ve._}});Object.defineProperty(X,"str",{enumerable:!0,get:function(){return ve.str}});Object.defineProperty(X,"stringify",{enumerable:!0,get:function(){return ve.stringify}});Object.defineProperty(X,"nil",{enumerable:!0,get:function(){return ve.nil}});Object.defineProperty(X,"Name",{enumerable:!0,get:function(){return ve.Name}});Object.defineProperty(X,"CodeGen",{enumerable:!0,get:function(){return ve.CodeGen}});var Ol=Og(),ro=xf(),Nl=Ut(),Ae=Hy(),Rl=Rt(),De=Re(),lt=Ne(),_r=nn(),Xs=bs(),ql=Zs(),no=(e,t)=>new RegExp(e,t);no.code="new RegExp";var Il=["removeAdditional","useDefaults","coerceTypes"],Tl=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),jl={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},Cl={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Ys=200;function Dl(e){var t,r,n,s,o,i,a,c,d,u,l,_,p,h,f,m,g,v,S,k,E,J,W,Pt,xt;let Se=e.strict,kt=(t=e.code)===null||t===void 0?void 0:t.optimize,xr=kt===!0||kt===void 0?1:kt||0,kr=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:no,Hi=(s=e.uriResolver)!==null&&s!==void 0?s:ql.default;return{strictSchema:(i=(o=e.strictSchema)!==null&&o!==void 0?o:Se)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:Se)!==null&&c!==void 0?c:!0,strictTypes:(u=(d=e.strictTypes)!==null&&d!==void 0?d:Se)!==null&&u!==void 0?u:"log",strictTuples:(_=(l=e.strictTuples)!==null&&l!==void 0?l:Se)!==null&&_!==void 0?_:"log",strictRequired:(h=(p=e.strictRequired)!==null&&p!==void 0?p:Se)!==null&&h!==void 0?h:!1,code:e.code?{...e.code,optimize:xr,regExp:kr}:{optimize:xr,regExp:kr},loopRequired:(f=e.loopRequired)!==null&&f!==void 0?f:Ys,loopEnum:(m=e.loopEnum)!==null&&m!==void 0?m:Ys,meta:(g=e.meta)!==null&&g!==void 0?g:!0,messages:(v=e.messages)!==null&&v!==void 0?v:!0,inlineRefs:(S=e.inlineRefs)!==null&&S!==void 0?S:!0,schemaId:(k=e.schemaId)!==null&&k!==void 0?k:"$id",addUsedSchema:(E=e.addUsedSchema)!==null&&E!==void 0?E:!0,validateSchema:(J=e.validateSchema)!==null&&J!==void 0?J:!0,validateFormats:(W=e.validateFormats)!==null&&W!==void 0?W:!0,unicodeRegExp:(Pt=e.unicodeRegExp)!==null&&Pt!==void 0?Pt:!0,int32range:(xt=e.int32range)!==null&&xt!==void 0?xt:!0,uriResolver:Hi}}class ft{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...Dl(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new Rl.ValueScope({scope:{},prefixes:Tl,es5:t,lines:r}),this.logger=Ul(e.logger);let n=e.validateFormats;if(e.validateFormats=!1,this.RULES=Nl.getRules(),eo.call(this,jl,e,"NOT SUPPORTED"),eo.call(this,Cl,e,"DEPRECATED","warn"),this._metaOpts=Vl.call(this),e.formats)Ml.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)Fl.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);Al.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=Xs;if(r==="id")n={...Xs},n.id=n.$id,delete n.$id;if(t&&e)this.addMetaSchema(n,n[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let n=r(t);if(!("$async"in r))this.errors=r.errors;return n}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(d,u){await s.call(this,d.$schema);let l=this._addSchema(d,u);return l.validate||o.call(this,l)}async function s(d){if(d&&!this.getSchema(d))await n.call(this,{$ref:d},!0)}async function o(d){try{return this._compileSchemaEnv(d)}catch(u){if(!(u instanceof ro.default))throw u;return i.call(this,u),await a.call(this,u.missingSchema),o.call(this,d)}}function i({missingSchema:d,missingRef:u}){if(this.refs[d])throw Error(`AnySchema ${d} is loaded but ${u} cannot be resolved`)}async function a(d){let u=await c.call(this,d);if(!this.refs[d])await s.call(this,u.$schema);if(!this.refs[d])this.addSchema(u,d,t)}async function c(d){let u=this._loading[d];if(u)return u;try{return await(this._loading[d]=r(d))}finally{delete this._loading[d]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,r,n);return this}let s;if(typeof e==="object"){let{schemaId:o}=this.opts;if(s=e[o],s!==void 0&&typeof s!="string")throw Error(`schema ${o} must be string`)}return t=De.normalizeId(t||s),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(r,e);if(!n&&t){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw Error(s)}return n}getSchema(e){let t;while(typeof(t=to.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,n=new Ae.SchemaEnv({schema:{},schemaId:r});if(t=Ae.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=to.call(this,e);if(typeof t=="object")this._cache.delete(t.schema);return delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let r=e[this.opts.schemaId];if(r)r=De.normalizeId(r),delete this.schemas[r],delete this.refs[r];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if(typeof e=="string"){if(r=e,typeof t=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r}else if(typeof e=="object"&&t===void 0){if(t=e,r=t.keyword,Array.isArray(r)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(Hl.call(this,r,t),!t)return _r.eachItem(r,(s)=>mr.call(this,s)),this;Gl.call(this,t);let n={...t,type:lt.getJSONTypes(t.type),schemaType:lt.getJSONTypes(t.schemaType)};return _r.eachItem(r,n.type.length===0?(s)=>mr.call(this,s,n):(s)=>n.type.forEach((o)=>mr.call(this,s,n,o))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let r of t.rules){let n=r.rules.findIndex((s)=>s.keyword===e);if(n>=0)r.rules.splice(n,1)}return this}addFormat(e,t){if(typeof t=="string")t=new RegExp(t);return this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){if(!e||e.length===0)return"No errors";return e.map((n)=>`${r}${n.instancePath} ${n.message}`).reduce((n,s)=>n+t+s)}$dataMetaSchema(e,t){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of t){let s=n.split("/").slice(1),o=e;for(let i of s)o=o[i];for(let i in r){let a=r[i];if(typeof a!="object")continue;let{$data:c}=a.definition,d=o[i];if(c&&d)o[i]=so(d)}}return e}_removeAllSchemas(e,t){for(let r in e){let n=e[r];if(!t||t.test(r)){if(typeof n=="string")delete e[r];else if(n&&!n.meta)this._cache.delete(n.schema),delete e[r]}}}_addSchema(e,t,r,n=this.opts.validateSchema,s=this.opts.addUsedSchema){let o,{schemaId:i}=this.opts;if(typeof e=="object")o=e[i];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof e!="boolean")throw Error("schema must be object or boolean");let a=this._cache.get(e);if(a!==void 0)return a;r=De.normalizeId(o||r);let c=De.getSchemaRefs.call(this,e,r);if(a=new Ae.SchemaEnv({schema:e,schemaId:i,meta:t,baseId:r,localRefs:c}),this._cache.set(a.schema,a),s&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=a}if(n)this.validateSchema(e,!0);return a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta)this._compileMetaSchema(e);else Ae.compileSchema.call(this,e);if(!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{Ae.compileSchema.call(this,e)}finally{this.opts=t}}}ft.ValidationError=Ol.default;ft.MissingRefError=ro.default;X.default=ft;function eo(e,t,r,n="error"){for(let s in e){let o=s;if(o in t)this.logger[n](`${r}: option ${s}. ${e[o]}`)}}function to(e){return e=De.normalizeId(e),this.schemas[e]||this.refs[e]}function Al(){let e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function Ml(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function Fl(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];if(!r.keyword)r.keyword=t;this.addKeyword(r)}}function Vl(){let e={...this.opts};for(let t of Il)delete e[t];return e}var zl={log(){},warn(){},error(){}};function Ul(e){if(e===!1)return zl;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}var Kl=/^[a-z_$][a-z0-9_$:-]*$/i;function Hl(e,t){let{RULES:r}=this;if(_r.eachItem(e,(n)=>{if(r.keywords[n])throw Error(`Keyword ${n} is already defined`);if(!Kl.test(n))throw Error(`Keyword ${n} has invalid name`)}),!t)return;if(t.$data&&!(("code"in t)||("validate"in t)))throw Error('$data keyword must have "code" or "validate" function')}function mr(e,t,r){var n;let s=t===null||t===void 0?void 0:t.post;if(r&&s)throw Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,i=s?o.post:o.rules.find(({type:c})=>c===r);if(!i)i={type:r,rules:[]},o.rules.push(i);if(o.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:lt.getJSONTypes(t.type),schemaType:lt.getJSONTypes(t.schemaType)}};if(t.before)Ll.call(this,i,a,t.before);else i.rules.push(a);o.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach((c)=>this.addKeyword(c))}function Ll(e,t,r){let n=e.rules.findIndex((s)=>s.keyword===r);if(n>=0)e.rules.splice(n,0,t);else e.rules.push(t),this.logger.warn(`rule ${r} is not defined`)}function Gl(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=so(t);e.validateSchema=this.compile(t,!0)}var Jl={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function so(e){return{anyOf:[e,Jl]}}});var co=ae(function(io){Object.defineProperty(io,"__esModule",{value:!0});io.DiscrError=void 0;var oo;(function(e){e.Tag="tag",e.Mapping="mapping"})(oo||(io.DiscrError=oo={}))});var f_=ae(function(lo){Object.defineProperty(lo,"__esModule",{value:!0});var we=Rt(),gr=co(),uo=Hy(),Ql=xf(),Zl=nn(),Xl={message:({params:{discrError:e,tagName:t}})=>e===gr.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>we._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},Yl={keyword:"discriminator",type:"object",schemaType:"object",error:Xl,code(e){let{gen:t,data:r,schema:n,parentSchema:s,it:o}=e,{oneOf:i}=s;if(!o.opts.discriminator)throw Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw Error("discriminator: requires propertyName");if(n.mapping)throw Error("discriminator: mapping is not supported");if(!i)throw Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),d=t.const("tag",we._`${r}${we.getProperty(a)}`);t.if(we._`typeof ${d} == "string"`,()=>u(),()=>e.error(!1,{discrError:gr.DiscrError.Tag,tag:d,tagName:a})),e.ok(c);function u(){let p=_();t.if(!1);for(let h in p)t.elseIf(we._`${d} === ${h}`),t.assign(c,l(p[h]));t.else(),e.error(!1,{discrError:gr.DiscrError.Mapping,tag:d,tagName:a}),t.endIf()}function l(p){let h=t.name("valid"),f=e.subschema({keyword:"oneOf",schemaProp:p},h);return e.mergeEvaluated(f,we.Name),h}function _(){var p;let h={},f=g(s),m=!0;for(let k=0;k<i.length;k++){let E=i[k];if((E===null||E===void 0?void 0:E.$ref)&&!Zl.schemaHasRulesButRef(E,o.self.RULES)){let W=E.$ref;if(E=uo.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,W),E instanceof uo.SchemaEnv)E=E.schema;if(E===void 0)throw new Ql.default(o.opts.uriResolver,o.baseId,W)}let J=(p=E===null||E===void 0?void 0:E.properties)===null||p===void 0?void 0:p[a];if(typeof J!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);m=m&&(f||g(E)),v(J,k)}if(!m)throw Error(`discriminator: "${a}" must be required`);return h;function g({required:k}){return Array.isArray(k)&&k.includes(a)}function v(k,E){if(k.const)S(k.const,E);else if(k.enum)for(let J of k.enum)S(J,E);else throw Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function S(k,E){if(typeof k!="string"||k in h)throw Error(`discriminator: "${a}" values must be unique strings`);h[k]=E}}}};lo.default=Yl});var ho=ae(function(fo){Object.defineProperty(fo,"__esModule",{value:!0});var tf={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};fo.default=tf});var a_=ae(function(go){Object.defineProperty(go,"__esModule",{value:!0});go.callRef=go.getValidate=void 0;var nf=xf(),po=V(),F=Rt(),Ee=kl(),mo=Hy(),ht=nn(),sf={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:o,validateName:i,opts:a,self:c}=n,{root:d}=o;if((r==="#"||r==="#/")&&s===d.baseId)return l();let u=mo.resolveRef.call(c,d,s,r);if(u===void 0)throw new nf.default(n.opts.uriResolver,s,r);if(u instanceof mo.SchemaEnv)return _(u);return p(u);function l(){if(o===d)return pt(e,i,o,o.$async);let h=t.scopeValue("root",{ref:d});return pt(e,F._`${h}.validate`,d,d.$async)}function _(h){let f=_o(e,h);pt(e,f,h,h.$async)}function p(h){let f=t.scopeValue("schema",a.code.source===!0?{ref:h,code:F.stringify(h)}:{ref:h}),m=t.name("valid"),g=e.subschema({schema:h,dataTypes:[],schemaPath:F.nil,topSchemaRef:f,errSchemaPath:r},m);e.mergeEvaluated(g),e.ok(m)}}};function _o(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):F._`${r.scopeValue("wrapper",{ref:t})}.validate`}go.getValidate=_o;function pt(e,t,r,n){let{gen:s,it:o}=e,{allErrors:i,schemaEnv:a,opts:c}=o,d=c.passContext?Ee.default.this:F.nil;if(n)u();else l();function u(){if(!a.$async)throw Error("async schema referenced by sync schema");let h=s.let("valid");s.try(()=>{if(s.code(F._`await ${po.callValidateCode(e,t,d)}`),p(t),!i)s.assign(h,!0)},(f)=>{if(s.if(F._`!(${f} instanceof ${o.ValidationError})`,()=>s.throw(f)),_(f),!i)s.assign(h,!1)}),e.ok(h)}function l(){e.result(po.callValidateCode(e,t,d),()=>p(t),()=>_(t))}function _(h){let f=F._`${h}.errors`;s.assign(Ee.default.vErrors,F._`${Ee.default.vErrors} === null ? ${f} : ${Ee.default.vErrors}.concat(${f})`),s.assign(Ee.default.errors,F._`${Ee.default.vErrors}.length`)}function p(h){var f;if(!o.opts.unevaluated)return;let m=(f=r===null||r===void 0?void 0:r.validate)===null||f===void 0?void 0:f.evaluated;if(o.props!==!0)if(m&&!m.dynamicProps){if(m.props!==void 0)o.props=ht.mergeEvaluated.props(s,m.props,o.props)}else{let g=s.var("props",F._`${h}.evaluated.props`);o.props=ht.mergeEvaluated.props(s,g,o.props,F.Name)}if(o.items!==!0)if(m&&!m.dynamicItems){if(m.items!==void 0)o.items=ht.mergeEvaluated.items(s,m.items,o.items)}else{let g=s.var("items",F._`${h}.evaluated.items`);o.items=ht.mergeEvaluated.items(s,g,o.items,F.Name)}}}go.callRef=pt;go.default=sf});var l_=ae(function($o){Object.defineProperty($o,"__esModule",{value:!0});var cf=ho(),df=a_(),uf=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",cf.default,df.default];$o.default=uf});var wo=ae(function(vo){Object.defineProperty(vo,"__esModule",{value:!0});var _t=Rt(),se=_t.operators,mt={maximum:{okStr:"<=",ok:se.LTE,fail:se.GT},minimum:{okStr:">=",ok:se.GTE,fail:se.LT},exclusiveMaximum:{okStr:"<",ok:se.LT,fail:se.GTE},exclusiveMinimum:{okStr:">",ok:se.GT,fail:se.LTE}},ff={message:({keyword:e,schemaCode:t})=>_t.str`must be ${mt[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>_t._`{comparison: ${mt[e].okStr}, limit: ${t}}`},hf={keyword:Object.keys(mt),type:"number",schemaType:"number",$data:!0,error:ff,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data(_t._`${r} ${mt[t].fail} ${n} || isNaN(${r})`)}};vo.default=hf});var bo=ae(function(Eo){Object.defineProperty(Eo,"__esModule",{value:!0});var Me=Rt(),mf={message:({schemaCode:e})=>Me.str`must be multiple of ${e}`,params:({schemaCode:e})=>Me._`{multipleOf: ${e}}`},_f={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:mf,code(e){let{gen:t,data:r,schemaCode:n,it:s}=e,o=s.opts.multipleOfPrecision,i=t.let("res"),a=o?Me._`Math.abs(Math.round(${i}) - ${i}) > 1e-${o}`:Me._`${i} !== parseInt(${i})`;e.fail$data(Me._`(${n} === 0 || (${i} = ${r}/${n}, ${a}))`)}};Eo.default=_f});var xo=ae(function(Po){Object.defineProperty(Po,"__esModule",{value:!0});function So(e){let t=e.length,r=0,n=0,s;while(n<t)if(r++,s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<t){if(s=e.charCodeAt(n),(s&64512)===56320)n++}return r}Po.default=So;So.code='require("ajv/dist/runtime/ucs2length").default'});var Oo=ae(function(ko){Object.defineProperty(ko,"__esModule",{value:!0});var fe=Rt(),$f=nn(),vf=xo(),Ef={message({keyword:e,schemaCode:t}){return fe.str`must NOT have ${e==="maxLength"?"more":"fewer"} than ${t} characters`},params:({schemaCode:e})=>fe._`{limit: ${e}}`},bf={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Ef,code(e){let{keyword:t,data:r,schemaCode:n,it:s}=e,o=t==="maxLength"?fe.operators.GT:fe.operators.LT,i=s.opts.unicode===!1?fe._`${r}.length`:fe._`${$f.useFunc(e.gen,vf.default)}(${r})`;e.fail$data(fe._`${i} ${o} ${n}`)}};ko.default=bf});var Ro=ae(function(No){Object.defineProperty(No,"__esModule",{value:!0});var Pf=V(),kf=nn(),be=Rt(),Of={message:({schemaCode:e})=>be.str`must match pattern "${e}"`,params:({schemaCode:e})=>be._`{pattern: ${e}}`},Nf={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Of,code(e){let{gen:t,data:r,$data:n,schema:s,schemaCode:o,it:i}=e,a=i.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=i.opts.code,d=c.code==="new RegExp"?be._`new RegExp`:kf.useFunc(t,c),u=t.let("valid");t.try(()=>t.assign(u,be._`${d}(${o}, ${a}).test(${r})`),()=>t.assign(u,!1)),e.fail$data(be._`!${u}`)}else{let c=Pf.usePattern(e,s);e.fail$data(be._`!${c}.test(${r})`)}}};No.default=Nf});var Io=ae(function(qo){Object.defineProperty(qo,"__esModule",{value:!0});var Fe=Rt(),qf={message({keyword:e,schemaCode:t}){return Fe.str`must NOT have ${e==="maxProperties"?"more":"fewer"} than ${t} properties`},params:({schemaCode:e})=>Fe._`{limit: ${e}}`},If={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:qf,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?Fe.operators.GT:Fe.operators.LT;e.fail$data(Fe._`Object.keys(${r}).length ${s} ${n}`)}};qo.default=If});var jo=ae(function(To){Object.defineProperty(To,"__esModule",{value:!0});var ze=V(),Ve=Rt(),jf=nn(),Cf={message:({params:{missingProperty:e}})=>Ve.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>Ve._`{missingProperty: ${e}}`},Df={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Cf,code(e){let{gen:t,schema:r,schemaCode:n,data:s,$data:o,it:i}=e,{opts:a}=i;if(!o&&r.length===0)return;let c=r.length>=a.loopRequired;if(i.allErrors)d();else u();if(a.strictRequired){let p=e.parentSchema.properties,{definedProperties:h}=e.it;for(let f of r)if((p===null||p===void 0?void 0:p[f])===void 0&&!h.has(f)){let m=i.schemaEnv.baseId+i.errSchemaPath,g=`required property "${f}" is not defined at "${m}" (strictRequired)`;jf.checkStrictMode(i,g,i.opts.strictRequired)}}function d(){if(c||o)e.block$data(Ve.nil,l);else for(let p of r)ze.checkReportMissingProp(e,p)}function u(){let p=t.let("missing");if(c||o){let h=t.let("valid",!0);e.block$data(h,()=>_(p,h)),e.ok(h)}else t.if(ze.checkMissingProp(e,r,p)),ze.reportMissingProp(e,p),t.else()}function l(){t.forOf("prop",n,(p)=>{e.setParams({missingProperty:p}),t.if(ze.noPropertyInData(t,s,p,a.ownProperties),()=>e.error())})}function _(p,h){e.setParams({missingProperty:p}),t.forOf(p,n,()=>{t.assign(h,ze.propertyInData(t,s,p,a.ownProperties)),t.if(Ve.not(h),()=>{e.error(),t.break()})},Ve.nil)}}};To.default=Df});var Do=ae(function(Co){Object.defineProperty(Co,"__esModule",{value:!0});var Ue=Rt(),Mf={message({keyword:e,schemaCode:t}){return Ue.str`must NOT have ${e==="maxItems"?"more":"fewer"} than ${t} items`},params:({schemaCode:e})=>Ue._`{limit: ${e}}`},Ff={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Mf,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?Ue.operators.GT:Ue.operators.LT;e.fail$data(Ue._`${r}.length ${s} ${n}`)}};Co.default=Ff});var gt=ae(function(Mo){Object.defineProperty(Mo,"__esModule",{value:!0});var Ao=Qt();Ao.code='require("ajv/dist/runtime/equal").default';Mo.default=Ao});var Vo=ae(function(Fo){Object.defineProperty(Fo,"__esModule",{value:!0});var yr=Ne(),q=Rt(),Uf=nn(),Kf=gt(),Hf={message:({params:{i:e,j:t}})=>q.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>q._`{i: ${e}, j: ${t}}`},Lf={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Hf,code(e){let{gen:t,data:r,$data:n,schema:s,parentSchema:o,schemaCode:i,it:a}=e;if(!n&&!s)return;let c=t.let("valid"),d=o.items?yr.getSchemaTypes(o.items):[];e.block$data(c,u,q._`${i} === false`),e.ok(c);function u(){let h=t.let("i",q._`${r}.length`),f=t.let("j");e.setParams({i:h,j:f}),t.assign(c,!0),t.if(q._`${h} > 1`,()=>(l()?_:p)(h,f))}function l(){return d.length>0&&!d.some((h)=>h==="object"||h==="array")}function _(h,f){let m=t.name("item"),g=yr.checkDataTypes(d,m,a.opts.strictNumbers,yr.DataType.Wrong),v=t.const("indices",q._`{}`);t.for(q._`;${h}--;`,()=>{if(t.let(m,q._`${r}[${h}]`),t.if(g,q._`continue`),d.length>1)t.if(q._`typeof ${m} == "string"`,q._`${m} += "_"`);t.if(q._`typeof ${v}[${m}] == "number"`,()=>{t.assign(f,q._`${v}[${m}]`),e.error(),t.assign(c,!1).break()}).code(q._`${v}[${m}] = ${h}`)})}function p(h,f){let m=Uf.useFunc(t,Kf.default),g=t.name("outer");t.label(g).for(q._`;${h}--;`,()=>t.for(q._`${f} = ${h}; ${f}--;`,()=>t.if(q._`${m}(${r}[${h}], ${r}[${f}])`,()=>{e.error(),t.assign(c,!1).break(g)})))}}};Fo.default=Lf});var Uo=ae(function(zo){Object.defineProperty(zo,"__esModule",{value:!0});var $r=Rt(),Jf=nn(),Bf=gt(),Wf={message:"must be equal to constant",params:({schemaCode:e})=>$r._`{allowedValue: ${e}}`},Qf={keyword:"const",$data:!0,error:Wf,code(e){let{gen:t,data:r,$data:n,schemaCode:s,schema:o}=e;if(n||o&&typeof o=="object")e.fail$data($r._`!${Jf.useFunc(t,Bf.default)}(${r}, ${s})`);else e.fail($r._`${o} !== ${r}`)}};zo.default=Qf});var Ho=ae(function(Ko){Object.defineProperty(Ko,"__esModule",{value:!0});var Ke=Rt(),Xf=nn(),Yf=gt(),eh={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>Ke._`{allowedValues: ${e}}`},th={keyword:"enum",schemaType:"array",$data:!0,error:eh,code(e){let{gen:t,data:r,$data:n,schema:s,schemaCode:o,it:i}=e;if(!n&&s.length===0)throw Error("enum must have non-empty array");let a=s.length>=i.opts.loopEnum,c,d=()=>c!==null&&c!==void 0?c:c=Xf.useFunc(t,Yf.default),u;if(a||n)u=t.let("valid"),e.block$data(u,l);else{if(!Array.isArray(s))throw Error("ajv implementation error");let p=t.const("vSchema",o);u=Ke.or(...s.map((h,f)=>_(p,f)))}e.pass(u);function l(){t.assign(u,!1),t.forOf("v",o,(p)=>t.if(Ke._`${d()}(${r}, ${p})`,()=>t.assign(u,!0).break()))}function _(p,h){let f=s[h];return typeof f==="object"&&f!==null?Ke._`${d()}(${r}, ${p}[${h}])`:Ke._`${r} === ${f}`}}};Ko.default=th});var c_=ae(function(Lo){Object.defineProperty(Lo,"__esModule",{value:!0});var nh=wo(),sh=bo(),oh=Oo(),ih=Ro(),ah=Io(),ch=jo(),dh=Do(),uh=Vo(),lh=Uo(),fh=Ho(),hh=[nh.default,sh.default,oh.default,ih.default,ah.default,ch.default,dh.default,uh.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},lh.default,fh.default];Lo.default=hh});var wr=ae(function(Jo){Object.defineProperty(Jo,"__esModule",{value:!0});Jo.validateAdditionalItems=void 0;var he=Rt(),vr=nn(),mh={message:({params:{len:e}})=>he.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>he._`{limit: ${e}}`},_h={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:mh,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){vr.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Go(e,n)}};function Go(e,t){let{gen:r,schema:n,data:s,keyword:o,it:i}=e;i.items=!0;let a=r.const("len",he._`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass(he._`${a} <= ${t.length}`);else if(typeof n=="object"&&!vr.alwaysValidSchema(i,n)){let d=r.var("valid",he._`${a} <= ${t.length}`);r.if(he.not(d),()=>c(d)),e.ok(d)}function c(d){r.forRange("i",t.length,a,(u)=>{if(e.subschema({keyword:o,dataProp:u,dataPropType:vr.Type.Num},d),!i.allErrors)r.if(he.not(d),()=>r.break())})}}Jo.validateAdditionalItems=Go;Jo.default=_h});var Er=ae(function(Zo){Object.defineProperty(Zo,"__esModule",{value:!0});Zo.validateTuple=void 0;var Wo=Rt(),yt=nn(),yh=V(),$h={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return Qo(e,"additionalItems",t);if(r.items=!0,yt.alwaysValidSchema(r,t))return;e.ok(yh.validateArray(e))}};function Qo(e,t,r=e.schema){let{gen:n,parentSchema:s,data:o,keyword:i,it:a}=e;if(u(s),a.opts.unevaluated&&r.length&&a.items!==!0)a.items=yt.mergeEvaluated.items(n,r.length,a.items);let c=n.name("valid"),d=n.const("len",Wo._`${o}.length`);r.forEach((l,_)=>{if(yt.alwaysValidSchema(a,l))return;n.if(Wo._`${d} > ${_}`,()=>e.subschema({keyword:i,schemaProp:_,dataProp:_},c)),e.ok(c)});function u(l){let{opts:_,errSchemaPath:p}=a,h=r.length,f=h===l.minItems&&(h===l.maxItems||l[t]===!1);if(_.strictTuples&&!f){let m=`"${i}" is ${h}-tuple, but minItems or maxItems/${t} are not specified or different at path "${p}"`;yt.checkStrictMode(a,m,_.strictTuples)}}}Zo.validateTuple=Qo;Zo.default=$h});var ei=ae(function(Yo){Object.defineProperty(Yo,"__esModule",{value:!0});var wh=Er(),Eh={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>wh.validateTuple(e,"items")};Yo.default=Eh});var ni=ae(function(ri){Object.defineProperty(ri,"__esModule",{value:!0});var ti=Rt(),Sh=nn(),Ph=V(),xh=wr(),kh={message:({params:{len:e}})=>ti.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ti._`{limit: ${e}}`},Oh={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:kh,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;if(n.items=!0,Sh.alwaysValidSchema(n,t))return;if(s)xh.validateAdditionalItems(e,s);else e.ok(Ph.validateArray(e))}};ri.default=Oh});var oi=ae(function(si){Object.defineProperty(si,"__esModule",{value:!0});var z=Rt(),$t=nn(),Rh={message:({params:{min:e,max:t}})=>t===void 0?z.str`must contain at least ${e} valid item(s)`:z.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?z._`{minContains: ${e}}`:z._`{minContains: ${e}, maxContains: ${t}}`},qh={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Rh,code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:o}=e,i,a,{minContains:c,maxContains:d}=n;if(o.opts.next)i=c===void 0?1:c,a=d;else i=1;let u=t.const("len",z._`${s}.length`);if(e.setParams({min:i,max:a}),a===void 0&&i===0){$t.checkStrictMode(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){$t.checkStrictMode(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if($t.alwaysValidSchema(o,r)){let f=z._`${u} >= ${i}`;if(a!==void 0)f=z._`${f} && ${u} <= ${a}`;e.pass(f);return}o.items=!0;let l=t.name("valid");if(a===void 0&&i===1)p(l,()=>t.if(l,()=>t.break()));else if(i===0){if(t.let(l,!0),a!==void 0)t.if(z._`${s}.length > 0`,_)}else t.let(l,!1),_();e.result(l,()=>e.reset());function _(){let f=t.name("_valid"),m=t.let("count",0);p(f,()=>t.if(f,()=>h(m)))}function p(f,m){t.forRange("i",0,u,(g)=>{e.subschema({keyword:"contains",dataProp:g,dataPropType:$t.Type.Num,compositeRule:!0},f),m()})}function h(f){if(t.code(z._`${f}++`),a===void 0)t.if(z._`${f} >= ${i}`,()=>t.assign(l,!0).break());else if(t.if(z._`${f} > ${a}`,()=>t.assign(l,!1).break()),i===1)t.assign(l,!0);else t.if(z._`${f} >= ${i}`,()=>t.assign(l,!0))}}};si.default=qh});var d_=ae(function(ci){Object.defineProperty(ci,"__esModule",{value:!0});ci.validateSchemaDeps=ci.validatePropertyDeps=ci.error=void 0;var br=Rt(),Th=nn(),He=V();ci.error={message:({params:{property:e,depsCount:t,deps:r}})=>br.str`must have ${t===1?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>br._`{property: ${e},
6
- missingProperty: ${n},
7
- depsCount: ${t},
8
- deps: ${r}}`};var jh={keyword:"dependencies",type:"object",schemaType:"object",error:ci.error,code(e){let[t,r]=Ch(e);ii(e,t),ai(e,r)}};function Ch({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let s=Array.isArray(e[n])?t:r;s[n]=e[n]}return[t,r]}function ii(e,t=e.schema){let{gen:r,data:n,it:s}=e;if(Object.keys(t).length===0)return;let o=r.let("missing");for(let i in t){let a=t[i];if(a.length===0)continue;let c=He.propertyInData(r,n,i,s.opts.ownProperties);if(e.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),s.allErrors)r.if(c,()=>{for(let d of a)He.checkReportMissingProp(e,d)});else r.if(br._`${c} && (${He.checkMissingProp(e,a,o)})`),He.reportMissingProp(e,o),r.else()}}ci.validatePropertyDeps=ii;function ai(e,t=e.schema){let{gen:r,data:n,keyword:s,it:o}=e,i=r.name("valid");for(let a in t){if(Th.alwaysValidSchema(o,t[a]))continue;r.if(He.propertyInData(r,n,a,o.opts.ownProperties),()=>{let c=e.subschema({keyword:s,schemaProp:a},i);e.mergeValidEvaluated(c,i)},()=>r.var(i,!0)),e.ok(i)}}ci.validateSchemaDeps=ai;ci.default=jh});var hi=ae(function(fi){Object.defineProperty(fi,"__esModule",{value:!0});var li=Rt(),Mh=nn(),Fh={message:"property name must be valid",params:({params:e})=>li._`{propertyName: ${e.propertyName}}`},Vh={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Fh,code(e){let{gen:t,schema:r,data:n,it:s}=e;if(Mh.alwaysValidSchema(s,r))return;let o=t.name("valid");t.forIn("key",n,(i)=>{e.setParams({propertyName:i}),e.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},o),t.if(li.not(o),()=>{if(e.error(!0),!s.allErrors)t.break()})}),e.ok(o)}};fi.default=Vh});var Sr=ae(function(pi){Object.defineProperty(pi,"__esModule",{value:!0});var vt=V(),G=Rt(),Uh=kl(),wt=nn(),Kh={message:"must NOT have additional properties",params:({params:e})=>G._`{additionalProperty: ${e.additionalProperty}}`},Hh={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Kh,code(e){let{gen:t,schema:r,parentSchema:n,data:s,errsCount:o,it:i}=e;if(!o)throw Error("ajv implementation error");let{allErrors:a,opts:c}=i;if(i.props=!0,c.removeAdditional!=="all"&&wt.alwaysValidSchema(i,r))return;let d=vt.allSchemaProperties(n.properties),u=vt.allSchemaProperties(n.patternProperties);l(),e.ok(G._`${o} === ${Uh.default.errors}`);function l(){t.forIn("key",s,(m)=>{if(!d.length&&!u.length)h(m);else t.if(_(m),()=>h(m))})}function _(m){let g;if(d.length>8){let v=wt.schemaRefOrVal(i,n.properties,"properties");g=vt.isOwnProperty(t,v,m)}else if(d.length)g=G.or(...d.map((v)=>G._`${m} === ${v}`));else g=G.nil;if(u.length)g=G.or(g,...u.map((v)=>G._`${vt.usePattern(e,v)}.test(${m})`));return G.not(g)}function p(m){t.code(G._`delete ${s}[${m}]`)}function h(m){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){p(m);return}if(r===!1){if(e.setParams({additionalProperty:m}),e.error(),!a)t.break();return}if(typeof r=="object"&&!wt.alwaysValidSchema(i,r)){let g=t.name("valid");if(c.removeAdditional==="failing")f(m,g,!1),t.if(G.not(g),()=>{e.reset(),p(m)});else if(f(m,g),!a)t.if(G.not(g),()=>t.break())}}function f(m,g,v){let S={keyword:"additionalProperties",dataProp:m,dataPropType:wt.Type.Str};if(v===!1)Object.assign(S,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(S,g)}}};pi.default=Hh});var yi=ae(function(gi){Object.defineProperty(gi,"__esModule",{value:!0});var Gh=wf(),_i=V(),Pr=nn(),mi=Sr(),Jh={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:o}=e;if(o.opts.removeAdditional==="all"&&n.additionalProperties===void 0)mi.default.code(new Gh.KeywordCxt(o,mi.default,"additionalProperties"));let i=_i.allSchemaProperties(r);for(let l of i)o.definedProperties.add(l);if(o.opts.unevaluated&&i.length&&o.props!==!0)o.props=Pr.mergeEvaluated.props(t,Pr.toHash(i),o.props);let a=i.filter((l)=>!Pr.alwaysValidSchema(o,r[l]));if(a.length===0)return;let c=t.name("valid");for(let l of a){if(d(l))u(l);else{if(t.if(_i.propertyInData(t,s,l,o.opts.ownProperties)),u(l),!o.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(l),e.ok(c)}function d(l){return o.opts.useDefaults&&!o.compositeRule&&r[l].default!==void 0}function u(l){e.subschema({keyword:"properties",schemaProp:l,dataProp:l},c)}}};gi.default=Jh});var bi=ae(function(Ei){Object.defineProperty(Ei,"__esModule",{value:!0});var $i=V(),Et=Rt(),vi=nn(),wi=nn(),Wh={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:s,it:o}=e,{opts:i}=o,a=$i.allSchemaProperties(r),c=a.filter((f)=>vi.alwaysValidSchema(o,r[f]));if(a.length===0||c.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let d=i.strictSchema&&!i.allowMatchingProperties&&s.properties,u=t.name("valid");if(o.props!==!0&&!(o.props instanceof Et.Name))o.props=wi.evaluatedPropsToName(t,o.props);let{props:l}=o;_();function _(){for(let f of a){if(d)p(f);if(o.allErrors)h(f);else t.var(u,!0),h(f),t.if(u)}}function p(f){for(let m in d)if(new RegExp(f).test(m))vi.checkStrictMode(o,`property ${m} matches pattern ${f} (use allowMatchingProperties)`)}function h(f){t.forIn("key",n,(m)=>{t.if(Et._`${$i.usePattern(e,f)}.test(${m})`,()=>{let g=c.includes(f);if(!g)e.subschema({keyword:"patternProperties",schemaProp:f,dataProp:m,dataPropType:wi.Type.Str},u);if(o.opts.unevaluated&&l!==!0)t.assign(Et._`${l}[${m}]`,!0);else if(!g&&!o.allErrors)t.if(Et.not(u),()=>t.break())})})}}};Ei.default=Wh});var Pi=ae(function(Si){Object.defineProperty(Si,"__esModule",{value:!0});var Zh=nn(),Xh={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if(Zh.alwaysValidSchema(n,r)){e.fail();return}let s=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Si.default=Xh});var ki=ae(function(xi){Object.defineProperty(xi,"__esModule",{value:!0});var ep=V(),tp={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ep.validateUnion,error:{message:"must match a schema in anyOf"}};xi.default=tp});var Ni=ae(function(Oi){Object.defineProperty(Oi,"__esModule",{value:!0});var bt=Rt(),np=nn(),sp={message:"must match exactly one schema in oneOf",params:({params:e})=>bt._`{passingSchemas: ${e.passing}}`},op={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:sp,code(e){let{gen:t,schema:r,parentSchema:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let o=r,i=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(d),e.result(i,()=>e.reset(),()=>e.error(!0));function d(){o.forEach((u,l)=>{let _;if(np.alwaysValidSchema(s,u))t.var(c,!0);else _=e.subschema({keyword:"oneOf",schemaProp:l,compositeRule:!0},c);if(l>0)t.if(bt._`${c} && ${i}`).assign(i,!1).assign(a,bt._`[${a}, ${l}]`).else();t.if(c,()=>{if(t.assign(i,!0),t.assign(a,l),_)e.mergeEvaluated(_,bt.Name)})})}}};Oi.default=op});var qi=ae(function(Ri){Object.defineProperty(Ri,"__esModule",{value:!0});var ap=nn(),cp={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let s=t.name("valid");r.forEach((o,i)=>{if(ap.alwaysValidSchema(n,o))return;let a=e.subschema({keyword:"allOf",schemaProp:i},s);e.ok(s),e.mergeEvaluated(a)})}};Ri.default=cp});var Ci=ae(function(ji){Object.defineProperty(ji,"__esModule",{value:!0});var St=Rt(),Ti=nn(),up={message:({params:e})=>St.str`must match "${e.ifClause}" schema`,params:({params:e})=>St._`{failingKeyword: ${e.ifClause}}`},lp={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:up,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)Ti.checkStrictMode(n,'"if" without "then" and "else" is ignored');let s=Ii(n,"then"),o=Ii(n,"else");if(!s&&!o)return;let i=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),s&&o){let u=t.let("ifClause");e.setParams({ifClause:u}),t.if(a,d("then",u),d("else",u))}else if(s)t.if(a,d("then"));else t.if(St.not(a),d("else"));e.pass(i,()=>e.error(!0));function c(){let u=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(u)}function d(u,l){return()=>{let _=e.subschema({keyword:u},a);if(t.assign(i,a),e.mergeValidEvaluated(_,i),l)t.assign(l,St._`${u}`);else e.setParams({ifClause:u})}}}};function Ii(e,t){let r=e.schema[t];return r!==void 0&&!Ti.alwaysValidSchema(e,r)}ji.default=lp});var Ai=ae(function(Di){Object.defineProperty(Di,"__esModule",{value:!0});var hp=nn(),pp={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)hp.checkStrictMode(r,`"${e}" without "if" is ignored`)}};Di.default=pp});var u_=ae(function(Mi){Object.defineProperty(Mi,"__esModule",{value:!0});var _p=wr(),gp=ei(),yp=Er(),$p=ni(),vp=oi(),wp=d_(),Ep=hi(),bp=Sr(),Sp=yi(),Pp=bi(),xp=Pi(),kp=ki(),Op=Ni(),Np=qi(),Rp=Ci(),qp=Ai();function Ip(e=!1){let t=[xp.default,kp.default,Op.default,Np.default,Rp.default,qp.default,Ep.default,bp.default,wp.default,Sp.default,Pp.default];if(e)t.push(gp.default,$p.default);else t.push(_p.default,yp.default);return t.push(vp.default),t}Mi.default=Ip});var Vi=ae(function(Fi){Object.defineProperty(Fi,"__esModule",{value:!0});var R=Rt(),jp={message:({schemaCode:e})=>R.str`must match format "${e}"`,params:({schemaCode:e})=>R._`{format: ${e}}`},Cp={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:jp,code(e,t){let{gen:r,data:n,$data:s,schema:o,schemaCode:i,it:a}=e,{opts:c,errSchemaPath:d,schemaEnv:u,self:l}=a;if(!c.validateFormats)return;if(s)_();else p();function _(){let h=r.scopeValue("formats",{ref:l.formats,code:c.code.formats}),f=r.const("fDef",R._`${h}[${i}]`),m=r.let("fType"),g=r.let("format");r.if(R._`typeof ${f} == "object" && !(${f} instanceof RegExp)`,()=>r.assign(m,R._`${f}.type || "string"`).assign(g,R._`${f}.validate`),()=>r.assign(m,R._`"string"`).assign(g,f)),e.fail$data(R.or(v(),S()));function v(){if(c.strictSchema===!1)return R.nil;return R._`${i} && !${g}`}function S(){let k=u.$async?R._`(${f}.async ? await ${g}(${n}) : ${g}(${n}))`:R._`${g}(${n})`,E=R._`(typeof ${g} == "function" ? ${k} : ${g}.test(${n}))`;return R._`${g} && ${g} !== true && ${m} === ${t} && !${E}`}}function p(){let h=l.formats[o];if(!h){v();return}if(h===!0)return;let[f,m,g]=S(h);if(f===t)e.pass(k());function v(){if(c.strictSchema===!1){l.logger.warn(E());return}throw Error(E());function E(){return`unknown format "${o}" ignored in schema at path "${d}"`}}function S(E){let J=E instanceof RegExp?R.regexpCode(E):c.code.formats?R._`${c.code.formats}${R.getProperty(o)}`:void 0,W=r.scopeValue("formats",{key:o,ref:E,code:J});if(typeof E=="object"&&!(E instanceof RegExp))return[E.type||"string",E.validate,R._`${W}.validate`];return["string",E,W]}function k(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!u.$async)throw Error("async format in sync schema");return R._`await ${g}(${n})`}return typeof m=="function"?R._`${g}(${n})`:R._`${g}.test(${n})`}}}};Fi.default=Cp});var h_=ae(function(zi){Object.defineProperty(zi,"__esModule",{value:!0});var Ap=Vi(),Mp=[Ap.default];zi.default=Mp});var p_=ae(function(Ui){Object.defineProperty(Ui,"__esModule",{value:!0});Ui.contentVocabulary=Ui.metadataVocabulary=void 0;Ui.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Ui.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});
9
- export{Rt,nn,kl,wf,Og,xf,Hy,s_,a_,l_,c_,d_,u_,h_,p_,f_};
10
-
11
- //# debugId=8F3D751FB563E20464756E2164756E21
12
- //# sourceMappingURL=studio-hjbg8d5y.js.map
@@ -1,5 +0,0 @@
1
- function nt(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Ot(e){return nt(e)&&typeof e.$ref==="string"}function Za(e){return nt(e)&&e.$prototype==="Function"}function ba(e){return nt(e)&&nt(e.$expression)}function Mv(e){return ba(e)&&Array.isArray(e.parameters)&&e.parameters.length>0}function Tk(e){return Za(e)&&Array.isArray(e.body)}function Lk(e){return nt(e)&&typeof e.$prototype==="string"&&e.$prototype!=="Function"}function Ik(e){return nt(e)&&e.timing==="server"&&typeof e.$src==="string"&&typeof e.$export==="string"&&!e.$prototype}function Vx(e){return nt(e)&&e.$prototype==="Array"}function Ks(e){return typeof e==="string"&&e.includes("${")}function Rk(e){return/\breturn\b[^\S\n]*(?![;}\s]|$)/.test(e)}function ih(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function va(e,n){let t=e?.[n];return ih(t)?t:void 0}function oh(e,n){let t=e[n];if(ih(t))return t;let r={};return e[n]=r,r}function rh(e){return Ot(e)||Za(e)||ba(e)}function Op(e,n){let t=e[n];return rh(t)?t:void 0}function Pv(e){if(!e)return[];return e.map((n)=>typeof n==="string"?n:n.name)}function Hd(e){if(!nt(e)||!nt(e.$expression))return!1;let n=e.$expression;if(n.operator==="?:")return typeof n.value==="string"&&typeof n.initial==="string";if(n.operator==="switch")return nt(n.cases)&&Object.values(n.cases).every((t)=>typeof t==="string")&&typeof n.default==="string";return!1}function $k(e){if(typeof e==="string")return[e];if(!Hd(e))return[];let n=e.$expression;if(n.operator==="?:")return[...new Set([n.value,n.initial])];return[...new Set([...Object.values(n.cases),n.default])]}function qe(e){return typeof e==="string"?e:$k(e).join("|")}function Mp(e){return e.startsWith("#")}
2
- export{nt,Ot,Za,ba,Mv,Tk,Lk,Ik,Vx,Ks,Rk,ih,va,oh,rh,Op,Pv,Hd,$k,qe,Mp};
3
-
4
- //# debugId=DBCFD34E007C461F64756E2164756E21
5
- //# sourceMappingURL=studio-nbxqcgvf.js.map
@@ -1,4 +0,0 @@
1
- var e=new Map,r=new Set;function o(){for(let t of r)t()}function ja(){o()}function db(t){return r.add(t),()=>{r.delete(t)}}function cs(t){e.set(t.key,t),o()}function x1(t){if(e.delete(t))o()}function Vf(){return[...e.values()].toSorted((t,s)=>t.order-s.order)}function Lw(){return Vf().map((t)=>t.key)}function Iw(t){return e.get(t)}var i=null,n="overview";function ub(){if(i!==null&&e.has(i))return n=i,i=null,n;if(e.has(n))return n;return Lw()[0]??n}function hb(t){if(e.has(t))n=t,i=null;else i=t;o()}export{ja,db,cs,x1,Vf,Lw,Iw,ub,hb};
2
-
3
- //# debugId=2A602E1D78BE302464756E2164756E21
4
- //# sourceMappingURL=studio-t1eedsyx.js.map
@@ -1,5 +0,0 @@
1
- function Oe(e){return e.getBoundingClientRect()}function Rv(e,t,n=document){return n.elementFromPoint(e,t)}
2
- export{Oe,Rv};
3
-
4
- //# debugId=07973ACE60D252EA64756E2164756E21
5
- //# sourceMappingURL=studio-vavmwshr.js.map
@@ -1,5 +0,0 @@
1
- import{ge,Xa,Q,v,re,zd,k}from"./studio-fqq890ap.js";import{kp}from"./studio-7pgy3xaf.js";import{p}from"./studio-y7jehjrp.js";import{wi,Zt,Dr}from"./studio-cqmtbg2p.js";import{K,Lm,ht,_n,Yo,qa,D}from"./studio-tp642n5g.js";import{Ae,Ic,Im,lk}from"./studio-evwgp1ym.js";import{va,oh,rh}from"./studio-nbxqcgvf.js";import{me}from"./studio-0bbxhhce.js";function vm(e,t){return{success:!0,data:e,summary:t}}function zi(e){return{success:!1,error:e}}function Ki({name:e,description:t,parameters:n,strict:o=!0,llmStrict:r=!1,interactive:i,execute:s}){return{name:e,description:t,parameters:n,strict:o,llmStrict:r,...i===void 0?{}:{interactive:i},execute:s}}function av(e){let t=[];return{record(n){t.push(n),e?.(n)},writes:t}}function Dd(e=null,t={}){let n=new Map(Object.entries(t));return{sessionId:e,get:(o)=>n.get(o),set:(o,r)=>{n.set(o,r)},toJSON:()=>Object.fromEntries(n)}}var Ot=new AbortController().signal;function lv(e={}){let t=e.session??Dd();return{actor:e.actor??{id:`assistant:${t.sessionId??"local"}:`,kind:"assistant",sessionId:t.sessionId,turnId:""},callId:e.callId??"",ledger:e.ledger??av(),progress:e.progress??(()=>{}),session:t,signal:e.signal??Ot}}function wL(e){let t=new AbortController;if(e.aborted)return t.abort(e.reason),{release:()=>{},signal:t.signal};let n=()=>{t.abort(e.reason)};return e.addEventListener("abort",n,{once:!0}),{release:()=>{e.removeEventListener("abort",n)},signal:t.signal}}function zC(){let e=new Map;return{register(t){if(e.has(t.name))console.warn(`Tool "${t.name}" is being re-registered.`);e.set(t.name,t)},list(){return[...e.values()]},listForLLM(){return[...e.values()].map((t)=>({type:"function",function:{name:t.name,description:t.description,parameters:t.parameters,...t.llmStrict===!0?{strict:!0}:{}}}))},getDefinition(t){return e.get(t)},validate(t,n){let o=e.get(t);if(!o)return{valid:!1,errors:[`Unknown tool: "${t}"`]};if(!o.strict)return{valid:!0};let r=o.parameters;if(!r||!r.properties)return{valid:!0};let i=[],s=r.properties,a=r.required||[],l=n;for(let c of a)if(!(c in n)||l[c]===void 0||l[c]===null)i.push(`Missing required argument: "${c}"`);for(let[c,d]of Object.entries(l)){let g=s[c];if(!g)continue;let y=g.type;if(!y)continue;let b=Array.isArray(d)?"array":typeof d;if(y==="number"||y==="integer"){if(b==="number")continue;if(b==="string"){if(!Number.isNaN(Number(d)))continue;i.push(`Argument "${c}" should be a number, got non-numeric string "${d}"`);continue}i.push(`Argument "${c}" should be a number, got ${b}`);continue}if(y==="string"&&b!=="string")i.push(`Argument "${c}" should be a string, got ${b}`);else if(y==="boolean"&&b!=="boolean")i.push(`Argument "${c}" should be a boolean, got ${b}`);else if(y==="array"&&b!=="array")i.push(`Argument "${c}" should be an array, got ${b}`);else if(y==="object"&&b!=="object")i.push(`Argument "${c}" should be an object, got ${b}`)}return i.length>0?{valid:!1,errors:i}:{valid:!0}},async execute(t,n,o=lv()){let r=e.get(t);if(!r)return zi(`Unknown tool: "${t}"`);let i=this.validate(t,n);if(!i.valid)return zi(`Validation failed: ${(i.errors||[]).join("; ")}`);try{return await r.execute(n,o)}catch(s){return zi(`Tool "${t}" execution error: ${s.message}`)}}}}function wt(e){return JSON.parse(JSON.stringify(e))}function St(e){if(!e)return{};let t=JSON.parse(e);if(t===null||typeof t!=="object"||Array.isArray(t)){let n=t===null?"null":Array.isArray(t)?"array":typeof t;throw TypeError(`arguments must be a JSON object, got ${n}`)}return t}async function xL(e,t,n){let o=!1,r;try{let i=St(t.argumentsText);o=!0,r=await e.execute(t.name,i,n)}catch(i){r=zi(`Failed to parse arguments: ${i.message}`)}try{return{status:"done",result:wt(r),executed:o}}catch(i){let s=i.message;return{status:"done",result:zi(`Tool "${t.name}" returned a result that cannot be serialized: ${s}`),executed:o}}}var F=[],Ct=50;function _L(e){return Object.assign(av(),{turnId:e})}function CL(e,t){if(t.length===0)return[];let n={id:e,writes:[...t]};F.push(n);while(F.length>Ct)F.shift();return n.writes}function Tx(e){return F.find((t)=>t.id===e)?.writes??[]}function kL(e){let t=e.filter((a)=>a.ok),n=new Set(t.map((a)=>a.path)),o=e.length-t.length;if(n.size===0)return o>0?`${o} change${o===1?"":"s"} failed`:"";let r=`Changed ${n.size} file${n.size===1?"":"s"}`,i=new Set(t.filter((a)=>a.disk).map((a)=>a.path)),s=[r];if(i.size>0)s.push(`${i.size} written to disk — undo cannot reach ${i.size===1?"it":"them"}`);if(o>0)s.push(`${o} failed`);return s.join(" · ")}function Lx(){F.splice(0)}function SL(e,t){let n=null;for(let o=e.length-1;o>=0;o--){let r=e[o];if(r.id===t)return n;let i=r.role==="assistant"&&(r.content||(r.toolCalls?.length??0)>0);if(n===null&&i)n=r.id}return t===void 0?n:null}var Rt=new Set(["Adlm","Arab","Aran","Armi","Avst","Cprt","Egyd","Egyh","Elym","Gara","Hatr","Hebr","Hluw","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogd","Sogo","Syrc","Thaa","Todr","Yezi"]),Sx="^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$";function Go(e){if(typeof e!=="string"||e.trim()==="")return null;try{return new Intl.Locale(e.trim()).toString()}catch{return null}}function iv(e){return Go(e)!==null}function gL(e){let t=Go(e);if(t===null)return"ltr";let n=new Intl.Locale(t),o=n.script??n.maximize().script;return o!==void 0&&Rt.has(o)?"rtl":"ltr"}function dn(e){let t=Go(e);if(t===null)return typeof e==="string"?e:"";return new Intl.DisplayNames([t],{type:"language"}).of(t)??t}var At="prefix-except-default";function $o(e){let t=e.i18n,n=[];if(!t||typeof t!=="object")return{errors:n,i18n:null};let o=Array.isArray(t.locales)?t.locales:[],r=[];for(let a of o){let l=Go(a);if(l===null){n.push(`i18n.locales: "${String(a)}" is not a well-formed BCP 47 language tag.`);continue}if(!r.includes(l))r.push(l)}let i=Go(t.defaultLocale)??r[0]??null;if(t.defaultLocale!==void 0&&Go(t.defaultLocale)===null)n.push(`i18n.defaultLocale: "${String(t.defaultLocale)}" is not a well-formed BCP 47 language tag.`);if(i===null)return n.push("i18n is declared with no usable locale — set `defaultLocale` or `locales`."),{errors:n,i18n:null};if(!r.includes(i))r.unshift(i);let s=t.routing==="prefix-always"||t.routing==="prefix-except-default"?t.routing:At;return{errors:n,i18n:{defaultLocale:i,locales:r,routing:s}}}function zu(e,t){let n=se(W(e),t);if(n===-1||t===null)return null;return Go(W(e)[n])}function bL(e,t){let n=zu(e,t);if(n!==null||t===null||t.routing!=="prefix-except-default")return n;return W(e)[0]==="pages"?t.defaultLocale:null}function BC(e,t){let n=W(e),o=se(n,t);return o===-1?n.join("/"):n.filter((r,i)=>i!==o).join("/")}function Wu(e,t,n){if(n===null)return null;let o=Go(t);if(o===null||!n.locales.includes(o))return null;let r=W(e),i=se(r,n),s=i===-1?kt(r):i;if(s===-1)return null;let a=i===-1?r:r.filter((l,c)=>c!==i);if(o===n.defaultLocale&&n.routing==="prefix-except-default")return a.join("/");return a.toSpliced(s,0,o.toLowerCase()).join("/")}function W(e){return e.replace(/^\.\//,"").split("/").filter(Boolean)}function se(e,t){if(t===null)return-1;return e.findIndex((n)=>{let o=Go(n);return o!==null&&t.locales.includes(o)})}function kt(e){if(e[0]==="pages"&&e.length>1)return 1;if(e[0]==="content"&&e.length>2)return 2;return-1}var Dx="{locale}";function Re(e){return e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}function B(e){return e.replaceAll("\\","/").replace(/^\.\//,"").replace(/\/+$/,"")}function ke(e){return e??D?.projectConfig??null}function Je(e){return e?.content??{}}function Jt(e){let t=$o(e??{}).i18n?.locales??[];return t.length>0?[...t]:null}function je(e){if(e.endsWith("/"))return!1;let t=e.slice(e.lastIndexOf("/")+1);return/\.[a-z\d]+$/i.test(t)}function Ie(e){if(e.format==="json")return{ext:".json",unresolvedFormat:null};if(e.format===void 0||e.format==="")return{ext:Dr()?.extensions[0]??".json",unresolvedFormat:null};let t=wi(e.format);return t?.extensions[0]===void 0?{ext:null,unresolvedFormat:e.format}:{ext:t.extensions[0],unresolvedFormat:null}}function jt(e,t){let n=t===null?"[^/]+":`(?:${t.map((r)=>Re(r)).join("|")})`,o=B(e).split(Dx).map((r)=>Re(r)).join(n);return new RegExp(`^${o}(?:/|$)`,"i")}function It(e,t,n){let o=jt(e,n).exec(t);if(!o)return null;return o[0].replace(/\/$/,"")}function Dt(e){return B(e).replaceAll(Dx,"").length}function bp(e,t){if(e===null||e===void 0||e==="")return null;let n=ke(t),o=Jt(n),r=B(e),i=null,s=-1;for(let[a,l]of Object.entries(Je(n))){let{source:c}=l;if(c===void 0||c===""||je(c))continue;let d=Dt(c);if(d<=s)continue;let g=It(c,r,o);if(g===null)continue;i={def:l,dir:r,fileBacked:!1,isSourceRoot:r.length===g.length,name:a,...Ie(l)},s=d}return i}function Ax(e,t){if(e===null||e===void 0||e==="")return null;let n=ke(t),o=B(e),r=o.toLowerCase();for(let[i,s]of Object.entries(Je(n))){let{source:a}=s;if(a===void 0||a===""||!je(a))continue;let l=B(a).toLowerCase();if(r===l||r.endsWith(`/${l}`))return{def:s,dir:o.includes("/")?o.slice(0,o.lastIndexOf("/")):".",fileBacked:!0,isSourceRoot:!1,name:i,...Ie(s)}}return bp(o.includes("/")?o.slice(0,o.lastIndexOf("/")):".",n)}function Ml(e){return e.replaceAll(/([A-Z])/g," $1").replace(/^./,(t)=>t.toUpperCase())}function xv(e){return e.replaceAll(/[^a-zA-Z0-9]+(.)?/g,(t,n)=>n?n.toUpperCase():"").replace(/^[A-Z]/,(t)=>t.toLowerCase())}function _v(e){return e.replaceAll(/(^|-)(\w)/g,(t,n,o)=>(n?" ":"")+o.toUpperCase())}function Nx(e,t){return e?.$label||Ml(t)}function KL(e,t){if(e?.$label)return e.$label;if(t.includes("-"))return t.replaceAll(/(^|-)(\w)/g,(n,o,r)=>(o?" ":"")+r.toUpperCase());return Ml(t)}function ma(e){return e==="image"||e==="uri-reference"}function Ad(e){if(e.$shorthand===!0)return"shorthand";if(e.$input==="button-group")return"button-group";if(e.$input==="media")return"media";if(e.format==="color")return"color";if(ma(e.format))return"media";if(e.$units!==void 0)return"number-unit";if(e.type==="number")return"number";if(Array.isArray(e.enum))return"select";if(Array.isArray(e.examples)||Array.isArray(e.presets))return"combobox";return"text"}function qu(e,t){if(!e||!t?.content)return null;let n=Ax(e,t);if(!n||!n.def.schema)return null;if(!n.fileBacked){let o=n.ext??Dr()?.extensions[0]??".json";if(!e.toLowerCase().endsWith(o.toLowerCase()))return null}return{name:n.name,schema:n.def.schema}}function xm(e,t){let n=e.trim().toLowerCase().replaceAll(/[^a-z0-9\s-]/g,"").replaceAll(/\s+/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,"");if(!n)return"";return`${t}${n}`}function Cv(e,t){return e.replace(new RegExp(`^${t.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}`),"").replace(/^--/,"").replaceAll("-"," ").replaceAll(/\b\w/g,(n)=>n.toUpperCase())||e}function JL(e){if(!e)return{kind:"text"};let t=e.trim().replaceAll(/\s*\|\s*undefined\b/g,"").trim();if(t==="boolean")return{kind:"boolean"};if(t==="number")return{kind:"number"};if(t.match(/^'[^']*'(\s*\|\s*'[^']*')+$/))return{kind:"combobox",options:[...t.matchAll(/'([^']*)'/g)].map((r)=>r[1])};return{kind:"text"}}function Ao(e){return JSON.parse(JSON.stringify(e))}function Le(e){return e&&e.length>0?e.at(-1):null}function LL(e){return e&&e.length>0?e[0]:null}function dv(e,t){if(!t||!e)return!1;return e.some((n)=>Yo(n,t))}function ms(e){return E(e)}function E(e){let t=[];for(let n of e)t.push([...n]);return t}function uv(e,t){if(dv(e,t))return E(e.filter((n)=>!Yo(n,t)));return[...E(e),[...t]]}function IL(e,t,n){let o=e.findIndex((s)=>Yo(s,n)),r=t?e.findIndex((s)=>Yo(s,t)):-1;if(o===-1||r===-1)return[[...n]];let i=r<=o?e.slice(r,o+1):e.slice(o,r+1).toReversed();return E(i)}function De(e,t){return E(e.filter((n)=>!qa(t,n)))}function Et(e,t){let n=Math.min(e.length,t.length);for(let o=0;o<n;o++){let r=e[o],i=t[o];if(r===i)continue;if(typeof r==="number"&&typeof i==="number")return r-i;return String(r)<String(i)?-1:1}return e.length-t.length}function Lt(e){return E(e.filter((t)=>!e.some((n)=>!Yo(n,t)&&qa(n,t))))}function Nl(e){return e.at(-2)==="children"&&typeof e.at(-1)==="number"}function hv(e){return Lt(e).filter((t)=>Nl(t)).toSorted((t,n)=>Et(n,t))}function RL(e){let t=[];for(let n of e)if(!t.some((o)=>Yo(o,n)))t.push([...n]);return t}function mp(e){if(e.length===0)return{mixed:!1,value:void 0};let t=e[0],n=JSON.stringify(t??null);for(let o=1;o<e.length;o++)if(JSON.stringify(e[o]??null)!==n)return{mixed:!0,value:void 0};return{mixed:!1,value:t}}var Ee=null;function $L(e){Ee=e}function Me(){return Ee}var V=null,U=null,G=null,ae=!0;function $e(){V=[],U=[],G=[],ae=!0}function f(e){if(V)V.push(e)}function vi(e){if(U)U.push(e)}function Ne(e){if(G)G.push(e)}function _e(){let e={docOps:U??[],fmOps:G??[],invertible:ae,ops:V??[]};return V=null,U=null,G=null,ae=!0,e}var Fe=100,Mt=20;function H(){try{return typeof localStorage>"u"||!localStorage.getItem("jx-legacy-history")}catch{return!0}}function P(e,t,n,o){return{forward:{key:t,op:"set-key",path:e,value:o},inverse:{key:t,op:"set-key",path:e,value:n}}}function $t(e,t,n,o,r){let i=e.length;if(!(i<t.length&&e.every((c,d)=>c===t[d]))||t[i]!=="children"||typeof t[i+1]!=="number")return t;let a=t[i+1];if(r?a<n:a<=n)return t;let l=[...t];return l[i+1]=a+o,l}var We=null;function Be(e){We=e}var Ve=null;function Ke(e){Ve=e}function Nt(e,t,n,o){for(let r=t.docOps.length-1;r>=0;r--)Im(e.doc.document,re(t.docOps[r].inverse));for(let r=t.fmOps.length-1;r>=0;r--){let i=t.fmOps[r];de(e,i.field,i.before)}e.doc.document={...re(e.doc.document)},e.session.selection=n,e.doc.dirty=o}function q(e,t,{skipHistory:n=!1,origin:o="user",coalesceKey:r=null}={}){if(!e)return!1;if(o!=="remote"&&Ve?.(e,o))return!1;let i=ms(e.session.selection),s=e.doc.dirty;$e();let a,l=null;try{t(e)}catch(b){l={error:b}}finally{a=_e()}if(l)throw Nt(e,a,i,s),l.error;let c=re(e.doc.document),d={...c},g=Me(),y=g===null?{patchable:!1,reason:"no-patch-consumer"}:a.ops.length===0?{patchable:!1,reason:"unrecorded-mutation"}:g.classify(e,a.ops);if(y.patchable)g.markConsumed(d,e);if(e.doc.document=d,y.patchable)try{g.apply(e,a.ops,a)}catch(b){g.escalate(`patch-apply-failed: ${b instanceof Error?b.message:String(b)}`,e)}if(!n&&!L)_t(e,c,a,i,r);return e.doc.dirty=!0,We?.(e,a,o),!0}function _t(e,t,n,o,r=null){let i=e.history.snapshots.slice(0,e.history.index+1),s=H()&&n.invertible&&(n.docOps.length>0||n.fmOps.length>0),a=i.at(-1);if(r&&s&&a&&a.coalesceKey===r&&a.inverseOps){if(a.forwardOps=[...a.forwardOps??[],...n.docOps.map((c)=>c.forward)],a.inverseOps=[...a.inverseOps,...n.docOps.map((c)=>c.inverse)],a.selection=ms(e.session.selection),a.document)a.document=Ao(t);e.history.snapshots=i,e.history.index=i.length-1;return}let l=!s||i.length%Mt===0;if(i.push({document:l?Ao(t):null,fmOps:s&&n.fmOps.length>0?n.fmOps:null,forwardOps:s?n.docOps.map((c)=>c.forward):null,inverseOps:s?n.docOps.map((c)=>c.inverse):null,coalesceKey:r,selection:ms(e.session.selection),selectionBefore:o}),i.length>Fe){if(!i[1].document)i[1].document=le(i,1);i.shift()}e.history.snapshots=i,e.history.index=i.length-1}function le(e,t){let n=t;while(n>=0&&!e[n].document)n-=1;if(n<0)throw Error("history-missing-checkpoint");let o=Ao(e[n].document);for(let r=n+1;r<=t;r++)for(let i of e[r].forwardOps??[])Im(o,i);return o}function Hs(e,t,n){return q(e,(o)=>t(o.doc.document),n)}function ce(e,t){q(e,(n)=>{for(let o of t)ue(n,o)},{origin:"remote",skipHistory:!0})}var Ft=new Set(["state","$media","$head","$elements","imports","$layout"]);function ue(e,t){let n=t.op==="set-key"?K(e.doc.document,t.path)?.[t.key]:null;switch(Im(e.doc.document,t),vi({forward:t,inverse:t}),t.op){case"set-key":{if(Ft.has(t.key))f({key:t.key,op:"doc-meta"});else if(t.key==="style")f({op:"set-style",path:t.path});else if(t.key==="textContent")f({op:"set-text",path:t.path});else if(t.key==="attributes"||t.key==="cases"||t.key==="$props")f({op:"replace",path:t.path});else{let o=t.key.startsWith("on")&&(rh(t.value)||rh(n));f({isEvent:o,key:t.key,op:"set-prop",path:t.path})}return}case"insert-child":{f({index:t.index,op:"insert",parentPath:t.parentPath});return}case"remove-child":{f({op:"remove",path:[...t.parentPath,"children",t.index]});return}case"set-child":{f({op:"replace",path:[...t.parentPath,"children",t.index]});return}case"move-child":{f({fromPath:[...t.fromParentPath,"children",t.fromIndex],op:"move",toIndex:t.toIndex,toParentPath:t.toParentPath});break}default:break}}var L=null,Ge=null;function qe(e){Ge=e}function pv(e){L=e}function fv(){let e=L;if(e&&!j.has(e)){let t=re(e.doc.document),n={document:Ao(t),selection:ms(e.session.selection)},o=e.history.snapshots.slice(0,e.history.index+1);if(o.push(n),o.length>Fe)o.shift();e.history.snapshots=o,e.history.index=o.length-1}if(L=null,e)Ge?.(e)}function Ix(){return L!==null}function DL(){return L}var j=new WeakMap;function ym(e,t){if(t)j.set(e,t);else j.delete(e)}function AL(e){let t=j.get(e);return t?t.canUndo(e):e.history.index>0}function NL(e){let t=j.get(e);return t?t.canRedo(e):e.history.index<e.history.snapshots.length-1}function ze(e,t){let{snapshots:n}=e.history;e.doc.document=le(n,t);let o=n[t];e.session.selection=ms(re(o.selection))}function Ye(e,t){try{if(typeof localStorage>"u"||!localStorage.getItem("jx-canvas-debug"))return}catch{return}let n=JSON.stringify(le(e.history.snapshots,t)),o=JSON.stringify(Ao(re(e.doc.document)));if(n!==o)console.error("jx history: ops-based undo/redo diverged from checkpoint replay",{index:t})}function Rx(e){let t=j.get(e);if(t){t.undo(e);return}if(e.history.index<=0)return;let n=e.history.snapshots[e.history.index],o=H()?n.inverseOps:null,r=H()?n.fmOps:null;if(o&&o.length>0||r&&r.length>0){if(!q(e,(s)=>{if(o)for(let a=o.length-1;a>=0;a--)ue(s,re(o[a]));if(r)for(let a=r.length-1;a>=0;a--){let l=re(r[a]);de(s,l.field,l.before)}},{origin:"history",skipHistory:!0}))return;e.session.selection=ms(re(n.selectionBefore??[])),e.history.index-=1,Ye(e,e.history.index)}else e.history.index-=1,ze(e,e.history.index);e.doc.dirty=!0}function OL(e){let t=j.get(e);if(t){t.redo(e);return}if(e.history.index>=e.history.snapshots.length-1)return;let n=e.history.snapshots[e.history.index+1],o=H()?n.forwardOps:null,r=H()?n.fmOps:null;if(o&&o.length>0||r&&r.length>0){if(!q(e,(s)=>{if(o)for(let a of o)ue(s,re(a));if(r)for(let a of r){let l=re(a);de(s,l.field,l.after)}},{origin:"history",skipHistory:!0}))return;e.session.selection=ms(re(n.selection)),e.history.index+=1,Ye(e,e.history.index)}else e.history.index+=1,ze(e,e.history.index);e.doc.dirty=!0}function Ji(e,t,n,o){let r=K(e.doc.document,t);if(!r)return;Ic(r).splice(n,0,structuredClone(o)),f({index:n,op:"insert",parentPath:t}),vi({forward:{index:n,node:Ae(o),op:"insert-child",parentPath:t},inverse:{index:n,op:"remove-child",parentPath:t}})}function Vu(e,t){if(!t||!Nl(t))return;let n=ht(t),o=_n(t),[r]=K(e.doc.document,n).children.splice(o,1);f({op:"remove",path:t}),vi({forward:{index:o,op:"remove-child",parentPath:n},inverse:{index:o,node:Ae(r),op:"insert-child",parentPath:n}}),e.session.selection=De(e.session.selection,t)}function VC(e,t){if(!t||!Nl(t))return;let n=K(e.doc.document,t);if(!n)return;let o=ht(t),r=_n(t),i=structuredClone(re(n));K(e.doc.document,o).children.splice(r+1,0,i),f({index:r+1,op:"insert",parentPath:o}),vi({forward:{index:r+1,node:Ae(i),op:"insert-child",parentPath:o},inverse:{index:r+1,op:"remove-child",parentPath:o}}),e.session.selection=[[...o,"children",r+1]]}function gp(e,t){for(let n of hv(t))Vu(e,n)}function mv(e,t){let n=[];for(let o of hv(t)){let r=e.session.selection;VC(e,o);let i=Le(e.session.selection);if(!i||e.session.selection===r)continue;let s=ht(i),a=_n(i);n=n.map((l)=>$t(s,l,a,1,!0)),n.unshift(i)}if(n.length>0)e.session.selection=n}function ML(e,t,n="div"){if(!t||!Nl(t))return;let o=K(e.doc.document,t);if(!o)return;let r=ht(t),i=_n(t),s={children:[structuredClone(re(o))],tagName:n},a=Ae(o);K(e.doc.document,r).children.splice(i,1,s),f({op:"replace",path:t}),vi({forward:{index:i,node:Ae(s),op:"set-child",parentPath:r},inverse:{index:i,node:a,op:"set-child",parentPath:r}}),e.session.selection=[[...r,"children",i]]}function pa(e,t,n,o){let r=e.doc.document,i=ht(t),s=_n(t);if(!i||typeof s!=="number")return;let a=K(r,i),l=K(r,n);if(!a||!Array.isArray(a.children)||!l)return;if(a.children[s]===void 0)return;let c=o;if(a===l&&s<o)c-=1;let d={fromIndex:s,fromParentPath:i,op:"move-child",toIndex:c,toParentPath:n},g=lk(r,d),[y]=a.children.splice(s,1);if(Ic(l).splice(c,0,y),f({fromPath:t,op:"move",toIndex:c,toParentPath:n}),vi({forward:d,inverse:g}),Yo(Le(e.session.selection),t)){let b=o;if(i.length===n.length&&i.every((_,I)=>_===n[I])&&s<o)b=o-1;e.session.selection=[[...n,"children",b]]}}function Ue(e,t,n,o){let r=K(e.doc.document,t);if(!r)return;let i=r[n],s=Ae(i);if(o===void 0||o===null||o==="")delete r[n];else r[n]=o;if(vi(P(t,n,s,Ae(r[n]))),n==="textContent")f({op:"set-text",path:t});else if(n==="style")f({op:"set-style",path:t});else{let a=o===void 0||o===null||o===""?i:o,l=n.startsWith("on")&&rh(a);f({isEvent:l,key:n,op:"set-prop",path:t})}}function kc(e,t,n,o){let r=K(e.doc.document,t),i=Ae(r.style);if(!r.style)r.style={};if(o===void 0||o==="")delete r.style[n];else r.style[n]=o;if(Object.keys(r.style).length===0)delete r.style;vi(P(t,"style",i,Ae(r.style))),f({op:"set-style",path:t})}function Ko(e,t,n,o){let r=K(e.doc.document,t),i=Ae(r.attributes);if(!r.attributes)r.attributes={};if(o===void 0||o==="")delete r.attributes[n];else r.attributes[n]=o;if(Object.keys(r.attributes).length===0)delete r.attributes;vi(P(t,"attributes",i,Ae(r.attributes))),f({attr:n,op:"set-attr",path:t})}function PL(e,t,n,o,r){if(!n)return kc(e,t,o,r);let i=K(e.doc.document,t),s=Ae(i.style);if(!i.style)i.style={};let a=`@${n}`,l=oh(i.style,a);if(r===void 0||r===""){if(delete l[o],Object.keys(l).length===0)delete i.style[a]}else l[o]=r;if(Object.keys(i.style).length===0)delete i.style;vi(P(t,"style",s,Ae(i.style))),f({op:"set-style",path:t})}function gv(e,t,n,o,r){let i=K(e.doc.document,t),s=Ae(i.style);if(!i.style)i.style={};let a=oh(i.style,n);if(r===void 0||r===""){if(delete a[o],Object.keys(a).length===0)delete i.style[n]}else a[o]=r;if(Object.keys(i.style).length===0)delete i.style;vi(P(t,"style",s,Ae(i.style))),f({op:"set-style",path:t})}function FL(e,t,n,o,r,i){let s=K(e.doc.document,t),a=Ae(s.style);if(!s.style)s.style={};let l=`@${n}`,c=oh(s.style,l),d=oh(c,o);if(i===void 0||i===""){if(delete d[r],Object.keys(d).length===0)delete c[o];if(Object.keys(c).length===0)delete s.style[l]}else d[r]=i;if(Object.keys(s.style).length===0)delete s.style;vi(P(t,"style",a,Ae(s.style))),f({op:"set-style",path:t})}function Ze(e,t){let n=[e];for(let o of t){let r=va(n.at(-1),o);if(!r)break;n.push(r)}for(let o=n.length-2;o>=0;o--){let r=n[o],i=t[o],s=va(r,i);if(s&&Object.keys(s).length===0)delete r[i]}}function bv(e,t,n,o,r){let i=K(e.doc.document,t),s=Ae(i.style);if(!i.style)i.style={};let a=i.style;for(let l of n)a=oh(a,l);if(r===void 0||r==="")delete a[o],Ze(i.style,n);else a[o]=r;if(Object.keys(i.style).length===0)delete i.style;vi(P(t,"style",s,Ae(i.style))),f({op:"set-style",path:t})}function jL(e,t,n,o,r,i){let s=K(e.doc.document,t),a=Ae(s.style);if(!s.style)s.style={};let l=`@${n}`,c=oh(s.style,l),d=c;for(let g of o)d=oh(d,g);if(i===void 0||i===""){if(delete d[r],Ze(c,o),Object.keys(c).length===0)delete s.style[l]}else d[r]=i;if(Object.keys(s.style).length===0)delete s.style;vi(P(t,"style",a,Ae(s.style))),f({op:"set-style",path:t})}function HL(e,t,n){let o=K(e.doc.document,t),r=Ae(o.style);if(n&&Object.keys(n).length>0)o.style=n;else delete o.style;vi(P(t,"style",r,Ae(o.style))),f({op:"set-style",path:t})}function Bs(e,t,n){let o=e.doc.document,r=Ae(o.state);if(!o.state)o.state={};o.state[t]=n,vi(P([],"state",r,Ae(o.state))),f({key:"state",op:"doc-meta"})}function vv(e,t){let n=e.doc.document;if(n.state){let o=Ae(n.state);if(delete n.state[t],Object.keys(n.state).length===0)delete n.state;vi(P([],"state",o,Ae(n.state))),f({key:"state",op:"doc-meta"})}}function mr(e,t,n){let o=e.doc.document,r=Ae(o.state);if(!o.state)o.state={};let i=o.state[t],s=i==null?{}:typeof i!=="object"||Array.isArray(i)?{default:i}:i;o.state[t]=s,Object.assign(s,n);for(let a of Object.keys(s))if(s[a]===void 0||s[a]===null)delete s[a];vi(P([],"state",r,Ae(o.state))),f({key:"state",op:"doc-meta"})}function BL(e,t,n){let o=e.doc.document;if(!o.state||!o.state[t])return;let r=Ae(o.state);o.state[n]=o.state[t],delete o.state[t],vi(P([],"state",r,Ae(o.state))),f({key:"state",op:"doc-meta"})}function Uu(e,t,n,o){let r=K(e.doc.document,t),i=Ae(r.$props);if(!r.$props)r.$props={};if(o===void 0||o===null||o==="")delete r.$props[n];else r.$props[n]=o;if(Object.keys(r.$props).length===0)delete r.$props;vi(P(t,"$props",i,Ae(r.$props))),f({op:"replace",path:t})}function zL(e,t,n,o){let r=K(e.doc.document,t),i=Ae(r.cases);if(!r.cases)r.cases={};r.cases[n]=o||{tagName:"div",textContent:n},vi(P(t,"cases",i,Ae(r.cases))),f({op:"replace",path:t})}function WL(e,t,n){let o=K(e.doc.document,t);if(o.cases){let r=Ae(o.cases);delete o.cases[n],vi(P(t,"cases",r,Ae(o.cases))),f({op:"replace",path:t})}}function VL(e,t,n,o){let r=K(e.doc.document,t);if(!r.cases||!r.cases[n])return;let i=Ae(r.cases);r.cases[o]=r.cases[n],delete r.cases[n],vi(P(t,"cases",i,Ae(r.cases))),f({op:"replace",path:t})}function Ol(e,t,n){let o=e.doc.content.frontmatter,r=Object.hasOwn(o,t)?Ae(o[t]):void 0,i=n===void 0||n===null||n==="";if(i)delete o[t];else o[t]=n;let s=i?void 0:Ae(n);Ne({after:s,before:r,field:t}),e.doc.dirty=!0}function de(e,t,n){if(n===void 0)delete e.doc.content.frontmatter[t];else e.doc.content.frontmatter[t]=n}var Wt={design:"canvas",edit:"canvas",entry:"entry","git-diff":"diff",grid:"grid",manage:"library",media:"media",preview:"canvas",settings:"config",source:"code",stylebook:"config"},ov={canvas:"Canvas",code:"Code",config:"Project Styles",diff:"Diff",entry:"Entry",grid:"Grid",media:"Media",library:"Library",none:"None"};function ha(e){return Wt[e]??"canvas"}var Bt={design:"design",edit:"edit",preview:"preview"};function vL(e){return Bt[e]??"design"}var rv=(e)=>e.editor.kind==="canvas",$d=(e)=>rv(e)&&e.selection.count>0,sv=(e)=>$d(e)&&!e.selection.isRoot;function bm(){return{project:{open:!1,isSite:!1,isRepo:!1,isMultilingual:!1},git:{ahead:0,behind:0,dirtyCount:0},document:{open:!1,dirty:!1,mode:"",canUndo:!1,canRedo:!1},editor:{kind:"none"},canvas:{view:"design"},pane:{count:1,derived:!1},selection:{count:0,paths:[],kind:"",isRoot:!1,isComponentInstance:!1,isLayoutNode:!1,isRepeater:!1},caret:{active:!1,inCanvas:!1},focus:{region:"pane"},modal:{open:!1},collab:{attached:!1,readOnly:!1,sourceCanonical:!1},ai:{configured:!1,streaming:!1,waiting:!1},capability:{gitClone:!1,importSite:!1,openProjectInNewWindow:!1,dataRows:!1,windowControls:!1,findReferences:!1,readFileBytes:!1}}}function Ex(e={}){let t=bm();for(let n of Object.keys(e)){let o=e[n];if(o)Object.assign(t[n],o)}return t}var Vt=["palette"],Kt=["caret","global"],Ut=["dock","global"],Gt=["canvas","global"],Ht=["grid","global"],qt=["code","global"],Xe=["global"];function yL(e){if(e.modal.open)return Vt;if(e.caret.active)return Kt;if(e.focus.region!=="pane")return Ut;switch(e.editor.kind){case"grid":return Ht;case"code":return qt;case"canvas":return e.canvas.view==="preview"?Xe:Gt;default:return Xe}}var ai="project.json";function zt(e,t=!1){return{activeMedia:null,activeSelector:null,openPopover:null,openDialog:null,canvasMode:e,editZoom:1,editingFormula:null,editingFunction:null,featureToggles:{},inspectorSections:{},pendingInlineEdit:null,preview:t,previewColorScheme:"auto",previewLocale:null,previewParams:{},previewProps:null,rightTab:"properties",showLayout:!0,styleFilter:"",styleSections:{},dataRows:{},dataLimits:{},styleShorthands:{},zoom:1}}var Yt=["edit","design","preview","source","stylebook","git-diff"];function cv({id:e,documentPath:t=null,fileHandle:n=null,document:o,frontmatter:r,sourceFormat:i=null,capabilities:s,openedFrom:a=null,preview:l=!1,layout:c=null}){let d=ge();Lm(o);let g=s?.modes??Xt(t,i),y=g.find((I)=>I!=="preview")??"edit",b=g[0]==="preview";return d.run(()=>({capabilities:{modes:g},doc:v({content:{frontmatter:r||{}},dirty:!1,document:o,handlersSource:null,layout:c,mode:Qt(t,i),sourceFormat:i}),documentPath:t,fileHandle:n,history:v({index:0,snapshots:[{document:structuredClone(o),selection:[]}]}),id:e,pinned:!1,preview:l,scope:d,session:v({canvas:{refreshing:!1,error:null,livePreviews:null,pendingInlineEdit:null,scope:null,status:"idle"},clipboard:null,hover:null,openedFrom:a,selection:[],ui:zt(y,b)})}))}function Xt(e,t){if(e===ai)return["stylebook","source"];let n=wi(t)??Zt(e);if(n)return n.studio?.modes??["edit","design","preview","source"];return Yt}function Qt(e,t){let n=wi(t)??Zt(e);if(n)return n.studio?.documentMode?.default??"content";return"component"}function WC(e){return ha(e.session.ui.canvasMode)}function EL(e){let t=[];for(let n of e.capabilities.modes){if(n==="preview")continue;let o=ha(n);if(!t.includes(o))t.push(o)}return t}function TL(e,t){return e.capabilities.modes.find((n)=>n!=="preview"&&ha(n)===t)}function fp(e){e.scope.stop()}var Qe=new WeakMap,M=new Map;function xn(e){let t=re(e),n=Qe.get(t);if(!n)n=v({active:!1,attachError:"",peers:[],readOnly:!1,sourceCanonical:!1,status:"unavailable"}),Qe.set(t,n);return n}function et(e){M.set(e,(M.get(e)??0)+1)}function tt(e){let t=M.get(e)??0;if(t<=1)M.delete(e);else M.set(e,t-1)}function wm(e){return M.has(e.replaceAll("\\","/"))}var en=8000,tn=800,nn=2500,nt=null;function on(){return nt??=(me("m0x5ztax"),import("./index-m0x5ztax.js")),nt}function it(){try{return p()}catch{return null}}var N=null;function YL(e){N=e}var pe=null;function ZL(e){pe=e}var st=()=>{};function XL(e){st=e??(()=>{})}var be=new WeakMap;function at(e){return re(e)}function C(e){return be.get(at(e))}function xe(e){let t=at(e),n=be.get(t);if(!n)n={attaching:null,generation:0,optedOut:v({value:!1}),session:null,watcherInstalled:!1},be.set(t,n);return n}var rt=!1;function rn(){if(rt)return;rt=!0,Be(sn),qe(an),Ke((e)=>{if(C(e)?.session?.synced&&xn(e).sourceCanonical)return st("Source editing in progress — structural edits are paused"),"source-canonical";return null})}function sn(e,t,n){let o=C(e)?.session;if(!o||!o.synced)return;if(o.lastSeenRef=re(e.doc.document),n==="remote"){ee(o);return}if(o.canWrite)ln(o,t),ee(o)}function an(e){let t=C(e)?.session;if(!t?.synced||t.batchOps===null)return;let{batchOps:n,batchNeedsDiff:o}=t;if(t.batchOps=null,t.batchNeedsDiff=!1,!t.canWrite)return;if(t.undoManager?.stopCapturing(),o)z(t);else if(n.length>0)try{t.collab.applyDocOpsToY(t.handle.doc,n,t.collab.LOCAL_ORIGIN)}catch{z(t)}t.undoManager?.stopCapturing()}function ln(e,t){let n=t.docOps.map((o)=>o.forward);if(Ix()){if(e.batchOps??=[],n.length===0)e.batchNeedsDiff=!0;else e.batchOps.push(...n);return}if(n.length===0){z(e);return}try{e.collab.applyDocOpsToY(e.handle.doc,n,e.collab.LOCAL_ORIGIN)}catch{z(e)}}function z(e){let{collab:t,handle:n,tab:o}=e,r=t.yDocToJson(n.doc),i=Ao(re(o.doc.document)),s=t.diffDocs(r,i);if(s===null)t.replaceYStructure(n.doc,i,t.LOCAL_ORIGIN);else if(s.length>0)try{t.applyDocOpsToY(n.doc,s,t.LOCAL_ORIGIN)}catch{t.replaceYStructure(n.doc,i,t.LOCAL_ORIGIN)}}function fe(e){let t=e.collab.yDocToJson(e.handle.doc);q(e.tab,(n)=>{let o=n.doc.document;for(let r of Object.keys(o))if(!(r in t))delete o[r];Object.assign(o,t)},{origin:"remote",skipHistory:!0})}function cn(e){if(!e.canWrite)return!1;let{awareness:t}=e.handle,n=t.clientID;for(let[o,r]of t.getStates())if(r.canWrite!==!1&&o<n)n=o;return n===e.handle.awareness.clientID}function ee(e){if(!N||!cn(e))return;if(e.collab.canonicalOf(e.handle.doc)==="source")return;let t=Date.now();if(e.lastMirrorAt??=t,t-e.lastMirrorAt>=nn){if(e.mirrorTimer)clearTimeout(e.mirrorTimer),e.mirrorTimer=null;e.lastMirrorAt=t,ye(e);return}if(e.mirrorTimer)clearTimeout(e.mirrorTimer);e.mirrorTimer=setTimeout(()=>{e.mirrorTimer=null,e.lastMirrorAt=Date.now(),ye(e)},tn)}async function ye(e){if(!N||!e.synced)return;try{let t=await N(e.tab);e.collab.updateSourceText(e.handle.doc,t,e.collab.MIRROR_ORIGIN)}catch{}}async function lt(e){if(!pe||!e.synced||!e.canWrite)return;let{collab:t,handle:n,tab:o}=e,r=t.canonicalRevOf(n.doc),i=t.sourceText(n.doc).toString(),s;try{s=await pe(o,i)}catch{return}if(!e.synced||t.canonicalRevOf(n.doc)!==r)return;let a=t.diffDocs(t.yDocToJson(n.doc),s.document);if(a===null)t.replaceYStructure(n.doc,s.document,t.MIRROR_ORIGIN);else if(a.length>0)try{t.applyDocOpsToY(n.doc,a,t.MIRROR_ORIGIN)}catch{t.replaceYStructure(n.doc,s.document,t.MIRROR_ORIGIN)}let l=t.frontmatterMap(n.doc),c=s.frontmatter??{};n.doc.transact(()=>{let d=[...l.keys()];for(let g of d)if(!(g in c))l.delete(g);for(let[g,y]of Object.entries(c))if(!t.deepEqual(l.get(g),y))l.set(g,y)},t.MIRROR_ORIGIN)}function QL(e){let t=C(e)?.session;if(!t?.synced)return null;let{collab:n,handle:o}=t,r=null,i=()=>r!==null&&t.sourceLockOwner===r;return{awareness:o.awareness,enter:async()=>{r={},t.sourceLockOwner=r;let s=o.awareness.getLocalState();if(s)o.awareness.setLocalState({...s,mode:"source"});if(!t.canWrite)return;let a=null;if(N)try{a=await N(e)}catch{a=null}if(!i())return;n.acquireSourceCanonical(o.doc,a??n.sourceText(o.doc).toString(),n.LOCAL_ORIGIN)},leave:()=>{if(!i()){r=null;return}r=null,t.sourceLockOwner=null;let s=o.awareness.getLocalState();if(s)o.awareness.setLocalState({...s,mode:"structure"});if(!t.canWrite)return;if(n.otherSourceEditors(o.awareness,t.path,o.awareness.clientID).filter((l)=>o.awareness.getStates().get(l)?.canWrite!==!1).length===0)lt(t).then(()=>{n.releaseSourceCanonical(o.doc,n.LOCAL_ORIGIN)})},localOrigin:n.LOCAL_ORIGIN,readOnly:!t.canWrite,text:n.sourceText(o.doc)}}function _m(e){let t=xn(e);return t.active&&t.readOnly}async function GC(e){let t=C(e)?.session;if(!t?.synced||!t.canWrite)return!1;if(t.mirrorTimer)clearTimeout(t.mirrorTimer),t.mirrorTimer=null;return await ye(t),await t.handle.flush(),!0}async function KC(){for(let e of he)if(C(e)?.session?.synced)await GC(e)}var he=new Set;function Y(e){if(!it()?.collab||!e.documentPath||e.documentPath===ai)return;let n=xe(e);if(n.watcherInstalled)return;n.watcherInstalled=!0,rn(),he.add(e),e.scope.run(()=>{Q(()=>{if(n.optedOut.value)te(e);else ve(e)}),Xa(()=>{he.delete(e),te(e)})})}function JC(e,t){let n=xe(e);if(n.optedOut.value===!t)return;if(n.optedOut.value=!t,!n.watcherInstalled&&t)Y(e)}function YC(e){return C(e)?.optedOut.value!==!0}function ct(e){if(!C(e)?.watcherInstalled){Y(e);return}te(e),ve(e)}async function ve(e){let t=xe(e);if(t.session||t.attaching)return;let{documentPath:n}=e,o=it();if(!n||!o?.collab){xn(e).status="unavailable";return}let{generation:r}=t,i=xn(e);i.status="connecting",i.attachError="";let s=(async()=>{try{let[a,l]=await Promise.all([on(),o.collab(n)]);if(!l){i.status="detached";return}if(t.generation!==r){l.destroy();return}let c=null,d=new Promise((g,y)=>{c=setTimeout(()=>y(Error("collab-sync-timeout")),en)});try{await Promise.race([l.whenSynced,d])}finally{if(c)clearTimeout(c)}if(t.generation!==r){l.destroy();return}t.session=un(e,n,a,l),i.active=!0,i.status="synced",i.readOnly=!t.session.canWrite,i.attachError="",et(n)}catch(a){i.status="failed",i.active=!1,i.attachError=a instanceof Error?a.message:String(a),k.warn(`Live collaboration is not available for "${n}" — ${i.attachError}`,{key:`collab:${n}`,path:n,source:"Collaboration"})}finally{t.attaching=null}})();t.attaching=s,await s}function te(e){let t=C(e);if(!t)return;t.generation+=1;let{session:n}=t;t.session=null;let o=xn(e);if(o.active=!1,o.status="detached",o.attachError="",o.peers=[],!n)return;if(tt(n.path),n.mirrorTimer)clearTimeout(n.mirrorTimer);if(n.sourceParseTimer)clearTimeout(n.sourceParseTimer);for(let r of n.disposers)try{r()}catch{}ym(e,null),e.history.snapshots=[{document:Ao(re(e.doc.document)),selection:ms(e.session.selection)}],e.history.index=0,n.undoManager?.destroy(),n.handle.destroy()}function un(e,t,n,o){let r=o.identity(),i={applyingRemoteFrontmatter:!1,batchNeedsDiff:!1,batchOps:null,canWrite:r?r.permission!=="read":!0,collab:n,disposers:[],handle:o,lastSeenRef:re(e.doc.document),mirrorTimer:null,path:t,sourceLockOwner:null,sourceParseTimer:null,synced:!1,tab:e,undoManager:null};if(n.metaMap(o.doc).get("structureSeeded")===!0){let h=n.yDocToJson(o.doc),x=Ao(re(e.doc.document));if(!n.deepEqual(h,x)){let w=n.diffDocs(x,h);if(w===null)i.synced=!0,fe(i),i.synced=!1;else if(w.length>0)ce(e,w)}i.applyingRemoteFrontmatter=!0;let T=n.frontmatterMap(o.doc);for(let[w,J]of T.entries())e.doc.content.frontmatter[w]=J;i.applyingRemoteFrontmatter=!1}else if(i.canWrite)n.seedStructure(o.doc,Ao(re(e.doc.document)),{frontmatter:Ao(re(e.doc.content.frontmatter)),origin:n.SEED_ORIGIN,sourceFormat:e.doc.sourceFormat});i.lastSeenRef=re(e.doc.document),i.disposers.push(o.onDirty((h)=>{e.doc.dirty=h})),o.awareness.setLocalState({canWrite:i.canWrite,focusedPath:t,structuralSelection:null,user:r?{avatarUrl:r.avatarUrl,color:r.color,login:r.login,name:r.name}:{color:n.colorForKey(String(o.awareness.clientID)),login:`guest-${o.awareness.clientID%1000}`}});let a=new n.UndoManager([n.structureMap(o.doc),n.frontmatterMap(o.doc)],{trackedOrigins:new Set([n.LOCAL_ORIGIN])});i.undoManager=a;let l=({stackItem:h})=>{h.meta.set("selection",ms(e.session.selection))},c=({stackItem:h})=>{let x=h.meta.get("selection");e.session.selection=ms(x??[])};a.on("stack-item-added",l),a.on("stack-item-popped",c),i.disposers.push(()=>{a.off("stack-item-added",l),a.off("stack-item-popped",c)}),ym(e,{canRedo:()=>a.canRedo(),canUndo:()=>a.canUndo(),redo:()=>{a.redo()},undo:()=>{a.undo()}});let d=n.structureMap(o.doc),g=(h,x)=>{if(x.origin===n.LOCAL_ORIGIN||!i.synced)return;let T=n.yEventsToDocOps(h);if(T===null){fe(i);return}if(T.length===0)return;try{ce(e,T)}catch{fe(i)}};d.observeDeep(g),i.disposers.push(()=>d.unobserveDeep(g));let y=xn(e);y.sourceCanonical=n.canonicalOf(o.doc)==="source";let b=n.metaMap(o.doc),_=()=>{y.sourceCanonical=n.canonicalOf(o.doc)==="source"};b.observe(_),i.disposers.push(()=>b.unobserve(_));let I=n.sourceText(o.doc),Oe=(h,x)=>{if(x.origin===n.MIRROR_ORIGIN||!i.synced)return;if(n.canonicalOf(o.doc)!=="source")return;if(!n.isSourceReconciler(o.awareness,i.path))return;if(i.sourceParseTimer)clearTimeout(i.sourceParseTimer);i.sourceParseTimer=setTimeout(()=>{i.sourceParseTimer=null,lt(i)},600)};I.observe(Oe),i.disposers.push(()=>I.unobserve(Oe));let A=n.frontmatterMap(o.doc),we=(h,x)=>{if(x.origin===n.LOCAL_ORIGIN||!i.synced)return;i.applyingRemoteFrontmatter=!0;try{for(let[T,w]of h.changes.keys)if(w.action==="delete")delete e.doc.content.frontmatter[T];else e.doc.content.frontmatter[T]=A.get(T)}finally{i.applyingRemoteFrontmatter=!1}};A.observe(we),i.disposers.push(()=>A.unobserve(we)),e.scope.run(()=>{let h=JSON.stringify(e.doc.content.frontmatter);Q(()=>{let x=JSON.stringify(e.doc.content.frontmatter);if(x===h)return;if(h=x,i.applyingRemoteFrontmatter||!i.synced||!i.canWrite)return;let T=JSON.parse(x);o.doc.transact(()=>{let w=[...A.keys()];for(let J of w)if(!(J in T))A.delete(J);for(let[J,Ce]of Object.entries(T))if(!n.deepEqual(A.get(J),Ce))A.set(J,Ce)},n.LOCAL_ORIGIN),ee(i)}),Q(()=>{let x=e.session.selection.length>0?ms(e.session.selection):null,T=o.awareness.getLocalState();if(T)o.awareness.setLocalState({...T,structuralSelection:x})}),Q(()=>{let x=re(e.doc.document);queueMicrotask(()=>{if(C(e)?.session!==i||!i.synced||!i.canWrite)return;let w=re(e.doc.document);if(w!==x||w===i.lastSeenRef)return;i.lastSeenRef=w,z(i),ee(i)})})});let oe=xn(e),ie=()=>{let h=[];for(let[x,T]of o.awareness.getStates())if(x!==o.awareness.clientID&&T.user)h.push({clientId:x,state:T});oe.peers=h};return ie(),o.awareness.on("change",ie),i.disposers.push(()=>o.awareness.off("change",ie),o.onStatus((h)=>{if(h==="offline"||h==="connecting")oe.status="offline";else if(i.synced)oe.status="synced"}),o.onReset(()=>{te(e),ve(e)})),i.synced=!0,i}function S(e,t,n){return RangeError(`command "${e}" argument "${t}": ${n}`)}function O(e){if(e===void 0)return"missing";return typeof e==="string"?`"${e}"`:`${typeof e} ${JSON.stringify(e)}`}function ot(e,t,n){let o=t[n];if(typeof o!=="string"||o==="")throw S(e,n,`expected a non-empty string, got ${O(o)}`);return o}function Jo(e,t,n){if(t[n]===void 0)return;return ot(e,t,n)}function dt(e,t,n){let o=t[n];if(typeof o!=="number"||!Number.isFinite(o))throw S(e,n,`expected a finite number, got ${O(o)}`);return o}function ut(e,t,n){let o=t[n];if(typeof o!=="number"||!Number.isInteger(o))throw S(e,n,`expected an integer, got ${O(o)}`);return o}function yv(e,t,n,o,r){let i=dt(e,t,n);if(i<o||i>r)throw S(e,n,`${i} is outside the supported range ${o}–${r}`);return i}function yi(e,t,n){let o=t[n];if(typeof o!=="boolean")throw S(e,n,`expected a boolean, got ${O(o)}`);return o}function li(e,t,n,o){let r=t[n];if(typeof r!=="string"||!o.includes(r))throw S(e,n,`${O(r)} is not declared — declared: ${o.join(", ")||"none"}`);return r}function $x(e,t,n){let o=t[n];if(!Array.isArray(o)||!o.every((r)=>typeof r==="string"||typeof r==="number"))throw S(e,n,`expected an array of path segments (strings or numbers), got ${O(o)}`);return o}function UL(e,t,n){if(t[n]===null)return null;return $x(e,t,n)}function UC(e,t,n){let o=t[n];if(!Array.isArray(o))throw S(e,n,`expected an array of document paths, got ${O(o)}`);return o.map((r,i)=>{if(!Array.isArray(r)||!r.every((s)=>typeof s==="string"||typeof s==="number"))throw S(e,n,`entry ${i} is not a document path — expected an array of segments, got ${O(r)}`);return r})}function Se(e,t=Object.keys(e)){return{additionalProperties:!1,properties:e,required:[...t],type:"object"}}function Do(e,t){return{description:t,enum:[...e],type:"string"}}function fa(e,t){return{description:t,get enum(){return[...e()]},type:"string"}}function qC(e,t={}){return{description:e,type:"number",...t}}function oo(e){return{description:e,type:"boolean"}}function wv(e,t=!1){let n={items:{type:["string","number"]},type:"array"};return t?{description:e,oneOf:[n,{type:"null"}]}:{description:e,...n}}function qL(e){return{description:e,items:{items:{type:["string","number"]},type:"array"},type:"array"}}function He(e){return{description:e,type:"string"}}function fn(e){return e.length===2&&e.includes("string")&&e.includes("number")}function Te(e){return Array.isArray(e)?e:[e]}function ft(e){let t=e;if("enum"in t)return"enum";if("const"in t)return"const";if(Array.isArray(t.oneOf))return"one-of";if(Array.isArray(t.type))return"typed";switch(t.type){case"boolean":return"boolean";case"number":case"integer":{if(t.minimum!==void 0&&t.maximum!==void 0)return"bounded-number";return t.type==="integer"?"integer":"number"}case"string":return"string";case"array":{let n=t.items?.type;if(Array.isArray(n))return fn(n)?"path":"pass-through";return n==="array"?"path-list":"pass-through"}case"null":case"object":return"typed";default:break}return"pass-through"}function pt(e,t){switch(e){case"null":return t===null;case"boolean":return typeof t==="boolean";case"string":return typeof t==="string";case"number":return typeof t==="number"&&Number.isFinite(t);case"integer":return typeof t==="number"&&Number.isInteger(t);case"array":return Array.isArray(t);case"object":return typeof t==="object"&&t!==null&&!Array.isArray(t);default:break}return!1}function mt(e){if(e.length<=1)return e.join("");return`${e.slice(0,-1).join(", ")} or ${e.at(-1)}`}function pn(e,t,n,o){let r=t[n];if(!o.some((i)=>pt(i,r)))throw S(e,n,`expected ${mt(o)}, got ${O(r)}`);return r}function gt(e){switch(ft(e)){case"enum":return`one of ${(e.enum??[]).map((t)=>O(t)).join(" | ")}`;case"const":return`the constant ${O(e.const)}`;case"one-of":return(e.oneOf??[]).map((t)=>gt(t)).join(" or ");case"typed":return mt(Te(e.type??[]));case"boolean":return"a boolean";case"bounded-number":return`a number from ${e.minimum} to ${e.maximum}`;case"number":return"a finite number";case"integer":return"an integer";case"string":return"a non-empty string";case"path":return"a document path";case"path-list":return"a list of document paths";default:return"anything"}}function mn(e,t,n,o){let r=t[n],i=[];for(let s of o){if(s.type!==void 0&&!Te(s.type).some((a)=>pt(a,r)))continue;try{return bt(e,t,n,s)}catch(a){i.push(a)}}if(i.length===1)throw i[0];throw S(e,n,`expected ${o.map((s)=>gt(s)).join(" or ")}, got ${O(r)}`)}function bt(e,t,n,o){switch(ft(o)){case"enum":return li(e,t,n,o.enum??[]);case"const":{let r=t[n];if(r!==o.const)throw S(e,n,`expected the constant ${O(o.const)}, got ${O(r)}`);return r}case"one-of":return mn(e,t,n,o.oneOf??[]);case"typed":return pn(e,t,n,Te(o.type??[]));case"boolean":return yi(e,t,n);case"bounded-number":{if(o.type==="integer")ut(e,t,n);return yv(e,t,n,o.minimum,o.maximum)}case"number":return dt(e,t,n);case"integer":return ut(e,t,n);case"string":return ot(e,t,n);case"path":return $x(e,t,n);case"path-list":return UC(e,t,n);default:return t[n]}}function GL(e,t,n){let o=t,r=o.properties??{},i=Object.keys(r),s=o.required??[],a={};for(let[l,c]of Object.entries(n)){if(c===void 0||Object.hasOwn(r,l))continue;if(o.additionalProperties===!1)throw S(e,l,`not declared — declared: ${i.join(", ")||"none"}`);a[l]=c}for(let l of i){if(n[l]===void 0&&!s.includes(l))continue;a[l]=bt(e,n,l,r[l])}return a}var gn=20,Qn="primary",vp="secondary",ZC=2,m=v({activePaneId:Qn,clipboard:null,closedTabs:[],componentRegistry:[],mruOrder:[],fileTree:{dirs:new Map,expanded:new Set,searchQuery:"",selectedPath:null},panes:[{activeTabId:null,derived:null,id:Qn,tabOrder:[]}],projectConfig:null,projectRoot:null,styleClipboard:null,tabs:new Map,ui:{activityBar:"files"},get activeTabId(){let e=Rr();return e.derived?.kind==="lens"?Hn(e.derived.sourcePaneId)?.activeTabId??null:e.activeTabId},get tabOrder(){return Rr().tabOrder}}),u=zd(()=>m.activeTabId?m.tabs.get(m.activeTabId)??null:null);function Rr(){let{panes:e}=m;return e.find((t)=>t.id===m.activePaneId)??e[0]}function Hn(e){return m.panes.find((t)=>t.id===e)}function Gu(e){return m.panes.find((t)=>t.tabOrder.includes(e))}function $r(e){let t=Hn(e);if(!t||t.id===m.activePaneId)return;m.activePaneId=t.id,R();let{activeTabId:n}=t;if(n){Pe(n);let o=m.tabs.get(n);if(o)vt(o)}}function yp(e){return m.activePaneId===e}function Ox(e){let t=e??Rr().activeTabId,n=t?m.tabs.get(t):null;if(!t||!n)return null;let o=Gu(t);if(!o)return null;let r=Pl(o.id);return _p(t),Ku(r,t),r.activeTabId=t,m.activePaneId=r.id,R(),Pe(t),r}function Mx(e){return m.panes.find((t)=>t.id!==e)??bn(vp)}function Pl(e){let t=Mx(e);if(t.derived)t.derived=null;return t}function bn(e){let t=Hn(e);if(t)return t;return m.panes=[...m.panes,{activeTabId:null,derived:null,id:e,tabOrder:[]}],Hn(e)}function wp(e){if(m.panes.length<2)return;let t=e===Qn?m.panes.find((r)=>r.id!==Qn)?.id:e,n=t===void 0?void 0:Hn(t),o=m.panes.find((r)=>r.id!==t);if(!n||!o)return;for(let r of n.tabOrder)Ku(o,r);if(o.activeTabId=m.activePaneId===n.id?n.activeTabId??o.activeTabId:o.activeTabId??n.activeTabId,m.activePaneId=o.id,o.derived?.sourcePaneId===n.id)o.derived=null;m.panes=m.panes.filter((r)=>r.id!==n.id),R()}function xp(e){return e.tabOrder.length===0&&e.derived===null}function _p(e){let t=[];for(let n of m.panes){if(!n.tabOrder.includes(e))continue;if(n.tabOrder=n.tabOrder.filter((o)=>o!==e),n.activeTabId===e)n.activeTabId=n.tabOrder.at(-1)??null;if(n.id!==Qn&&xp(n))t.push(n.id)}for(let n of t)wp(n)}function Ku(e,t,n){if(e.tabOrder.includes(t))return;let o=n??hn(e,t);e.tabOrder=[...e.tabOrder.slice(0,o),t,...e.tabOrder.slice(o)]}function yn(e){let t=0;for(let n of e.tabOrder){if(m.tabs.get(n)?.pinned!==!0)break;t+=1}return t}function hn(e,t){return m.tabs.get(t)?.pinned===!0?yn(e):e.tabOrder.length}function Ua(e,t=null){if(m.projectRoot&&e!==m.projectRoot)Lx();m.projectRoot=e,m.projectConfig=t}function Cp(e){let t=u.value;return e!==null&&t!==null&&re(t)===re(e)}function Sc(e){if(!e)return!1;let t=m.tabs.get(e.id);return t!==void 0&&re(t)===re(e)}function Pe(e){m.mruOrder=[e,...m.mruOrder.filter((t)=>t!==e)]}var ne=null,Z=0;function R(){ne=null,Z=0}function vt(e){if(D&&e.documentPath)D.selectedPath=e.documentPath}function X(e,t={}){let n=m.tabs.get(e),o=Gu(e);if(!n||!o)return;if(o.activeTabId=e,t.focus===!1)return;if(m.activePaneId=o.id,!t.cycling)R(),Pe(e);vt(n)}function No(e){let t=m.tabs.get(e.id),n=e.preview===!0&&t?.pinned!==!0,o=cv({...e,preview:n}),r=(e.paneId===void 0?void 0:Hn(e.paneId))??Rr(),i;if(t)o.pinned=t.pinned,fp(t);else{if(n){let a=yt(r),l=a?m.tabs.get(a):null;if(l)kp(l);Px()}let s=n?yt(r):null;if(s)i=r.tabOrder.indexOf(s),Fx(s);Ku(r,o.id,i)}return m.tabs.set(o.id,o),X(o.id,{focus:e.focus!==!1}),Y(o),o}function yt(e){return e.tabOrder.find((t)=>m.tabs.get(t)?.preview===!0)??null}function Fl(e){let t=m.tabs.get(e);if(t?.preview===!0)t.preview=!1}function Px(){for(let[e,t]of m.tabs)if(t.preview&&t.doc.dirty)Fl(e)}function kv(e,t){let n=m.tabs.get(e),o=Gu(e);if(!n||!o)return;if(n.pinned=t,t)n.preview=!1;let r=o.tabOrder.filter((s)=>s!==e),i=r.filter((s)=>m.tabs.get(s)?.pinned===!0).length;o.tabOrder=[...r.slice(0,i),e,...r.slice(i)]}function XC(e,t){let n=m.tabs.get(e),o=Gu(e);if(!n||!o)return;o.tabOrder=Tt(o,e,t)}function Tt(e,t,n){let o=m.tabs.get(t);if(!o)return e.tabOrder;let r=e.tabOrder.filter((c)=>c!==t),i=r.filter((c)=>m.tabs.get(c)?.pinned===!0).length,s=o.pinned?0:i,a=o.pinned?i:r.length,l=Math.min(Math.max(n,s),a);return[...r.slice(0,l),t,...r.slice(l)]}function Fx(e){let t=m.tabs.get(e);if(!t)return;let n=Gu(e),o=n?.activeTabId===e;if(vn(t),fp(t),m.tabs.delete(e),_p(e),m.mruOrder=m.mruOrder.filter((s)=>s!==e),R(),n&&xp(n))wp(n.id);if(!o)return;let r=Rr(),i=m.mruOrder.find((s)=>r.tabOrder.includes(s))??r.tabOrder.at(-1)??null;if(i)X(i)}function QC(){let e=[...m.tabs.values()];m.tabs.clear(),Pt(),m.mruOrder=[],R();for(let t of e)fp(t)}function Pt(){m.panes=[{activeTabId:null,derived:null,id:Qn,tabOrder:[]}],m.activePaneId=Qn}function vn(e){if(!e.documentPath)return;let t=e.documentPath;m.closedTabs=[{documentPath:t},...m.closedTabs.filter((n)=>n.documentPath!==t)].slice(0,gn)}function Tn(){let[e]=m.closedTabs;if(!e)return;return m.closedTabs=m.closedTabs.slice(1),e.documentPath}function xt(e){if(!ne)ne=m.mruOrder.filter((o)=>m.tabs.has(o)),Z=0;let t=ne;if(t.length<2)return;Z=((Z+e)%t.length+t.length)%t.length;let n=t[Z];return X(n,{cycling:!0}),n}function ek(e){let t=[...m.tabs.keys()],n=[...m.tabs.values()],o=cv(e);m.tabs.set(o.id,o),Pt(),m.panes[0].tabOrder=[o.id],m.mruOrder=[],R(),X(o.id),Y(o);for(let r of t){if(r===o.id)continue;m.tabs.delete(r)}for(let r of n)fp(r);return o}function ci(e,t={}){X(e,t)}function Cm(e,t,n){let o=Hn(t);if(!o||!m.tabs.has(e))return null;if(o.tabOrder.includes(e)){if(n!==void 0)o.tabOrder=Tt(o,e,n);return o}return _p(e),Ku(o,e,n),o}function Sv(e,t,n){let o=m.tabs.get(e);if(!o)return;o.id=t,o.documentPath=n,m.tabs.delete(e),m.tabs.set(t,o);for(let r of m.panes)if(r.tabOrder=r.tabOrder.map((i)=>i===e?t:i),r.activeTabId===e)r.activeTabId=t;m.mruOrder=m.mruOrder.map((r)=>r===e?t:r),R(),ct(o)}function tk(e,t){e.registerAll([...Pn(t),...On(t)])}function Pn(e){let t=()=>m.tabs.size>1;return[{id:"document.nextTab",title:"Next Tab",category:"Document",level:"document",keybinding:["ctrl+tab","mod+tab"],menus:["palette"],group:"2_navigate",when:(n)=>n.document.open,enablement:t,requires:"a second open document",run:()=>{xt(1)}},{id:"document.previousTab",title:"Previous Tab",category:"Document",level:"document",keybinding:["ctrl+shift+tab","mod+shift+tab"],menus:["palette"],group:"2_navigate",when:(n)=>n.document.open,enablement:t,requires:"a second open document",run:()=>{xt(-1)}},{args:Se({path:He('Project-relative path of the file to open, e.g. "pages/about.json" or "components/nav-bar.json". It must exist.')}),id:"document.open",title:"Open Document",category:"Document",level:"project",menus:["palette"],group:"1_file",when:(n)=>n.project.open,requires:"an open project",aiTool:{description:"Open a project file as the active document; the document tools then operate on it. Use it when the user should SEE the page, or for iterative visual refinement after creating a page or component.",name:"open_document",report:({after:n,args:o})=>{let r=ot("document.open",o,"path"),i=u.value?.documentPath??null;if(i!==r)return`Opened "${r}", but the active document is ${i===null?"none":`"${i}"`}.`;let s=n.editor.kind==="canvas"?"on the canvas; the document tools now operate on it":`in the ${ov[n.editor.kind]} editor, which is not an element tree the document tools can edit`;return`"${r}" is the active document, ${s}.`}},run:async(n,o)=>{let r=ot("document.open",o,"path");if(await e.openFile(r),![...m.tabs.values()].some((i)=>i.documentPath===r))throw RangeError(`command "document.open" argument "path": "${r}" could not be opened — it does `+"not exist, or no editor claims its format. Problems has the reason.")}},{args:Se({file:He('Project-relative path of the file to open in the other pane, e.g. "pages/about.json". It must exist.')}),id:"document.openToSide",title:"Open to the Side",category:"Document",level:"project",menus:["context/file","palette"],group:"1_file",when:(n)=>n.project.open,requires:"an open project",undo:"none",run:async(n,o)=>{let r=ot("document.openToSide",o,"file"),i=Pl(Rr().id);if(await e.openFile(r,{paneId:i.id}),![...m.tabs.values()].some((s)=>s.documentPath===r)){if(xp(i)&&i.id!==Qn)wp(i.id);throw RangeError(`command "document.openToSide" argument "file": "${r}" could not be opened — it `+"does not exist, or no editor claims its format. Problems has the reason.")}}},{id:"document.reopenClosed",title:"Reopen Closed Document",category:"Document",level:"document",keybinding:"mod+shift+t",menus:["context/tab","palette"],group:"1_file",enablement:()=>m.closedTabs.length>0,requires:"a document closed in this session",run:async()=>{let n=Tn();if(n)await e.openFile(n)}},{id:"document.togglePinned",title:"Pin / Unpin Document",category:"Document",level:"document",menus:["context/tab","palette"],group:"1_file",when:(n)=>n.document.open,requires:"an open document",run:()=>{let n=m.activeTabId,o=n?m.tabs.get(n):null;if(n&&o)kv(n,!o.pinned)}},{args:Se({pinned:oo("True to pin the active document's tab, false to unpin it.")}),id:"document.setPinned",title:"Set Document Pinned",category:"Document",level:"document",menus:["palette"],group:"1_file",when:(n)=>n.document.open,requires:"an open document",run:(n,o)=>{let r=m.activeTabId;if(r&&m.tabs.get(r))kv(r,yi("document.setPinned",o,"pinned"))}},{id:"document.keepOpen",title:"Keep Document Open",category:"Document",level:"document",menus:["context/tab","palette"],group:"1_file",when:(n)=>n.document.open,enablement:()=>{let n=m.activeTabId;return n!==null&&m.tabs.get(n)?.preview===!0},requires:"a preview document — one opened by a single click",run:()=>{let n=m.activeTabId;if(n)Fl(n)}}]}function On(e){let t=()=>m.panes.length>1;return[{id:"pane.splitRight",title:"Split Right",category:"View",level:"document",keybinding:"mod+\\",menus:["context/pane","context/tab","palette"],group:"5_pane",when:(n)=>n.document.open,enablement:()=>m.activeTabId!==null,requires:"an open document",undo:"none",run:()=>{Ox()}},{args:Se({path:He("Project-relative path of the document to open beside this one.")}),id:"pane.compareWith",title:"Compare With…",category:"View",level:"document",menus:["context/pane","context/tab","palette"],group:"5_pane",when:(n)=>n.document.open,enablement:()=>m.activeTabId!==null,requires:"an open document",undo:"none",run:async(n,o)=>{let r=ot("pane.compareWith",o,"path"),i=Rr();if((i.activeTabId?m.tabs.get(i.activeTabId):null)?.documentPath===r)throw RangeError(`command "pane.compareWith" argument "path": "${r}" is the document this pane is `+"already showing — name a different one");await e.openFileInPane(Pl(i.id).id,r)}},{id:"pane.focusPrimary",title:"Focus Primary Pane",category:"View",level:"document",keybinding:"mod+0",menus:["palette"],group:"5_pane",enablement:t,requires:"a split pane grid",undo:"none",run:()=>{$r(Qn)}},{id:"pane.focusSecondary",title:"Focus Side Pane",category:"View",level:"document",keybinding:"mod+alt+0",menus:["palette"],group:"5_pane",enablement:t,requires:"a split pane grid",undo:"none",run:()=>{$r(vp)}},{id:"pane.unsplit",title:"Close Side Pane",category:"View",level:"document",menus:["context/pane","palette"],group:"5_pane",enablement:t,requires:"a second pane",undo:"none",run:wn}]}function wn(){let e=m.panes.find((t)=>t.derived!==null);if(e?.id===Qn){if(e.derived=null,!xp(e))return}wp(e?.id??vp)}
2
- export{Sx,Go,iv,gL,dn,$o,zu,bL,BC,Wu,ov,ha,vL,rv,$d,sv,bm,Ex,yL,vm,zi,Ki,av,Dd,lv,wL,zC,xL,_L,CL,Tx,kL,Lx,SL,ai,cv,WC,EL,TL,fp,Le,LL,dv,ms,uv,IL,Nl,hv,RL,mp,$L,vi,q,Hs,pv,fv,Ix,DL,ym,AL,NL,Rx,OL,Ji,Vu,VC,gp,mv,ML,pa,Ue,kc,Ko,PL,gv,FL,bv,jL,HL,Bs,vv,mr,BL,Uu,zL,WL,VL,Ol,xn,wm,ot,Jo,yv,yi,li,$x,UL,UC,Se,Do,fa,qC,oo,wv,qL,He,GL,Dx,bp,Ax,Ml,xv,_v,Nx,KL,ma,Ad,qu,xm,Cv,JL,Ao,YL,ZL,XL,QL,_m,GC,KC,JC,YC,Qn,vp,ZC,m,u,Rr,Hn,Gu,$r,yp,Ox,Mx,Pl,wp,xp,_p,Ku,Ua,Cp,Sc,No,Fl,Px,kv,XC,Fx,QC,ek,ci,Cm,Sv,tk};
3
-
4
- //# debugId=D2F6E6849DBDB77464756E2164756E21
5
- //# sourceMappingURL=studio-x5g1xk77.js.map