@reformer/builder 3.0.0-beta.6 → 3.0.0-beta.7
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.
- package/README.md +32 -198
- package/bin/reformer-builder.d.mts +7 -9
- package/bin/reformer-builder.mjs +43 -54
- package/dist/assets/css/index-DgRudQqc.css +1 -0
- package/dist/assets/css/monaco-runtime-Ch4loDnq.css +1 -0
- package/dist/assets/i18n/en-DHElWsPO.js +1 -0
- package/dist/assets/i18n/ru-DXsuKRv9.js +1 -0
- package/dist/assets/js/index-BSeq6-8S.js +67 -0
- package/dist/assets/js/index-CQvmAVe0.js +115 -0
- package/dist/assets/js/naming-9aaM0Wbc.js +1 -0
- package/dist/assets/js/rules-CM1OzesO.js +1 -0
- package/dist/assets/js/selectors-BiPlGN2c.js +1 -0
- package/dist/assets/monaco/html-R9lQ-L9C.js +1 -0
- package/dist/assets/monaco/javascript-COUjr2au.js +1 -0
- package/dist/assets/monaco/jsonMode-C3DAkvde.js +12 -0
- package/dist/assets/monaco/monaco-runtime-DNdOZY7f.js +924 -0
- package/dist/assets/monaco/typescript-CVSiBX9O.js +1 -0
- package/dist/assets/monaco/xml-ee1lph4p.js +1 -0
- package/dist/assets/monaco/yaml-DXPc9WLc.js +1 -0
- package/dist/assets/{byok-D0ncJaTq.js → plugins/ai-byok-DgeZQTZb.js} +55 -55
- package/dist/assets/plugins/ai-jKAVkXuU.js +178 -0
- package/dist/assets/plugins/ai-knowledge-docs-DCjqodcj.js +1 -0
- package/dist/assets/plugins/ai-knowledge-index-bUfNPqlZ.js +1 -0
- package/dist/assets/plugins/codegen-B0riFOHC.js +416 -0
- package/dist/assets/{MarkdownPreview-DXY3eJ1Z.js → plugins/editor-markdown-MarkdownPreview-DyHZvj8H.js} +20 -20
- package/dist/assets/plugins/editor-markdown-oiBrRpM4.js +2 -0
- package/dist/assets/plugins/editor-schema-CVPAk-MV.js +4 -0
- package/dist/assets/plugins/plugin-manager-BmjjSqYy.js +1 -0
- package/dist/assets/plugins/templates-DNeIl0cD.js +2 -0
- package/dist/assets/vendor/ajv-CCplthOF.js +8 -0
- package/dist/assets/vendor/collapsible-base-DZxAKbAF-h07cIL_F.js +1 -0
- package/dist/assets/vendor/highlight.js/common-g0-hl6Ud.js +5 -0
- package/dist/assets/vendor/index-jGqhTST4.js +6 -0
- package/dist/assets/vendor/lucide-react/eye-COs0olKf.js +1 -0
- package/dist/assets/vendor/lucide-react/file-code-corner-BMVX-Qf1.js +1 -0
- package/dist/assets/vendor/lucide-react/rotate-ccw-D0mVnqJN.js +1 -0
- package/dist/assets/vendor/lucide-react/wrench-BX6KiYsu.js +1 -0
- package/dist/assets/vendor/message-base-B5jT1FuY-GU8TkaN4.js +1 -0
- package/dist/assets/vendor/reformer-cdk/async-boundary-DPu-1Ifi.js +1 -0
- package/dist/assets/vendor/reformer-cdk/define-steps-CyGUrx9p-B_03D9I7.js +1 -0
- package/dist/assets/vendor/reformer-cdk/file-upload-C_DEa-OT.js +1 -0
- package/dist/assets/vendor/reformer-cdk/form-array-DRkRfAUh.js +1 -0
- package/dist/assets/vendor/reformer-cdk/form-wizard-DFqFjH7E.js +1 -0
- package/dist/assets/vendor/reformer-cdk/index-BXFomK5m.js +1 -0
- package/dist/assets/vendor/reformer-cdk/list-BrqYwhrQ.js +1 -0
- package/dist/assets/vendor/reformer-form-registry/index-s1IAa6Lm.js +1 -0
- package/dist/assets/vendor/reformer-form-registry/loader-BK2c_fCA-D59m3JOQ.js +2 -0
- package/dist/assets/vendor/reformer-form-registry/react-B8lbN6s4.js +1 -0
- package/dist/assets/vendor/reformer-form-registry/storage-BbhnRE7V.js +1 -0
- package/dist/assets/vendor/reformer-form-registry/types-DoMH_n1U-BSN9tyeo.js +1 -0
- package/dist/assets/vendor/reformer-renderer-json/validate-C5Gll2Yt.js +8 -0
- package/dist/assets/vendor/reformer-ui-kit/alert-base-WOl_V-qI-CYoSap05.js +1 -0
- package/dist/assets/vendor/reformer-ui-kit/component-catalog-BKjWf5Yx.js +1 -0
- package/dist/assets/{typescript-BuFxP6n6.js → vendor/typescript/typescript-Dp5hP5cS.js} +1 -1
- package/dist/index.html +4 -4
- package/package.json +15 -18
- package/runtime-config.schema.json +17 -60
- package/dist/assets/App-DRJnHAjE.js +0 -1137
- package/dist/assets/BootError-CiPUX-Tr.js +0 -1
- package/dist/assets/ChatPanel-CnU7eT8N.js +0 -82
- package/dist/assets/CodeEditor-Wv0NRzV8.js +0 -1
- package/dist/assets/RawJsonEditor-c354H_pY.js +0 -1
- package/dist/assets/abap-DLDM7-KI.js +0 -1
- package/dist/assets/apex-DNDY2TF8.js +0 -1
- package/dist/assets/azcli-Y6nb8tq_.js +0 -1
- package/dist/assets/bat-BwHxbl9M.js +0 -1
- package/dist/assets/bicep-CFznDFnq.js +0 -2
- package/dist/assets/boot-5_JU0zay.js +0 -2
- package/dist/assets/cameligo-Bf6VGUru.js +0 -1
- package/dist/assets/clojure-Dnu-v4kV.js +0 -1
- package/dist/assets/coffee-Bd8akH9Z.js +0 -1
- package/dist/assets/cpp-BbWJElDN.js +0 -1
- package/dist/assets/csharp-Co3qMtFm.js +0 -1
- package/dist/assets/csp-D-4FJmMZ.js +0 -1
- package/dist/assets/cypher-cTPe9QuQ.js +0 -1
- package/dist/assets/dart-BOtBlQCF.js +0 -1
- package/dist/assets/dockerfile-BG73LgW2.js +0 -1
- package/dist/assets/ecl-BEgZUVRK.js +0 -1
- package/dist/assets/editor-BzOv8av-.css +0 -1
- package/dist/assets/editor.api-CMCnIB-P.js +0 -865
- package/dist/assets/elixir-BkW5O-1t.js +0 -1
- package/dist/assets/flow9-BeJ5waoc.js +0 -1
- package/dist/assets/freemarker2-C645vQBx.js +0 -3
- package/dist/assets/fsharp-PahG7c26.js +0 -1
- package/dist/assets/go-acbASCJo.js +0 -1
- package/dist/assets/graphql-BxJiqAUM.js +0 -1
- package/dist/assets/handlebars-B5DnoJkq.js +0 -1
- package/dist/assets/hcl-DtV1sZF8.js +0 -1
- package/dist/assets/html-TNLrm0oH.js +0 -1
- package/dist/assets/index--0tYkbnz.js +0 -3
- package/dist/assets/index-BKc-soqk.css +0 -1
- package/dist/assets/index-BLGbxQaR.js +0 -104
- package/dist/assets/index-Bb-H-IRh.js +0 -1
- package/dist/assets/index-BivFj4xA.js +0 -10
- package/dist/assets/index-C_YSTVSM.js +0 -68
- package/dist/assets/index-Crsub4wy.js +0 -5028
- package/dist/assets/index-D2vdVqoN.js +0 -11
- package/dist/assets/index-DBBur3Kg.js +0 -4709
- package/dist/assets/index-DzAasWzr.css +0 -1
- package/dist/assets/ini-Kd9XrMLS.js +0 -1
- package/dist/assets/java-CXBNlu9o.js +0 -1
- package/dist/assets/javascript-YmJoSFNK.js +0 -1
- package/dist/assets/jsonMode-BgHFRVOe.css +0 -1
- package/dist/assets/jsonMode-CUyarZ9Q.js +0 -70
- package/dist/assets/julia-cl7-CwDS.js +0 -1
- package/dist/assets/kotlin-s7OhZKlX.js +0 -1
- package/dist/assets/less-9HpZscsL.js +0 -2
- package/dist/assets/lexon-OrD6JF1K.js +0 -1
- package/dist/assets/liquid-CsrVJLkL.js +0 -1
- package/dist/assets/load-DahhU28W.js +0 -11
- package/dist/assets/lua-Cyyb5UIc.js +0 -1
- package/dist/assets/m3-B8OfTtLu.js +0 -1
- package/dist/assets/mdx-DDXJg3VI.js +0 -1
- package/dist/assets/mips-CiqrrVzr.js +0 -1
- package/dist/assets/monaco-languages-CfiXabIS.js +0 -2
- package/dist/assets/monaco-setup-DPehMZ7o.js +0 -12
- package/dist/assets/msdax-DmeGPVcC.js +0 -1
- package/dist/assets/mysql-C_tMU-Nz.js +0 -1
- package/dist/assets/objective-c-BDtDVThU.js +0 -1
- package/dist/assets/pascal-vHIfCaH5.js +0 -1
- package/dist/assets/pascaligo-DtZ0uQbO.js +0 -1
- package/dist/assets/perl-Ub6l9XKa.js +0 -1
- package/dist/assets/pgsql-BlNEE0v7.js +0 -1
- package/dist/assets/php-BBUBE1dy.js +0 -1
- package/dist/assets/pla-DSh2-awV.js +0 -1
- package/dist/assets/postiats-CocnycG-.js +0 -1
- package/dist/assets/powerquery-tScXyioY.js +0 -1
- package/dist/assets/powershell-COWaemsV.js +0 -1
- package/dist/assets/protobuf-Brw8urJB.js +0 -2
- package/dist/assets/pug-8SOpv6rk.js +0 -1
- package/dist/assets/python-DpnOD9VM.js +0 -1
- package/dist/assets/qsharp-Bw9ernYp.js +0 -1
- package/dist/assets/r-j7ic8hl3.js +0 -1
- package/dist/assets/razor-BsF1GcFZ.js +0 -1
- package/dist/assets/redis-Bu5POkcn.js +0 -1
- package/dist/assets/redshift-Bs9aos_-.js +0 -1
- package/dist/assets/reformer-ui-kit-11-Bml4F8Os.js +0 -1
- package/dist/assets/reformer-ui-kit-BWUaVvO0.js +0 -1
- package/dist/assets/restructuredtext-CqXO7rUv.js +0 -1
- package/dist/assets/ruby-zBfavPgS.js +0 -1
- package/dist/assets/rust-BzKRNQWT.js +0 -1
- package/dist/assets/sb-BBc9UKZt.js +0 -1
- package/dist/assets/scala-D9hQfWCl.js +0 -1
- package/dist/assets/scheme-BPhDTwHR.js +0 -1
- package/dist/assets/scss-CBJaRo0y.js +0 -3
- package/dist/assets/shell-DiJ1NA_G.js +0 -1
- package/dist/assets/solidity-Db0IVjzk.js +0 -1
- package/dist/assets/sophia-CnS9iZB_.js +0 -1
- package/dist/assets/sparql-CJmd_6j2.js +0 -1
- package/dist/assets/sql-ClhHkBeG.js +0 -1
- package/dist/assets/st-CHwy0fLd.js +0 -1
- package/dist/assets/swift-CnmFD0ga.js +0 -1
- package/dist/assets/systemverilog-Bs9z6M-B.js +0 -1
- package/dist/assets/tcl-Dm6ycUr_.js +0 -1
- package/dist/assets/twig-Csy3S7wG.js +0 -1
- package/dist/assets/typescript-D7ER-DvA.js +0 -1
- package/dist/assets/typespec-Btyra-wh.js +0 -1
- package/dist/assets/useFormField-BLbvmpme-CM4hze15.js +0 -1
- package/dist/assets/vb-Db0cS2oM.js +0 -1
- package/dist/assets/wgsl-BTesnYfV.js +0 -298
- package/dist/assets/xml-5MzZ4-DY.js +0 -1
- package/dist/assets/yaml-Ch0E2rII.js +0 -1
- /package/dist/assets/{codicon-Brq4_Ui5.ttf → fonts/codicon-Brq4_Ui5.ttf} +0 -0
- /package/dist/assets/{css-DdJfP1eB.js → monaco/css-DdJfP1eB.js} +0 -0
- /package/dist/assets/{editor.worker-CRaYpIdo.js → monaco/editor.worker-CRaYpIdo.js} +0 -0
- /package/dist/assets/{json.worker-C5PEkLU0.js → monaco/json.worker-C5PEkLU0.js} +0 -0
- /package/dist/assets/{markdown-BFxVWTOG.js → monaco/markdown-BFxVWTOG.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e}from"../../js/index-BSeq6-8S.js";const c=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],a=e("code-xml",c);const o=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],d=e("columns-2",o);const t=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],r=e("eye",t);export{a as C,r as E,d as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e}from"../../js/index-BSeq6-8S.js";const o=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],c=e("file-code-corner",o);export{c as F};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e}from"../../js/index-BSeq6-8S.js";const t=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],h=e("file-code",t);const a=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]],y=e("layout-template",a);const o=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],d=e("rotate-ccw",o);export{h as F,y as L,d as R};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as a}from"../../js/index-BSeq6-8S.js";const t=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],p=a("arrow-down",t);const e=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],k=a("arrow-right",e);const o=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],i=a("blocks",o);const h=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],M=a("braces",h);const c=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}]],l=a("layout-panel-top",c);const s=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],_=a("list",s);const d=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],w=a("sliders-horizontal",d);const n=[["path",{d:"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z",key:"xwnzip"}],["path",{d:"M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6",key:"14rsvq"}]],x=a("square-mouse-pointer",n);const y=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],v=a("wrench",y);export{p as A,M as B,_ as L,x as S,v as W,l as a,k as b,i as c,w as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as n,j as s,y as t}from"../js/index-BSeq6-8S.js";const o=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]],u=n("message-square-plus",o);const d=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],f=n("send",d);const r=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],g=n("sparkles",r);const i=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],x=n("square",i);const m=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],p=n("undo-2",m);function h({className:a,...e}){return s.jsx("div",{"data-slot":"message-group",className:t("flex min-w-0 flex-col gap-2",a),...e})}function y({className:a,align:e="start",...l}){return s.jsx("div",{"data-slot":"message","data-align":e,className:t("group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse",a),...l})}function w({className:a,...e}){return s.jsx("div",{"data-slot":"message-avatar",className:t("flex w-fit min-w-8 shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted group-has-data-[slot=message-footer]/message:-translate-y-8",a),...e})}function k({className:a,...e}){return s.jsx("div",{"data-slot":"message-content",className:t("flex w-full min-w-0 flex-col gap-2.5 wrap-break-word group-data-[align=end]/message:*:data-slot:self-end",a),...e})}function N({className:a,...e}){return s.jsx("div",{"data-slot":"message-header",className:t("flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0",a),...e})}function v({className:a,...e}){return s.jsx("div",{"data-slot":"message-footer",className:t("flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0 group-data-[align=end]/message:justify-end",a),...e})}export{u as M,g as S,p as U,x as a,f as b,w as d,k as g,N as i,h as l,y as m,v as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,j as a,f as N}from"../../js/index-BSeq6-8S.js";const C=t.createContext(null);function p(){const r=t.useContext(C);if(!r)throw new Error("AsyncBoundary.* components must be used within <AsyncBoundary.Root>. Wrap your slots with <AsyncBoundary.Root status={...}>.");return r}function S({status:r,error:e=null,refreshing:s=!1,onRetry:d,delayMs:o=0,id:i}){const c=t.useId(),u=i??c,[f,y]=t.useState(o===0);t.useEffect(()=>{if(o===0){y(!0);return}if(r!=="loading"){y(!1);return}const b=setTimeout(()=>y(!0),o);return()=>clearTimeout(b)},[r,o]);const n=t.useRef(d);n.current=d;const g=t.useCallback(()=>n.current?.(),[]),m=r==="loading"&&f,A=typeof d=="function",l=t.useMemo(()=>Object.freeze({region:`async-${u}`,status:`async-status-${u}`,error:`async-error-${u}`}),[u]);return t.useMemo(()=>({status:r,isIdle:r==="idle",isLoading:m,isReady:r==="ready",isError:r==="error",refreshing:s,error:e,retry:g,canRetry:A,ids:l,rootProps:{id:l.region,"data-status":r,"data-refreshing":s||void 0,"aria-busy":r==="loading"||s||void 0},loadingProps:{id:l.status,role:"status","aria-live":"polite"},errorProps:{id:l.error,role:"alert","aria-live":"assertive"}}),[r,m,s,e,g,A,l])}function K(){return{status:"idle",data:void 0,error:null,refreshing:!1}}function T(r,e){switch(e.kind){case"skip":return{status:"idle",data:void 0,error:null,refreshing:!1};case"load-start":return r.data!==void 0?{...r,status:"ready",error:null,refreshing:!0}:{status:"loading",data:void 0,error:null,refreshing:!1};case"load-success":return{status:"ready",data:e.data,error:null,refreshing:!1};case"load-error":return{status:"error",data:r.data,error:e.error,refreshing:!1};case"abort":return{status:r.data!==void 0?"ready":"idle",data:r.data,error:null,refreshing:!1}}}function $(r){return r instanceof Error?r.message:typeof r=="string"&&r.length>0?r:"Неизвестная ошибка"}function z({load:r,loadKey:e,enabled:s=!0,onSuccess:d,onError:o,toError:i}){const[c,u]=t.useReducer(T,void 0,K),[f,y]=t.useState(0),n=t.useRef(r),g=t.useRef(d),m=t.useRef(o),A=t.useRef(i);n.current=r,g.current=d,m.current=o,A.current=i;const l=t.useRef(null),b=t.useCallback(()=>y(h=>h+1),[]),v=t.useCallback(()=>{l.current&&(l.current.abort(),l.current=null,u({kind:"abort"}))},[]);return t.useEffect(()=>{if(!s){u({kind:"skip"});return}const h=new AbortController;l.current=h;let E=!1;return u({kind:"load-start"}),n.current(h.signal).then(B=>{E||(u({kind:"load-success",data:B}),g.current?.(B))},B=>{if(E||h.signal.aborted)return;const j=(A.current??$)(B);u({kind:"load-error",error:j}),m.current?.(j)}),()=>{E=!0,h.abort(),l.current===h&&(l.current=null)}},[e,s,f]),t.useMemo(()=>({...c,reload:b,abort:v}),[c,b,v])}function H({status:r,data:e,error:s,refreshing:d,onRetry:o,onAbort:i,delayMs:c,id:u,children:f},y){const n=S({status:r,error:s,refreshing:d,onRetry:o,delayMs:c,id:u}),g=t.useMemo(()=>({status:n.status,data:e,isIdle:n.isIdle,isLoading:n.isLoading,isReady:n.isReady,isError:n.isError,refreshing:n.refreshing,error:n.error,retry:n.retry,canRetry:n.canRetry,ids:n.ids,rootProps:n.rootProps,loadingProps:n.loadingProps,errorProps:n.errorProps}),[n,e]);return t.useImperativeHandle(y,()=>({reload:n.retry,abort:()=>i?.(),status:n.status,data:e,error:n.error,isLoading:n.isLoading,refreshing:n.refreshing}),[n,e,i]),a.jsx(C.Provider,{value:g,children:f})}const k=t.forwardRef(H);function W({load:r,loadKey:e,enabled:s=!0,onSuccess:d,onError:o,toError:i,delayMs:c=0,id:u,children:f},y){const n=z({load:r,loadKey:e,enabled:s,onSuccess:d,onError:o,toError:i});return a.jsx(k,{ref:y,status:n.status,data:n.data,error:n.error,refreshing:n.refreshing,onRetry:n.reload,onAbort:n.abort,delayMs:c,id:u,children:f})}const D=t.forwardRef(W);function O({status:r="idle",error:e=null,refreshing:s=!1,onRetry:d,delayMs:o=0,id:i,children:c},u){return a.jsx(k,{ref:u,status:r,data:void 0,error:e,refreshing:s,onRetry:d,delayMs:o,id:i,children:c})}const Q=t.forwardRef(O);function U(r,e){const{load:s}=r;return s?a.jsx(D,{...r,load:s,ref:e}):a.jsx(Q,{...r,ref:e})}const x=t.forwardRef(U);x.displayName="AsyncBoundary.Root";function w({children:r}){const{isIdle:e}=p();return e?a.jsx(a.Fragment,{children:r}):null}w.displayName="AsyncBoundary.Idle";function M({children:r}){const{isLoading:e}=p();return e?a.jsx(a.Fragment,{children:r}):null}M.displayName="AsyncBoundary.Loading";function L({showWhileRefreshing:r=!0,children:e}){const{isReady:s,refreshing:d,data:o}=p();return!s||d&&!r?null:typeof e=="function"?o===void 0?null:a.jsx(a.Fragment,{children:e(o)}):a.jsx(a.Fragment,{children:e})}L.displayName="AsyncBoundary.Content";function P({when:r,children:e}){const{isReady:s}=p();return!s||!r?null:a.jsx(a.Fragment,{children:e})}P.displayName="AsyncBoundary.Empty";function X(r){return typeof r=="function"}function I({children:r}){const{isError:e,error:s,retry:d,canRetry:o}=p();return e?X(r)?a.jsx(a.Fragment,{children:r({error:s,retry:d,canRetry:o})}):a.jsx(a.Fragment,{children:r}):null}I.displayName="AsyncBoundary.Error";const F=t.forwardRef(({asChild:r=!1,children:e,...s},d)=>{const{retry:o,canRetry:i}=p();return i?a.jsx(r?N:"button",{ref:d,type:r?void 0:"button",onClick:o,...s,children:e}):null});F.displayName="AsyncBoundary.Retry";const R=x;R.Root=x;R.Idle=w;R.Loading=M;R.Content=L;R.Empty=P;R.Error=I;R.Retry=F;export{R as AsyncBoundary,L as AsyncBoundaryContent,C as AsyncBoundaryContext,P as AsyncBoundaryEmpty,I as AsyncBoundaryError,w as AsyncBoundaryIdle,M as AsyncBoundaryLoading,F as AsyncBoundaryRetry,x as AsyncBoundaryRoot,T as asyncResourceReducer,$ as defaultToError,K as initialAsyncResourceState,S as useAsyncBoundary,p as useAsyncBoundaryContext,z as useAsyncResource};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as n,j as c,C as V,h as K,i as O,f as k,m as Q}from"../../js/index-BSeq6-8S.js";const L=n.createContext(null);function v(){const t=n.useContext(L);if(!t)throw new Error("useFormWizard must be used within FormWizard");return t}function j({component:t,control:e,children:i,_stepIndex:s,...a}){const{currentStep:p}=v();return s===void 0||p!==s?null:i!==void 0?c.jsx(c.Fragment,{children:i}):t&&e?c.jsx(t,{control:e,...a}):null}j.displayName="FormWizard.Step";function R({steps:t,children:e}){if(typeof e!="function")throw new Error("FormWizard.Indicator requires children as a render function. Example: <FormWizard.Indicator steps={STEPS}>{({ steps }) => <YourUI />}</FormWizard.Indicator>");const{currentStep:i,totalSteps:s,completedSteps:a,goToStep:p}=v(),d={steps:t.map(o=>({...o,isCurrent:i===o.number,isCompleted:a.includes(o.number),canNavigate:o.number===1||a.includes(o.number-1)})),goToStep:p,currentStep:i,totalSteps:s,completedSteps:a};return c.jsx(c.Fragment,{children:e(d)})}R.displayName="FormWizard.Indicator";const M=n.createContext(null);function X(){const t=n.useContext(M);if(!t)throw new Error("FormWizard.Prev/Next/Submit must be used within FormWizard.Actions. Wrap your navigation buttons with <FormWizard.Actions>.");return t}function Z(t){return typeof t=="function"}function $({onSubmit:t,children:e,className:i,style:s}){const{isFirstStep:a,isLastStep:p,isValidating:d,isSubmitting:o,goToNextStep:r,goToPreviousStep:f,submit:u}=v(),S=n.useMemo(()=>({onSubmit:t}),[t]);if(Z(e)){const h=d||o;return c.jsx(c.Fragment,{children:e({prev:{onClick:f,disabled:h},next:{onClick:()=>r(),disabled:h},submit:{onClick:()=>{u(()=>t?.())},disabled:h,isSubmitting:o},isFirstStep:a,isLastStep:p,isValidating:d,isSubmitting:o})})}return c.jsx(M.Provider,{value:S,children:i||s?c.jsx("div",{className:i,style:s,children:e}):c.jsx(c.Fragment,{children:e})})}$.displayName="FormWizard.Actions";function q({children:t}){if(typeof t!="function")throw new Error("FormWizard.Progress requires children as a render function. Example: <FormWizard.Progress>{({ current, total }) => <YourUI />}</FormWizard.Progress>");const{currentStep:e,totalSteps:i,completedSteps:s,isFirstStep:a,isLastStep:p}=v(),d={current:e,total:i,percent:i>0?Math.round(e/i*100):0,completedCount:s.length,isFirstStep:a,isLastStep:p};return c.jsx(c.Fragment,{children:t(d)})}q.displayName="FormWizard.Progress";const U=n.forwardRef(({children:t,asChild:e=!1,disabled:i,...s},a)=>{const{goToPreviousStep:p,isFirstStep:d,isValidating:o,isSubmitting:r}=v();return c.jsx(e?k:"button",{ref:a,type:e?void 0:"button",onClick:p,disabled:i||d||o||r,"data-first-step":d||void 0,...s,children:t})});U.displayName="FormWizard.Prev";const Y=n.forwardRef(({children:t,asChild:e=!1,disabled:i,...s},a)=>{const{goToNextStep:p,isLastStep:d,isValidating:o,isSubmitting:r}=v();return c.jsx(e?k:"button",{ref:a,type:e?void 0:"button",onClick:()=>p(),disabled:i||d||o||r,"data-last-step":d||void 0,...s,children:t})});Y.displayName="FormWizard.Next";const _=n.forwardRef(({children:t,asChild:e=!1,disabled:i,loadingText:s,...a},p)=>{const{isLastStep:d,isValidating:o,isSubmitting:r,submit:f}=v(),{onSubmit:u}=X(),S=i||!d||o||r,h=e?k:"button",g=r&&s;let y=t;return e&&g&&n.isValidElement(t)&&(y=n.cloneElement(t,{},s)),c.jsx(h,{ref:p,type:e?void 0:"submit",onClick:()=>{f(()=>u?.())},disabled:S,"data-submitting":r||void 0,"data-not-last-step":!d||void 0,...a,children:e?y:g?s:t})});_.displayName="FormWizard.Submit";function I(t,e){return t.filter(i=>i<e)}const B={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function D({form:t,config:e,children:i,onStepChange:s,scrollToTop:a=!0},p){const d=l=>{let m=0;return n.Children.forEach(l,b=>{if(n.isValidElement(b))if(b.type===j)m+=1;else{const A=b.props;A.children&&(m+=d(A.children))}}),m},o=d(i),[r,f]=n.useState(1),[u,S]=n.useState([]),[h,g]=n.useState(!1),y=t.submitting.value,F=n.useCallback(async()=>{if(!e.validateStep)return console.warn(`No validateStep callback configured for step ${r}`),!0;g(!0);try{return await e.validateStep(r)}finally{g(!1)}},[r,e]),w=n.useCallback(async()=>{if(!await F())return t.markAsTouched(),!1;if(u.includes(r)||S(l=>[...l,r]),r<o){const l=r+1;f(l),s?.(l),a&&window.scrollTo({top:0,behavior:"smooth"})}return!0},[F,r,u,o,t,s,a]),C=n.useCallback(()=>{if(r>1){const l=r-1;f(l),S(m=>I(m,l)),s?.(l),a&&window.scrollTo({top:0,behavior:"smooth"})}},[r,s,a]),T=n.useCallback(l=>(l===1||u.includes(l-1))&&l>=1&&l<=o?(l<r&&S(m=>I(m,l)),f(l),s?.(l),a&&window.scrollTo({top:0,behavior:"smooth"}),!0):!1,[u,o,r,s,a]),z=n.useCallback(async l=>{g(!0);try{return!e.validateAll||await e.validateAll()?t.submit(l,{skipValidation:!0}):(t.markAsTouched(),null)}finally{g(!1)}},[t,e]),W=r===1,N=r===o;n.useImperativeHandle(p,()=>({form:t,currentStep:r,completedSteps:u,validateCurrentStep:F,goToNextStep:w,goToPreviousStep:C,goToStep:T,submit:z,isFirstStep:W,isLastStep:N,isValidating:h}),[t,r,u,F,w,C,T,z,W,N,h]);const H=n.useMemo(()=>({currentStep:r,totalSteps:o,completedSteps:u,isFirstStep:W,isLastStep:N,isValidating:h,isSubmitting:y,form:t,goToNextStep:w,goToPreviousStep:C,goToStep:T,submit:z}),[r,o,u,W,N,h,y,t,w,C,T,z]);let E=0;const P=l=>n.Children.map(l,m=>{if(!n.isValidElement(m))return m;const b=m.props;return m.type===j?(E+=1,n.cloneElement(m,{...b,_stepIndex:E})):typeof b.children=="function"?m:b.children?n.cloneElement(m,{...b,children:P(b.children)}):m}),G=P(i),J=H;return c.jsxs(L.Provider,{value:J,children:[c.jsx("div",{role:"status","aria-live":"polite","aria-atomic":"true",style:B,children:`Step ${r} of ${o}`}),G]})}const tt=n.forwardRef(D),x=tt;x.Step=j;x.Indicator=R;x.Actions=$;x.Progress=q;x.Prev=U;x.Next=Y;x.Submit=_;function rt(t,e){const i=Object.keys(e.steps),s=()=>{},a=i.map(f=>e.steps[f]).filter(f=>f!=null),p=O(()=>Q(...a,...e.extras?[e.extras]:[])),{strategy:d,debounce:o,liveAfterSubmit:r}=e;return{stepSelectors:i,validateStep:f=>{const u=i[f-1],S=(u!=null?e.steps[u]:null)??s;return V(t,S,{touch:!0})},validateAll:()=>V(t,p,{touch:!0}),createStepController:f=>{if(!d||d==="submit")return null;const u=i[f-1],S=u!=null?e.steps[u]:null;return S==null?null:K(t,S,{strategy:d,debounce:o,liveAfterSubmit:r})}}}export{$ as J,q as K,j as N,U as Q,L as U,v as W,Y as X,R as Y,_ as Z,X as a,rt as f,x as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,j as m,f0 as Je,f as W}from"../../js/index-BSeq6-8S.js";const fe=s.createContext(null);function S(){const t=s.useContext(fe);if(!t)throw new Error("FileUpload.* components must be used within <FileUpload.Root>. Wrap your slots with <FileUpload.Root>.");return t}const ge=s.createContext(null);function O(){const t=s.useContext(ge);if(!t)throw new Error("FileUpload.Item* components must be used within <FileUpload.Item>.");return t}function ye(){return{items:[],rejections:[]}}function ce(t,r){switch(r.kind){case"add":{const e=r.accepted.map((n,i)=>({key:r.keys[i],status:"local",file:n}));return{items:r.replace?e:[...t.items,...e],rejections:r.rejected}}case"remove":{const e=t.items.filter(n=>n.key!==r.key);return e.length===t.items.length?t:{...t,items:e}}case"clear":return ye();case"upload-start":return K(t,r.key,e=>e.status==="local"||e.status==="error"?{key:e.key,status:"uploading",file:e.file,progress:0}:e);case"upload-progress":return K(t,r.key,e=>e.status==="uploading"?{...e,progress:Qe(r.percent)}:e);case"upload-success":return K(t,r.key,e=>e.status==="uploading"?{key:e.key,status:"uploaded",file:e.file,remote:r.remote}:e);case"upload-error":return K(t,r.key,e=>e.status==="uploading"?{key:e.key,status:"error",file:e.file,error:r.error,progress:e.progress}:e);case"retry":return K(t,r.key,e=>e.status==="error"?{key:e.key,status:"local",file:e.file}:e);case"sync-items":return{...t,items:r.items}}}function K(t,r,e){let n=!1;const i=t.items.map(u=>{if(u.key!==r)return u;const k=e(u);return k!==u&&(n=!0),k});return n?{...t,items:i}:t}function Qe(t){return Number.isNaN(t)?0:Math.min(100,Math.max(0,t))}function j(t,r){return{code:t,message:"invalid",params:r}}function Ve(t,r,e){const{accept:n,multiple:i=!1,maxFiles:u,maxFileSize:k,minFileSize:T,maxTotalFileSize:N,preventDuplicates:U=!0,validate:J}=r,Q=i?u??1/0:1,D=e.length,X=e.reduce((c,p)=>c+Ye(p),0),v=[],f=[];let V=0;for(const c of t){const p=[];n&&!Je(c,n)&&p.push(j("fileType",{accept:n,fileName:c.name})),typeof k=="number"&&c.size>k&&p.push(j("maxFileSize",{maxFileSize:k,fileName:c.name,actualSize:c.size})),typeof T=="number"&&c.size<T&&p.push(j("minFileSize",{minFileSize:T,fileName:c.name,actualSize:c.size})),U&&Ze(c,e,v)&&p.push(j("fileExists",{fileName:c.name}));const Y=J?.(c,{existing:e});Y?.length&&p.push(...Y),p.length===0&&(D+v.length+1>Q?p.push(j("maxFiles",{maxFiles:Q,fileName:c.name})):typeof N=="number"&&X+V+c.size>N&&p.push(j("maxTotalFileSize",{maxTotalFileSize:N,fileName:c.name}))),p.length>0?f.push({file:c,errors:p}):(v.push(c),V+=c.size)}return{accepted:v,rejected:f}}function Ye(t){return t.status==="uploaded"?t.file?.size??t.remote.size??0:t.file.size}function Ze(t,r,e){const n=(i,u)=>i===t.name&&u===t.size;return r.some(i=>i.status==="uploaded"?n(i.file?.name??i.remote.name,i.file?.size??i.remote.size):n(i.file.name,i.file.size))||e.some(i=>n(i.name,i.size))}function re(t,r){if(r==="remote"){const n=t.flatMap(i=>i.status==="uploaded"?[i.remote]:[]);return n.length>0?n:null}const e=t.flatMap(n=>n.file?[n.file]:[]);return e.length>0?e:null}function de(t,r,e,n){return r===null||r.length===0?[]:e==="remote"?r.map(i=>t.find(u=>u.status==="uploaded"&&u.remote.id===i.id)??{key:`remote:${i.id}`,status:"uploaded",remote:i}):r.map(i=>t.find(u=>u.file===i)??{key:n(i),status:"local",file:i})}function Xe(t,r){return`${r}:${t.name}:${t.size}:${t.lastModified??""}`}const me=["Б","КБ","МБ","ГБ","ТБ"];function qe(t){if(!Number.isFinite(t)||t<0)return"";let r=t,e=0;for(;r>=1024&&e<me.length-1;)r/=1024,e+=1;const n=e===0?r:Math.round(r*10)/10;return`${Number.isInteger(n)?String(n):n.toFixed(1)} ${me[e]}`}const pe={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0};function ae(t){return t.status==="uploaded"?t.file?.name??t.remote.name:t.file.name}function le(t,r){return t===r?!0:!Array.isArray(t)||!Array.isArray(r)?!1:t.length===r.length&&t.every((e,n)=>e===r[n])}function _e(t){const{value:r,disabled:e=!1,accept:n,multiple:i=!1,maxFiles:u,allowDrop:k=!0,allowPaste:T=!1,capture:N,uploader:U,autoUpload:J=!0,id:Q}=t,D=U?"remote":"local",X=s.useRef(0),v=s.useCallback(a=>Xe(a,++X.current),[]),[f,V]=s.useReducer(ce,void 0,()=>r!=null&&r.length>0?{items:de([],r,U?"remote":"local",v),rejections:[]}:ye()),[c,p]=s.useState(!1),[Y,se]=s.useState(!1),[we,$]=s.useState(""),F=s.useRef(t);F.current=t;const x=s.useRef(f);x.current=f;const Z=s.useRef(null),g=s.useRef(new Map),E=s.useRef(new Map),B=s.useRef(0),G=s.useRef(void 0),Pe=s.useId(),H=Q??Pe,z=s.useMemo(()=>Object.freeze({root:`file-upload-${H}`,hiddenInput:`file-upload-input-${H}`,dropzone:`file-upload-dropzone-${H}`,liveRegion:`file-upload-live-${H}`}),[H]),y=s.useCallback(a=>{const l=ce(x.current,a);return x.current=l,V(a),l},[]),I=s.useCallback(a=>{const l=E.current.get(a);l!==void 0&&(E.current.delete(a),URL.revokeObjectURL(l))},[]),q=s.useRef(U);q.current=U;const w=s.useCallback(a=>{const l=re(a,q.current?"remote":"local");le(l,G.current)||(G.current=l,F.current.onChange?.(l))},[]),ie=s.useCallback((a,l)=>{const o=q.current;if(!o)return;const C=new AbortController;g.current.set(a,C),y({kind:"upload-start",key:a});let h=0;o(l,{onProgress:d=>{const R=Date.now();d<100&&R-h<100||(h=R,y({kind:"upload-progress",key:a,percent:d}))},signal:C.signal}).then(d=>{g.current.delete(a);const R=y({kind:"upload-success",key:a,remote:d}),A=R.items.find(P=>P.key===a);A?.status==="uploaded"&&(F.current.onUploadSuccess?.(A),$(`Файл ${l.name} загружен`),w(R.items))},d=>{g.current.delete(a);const R=C.signal.aborted||d instanceof Error&&d.name==="AbortError",A=R?j("uploadAborted",{fileName:l.name}):j("uploadFailed",{fileName:l.name,reason:d instanceof Error?d.message:String(d)}),P=y({kind:"upload-error",key:a,error:A}).items.find(We=>We.key===a);P?.status==="error"&&(F.current.onUploadError?.(P),$(R?`Загрузка ${l.name} прервана`:`Ошибка загрузки ${l.name}`))})},[y,w]);s.useEffect(()=>{if(!(!U||!J))for(const a of f.items)a.status==="local"&&!g.current.has(a.key)&&ie(a.key,a.file)},[f.items,U,J,ie]);const L=s.useCallback(a=>{const l=F.current;if(l.disabled||a.length===0)return;const o=!(l.multiple??!1),C=o?[]:x.current.items,{accepted:h,rejected:d}=Ve(a,{accept:l.accept,multiple:l.multiple,maxFiles:l.maxFiles,maxFileSize:l.maxFileSize,minFileSize:l.minFileSize,maxTotalFileSize:l.maxTotalFileSize,preventDuplicates:l.preventDuplicates,validate:l.validate},C);if(o)for(const P of x.current.items)g.current.get(P.key)?.abort(),g.current.delete(P.key),I(P.key);const R=h.map(v),A=y({kind:"add",accepted:h,keys:R,rejected:d,replace:o});h.length>0&&(l.onAccept?.(h),$(h.length===1?`Файл ${h[0].name} добавлен`:`Добавлено файлов: ${h.length}`)),d.length>0&&(l.onReject?.(d),$(d.length===1?`Файл ${d[0].file.name} отклонён`:`Отклонено файлов: ${d.length}`)),w(A.items)},[y,w,v,I]),_=s.useCallback(a=>{g.current.get(a)?.abort(),g.current.delete(a),I(a);const l=x.current.items.find(C=>C.key===a),o=y({kind:"remove",key:a});l&&$(`Файл ${ae(l)} удалён`),w(o.items)},[y,w,I]),ee=s.useCallback(()=>{for(const[,l]of g.current)l.abort();g.current.clear();for(const[l]of E.current)I(l);const a=y({kind:"clear"});$("Список файлов очищен"),w(a.items)},[y,w,I]),te=s.useCallback(a=>{y({kind:"retry",key:a})},[y]),je=s.useCallback(a=>{if(a!==void 0){g.current.get(a)?.abort();return}for(const[,l]of g.current)l.abort()},[]),M=s.useCallback(()=>{F.current.disabled||Z.current?.click()},[]),Se=s.useCallback(()=>{Z.current?.focus()},[]),Te=s.useCallback(a=>{const l=x.current.items.find(h=>h.key===a);if(!l)return null;if(!l.file)return l.status==="uploaded"?l.remote.url??null:null;const o=E.current.get(a);if(o!==void 0)return o;if(typeof URL>"u"||typeof URL.createObjectURL!="function")return null;const C=URL.createObjectURL(l.file);return E.current.set(a,C),C},[]);s.useEffect(()=>{if(r===void 0||le(r,G.current))return;if(le(r,re(x.current.items,D))){G.current=r;return}const a=de(x.current.items,r,D,v),l=new Set(a.map(o=>o.key));for(const o of x.current.items)l.has(o.key)||(g.current.get(o.key)?.abort(),g.current.delete(o.key),I(o.key));y({kind:"sync-items",items:a}),G.current=re(a,D)},[r,D,y,v,I]),s.useEffect(()=>{const a=g.current,l=E.current;return()=>{for(const[,o]of a)o.abort();a.clear();for(const[,o]of l)URL.revokeObjectURL(o);l.clear()}},[]),s.useEffect(()=>{const a=Z.current;if(!a)return;const l=()=>F.current.onBlur?.();return a.addEventListener("cancel",l),()=>a.removeEventListener("cancel",l)},[]),s.useEffect(()=>{F.current.onFilesChange?.(f.items)},[f.items]);const Ne=s.useCallback(()=>({id:z.root,"data-dragging":c||void 0,"data-disabled":e||void 0}),[z,c,e]),oe=s.useCallback(()=>{B.current=0,p(!1)},[]),De=s.useCallback(()=>{const a={id:z.dropzone,role:"button",tabIndex:e?-1:0,"aria-disabled":e||void 0,"data-dragging":c||void 0,"data-disabled":e||void 0,onClick:M,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),M())},onFocus:()=>se(!0),onBlur:()=>{se(!1),F.current.onBlur?.()}};return k&&!e&&(a.onDragEnter=l=>{l.preventDefault(),Array.from(l.dataTransfer?.types??[]).includes("Files")&&(B.current+=1,p(!0))},a.onDragOver=l=>{l.preventDefault()},a.onDragLeave=()=>{B.current=Math.max(0,B.current-1),B.current===0&&p(!1)},a.onDrop=l=>{l.preventDefault(),oe();const o=Array.from(l.dataTransfer?.files??[]);o.length>0&&L(o),F.current.onBlur?.()}),T&&!e&&(a.onPaste=l=>{const o=Array.from(l.clipboardData?.files??[]);o.length>0&&(l.preventDefault(),L(o))}),a},[z,e,c,k,T,M,L,oe]),$e=s.useCallback(()=>({type:"button",disabled:e,onClick:M}),[e,M]),ue=s.useCallback(a=>{const l=Array.from(a.target.files??[]);a.target.value="",l.length>0&&L(l),F.current.onBlur?.()},[L]),Ee=s.useCallback(()=>({ref:Z,id:z.hiddenInput,type:"file",accept:n,multiple:i,capture:N,disabled:e,tabIndex:-1,"aria-hidden":!0,style:pe,onChange:ue}),[z,n,i,N,e,ue]),Le=s.useCallback(()=>({role:"list"}),[]),Me=s.useCallback(a=>({role:"listitem","data-status":a.status}),[]),Ae=s.useCallback(a=>({type:"button","aria-label":`Удалить файл ${ae(a)}`,disabled:e,onClick:()=>_(a.key)}),[e,_]),Oe=s.useCallback(a=>({type:"button","aria-label":`Повторить загрузку файла ${ae(a)}`,onClick:()=>te(a.key)}),[te]),Be=s.useCallback(()=>({type:"button",disabled:e||f.items.length===0,onClick:ee}),[e,f.items.length,ee]),Ge=s.useCallback(()=>({id:z.liveRegion,role:"status","aria-live":"polite",style:pe}),[z]),He=i?u??1/0:1,Ke=f.items.some(a=>a.status==="uploading");return{items:f.items,rejections:f.rejections,dragging:c,focused:Y,disabled:e,maxFilesReached:f.items.length>=He,uploading:Ke,liveMessage:we,ids:z,openFilePicker:M,addFiles:L,removeItem:_,clear:ee,retry:te,abort:je,focus:Se,getPreviewUrl:Te,getRootProps:Ne,getDropzoneProps:De,getTriggerProps:$e,getHiddenInputProps:Ee,getItemGroupProps:Le,getItemProps:Me,getItemDeleteTriggerProps:Ae,getItemRetryTriggerProps:Oe,getClearTriggerProps:Be,getLiveRegionProps:Ge}}const ne=s.forwardRef(function({children:t,...r},e){const n=_e(r);return s.useImperativeHandle(e,()=>({openFilePicker:n.openFilePicker,addFiles:n.addFiles,removeItem:n.removeItem,clear:n.clear,retry:n.retry,abort:n.abort,focus:n.focus}),[n]),m.jsxs(fe.Provider,{value:n,children:[m.jsx("input",{...n.getHiddenInputProps()}),t,m.jsx("div",{...n.getLiveRegionProps(),children:n.liveMessage})]})});ne.displayName="FileUpload.Root";const ke=s.forwardRef(function({asChild:t,children:r,...e},n){const{getTriggerProps:i}=S();return m.jsx(t?W:"button",{ref:n,...i(),...e,children:r})});ke.displayName="FileUpload.Trigger";const he=s.forwardRef(function({asChild:t,children:r,...e},n){const{getDropzoneProps:i}=S();return m.jsx(t?W:"div",{ref:n,...i(),...e,children:r})});he.displayName="FileUpload.Dropzone";const be=s.forwardRef(function({children:t,...r},e){const{items:n,getItemGroupProps:i}=S();return n.length===0?null:m.jsx("ul",{ref:e,...i(),...r,children:n.map(u=>t(u))})});be.displayName="FileUpload.ItemGroup";const Fe=s.forwardRef(function({item:t,children:r,...e},n){const{getItemProps:i}=S(),u=s.useMemo(()=>({item:t}),[t]);return m.jsx(ge.Provider,{value:u,children:m.jsx("li",{ref:n,...i(t),...e,children:r})})});Fe.displayName="FileUpload.Item";function et(t){return t.file?.type??t.remote?.type??""}const ve=s.forwardRef(function({children:t,alt:r,...e},n){const{getPreviewUrl:i}=S(),{item:u}=O(),k=et(u).startsWith("image/")?i(u.key):null;return k?m.jsx("img",{ref:n,src:k,alt:r??"",...e}):m.jsx(m.Fragment,{children:t})});ve.displayName="FileUpload.ItemPreview";const xe=s.forwardRef(function(t,r){const{item:e}=O(),n=e.status==="uploaded"?e.file?.name??e.remote.name:e.file.name;return m.jsx("span",{ref:r,...t,children:n})});xe.displayName="FileUpload.ItemName";const Ce=s.forwardRef(function(t,r){const{item:e}=O(),n=e.status==="uploaded"?e.file?.size??e.remote.size:e.file.size;return typeof n!="number"?null:m.jsx("span",{ref:r,...t,children:qe(n)})});Ce.displayName="FileUpload.ItemSize";const Re=s.forwardRef(function({children:t,...r},e){const{item:n}=O();if(n.status!=="uploading")return null;const i=Math.round(n.progress);return m.jsx("div",{ref:e,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":i,"data-progress":i,...r,children:t?t(i):`${i}%`})});Re.displayName="FileUpload.ItemProgress";const ze=s.forwardRef(function({asChild:t,children:r,...e},n){const{getItemDeleteTriggerProps:i}=S(),{item:u}=O();return m.jsx(t?W:"button",{ref:n,...i(u),...e,children:r})});ze.displayName="FileUpload.ItemDeleteTrigger";const Ue=s.forwardRef(function({asChild:t,children:r,...e},n){const{getItemRetryTriggerProps:i}=S(),{item:u}=O();return u.status!=="error"?null:m.jsx(t?W:"button",{ref:n,...i(u),...e,children:r})});Ue.displayName="FileUpload.ItemRetryTrigger";const Ie=s.forwardRef(function({asChild:t,children:r,...e},n){const{getClearTriggerProps:i}=S();return m.jsx(t?W:"button",{ref:n,...i(),...e,children:r})});Ie.displayName="FileUpload.ClearTrigger";const b=ne;b.Root=ne;b.Trigger=ke;b.Dropzone=he;b.ItemGroup=be;b.Item=Fe;b.ItemPreview=ve;b.ItemName=xe;b.ItemSize=Ce;b.ItemProgress=Re;b.ItemDeleteTrigger=ze;b.ItemRetryTrigger=Ue;b.ClearTrigger=Ie;export{b as FileUpload,Ie as FileUploadClearTrigger,fe as FileUploadContext,he as FileUploadDropzone,Fe as FileUploadItem,ge as FileUploadItemContext,ze as FileUploadItemDeleteTrigger,be as FileUploadItemGroup,xe as FileUploadItemName,ve as FileUploadItemPreview,Re as FileUploadItemProgress,Ue as FileUploadItemRetryTrigger,Ce as FileUploadItemSize,ne as FileUploadRoot,ke as FileUploadTrigger,Xe as fileItemKey,ce as fileUploadReducer,qe as formatFileSize,ye as initialFileUploadState,j as makeFileError,re as projectValue,de as reconcileItems,Ve as selectFiles,_e as useFileUpload,S as useFileUploadContext,O as useFileUploadItemContext};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as l,j as o,cR as h,f as p,u as g}from"../../js/index-BSeq6-8S.js";function E(e){const{length:t,value:i,errors:a,valid:s,invalid:d}=h(e);return{items:l.useMemo(()=>e.map((n,r)=>({control:n,index:r,id:n.id??r,remove:()=>e.removeAt(r),moveUp:()=>e.move(r,r-1),moveDown:()=>e.move(r,r+1),canMoveUp:r>0,canMoveDown:r<t-1})),[e,t,i]),length:t,isEmpty:t===0,add:n=>e.push(n),clear:()=>e.clear(),insert:(n,r)=>e.insert(n,r),removeAt:n=>e.removeAt(n),move:(n,r)=>e.move(n,r),swap:(n,r)=>e.swap(n,r),at:n=>e.at(n),errors:a,valid:s,invalid:d}}const y=l.createContext(null),f=l.createContext(null);function v(){const e=l.useContext(y);if(!e)throw new Error("FormArray.* components must be used within FormArray.Root or RenderSchema FormArray");return e}function A(){const e=l.useContext(f);if(!e)throw new Error("FormArray.Item* components must be used within FormArray.List or item template");return e}function R({children:e,className:t,as:i="div"}){const{items:a,move:s}=v(),d=a.length,n=a.map(r=>{const m={...r,moveUp:()=>s(r.index,r.index-1),moveDown:()=>s(r.index,r.index+1),canMoveUp:r.index>0,canMoveDown:r.index<d-1},c=m;return o.jsx(f.Provider,{value:c,children:e(m)},r.id)});return t?l.createElement(i,{className:t},n):o.jsx(o.Fragment,{children:n})}function b({children:e,initialValue:t,asChild:i=!1,disabled:a,...s},d){const{add:n,control:r}=v(),{disabled:m}=h(r),c=a||m;return o.jsx(i?p:"button",{ref:d,type:i?void 0:"button",disabled:c,onClick:()=>{c||n(t)},...s,children:e})}const F=l.forwardRef(b);F.displayName="FormArray.AddButton";const I=F,j=l.forwardRef(({children:e,asChild:t=!1,disabled:i,...a},s)=>{const{remove:d}=A(),n=l.useContext(y),{disabled:r}=h(n?.control),m=i||r;return o.jsx(t?p:"button",{ref:s,type:t?void 0:"button",disabled:m,onClick:()=>{m||d()},...a,children:e})});j.displayName="FormArray.RemoveButton";function B({children:e}){const{isEmpty:t}=v();return t?o.jsx(o.Fragment,{children:e}):null}function N({render:e}){const{length:t}=v();return e?o.jsx(o.Fragment,{children:e(t)}):o.jsx(o.Fragment,{children:t})}function M({render:e}){const{index:t}=A();return e?o.jsx(o.Fragment,{children:e(t)}):o.jsx(o.Fragment,{children:t+1})}const w=l.forwardRef(({asChild:e=!1,multi:t=!1,render:i,children:a,...s},d)=>{const{errors:n}=v(),r=g();if(n.length===0)return null;const m=e?p:"p";return i?o.jsx(o.Fragment,{children:n.map((c,x)=>o.jsx(m,{role:"alert",...s,children:i(c,x)},c.code??x))}):t?o.jsx(o.Fragment,{children:n.map((c,x)=>o.jsx(m,{role:"alert",...s,children:r(c)},c.code??x))}):o.jsx(m,{ref:d,role:"alert",...s,children:a??r(n[0])})});w.displayName="FormArray.Error";function U({control:e,children:t},i){const a=E(e);l.useImperativeHandle(i,()=>({add:a.add,clear:a.clear,insert:a.insert,removeAt:d=>e.removeAt(d),move:a.move,swap:a.swap,length:a.length,isEmpty:a.isEmpty,at:d=>e.at(d)}),[a,e]);const s={...a,control:e};return o.jsx(y.Provider,{value:s,children:t})}const C=l.forwardRef(U),u=C;u.Root=C;u.List=R;u.AddButton=I;u.RemoveButton=j;u.Empty=B;u.Count=N;u.ItemIndex=M;u.Error=w;export{u as FormArray,I as FormArrayAddButton,y as FormArrayContext,N as FormArrayCount,B as FormArrayEmpty,w as FormArrayError,f as FormArrayItemContext,M as FormArrayItemIndex,R as FormArrayList,j as FormArrayRemoveButton,E as useFormArray,v as useFormArrayContext,A as useFormArrayItemContext};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{W as s}from"./define-steps-CyGUrx9p-B_03D9I7.js";import{z,J as F,U as W,Y as f,X as u,Q as x,K as S,N as l,Z as j,f as E,a as N}from"./define-steps-CyGUrx9p-B_03D9I7.js";import{j as o,r as e}from"../../js/index-BSeq6-8S.js";import{f as h}from"../../js/index-BSeq6-8S.js";function i({children:r}){return o.jsx(o.Fragment,{children:r})}i.displayName="Step";function d(r){const{currentStep:a}=s();e.useEffect(()=>{const t=r.createStepController(a);if(t)return t.start()},[r,a])}export{z as FormWizard,F as FormWizardActions,W as FormWizardContext,f as FormWizardIndicator,u as FormWizardNext,x as FormWizardPrev,S as FormWizardProgress,l as FormWizardStep,j as FormWizardSubmit,h as Slot,i as Step,E as defineSteps,s as useFormWizard,N as useFormWizardActions,d as useWizardStepValidation};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{AsyncBoundary as o,AsyncBoundaryContent as t,AsyncBoundaryContext as a,AsyncBoundaryEmpty as s,AsyncBoundaryError as i,AsyncBoundaryIdle as l,AsyncBoundaryLoading as d,AsyncBoundaryRetry as n,AsyncBoundaryRoot as F,asyncResourceReducer as m,defaultToError as y,initialAsyncResourceState as u,useAsyncBoundary as p,useAsyncBoundaryContext as A,useAsyncResource as c}from"./async-boundary-DPu-1Ifi.js";import{FormArray as C,FormArrayAddButton as U,FormArrayContext as I,FormArrayCount as R,FormArrayEmpty as g,FormArrayItemContext as f,FormArrayItemIndex as B,FormArrayList as z,FormArrayRemoveButton as E,useFormArray as L,useFormArrayContext as W,useFormArrayItemContext as v}from"./form-array-DRkRfAUh.js";import{List as T,ListContext as P,ListItemContext as D,useList as V,useListContext as k,useListItemContext as K}from"./list-BrqYwhrQ.js";import{g as N,$ as b,A as j,T as w,R as G,k as J,E as Y,l as $,d as h,n as q,z as H,x as O,u as Q}from"../../js/index-BSeq6-8S.js";import{FileUpload as Z,FileUploadClearTrigger as _,FileUploadContext as ee,FileUploadDropzone as re,FileUploadItem as oe,FileUploadItemContext as te,FileUploadItemDeleteTrigger as ae,FileUploadItemGroup as se,FileUploadItemName as ie,FileUploadItemPreview as le,FileUploadItemProgress as de,FileUploadItemRetryTrigger as ne,FileUploadItemSize as Fe,FileUploadRoot as me,FileUploadTrigger as ye,fileItemKey as ue,fileUploadReducer as pe,formatFileSize as Ae,initialFileUploadState as ce,makeFileError as xe,projectValue as Ce,reconcileItems as Ue,selectFiles as Ie,useFileUpload as Re,useFileUploadContext as ge,useFileUploadItemContext as fe}from"./file-upload-C_DEa-OT.js";import{z as ze,J as Ee,U as Le,Y as We,K as ve,N as Se,f as Te,W as Pe}from"./define-steps-CyGUrx9p-B_03D9I7.js";export{o as AsyncBoundary,t as AsyncBoundaryContent,a as AsyncBoundaryContext,s as AsyncBoundaryEmpty,i as AsyncBoundaryError,l as AsyncBoundaryIdle,d as AsyncBoundaryLoading,n as AsyncBoundaryRetry,F as AsyncBoundaryRoot,Z as FileUpload,_ as FileUploadClearTrigger,ee as FileUploadContext,re as FileUploadDropzone,oe as FileUploadItem,te as FileUploadItemContext,ae as FileUploadItemDeleteTrigger,se as FileUploadItemGroup,ie as FileUploadItemName,le as FileUploadItemPreview,de as FileUploadItemProgress,ne as FileUploadItemRetryTrigger,Fe as FileUploadItemSize,me as FileUploadRoot,ye as FileUploadTrigger,C as FormArray,U as FormArrayAddButton,I as FormArrayContext,R as FormArrayCount,g as FormArrayEmpty,f as FormArrayItemContext,B as FormArrayItemIndex,z as FormArrayList,E as FormArrayRemoveButton,N as FormField,b as FormFieldContext,j as FormFieldControl,w as FormFieldDescription,G as FormFieldError,J as FormFieldLabel,Y as FormFieldRoot,ze as FormWizard,Ee as FormWizardActions,Le as FormWizardContext,We as FormWizardIndicator,ve as FormWizardProgress,Se as FormWizardStep,T as List,P as ListContext,D as ListItemContext,$ as ValidationMessagesProvider,m as asyncResourceReducer,h as createMessageResolver,q as defaultErrorResolver,y as defaultToError,Te as defineSteps,ue as fileItemKey,pe as fileUploadReducer,Ae as formatFileSize,u as initialAsyncResourceState,ce as initialFileUploadState,xe as makeFileError,Ce as projectValue,Ue as reconcileItems,Ie as selectFiles,p as useAsyncBoundary,A as useAsyncBoundaryContext,c as useAsyncResource,Re as useFileUpload,ge as useFileUploadContext,fe as useFileUploadItemContext,L as useFormArray,W as useFormArrayContext,v as useFormArrayItemContext,H as useFormField,O as useFormFieldContext,Pe as useFormWizard,V as useList,k as useListContext,K as useListItemContext,Q as useValidationErrorResolver};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,j as n,cR as h}from"../../js/index-BSeq6-8S.js";function p(t){const{length:e,value:r}=h(t);return{items:s.useMemo(()=>t.map((i,o)=>({control:i,index:o,id:i.id??o})),[t,e,r]),length:e,isEmpty:e===0}}const a=s.createContext(null),m=s.createContext(null);function l(){const t=s.useContext(a);if(!t)throw new Error("List.* components must be used within List.Root");return t}function C(){const t=s.useContext(m);if(!t)throw new Error("List item components must be used within List.Items");return t}function d({control:t,children:e}){const r=p(t);return n.jsx(a.Provider,{value:r,children:e})}function L({children:t,className:e,as:r="div"}){const{items:i}=l(),o=i.map(c=>{const x=c;return n.jsx(m.Provider,{value:x,children:t(c)},c.id)});return e?s.createElement(r,{className:e},o):n.jsx(n.Fragment,{children:o})}function f({children:t}){const{isEmpty:e}=l();return e?n.jsx(n.Fragment,{children:t}):null}const u=d;u.Root=d;u.Items=L;u.Empty=f;export{u as List,a as ListContext,m as ListItemContext,p as useList,l as useListContext,C as useListItemContext};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as X,$ as ee,R as te,A as re,B as ae,k as se,D as ne,L as oe,J as ie,K as ce,I as le,b as de,T as ue}from"./loader-BK2c_fCA-D59m3JOQ.js";import{d as M}from"./types-DoMH_n1U-BSN9tyeo.js";import"../../js/index-BSeq6-8S.js";function D(r){const t=r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\/:([A-Za-z_][\w]*)/g,"/(?<$1>[^/]+)").replace(/\*/g,".*");return new RegExp(`^${t}/?$`)}const S=new Map;function k(r){let t=S.get(r);return t||(t=D(r),S.set(r,t)),t}function J(r,t){switch(t.by){case"id":return r.id===t.id&&(t.version===void 0||r.version===t.version);case"slot":return r.placement?.slots?.includes(t.slot)??!1;case"route":return r.placement?.routes?.some(n=>k(n).test(t.path))??!1;case"tag":return r.meta?.tags?.includes(t.tag)??!1}}function z(r,t){const n=r.access;return n?n.permissions?.some(s=>!t.permissions.has(s))||n.flags?.some(s=>!t.flags.has(s))?!1:n.canRender?n.canRender(t):!0:!0}function H(r,t){const n=r.split(/[.\-+]/),s=t.split(/[.\-+]/);for(let h=0;h<Math.max(n.length,s.length);h++){const w=n[h]??"",l=s[h]??"",p=Number(w),a=Number(l),i=!Number.isNaN(p)&&!Number.isNaN(a)&&w!==""&&l!==""?a-p:l.localeCompare(w);if(i!==0)return i}return 0}function O(r,t){const n=r.placement?.priority??0,s=t.placement?.priority??0;return n!==s?s-n:H(r.version,t.version)}function T(r,t,n){return r.filter(s=>J(s,t)).filter(s=>z(s,n)).sort(O)}function j(r,t){for(const n of r.placement?.routes??[]){const s=k(n).exec(t);if(s)return{...s.groups}}}const K=Symbol.for("reformer.form-registry.v1");function C(){const r=globalThis;return r[K]??={}}const W=r=>`${r.id}@${r.version}`;function I(){const r=new Map,t=new Set,n=[];let s=[],h=!0;const w=()=>(h&&(s=[...r.values()],h=!1),s),l=()=>{h=!0,t.forEach(a=>a())},p=(a,i)=>{const u=W(a),g=r.get(u),b=i?.onConflict??"throw";if(g&&g!==a){if(b==="keep")return n.push({level:"warn",code:"duplicate-entry-kept",message:`Форма ${u} уже зарегистрирована владельцем "${g.owner}"; регистрация от "${a.owner}" проигнорирована.`,entry:{id:a.id,version:a.version,owner:a.owner}}),()=>{};if(b==="throw")throw new Error(`Конфликт в реестре форм: ${u} уже зарегистрирована владельцем "${g.owner}", повторная регистрация от "${a.owner}". Разведите id по владельцам или передайте { onConflict: 'replace' | 'keep' }, если перекрытие намеренное.`);n.push({level:"warn",code:"duplicate-entry-replaced",message:`Форма ${u} от "${g.owner}" заменена регистрацией от "${a.owner}".`,entry:{id:a.id,version:a.version,owner:a.owner}})}r.set(u,a),l();let $=!1;return()=>{$||($=!0,r.get(u)===a&&(r.delete(u),l()))}};return{register:p,registerAll(a,i){const u=a.map(g=>p(g,i));return()=>u.forEach(g=>g())},list:w,resolve:(a,i)=>T(w(),a,i),subscribe(a){return t.add(a),()=>t.delete(a)},get diagnostics(){return n}}}function B(){const r=C();return r.instance??=I()}function G(){C().instance=void 0}const U={"l1-hit":"l1Hit","l2-hit":"l2Hit",dedup:"dedup",stale:"stale",miss:"miss",fetched:"fetched",refetched:"refetched",revalidated:"revalidated",error:"error",aborted:"aborted"},V={"cache-read-failed":"l2ReadFailed","cache-write-failed":"l2WriteFailed","cache-corrupt":"l2Corrupt"},L=()=>({l1Hit:0,l2Hit:0,dedup:0,stale:0,miss:0,fetched:0,refetched:0,revalidated:0,error:0,aborted:0,l2ReadFailed:0,l2WriteFailed:0,l2Corrupt:0,bytesFromNetwork:0});function Q(r={}){const{storage:t,maxAgeMs:n=300*1e3,now:s=Date.now,onDiagnostic:h,onEvent:w}=r,l=new Map,p=new Map;let a=L();const i=(e,o,c)=>{a[U[e]]++,c?.bytes!==void 0&&(a.bytesFromNetwork+=c.bytes),w?.({type:e,key:o,...c})},u=(e,o,c)=>{a[V[e]]++,h?.({code:e,key:o,message:c})},g=async e=>{if(t)try{return await t.get(e)}catch(o){u("cache-read-failed",e,`L2 недоступен: ${String(o)}`);return}},b=async(e,o,c,f)=>{if(!t)return;const d=s();try{await t.set({key:e,body:o,etag:c,size:f??M(o),storedAt:d,lastUsedAt:d})}catch(F){u("cache-write-failed",e,`не записалось в L2: ${String(F)}`)}};function $(e,o,c){const f=l.get(e);if(f&&s()-f.storedAt<n)return i("l1-hit",e),Promise.resolve(f.entry.value);const d=p.get(e);return d?(i("dedup",e),x(e,d,c)):P(e,o,c)}function P(e,o,c){const f=new AbortController,d={waiters:1,controller:f,promise:void 0};p.set(e,d),d.promise=(async()=>{const y=await g(e);let m;if(y){try{m={value:JSON.parse(y.body),etag:y.etag}}catch{u("cache-corrupt",e,"тело в L2 не разобралось, запись отброшена"),await t?.delete(e).catch(()=>{})}if(m&&s()-y.storedAt<n)return i("l2-hit",e),l.set(e,{entry:m,storedAt:y.storedAt}),m}i(m?"stale":"miss",e);const E=s();try{const v=await o(m?.etag,f.signal);if(v.notModified){if(!m)throw new Error(`[form-registry] ${e}: сервер ответил 304, но кэшированного тела нет`);return i("revalidated",e,{durationMs:s()-E}),l.set(e,{entry:m,storedAt:s()}),await b(e,JSON.stringify(m.value),m.etag),m}const A={value:v.data,etag:v.etag},N=JSON.stringify(v.data),R=M(N);return i(m?"refetched":"fetched",e,{durationMs:s()-E,bytes:R}),l.set(e,{entry:A,storedAt:s()}),await b(e,N,v.etag,R),A}catch(v){throw i(f.signal.aborted?"aborted":"error",e,{durationMs:s()-E}),v}})();const F=()=>{d.waiters--,d.waiters<=0&&f.abort()};return c?.addEventListener("abort",F,{once:!0}),d.promise.finally(()=>{c?.removeEventListener("abort",F),p.get(e)===d&&p.delete(e)}).then(y=>y.value)}function x(e,o,c){o.waiters++;const f=()=>{o.waiters--,o.waiters<=0&&o.controller.abort()};return c?.addEventListener("abort",f,{once:!0}),o.promise.then(d=>d.value).finally(()=>c?.removeEventListener("abort",f))}return{get:$,async invalidate(e){l.delete(e),await t?.delete(e).catch(()=>{})},async clear(){l.clear(),await t?.clear().catch(()=>{})},get memorySize(){return l.size},stats:()=>({...a}),resetStats(){a=L()}}}export{X as FormFetchError,ee as FormLoadError,te as FormPreflightError,re as assertFormSchemaShape,O as byPriorityThenVersionDesc,ae as collectModelPaths,D as compileRoute,I as createFormRegistry,Q as createSchemaCache,se as entryKeyOf,ne as fetchJson,oe as formatPreflight,B as getFormRegistry,ie as hasPath,ce as loadForm,j as matchRouteParams,z as passesGate,le as preflight,G as resetFormRegistry,T as resolveForms,de as retryDelay,ue as satisfiesRange};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{H as x,Y as S,a as N,b as M,e as A}from"../../js/index-BSeq6-8S.js";class g extends Error{constructor(n,t,r,o,i){super(`[form-registry] ${t}: ${r}`),this.kind=n,this.url=t,this.status=o,this.cause=i,this.name="FormFetchError"}}const E=new Set([408,425,429,500,502,503,504]),F=e=>new Promise(n=>setTimeout(n,e));function $(e,n,t,r){if(r){const i=Number(r);if(Number.isFinite(i)&&i>=0)return i*1e3;const a=Date.parse(r);if(!Number.isNaN(a))return Math.max(0,a-Date.now())}const o=n*2**e;return Math.round(o*(.5+t()*.5))}const O=e=>!e||/\bjson\b/i.test(e);async function P(e,n={}){const{init:t,signal:r,etag:o,retries:i=2,retryBaseMs:a=250,fetchImpl:f=fetch,sleep:s=F,random:l=Math.random}=n,u=new Headers(t?.headers);u.has("accept")||u.set("accept","application/json"),o&&u.set("if-none-match",o);let w;for(let h=0;h<=i;h++){if(r?.aborted)throw new g("aborted",e,"запрос отменён");let c;try{c=await f(e,{...t,headers:u,signal:r})}catch(d){if(r?.aborted)throw new g("aborted",e,"запрос отменён",void 0,d);if(w=d,h===i)throw new g("network",e,"сеть недоступна",void 0,d);await s($(h,a,l));continue}if(c.status===304)return{data:void 0,etag:o,notModified:!0};if(!c.ok){if(E.has(c.status)&&h<i){await s($(h,a,l,c.headers.get("retry-after")));continue}throw new g("http-error",e,`HTTP ${c.status}`,c.status)}const p=c.headers.get("content-type");if(!O(p))throw new g("not-json",e,`ожидался JSON, получен content-type "${p}" — похоже на SPA-fallback (index.html)`,c.status);let m;try{m=await c.text()}catch(d){throw new g("network",e,"тело ответа не дочиталось",c.status,d)}try{return{data:JSON.parse(m),etag:c.headers.get("etag")??void 0,notModified:!1}}catch(d){throw new g("not-json",e,"тело не разобралось как JSON",c.status,d)}}throw new g("network",e,"исчерпаны попытки",void 0,w)}function B(e,n){if(!n||typeof n!="object"||Array.isArray(n))throw new g("not-a-form-schema",e,"ожидался объект схемы");if(!("root"in n))throw new g("not-a-form-schema",e,"в объекте нет обязательного поля `root` — это не схема формы")}function D(e,n){const t=n.trim();if(!t||t==="*"||t==="x")return!0;const r=l=>l.replace(/^[v=]+/,"").split(/[.\-+]/).slice(0,3).map(u=>u==="x"||u==="*"?-1:Number(u)).map(u=>Number.isFinite(u)?u:-1),o=(l,u)=>{for(let w=0;w<3;w++){const h=l[w]??0,c=u[w]??0;if(h!==c)return h<c?-1:1}return 0},i=r(e),a=/^(>=|<=|>|<|\^|~)?\s*(.+)$/.exec(t),f=a?.[1]??"",s=r(a?.[2]??t);if(s.includes(-1)){for(let l=0;l<3;l++){if(s[l]===-1)return!0;if((i[l]??0)!==s[l])return!1}return!0}switch(f){case">=":return o(i,s)>=0;case">":return o(i,s)>0;case"<=":return o(i,s)<=0;case"<":return o(i,s)<0;case"^":return s[0]>0?i[0]===s[0]&&o(i,s)>=0:s[1]>0?i[0]===0&&i[1]===s[1]&&o(i,s)>=0:o(i,s)===0;case"~":return i[0]===s[0]&&i[1]===s[1]&&o(i,s)>=0;default:return o(i,s)===0}}function H(e){const n=new Set,t=r=>{if(typeof r=="string"){const o=/^\$model\(([^)]*)\)$/.exec(r);o?.[1]&&n.add(o[1]);return}if(Array.isArray(r)){r.forEach(t);return}if(r&&typeof r=="object")for(const o of Object.values(r))t(o)};return t(e.root),[...n]}function I(e,n){if(/(^|\.)\d+(\.|$)/.test(n))return!0;let t=e;for(const r of n.split(".")){if(t===null||typeof t!="object"||!(r in t))return!1;t=t[r]}return!0}function J(e){const{entry:n,schema:t,registry:r,initial:o,validation:i}=e,a=[],f=t;n.compatibleSchema&&f.version&&!D(f.version,n.compatibleSchema)&&a.push({code:"schema-version-drift",level:"error",items:[f.version],message:`схема версии ${f.version} вне диапазона "${n.compatibleSchema}", объявленного кодом. Похоже, схему выкатили вперёд кода — обновите микрофронт либо откатите схему.`});const s=[];f.id&&f.id!==n.id&&s.push(`id: ждали "${n.id}", получили "${f.id}"`),s.length&&a.push({code:"schema-identity-mismatch",level:"error",items:s,message:`схема не соответствует записи (${s.join("; ")})`});const l=S(t),u=l.components.filter(m=>!r.has(m));u.length&&a.push({code:"missing-components",level:"error",items:u,message:`в реестре нет компонентов: ${u.join(", ")}`});const w=new Set(N(r)),h=l.dataSources.filter(m=>!w.has(m));h.length&&a.push({code:"missing-data-sources",level:"error",items:h,message:`в реестре нет источников данных: ${h.join(", ")}`});const c=new Set(M(r)),p=l.fns.filter(m=>!c.has(m));if(p.length&&a.push({code:"missing-fns",level:"error",items:p,message:`в реестре нет функций: ${p.join(", ")}`}),i?.steps){const m=A(t),d=Object.keys(i.steps).filter(k=>!m.has(k));d.length&&a.push({code:"unknown-step-selectors",level:"error",items:d,message:`валидация ссылается на несуществующие шаги: ${d.join(", ")}. Известные селекторы: ${[...m].sort().join(", ")||"(нет)"}. Переименованный шаг иначе просто перестал бы валидироваться — молча.`})}if(o!=null){const m=H(t).filter(d=>!I(o,d));m.length&&a.push({code:"unmaterialized-model-paths",level:"warn",items:m,message:`в начальных значениях нет полей: ${m.join(", ")}. У таких полей нет сигнала, поэтому ни поведение, ни ошибки валидации к ним не привяжутся — и это не проявится ничем, кроме «валидация не работает».`})}return{ok:!a.some(m=>m.level==="error"),problems:a}}function K(e,n){return n.problems.length?[`Форма ${e} не прошла проверку:`,...n.problems.map(t=>` • [${t.level}] ${t.message}`)].join(`
|
|
2
|
+
`):`${e}: проверки пройдены`}class v extends Error{constructor(n,t,r,o){super(`[form-registry] ${n}: ${t} — ${r}`),this.entryKey=n,this.part=t,this.cause=o,this.name="FormLoadError"}}class T extends Error{constructor(n,t){super(K(n,t)),this.entryKey=n,this.result=t,this.name="FormPreflightError"}}const j=e=>`${e.id}@${e.version}`,R=(e,n)=>`${e.owner}/${e.id}@${e.version}#${n}`;async function b(e,n,t,r){if(!e)return;const o=j(n);if(e.kind==="inline")return e.value;if(e.kind==="module")try{return await e.load()}catch(a){throw new v(o,t,"модуль не загрузился",a)}const i=async(a,f)=>{const s=await P(e.url,{init:e.init,signal:f,etag:a,fetchImpl:r.fetchImpl});return!s.notModified&&t==="schema"&&B(e.url,s.data),s};try{return r.cache?await r.cache.get(R(n,t),i,r.signal):(await i(void 0,r.signal??new AbortController().signal)).data}catch(a){throw new v(o,t,`не загрузилось по сети (${e.url})`,a)}}async function y(e,n,t){if(e){if(e.kind==="inline")return e.value;try{return await e.load()}catch(r){throw new v(n,t,"модуль не загрузился",r)}}}async function C(e,n,t={}){const r=j(e),[o,i,a,f,s,l,u]=await Promise.all([b(e.schema,e,"schema",t),y(e.registry,r,"registry"),b(e.initial,e,"initial",t),y(e.model,r,"model"),y(e.behavior,r,"behavior"),y(e.validation,r,"validation"),y(e.renderBehavior,r,"renderBehavior")]);if(!o)throw new v(r,"schema","схема не загрузилась");if(!a&&!f)throw new v(r,"model","нужны либо `initial` (начальные значения), либо `model` (фабрика модели)");const w=i?x(n,i):n;let h;const c=t.preflight??"error";if(c!=="off"){h=J({entry:e,schema:o,registry:w,initial:a,validation:l});for(const p of h.problems)t.onDiagnostic?.({code:p.code,message:p.message,entryKey:r,level:p.level});if(!h.ok&&c==="error")throw new T(r,h)}return{schema:o,registry:w,initial:a,makeModel:f,behavior:s,validation:l,makeRenderBehavior:u,preflight:h}}export{v as $,B as A,H as B,P as D,J as I,I as J,C as K,K as L,T as R,D as T,$ as b,j as k,g as p};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as n,j as m,X as F,Q as k,F as j,G as E}from"../../js/index-BSeq6-8S.js";import{k as v,K as M}from"./loader-BK2c_fCA-D59m3JOQ.js";const x=n.createContext(null);function I({registry:r,context:e,baseRegistry:s,cache:t,options:i,children:a}){const o=n.useSyncExternalStore(r.subscribe,r.list,r.list),{onDiagnostic:c,preflight:l,fetchImpl:d}=i??{},y=n.useMemo(()=>({registry:r,entries:o,ctx:e,baseRegistry:s,cache:t,options:{onDiagnostic:c,preflight:l,fetchImpl:d}}),[r,o,e,s,t,c,l,d]);return m.jsx(x.Provider,{value:y,children:a})}function p(){const r=n.useContext(x);if(!r)throw new Error("[form-registry] Компонент использован вне <FormRegistryProvider>. Оберните поддерево провайдером с registry, context и baseRegistry.");return r}function S(r,e,s){const[t,i]=n.useState({status:"pending"}),[a,o]=n.useState(0),c=n.useCallback(()=>o(f=>f+1),[]),l=v(r),d=n.useRef(r);d.current=r;const y=n.useRef(s);y.current=s;const h=s?.cache;return n.useEffect(()=>{let f=!1;return i({status:"pending"}),M(d.current,e,y.current).then(u=>{f||i({status:"ready",data:u})},u=>{f||i({status:"error",error:u instanceof Error?u:new Error(String(u))})}),()=>{f=!0}},[l,e,h,a]),t.status==="ready"&&t.data?{status:"ready",data:t.data}:t.status==="error"&&t.error?{status:"error",error:t.error,retry:c}:{status:"pending"}}function w({entry:r,loaded:e,initial:s,model:t,renderBehaviorOptions:i,errorFallback:a,onReady:o}){const c=F(()=>k({schema:e.schema,registry:e.registry,...t?{model:t}:e.makeModel?{model:e.makeModel()}:{initial:s??e.initial},behavior:e.behavior,...e.validation?{validation:e.validation}:{},...e.makeRenderBehavior?{renderBehavior:(l,d,y)=>e.makeRenderBehavior(l,d,y,i)}:{}}));return n.useEffect(()=>{o?.(c)},[c,o]),m.jsx(j,{resetKey:c,fallback:a?l=>a(l,r):void 0,children:m.jsx(E,{form:c,registry:e.registry,validateSchema:!1})})}function b({entry:r,...e}){const{baseRegistry:s,cache:t,options:i}=p(),{onDiagnostic:a,preflight:o,fetchImpl:c}=i,{id:l,version:d,owner:y}=r,h=n.useCallback(g=>a?.({level:g.level??"warn",code:g.code,message:g.message,entry:{id:l,version:d,owner:y}}),[a,l,d,y]),f=n.useMemo(()=>({cache:t,preflight:o,fetchImpl:c,onDiagnostic:a?h:void 0}),[t,o,c,a,h]),u=S(r,s,f);return u.status==="pending"?e.fallback??null:u.status==="error"?e.loadErrorFallback?.(u.error,u.retry)??null:m.jsx(w,{entry:r,loaded:u.data,initial:e.initial,model:e.model,renderBehaviorOptions:e.renderBehaviorOptions,errorFallback:e.errorFallback,onReady:e.onReady})}function D({id:r,version:e,...s}){const{entries:t,ctx:i,registry:a}=p(),o=n.useMemo(()=>a.resolve({by:"id",id:r,version:e},i)[0],[a,t,r,e,i]);return o?m.jsx(b,{entry:o,...s},v(o)):null}function R({query:r,...e}){const{entries:s,ctx:t,registry:i}=p(),a=n.useMemo(()=>i.resolve(r,t),[i,s,r,t]);return m.jsx(m.Fragment,{children:a.map(o=>m.jsx(b,{entry:o,...e},v(o)))})}function K({name:r,...e}){const s=n.useMemo(()=>({by:"slot",slot:r}),[r]);return m.jsx(R,{query:s,...e})}function O({path:r,...e}){const s=n.useMemo(()=>({by:"route",path:r}),[r]);return m.jsx(R,{query:s,...e})}export{D as FormOutlet,I as FormRegistryProvider,O as FormRoute,K as FormSlot,w as MountedForm,p as useFormRegistryContext,S as useFormResource};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as b,l as A,A as v}from"./types-DoMH_n1U-BSN9tyeo.js";import{d as T,a as q}from"./types-DoMH_n1U-BSN9tyeo.js";function D(c={}){const u=c.maxBytes??A,o=new Map;let s=0;const f=()=>{for(const n of v([...o.values()],s,u)){const y=o.get(n);y&&(s-=y.size,o.delete(n))}};return{name:"memory",async get(n){const y=o.get(n);if(!y)return;const w={...y,lastUsedAt:Date.now()};return o.set(n,w),w},async set(n){const y=o.get(n.key);y&&(s-=y.size),o.set(n.key,n),s+=n.size,f()},async delete(n){const y=o.get(n);y&&(s-=y.size,o.delete(n))},async keys(){return[...o.keys()]},async clear(){o.clear(),s=0},async estimate(){return{usage:s,quota:u}}}}const U=D(),h="records";function S(){try{return typeof indexedDB<"u"&&indexedDB!==null}catch{return!1}}const x=c=>new Promise((u,o)=>{c.onsuccess=()=>u(c.result),c.onerror=()=>o(c.error??new Error("IndexedDB request failed"))});function k(c={}){const u=(c.namespace??b).replace(/\//g,"_"),o=c.maxBytes??A;let s;const f=()=>s||(s=new Promise((r,e)=>{const t=indexedDB.open(u,1);t.onupgradeneeded=()=>{const a=t.result;a.objectStoreNames.contains(h)||a.createObjectStore(h,{keyPath:"key"})},t.onsuccess=()=>{const a=t.result;a.onclose=()=>{s=void 0},a.onversionchange=()=>{a.close(),s=void 0},r(a)},t.onerror=()=>e(t.error??new Error("IndexedDB open failed")),t.onblocked=()=>e(new Error("IndexedDB open blocked by another connection"))}).catch(r=>{throw s=void 0,r}),s),n=async(r,e)=>{const t=await f();return new Promise((a,i)=>{const l=t.transaction(h,r);let d,g=!1;l.oncomplete=()=>{g||a(d)},l.onabort=()=>{g=!0,i(l.error??new Error("IndexedDB transaction aborted"))},l.onerror=()=>{g=!0,i(l.error??new Error("IndexedDB transaction failed"))},Promise.resolve(e(l.objectStore(h))).then(p=>{d=p,r==="readonly"&&!g&&a(p)}).catch(p=>{g=!0;try{l.abort()}catch{}i(p)})})},y=r=>r instanceof DOMException?r.name==="QuotaExceededError"||r.name==="NS_ERROR_DOM_QUOTA_REACHED":r instanceof Error&&/quota/i.test(r.message),w=()=>n("readonly",r=>x(r.getAll())),m=async r=>{const e=await w(),t=e.reduce((i,l)=>i+l.size,0)+r,a=v(e,t,o);a.length&&await n("readwrite",i=>{for(const l of a)i.delete(l)})};return{name:"indexeddb",async get(r){const e=await n("readonly",a=>x(a.get(r)));if(!e)return;const t={...e,lastUsedAt:Date.now()};try{await n("readwrite",a=>{a.put(t)})}catch{}return t},async set(r){await m(r.size);try{await n("readwrite",e=>{e.put(r)})}catch(e){if(!y(e))throw e;await m(o),await n("readwrite",t=>{t.put(r)})}},async delete(r){await n("readwrite",e=>{e.delete(r)})},async keys(){return n("readonly",r=>x(r.getAllKeys()))},async clear(){await n("readwrite",r=>{r.clear()})},async estimate(){return{usage:(await w()).reduce((r,e)=>r+e.size,0),quota:o}}}}function B(){try{return typeof navigator<"u"&&typeof navigator.storage?.getDirectory=="function"}catch{return!1}}const E=c=>encodeURIComponent(c),O=c=>decodeURIComponent(c);async function z(c,u){const o=navigator.locks;return o?o.request(c,u):u()}function I(c={}){const u=c.namespace??b,o=c.maxBytes??A,s=u.split("/").filter(Boolean);let f;const n=()=>f||(f=(async()=>{c.persist&&typeof navigator.storage?.persist=="function"&&await navigator.storage.persist().catch(()=>!1);let e=await navigator.storage.getDirectory();for(const t of s)e=await e.getDirectoryHandle(t,{create:!0});return e})().catch(e=>{throw f=void 0,e}),f),y=async e=>{try{const t=await(await(await(await n()).getFileHandle(e)).getFile()).text();return JSON.parse(t)}catch{return}},w=async(e,t)=>{const a=await(await n()).getFileHandle(e,{create:!0}),i=JSON.stringify(t);if(typeof a.createSyncAccessHandle=="function")try{return await z(`reformer-forms:${e}`,async()=>{const d=await a.createSyncAccessHandle();try{d.truncate(0),d.write(new TextEncoder().encode(i),{at:0}),d.flush()}finally{d.close()}})}catch{}if(typeof a.createWritable!="function")throw new Error("OPFS: ни createSyncAccessHandle, ни createWritable недоступны");const l=await a.createWritable();try{await l.write(i)}finally{await l.close()}},m=async()=>{const e=await n(),t=[];for await(const a of e.keys()){const i=await y(a);i&&t.push(i)}return t},r=async e=>{const t=await m(),a=t.reduce((d,g)=>d+g.size,0)+e,i=v(t,a,o);if(!i.length)return;const l=await n();for(const d of i)await l.removeEntry(E(d)).catch(()=>{})};return{name:"opfs",async get(e){const t=E(e),a=await y(t);if(!a)return;const i={...a,lastUsedAt:Date.now()};return await w(t,i).catch(()=>{}),i},async set(e){await r(e.size),await w(E(e.key),e)},async delete(e){await(await n()).removeEntry(E(e)).catch(()=>{})},async keys(){const e=await n(),t=[];for await(const a of e.keys())t.push(O(a));return t},async clear(){const e=await n(),t=[];for await(const a of e.keys())t.push(a);for(const a of t)await e.removeEntry(a,{recursive:!0}).catch(()=>{})},async estimate(){return{usage:(await m()).reduce((e,t)=>e+t.size,0),quota:o}}}}const R=["opfs","indexeddb","memory"];async function P(c=R,u={}){for(const o of c)try{if(o==="opfs"){if(!B())continue;const s=I(u);return await s.keys(),s}if(o==="indexeddb"){if(!S())continue;const s=k(u);return await s.keys(),s}if(o==="memory")return D(u)}catch{}return D(u)}export{A as DEFAULT_MAX_BYTES,b as DEFAULT_NAMESPACE,R as DEFAULT_STORAGE_ORDER,T as byteLength,q as cacheKey,k as createIndexedDbStorage,D as createMemoryStorage,I as createOpfsStorage,U as defaultStorage,S as isIndexedDbAvailable,B as isOpfsAvailable,P as pickStorage,v as selectEvictions};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const i="reformer-forms/v1",l=33554432,u=(o,e,t)=>`${o}/${e}@${t}`;function d(o){if(typeof TextEncoder<"u")return new TextEncoder().encode(o).length;let e=0;for(let t=0;t<o.length;t++){const r=o.codePointAt(t);r>65535?(t++,e+=4):r>2047?e+=3:r>127?e+=2:e+=1}return e}function a(o,e,t){if(e<=t)return[];const r=[...o].sort((n,f)=>n.lastUsedAt-f.lastUsedAt),s=[];let c=0;for(const n of r){if(e-c<=t)break;s.push(n.key),c+=n.size}return s}export{a as A,u as a,d,i,l};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{p as hs,a as ps,b as ms,W as ys,q as vs,s as Ct,t as gs,L as ss,v as $s}from"../../js/index-BSeq6-8S.js";function ws(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _t={exports:{}},Rt={},he={},$e={},Dt={},Vt={},At={},zt;function ft(){return zt||(zt=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class r{}e._CodeOrName=r,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class p extends r{constructor(s){if(super(),!e.IDENTIFIER.test(s))throw new Error("CodeGen: name must be a valid identifier");this.str=s}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=p;class n extends r{constructor(s){super(),this._items=typeof s=="string"?[s]:s}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const s=this._items[0];return s===""||s==='""'}get str(){var s;return(s=this._str)!==null&&s!==void 0?s:this._str=this._items.reduce((t,g)=>`${t}${g}`,"")}get names(){var s;return(s=this._names)!==null&&s!==void 0?s:this._names=this._items.reduce((t,g)=>(g instanceof p&&(t[g.str]=(t[g.str]||0)+1),t),{})}}e._Code=n,e.nil=new n("");function o(a,...s){const t=[a[0]];let g=0;for(;g<s.length;)f(t,s[g]),t.push(a[++g]);return new n(t)}e._=o;const u=new n("+");function d(a,...s){const t=[h(a[0])];let g=0;for(;g<s.length;)t.push(u),f(t,s[g]),t.push(u,h(a[++g]));return m(t),new n(t)}e.str=d;function f(a,s){s instanceof n?a.push(...s._items):s instanceof p?a.push(s):a.push(k(s))}e.addCodeArg=f;function m(a){let s=1;for(;s<a.length-1;){if(a[s]===u){const t=w(a[s-1],a[s+1]);if(t!==void 0){a.splice(s-1,3,t);continue}a[s++]="+"}s++}}function w(a,s){if(s==='""')return a;if(a==='""')return s;if(typeof a=="string")return s instanceof p||a[a.length-1]!=='"'?void 0:typeof s!="string"?`${a.slice(0,-1)}${s}"`:s[0]==='"'?a.slice(0,-1)+s.slice(1):void 0;if(typeof s=="string"&&s[0]==='"'&&!(a instanceof p))return`"${a}${s.slice(1)}`}function $(a,s){return s.emptyStr()?a:a.emptyStr()?s:d`${a}${s}`}e.strConcat=$;function k(a){return typeof a=="number"||typeof a=="boolean"||a===null?a:h(Array.isArray(a)?a.join(","):a)}function _(a){return new n(h(a))}e.stringify=_;function h(a){return JSON.stringify(a).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=h;function v(a){return typeof a=="string"&&e.IDENTIFIER.test(a)?new n(`.${a}`):o`[${a}]`}e.getProperty=v;function E(a){if(typeof a=="string"&&e.IDENTIFIER.test(a))return new n(`${a}`);throw new Error(`CodeGen: invalid export name: ${a}, use explicit $id name mapping`)}e.getEsmExportName=E;function i(a){return new n(a.toString())}e.regexpCode=i})(At)),At}var Ut={},Kt;function qt(){return Kt||(Kt=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const r=ft();class p extends Error{constructor(w){super(`CodeGen: "code" for ${w} not defined`),this.value=w.value}}var n;(function(m){m[m.Started=0]="Started",m[m.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new r.Name("const"),let:new r.Name("let"),var:new r.Name("var")};class o{constructor({prefixes:w,parent:$}={}){this._names={},this._prefixes=w,this._parent=$}toName(w){return w instanceof r.Name?w:this.name(w)}name(w){return new r.Name(this._newName(w))}_newName(w){const $=this._names[w]||this._nameGroup(w);return`${w}${$.index++}`}_nameGroup(w){var $,k;if(!((k=($=this._parent)===null||$===void 0?void 0:$._prefixes)===null||k===void 0)&&k.has(w)||this._prefixes&&!this._prefixes.has(w))throw new Error(`CodeGen: prefix "${w}" is not allowed in this scope`);return this._names[w]={prefix:w,index:0}}}e.Scope=o;class u extends r.Name{constructor(w,$){super($),this.prefix=w}setValue(w,{property:$,itemIndex:k}){this.value=w,this.scopePath=(0,r._)`.${new r.Name($)}[${k}]`}}e.ValueScopeName=u;const d=(0,r._)`\n`;class f extends o{constructor(w){super(w),this._values={},this._scope=w.scope,this.opts={...w,_n:w.lines?d:r.nil}}get(){return this._scope}name(w){return new u(w,this._newName(w))}value(w,$){var k;if($.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const _=this.toName(w),{prefix:h}=_,v=(k=$.key)!==null&&k!==void 0?k:$.ref;let E=this._values[h];if(E){const s=E.get(v);if(s)return s}else E=this._values[h]=new Map;E.set(v,_);const i=this._scope[h]||(this._scope[h]=[]),a=i.length;return i[a]=$.ref,_.setValue($,{property:h,itemIndex:a}),_}getValue(w,$){const k=this._values[w];if(k)return k.get($)}scopeRefs(w,$=this._values){return this._reduceValues($,k=>{if(k.scopePath===void 0)throw new Error(`CodeGen: name "${k}" has no value`);return(0,r._)`${w}${k.scopePath}`})}scopeCode(w=this._values,$,k){return this._reduceValues(w,_=>{if(_.value===void 0)throw new Error(`CodeGen: name "${_}" has no value`);return _.value.code},$,k)}_reduceValues(w,$,k={},_){let h=r.nil;for(const v in w){const E=w[v];if(!E)continue;const i=k[v]=k[v]||new Map;E.forEach(a=>{if(i.has(a))return;i.set(a,n.Started);let s=$(a);if(s){const t=this.opts.es5?e.varKinds.var:e.varKinds.const;h=(0,r._)`${h}${t} ${a} = ${s};${this.opts._n}`}else if(s=_?.(a))h=(0,r._)`${h}${s}${this.opts._n}`;else throw new p(a);i.set(a,n.Completed)})}return h}}e.ValueScope=f})(Ut)),Ut}var Ft;function H(){return Ft||(Ft=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const r=ft(),p=qt();var n=ft();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var o=qt();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),e.operators={GT:new r._Code(">"),GTE:new r._Code(">="),LT:new r._Code("<"),LTE:new r._Code("<="),EQ:new r._Code("==="),NEQ:new r._Code("!=="),NOT:new r._Code("!"),OR:new r._Code("||"),AND:new r._Code("&&"),ADD:new r._Code("+")};class u{optimizeNodes(){return this}optimizeNames(c,P){return this}}class d extends u{constructor(c,P,x){super(),this.varKind=c,this.name=P,this.rhs=x}render({es5:c,_n:P}){const x=c?p.varKinds.var:this.varKind,A=this.rhs===void 0?"":` = ${this.rhs}`;return`${x} ${this.name}${A};`+P}optimizeNames(c,P){if(c[this.name.str])return this.rhs&&(this.rhs=W(this.rhs,c,P)),this}get names(){return this.rhs instanceof r._CodeOrName?this.rhs.names:{}}}class f extends u{constructor(c,P,x){super(),this.lhs=c,this.rhs=P,this.sideEffects=x}render({_n:c}){return`${this.lhs} = ${this.rhs};`+c}optimizeNames(c,P){if(!(this.lhs instanceof r.Name&&!c[this.lhs.str]&&!this.sideEffects))return this.rhs=W(this.rhs,c,P),this}get names(){const c=this.lhs instanceof r.Name?{}:{...this.lhs.names};return L(c,this.rhs)}}class m extends f{constructor(c,P,x,A){super(c,x,A),this.op=P}render({_n:c}){return`${this.lhs} ${this.op}= ${this.rhs};`+c}}class w extends u{constructor(c){super(),this.label=c,this.names={}}render({_n:c}){return`${this.label}:`+c}}class $ extends u{constructor(c){super(),this.label=c,this.names={}}render({_n:c}){return`break${this.label?` ${this.label}`:""};`+c}}class k extends u{constructor(c){super(),this.error=c}render({_n:c}){return`throw ${this.error};`+c}get names(){return this.error.names}}class _ extends u{constructor(c){super(),this.code=c}render({_n:c}){return`${this.code};`+c}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(c,P){return this.code=W(this.code,c,P),this}get names(){return this.code instanceof r._CodeOrName?this.code.names:{}}}class h extends u{constructor(c=[]){super(),this.nodes=c}render(c){return this.nodes.reduce((P,x)=>P+x.render(c),"")}optimizeNodes(){const{nodes:c}=this;let P=c.length;for(;P--;){const x=c[P].optimizeNodes();Array.isArray(x)?c.splice(P,1,...x):x?c[P]=x:c.splice(P,1)}return c.length>0?this:void 0}optimizeNames(c,P){const{nodes:x}=this;let A=x.length;for(;A--;){const K=x[A];K.optimizeNames(c,P)||(se(c,K.names),x.splice(A,1))}return x.length>0?this:void 0}get names(){return this.nodes.reduce((c,P)=>F(c,P.names),{})}}class v extends h{render(c){return"{"+c._n+super.render(c)+"}"+c._n}}class E extends h{}class i extends v{}i.kind="else";class a extends v{constructor(c,P){super(P),this.condition=c}render(c){let P=`if(${this.condition})`+super.render(c);return this.else&&(P+="else "+this.else.render(c)),P}optimizeNodes(){super.optimizeNodes();const c=this.condition;if(c===!0)return this.nodes;let P=this.else;if(P){const x=P.optimizeNodes();P=this.else=Array.isArray(x)?new i(x):x}if(P)return c===!1?P instanceof a?P:P.nodes:this.nodes.length?this:new a(de(c),P instanceof a?[P]:P.nodes);if(!(c===!1||!this.nodes.length))return this}optimizeNames(c,P){var x;if(this.else=(x=this.else)===null||x===void 0?void 0:x.optimizeNames(c,P),!!(super.optimizeNames(c,P)||this.else))return this.condition=W(this.condition,c,P),this}get names(){const c=super.names;return L(c,this.condition),this.else&&F(c,this.else.names),c}}a.kind="if";class s extends v{}s.kind="for";class t extends s{constructor(c){super(),this.iteration=c}render(c){return`for(${this.iteration})`+super.render(c)}optimizeNames(c,P){if(super.optimizeNames(c,P))return this.iteration=W(this.iteration,c,P),this}get names(){return F(super.names,this.iteration.names)}}class g extends s{constructor(c,P,x,A){super(),this.varKind=c,this.name=P,this.from=x,this.to=A}render(c){const P=c.es5?p.varKinds.var:this.varKind,{name:x,from:A,to:K}=this;return`for(${P} ${x}=${A}; ${x}<${K}; ${x}++)`+super.render(c)}get names(){const c=L(super.names,this.from);return L(c,this.to)}}class l extends s{constructor(c,P,x,A){super(),this.loop=c,this.varKind=P,this.name=x,this.iterable=A}render(c){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(c)}optimizeNames(c,P){if(super.optimizeNames(c,P))return this.iterable=W(this.iterable,c,P),this}get names(){return F(super.names,this.iterable.names)}}class y extends v{constructor(c,P,x){super(),this.name=c,this.args=P,this.async=x}render(c){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(c)}}y.kind="func";class b extends h{render(c){return"return "+super.render(c)}}b.kind="return";class N extends v{render(c){let P="try"+super.render(c);return this.catch&&(P+=this.catch.render(c)),this.finally&&(P+=this.finally.render(c)),P}optimizeNodes(){var c,P;return super.optimizeNodes(),(c=this.catch)===null||c===void 0||c.optimizeNodes(),(P=this.finally)===null||P===void 0||P.optimizeNodes(),this}optimizeNames(c,P){var x,A;return super.optimizeNames(c,P),(x=this.catch)===null||x===void 0||x.optimizeNames(c,P),(A=this.finally)===null||A===void 0||A.optimizeNames(c,P),this}get names(){const c=super.names;return this.catch&&F(c,this.catch.names),this.finally&&F(c,this.finally.names),c}}class M extends v{constructor(c){super(),this.error=c}render(c){return`catch(${this.error})`+super.render(c)}}M.kind="catch";class V extends v{render(c){return"finally"+super.render(c)}}V.kind="finally";class z{constructor(c,P={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...P,_n:P.lines?`
|
|
2
|
+
`:""},this._extScope=c,this._scope=new p.Scope({parent:c}),this._nodes=[new E]}toString(){return this._root.render(this.opts)}name(c){return this._scope.name(c)}scopeName(c){return this._extScope.name(c)}scopeValue(c,P){const x=this._extScope.value(c,P);return(this._values[x.prefix]||(this._values[x.prefix]=new Set)).add(x),x}getScopeValue(c,P){return this._extScope.getValue(c,P)}scopeRefs(c){return this._extScope.scopeRefs(c,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(c,P,x,A){const K=this._scope.toName(P);return x!==void 0&&A&&(this._constants[K.str]=x),this._leafNode(new d(c,K,x)),K}const(c,P,x){return this._def(p.varKinds.const,c,P,x)}let(c,P,x){return this._def(p.varKinds.let,c,P,x)}var(c,P,x){return this._def(p.varKinds.var,c,P,x)}assign(c,P,x){return this._leafNode(new f(c,P,x))}add(c,P){return this._leafNode(new m(c,e.operators.ADD,P))}code(c){return typeof c=="function"?c():c!==r.nil&&this._leafNode(new _(c)),this}object(...c){const P=["{"];for(const[x,A]of c)P.length>1&&P.push(","),P.push(x),(x!==A||this.opts.es5)&&(P.push(":"),(0,r.addCodeArg)(P,A));return P.push("}"),new r._Code(P)}if(c,P,x){if(this._blockNode(new a(c)),P&&x)this.code(P).else().code(x).endIf();else if(P)this.code(P).endIf();else if(x)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(c){return this._elseNode(new a(c))}else(){return this._elseNode(new i)}endIf(){return this._endBlockNode(a,i)}_for(c,P){return this._blockNode(c),P&&this.code(P).endFor(),this}for(c,P){return this._for(new t(c),P)}forRange(c,P,x,A,K=this.opts.es5?p.varKinds.var:p.varKinds.let){const Q=this._scope.toName(c);return this._for(new g(K,Q,P,x),()=>A(Q))}forOf(c,P,x,A=p.varKinds.const){const K=this._scope.toName(c);if(this.opts.es5){const Q=P instanceof r.Name?P:this.var("_arr",P);return this.forRange("_i",0,(0,r._)`${Q}.length`,B=>{this.var(K,(0,r._)`${Q}[${B}]`),x(K)})}return this._for(new l("of",A,K,P),()=>x(K))}forIn(c,P,x,A=this.opts.es5?p.varKinds.var:p.varKinds.const){if(this.opts.ownProperties)return this.forOf(c,(0,r._)`Object.keys(${P})`,x);const K=this._scope.toName(c);return this._for(new l("in",A,K,P),()=>x(K))}endFor(){return this._endBlockNode(s)}label(c){return this._leafNode(new w(c))}break(c){return this._leafNode(new $(c))}return(c){const P=new b;if(this._blockNode(P),this.code(c),P.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(b)}try(c,P,x){if(!P&&!x)throw new Error('CodeGen: "try" without "catch" and "finally"');const A=new N;if(this._blockNode(A),this.code(c),P){const K=this.name("e");this._currNode=A.catch=new M(K),P(K)}return x&&(this._currNode=A.finally=new V,this.code(x)),this._endBlockNode(M,V)}throw(c){return this._leafNode(new k(c))}block(c,P){return this._blockStarts.push(this._nodes.length),c&&this.code(c).endBlock(P),this}endBlock(c){const P=this._blockStarts.pop();if(P===void 0)throw new Error("CodeGen: not in self-balancing block");const x=this._nodes.length-P;if(x<0||c!==void 0&&x!==c)throw new Error(`CodeGen: wrong number of nodes: ${x} vs ${c} expected`);return this._nodes.length=P,this}func(c,P=r.nil,x,A){return this._blockNode(new y(c,P,x)),A&&this.code(A).endFunc(),this}endFunc(){return this._endBlockNode(y)}optimize(c=1){for(;c-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(c){return this._currNode.nodes.push(c),this}_blockNode(c){this._currNode.nodes.push(c),this._nodes.push(c)}_endBlockNode(c,P){const x=this._currNode;if(x instanceof c||P&&x instanceof P)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${P?`${c.kind}/${P.kind}`:c.kind}"`)}_elseNode(c){const P=this._currNode;if(!(P instanceof a))throw new Error('CodeGen: "else" without "if"');return this._currNode=P.else=c,this}get _root(){return this._nodes[0]}get _currNode(){const c=this._nodes;return c[c.length-1]}set _currNode(c){const P=this._nodes;P[P.length-1]=c}}e.CodeGen=z;function F(C,c){for(const P in c)C[P]=(C[P]||0)+(c[P]||0);return C}function L(C,c){return c instanceof r._CodeOrName?F(C,c.names):C}function W(C,c,P){if(C instanceof r.Name)return x(C);if(!A(C))return C;return new r._Code(C._items.reduce((K,Q)=>(Q instanceof r.Name&&(Q=x(Q)),Q instanceof r._Code?K.push(...Q._items):K.push(Q),K),[]));function x(K){const Q=P[K.str];return Q===void 0||c[K.str]!==1?K:(delete c[K.str],Q)}function A(K){return K instanceof r._Code&&K._items.some(Q=>Q instanceof r.Name&&c[Q.str]===1&&P[Q.str]!==void 0)}}function se(C,c){for(const P in c)C[P]=(C[P]||0)-(c[P]||0)}function de(C){return typeof C=="boolean"||typeof C=="number"||C===null?!C:(0,r._)`!${T(C)}`}e.not=de;const fe=j(e.operators.AND);function Y(...C){return C.reduce(fe)}e.and=Y;const ye=j(e.operators.OR);function R(...C){return C.reduce(ye)}e.or=R;function j(C){return(c,P)=>c===r.nil?P:P===r.nil?c:(0,r._)`${T(c)} ${C} ${T(P)}`}function T(C){return C instanceof r.Name?C:(0,r._)`(${C})`}})(Vt)),Vt}var q={},Lt;function J(){if(Lt)return q;Lt=1,Object.defineProperty(q,"__esModule",{value:!0}),q.checkStrictMode=q.getErrorPath=q.Type=q.useFunc=q.setEvaluated=q.evaluatedPropsToName=q.mergeEvaluated=q.eachItem=q.unescapeJsonPointer=q.escapeJsonPointer=q.escapeFragment=q.unescapeFragment=q.schemaRefOrVal=q.schemaHasRulesButRef=q.schemaHasRules=q.checkUnknownRules=q.alwaysValidSchema=q.toHash=void 0;const e=H(),r=ft();function p(l){const y={};for(const b of l)y[b]=!0;return y}q.toHash=p;function n(l,y){return typeof y=="boolean"?y:Object.keys(y).length===0?!0:(o(l,y),!u(y,l.self.RULES.all))}q.alwaysValidSchema=n;function o(l,y=l.schema){const{opts:b,self:N}=l;if(!b.strictSchema||typeof y=="boolean")return;const M=N.RULES.keywords;for(const V in y)M[V]||g(l,`unknown keyword: "${V}"`)}q.checkUnknownRules=o;function u(l,y){if(typeof l=="boolean")return!l;for(const b in l)if(y[b])return!0;return!1}q.schemaHasRules=u;function d(l,y){if(typeof l=="boolean")return!l;for(const b in l)if(b!=="$ref"&&y.all[b])return!0;return!1}q.schemaHasRulesButRef=d;function f({topSchemaRef:l,schemaPath:y},b,N,M){if(!M){if(typeof b=="number"||typeof b=="boolean")return b;if(typeof b=="string")return(0,e._)`${b}`}return(0,e._)`${l}${y}${(0,e.getProperty)(N)}`}q.schemaRefOrVal=f;function m(l){return k(decodeURIComponent(l))}q.unescapeFragment=m;function w(l){return encodeURIComponent($(l))}q.escapeFragment=w;function $(l){return typeof l=="number"?`${l}`:l.replace(/~/g,"~0").replace(/\//g,"~1")}q.escapeJsonPointer=$;function k(l){return l.replace(/~1/g,"/").replace(/~0/g,"~")}q.unescapeJsonPointer=k;function _(l,y){if(Array.isArray(l))for(const b of l)y(b);else y(l)}q.eachItem=_;function h({mergeNames:l,mergeToName:y,mergeValues:b,resultToName:N}){return(M,V,z,F)=>{const L=z===void 0?V:z instanceof e.Name?(V instanceof e.Name?l(M,V,z):y(M,V,z),z):V instanceof e.Name?(y(M,z,V),V):b(V,z);return F===e.Name&&!(L instanceof e.Name)?N(M,L):L}}q.mergeEvaluated={props:h({mergeNames:(l,y,b)=>l.if((0,e._)`${b} !== true && ${y} !== undefined`,()=>{l.if((0,e._)`${y} === true`,()=>l.assign(b,!0),()=>l.assign(b,(0,e._)`${b} || {}`).code((0,e._)`Object.assign(${b}, ${y})`))}),mergeToName:(l,y,b)=>l.if((0,e._)`${b} !== true`,()=>{y===!0?l.assign(b,!0):(l.assign(b,(0,e._)`${b} || {}`),E(l,b,y))}),mergeValues:(l,y)=>l===!0?!0:{...l,...y},resultToName:v}),items:h({mergeNames:(l,y,b)=>l.if((0,e._)`${b} !== true && ${y} !== undefined`,()=>l.assign(b,(0,e._)`${y} === true ? true : ${b} > ${y} ? ${b} : ${y}`)),mergeToName:(l,y,b)=>l.if((0,e._)`${b} !== true`,()=>l.assign(b,y===!0?!0:(0,e._)`${b} > ${y} ? ${b} : ${y}`)),mergeValues:(l,y)=>l===!0?!0:Math.max(l,y),resultToName:(l,y)=>l.var("items",y)})};function v(l,y){if(y===!0)return l.var("props",!0);const b=l.var("props",(0,e._)`{}`);return y!==void 0&&E(l,b,y),b}q.evaluatedPropsToName=v;function E(l,y,b){Object.keys(b).forEach(N=>l.assign((0,e._)`${y}${(0,e.getProperty)(N)}`,!0))}q.setEvaluated=E;const i={};function a(l,y){return l.scopeValue("func",{ref:y,code:i[y.code]||(i[y.code]=new r._Code(y.code))})}q.useFunc=a;var s;(function(l){l[l.Num=0]="Num",l[l.Str=1]="Str"})(s||(q.Type=s={}));function t(l,y,b){if(l instanceof e.Name){const N=y===s.Num;return b?N?(0,e._)`"[" + ${l} + "]"`:(0,e._)`"['" + ${l} + "']"`:N?(0,e._)`"/" + ${l}`:(0,e._)`"/" + ${l}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return b?(0,e.getProperty)(l).toString():"/"+$(l)}q.getErrorPath=t;function g(l,y,b=l.opts.strictSchema){if(b){if(y=`strict mode: ${y}`,b===!0)throw new Error(y);l.self.logger.warn(y)}}return q.checkStrictMode=g,q}var Ce={},Gt;function ge(){if(Gt)return Ce;Gt=1,Object.defineProperty(Ce,"__esModule",{value:!0});const e=H(),r={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return Ce.default=r,Ce}var Ht;function pt(){return Ht||(Ht=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const r=H(),p=J(),n=ge();e.keywordError={message:({keyword:i})=>(0,r.str)`must pass "${i}" keyword validation`},e.keyword$DataError={message:({keyword:i,schemaType:a})=>a?(0,r.str)`"${i}" keyword must be ${a} ($data)`:(0,r.str)`"${i}" keyword is invalid ($data)`};function o(i,a=e.keywordError,s,t){const{it:g}=i,{gen:l,compositeRule:y,allErrors:b}=g,N=k(i,a,s);t??(y||b)?m(l,N):w(g,(0,r._)`[${N}]`)}e.reportError=o;function u(i,a=e.keywordError,s){const{it:t}=i,{gen:g,compositeRule:l,allErrors:y}=t,b=k(i,a,s);m(g,b),l||y||w(t,n.default.vErrors)}e.reportExtraError=u;function d(i,a){i.assign(n.default.errors,a),i.if((0,r._)`${n.default.vErrors} !== null`,()=>i.if(a,()=>i.assign((0,r._)`${n.default.vErrors}.length`,a),()=>i.assign(n.default.vErrors,null)))}e.resetErrorsCount=d;function f({gen:i,keyword:a,schemaValue:s,data:t,errsCount:g,it:l}){if(g===void 0)throw new Error("ajv implementation error");const y=i.name("err");i.forRange("i",g,n.default.errors,b=>{i.const(y,(0,r._)`${n.default.vErrors}[${b}]`),i.if((0,r._)`${y}.instancePath === undefined`,()=>i.assign((0,r._)`${y}.instancePath`,(0,r.strConcat)(n.default.instancePath,l.errorPath))),i.assign((0,r._)`${y}.schemaPath`,(0,r.str)`${l.errSchemaPath}/${a}`),l.opts.verbose&&(i.assign((0,r._)`${y}.schema`,s),i.assign((0,r._)`${y}.data`,t))})}e.extendErrors=f;function m(i,a){const s=i.const("err",a);i.if((0,r._)`${n.default.vErrors} === null`,()=>i.assign(n.default.vErrors,(0,r._)`[${s}]`),(0,r._)`${n.default.vErrors}.push(${s})`),i.code((0,r._)`${n.default.errors}++`)}function w(i,a){const{gen:s,validateName:t,schemaEnv:g}=i;g.$async?s.throw((0,r._)`new ${i.ValidationError}(${a})`):(s.assign((0,r._)`${t}.errors`,a),s.return(!1))}const $={keyword:new r.Name("keyword"),schemaPath:new r.Name("schemaPath"),params:new r.Name("params"),propertyName:new r.Name("propertyName"),message:new r.Name("message"),schema:new r.Name("schema"),parentSchema:new r.Name("parentSchema")};function k(i,a,s){const{createErrors:t}=i.it;return t===!1?(0,r._)`{}`:_(i,a,s)}function _(i,a,s={}){const{gen:t,it:g}=i,l=[h(g,s),v(i,s)];return E(i,a,l),t.object(...l)}function h({errorPath:i},{instancePath:a}){const s=a?(0,r.str)`${i}${(0,p.getErrorPath)(a,p.Type.Str)}`:i;return[n.default.instancePath,(0,r.strConcat)(n.default.instancePath,s)]}function v({keyword:i,it:{errSchemaPath:a}},{schemaPath:s,parentSchema:t}){let g=t?a:(0,r.str)`${a}/${i}`;return s&&(g=(0,r.str)`${g}${(0,p.getErrorPath)(s,p.Type.Str)}`),[$.schemaPath,g]}function E(i,{params:a,message:s},t){const{keyword:g,data:l,schemaValue:y,it:b}=i,{opts:N,propertyName:M,topSchemaRef:V,schemaPath:z}=b;t.push([$.keyword,g],[$.params,typeof a=="function"?a(i):a||(0,r._)`{}`]),N.messages&&t.push([$.message,typeof s=="function"?s(i):s]),N.verbose&&t.push([$.schema,y],[$.parentSchema,(0,r._)`${V}${z}`],[n.default.data,l]),M&&t.push([$.propertyName,M])}})(Dt)),Dt}var Bt;function _s(){if(Bt)return $e;Bt=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.boolOrEmptySchema=$e.topBoolOrEmptySchema=void 0;const e=pt(),r=H(),p=ge(),n={message:"boolean schema is false"};function o(f){const{gen:m,schema:w,validateName:$}=f;w===!1?d(f,!1):typeof w=="object"&&w.$async===!0?m.return(p.default.data):(m.assign((0,r._)`${$}.errors`,null),m.return(!0))}$e.topBoolOrEmptySchema=o;function u(f,m){const{gen:w,schema:$}=f;$===!1?(w.var(m,!1),d(f)):w.var(m,!0)}$e.boolOrEmptySchema=u;function d(f,m){const{gen:w,data:$}=f,k={gen:w,keyword:"false schema",data:$,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:f};(0,e.reportError)(k,n,void 0,m)}return $e}var te={},we={},Jt;function ns(){if(Jt)return we;Jt=1,Object.defineProperty(we,"__esModule",{value:!0}),we.getRules=we.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],r=new Set(e);function p(o){return typeof o=="string"&&r.has(o)}we.isJSONType=p;function n(){const o={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...o,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},o.number,o.string,o.array,o.object],post:{rules:[]},all:{},keywords:{}}}return we.getRules=n,we}var pe={},Qt;function os(){if(Qt)return pe;Qt=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.shouldUseRule=pe.shouldUseGroup=pe.schemaHasRulesForType=void 0;function e({schema:n,self:o},u){const d=o.RULES.types[u];return d&&d!==!0&&r(n,d)}pe.schemaHasRulesForType=e;function r(n,o){return o.rules.some(u=>p(n,u))}pe.shouldUseGroup=r;function p(n,o){var u;return n[o.keyword]!==void 0||((u=o.definition.implements)===null||u===void 0?void 0:u.some(d=>n[d]!==void 0))}return pe.shouldUseRule=p,pe}var Wt;function ht(){if(Wt)return te;Wt=1,Object.defineProperty(te,"__esModule",{value:!0}),te.reportTypeError=te.checkDataTypes=te.checkDataType=te.coerceAndCheckDataType=te.getJSONTypes=te.getSchemaTypes=te.DataType=void 0;const e=ns(),r=os(),p=pt(),n=H(),o=J();var u;(function(s){s[s.Correct=0]="Correct",s[s.Wrong=1]="Wrong"})(u||(te.DataType=u={}));function d(s){const t=f(s.type);if(t.includes("null")){if(s.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&s.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');s.nullable===!0&&t.push("null")}return t}te.getSchemaTypes=d;function f(s){const t=Array.isArray(s)?s:s?[s]:[];if(t.every(e.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}te.getJSONTypes=f;function m(s,t){const{gen:g,data:l,opts:y}=s,b=$(t,y.coerceTypes),N=t.length>0&&!(b.length===0&&t.length===1&&(0,r.schemaHasRulesForType)(s,t[0]));if(N){const M=v(t,l,y.strictNumbers,u.Wrong);g.if(M,()=>{b.length?k(s,t,b):i(s)})}return N}te.coerceAndCheckDataType=m;const w=new Set(["string","number","integer","boolean","null"]);function $(s,t){return t?s.filter(g=>w.has(g)||t==="array"&&g==="array"):[]}function k(s,t,g){const{gen:l,data:y,opts:b}=s,N=l.let("dataType",(0,n._)`typeof ${y}`),M=l.let("coerced",(0,n._)`undefined`);b.coerceTypes==="array"&&l.if((0,n._)`${N} == 'object' && Array.isArray(${y}) && ${y}.length == 1`,()=>l.assign(y,(0,n._)`${y}[0]`).assign(N,(0,n._)`typeof ${y}`).if(v(t,y,b.strictNumbers),()=>l.assign(M,y))),l.if((0,n._)`${M} !== undefined`);for(const z of g)(w.has(z)||z==="array"&&b.coerceTypes==="array")&&V(z);l.else(),i(s),l.endIf(),l.if((0,n._)`${M} !== undefined`,()=>{l.assign(y,M),_(s,M)});function V(z){switch(z){case"string":l.elseIf((0,n._)`${N} == "number" || ${N} == "boolean"`).assign(M,(0,n._)`"" + ${y}`).elseIf((0,n._)`${y} === null`).assign(M,(0,n._)`""`);return;case"number":l.elseIf((0,n._)`${N} == "boolean" || ${y} === null
|
|
3
|
+
|| (${N} == "string" && ${y} && ${y} == +${y})`).assign(M,(0,n._)`+${y}`);return;case"integer":l.elseIf((0,n._)`${N} === "boolean" || ${y} === null
|
|
4
|
+
|| (${N} === "string" && ${y} && ${y} == +${y} && !(${y} % 1))`).assign(M,(0,n._)`+${y}`);return;case"boolean":l.elseIf((0,n._)`${y} === "false" || ${y} === 0 || ${y} === null`).assign(M,!1).elseIf((0,n._)`${y} === "true" || ${y} === 1`).assign(M,!0);return;case"null":l.elseIf((0,n._)`${y} === "" || ${y} === 0 || ${y} === false`),l.assign(M,null);return;case"array":l.elseIf((0,n._)`${N} === "string" || ${N} === "number"
|
|
5
|
+
|| ${N} === "boolean" || ${y} === null`).assign(M,(0,n._)`[${y}]`)}}}function _({gen:s,parentData:t,parentDataProperty:g},l){s.if((0,n._)`${t} !== undefined`,()=>s.assign((0,n._)`${t}[${g}]`,l))}function h(s,t,g,l=u.Correct){const y=l===u.Correct?n.operators.EQ:n.operators.NEQ;let b;switch(s){case"null":return(0,n._)`${t} ${y} null`;case"array":b=(0,n._)`Array.isArray(${t})`;break;case"object":b=(0,n._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":b=N((0,n._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":b=N();break;default:return(0,n._)`typeof ${t} ${y} ${s}`}return l===u.Correct?b:(0,n.not)(b);function N(M=n.nil){return(0,n.and)((0,n._)`typeof ${t} == "number"`,M,g?(0,n._)`isFinite(${t})`:n.nil)}}te.checkDataType=h;function v(s,t,g,l){if(s.length===1)return h(s[0],t,g,l);let y;const b=(0,o.toHash)(s);if(b.array&&b.object){const N=(0,n._)`typeof ${t} != "object"`;y=b.null?N:(0,n._)`!${t} || ${N}`,delete b.null,delete b.array,delete b.object}else y=n.nil;b.number&&delete b.integer;for(const N in b)y=(0,n.and)(y,h(N,t,g,l));return y}te.checkDataTypes=v;const E={message:({schema:s})=>`must be ${s}`,params:({schema:s,schemaValue:t})=>typeof s=="string"?(0,n._)`{type: ${s}}`:(0,n._)`{type: ${t}}`};function i(s){const t=a(s);(0,p.reportError)(t,E)}te.reportTypeError=i;function a(s){const{gen:t,data:g,schema:l}=s,y=(0,o.schemaRefOrVal)(s,l,"type");return{gen:t,keyword:"type",data:g,schema:l.type,schemaCode:y,schemaValue:y,parentSchema:l,params:{},it:s}}return te}var ke={},Xt;function bs(){if(Xt)return ke;Xt=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.assignDefaults=void 0;const e=H(),r=J();function p(o,u){const{properties:d,items:f}=o.schema;if(u==="object"&&d)for(const m in d)n(o,m,d[m].default);else u==="array"&&Array.isArray(f)&&f.forEach((m,w)=>n(o,w,m.default))}ke.assignDefaults=p;function n(o,u,d){const{gen:f,compositeRule:m,data:w,opts:$}=o;if(d===void 0)return;const k=(0,e._)`${w}${(0,e.getProperty)(u)}`;if(m){(0,r.checkStrictMode)(o,`default is ignored for: ${k}`);return}let _=(0,e._)`${k} === undefined`;$.useDefaults==="empty"&&(_=(0,e._)`${_} || ${k} === null || ${k} === ""`),f.if(_,(0,e._)`${k} = ${(0,e.stringify)(d)}`)}return ke}var ue={},X={},Yt;function le(){if(Yt)return X;Yt=1,Object.defineProperty(X,"__esModule",{value:!0}),X.validateUnion=X.validateArray=X.usePattern=X.callValidateCode=X.schemaProperties=X.allSchemaProperties=X.noPropertyInData=X.propertyInData=X.isOwnProperty=X.hasPropFunc=X.reportMissingProp=X.checkMissingProp=X.checkReportMissingProp=void 0;const e=H(),r=J(),p=ge(),n=J();function o(s,t){const{gen:g,data:l,it:y}=s;g.if($(g,l,t,y.opts.ownProperties),()=>{s.setParams({missingProperty:(0,e._)`${t}`},!0),s.error()})}X.checkReportMissingProp=o;function u({gen:s,data:t,it:{opts:g}},l,y){return(0,e.or)(...l.map(b=>(0,e.and)($(s,t,b,g.ownProperties),(0,e._)`${y} = ${b}`)))}X.checkMissingProp=u;function d(s,t){s.setParams({missingProperty:t},!0),s.error()}X.reportMissingProp=d;function f(s){return s.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}X.hasPropFunc=f;function m(s,t,g){return(0,e._)`${f(s)}.call(${t}, ${g})`}X.isOwnProperty=m;function w(s,t,g,l){const y=(0,e._)`${t}${(0,e.getProperty)(g)} !== undefined`;return l?(0,e._)`${y} && ${m(s,t,g)}`:y}X.propertyInData=w;function $(s,t,g,l){const y=(0,e._)`${t}${(0,e.getProperty)(g)} === undefined`;return l?(0,e.or)(y,(0,e.not)(m(s,t,g))):y}X.noPropertyInData=$;function k(s){return s?Object.keys(s).filter(t=>t!=="__proto__"):[]}X.allSchemaProperties=k;function _(s,t){return k(t).filter(g=>!(0,r.alwaysValidSchema)(s,t[g]))}X.schemaProperties=_;function h({schemaCode:s,data:t,it:{gen:g,topSchemaRef:l,schemaPath:y,errorPath:b},it:N},M,V,z){const F=z?(0,e._)`${s}, ${t}, ${l}${y}`:t,L=[[p.default.instancePath,(0,e.strConcat)(p.default.instancePath,b)],[p.default.parentData,N.parentData],[p.default.parentDataProperty,N.parentDataProperty],[p.default.rootData,p.default.rootData]];N.opts.dynamicRef&&L.push([p.default.dynamicAnchors,p.default.dynamicAnchors]);const W=(0,e._)`${F}, ${g.object(...L)}`;return V!==e.nil?(0,e._)`${M}.call(${V}, ${W})`:(0,e._)`${M}(${W})`}X.callValidateCode=h;const v=(0,e._)`new RegExp`;function E({gen:s,it:{opts:t}},g){const l=t.unicodeRegExp?"u":"",{regExp:y}=t.code,b=y(g,l);return s.scopeValue("pattern",{key:b.toString(),ref:b,code:(0,e._)`${y.code==="new RegExp"?v:(0,n.useFunc)(s,y)}(${g}, ${l})`})}X.usePattern=E;function i(s){const{gen:t,data:g,keyword:l,it:y}=s,b=t.name("valid");if(y.allErrors){const M=t.let("valid",!0);return N(()=>t.assign(M,!1)),M}return t.var(b,!0),N(()=>t.break()),b;function N(M){const V=t.const("len",(0,e._)`${g}.length`);t.forRange("i",0,V,z=>{s.subschema({keyword:l,dataProp:z,dataPropType:r.Type.Num},b),t.if((0,e.not)(b),M)})}}X.validateArray=i;function a(s){const{gen:t,schema:g,keyword:l,it:y}=s;if(!Array.isArray(g))throw new Error("ajv implementation error");if(g.some(M=>(0,r.alwaysValidSchema)(y,M))&&!y.opts.unevaluated)return;const b=t.let("valid",!1),N=t.name("_valid");t.block(()=>g.forEach((M,V)=>{const z=s.subschema({keyword:l,schemaProp:V,compositeRule:!0},N);t.assign(b,(0,e._)`${b} || ${N}`),s.mergeValidEvaluated(z,N)||t.if((0,e.not)(b))})),s.result(b,()=>s.reset(),()=>s.error(!0))}return X.validateUnion=a,X}var Zt;function Ps(){if(Zt)return ue;Zt=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.validateKeywordUsage=ue.validSchemaType=ue.funcKeywordCode=ue.macroKeywordCode=void 0;const e=H(),r=ge(),p=le(),n=pt();function o(_,h){const{gen:v,keyword:E,schema:i,parentSchema:a,it:s}=_,t=h.macro.call(s.self,i,a,s),g=w(v,E,t);s.opts.validateSchema!==!1&&s.self.validateSchema(t,!0);const l=v.name("valid");_.subschema({schema:t,schemaPath:e.nil,errSchemaPath:`${s.errSchemaPath}/${E}`,topSchemaRef:g,compositeRule:!0},l),_.pass(l,()=>_.error(!0))}ue.macroKeywordCode=o;function u(_,h){var v;const{gen:E,keyword:i,schema:a,parentSchema:s,$data:t,it:g}=_;m(g,h);const l=!t&&h.compile?h.compile.call(g.self,a,s,g):h.validate,y=w(E,i,l),b=E.let("valid");_.block$data(b,N),_.ok((v=h.valid)!==null&&v!==void 0?v:b);function N(){if(h.errors===!1)z(),h.modifying&&d(_),F(()=>_.error());else{const L=h.async?M():V();h.modifying&&d(_),F(()=>f(_,L))}}function M(){const L=E.let("ruleErrs",null);return E.try(()=>z((0,e._)`await `),W=>E.assign(b,!1).if((0,e._)`${W} instanceof ${g.ValidationError}`,()=>E.assign(L,(0,e._)`${W}.errors`),()=>E.throw(W))),L}function V(){const L=(0,e._)`${y}.errors`;return E.assign(L,null),z(e.nil),L}function z(L=h.async?(0,e._)`await `:e.nil){const W=g.opts.passContext?r.default.this:r.default.self,se=!("compile"in h&&!t||h.schema===!1);E.assign(b,(0,e._)`${L}${(0,p.callValidateCode)(_,y,W,se)}`,h.modifying)}function F(L){var W;E.if((0,e.not)((W=h.valid)!==null&&W!==void 0?W:b),L)}}ue.funcKeywordCode=u;function d(_){const{gen:h,data:v,it:E}=_;h.if(E.parentData,()=>h.assign(v,(0,e._)`${E.parentData}[${E.parentDataProperty}]`))}function f(_,h){const{gen:v}=_;v.if((0,e._)`Array.isArray(${h})`,()=>{v.assign(r.default.vErrors,(0,e._)`${r.default.vErrors} === null ? ${h} : ${r.default.vErrors}.concat(${h})`).assign(r.default.errors,(0,e._)`${r.default.vErrors}.length`),(0,n.extendErrors)(_)},()=>_.error())}function m({schemaEnv:_},h){if(h.async&&!_.$async)throw new Error("async keyword in sync schema")}function w(_,h,v){if(v===void 0)throw new Error(`keyword "${h}" failed to compile`);return _.scopeValue("keyword",typeof v=="function"?{ref:v}:{ref:v,code:(0,e.stringify)(v)})}function $(_,h,v=!1){return!h.length||h.some(E=>E==="array"?Array.isArray(_):E==="object"?_&&typeof _=="object"&&!Array.isArray(_):typeof _==E||v&&typeof _>"u")}ue.validSchemaType=$;function k({schema:_,opts:h,self:v,errSchemaPath:E},i,a){if(Array.isArray(i.keyword)?!i.keyword.includes(a):i.keyword!==a)throw new Error("ajv implementation error");const s=i.dependencies;if(s?.some(t=>!Object.prototype.hasOwnProperty.call(_,t)))throw new Error(`parent schema must have dependencies of ${a}: ${s.join(",")}`);if(i.validateSchema&&!i.validateSchema(_[a])){const t=`keyword "${a}" value is invalid at path "${E}": `+v.errorsText(i.validateSchema.errors);if(h.validateSchema==="log")v.logger.error(t);else throw new Error(t)}}return ue.validateKeywordUsage=k,ue}var me={},er;function Es(){if(er)return me;er=1,Object.defineProperty(me,"__esModule",{value:!0}),me.extendSubschemaMode=me.extendSubschemaData=me.getSubschema=void 0;const e=H(),r=J();function p(u,{keyword:d,schemaProp:f,schema:m,schemaPath:w,errSchemaPath:$,topSchemaRef:k}){if(d!==void 0&&m!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(d!==void 0){const _=u.schema[d];return f===void 0?{schema:_,schemaPath:(0,e._)`${u.schemaPath}${(0,e.getProperty)(d)}`,errSchemaPath:`${u.errSchemaPath}/${d}`}:{schema:_[f],schemaPath:(0,e._)`${u.schemaPath}${(0,e.getProperty)(d)}${(0,e.getProperty)(f)}`,errSchemaPath:`${u.errSchemaPath}/${d}/${(0,r.escapeFragment)(f)}`}}if(m!==void 0){if(w===void 0||$===void 0||k===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:m,schemaPath:w,topSchemaRef:k,errSchemaPath:$}}throw new Error('either "keyword" or "schema" must be passed')}me.getSubschema=p;function n(u,d,{dataProp:f,dataPropType:m,data:w,dataTypes:$,propertyName:k}){if(w!==void 0&&f!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:_}=d;if(f!==void 0){const{errorPath:v,dataPathArr:E,opts:i}=d,a=_.let("data",(0,e._)`${d.data}${(0,e.getProperty)(f)}`,!0);h(a),u.errorPath=(0,e.str)`${v}${(0,r.getErrorPath)(f,m,i.jsPropertySyntax)}`,u.parentDataProperty=(0,e._)`${f}`,u.dataPathArr=[...E,u.parentDataProperty]}if(w!==void 0){const v=w instanceof e.Name?w:_.let("data",w,!0);h(v),k!==void 0&&(u.propertyName=k)}$&&(u.dataTypes=$);function h(v){u.data=v,u.dataLevel=d.dataLevel+1,u.dataTypes=[],d.definedProperties=new Set,u.parentData=d.data,u.dataNames=[...d.dataNames,v]}}me.extendSubschemaData=n;function o(u,{jtdDiscriminator:d,jtdMetadata:f,compositeRule:m,createErrors:w,allErrors:$}){m!==void 0&&(u.compositeRule=m),w!==void 0&&(u.createErrors=w),$!==void 0&&(u.allErrors=$),u.jtdDiscriminator=d,u.jtdMetadata=f}return me.extendSubschemaMode=o,me}var re={},tr,rr;function as(){return rr||(rr=1,tr=function e(r,p){if(r===p)return!0;if(r&&p&&typeof r=="object"&&typeof p=="object"){if(r.constructor!==p.constructor)return!1;var n,o,u;if(Array.isArray(r)){if(n=r.length,n!=p.length)return!1;for(o=n;o--!==0;)if(!e(r[o],p[o]))return!1;return!0}if(r.constructor===RegExp)return r.source===p.source&&r.flags===p.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===p.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===p.toString();if(u=Object.keys(r),n=u.length,n!==Object.keys(p).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(p,u[o]))return!1;for(o=n;o--!==0;){var d=u[o];if(!e(r[d],p[d]))return!1}return!0}return r!==r&&p!==p}),tr}var bt={exports:{}},sr;function Ss(){if(sr)return bt.exports;sr=1;var e=bt.exports=function(n,o,u){typeof o=="function"&&(u=o,o={}),u=o.cb||u;var d=typeof u=="function"?u:u.pre||function(){},f=u.post||function(){};r(o,d,f,n,"",n)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.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 r(n,o,u,d,f,m,w,$,k,_){if(d&&typeof d=="object"&&!Array.isArray(d)){o(d,f,m,w,$,k,_);for(var h in d){var v=d[h];if(Array.isArray(v)){if(h in e.arrayKeywords)for(var E=0;E<v.length;E++)r(n,o,u,v[E],f+"/"+h+"/"+E,m,f,h,d,E)}else if(h in e.propsKeywords){if(v&&typeof v=="object")for(var i in v)r(n,o,u,v[i],f+"/"+h+"/"+p(i),m,f,h,d,i)}else(h in e.keywords||n.allKeys&&!(h in e.skipKeywords))&&r(n,o,u,v,f+"/"+h,m,f,h,d)}u(d,f,m,w,$,k,_)}}function p(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return bt.exports}var nr;function mt(){if(nr)return re;nr=1,Object.defineProperty(re,"__esModule",{value:!0}),re.getSchemaRefs=re.resolveUrl=re.normalizeId=re._getFullPath=re.getFullPath=re.inlineRef=void 0;const e=J(),r=as(),p=Ss(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function o(E,i=!0){return typeof E=="boolean"?!0:i===!0?!d(E):i?f(E)<=i:!1}re.inlineRef=o;const u=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function d(E){for(const i in E){if(u.has(i))return!0;const a=E[i];if(Array.isArray(a)&&a.some(d)||typeof a=="object"&&d(a))return!0}return!1}function f(E){let i=0;for(const a in E)if(a==="$ref"||(i++,!n.has(a)&&(typeof E[a]=="object"&&(0,e.eachItem)(E[a],s=>i+=f(s)),i===1/0)))return 1/0;return i}function m(E,i="",a){a!==!1&&(i=k(i));const s=E.parse(i);return w(E,s)}re.getFullPath=m;function w(E,i){return E.serialize(i).split("#")[0]+"#"}re._getFullPath=w;const $=/#\/?$/;function k(E){return E?E.replace($,""):""}re.normalizeId=k;function _(E,i,a){return a=k(a),E.resolve(i,a)}re.resolveUrl=_;const h=/^[a-z_][-a-z0-9._]*$/i;function v(E,i){if(typeof E=="boolean")return{};const{schemaId:a,uriResolver:s}=this.opts,t=k(E[a]||i),g={"":t},l=m(s,t,!1),y={},b=new Set;return p(E,{allKeys:!0},(V,z,F,L)=>{if(L===void 0)return;const W=l+z;let se=g[L];typeof V[a]=="string"&&(se=de.call(this,V[a])),fe.call(this,V.$anchor),fe.call(this,V.$dynamicAnchor),g[z]=se;function de(Y){const ye=this.opts.uriResolver.resolve;if(Y=k(se?ye(se,Y):Y),b.has(Y))throw M(Y);b.add(Y);let R=this.refs[Y];return typeof R=="string"&&(R=this.refs[R]),typeof R=="object"?N(V,R.schema,Y):Y!==k(W)&&(Y[0]==="#"?(N(V,y[Y],Y),y[Y]=V):this.refs[Y]=W),Y}function fe(Y){if(typeof Y=="string"){if(!h.test(Y))throw new Error(`invalid anchor "${Y}"`);de.call(this,`#${Y}`)}}}),y;function N(V,z,F){if(z!==void 0&&!r(V,z))throw M(F)}function M(V){return new Error(`reference "${V}" resolves to more than one schema`)}}return re.getSchemaRefs=v,re}var or;function yt(){if(or)return he;or=1,Object.defineProperty(he,"__esModule",{value:!0}),he.getData=he.KeywordCxt=he.validateFunctionCode=void 0;const e=_s(),r=ht(),p=os(),n=ht(),o=bs(),u=Ps(),d=Es(),f=H(),m=ge(),w=mt(),$=J(),k=pt();function _(S){if(l(S)&&(b(S),g(S))){i(S);return}h(S,()=>(0,e.topBoolOrEmptySchema)(S))}he.validateFunctionCode=_;function h({gen:S,validateName:O,schema:I,schemaEnv:D,opts:U},G){U.code.es5?S.func(O,(0,f._)`${m.default.data}, ${m.default.valCxt}`,D.$async,()=>{S.code((0,f._)`"use strict"; ${s(I,U)}`),E(S,U),S.code(G)}):S.func(O,(0,f._)`${m.default.data}, ${v(U)}`,D.$async,()=>S.code(s(I,U)).code(G))}function v(S){return(0,f._)`{${m.default.instancePath}="", ${m.default.parentData}, ${m.default.parentDataProperty}, ${m.default.rootData}=${m.default.data}${S.dynamicRef?(0,f._)`, ${m.default.dynamicAnchors}={}`:f.nil}}={}`}function E(S,O){S.if(m.default.valCxt,()=>{S.var(m.default.instancePath,(0,f._)`${m.default.valCxt}.${m.default.instancePath}`),S.var(m.default.parentData,(0,f._)`${m.default.valCxt}.${m.default.parentData}`),S.var(m.default.parentDataProperty,(0,f._)`${m.default.valCxt}.${m.default.parentDataProperty}`),S.var(m.default.rootData,(0,f._)`${m.default.valCxt}.${m.default.rootData}`),O.dynamicRef&&S.var(m.default.dynamicAnchors,(0,f._)`${m.default.valCxt}.${m.default.dynamicAnchors}`)},()=>{S.var(m.default.instancePath,(0,f._)`""`),S.var(m.default.parentData,(0,f._)`undefined`),S.var(m.default.parentDataProperty,(0,f._)`undefined`),S.var(m.default.rootData,m.default.data),O.dynamicRef&&S.var(m.default.dynamicAnchors,(0,f._)`{}`)})}function i(S){const{schema:O,opts:I,gen:D}=S;h(S,()=>{I.$comment&&O.$comment&&L(S),V(S),D.let(m.default.vErrors,null),D.let(m.default.errors,0),I.unevaluated&&a(S),N(S),W(S)})}function a(S){const{gen:O,validateName:I}=S;S.evaluated=O.const("evaluated",(0,f._)`${I}.evaluated`),O.if((0,f._)`${S.evaluated}.dynamicProps`,()=>O.assign((0,f._)`${S.evaluated}.props`,(0,f._)`undefined`)),O.if((0,f._)`${S.evaluated}.dynamicItems`,()=>O.assign((0,f._)`${S.evaluated}.items`,(0,f._)`undefined`))}function s(S,O){const I=typeof S=="object"&&S[O.schemaId];return I&&(O.code.source||O.code.process)?(0,f._)`/*# sourceURL=${I} */`:f.nil}function t(S,O){if(l(S)&&(b(S),g(S))){y(S,O);return}(0,e.boolOrEmptySchema)(S,O)}function g({schema:S,self:O}){if(typeof S=="boolean")return!S;for(const I in S)if(O.RULES.all[I])return!0;return!1}function l(S){return typeof S.schema!="boolean"}function y(S,O){const{schema:I,gen:D,opts:U}=S;U.$comment&&I.$comment&&L(S),z(S),F(S);const G=D.const("_errs",m.default.errors);N(S,G),D.var(O,(0,f._)`${G} === ${m.default.errors}`)}function b(S){(0,$.checkUnknownRules)(S),M(S)}function N(S,O){if(S.opts.jtd)return de(S,[],!1,O);const I=(0,r.getSchemaTypes)(S.schema),D=(0,r.coerceAndCheckDataType)(S,I);de(S,I,!D,O)}function M(S){const{schema:O,errSchemaPath:I,opts:D,self:U}=S;O.$ref&&D.ignoreKeywordsWithRef&&(0,$.schemaHasRulesButRef)(O,U.RULES)&&U.logger.warn(`$ref: keywords ignored in schema at path "${I}"`)}function V(S){const{schema:O,opts:I}=S;O.default!==void 0&&I.useDefaults&&I.strictSchema&&(0,$.checkStrictMode)(S,"default is ignored in the schema root")}function z(S){const O=S.schema[S.opts.schemaId];O&&(S.baseId=(0,w.resolveUrl)(S.opts.uriResolver,S.baseId,O))}function F(S){if(S.schema.$async&&!S.schemaEnv.$async)throw new Error("async schema in sync schema")}function L({gen:S,schemaEnv:O,schema:I,errSchemaPath:D,opts:U}){const G=I.$comment;if(U.$comment===!0)S.code((0,f._)`${m.default.self}.logger.log(${G})`);else if(typeof U.$comment=="function"){const Z=(0,f.str)`${D}/$comment`,ce=S.scopeValue("root",{ref:O.root});S.code((0,f._)`${m.default.self}.opts.$comment(${G}, ${Z}, ${ce}.schema)`)}}function W(S){const{gen:O,schemaEnv:I,validateName:D,ValidationError:U,opts:G}=S;I.$async?O.if((0,f._)`${m.default.errors} === 0`,()=>O.return(m.default.data),()=>O.throw((0,f._)`new ${U}(${m.default.vErrors})`)):(O.assign((0,f._)`${D}.errors`,m.default.vErrors),G.unevaluated&&se(S),O.return((0,f._)`${m.default.errors} === 0`))}function se({gen:S,evaluated:O,props:I,items:D}){I instanceof f.Name&&S.assign((0,f._)`${O}.props`,I),D instanceof f.Name&&S.assign((0,f._)`${O}.items`,D)}function de(S,O,I,D){const{gen:U,schema:G,data:Z,allErrors:ce,opts:ne,self:oe}=S,{RULES:ee}=oe;if(G.$ref&&(ne.ignoreKeywordsWithRef||!(0,$.schemaHasRulesButRef)(G,ee))){U.block(()=>A(S,"$ref",ee.all.$ref.definition));return}ne.jtd||Y(S,O),U.block(()=>{for(const ie of ee.rules)_e(ie);_e(ee.post)});function _e(ie){(0,p.shouldUseGroup)(G,ie)&&(ie.type?(U.if((0,n.checkDataType)(ie.type,Z,ne.strictNumbers)),fe(S,ie),O.length===1&&O[0]===ie.type&&I&&(U.else(),(0,n.reportTypeError)(S)),U.endIf()):fe(S,ie),ce||U.if((0,f._)`${m.default.errors} === ${D||0}`))}}function fe(S,O){const{gen:I,schema:D,opts:{useDefaults:U}}=S;U&&(0,o.assignDefaults)(S,O.type),I.block(()=>{for(const G of O.rules)(0,p.shouldUseRule)(D,G)&&A(S,G.keyword,G.definition,O.type)})}function Y(S,O){S.schemaEnv.meta||!S.opts.strictTypes||(ye(S,O),S.opts.allowUnionTypes||R(S,O),j(S,S.dataTypes))}function ye(S,O){if(O.length){if(!S.dataTypes.length){S.dataTypes=O;return}O.forEach(I=>{C(S.dataTypes,I)||P(S,`type "${I}" not allowed by context "${S.dataTypes.join(",")}"`)}),c(S,O)}}function R(S,O){O.length>1&&!(O.length===2&&O.includes("null"))&&P(S,"use allowUnionTypes to allow union type keyword")}function j(S,O){const I=S.self.RULES.all;for(const D in I){const U=I[D];if(typeof U=="object"&&(0,p.shouldUseRule)(S.schema,U)){const{type:G}=U.definition;G.length&&!G.some(Z=>T(O,Z))&&P(S,`missing type "${G.join(",")}" for keyword "${D}"`)}}}function T(S,O){return S.includes(O)||O==="number"&&S.includes("integer")}function C(S,O){return S.includes(O)||O==="integer"&&S.includes("number")}function c(S,O){const I=[];for(const D of S.dataTypes)C(O,D)?I.push(D):O.includes("integer")&&D==="number"&&I.push("integer");S.dataTypes=I}function P(S,O){const I=S.schemaEnv.baseId+S.errSchemaPath;O+=` at "${I}" (strictTypes)`,(0,$.checkStrictMode)(S,O,S.opts.strictTypes)}class x{constructor(O,I,D){if((0,u.validateKeywordUsage)(O,I,D),this.gen=O.gen,this.allErrors=O.allErrors,this.keyword=D,this.data=O.data,this.schema=O.schema[D],this.$data=I.$data&&O.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,$.schemaRefOrVal)(O,this.schema,D,this.$data),this.schemaType=I.schemaType,this.parentSchema=O.schema,this.params={},this.it=O,this.def=I,this.$data)this.schemaCode=O.gen.const("vSchema",B(this.$data,O));else if(this.schemaCode=this.schemaValue,!(0,u.validSchemaType)(this.schema,I.schemaType,I.allowUndefined))throw new Error(`${D} value must be ${JSON.stringify(I.schemaType)}`);("code"in I?I.trackErrors:I.errors!==!1)&&(this.errsCount=O.gen.const("_errs",m.default.errors))}result(O,I,D){this.failResult((0,f.not)(O),I,D)}failResult(O,I,D){this.gen.if(O),D?D():this.error(),I?(this.gen.else(),I(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(O,I){this.failResult((0,f.not)(O),void 0,I)}fail(O){if(O===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(O),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(O){if(!this.$data)return this.fail(O);const{schemaCode:I}=this;this.fail((0,f._)`${I} !== undefined && (${(0,f.or)(this.invalid$data(),O)})`)}error(O,I,D){if(I){this.setParams(I),this._error(O,D),this.setParams({});return}this._error(O,D)}_error(O,I){(O?k.reportExtraError:k.reportError)(this,this.def.error,I)}$dataError(){(0,k.reportError)(this,this.def.$dataError||k.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,k.resetErrorsCount)(this.gen,this.errsCount)}ok(O){this.allErrors||this.gen.if(O)}setParams(O,I){I?Object.assign(this.params,O):this.params=O}block$data(O,I,D=f.nil){this.gen.block(()=>{this.check$data(O,D),I()})}check$data(O=f.nil,I=f.nil){if(!this.$data)return;const{gen:D,schemaCode:U,schemaType:G,def:Z}=this;D.if((0,f.or)((0,f._)`${U} === undefined`,I)),O!==f.nil&&D.assign(O,!0),(G.length||Z.validateSchema)&&(D.elseIf(this.invalid$data()),this.$dataError(),O!==f.nil&&D.assign(O,!1)),D.else()}invalid$data(){const{gen:O,schemaCode:I,schemaType:D,def:U,it:G}=this;return(0,f.or)(Z(),ce());function Z(){if(D.length){if(!(I instanceof f.Name))throw new Error("ajv implementation error");const ne=Array.isArray(D)?D:[D];return(0,f._)`${(0,n.checkDataTypes)(ne,I,G.opts.strictNumbers,n.DataType.Wrong)}`}return f.nil}function ce(){if(U.validateSchema){const ne=O.scopeValue("validate$data",{ref:U.validateSchema});return(0,f._)`!${ne}(${I})`}return f.nil}}subschema(O,I){const D=(0,d.getSubschema)(this.it,O);(0,d.extendSubschemaData)(D,this.it,O),(0,d.extendSubschemaMode)(D,O);const U={...this.it,...D,items:void 0,props:void 0};return t(U,I),U}mergeEvaluated(O,I){const{it:D,gen:U}=this;D.opts.unevaluated&&(D.props!==!0&&O.props!==void 0&&(D.props=$.mergeEvaluated.props(U,O.props,D.props,I)),D.items!==!0&&O.items!==void 0&&(D.items=$.mergeEvaluated.items(U,O.items,D.items,I)))}mergeValidEvaluated(O,I){const{it:D,gen:U}=this;if(D.opts.unevaluated&&(D.props!==!0||D.items!==!0))return U.if(I,()=>this.mergeEvaluated(O,f.Name)),!0}}he.KeywordCxt=x;function A(S,O,I,D){const U=new x(S,I,O);"code"in I?I.code(U,D):U.$data&&I.validate?(0,u.funcKeywordCode)(U,I):"macro"in I?(0,u.macroKeywordCode)(U,I):(I.compile||I.validate)&&(0,u.funcKeywordCode)(U,I)}const K=/^\/(?:[^~]|~0|~1)*$/,Q=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function B(S,{dataLevel:O,dataNames:I,dataPathArr:D}){let U,G;if(S==="")return m.default.rootData;if(S[0]==="/"){if(!K.test(S))throw new Error(`Invalid JSON-pointer: ${S}`);U=S,G=m.default.rootData}else{const oe=Q.exec(S);if(!oe)throw new Error(`Invalid JSON-pointer: ${S}`);const ee=+oe[1];if(U=oe[2],U==="#"){if(ee>=O)throw new Error(ne("property/index",ee));return D[O-ee]}if(ee>O)throw new Error(ne("data",ee));if(G=I[O-ee],!U)return G}let Z=G;const ce=U.split("/");for(const oe of ce)oe&&(G=(0,f._)`${G}${(0,f.getProperty)((0,$.unescapeJsonPointer)(oe))}`,Z=(0,f._)`${Z} && ${G}`);return Z;function ne(oe,ee){return`Cannot access ${oe} ${ee} levels up, current level is ${O}`}}return he.getData=B,he}var xe={},ar;function xt(){if(ar)return xe;ar=1,Object.defineProperty(xe,"__esModule",{value:!0});class e extends Error{constructor(p){super("validation failed"),this.errors=p,this.ajv=this.validation=!0}}return xe.default=e,xe}var Ie={},ir;function vt(){if(ir)return Ie;ir=1,Object.defineProperty(Ie,"__esModule",{value:!0});const e=mt();class r extends Error{constructor(n,o,u,d){super(d||`can't resolve reference ${u} from id ${o}`),this.missingRef=(0,e.resolveUrl)(n,o,u),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return Ie.default=r,Ie}var ae={},cr;function It(){if(cr)return ae;cr=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.resolveSchema=ae.getCompilingSchema=ae.resolveRef=ae.compileSchema=ae.SchemaEnv=void 0;const e=H(),r=xt(),p=ge(),n=mt(),o=J(),u=yt();class d{constructor(a){var s;this.refs={},this.dynamicAnchors={};let t;typeof a.schema=="object"&&(t=a.schema),this.schema=a.schema,this.schemaId=a.schemaId,this.root=a.root||this,this.baseId=(s=a.baseId)!==null&&s!==void 0?s:(0,n.normalizeId)(t?.[a.schemaId||"$id"]),this.schemaPath=a.schemaPath,this.localRefs=a.localRefs,this.meta=a.meta,this.$async=t?.$async,this.refs={}}}ae.SchemaEnv=d;function f(i){const a=$.call(this,i);if(a)return a;const s=(0,n.getFullPath)(this.opts.uriResolver,i.root.baseId),{es5:t,lines:g}=this.opts.code,{ownProperties:l}=this.opts,y=new e.CodeGen(this.scope,{es5:t,lines:g,ownProperties:l});let b;i.$async&&(b=y.scopeValue("Error",{ref:r.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const N=y.scopeName("validate");i.validateName=N;const M={gen:y,allErrors:this.opts.allErrors,data:p.default.data,parentData:p.default.parentData,parentDataProperty:p.default.parentDataProperty,dataNames:[p.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:y.scopeValue("schema",this.opts.code.source===!0?{ref:i.schema,code:(0,e.stringify)(i.schema)}:{ref:i.schema}),validateName:N,ValidationError:b,schema:i.schema,schemaEnv:i,rootId:s,baseId:i.baseId||s,schemaPath:e.nil,errSchemaPath:i.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let V;try{this._compilations.add(i),(0,u.validateFunctionCode)(M),y.optimize(this.opts.code.optimize);const z=y.toString();V=`${y.scopeRefs(p.default.scope)}return ${z}`,this.opts.code.process&&(V=this.opts.code.process(V,i));const F=new Function(`${p.default.self}`,`${p.default.scope}`,V)(this,this.scope.get());if(this.scope.value(N,{ref:F}),F.errors=null,F.schema=i.schema,F.schemaEnv=i,i.$async&&(F.$async=!0),this.opts.code.source===!0&&(F.source={validateName:N,validateCode:z,scopeValues:y._values}),this.opts.unevaluated){const{props:L,items:W}=M;F.evaluated={props:L instanceof e.Name?void 0:L,items:W instanceof e.Name?void 0:W,dynamicProps:L instanceof e.Name,dynamicItems:W instanceof e.Name},F.source&&(F.source.evaluated=(0,e.stringify)(F.evaluated))}return i.validate=F,i}catch(z){throw delete i.validate,delete i.validateName,V&&this.logger.error("Error compiling schema, function code:",V),z}finally{this._compilations.delete(i)}}ae.compileSchema=f;function m(i,a,s){var t;s=(0,n.resolveUrl)(this.opts.uriResolver,a,s);const g=i.refs[s];if(g)return g;let l=_.call(this,i,s);if(l===void 0){const y=(t=i.localRefs)===null||t===void 0?void 0:t[s],{schemaId:b}=this.opts;y&&(l=new d({schema:y,schemaId:b,root:i,baseId:a}))}if(l!==void 0)return i.refs[s]=w.call(this,l)}ae.resolveRef=m;function w(i){return(0,n.inlineRef)(i.schema,this.opts.inlineRefs)?i.schema:i.validate?i:f.call(this,i)}function $(i){for(const a of this._compilations)if(k(a,i))return a}ae.getCompilingSchema=$;function k(i,a){return i.schema===a.schema&&i.root===a.root&&i.baseId===a.baseId}function _(i,a){let s;for(;typeof(s=this.refs[a])=="string";)a=s;return s||this.schemas[a]||h.call(this,i,a)}function h(i,a){const s=this.opts.uriResolver.parse(a),t=(0,n._getFullPath)(this.opts.uriResolver,s);let g=(0,n.getFullPath)(this.opts.uriResolver,i.baseId,void 0);if(Object.keys(i.schema).length>0&&t===g)return E.call(this,s,i);const l=(0,n.normalizeId)(t),y=this.refs[l]||this.schemas[l];if(typeof y=="string"){const b=h.call(this,i,y);return typeof b?.schema!="object"?void 0:E.call(this,s,b)}if(typeof y?.schema=="object"){if(y.validate||f.call(this,y),l===(0,n.normalizeId)(a)){const{schema:b}=y,{schemaId:N}=this.opts,M=b[N];return M&&(g=(0,n.resolveUrl)(this.opts.uriResolver,g,M)),new d({schema:b,schemaId:N,root:i,baseId:g})}return E.call(this,s,y)}}ae.resolveSchema=h;const v=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function E(i,{baseId:a,schema:s,root:t}){var g;if(((g=i.fragment)===null||g===void 0?void 0:g[0])!=="/")return;for(const b of i.fragment.slice(1).split("/")){if(typeof s=="boolean")return;const N=s[(0,o.unescapeFragment)(b)];if(N===void 0)return;s=N;const M=typeof s=="object"&&s[this.opts.schemaId];!v.has(b)&&M&&(a=(0,n.resolveUrl)(this.opts.uriResolver,a,M))}let l;if(typeof s!="boolean"&&s.$ref&&!(0,o.schemaHasRulesButRef)(s,this.RULES)){const b=(0,n.resolveUrl)(this.opts.uriResolver,a,s.$ref);l=h.call(this,t,b)}const{schemaId:y}=this.opts;if(l=l||new d({schema:s,schemaId:y,root:t,baseId:a}),l.schema!==l.root.schema)return l}return ae}const ks="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",js="Meta-schema for $data reference (JSON AnySchema extension proposal)",Os="object",Cs=["$data"],xs={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Is=!1,Ns={$id:ks,description:js,type:Os,required:Cs,properties:xs,additionalProperties:Is};var Ne={},je={exports:{}},Pt,ur;function is(){if(ur)return Pt;ur=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=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);function p(_){let h="",v=0,E=0;for(E=0;E<_.length;E++)if(v=_[E].charCodeAt(0),v!==48){if(!(v>=48&&v<=57||v>=65&&v<=70||v>=97&&v<=102))return"";h+=_[E];break}for(E+=1;E<_.length;E++){if(v=_[E].charCodeAt(0),!(v>=48&&v<=57||v>=65&&v<=70||v>=97&&v<=102))return"";h+=_[E]}return h}const n=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function o(_){return _.length=0,!0}function u(_,h,v){if(_.length){const E=p(_);if(E!=="")h.push(E);else return v.error=!0,!1;_.length=0}return!0}function d(_){let h=0;const v={error:!1,address:"",zone:""},E=[],i=[];let a=!1,s=!1,t=u;for(let g=0;g<_.length;g++){const l=_[g];if(!(l==="["||l==="]"))if(l===":"){if(a===!0&&(s=!0),!t(i,E,v))break;if(++h>7){v.error=!0;break}g>0&&_[g-1]===":"&&(a=!0),E.push(":");continue}else if(l==="%"){if(!t(i,E,v))break;t=o}else{i.push(l);continue}}return i.length&&(t===o?v.zone=i.join(""):s?E.push(i.join("")):E.push(p(i))),v.address=E.join(""),v}function f(_){if(m(_,":")<2)return{host:_,isIPV6:!1};const h=d(_);if(h.error)return{host:_,isIPV6:!1};{let v=h.address,E=h.address;return h.zone&&(v+="%"+h.zone,E+="%25"+h.zone),{host:v,isIPV6:!0,escapedHost:E}}}function m(_,h){let v=0;for(let E=0;E<_.length;E++)_[E]===h&&v++;return v}function w(_){let h=_;const v=[];let E=-1,i=0;for(;i=h.length;){if(i===1){if(h===".")break;if(h==="/"){v.push("/");break}else{v.push(h);break}}else if(i===2){if(h[0]==="."){if(h[1]===".")break;if(h[1]==="/"){h=h.slice(2);continue}}else if(h[0]==="/"&&(h[1]==="."||h[1]==="/")){v.push("/");break}}else if(i===3&&h==="/.."){v.length!==0&&v.pop(),v.push("/");break}if(h[0]==="."){if(h[1]==="."){if(h[2]==="/"){h=h.slice(3);continue}}else if(h[1]==="/"){h=h.slice(2);continue}}else if(h[0]==="/"&&h[1]==="."){if(h[2]==="/"){h=h.slice(2);continue}else if(h[2]==="."&&h[3]==="/"){h=h.slice(3),v.length!==0&&v.pop();continue}}if((E=h.indexOf("/",1))===-1){v.push(h);break}else v.push(h.slice(0,E)),h=h.slice(E)}return v.join("")}function $(_,h){const v=h!==!0?escape:unescape;return _.scheme!==void 0&&(_.scheme=v(_.scheme)),_.userinfo!==void 0&&(_.userinfo=v(_.userinfo)),_.host!==void 0&&(_.host=v(_.host)),_.path!==void 0&&(_.path=v(_.path)),_.query!==void 0&&(_.query=v(_.query)),_.fragment!==void 0&&(_.fragment=v(_.fragment)),_}function k(_){const h=[];if(_.userinfo!==void 0&&(h.push(_.userinfo),h.push("@")),_.host!==void 0){let v=unescape(_.host);if(!r(v)){const E=f(v);E.isIPV6===!0?v=`[${E.escapedHost}]`:v=_.host}h.push(v)}return(typeof _.port=="number"||typeof _.port=="string")&&(h.push(":"),h.push(String(_.port))),h.length?h.join(""):void 0}return Pt={nonSimpleDomain:n,recomposeAuthority:k,normalizeComponentEncoding:$,removeDotSegments:w,isIPv4:r,isUUID:e,normalizeIPv6:f,stringArrayToHexStripped:p},Pt}var Et,lr;function Ts(){if(lr)return Et;lr=1;const{isUUID:e}=is(),r=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,p=["http","https","ws","wss","urn","urn:uuid"];function n(t){return p.indexOf(t)!==-1}function o(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function u(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function d(t){const g=String(t.scheme).toLowerCase()==="https";return(t.port===(g?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function f(t){return t.secure=o(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function m(t){if((t.port===(o(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){const[g,l]=t.resourceName.split("?");t.path=g&&g!=="/"?g:void 0,t.query=l,t.resourceName=void 0}return t.fragment=void 0,t}function w(t,g){if(!t.path)return t.error="URN can not be parsed",t;const l=t.path.match(r);if(l){const y=g.scheme||t.scheme||"urn";t.nid=l[1].toLowerCase(),t.nss=l[2];const b=`${y}:${g.nid||t.nid}`,N=s(b);t.path=void 0,N&&(t=N.parse(t,g))}else t.error=t.error||"URN can not be parsed.";return t}function $(t,g){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");const l=g.scheme||t.scheme||"urn",y=t.nid.toLowerCase(),b=`${l}:${g.nid||y}`,N=s(b);N&&(t=N.serialize(t,g));const M=t,V=t.nss;return M.path=`${y||g.nid}:${V}`,g.skipEscape=!0,M}function k(t,g){const l=t;return l.uuid=l.nss,l.nss=void 0,!g.tolerant&&(!l.uuid||!e(l.uuid))&&(l.error=l.error||"UUID is not valid."),l}function _(t){const g=t;return g.nss=(t.uuid||"").toLowerCase(),g}const h={scheme:"http",domainHost:!0,parse:u,serialize:d},v={scheme:"https",domainHost:h.domainHost,parse:u,serialize:d},E={scheme:"ws",domainHost:!0,parse:f,serialize:m},i={scheme:"wss",domainHost:E.domainHost,parse:E.parse,serialize:E.serialize},a={http:h,https:v,ws:E,wss:i,urn:{scheme:"urn",parse:w,serialize:$,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:k,serialize:_,skipNormalize:!0}};Object.setPrototypeOf(a,null);function s(t){return t&&(a[t]||a[t.toLowerCase()])||void 0}return Et={wsIsSecure:o,SCHEMES:a,isValidSchemeName:n,getSchemeHandler:s},Et}var dr;function Ms(){if(dr)return je.exports;dr=1;const{normalizeIPv6:e,removeDotSegments:r,recomposeAuthority:p,normalizeComponentEncoding:n,isIPv4:o,nonSimpleDomain:u}=is(),{SCHEMES:d,getSchemeHandler:f}=Ts();function m(i,a){return typeof i=="string"?i=_(v(i,a),a):typeof i=="object"&&(i=v(_(i,a),a)),i}function w(i,a,s){const t=s?Object.assign({scheme:"null"},s):{scheme:"null"},g=$(v(i,t),v(a,t),t,!0);return t.skipEscape=!0,_(g,t)}function $(i,a,s,t){const g={};return t||(i=v(_(i,s),s),a=v(_(a,s),s)),s=s||{},!s.tolerant&&a.scheme?(g.scheme=a.scheme,g.userinfo=a.userinfo,g.host=a.host,g.port=a.port,g.path=r(a.path||""),g.query=a.query):(a.userinfo!==void 0||a.host!==void 0||a.port!==void 0?(g.userinfo=a.userinfo,g.host=a.host,g.port=a.port,g.path=r(a.path||""),g.query=a.query):(a.path?(a.path[0]==="/"?g.path=r(a.path):((i.userinfo!==void 0||i.host!==void 0||i.port!==void 0)&&!i.path?g.path="/"+a.path:i.path?g.path=i.path.slice(0,i.path.lastIndexOf("/")+1)+a.path:g.path=a.path,g.path=r(g.path)),g.query=a.query):(g.path=i.path,a.query!==void 0?g.query=a.query:g.query=i.query),g.userinfo=i.userinfo,g.host=i.host,g.port=i.port),g.scheme=i.scheme),g.fragment=a.fragment,g}function k(i,a,s){return typeof i=="string"?(i=unescape(i),i=_(n(v(i,s),!0),{...s,skipEscape:!0})):typeof i=="object"&&(i=_(n(i,!0),{...s,skipEscape:!0})),typeof a=="string"?(a=unescape(a),a=_(n(v(a,s),!0),{...s,skipEscape:!0})):typeof a=="object"&&(a=_(n(a,!0),{...s,skipEscape:!0})),i.toLowerCase()===a.toLowerCase()}function _(i,a){const s={host:i.host,scheme:i.scheme,userinfo:i.userinfo,port:i.port,path:i.path,query:i.query,nid:i.nid,nss:i.nss,uuid:i.uuid,fragment:i.fragment,reference:i.reference,resourceName:i.resourceName,secure:i.secure,error:""},t=Object.assign({},a),g=[],l=f(t.scheme||s.scheme);l&&l.serialize&&l.serialize(s,t),s.path!==void 0&&(t.skipEscape?s.path=unescape(s.path):(s.path=escape(s.path),s.scheme!==void 0&&(s.path=s.path.split("%3A").join(":")))),t.reference!=="suffix"&&s.scheme&&g.push(s.scheme,":");const y=p(s);if(y!==void 0&&(t.reference!=="suffix"&&g.push("//"),g.push(y),s.path&&s.path[0]!=="/"&&g.push("/")),s.path!==void 0){let b=s.path;!t.absolutePath&&(!l||!l.absolutePath)&&(b=r(b)),y===void 0&&b[0]==="/"&&b[1]==="/"&&(b="/%2F"+b.slice(2)),g.push(b)}return s.query!==void 0&&g.push("?",s.query),s.fragment!==void 0&&g.push("#",s.fragment),g.join("")}const h=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function v(i,a){const s=Object.assign({},a),t={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let g=!1;s.reference==="suffix"&&(s.scheme?i=s.scheme+":"+i:i="//"+i);const l=i.match(h);if(l){if(t.scheme=l[1],t.userinfo=l[3],t.host=l[4],t.port=parseInt(l[5],10),t.path=l[6]||"",t.query=l[7],t.fragment=l[8],isNaN(t.port)&&(t.port=l[5]),t.host)if(o(t.host)===!1){const b=e(t.host);t.host=b.host.toLowerCase(),g=b.isIPV6}else g=!0;t.scheme===void 0&&t.userinfo===void 0&&t.host===void 0&&t.port===void 0&&t.query===void 0&&!t.path?t.reference="same-document":t.scheme===void 0?t.reference="relative":t.fragment===void 0?t.reference="absolute":t.reference="uri",s.reference&&s.reference!=="suffix"&&s.reference!==t.reference&&(t.error=t.error||"URI is not a "+s.reference+" reference.");const y=f(s.scheme||t.scheme);if(!s.unicodeSupport&&(!y||!y.unicodeSupport)&&t.host&&(s.domainHost||y&&y.domainHost)&&g===!1&&u(t.host))try{t.host=URL.domainToASCII(t.host.toLowerCase())}catch(b){t.error=t.error||"Host's domain name can not be converted to ASCII: "+b}(!y||y&&!y.skipNormalize)&&(i.indexOf("%")!==-1&&(t.scheme!==void 0&&(t.scheme=unescape(t.scheme)),t.host!==void 0&&(t.host=unescape(t.host))),t.path&&(t.path=escape(unescape(t.path))),t.fragment&&(t.fragment=encodeURI(decodeURIComponent(t.fragment)))),y&&y.parse&&y.parse(t,s)}else t.error=t.error||"URI can not be parsed.";return t}const E={SCHEMES:d,normalize:m,resolve:w,resolveComponent:$,equal:k,serialize:_,parse:v};return je.exports=E,je.exports.default=E,je.exports.fastUri=E,je.exports}var fr;function Rs(){if(fr)return Ne;fr=1,Object.defineProperty(Ne,"__esModule",{value:!0});const e=Ms();return e.code='require("ajv/dist/runtime/uri").default',Ne.default=e,Ne}var hr;function Ds(){return hr||(hr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var r=yt();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return r.KeywordCxt}});var p=H();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return p._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return p.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return p.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return p.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return p.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return p.CodeGen}});const n=xt(),o=vt(),u=ns(),d=It(),f=H(),m=mt(),w=ht(),$=J(),k=Ns,_=Rs(),h=(R,j)=>new RegExp(R,j);h.code="new RegExp";const v=["removeAdditional","useDefaults","coerceTypes"],E=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),i={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."},a={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},s=200;function t(R){var j,T,C,c,P,x,A,K,Q,B,S,O,I,D,U,G,Z,ce,ne,oe,ee,_e,ie,gt,$t;const Se=R.strict,wt=(j=R.code)===null||j===void 0?void 0:j.optimize,Tt=wt===!0||wt===void 0?1:wt||0,Mt=(C=(T=R.code)===null||T===void 0?void 0:T.regExp)!==null&&C!==void 0?C:h,fs=(c=R.uriResolver)!==null&&c!==void 0?c:_.default;return{strictSchema:(x=(P=R.strictSchema)!==null&&P!==void 0?P:Se)!==null&&x!==void 0?x:!0,strictNumbers:(K=(A=R.strictNumbers)!==null&&A!==void 0?A:Se)!==null&&K!==void 0?K:!0,strictTypes:(B=(Q=R.strictTypes)!==null&&Q!==void 0?Q:Se)!==null&&B!==void 0?B:"log",strictTuples:(O=(S=R.strictTuples)!==null&&S!==void 0?S:Se)!==null&&O!==void 0?O:"log",strictRequired:(D=(I=R.strictRequired)!==null&&I!==void 0?I:Se)!==null&&D!==void 0?D:!1,code:R.code?{...R.code,optimize:Tt,regExp:Mt}:{optimize:Tt,regExp:Mt},loopRequired:(U=R.loopRequired)!==null&&U!==void 0?U:s,loopEnum:(G=R.loopEnum)!==null&&G!==void 0?G:s,meta:(Z=R.meta)!==null&&Z!==void 0?Z:!0,messages:(ce=R.messages)!==null&&ce!==void 0?ce:!0,inlineRefs:(ne=R.inlineRefs)!==null&&ne!==void 0?ne:!0,schemaId:(oe=R.schemaId)!==null&&oe!==void 0?oe:"$id",addUsedSchema:(ee=R.addUsedSchema)!==null&&ee!==void 0?ee:!0,validateSchema:(_e=R.validateSchema)!==null&&_e!==void 0?_e:!0,validateFormats:(ie=R.validateFormats)!==null&&ie!==void 0?ie:!0,unicodeRegExp:(gt=R.unicodeRegExp)!==null&>!==void 0?gt:!0,int32range:($t=R.int32range)!==null&&$t!==void 0?$t:!0,uriResolver:fs}}class g{constructor(j={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,j=this.opts={...j,...t(j)};const{es5:T,lines:C}=this.opts.code;this.scope=new f.ValueScope({scope:{},prefixes:E,es5:T,lines:C}),this.logger=F(j.logger);const c=j.validateFormats;j.validateFormats=!1,this.RULES=(0,u.getRules)(),l.call(this,i,j,"NOT SUPPORTED"),l.call(this,a,j,"DEPRECATED","warn"),this._metaOpts=V.call(this),j.formats&&N.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),j.keywords&&M.call(this,j.keywords),typeof j.meta=="object"&&this.addMetaSchema(j.meta),b.call(this),j.validateFormats=c}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:j,meta:T,schemaId:C}=this.opts;let c=k;C==="id"&&(c={...k},c.id=c.$id,delete c.$id),T&&j&&this.addMetaSchema(c,c[C],!1)}defaultMeta(){const{meta:j,schemaId:T}=this.opts;return this.opts.defaultMeta=typeof j=="object"?j[T]||j:void 0}validate(j,T){let C;if(typeof j=="string"){if(C=this.getSchema(j),!C)throw new Error(`no schema with key or ref "${j}"`)}else C=this.compile(j);const c=C(T);return"$async"in C||(this.errors=C.errors),c}compile(j,T){const C=this._addSchema(j,T);return C.validate||this._compileSchemaEnv(C)}compileAsync(j,T){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:C}=this.opts;return c.call(this,j,T);async function c(B,S){await P.call(this,B.$schema);const O=this._addSchema(B,S);return O.validate||x.call(this,O)}async function P(B){B&&!this.getSchema(B)&&await c.call(this,{$ref:B},!0)}async function x(B){try{return this._compileSchemaEnv(B)}catch(S){if(!(S instanceof o.default))throw S;return A.call(this,S),await K.call(this,S.missingSchema),x.call(this,B)}}function A({missingSchema:B,missingRef:S}){if(this.refs[B])throw new Error(`AnySchema ${B} is loaded but ${S} cannot be resolved`)}async function K(B){const S=await Q.call(this,B);this.refs[B]||await P.call(this,S.$schema),this.refs[B]||this.addSchema(S,B,T)}async function Q(B){const S=this._loading[B];if(S)return S;try{return await(this._loading[B]=C(B))}finally{delete this._loading[B]}}}addSchema(j,T,C,c=this.opts.validateSchema){if(Array.isArray(j)){for(const x of j)this.addSchema(x,void 0,C,c);return this}let P;if(typeof j=="object"){const{schemaId:x}=this.opts;if(P=j[x],P!==void 0&&typeof P!="string")throw new Error(`schema ${x} must be string`)}return T=(0,m.normalizeId)(T||P),this._checkUnique(T),this.schemas[T]=this._addSchema(j,C,T,c,!0),this}addMetaSchema(j,T,C=this.opts.validateSchema){return this.addSchema(j,T,!0,C),this}validateSchema(j,T){if(typeof j=="boolean")return!0;let C;if(C=j.$schema,C!==void 0&&typeof C!="string")throw new Error("$schema must be a string");if(C=C||this.opts.defaultMeta||this.defaultMeta(),!C)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const c=this.validate(C,j);if(!c&&T){const P="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(P);else throw new Error(P)}return c}getSchema(j){let T;for(;typeof(T=y.call(this,j))=="string";)j=T;if(T===void 0){const{schemaId:C}=this.opts,c=new d.SchemaEnv({schema:{},schemaId:C});if(T=d.resolveSchema.call(this,c,j),!T)return;this.refs[j]=T}return T.validate||this._compileSchemaEnv(T)}removeSchema(j){if(j instanceof RegExp)return this._removeAllSchemas(this.schemas,j),this._removeAllSchemas(this.refs,j),this;switch(typeof j){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const T=y.call(this,j);return typeof T=="object"&&this._cache.delete(T.schema),delete this.schemas[j],delete this.refs[j],this}case"object":{const T=j;this._cache.delete(T);let C=j[this.opts.schemaId];return C&&(C=(0,m.normalizeId)(C),delete this.schemas[C],delete this.refs[C]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(j){for(const T of j)this.addKeyword(T);return this}addKeyword(j,T){let C;if(typeof j=="string")C=j,typeof T=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),T.keyword=C);else if(typeof j=="object"&&T===void 0){if(T=j,C=T.keyword,Array.isArray(C)&&!C.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(W.call(this,C,T),!T)return(0,$.eachItem)(C,P=>se.call(this,P)),this;fe.call(this,T);const c={...T,type:(0,w.getJSONTypes)(T.type),schemaType:(0,w.getJSONTypes)(T.schemaType)};return(0,$.eachItem)(C,c.type.length===0?P=>se.call(this,P,c):P=>c.type.forEach(x=>se.call(this,P,c,x))),this}getKeyword(j){const T=this.RULES.all[j];return typeof T=="object"?T.definition:!!T}removeKeyword(j){const{RULES:T}=this;delete T.keywords[j],delete T.all[j];for(const C of T.rules){const c=C.rules.findIndex(P=>P.keyword===j);c>=0&&C.rules.splice(c,1)}return this}addFormat(j,T){return typeof T=="string"&&(T=new RegExp(T)),this.formats[j]=T,this}errorsText(j=this.errors,{separator:T=", ",dataVar:C="data"}={}){return!j||j.length===0?"No errors":j.map(c=>`${C}${c.instancePath} ${c.message}`).reduce((c,P)=>c+T+P)}$dataMetaSchema(j,T){const C=this.RULES.all;j=JSON.parse(JSON.stringify(j));for(const c of T){const P=c.split("/").slice(1);let x=j;for(const A of P)x=x[A];for(const A in C){const K=C[A];if(typeof K!="object")continue;const{$data:Q}=K.definition,B=x[A];Q&&B&&(x[A]=ye(B))}}return j}_removeAllSchemas(j,T){for(const C in j){const c=j[C];(!T||T.test(C))&&(typeof c=="string"?delete j[C]:c&&!c.meta&&(this._cache.delete(c.schema),delete j[C]))}}_addSchema(j,T,C,c=this.opts.validateSchema,P=this.opts.addUsedSchema){let x;const{schemaId:A}=this.opts;if(typeof j=="object")x=j[A];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof j!="boolean")throw new Error("schema must be object or boolean")}let K=this._cache.get(j);if(K!==void 0)return K;C=(0,m.normalizeId)(x||C);const Q=m.getSchemaRefs.call(this,j,C);return K=new d.SchemaEnv({schema:j,schemaId:A,meta:T,baseId:C,localRefs:Q}),this._cache.set(K.schema,K),P&&!C.startsWith("#")&&(C&&this._checkUnique(C),this.refs[C]=K),c&&this.validateSchema(j,!0),K}_checkUnique(j){if(this.schemas[j]||this.refs[j])throw new Error(`schema with key or id "${j}" already exists`)}_compileSchemaEnv(j){if(j.meta?this._compileMetaSchema(j):d.compileSchema.call(this,j),!j.validate)throw new Error("ajv implementation error");return j.validate}_compileMetaSchema(j){const T=this.opts;this.opts=this._metaOpts;try{d.compileSchema.call(this,j)}finally{this.opts=T}}}g.ValidationError=n.default,g.MissingRefError=o.default,e.default=g;function l(R,j,T,C="error"){for(const c in R){const P=c;P in j&&this.logger[C](`${T}: option ${c}. ${R[P]}`)}}function y(R){return R=(0,m.normalizeId)(R),this.schemas[R]||this.refs[R]}function b(){const R=this.opts.schemas;if(R)if(Array.isArray(R))this.addSchema(R);else for(const j in R)this.addSchema(R[j],j)}function N(){for(const R in this.opts.formats){const j=this.opts.formats[R];j&&this.addFormat(R,j)}}function M(R){if(Array.isArray(R)){this.addVocabulary(R);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const j in R){const T=R[j];T.keyword||(T.keyword=j),this.addKeyword(T)}}function V(){const R={...this.opts};for(const j of v)delete R[j];return R}const z={log(){},warn(){},error(){}};function F(R){if(R===!1)return z;if(R===void 0)return console;if(R.log&&R.warn&&R.error)return R;throw new Error("logger must implement log, warn and error methods")}const L=/^[a-z_$][a-z0-9_$:-]*$/i;function W(R,j){const{RULES:T}=this;if((0,$.eachItem)(R,C=>{if(T.keywords[C])throw new Error(`Keyword ${C} is already defined`);if(!L.test(C))throw new Error(`Keyword ${C} has invalid name`)}),!!j&&j.$data&&!("code"in j||"validate"in j))throw new Error('$data keyword must have "code" or "validate" function')}function se(R,j,T){var C;const c=j?.post;if(T&&c)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:P}=this;let x=c?P.post:P.rules.find(({type:K})=>K===T);if(x||(x={type:T,rules:[]},P.rules.push(x)),P.keywords[R]=!0,!j)return;const A={keyword:R,definition:{...j,type:(0,w.getJSONTypes)(j.type),schemaType:(0,w.getJSONTypes)(j.schemaType)}};j.before?de.call(this,x,A,j.before):x.rules.push(A),P.all[R]=A,(C=j.implements)===null||C===void 0||C.forEach(K=>this.addKeyword(K))}function de(R,j,T){const C=R.rules.findIndex(c=>c.keyword===T);C>=0?R.rules.splice(C,0,j):(R.rules.push(j),this.logger.warn(`rule ${T} is not defined`))}function fe(R){let{metaSchema:j}=R;j!==void 0&&(R.$data&&this.opts.$data&&(j=ye(j)),R.validateSchema=this.compile(j,!0))}const Y={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ye(R){return{anyOf:[R,Y]}}})(Rt)),Rt}var Te={},Me={},Re={},pr;function Vs(){if(pr)return Re;pr=1,Object.defineProperty(Re,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Re.default=e,Re}var ve={},mr;function As(){if(mr)return ve;mr=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.callRef=ve.getValidate=void 0;const e=vt(),r=le(),p=H(),n=ge(),o=It(),u=J(),d={keyword:"$ref",schemaType:"string",code(w){const{gen:$,schema:k,it:_}=w,{baseId:h,schemaEnv:v,validateName:E,opts:i,self:a}=_,{root:s}=v;if((k==="#"||k==="#/")&&h===s.baseId)return g();const t=o.resolveRef.call(a,s,h,k);if(t===void 0)throw new e.default(_.opts.uriResolver,h,k);if(t instanceof o.SchemaEnv)return l(t);return y(t);function g(){if(v===s)return m(w,E,v,v.$async);const b=$.scopeValue("root",{ref:s});return m(w,(0,p._)`${b}.validate`,s,s.$async)}function l(b){const N=f(w,b);m(w,N,b,b.$async)}function y(b){const N=$.scopeValue("schema",i.code.source===!0?{ref:b,code:(0,p.stringify)(b)}:{ref:b}),M=$.name("valid"),V=w.subschema({schema:b,dataTypes:[],schemaPath:p.nil,topSchemaRef:N,errSchemaPath:k},M);w.mergeEvaluated(V),w.ok(M)}}};function f(w,$){const{gen:k}=w;return $.validate?k.scopeValue("validate",{ref:$.validate}):(0,p._)`${k.scopeValue("wrapper",{ref:$})}.validate`}ve.getValidate=f;function m(w,$,k,_){const{gen:h,it:v}=w,{allErrors:E,schemaEnv:i,opts:a}=v,s=a.passContext?n.default.this:p.nil;_?t():g();function t(){if(!i.$async)throw new Error("async schema referenced by sync schema");const b=h.let("valid");h.try(()=>{h.code((0,p._)`await ${(0,r.callValidateCode)(w,$,s)}`),y($),E||h.assign(b,!0)},N=>{h.if((0,p._)`!(${N} instanceof ${v.ValidationError})`,()=>h.throw(N)),l(N),E||h.assign(b,!1)}),w.ok(b)}function g(){w.result((0,r.callValidateCode)(w,$,s),()=>y($),()=>l($))}function l(b){const N=(0,p._)`${b}.errors`;h.assign(n.default.vErrors,(0,p._)`${n.default.vErrors} === null ? ${N} : ${n.default.vErrors}.concat(${N})`),h.assign(n.default.errors,(0,p._)`${n.default.vErrors}.length`)}function y(b){var N;if(!v.opts.unevaluated)return;const M=(N=k?.validate)===null||N===void 0?void 0:N.evaluated;if(v.props!==!0)if(M&&!M.dynamicProps)M.props!==void 0&&(v.props=u.mergeEvaluated.props(h,M.props,v.props));else{const V=h.var("props",(0,p._)`${b}.evaluated.props`);v.props=u.mergeEvaluated.props(h,V,v.props,p.Name)}if(v.items!==!0)if(M&&!M.dynamicItems)M.items!==void 0&&(v.items=u.mergeEvaluated.items(h,M.items,v.items));else{const V=h.var("items",(0,p._)`${b}.evaluated.items`);v.items=u.mergeEvaluated.items(h,V,v.items,p.Name)}}}return ve.callRef=m,ve.default=d,ve}var yr;function zs(){if(yr)return Me;yr=1,Object.defineProperty(Me,"__esModule",{value:!0});const e=Vs(),r=As(),p=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,r.default];return Me.default=p,Me}var De={},Ve={},vr;function Us(){if(vr)return Ve;vr=1,Object.defineProperty(Ve,"__esModule",{value:!0});const e=H(),r=e.operators,p={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},n={message:({keyword:u,schemaCode:d})=>(0,e.str)`must be ${p[u].okStr} ${d}`,params:({keyword:u,schemaCode:d})=>(0,e._)`{comparison: ${p[u].okStr}, limit: ${d}}`},o={keyword:Object.keys(p),type:"number",schemaType:"number",$data:!0,error:n,code(u){const{keyword:d,data:f,schemaCode:m}=u;u.fail$data((0,e._)`${f} ${p[d].fail} ${m} || isNaN(${f})`)}};return Ve.default=o,Ve}var Ae={},gr;function Ks(){if(gr)return Ae;gr=1,Object.defineProperty(Ae,"__esModule",{value:!0});const e=H(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:p})=>(0,e.str)`must be multiple of ${p}`,params:({schemaCode:p})=>(0,e._)`{multipleOf: ${p}}`},code(p){const{gen:n,data:o,schemaCode:u,it:d}=p,f=d.opts.multipleOfPrecision,m=n.let("res"),w=f?(0,e._)`Math.abs(Math.round(${m}) - ${m}) > 1e-${f}`:(0,e._)`${m} !== parseInt(${m})`;p.fail$data((0,e._)`(${u} === 0 || (${m} = ${o}/${u}, ${w}))`)}};return Ae.default=r,Ae}var ze={},Ue={},$r;function qs(){if($r)return Ue;$r=1,Object.defineProperty(Ue,"__esModule",{value:!0});function e(r){const p=r.length;let n=0,o=0,u;for(;o<p;)n++,u=r.charCodeAt(o++),u>=55296&&u<=56319&&o<p&&(u=r.charCodeAt(o),(u&64512)===56320&&o++);return n}return Ue.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Ue}var wr;function Fs(){if(wr)return ze;wr=1,Object.defineProperty(ze,"__esModule",{value:!0});const e=H(),r=J(),p=qs(),n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:u}){const d=o==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${d} than ${u} characters`},params:({schemaCode:o})=>(0,e._)`{limit: ${o}}`},code(o){const{keyword:u,data:d,schemaCode:f,it:m}=o,w=u==="maxLength"?e.operators.GT:e.operators.LT,$=m.opts.unicode===!1?(0,e._)`${d}.length`:(0,e._)`${(0,r.useFunc)(o.gen,p.default)}(${d})`;o.fail$data((0,e._)`${$} ${w} ${f}`)}};return ze.default=n,ze}var Ke={},_r;function Ls(){if(_r)return Ke;_r=1,Object.defineProperty(Ke,"__esModule",{value:!0});const e=le(),r=H(),p={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:n})=>(0,r.str)`must match pattern "${n}"`,params:({schemaCode:n})=>(0,r._)`{pattern: ${n}}`},code(n){const{data:o,$data:u,schema:d,schemaCode:f,it:m}=n,w=m.opts.unicodeRegExp?"u":"",$=u?(0,r._)`(new RegExp(${f}, ${w}))`:(0,e.usePattern)(n,d);n.fail$data((0,r._)`!${$}.test(${o})`)}};return Ke.default=p,Ke}var qe={},br;function Gs(){if(br)return qe;br=1,Object.defineProperty(qe,"__esModule",{value:!0});const e=H(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:p,schemaCode:n}){const o=p==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${n} properties`},params:({schemaCode:p})=>(0,e._)`{limit: ${p}}`},code(p){const{keyword:n,data:o,schemaCode:u}=p,d=n==="maxProperties"?e.operators.GT:e.operators.LT;p.fail$data((0,e._)`Object.keys(${o}).length ${d} ${u}`)}};return qe.default=r,qe}var Fe={},Pr;function Hs(){if(Pr)return Fe;Pr=1,Object.defineProperty(Fe,"__esModule",{value:!0});const e=le(),r=H(),p=J(),n={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:o}})=>(0,r.str)`must have required property '${o}'`,params:({params:{missingProperty:o}})=>(0,r._)`{missingProperty: ${o}}`},code(o){const{gen:u,schema:d,schemaCode:f,data:m,$data:w,it:$}=o,{opts:k}=$;if(!w&&d.length===0)return;const _=d.length>=k.loopRequired;if($.allErrors?h():v(),k.strictRequired){const a=o.parentSchema.properties,{definedProperties:s}=o.it;for(const t of d)if(a?.[t]===void 0&&!s.has(t)){const g=$.schemaEnv.baseId+$.errSchemaPath,l=`required property "${t}" is not defined at "${g}" (strictRequired)`;(0,p.checkStrictMode)($,l,$.opts.strictRequired)}}function h(){if(_||w)o.block$data(r.nil,E);else for(const a of d)(0,e.checkReportMissingProp)(o,a)}function v(){const a=u.let("missing");if(_||w){const s=u.let("valid",!0);o.block$data(s,()=>i(a,s)),o.ok(s)}else u.if((0,e.checkMissingProp)(o,d,a)),(0,e.reportMissingProp)(o,a),u.else()}function E(){u.forOf("prop",f,a=>{o.setParams({missingProperty:a}),u.if((0,e.noPropertyInData)(u,m,a,k.ownProperties),()=>o.error())})}function i(a,s){o.setParams({missingProperty:a}),u.forOf(a,f,()=>{u.assign(s,(0,e.propertyInData)(u,m,a,k.ownProperties)),u.if((0,r.not)(s),()=>{o.error(),u.break()})},r.nil)}}};return Fe.default=n,Fe}var Le={},Er;function Bs(){if(Er)return Le;Er=1,Object.defineProperty(Le,"__esModule",{value:!0});const e=H(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:p,schemaCode:n}){const o=p==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${n} items`},params:({schemaCode:p})=>(0,e._)`{limit: ${p}}`},code(p){const{keyword:n,data:o,schemaCode:u}=p,d=n==="maxItems"?e.operators.GT:e.operators.LT;p.fail$data((0,e._)`${o}.length ${d} ${u}`)}};return Le.default=r,Le}var Ge={},He={},Sr;function Nt(){if(Sr)return He;Sr=1,Object.defineProperty(He,"__esModule",{value:!0});const e=as();return e.code='require("ajv/dist/runtime/equal").default',He.default=e,He}var kr;function Js(){if(kr)return Ge;kr=1,Object.defineProperty(Ge,"__esModule",{value:!0});const e=ht(),r=H(),p=J(),n=Nt(),o={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:u,j:d}})=>(0,r.str)`must NOT have duplicate items (items ## ${d} and ${u} are identical)`,params:({params:{i:u,j:d}})=>(0,r._)`{i: ${u}, j: ${d}}`},code(u){const{gen:d,data:f,$data:m,schema:w,parentSchema:$,schemaCode:k,it:_}=u;if(!m&&!w)return;const h=d.let("valid"),v=$.items?(0,e.getSchemaTypes)($.items):[];u.block$data(h,E,(0,r._)`${k} === false`),u.ok(h);function E(){const t=d.let("i",(0,r._)`${f}.length`),g=d.let("j");u.setParams({i:t,j:g}),d.assign(h,!0),d.if((0,r._)`${t} > 1`,()=>(i()?a:s)(t,g))}function i(){return v.length>0&&!v.some(t=>t==="object"||t==="array")}function a(t,g){const l=d.name("item"),y=(0,e.checkDataTypes)(v,l,_.opts.strictNumbers,e.DataType.Wrong),b=d.const("indices",(0,r._)`{}`);d.for((0,r._)`;${t}--;`,()=>{d.let(l,(0,r._)`${f}[${t}]`),d.if(y,(0,r._)`continue`),v.length>1&&d.if((0,r._)`typeof ${l} == "string"`,(0,r._)`${l} += "_"`),d.if((0,r._)`typeof ${b}[${l}] == "number"`,()=>{d.assign(g,(0,r._)`${b}[${l}]`),u.error(),d.assign(h,!1).break()}).code((0,r._)`${b}[${l}] = ${t}`)})}function s(t,g){const l=(0,p.useFunc)(d,n.default),y=d.name("outer");d.label(y).for((0,r._)`;${t}--;`,()=>d.for((0,r._)`${g} = ${t}; ${g}--;`,()=>d.if((0,r._)`${l}(${f}[${t}], ${f}[${g}])`,()=>{u.error(),d.assign(h,!1).break(y)})))}}};return Ge.default=o,Ge}var Be={},jr;function Qs(){if(jr)return Be;jr=1,Object.defineProperty(Be,"__esModule",{value:!0});const e=H(),r=J(),p=Nt(),n={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:o})=>(0,e._)`{allowedValue: ${o}}`},code(o){const{gen:u,data:d,$data:f,schemaCode:m,schema:w}=o;f||w&&typeof w=="object"?o.fail$data((0,e._)`!${(0,r.useFunc)(u,p.default)}(${d}, ${m})`):o.fail((0,e._)`${w} !== ${d}`)}};return Be.default=n,Be}var Je={},Or;function Ws(){if(Or)return Je;Or=1,Object.defineProperty(Je,"__esModule",{value:!0});const e=H(),r=J(),p=Nt(),n={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:o})=>(0,e._)`{allowedValues: ${o}}`},code(o){const{gen:u,data:d,$data:f,schema:m,schemaCode:w,it:$}=o;if(!f&&m.length===0)throw new Error("enum must have non-empty array");const k=m.length>=$.opts.loopEnum;let _;const h=()=>_??(_=(0,r.useFunc)(u,p.default));let v;if(k||f)v=u.let("valid"),o.block$data(v,E);else{if(!Array.isArray(m))throw new Error("ajv implementation error");const a=u.const("vSchema",w);v=(0,e.or)(...m.map((s,t)=>i(a,t)))}o.pass(v);function E(){u.assign(v,!1),u.forOf("v",w,a=>u.if((0,e._)`${h()}(${d}, ${a})`,()=>u.assign(v,!0).break()))}function i(a,s){const t=m[s];return typeof t=="object"&&t!==null?(0,e._)`${h()}(${d}, ${a}[${s}])`:(0,e._)`${d} === ${t}`}}};return Je.default=n,Je}var Cr;function Xs(){if(Cr)return De;Cr=1,Object.defineProperty(De,"__esModule",{value:!0});const e=Us(),r=Ks(),p=Fs(),n=Ls(),o=Gs(),u=Hs(),d=Bs(),f=Js(),m=Qs(),w=Ws(),$=[e.default,r.default,p.default,n.default,o.default,u.default,d.default,f.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},m.default,w.default];return De.default=$,De}var Qe={},be={},xr;function cs(){if(xr)return be;xr=1,Object.defineProperty(be,"__esModule",{value:!0}),be.validateAdditionalItems=void 0;const e=H(),r=J(),p={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,e.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,e._)`{limit: ${o}}`},code(o){const{parentSchema:u,it:d}=o,{items:f}=u;if(!Array.isArray(f)){(0,r.checkStrictMode)(d,'"additionalItems" is ignored when "items" is not an array of schemas');return}n(o,f)}};function n(o,u){const{gen:d,schema:f,data:m,keyword:w,it:$}=o;$.items=!0;const k=d.const("len",(0,e._)`${m}.length`);if(f===!1)o.setParams({len:u.length}),o.pass((0,e._)`${k} <= ${u.length}`);else if(typeof f=="object"&&!(0,r.alwaysValidSchema)($,f)){const h=d.var("valid",(0,e._)`${k} <= ${u.length}`);d.if((0,e.not)(h),()=>_(h)),o.ok(h)}function _(h){d.forRange("i",u.length,k,v=>{o.subschema({keyword:w,dataProp:v,dataPropType:r.Type.Num},h),$.allErrors||d.if((0,e.not)(h),()=>d.break())})}}return be.validateAdditionalItems=n,be.default=p,be}var We={},Pe={},Ir;function us(){if(Ir)return Pe;Ir=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.validateTuple=void 0;const e=H(),r=J(),p=le(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(u){const{schema:d,it:f}=u;if(Array.isArray(d))return o(u,"additionalItems",d);f.items=!0,!(0,r.alwaysValidSchema)(f,d)&&u.ok((0,p.validateArray)(u))}};function o(u,d,f=u.schema){const{gen:m,parentSchema:w,data:$,keyword:k,it:_}=u;E(w),_.opts.unevaluated&&f.length&&_.items!==!0&&(_.items=r.mergeEvaluated.items(m,f.length,_.items));const h=m.name("valid"),v=m.const("len",(0,e._)`${$}.length`);f.forEach((i,a)=>{(0,r.alwaysValidSchema)(_,i)||(m.if((0,e._)`${v} > ${a}`,()=>u.subschema({keyword:k,schemaProp:a,dataProp:a},h)),u.ok(h))});function E(i){const{opts:a,errSchemaPath:s}=_,t=f.length,g=t===i.minItems&&(t===i.maxItems||i[d]===!1);if(a.strictTuples&&!g){const l=`"${k}" is ${t}-tuple, but minItems or maxItems/${d} are not specified or different at path "${s}"`;(0,r.checkStrictMode)(_,l,a.strictTuples)}}}return Pe.validateTuple=o,Pe.default=n,Pe}var Nr;function Ys(){if(Nr)return We;Nr=1,Object.defineProperty(We,"__esModule",{value:!0});const e=us(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:p=>(0,e.validateTuple)(p,"items")};return We.default=r,We}var Xe={},Tr;function Zs(){if(Tr)return Xe;Tr=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=H(),r=J(),p=le(),n=cs(),o={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:u}})=>(0,e.str)`must NOT have more than ${u} items`,params:({params:{len:u}})=>(0,e._)`{limit: ${u}}`},code(u){const{schema:d,parentSchema:f,it:m}=u,{prefixItems:w}=f;m.items=!0,!(0,r.alwaysValidSchema)(m,d)&&(w?(0,n.validateAdditionalItems)(u,w):u.ok((0,p.validateArray)(u)))}};return Xe.default=o,Xe}var Ye={},Mr;function en(){if(Mr)return Ye;Mr=1,Object.defineProperty(Ye,"__esModule",{value:!0});const e=H(),r=J(),p={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:n,max:o}})=>o===void 0?(0,e.str)`must contain at least ${n} valid item(s)`:(0,e.str)`must contain at least ${n} and no more than ${o} valid item(s)`,params:({params:{min:n,max:o}})=>o===void 0?(0,e._)`{minContains: ${n}}`:(0,e._)`{minContains: ${n}, maxContains: ${o}}`},code(n){const{gen:o,schema:u,parentSchema:d,data:f,it:m}=n;let w,$;const{minContains:k,maxContains:_}=d;m.opts.next?(w=k===void 0?1:k,$=_):w=1;const h=o.const("len",(0,e._)`${f}.length`);if(n.setParams({min:w,max:$}),$===void 0&&w===0){(0,r.checkStrictMode)(m,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if($!==void 0&&w>$){(0,r.checkStrictMode)(m,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,r.alwaysValidSchema)(m,u)){let s=(0,e._)`${h} >= ${w}`;$!==void 0&&(s=(0,e._)`${s} && ${h} <= ${$}`),n.pass(s);return}m.items=!0;const v=o.name("valid");$===void 0&&w===1?i(v,()=>o.if(v,()=>o.break())):w===0?(o.let(v,!0),$!==void 0&&o.if((0,e._)`${f}.length > 0`,E)):(o.let(v,!1),E()),n.result(v,()=>n.reset());function E(){const s=o.name("_valid"),t=o.let("count",0);i(s,()=>o.if(s,()=>a(t)))}function i(s,t){o.forRange("i",0,h,g=>{n.subschema({keyword:"contains",dataProp:g,dataPropType:r.Type.Num,compositeRule:!0},s),t()})}function a(s){o.code((0,e._)`${s}++`),$===void 0?o.if((0,e._)`${s} >= ${w}`,()=>o.assign(v,!0).break()):(o.if((0,e._)`${s} > ${$}`,()=>o.assign(v,!1).break()),w===1?o.assign(v,!0):o.if((0,e._)`${s} >= ${w}`,()=>o.assign(v,!0)))}}};return Ye.default=p,Ye}var Rr={},Dr;function tn(){return Dr||(Dr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const r=H(),p=J(),n=le();e.error={message:({params:{property:m,depsCount:w,deps:$}})=>{const k=w===1?"property":"properties";return(0,r.str)`must have ${k} ${$} when property ${m} is present`},params:({params:{property:m,depsCount:w,deps:$,missingProperty:k}})=>(0,r._)`{property: ${m},
|
|
6
|
+
missingProperty: ${k},
|
|
7
|
+
depsCount: ${w},
|
|
8
|
+
deps: ${$}}`};const o={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(m){const[w,$]=u(m);d(m,w),f(m,$)}};function u({schema:m}){const w={},$={};for(const k in m){if(k==="__proto__")continue;const _=Array.isArray(m[k])?w:$;_[k]=m[k]}return[w,$]}function d(m,w=m.schema){const{gen:$,data:k,it:_}=m;if(Object.keys(w).length===0)return;const h=$.let("missing");for(const v in w){const E=w[v];if(E.length===0)continue;const i=(0,n.propertyInData)($,k,v,_.opts.ownProperties);m.setParams({property:v,depsCount:E.length,deps:E.join(", ")}),_.allErrors?$.if(i,()=>{for(const a of E)(0,n.checkReportMissingProp)(m,a)}):($.if((0,r._)`${i} && (${(0,n.checkMissingProp)(m,E,h)})`),(0,n.reportMissingProp)(m,h),$.else())}}e.validatePropertyDeps=d;function f(m,w=m.schema){const{gen:$,data:k,keyword:_,it:h}=m,v=$.name("valid");for(const E in w)(0,p.alwaysValidSchema)(h,w[E])||($.if((0,n.propertyInData)($,k,E,h.opts.ownProperties),()=>{const i=m.subschema({keyword:_,schemaProp:E},v);m.mergeValidEvaluated(i,v)},()=>$.var(v,!0)),m.ok(v))}e.validateSchemaDeps=f,e.default=o})(Rr)),Rr}var Ze={},Vr;function rn(){if(Vr)return Ze;Vr=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=H(),r=J(),p={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:n})=>(0,e._)`{propertyName: ${n.propertyName}}`},code(n){const{gen:o,schema:u,data:d,it:f}=n;if((0,r.alwaysValidSchema)(f,u))return;const m=o.name("valid");o.forIn("key",d,w=>{n.setParams({propertyName:w}),n.subschema({keyword:"propertyNames",data:w,dataTypes:["string"],propertyName:w,compositeRule:!0},m),o.if((0,e.not)(m),()=>{n.error(!0),f.allErrors||o.break()})}),n.ok(m)}};return Ze.default=p,Ze}var et={},Ar;function ls(){if(Ar)return et;Ar=1,Object.defineProperty(et,"__esModule",{value:!0});const e=le(),r=H(),p=ge(),n=J(),o={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:u})=>(0,r._)`{additionalProperty: ${u.additionalProperty}}`},code(u){const{gen:d,schema:f,parentSchema:m,data:w,errsCount:$,it:k}=u;if(!$)throw new Error("ajv implementation error");const{allErrors:_,opts:h}=k;if(k.props=!0,h.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(k,f))return;const v=(0,e.allSchemaProperties)(m.properties),E=(0,e.allSchemaProperties)(m.patternProperties);i(),u.ok((0,r._)`${$} === ${p.default.errors}`);function i(){d.forIn("key",w,l=>{!v.length&&!E.length?t(l):d.if(a(l),()=>t(l))})}function a(l){let y;if(v.length>8){const b=(0,n.schemaRefOrVal)(k,m.properties,"properties");y=(0,e.isOwnProperty)(d,b,l)}else v.length?y=(0,r.or)(...v.map(b=>(0,r._)`${l} === ${b}`)):y=r.nil;return E.length&&(y=(0,r.or)(y,...E.map(b=>(0,r._)`${(0,e.usePattern)(u,b)}.test(${l})`))),(0,r.not)(y)}function s(l){d.code((0,r._)`delete ${w}[${l}]`)}function t(l){if(h.removeAdditional==="all"||h.removeAdditional&&f===!1){s(l);return}if(f===!1){u.setParams({additionalProperty:l}),u.error(),_||d.break();return}if(typeof f=="object"&&!(0,n.alwaysValidSchema)(k,f)){const y=d.name("valid");h.removeAdditional==="failing"?(g(l,y,!1),d.if((0,r.not)(y),()=>{u.reset(),s(l)})):(g(l,y),_||d.if((0,r.not)(y),()=>d.break()))}}function g(l,y,b){const N={keyword:"additionalProperties",dataProp:l,dataPropType:n.Type.Str};b===!1&&Object.assign(N,{compositeRule:!0,createErrors:!1,allErrors:!1}),u.subschema(N,y)}}};return et.default=o,et}var tt={},zr;function sn(){if(zr)return tt;zr=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=yt(),r=le(),p=J(),n=ls(),o={keyword:"properties",type:"object",schemaType:"object",code(u){const{gen:d,schema:f,parentSchema:m,data:w,it:$}=u;$.opts.removeAdditional==="all"&&m.additionalProperties===void 0&&n.default.code(new e.KeywordCxt($,n.default,"additionalProperties"));const k=(0,r.allSchemaProperties)(f);for(const i of k)$.definedProperties.add(i);$.opts.unevaluated&&k.length&&$.props!==!0&&($.props=p.mergeEvaluated.props(d,(0,p.toHash)(k),$.props));const _=k.filter(i=>!(0,p.alwaysValidSchema)($,f[i]));if(_.length===0)return;const h=d.name("valid");for(const i of _)v(i)?E(i):(d.if((0,r.propertyInData)(d,w,i,$.opts.ownProperties)),E(i),$.allErrors||d.else().var(h,!0),d.endIf()),u.it.definedProperties.add(i),u.ok(h);function v(i){return $.opts.useDefaults&&!$.compositeRule&&f[i].default!==void 0}function E(i){u.subschema({keyword:"properties",schemaProp:i,dataProp:i},h)}}};return tt.default=o,tt}var rt={},Ur;function nn(){if(Ur)return rt;Ur=1,Object.defineProperty(rt,"__esModule",{value:!0});const e=le(),r=H(),p=J(),n=J(),o={keyword:"patternProperties",type:"object",schemaType:"object",code(u){const{gen:d,schema:f,data:m,parentSchema:w,it:$}=u,{opts:k}=$,_=(0,e.allSchemaProperties)(f),h=_.filter(g=>(0,p.alwaysValidSchema)($,f[g]));if(_.length===0||h.length===_.length&&(!$.opts.unevaluated||$.props===!0))return;const v=k.strictSchema&&!k.allowMatchingProperties&&w.properties,E=d.name("valid");$.props!==!0&&!($.props instanceof r.Name)&&($.props=(0,n.evaluatedPropsToName)(d,$.props));const{props:i}=$;a();function a(){for(const g of _)v&&s(g),$.allErrors?t(g):(d.var(E,!0),t(g),d.if(E))}function s(g){for(const l in v)new RegExp(g).test(l)&&(0,p.checkStrictMode)($,`property ${l} matches pattern ${g} (use allowMatchingProperties)`)}function t(g){d.forIn("key",m,l=>{d.if((0,r._)`${(0,e.usePattern)(u,g)}.test(${l})`,()=>{const y=h.includes(g);y||u.subschema({keyword:"patternProperties",schemaProp:g,dataProp:l,dataPropType:n.Type.Str},E),$.opts.unevaluated&&i!==!0?d.assign((0,r._)`${i}[${l}]`,!0):!y&&!$.allErrors&&d.if((0,r.not)(E),()=>d.break())})})}}};return rt.default=o,rt}var st={},Kr;function on(){if(Kr)return st;Kr=1,Object.defineProperty(st,"__esModule",{value:!0});const e=J(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(p){const{gen:n,schema:o,it:u}=p;if((0,e.alwaysValidSchema)(u,o)){p.fail();return}const d=n.name("valid");p.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},d),p.failResult(d,()=>p.reset(),()=>p.error())},error:{message:"must NOT be valid"}};return st.default=r,st}var nt={},qr;function an(){if(qr)return nt;qr=1,Object.defineProperty(nt,"__esModule",{value:!0});const e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:le().validateUnion,error:{message:"must match a schema in anyOf"}};return nt.default=e,nt}var ot={},Fr;function cn(){if(Fr)return ot;Fr=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=H(),r=J(),p={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:n})=>(0,e._)`{passingSchemas: ${n.passing}}`},code(n){const{gen:o,schema:u,parentSchema:d,it:f}=n;if(!Array.isArray(u))throw new Error("ajv implementation error");if(f.opts.discriminator&&d.discriminator)return;const m=u,w=o.let("valid",!1),$=o.let("passing",null),k=o.name("_valid");n.setParams({passing:$}),o.block(_),n.result(w,()=>n.reset(),()=>n.error(!0));function _(){m.forEach((h,v)=>{let E;(0,r.alwaysValidSchema)(f,h)?o.var(k,!0):E=n.subschema({keyword:"oneOf",schemaProp:v,compositeRule:!0},k),v>0&&o.if((0,e._)`${k} && ${w}`).assign(w,!1).assign($,(0,e._)`[${$}, ${v}]`).else(),o.if(k,()=>{o.assign(w,!0),o.assign($,v),E&&n.mergeEvaluated(E,e.Name)})})}}};return ot.default=p,ot}var at={},Lr;function un(){if(Lr)return at;Lr=1,Object.defineProperty(at,"__esModule",{value:!0});const e=J(),r={keyword:"allOf",schemaType:"array",code(p){const{gen:n,schema:o,it:u}=p;if(!Array.isArray(o))throw new Error("ajv implementation error");const d=n.name("valid");o.forEach((f,m)=>{if((0,e.alwaysValidSchema)(u,f))return;const w=p.subschema({keyword:"allOf",schemaProp:m},d);p.ok(d),p.mergeEvaluated(w)})}};return at.default=r,at}var it={},Gr;function ln(){if(Gr)return it;Gr=1,Object.defineProperty(it,"__esModule",{value:!0});const e=H(),r=J(),p={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:o})=>(0,e.str)`must match "${o.ifClause}" schema`,params:({params:o})=>(0,e._)`{failingKeyword: ${o.ifClause}}`},code(o){const{gen:u,parentSchema:d,it:f}=o;d.then===void 0&&d.else===void 0&&(0,r.checkStrictMode)(f,'"if" without "then" and "else" is ignored');const m=n(f,"then"),w=n(f,"else");if(!m&&!w)return;const $=u.let("valid",!0),k=u.name("_valid");if(_(),o.reset(),m&&w){const v=u.let("ifClause");o.setParams({ifClause:v}),u.if(k,h("then",v),h("else",v))}else m?u.if(k,h("then")):u.if((0,e.not)(k),h("else"));o.pass($,()=>o.error(!0));function _(){const v=o.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},k);o.mergeEvaluated(v)}function h(v,E){return()=>{const i=o.subschema({keyword:v},k);u.assign($,k),o.mergeValidEvaluated(i,$),E?u.assign(E,(0,e._)`${v}`):o.setParams({ifClause:v})}}}};function n(o,u){const d=o.schema[u];return d!==void 0&&!(0,r.alwaysValidSchema)(o,d)}return it.default=p,it}var ct={},Hr;function dn(){if(Hr)return ct;Hr=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=J(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:p,parentSchema:n,it:o}){n.if===void 0&&(0,e.checkStrictMode)(o,`"${p}" without "if" is ignored`)}};return ct.default=r,ct}var Br;function fn(){if(Br)return Qe;Br=1,Object.defineProperty(Qe,"__esModule",{value:!0});const e=cs(),r=Ys(),p=us(),n=Zs(),o=en(),u=tn(),d=rn(),f=ls(),m=sn(),w=nn(),$=on(),k=an(),_=cn(),h=un(),v=ln(),E=dn();function i(a=!1){const s=[$.default,k.default,_.default,h.default,v.default,E.default,d.default,f.default,u.default,m.default,w.default];return a?s.push(r.default,n.default):s.push(e.default,p.default),s.push(o.default),s}return Qe.default=i,Qe}var ut={},lt={},Jr;function hn(){if(Jr)return lt;Jr=1,Object.defineProperty(lt,"__esModule",{value:!0});const e=H(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:p})=>(0,e.str)`must match format "${p}"`,params:({schemaCode:p})=>(0,e._)`{format: ${p}}`},code(p,n){const{gen:o,data:u,$data:d,schema:f,schemaCode:m,it:w}=p,{opts:$,errSchemaPath:k,schemaEnv:_,self:h}=w;if(!$.validateFormats)return;d?v():E();function v(){const i=o.scopeValue("formats",{ref:h.formats,code:$.code.formats}),a=o.const("fDef",(0,e._)`${i}[${m}]`),s=o.let("fType"),t=o.let("format");o.if((0,e._)`typeof ${a} == "object" && !(${a} instanceof RegExp)`,()=>o.assign(s,(0,e._)`${a}.type || "string"`).assign(t,(0,e._)`${a}.validate`),()=>o.assign(s,(0,e._)`"string"`).assign(t,a)),p.fail$data((0,e.or)(g(),l()));function g(){return $.strictSchema===!1?e.nil:(0,e._)`${m} && !${t}`}function l(){const y=_.$async?(0,e._)`(${a}.async ? await ${t}(${u}) : ${t}(${u}))`:(0,e._)`${t}(${u})`,b=(0,e._)`(typeof ${t} == "function" ? ${y} : ${t}.test(${u}))`;return(0,e._)`${t} && ${t} !== true && ${s} === ${n} && !${b}`}}function E(){const i=h.formats[f];if(!i){g();return}if(i===!0)return;const[a,s,t]=l(i);a===n&&p.pass(y());function g(){if($.strictSchema===!1){h.logger.warn(b());return}throw new Error(b());function b(){return`unknown format "${f}" ignored in schema at path "${k}"`}}function l(b){const N=b instanceof RegExp?(0,e.regexpCode)(b):$.code.formats?(0,e._)`${$.code.formats}${(0,e.getProperty)(f)}`:void 0,M=o.scopeValue("formats",{key:f,ref:b,code:N});return typeof b=="object"&&!(b instanceof RegExp)?[b.type||"string",b.validate,(0,e._)`${M}.validate`]:["string",b,M]}function y(){if(typeof i=="object"&&!(i instanceof RegExp)&&i.async){if(!_.$async)throw new Error("async format in sync schema");return(0,e._)`await ${t}(${u})`}return typeof s=="function"?(0,e._)`${t}(${u})`:(0,e._)`${t}.test(${u})`}}}};return lt.default=r,lt}var Qr;function pn(){if(Qr)return ut;Qr=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=[hn().default];return ut.default=e,ut}var Ee={},Wr;function mn(){return Wr||(Wr=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.contentVocabulary=Ee.metadataVocabulary=void 0,Ee.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Ee.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Ee}var Xr;function yn(){if(Xr)return Te;Xr=1,Object.defineProperty(Te,"__esModule",{value:!0});const e=zs(),r=Xs(),p=fn(),n=pn(),o=mn(),u=[e.default,r.default,(0,p.default)(),n.default,o.metadataVocabulary,o.contentVocabulary];return Te.default=u,Te}var dt={},Oe={},Yr;function vn(){if(Yr)return Oe;Yr=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.DiscrError=void 0;var e;return(function(r){r.Tag="tag",r.Mapping="mapping"})(e||(Oe.DiscrError=e={})),Oe}var Zr;function gn(){if(Zr)return dt;Zr=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=H(),r=vn(),p=It(),n=vt(),o=J(),u={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:d,tagName:f}})=>d===r.DiscrError.Tag?`tag "${f}" must be string`:`value of tag "${f}" must be in oneOf`,params:({params:{discrError:d,tag:f,tagName:m}})=>(0,e._)`{error: ${d}, tag: ${m}, tagValue: ${f}}`},code(d){const{gen:f,data:m,schema:w,parentSchema:$,it:k}=d,{oneOf:_}=$;if(!k.opts.discriminator)throw new Error("discriminator: requires discriminator option");const h=w.propertyName;if(typeof h!="string")throw new Error("discriminator: requires propertyName");if(w.mapping)throw new Error("discriminator: mapping is not supported");if(!_)throw new Error("discriminator: requires oneOf keyword");const v=f.let("valid",!1),E=f.const("tag",(0,e._)`${m}${(0,e.getProperty)(h)}`);f.if((0,e._)`typeof ${E} == "string"`,()=>i(),()=>d.error(!1,{discrError:r.DiscrError.Tag,tag:E,tagName:h})),d.ok(v);function i(){const t=s();f.if(!1);for(const g in t)f.elseIf((0,e._)`${E} === ${g}`),f.assign(v,a(t[g]));f.else(),d.error(!1,{discrError:r.DiscrError.Mapping,tag:E,tagName:h}),f.endIf()}function a(t){const g=f.name("valid"),l=d.subschema({keyword:"oneOf",schemaProp:t},g);return d.mergeEvaluated(l,e.Name),g}function s(){var t;const g={},l=b($);let y=!0;for(let V=0;V<_.length;V++){let z=_[V];if(z?.$ref&&!(0,o.schemaHasRulesButRef)(z,k.self.RULES)){const L=z.$ref;if(z=p.resolveRef.call(k.self,k.schemaEnv.root,k.baseId,L),z instanceof p.SchemaEnv&&(z=z.schema),z===void 0)throw new n.default(k.opts.uriResolver,k.baseId,L)}const F=(t=z?.properties)===null||t===void 0?void 0:t[h];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${h}"`);y=y&&(l||b(z)),N(F,V)}if(!y)throw new Error(`discriminator: "${h}" must be required`);return g;function b({required:V}){return Array.isArray(V)&&V.includes(h)}function N(V,z){if(V.const)M(V.const,z);else if(V.enum)for(const F of V.enum)M(F,z);else throw new Error(`discriminator: "properties/${h}" must have "const" or "enum"`)}function M(V,z){if(typeof V!="string"||V in g)throw new Error(`discriminator: "${h}" values must be unique strings`);g[V]=z}}}};return dt.default=u,dt}const $n="http://json-schema.org/draft-07/schema#",wn="http://json-schema.org/draft-07/schema#",_n="Core schema meta-schema",bn={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Pn=["object","boolean"],En={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},Sn={$schema:$n,$id:wn,title:_n,definitions:bn,type:Pn,properties:En,default:!0};var es;function kn(){return es||(es=1,(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.MissingRefError=r.ValidationError=r.CodeGen=r.Name=r.nil=r.stringify=r.str=r._=r.KeywordCxt=r.Ajv=void 0;const p=Ds(),n=yn(),o=gn(),u=Sn,d=["/properties"],f="http://json-schema.org/draft-07/schema";class m extends p.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(v=>this.addVocabulary(v)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const v=this.opts.$data?this.$dataMetaSchema(u,d):u;this.addMetaSchema(v,f,!1),this.refs["http://json-schema.org/schema"]=f}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(f)?f:void 0)}}r.Ajv=m,e.exports=r=m,e.exports.Ajv=m,Object.defineProperty(r,"__esModule",{value:!0}),r.default=m;var w=yt();Object.defineProperty(r,"KeywordCxt",{enumerable:!0,get:function(){return w.KeywordCxt}});var $=H();Object.defineProperty(r,"_",{enumerable:!0,get:function(){return $._}}),Object.defineProperty(r,"str",{enumerable:!0,get:function(){return $.str}}),Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return $.stringify}}),Object.defineProperty(r,"nil",{enumerable:!0,get:function(){return $.nil}}),Object.defineProperty(r,"Name",{enumerable:!0,get:function(){return $.Name}}),Object.defineProperty(r,"CodeGen",{enumerable:!0,get:function(){return $.CodeGen}});var k=xt();Object.defineProperty(r,"ValidationError",{enumerable:!0,get:function(){return k.default}});var _=vt();Object.defineProperty(r,"MissingRefError",{enumerable:!0,get:function(){return _.default}})})(_t,_t.exports)),_t.exports}var jn=kn();const ts=ws(jn);function St(e,r,p,n){if(typeof e=="string"){const o=Ct(e),{componentNames:u,dataSourceNames:d,fnNames:f,localeKeys:m}=p;o?.op==="component"&&u&&!u.includes(o.arg)?n.push(`${r||"/"}: unknown component "${o.arg}"`):o?.op==="html"&&!gs(o.arg)?n.push(`${r||"/"}: HTML tag "${o.arg}" is not allowed in $html(...) — presentational tags only`):o?.op==="dataSource"&&d&&!d.includes(o.arg)?n.push(`${r||"/"}: unknown dataSource "${o.arg}"`):o?.op==="fn"&&f&&!f.includes(o.arg)?n.push(`${r||"/"}: unknown fn "${o.arg}"`):o?.op==="locale"&&m&&!m.includes(o.arg)&&n.push(`${r||"/"}: unknown locale key "${o.arg}"`);return}if(Array.isArray(e)){e.forEach((o,u)=>St(o,`${r}[${u}]`,p,n));return}if(e!==null&&typeof e=="object"){const o=e;typeof o.$locale=="string"&&p.localeKeys&&!p.localeKeys.includes(o.$locale)&&n.push(`${r?`${r}.`:""}$locale: unknown locale key "${o.$locale}"`);for(const[u,d]of Object.entries(e))St(d,r?`${r}.${u}`:u,p,n)}}function ds(e,r){const p=[];for(const n of e??[]){if(n.keyword==="if"||n.keyword==="anyOf"||n.schemaPath.includes("operatorOp"))continue;if(n.keyword==="additionalProperties"){const u=n.params.additionalProperty,d=rs(r,n.instancePath);p.push(`${d||"/"} has unknown property "${u??"?"}"`.trim());continue}const o=rs(r,n.instancePath);p.push(`${o||"/"} ${n.message??"invalid"}`.trim())}return p}function rs(e,r){return e?r?`${e}${r}`:e:r}function On(e,r,p,n){if(n.has(e))return n.get(e)??null;let o=null;try{o=p.compile($s(r))}catch{o=null}return n.set(e,o),o}function kt(e,r,p,n,o,u){if(Array.isArray(e)){e.forEach((m,w)=>kt(m,`${r}[${w}]`,p,n,o,u));return}if(e===null||typeof e!="object")return;const d=e,f=Ct(d.component);if(f?.op==="component"&&d.componentProps!==null&&typeof d.componentProps=="object"&&!Array.isArray(d.componentProps)){const m=p[f.arg];if(m){const w=On(f.arg,m,n,o);if(w&&!w(d.componentProps)){const $=`${r?`${r}.`:""}componentProps`;for(const k of ds(w.errors,$))u.push(k)}}}for(const[m,w]of Object.entries(d))kt(w,r?`${r}.${m}`:m,p,n,o,u)}function Cn(e){return ss(e.array)&&typeof e.item=="object"&&e.item!==null&&"$template"in e.item}function jt(e,r=new Set){if(Array.isArray(e))return e.forEach(p=>jt(p,r)),r;if(e!==null&&typeof e=="object"){const p=e;for(const n of[p.value,p.array])if(ss(n)){const o=(Ct(n)?.arg??"").split(".")[0].split("[")[0];o&&r.add(o)}for(const[n,o]of Object.entries(p))n!=="item"&&jt(o,r)}return r}function Ot(e,r,p){if(Array.isArray(e)){e.forEach((n,o)=>Ot(n,`${r}[${o}]`,p));return}if(e!==null&&typeof e=="object"){const n=e;if(Cn(n)){if(n.initialValue===void 0&&n.component===void 0)p.push(`${r||"/"}: array node is missing "initialValue" — the "Add" button would create an empty element and its "$model(...)" template leaves would render nothing. Provide an "initialValue" literal with the element's keys.`);else if(n.initialValue!==null&&typeof n.initialValue=="object"&&!Array.isArray(n.initialValue)){const o=n.item.$template,u=jt(o),d=new Set(Object.keys(n.initialValue)),f=[...u].filter(m=>!d.has(m));f.length&&p.push(`${r||"/"}: array node "initialValue" is missing element keys [${f.join(", ")}] required by the item template — those "$model(...)" leaves would have no signal and render nothing.`)}}for(const[o,u]of Object.entries(n))Ot(u,r?`${r}.${o}`:o,p)}}function In(e,r={}){const p=r.componentNames??(r.registry?hs(r.registry):void 0),n=r.dataSourceNames??(r.registry?ps(r.registry):void 0),o=r.fnNames??(r.registry?ms(r.registry):void 0),u=r.localeKeys??(r.registry?ys(r.registry):void 0),d=[],f=new ts({allErrors:!0}).compile(vs);if(!f(e))for(const m of ds(f.errors,""))d.push(m);if(St(e,"",{componentNames:p,dataSourceNames:n,fnNames:o,localeKeys:u},d),Ot(e,"",d),r.propSchemas){const m=new ts({allErrors:!0,allowUnionTypes:!0}),w=new Map;kt(e,"",r.propSchemas,m,w,d)}return{valid:d.length===0,errors:d}}export{In as validateFormSchema};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r,y as e,o as i}from"../../js/index-BSeq6-8S.js";const l=i("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}});function n({className:t,variant:a,...s}){return r.jsx("div",{"data-slot":"alert",role:"alert",className:e(l({variant:a}),t),...s})}function c({className:t,...a}){return r.jsx("div",{"data-slot":"alert-title",className:e("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...a})}function o({className:t,...a}){return r.jsx("div",{"data-slot":"alert-description",className:e("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",t),...a})}export{c as g,l,n as o,o as u};
|