@valbuild/ui 0.48.1 → 0.49.0

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.
@@ -32478,16 +32478,16 @@ new Sym("()");
32478
32478
  var VAL_EXTENSION = "_type";
32479
32479
  var FILE_REF_PROP = "_ref";
32480
32480
  function convertFileSource(src) {
32481
- var _src$metadata2;
32481
+ var _src$metadata3, _src$metadata4;
32482
32482
  if (!src[FILE_REF_PROP].startsWith("/public")) {
32483
- var _src$metadata;
32483
+ var _src$metadata, _src$metadata2;
32484
32484
  return {
32485
- url: src[FILE_REF_PROP] + "?sha256=".concat((_src$metadata = src.metadata) === null || _src$metadata === void 0 ? void 0 : _src$metadata.sha256),
32485
+ url: src[FILE_REF_PROP] + ((_src$metadata = src.metadata) !== null && _src$metadata !== void 0 && _src$metadata.sha256 ? "?sha256=".concat((_src$metadata2 = src.metadata) === null || _src$metadata2 === void 0 ? void 0 : _src$metadata2.sha256) : ""),
32486
32486
  metadata: src.metadata
32487
32487
  };
32488
32488
  }
32489
32489
  return {
32490
- url: src[FILE_REF_PROP].slice("/public".length) + "?sha256=".concat((_src$metadata2 = src.metadata) === null || _src$metadata2 === void 0 ? void 0 : _src$metadata2.sha256),
32490
+ url: src[FILE_REF_PROP].slice("/public".length) + ((_src$metadata3 = src.metadata) !== null && _src$metadata3 !== void 0 && _src$metadata3.sha256 ? "?sha256=".concat((_src$metadata4 = src.metadata) === null || _src$metadata4 === void 0 ? void 0 : _src$metadata4.sha256) : ""),
32491
32491
  metadata: src.metadata
32492
32492
  };
32493
32493
  }
@@ -38186,6 +38186,21 @@ const ChevronDown = createLucideIcon("ChevronDown", [
38186
38186
  const ChevronLeft = createLucideIcon("ChevronLeft", [
38187
38187
  ["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]
38188
38188
  ]);
38189
+ const Diff = createLucideIcon("Diff", [
38190
+ ["path", { d: "M12 3v14", key: "7cf3v8" }],
38191
+ ["path", { d: "M5 10h14", key: "elsbfy" }],
38192
+ ["path", { d: "M5 21h14", key: "11awu3" }]
38193
+ ]);
38194
+ const File = createLucideIcon("File", [
38195
+ [
38196
+ "path",
38197
+ {
38198
+ d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",
38199
+ key: "1nnpy2"
38200
+ }
38201
+ ],
38202
+ ["polyline", { points: "14 2 14 8 20 8", key: "1ew0cm" }]
38203
+ ]);
38189
38204
  const LogIn = createLucideIcon("LogIn", [
38190
38205
  ["path", { d: "M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4", key: "u53s6r" }],
38191
38206
  ["polyline", { points: "10 17 15 12 10 7", key: "1ail0h" }],
@@ -53924,7 +53939,701 @@ function _nonIterableSpread() {
53924
53939
  function _toConsumableArray(arr) {
53925
53940
  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
53926
53941
  }
53927
- var MIME_TYPE_REGEX = /^data:(image\/(png|jpeg|jpg|gif|webp|bmp|tiff|ico|svg\+xml));base64,/;
53942
+ var EXT_TO_MIME_TYPES = {
53943
+ x3d: "application/vnd.hzn-3d-crossword",
53944
+ "3gp": "video/3gpp",
53945
+ "3g2": "video/3gpp2",
53946
+ mseq: "application/vnd.mseq",
53947
+ pwn: "application/vnd.3m.post-it-notes",
53948
+ plb: "application/vnd.3gpp.pic-bw-large",
53949
+ psb: "application/vnd.3gpp.pic-bw-small",
53950
+ pvb: "application/vnd.3gpp.pic-bw-var",
53951
+ tcap: "application/vnd.3gpp2.tcap",
53952
+ "7z": "application/x-7z-compressed",
53953
+ abw: "application/x-abiword",
53954
+ ace: "application/x-ace-compressed",
53955
+ acc: "application/vnd.americandynamics.acc",
53956
+ acu: "application/vnd.acucobol",
53957
+ atc: "application/vnd.acucorp",
53958
+ adp: "audio/adpcm",
53959
+ aab: "application/x-authorware-bin",
53960
+ aam: "application/x-authorware-map",
53961
+ aas: "application/x-authorware-seg",
53962
+ air: "application/vnd.adobe.air-application-installer-package+zip",
53963
+ swf: "application/x-shockwave-flash",
53964
+ fxp: "application/vnd.adobe.fxp",
53965
+ pdf: "application/pdf",
53966
+ ppd: "application/vnd.cups-ppd",
53967
+ dir: "application/x-director",
53968
+ xdp: "application/vnd.adobe.xdp+xml",
53969
+ xfdf: "application/vnd.adobe.xfdf",
53970
+ aac: "audio/x-aac",
53971
+ ahead: "application/vnd.ahead.space",
53972
+ azf: "application/vnd.airzip.filesecure.azf",
53973
+ azs: "application/vnd.airzip.filesecure.azs",
53974
+ azw: "application/vnd.amazon.ebook",
53975
+ ami: "application/vnd.amiga.ami",
53976
+ "N/A": "application/andrew-inset",
53977
+ apk: "application/vnd.android.package-archive",
53978
+ cii: "application/vnd.anser-web-certificate-issue-initiation",
53979
+ fti: "application/vnd.anser-web-funds-transfer-initiation",
53980
+ atx: "application/vnd.antix.game-component",
53981
+ dmg: "application/x-apple-diskimage",
53982
+ mpkg: "application/vnd.apple.installer+xml",
53983
+ aw: "application/applixware",
53984
+ mp3: "audio/mpeg",
53985
+ les: "application/vnd.hhe.lesson-player",
53986
+ swi: "application/vnd.aristanetworks.swi",
53987
+ s: "text/x-asm",
53988
+ atomcat: "application/atomcat+xml",
53989
+ atomsvc: "application/atomsvc+xml",
53990
+ atom: "application/atom+xml",
53991
+ ac: "application/pkix-attr-cert",
53992
+ aif: "audio/x-aiff",
53993
+ avi: "video/x-msvideo",
53994
+ aep: "application/vnd.audiograph",
53995
+ dxf: "image/vnd.dxf",
53996
+ dwf: "model/vnd.dwf",
53997
+ par: "text/plain-bas",
53998
+ bcpio: "application/x-bcpio",
53999
+ bin: "application/octet-stream",
54000
+ bmp: "image/bmp",
54001
+ torrent: "application/x-bittorrent",
54002
+ cod: "application/vnd.rim.cod",
54003
+ mpm: "application/vnd.blueice.multipass",
54004
+ bmi: "application/vnd.bmi",
54005
+ sh: "application/x-sh",
54006
+ btif: "image/prs.btif",
54007
+ rep: "application/vnd.businessobjects",
54008
+ bz: "application/x-bzip",
54009
+ bz2: "application/x-bzip2",
54010
+ csh: "application/x-csh",
54011
+ c: "text/x-c",
54012
+ cdxml: "application/vnd.chemdraw+xml",
54013
+ css: "text/css",
54014
+ cdx: "chemical/x-cdx",
54015
+ cml: "chemical/x-cml",
54016
+ csml: "chemical/x-csml",
54017
+ cdbcmsg: "application/vnd.contact.cmsg",
54018
+ cla: "application/vnd.claymore",
54019
+ c4g: "application/vnd.clonk.c4group",
54020
+ sub: "image/vnd.dvb.subtitle",
54021
+ cdmia: "application/cdmi-capability",
54022
+ cdmic: "application/cdmi-container",
54023
+ cdmid: "application/cdmi-domain",
54024
+ cdmio: "application/cdmi-object",
54025
+ cdmiq: "application/cdmi-queue",
54026
+ c11amc: "application/vnd.cluetrust.cartomobile-config",
54027
+ c11amz: "application/vnd.cluetrust.cartomobile-config-pkg",
54028
+ ras: "image/x-cmu-raster",
54029
+ dae: "model/vnd.collada+xml",
54030
+ csv: "text/csv",
54031
+ cpt: "application/mac-compactpro",
54032
+ wmlc: "application/vnd.wap.wmlc",
54033
+ cgm: "image/cgm",
54034
+ ice: "x-conference/x-cooltalk",
54035
+ cmx: "image/x-cmx",
54036
+ xar: "application/vnd.xara",
54037
+ cmc: "application/vnd.cosmocaller",
54038
+ cpio: "application/x-cpio",
54039
+ clkx: "application/vnd.crick.clicker",
54040
+ clkk: "application/vnd.crick.clicker.keyboard",
54041
+ clkp: "application/vnd.crick.clicker.palette",
54042
+ clkt: "application/vnd.crick.clicker.template",
54043
+ clkw: "application/vnd.crick.clicker.wordbank",
54044
+ wbs: "application/vnd.criticaltools.wbs+xml",
54045
+ cryptonote: "application/vnd.rig.cryptonote",
54046
+ cif: "chemical/x-cif",
54047
+ cmdf: "chemical/x-cmdf",
54048
+ cu: "application/cu-seeme",
54049
+ cww: "application/prs.cww",
54050
+ curl: "text/vnd.curl",
54051
+ dcurl: "text/vnd.curl.dcurl",
54052
+ mcurl: "text/vnd.curl.mcurl",
54053
+ scurl: "text/vnd.curl.scurl",
54054
+ car: "application/vnd.curl.car",
54055
+ pcurl: "application/vnd.curl.pcurl",
54056
+ cmp: "application/vnd.yellowriver-custom-menu",
54057
+ dssc: "application/dssc+der",
54058
+ xdssc: "application/dssc+xml",
54059
+ deb: "application/x-debian-package",
54060
+ uva: "audio/vnd.dece.audio",
54061
+ uvi: "image/vnd.dece.graphic",
54062
+ uvh: "video/vnd.dece.hd",
54063
+ uvm: "video/vnd.dece.mobile",
54064
+ uvu: "video/vnd.uvvu.mp4",
54065
+ uvp: "video/vnd.dece.pd",
54066
+ uvs: "video/vnd.dece.sd",
54067
+ uvv: "video/vnd.dece.video",
54068
+ dvi: "application/x-dvi",
54069
+ seed: "application/vnd.fdsn.seed",
54070
+ dtb: "application/x-dtbook+xml",
54071
+ res: "application/x-dtbresource+xml",
54072
+ ait: "application/vnd.dvb.ait",
54073
+ svc: "application/vnd.dvb.service",
54074
+ eol: "audio/vnd.digital-winds",
54075
+ djvu: "image/vnd.djvu",
54076
+ dtd: "application/xml-dtd",
54077
+ mlp: "application/vnd.dolby.mlp",
54078
+ wad: "application/x-doom",
54079
+ dpg: "application/vnd.dpgraph",
54080
+ dra: "audio/vnd.dra",
54081
+ dfac: "application/vnd.dreamfactory",
54082
+ dts: "audio/vnd.dts",
54083
+ dtshd: "audio/vnd.dts.hd",
54084
+ dwg: "image/vnd.dwg",
54085
+ geo: "application/vnd.dynageo",
54086
+ es: "application/ecmascript",
54087
+ mag: "application/vnd.ecowin.chart",
54088
+ mmr: "image/vnd.fujixerox.edmics-mmr",
54089
+ rlc: "image/vnd.fujixerox.edmics-rlc",
54090
+ exi: "application/exi",
54091
+ mgz: "application/vnd.proteus.magazine",
54092
+ epub: "application/epub+zip",
54093
+ eml: "message/rfc822",
54094
+ nml: "application/vnd.enliven",
54095
+ xpr: "application/vnd.is-xpr",
54096
+ xif: "image/vnd.xiff",
54097
+ xfdl: "application/vnd.xfdl",
54098
+ emma: "application/emma+xml",
54099
+ ez2: "application/vnd.ezpix-album",
54100
+ ez3: "application/vnd.ezpix-package",
54101
+ fst: "image/vnd.fst",
54102
+ fvt: "video/vnd.fvt",
54103
+ fbs: "image/vnd.fastbidsheet",
54104
+ fe_launch: "application/vnd.denovo.fcselayout-link",
54105
+ f4v: "video/x-f4v",
54106
+ flv: "video/x-flv",
54107
+ fpx: "image/vnd.fpx",
54108
+ npx: "image/vnd.net-fpx",
54109
+ flx: "text/vnd.fmi.flexstor",
54110
+ fli: "video/x-fli",
54111
+ ftc: "application/vnd.fluxtime.clip",
54112
+ fdf: "application/vnd.fdf",
54113
+ f: "text/x-fortran",
54114
+ mif: "application/vnd.mif",
54115
+ fm: "application/vnd.framemaker",
54116
+ fh: "image/x-freehand",
54117
+ fsc: "application/vnd.fsc.weblaunch",
54118
+ fnc: "application/vnd.frogans.fnc",
54119
+ ltf: "application/vnd.frogans.ltf",
54120
+ ddd: "application/vnd.fujixerox.ddd",
54121
+ xdw: "application/vnd.fujixerox.docuworks",
54122
+ xbd: "application/vnd.fujixerox.docuworks.binder",
54123
+ oas: "application/vnd.fujitsu.oasys",
54124
+ oa2: "application/vnd.fujitsu.oasys2",
54125
+ oa3: "application/vnd.fujitsu.oasys3",
54126
+ fg5: "application/vnd.fujitsu.oasysgp",
54127
+ bh2: "application/vnd.fujitsu.oasysprs",
54128
+ spl: "application/x-futuresplash",
54129
+ fzs: "application/vnd.fuzzysheet",
54130
+ g3: "image/g3fax",
54131
+ gmx: "application/vnd.gmx",
54132
+ gtw: "model/vnd.gtw",
54133
+ txd: "application/vnd.genomatix.tuxedo",
54134
+ ggb: "application/vnd.geogebra.file",
54135
+ ggt: "application/vnd.geogebra.tool",
54136
+ gdl: "model/vnd.gdl",
54137
+ gex: "application/vnd.geometry-explorer",
54138
+ gxt: "application/vnd.geonext",
54139
+ g2w: "application/vnd.geoplan",
54140
+ g3w: "application/vnd.geospace",
54141
+ gsf: "application/x-font-ghostscript",
54142
+ bdf: "application/x-font-bdf",
54143
+ gtar: "application/x-gtar",
54144
+ texinfo: "application/x-texinfo",
54145
+ gnumeric: "application/x-gnumeric",
54146
+ kml: "application/vnd.google-earth.kml+xml",
54147
+ kmz: "application/vnd.google-earth.kmz",
54148
+ gqf: "application/vnd.grafeq",
54149
+ gif: "image/gif",
54150
+ gv: "text/vnd.graphviz",
54151
+ gac: "application/vnd.groove-account",
54152
+ ghf: "application/vnd.groove-help",
54153
+ gim: "application/vnd.groove-identity-message",
54154
+ grv: "application/vnd.groove-injector",
54155
+ gtm: "application/vnd.groove-tool-message",
54156
+ tpl: "application/vnd.groove-tool-template",
54157
+ vcg: "application/vnd.groove-vcard",
54158
+ h261: "video/h261",
54159
+ h263: "video/h263",
54160
+ h264: "video/h264",
54161
+ hpid: "application/vnd.hp-hpid",
54162
+ hps: "application/vnd.hp-hps",
54163
+ hdf: "application/x-hdf",
54164
+ rip: "audio/vnd.rip",
54165
+ hbci: "application/vnd.hbci",
54166
+ jlt: "application/vnd.hp-jlyt",
54167
+ pcl: "application/vnd.hp-pcl",
54168
+ hpgl: "application/vnd.hp-hpgl",
54169
+ hvs: "application/vnd.yamaha.hv-script",
54170
+ hvd: "application/vnd.yamaha.hv-dic",
54171
+ hvp: "application/vnd.yamaha.hv-voice",
54172
+ "sfd-hdstx": "application/vnd.hydrostatix.sof-data",
54173
+ stk: "application/hyperstudio",
54174
+ hal: "application/vnd.hal+xml",
54175
+ html: "text/html",
54176
+ irm: "application/vnd.ibm.rights-management",
54177
+ sc: "application/vnd.ibm.secure-container",
54178
+ ics: "text/calendar",
54179
+ icc: "application/vnd.iccprofile",
54180
+ ico: "image/x-icon",
54181
+ igl: "application/vnd.igloader",
54182
+ ief: "image/ief",
54183
+ ivp: "application/vnd.immervision-ivp",
54184
+ ivu: "application/vnd.immervision-ivu",
54185
+ rif: "application/reginfo+xml",
54186
+ "3dml": "text/vnd.in3d.3dml",
54187
+ spot: "text/vnd.in3d.spot",
54188
+ igs: "model/iges",
54189
+ i2g: "application/vnd.intergeo",
54190
+ cdy: "application/vnd.cinderella",
54191
+ xpw: "application/vnd.intercon.formnet",
54192
+ fcs: "application/vnd.isac.fcs",
54193
+ ipfix: "application/ipfix",
54194
+ cer: "application/pkix-cert",
54195
+ pki: "application/pkixcmp",
54196
+ crl: "application/pkix-crl",
54197
+ pkipath: "application/pkix-pkipath",
54198
+ igm: "application/vnd.insors.igm",
54199
+ rcprofile: "application/vnd.ipunplugged.rcprofile",
54200
+ irp: "application/vnd.irepository.package+xml",
54201
+ jad: "text/vnd.sun.j2me.app-descriptor",
54202
+ jar: "application/java-archive",
54203
+ "class": "application/java-vm",
54204
+ jnlp: "application/x-java-jnlp-file",
54205
+ ser: "application/java-serialized-object",
54206
+ java: "text/x-java-source,java",
54207
+ js: "application/javascript",
54208
+ json: "application/json",
54209
+ joda: "application/vnd.joost.joda-archive",
54210
+ jpm: "video/jpm",
54211
+ jpeg: "image/jpeg",
54212
+ jpg: "image/jpeg",
54213
+ pjpeg: "image/pjpeg",
54214
+ jpgv: "video/jpeg",
54215
+ ktz: "application/vnd.kahootz",
54216
+ mmd: "application/vnd.chipnuts.karaoke-mmd",
54217
+ karbon: "application/vnd.kde.karbon",
54218
+ chrt: "application/vnd.kde.kchart",
54219
+ kfo: "application/vnd.kde.kformula",
54220
+ flw: "application/vnd.kde.kivio",
54221
+ kon: "application/vnd.kde.kontour",
54222
+ kpr: "application/vnd.kde.kpresenter",
54223
+ ksp: "application/vnd.kde.kspread",
54224
+ kwd: "application/vnd.kde.kword",
54225
+ htke: "application/vnd.kenameaapp",
54226
+ kia: "application/vnd.kidspiration",
54227
+ kne: "application/vnd.kinar",
54228
+ sse: "application/vnd.kodak-descriptor",
54229
+ lasxml: "application/vnd.las.las+xml",
54230
+ latex: "application/x-latex",
54231
+ lbd: "application/vnd.llamagraphics.life-balance.desktop",
54232
+ lbe: "application/vnd.llamagraphics.life-balance.exchange+xml",
54233
+ jam: "application/vnd.jam",
54234
+ "123": "application/vnd.lotus-1-2-3",
54235
+ apr: "application/vnd.lotus-approach",
54236
+ pre: "application/vnd.lotus-freelance",
54237
+ nsf: "application/vnd.lotus-notes",
54238
+ org: "application/vnd.lotus-organizer",
54239
+ scm: "application/vnd.lotus-screencam",
54240
+ lwp: "application/vnd.lotus-wordpro",
54241
+ lvp: "audio/vnd.lucent.voice",
54242
+ m3u: "audio/x-mpegurl",
54243
+ m4v: "video/x-m4v",
54244
+ hqx: "application/mac-binhex40",
54245
+ portpkg: "application/vnd.macports.portpkg",
54246
+ mgp: "application/vnd.osgeo.mapguide.package",
54247
+ mrc: "application/marc",
54248
+ mrcx: "application/marcxml+xml",
54249
+ mxf: "application/mxf",
54250
+ nbp: "application/vnd.wolfram.player",
54251
+ ma: "application/mathematica",
54252
+ mathml: "application/mathml+xml",
54253
+ mbox: "application/mbox",
54254
+ mc1: "application/vnd.medcalcdata",
54255
+ mscml: "application/mediaservercontrol+xml",
54256
+ cdkey: "application/vnd.mediastation.cdkey",
54257
+ mwf: "application/vnd.mfer",
54258
+ mfm: "application/vnd.mfmp",
54259
+ msh: "model/mesh",
54260
+ mads: "application/mads+xml",
54261
+ mets: "application/mets+xml",
54262
+ mods: "application/mods+xml",
54263
+ meta4: "application/metalink4+xml",
54264
+ mcd: "application/vnd.mcd",
54265
+ flo: "application/vnd.micrografx.flo",
54266
+ igx: "application/vnd.micrografx.igx",
54267
+ es3: "application/vnd.eszigno3+xml",
54268
+ mdb: "application/x-msaccess",
54269
+ asf: "video/x-ms-asf",
54270
+ exe: "application/x-msdownload",
54271
+ cil: "application/vnd.ms-artgalry",
54272
+ cab: "application/vnd.ms-cab-compressed",
54273
+ ims: "application/vnd.ms-ims",
54274
+ application: "application/x-ms-application",
54275
+ clp: "application/x-msclip",
54276
+ mdi: "image/vnd.ms-modi",
54277
+ eot: "application/vnd.ms-fontobject",
54278
+ xls: "application/vnd.ms-excel",
54279
+ xlam: "application/vnd.ms-excel.addin.macroenabled.12",
54280
+ xlsb: "application/vnd.ms-excel.sheet.binary.macroenabled.12",
54281
+ xltm: "application/vnd.ms-excel.template.macroenabled.12",
54282
+ xlsm: "application/vnd.ms-excel.sheet.macroenabled.12",
54283
+ chm: "application/vnd.ms-htmlhelp",
54284
+ crd: "application/x-mscardfile",
54285
+ lrm: "application/vnd.ms-lrm",
54286
+ mvb: "application/x-msmediaview",
54287
+ mny: "application/x-msmoney",
54288
+ pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
54289
+ sldx: "application/vnd.openxmlformats-officedocument.presentationml.slide",
54290
+ ppsx: "application/vnd.openxmlformats-officedocument.presentationml.slideshow",
54291
+ potx: "application/vnd.openxmlformats-officedocument.presentationml.template",
54292
+ xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
54293
+ xltx: "application/vnd.openxmlformats-officedocument.spreadsheetml.template",
54294
+ docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
54295
+ dotx: "application/vnd.openxmlformats-officedocument.wordprocessingml.template",
54296
+ obd: "application/x-msbinder",
54297
+ thmx: "application/vnd.ms-officetheme",
54298
+ onetoc: "application/onenote",
54299
+ pya: "audio/vnd.ms-playready.media.pya",
54300
+ pyv: "video/vnd.ms-playready.media.pyv",
54301
+ ppt: "application/vnd.ms-powerpoint",
54302
+ ppam: "application/vnd.ms-powerpoint.addin.macroenabled.12",
54303
+ sldm: "application/vnd.ms-powerpoint.slide.macroenabled.12",
54304
+ pptm: "application/vnd.ms-powerpoint.presentation.macroenabled.12",
54305
+ ppsm: "application/vnd.ms-powerpoint.slideshow.macroenabled.12",
54306
+ potm: "application/vnd.ms-powerpoint.template.macroenabled.12",
54307
+ mpp: "application/vnd.ms-project",
54308
+ pub: "application/x-mspublisher",
54309
+ scd: "application/x-msschedule",
54310
+ xap: "application/x-silverlight-app",
54311
+ stl: "application/vnd.ms-pki.stl",
54312
+ cat: "application/vnd.ms-pki.seccat",
54313
+ vsd: "application/vnd.visio",
54314
+ vsdx: "application/vnd.visio2013",
54315
+ wm: "video/x-ms-wm",
54316
+ wma: "audio/x-ms-wma",
54317
+ wax: "audio/x-ms-wax",
54318
+ wmx: "video/x-ms-wmx",
54319
+ wmd: "application/x-ms-wmd",
54320
+ wpl: "application/vnd.ms-wpl",
54321
+ wmz: "application/x-ms-wmz",
54322
+ wmv: "video/x-ms-wmv",
54323
+ wvx: "video/x-ms-wvx",
54324
+ wmf: "application/x-msmetafile",
54325
+ trm: "application/x-msterminal",
54326
+ doc: "application/msword",
54327
+ docm: "application/vnd.ms-word.document.macroenabled.12",
54328
+ dotm: "application/vnd.ms-word.template.macroenabled.12",
54329
+ wri: "application/x-mswrite",
54330
+ wps: "application/vnd.ms-works",
54331
+ xbap: "application/x-ms-xbap",
54332
+ xps: "application/vnd.ms-xpsdocument",
54333
+ mid: "audio/midi",
54334
+ mpy: "application/vnd.ibm.minipay",
54335
+ afp: "application/vnd.ibm.modcap",
54336
+ rms: "application/vnd.jcp.javame.midlet-rms",
54337
+ tmo: "application/vnd.tmobile-livetv",
54338
+ prc: "application/x-mobipocket-ebook",
54339
+ mbk: "application/vnd.mobius.mbk",
54340
+ dis: "application/vnd.mobius.dis",
54341
+ plc: "application/vnd.mobius.plc",
54342
+ mqy: "application/vnd.mobius.mqy",
54343
+ msl: "application/vnd.mobius.msl",
54344
+ txf: "application/vnd.mobius.txf",
54345
+ daf: "application/vnd.mobius.daf",
54346
+ fly: "text/vnd.fly",
54347
+ mpc: "application/vnd.mophun.certificate",
54348
+ mpn: "application/vnd.mophun.application",
54349
+ mj2: "video/mj2",
54350
+ mpga: "audio/mpeg",
54351
+ mxu: "video/vnd.mpegurl",
54352
+ mpeg: "video/mpeg",
54353
+ m21: "application/mp21",
54354
+ mp4a: "audio/mp4",
54355
+ mp4: "video/mp4",
54356
+ m3u8: "application/vnd.apple.mpegurl",
54357
+ mus: "application/vnd.musician",
54358
+ msty: "application/vnd.muvee.style",
54359
+ mxml: "application/xv+xml",
54360
+ ngdat: "application/vnd.nokia.n-gage.data",
54361
+ "n-gage": "application/vnd.nokia.n-gage.symbian.install",
54362
+ ncx: "application/x-dtbncx+xml",
54363
+ nc: "application/x-netcdf",
54364
+ nlu: "application/vnd.neurolanguage.nlu",
54365
+ dna: "application/vnd.dna",
54366
+ nnd: "application/vnd.noblenet-directory",
54367
+ nns: "application/vnd.noblenet-sealer",
54368
+ nnw: "application/vnd.noblenet-web",
54369
+ rpst: "application/vnd.nokia.radio-preset",
54370
+ rpss: "application/vnd.nokia.radio-presets",
54371
+ n3: "text/n3",
54372
+ edm: "application/vnd.novadigm.edm",
54373
+ edx: "application/vnd.novadigm.edx",
54374
+ ext: "application/vnd.novadigm.ext",
54375
+ gph: "application/vnd.flographit",
54376
+ ecelp4800: "audio/vnd.nuera.ecelp4800",
54377
+ ecelp7470: "audio/vnd.nuera.ecelp7470",
54378
+ ecelp9600: "audio/vnd.nuera.ecelp9600",
54379
+ oda: "application/oda",
54380
+ ogx: "application/ogg",
54381
+ oga: "audio/ogg",
54382
+ ogv: "video/ogg",
54383
+ dd2: "application/vnd.oma.dd2+xml",
54384
+ oth: "application/vnd.oasis.opendocument.text-web",
54385
+ opf: "application/oebps-package+xml",
54386
+ qbo: "application/vnd.intu.qbo",
54387
+ oxt: "application/vnd.openofficeorg.extension",
54388
+ osf: "application/vnd.yamaha.openscoreformat",
54389
+ weba: "audio/webm",
54390
+ webm: "video/webm",
54391
+ odc: "application/vnd.oasis.opendocument.chart",
54392
+ otc: "application/vnd.oasis.opendocument.chart-template",
54393
+ odb: "application/vnd.oasis.opendocument.database",
54394
+ odf: "application/vnd.oasis.opendocument.formula",
54395
+ odft: "application/vnd.oasis.opendocument.formula-template",
54396
+ odg: "application/vnd.oasis.opendocument.graphics",
54397
+ otg: "application/vnd.oasis.opendocument.graphics-template",
54398
+ odi: "application/vnd.oasis.opendocument.image",
54399
+ oti: "application/vnd.oasis.opendocument.image-template",
54400
+ odp: "application/vnd.oasis.opendocument.presentation",
54401
+ otp: "application/vnd.oasis.opendocument.presentation-template",
54402
+ ods: "application/vnd.oasis.opendocument.spreadsheet",
54403
+ ots: "application/vnd.oasis.opendocument.spreadsheet-template",
54404
+ odt: "application/vnd.oasis.opendocument.text",
54405
+ odm: "application/vnd.oasis.opendocument.text-master",
54406
+ ott: "application/vnd.oasis.opendocument.text-template",
54407
+ ktx: "image/ktx",
54408
+ sxc: "application/vnd.sun.xml.calc",
54409
+ stc: "application/vnd.sun.xml.calc.template",
54410
+ sxd: "application/vnd.sun.xml.draw",
54411
+ std: "application/vnd.sun.xml.draw.template",
54412
+ sxi: "application/vnd.sun.xml.impress",
54413
+ sti: "application/vnd.sun.xml.impress.template",
54414
+ sxm: "application/vnd.sun.xml.math",
54415
+ sxw: "application/vnd.sun.xml.writer",
54416
+ sxg: "application/vnd.sun.xml.writer.global",
54417
+ stw: "application/vnd.sun.xml.writer.template",
54418
+ otf: "application/x-font-otf",
54419
+ osfpvg: "application/vnd.yamaha.openscoreformat.osfpvg+xml",
54420
+ dp: "application/vnd.osgi.dp",
54421
+ pdb: "application/vnd.palm",
54422
+ p: "text/x-pascal",
54423
+ paw: "application/vnd.pawaafile",
54424
+ pclxl: "application/vnd.hp-pclxl",
54425
+ efif: "application/vnd.picsel",
54426
+ pcx: "image/x-pcx",
54427
+ psd: "image/vnd.adobe.photoshop",
54428
+ prf: "application/pics-rules",
54429
+ pic: "image/x-pict",
54430
+ chat: "application/x-chat",
54431
+ p10: "application/pkcs10",
54432
+ p12: "application/x-pkcs12",
54433
+ p7m: "application/pkcs7-mime",
54434
+ p7s: "application/pkcs7-signature",
54435
+ p7r: "application/x-pkcs7-certreqresp",
54436
+ p7b: "application/x-pkcs7-certificates",
54437
+ p8: "application/pkcs8",
54438
+ plf: "application/vnd.pocketlearn",
54439
+ pnm: "image/x-portable-anymap",
54440
+ pbm: "image/x-portable-bitmap",
54441
+ pcf: "application/x-font-pcf",
54442
+ pfr: "application/font-tdpfr",
54443
+ pgn: "application/x-chess-pgn",
54444
+ pgm: "image/x-portable-graymap",
54445
+ png: "image/png",
54446
+ ppm: "image/x-portable-pixmap",
54447
+ pskcxml: "application/pskc+xml",
54448
+ pml: "application/vnd.ctc-posml",
54449
+ ai: "application/postscript",
54450
+ pfa: "application/x-font-type1",
54451
+ pbd: "application/vnd.powerbuilder6",
54452
+ pgp: "application/pgp-signature",
54453
+ box: "application/vnd.previewsystems.box",
54454
+ ptid: "application/vnd.pvi.ptid1",
54455
+ pls: "application/pls+xml",
54456
+ str: "application/vnd.pg.format",
54457
+ ei6: "application/vnd.pg.osasli",
54458
+ dsc: "text/prs.lines.tag",
54459
+ psf: "application/x-font-linux-psf",
54460
+ qps: "application/vnd.publishare-delta-tree",
54461
+ wg: "application/vnd.pmi.widget",
54462
+ qxd: "application/vnd.quark.quarkxpress",
54463
+ esf: "application/vnd.epson.esf",
54464
+ msf: "application/vnd.epson.msf",
54465
+ ssf: "application/vnd.epson.ssf",
54466
+ qam: "application/vnd.epson.quickanime",
54467
+ qfx: "application/vnd.intu.qfx",
54468
+ qt: "video/quicktime",
54469
+ rar: "application/x-rar-compressed",
54470
+ ram: "audio/x-pn-realaudio",
54471
+ rmp: "audio/x-pn-realaudio-plugin",
54472
+ rsd: "application/rsd+xml",
54473
+ rm: "application/vnd.rn-realmedia",
54474
+ bed: "application/vnd.realvnc.bed",
54475
+ mxl: "application/vnd.recordare.musicxml",
54476
+ musicxml: "application/vnd.recordare.musicxml+xml",
54477
+ rnc: "application/relax-ng-compact-syntax",
54478
+ rdz: "application/vnd.data-vision.rdz",
54479
+ rdf: "application/rdf+xml",
54480
+ rp9: "application/vnd.cloanto.rp9",
54481
+ jisp: "application/vnd.jisp",
54482
+ rtf: "application/rtf",
54483
+ rtx: "text/richtext",
54484
+ link66: "application/vnd.route66.link66+xml",
54485
+ rss: "application/rss+xml",
54486
+ shf: "application/shf+xml",
54487
+ st: "application/vnd.sailingtracker.track",
54488
+ svg: "image/svg+xml",
54489
+ sus: "application/vnd.sus-calendar",
54490
+ sru: "application/sru+xml",
54491
+ setpay: "application/set-payment-initiation",
54492
+ setreg: "application/set-registration-initiation",
54493
+ sema: "application/vnd.sema",
54494
+ semd: "application/vnd.semd",
54495
+ semf: "application/vnd.semf",
54496
+ see: "application/vnd.seemail",
54497
+ snf: "application/x-font-snf",
54498
+ spq: "application/scvp-vp-request",
54499
+ spp: "application/scvp-vp-response",
54500
+ scq: "application/scvp-cv-request",
54501
+ scs: "application/scvp-cv-response",
54502
+ sdp: "application/sdp",
54503
+ etx: "text/x-setext",
54504
+ movie: "video/x-sgi-movie",
54505
+ ifm: "application/vnd.shana.informed.formdata",
54506
+ itp: "application/vnd.shana.informed.formtemplate",
54507
+ iif: "application/vnd.shana.informed.interchange",
54508
+ ipk: "application/vnd.shana.informed.package",
54509
+ tfi: "application/thraud+xml",
54510
+ shar: "application/x-shar",
54511
+ rgb: "image/x-rgb",
54512
+ slt: "application/vnd.epson.salt",
54513
+ aso: "application/vnd.accpac.simply.aso",
54514
+ imp: "application/vnd.accpac.simply.imp",
54515
+ twd: "application/vnd.simtech-mindmapper",
54516
+ csp: "application/vnd.commonspace",
54517
+ saf: "application/vnd.yamaha.smaf-audio",
54518
+ mmf: "application/vnd.smaf",
54519
+ spf: "application/vnd.yamaha.smaf-phrase",
54520
+ teacher: "application/vnd.smart.teacher",
54521
+ svd: "application/vnd.svd",
54522
+ rq: "application/sparql-query",
54523
+ srx: "application/sparql-results+xml",
54524
+ gram: "application/srgs",
54525
+ grxml: "application/srgs+xml",
54526
+ ssml: "application/ssml+xml",
54527
+ skp: "application/vnd.koan",
54528
+ sgml: "text/sgml",
54529
+ sdc: "application/vnd.stardivision.calc",
54530
+ sda: "application/vnd.stardivision.draw",
54531
+ sdd: "application/vnd.stardivision.impress",
54532
+ smf: "application/vnd.stardivision.math",
54533
+ sdw: "application/vnd.stardivision.writer",
54534
+ sgl: "application/vnd.stardivision.writer-global",
54535
+ sm: "application/vnd.stepmania.stepchart",
54536
+ sit: "application/x-stuffit",
54537
+ sitx: "application/x-stuffitx",
54538
+ sdkm: "application/vnd.solent.sdkm+xml",
54539
+ xo: "application/vnd.olpc-sugar",
54540
+ au: "audio/basic",
54541
+ wqd: "application/vnd.wqd",
54542
+ sis: "application/vnd.symbian.install",
54543
+ smi: "application/smil+xml",
54544
+ xsm: "application/vnd.syncml+xml",
54545
+ bdm: "application/vnd.syncml.dm+wbxml",
54546
+ xdm: "application/vnd.syncml.dm+xml",
54547
+ sv4cpio: "application/x-sv4cpio",
54548
+ sv4crc: "application/x-sv4crc",
54549
+ sbml: "application/sbml+xml",
54550
+ tsv: "text/tab-separated-values",
54551
+ tiff: "image/tiff",
54552
+ tao: "application/vnd.tao.intent-module-archive",
54553
+ tar: "application/x-tar",
54554
+ tcl: "application/x-tcl",
54555
+ tex: "application/x-tex",
54556
+ tfm: "application/x-tex-tfm",
54557
+ tei: "application/tei+xml",
54558
+ txt: "text/plain",
54559
+ dxp: "application/vnd.spotfire.dxp",
54560
+ sfs: "application/vnd.spotfire.sfs",
54561
+ tsd: "application/timestamped-data",
54562
+ tpt: "application/vnd.trid.tpt",
54563
+ mxs: "application/vnd.triscape.mxs",
54564
+ t: "text/troff",
54565
+ tra: "application/vnd.trueapp",
54566
+ ttf: "application/x-font-ttf",
54567
+ ttl: "text/turtle",
54568
+ umj: "application/vnd.umajin",
54569
+ uoml: "application/vnd.uoml+xml",
54570
+ unityweb: "application/vnd.unity",
54571
+ ufd: "application/vnd.ufdl",
54572
+ uri: "text/uri-list",
54573
+ utz: "application/vnd.uiq.theme",
54574
+ ustar: "application/x-ustar",
54575
+ uu: "text/x-uuencode",
54576
+ vcs: "text/x-vcalendar",
54577
+ vcf: "text/x-vcard",
54578
+ vcd: "application/x-cdlink",
54579
+ vsf: "application/vnd.vsf",
54580
+ wrl: "model/vrml",
54581
+ vcx: "application/vnd.vcx",
54582
+ mts: "model/vnd.mts",
54583
+ vtu: "model/vnd.vtu",
54584
+ vis: "application/vnd.visionary",
54585
+ viv: "video/vnd.vivo",
54586
+ ccxml: "application/ccxml+xml,",
54587
+ vxml: "application/voicexml+xml",
54588
+ src: "application/x-wais-source",
54589
+ wbxml: "application/vnd.wap.wbxml",
54590
+ wbmp: "image/vnd.wap.wbmp",
54591
+ wav: "audio/x-wav",
54592
+ davmount: "application/davmount+xml",
54593
+ woff: "application/x-font-woff",
54594
+ wspolicy: "application/wspolicy+xml",
54595
+ webp: "image/webp",
54596
+ wtb: "application/vnd.webturbo",
54597
+ wgt: "application/widget",
54598
+ hlp: "application/winhlp",
54599
+ wml: "text/vnd.wap.wml",
54600
+ wmls: "text/vnd.wap.wmlscript",
54601
+ wmlsc: "application/vnd.wap.wmlscriptc",
54602
+ wpd: "application/vnd.wordperfect",
54603
+ stf: "application/vnd.wt.stf",
54604
+ wsdl: "application/wsdl+xml",
54605
+ xbm: "image/x-xbitmap",
54606
+ xpm: "image/x-xpixmap",
54607
+ xwd: "image/x-xwindowdump",
54608
+ der: "application/x-x509-ca-cert",
54609
+ fig: "application/x-xfig",
54610
+ xhtml: "application/xhtml+xml",
54611
+ xml: "application/xml",
54612
+ xdf: "application/xcap-diff+xml",
54613
+ xenc: "application/xenc+xml",
54614
+ xer: "application/patch-ops-error+xml",
54615
+ rl: "application/resource-lists+xml",
54616
+ rs: "application/rls-services+xml",
54617
+ rld: "application/resource-lists-diff+xml",
54618
+ xslt: "application/xslt+xml",
54619
+ xop: "application/xop+xml",
54620
+ xpi: "application/x-xpinstall",
54621
+ xspf: "application/xspf+xml",
54622
+ xul: "application/vnd.mozilla.xul+xml",
54623
+ xyz: "chemical/x-xyz",
54624
+ yaml: "text/yaml",
54625
+ yang: "application/yang",
54626
+ yin: "application/yin+xml",
54627
+ zir: "application/vnd.zul",
54628
+ zip: "application/zip",
54629
+ zmm: "application/vnd.handheld-entertainment+xml",
54630
+ zaz: "application/vnd.zzazz.deck+xml"
54631
+ };
54632
+ var MIME_TYPES_TO_EXT = Object.fromEntries(Object.entries(EXT_TO_MIME_TYPES).map(function(_ref) {
54633
+ var _ref2 = _slicedToArray(_ref, 2), k = _ref2[0], v = _ref2[1];
54634
+ return [v, k];
54635
+ }));
54636
+ var MIME_TYPE_REGEX = /^data:(.*?);base64,/;
53928
54637
  function getMimeType(base64Url) {
53929
54638
  var match = MIME_TYPE_REGEX.exec(base64Url);
53930
54639
  if (match && match[1]) {
@@ -53933,16 +54642,11 @@ function getMimeType(base64Url) {
53933
54642
  return;
53934
54643
  }
53935
54644
  function mimeTypeToFileExt(mimeType) {
53936
- if (mimeType === "image/svg+xml") {
53937
- return "svg";
53938
- }
53939
- if (mimeType === "image/vnd.microsoft.icon") {
53940
- return "ico";
53941
- }
53942
- if (mimeType.startsWith("image/")) {
53943
- return mimeType.slice("image/".length);
54645
+ var recognizedMimeType = MIME_TYPES_TO_EXT[mimeType];
54646
+ if (recognizedMimeType) {
54647
+ return recognizedMimeType;
53944
54648
  }
53945
- return mimeType;
54649
+ return mimeType.split("/")[1];
53946
54650
  }
53947
54651
  var HeaderRegEx = /^h([\d+])$/;
53948
54652
  function lexicalToRichTextSource(node) {
@@ -54100,10 +54804,10 @@ function fromLexicalFormat(format) {
54100
54804
  return [];
54101
54805
  });
54102
54806
  }
54103
- var textEncoder$1 = new TextEncoder();
54807
+ var textEncoder$2 = new TextEncoder();
54104
54808
  function fromLexicalImageNode(node, files) {
54105
54809
  if (node.src.startsWith("data:")) {
54106
- var sha256 = Internal.getSHA256Hash(textEncoder$1.encode(node.src));
54810
+ var sha256 = Internal.getSHA256Hash(textEncoder$2.encode(node.src));
54107
54811
  var mimeType = getMimeType(node.src);
54108
54812
  if (mimeType === void 0) {
54109
54813
  throw new Error("Could not detect Mime Type for image: ".concat(node.src));
@@ -62590,7 +63294,7 @@ const Dropdown = ({
62590
63294
  ) });
62591
63295
  };
62592
63296
  const Dropdown$1 = Dropdown;
62593
- const textEncoder = new TextEncoder();
63297
+ const textEncoder$1 = new TextEncoder();
62594
63298
  function readImage(ev) {
62595
63299
  return new Promise((resolve, reject) => {
62596
63300
  var _a;
@@ -62601,7 +63305,7 @@ function readImage(ev) {
62601
63305
  if (typeof result2 === "string") {
62602
63306
  const image = new Image();
62603
63307
  image.addEventListener("load", () => {
62604
- const sha256 = Internal.getSHA256Hash(textEncoder.encode(result2));
63308
+ const sha256 = Internal.getSHA256Hash(textEncoder$1.encode(result2));
62605
63309
  if (image.naturalWidth && image.naturalHeight) {
62606
63310
  const mimeType = getMimeType(result2);
62607
63311
  resolve({
@@ -64204,7 +64908,7 @@ function ValMenu({
64204
64908
  api,
64205
64909
  patches,
64206
64910
  direction,
64207
- onCommit
64911
+ onClickPatches
64208
64912
  }) {
64209
64913
  const { theme: theme2, setTheme, editMode, setEditMode, session } = useValOverlayContext();
64210
64914
  if (session.status === "success" && session.data.mode === "unauthorized") {
@@ -64287,17 +64991,7 @@ function ValMenu({
64287
64991
  {
64288
64992
  onClick: () => {
64289
64993
  if (patchCount > 0) {
64290
- api.postCommit({ patches }).then((res) => {
64291
- if (result.isErr(res)) {
64292
- console.error(res.error);
64293
- alert("Could not commit patches: " + res.error.message);
64294
- } else {
64295
- console.log("Committed patches: ", res.value);
64296
- onCommit();
64297
- }
64298
- });
64299
- } else {
64300
- alert("No patches to commit");
64994
+ onClickPatches();
64301
64995
  }
64302
64996
  },
64303
64997
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative h-[24px] w-[24px] flex justify-center items-center", children: [
@@ -64314,32 +65008,24 @@ function SingleItemMenu({
64314
65008
  direction,
64315
65009
  children
64316
65010
  }) {
64317
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
64318
- "div",
64319
- {
64320
- className: classNames(
64321
- "flex items-start justify-center w-full h-full font-sans border rounded-full gap-3 text-primary border-fill bg-gradient-to-br from-background/90 from-40% to-background backdrop-blur-lg drop-shadow-2xl",
64322
- {
64323
- "flex-col items-start": direction === "vertical",
64324
- "flex-row items-center": direction === "horizontal"
64325
- }
64326
- ),
64327
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("a", { className, href, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center px-2 gap-y-2", children }) })
64328
- }
64329
- );
65011
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(MenuContainer, { direction, border: false, children: /* @__PURE__ */ jsxRuntimeExports.jsx("a", { className, href, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center px-2 gap-y-2", children }) }) });
64330
65012
  }
64331
65013
  function MenuContainer({
64332
65014
  children,
64333
- direction
65015
+ direction,
65016
+ border = true
64334
65017
  }) {
64335
65018
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
64336
65019
  "div",
64337
65020
  {
64338
65021
  className: classNames(
64339
- "flex justify-center w-full h-full px-2 py-2 font-sans border rounded-full gap-3 text-primary border-fill bg-gradient-to-br from-background/90 from-40% to-background backdrop-blur-lg drop-shadow-2xl",
65022
+ "flex justify-center w-full h-full px-2 py-2 font-sans rounded-full gap-3 text-primary border-fill bg-gradient-to-br from-background/90 from-40% to-background backdrop-blur-lg drop-shadow-2xl",
64340
65023
  {
64341
65024
  "flex-col items-start": direction === "vertical",
64342
65025
  "flex-row items-center": direction === "horizontal"
65026
+ },
65027
+ {
65028
+ border
64343
65029
  }
64344
65030
  ),
64345
65031
  children
@@ -68175,6 +68861,7 @@ function useSession(api) {
68175
68861
  setSession({ status: "success", data: Session.parse(session2) });
68176
68862
  } else {
68177
68863
  if (res.error.statusCode === 401) {
68864
+ console.error("Unauthorized", res.error);
68178
68865
  setSession({
68179
68866
  status: "success",
68180
68867
  data: {
@@ -68283,23 +68970,6 @@ const Button = reactExports.forwardRef(
68283
68970
  }
68284
68971
  );
68285
68972
  Button.displayName = "Button";
68286
- const Input = reactExports.forwardRef(
68287
- ({ className: className2, type, ...props }, ref) => {
68288
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
68289
- "input",
68290
- {
68291
- type,
68292
- className: cn(
68293
- "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
68294
- className2
68295
- ),
68296
- ref,
68297
- ...props
68298
- }
68299
- );
68300
- }
68301
- );
68302
- Input.displayName = "Input";
68303
68973
  function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
68304
68974
  const PROVIDER_NAME = name + "CollectionProvider";
68305
68975
  const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1(PROVIDER_NAME);
@@ -68375,6 +69045,608 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
68375
69045
  createCollectionScope
68376
69046
  ];
68377
69047
  }
69048
+ function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop, defaultProp, onChange = () => {
69049
+ } }) {
69050
+ const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
69051
+ defaultProp,
69052
+ onChange
69053
+ });
69054
+ const isControlled = prop !== void 0;
69055
+ const value1 = isControlled ? prop : uncontrolledProp;
69056
+ const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
69057
+ const setValue = reactExports.useCallback((nextValue) => {
69058
+ if (isControlled) {
69059
+ const setter = nextValue;
69060
+ const value = typeof nextValue === "function" ? setter(prop) : nextValue;
69061
+ if (value !== prop)
69062
+ handleChange(value);
69063
+ } else
69064
+ setUncontrolledProp(nextValue);
69065
+ }, [
69066
+ isControlled,
69067
+ prop,
69068
+ setUncontrolledProp,
69069
+ handleChange
69070
+ ]);
69071
+ return [
69072
+ value1,
69073
+ setValue
69074
+ ];
69075
+ }
69076
+ function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp, onChange }) {
69077
+ const uncontrolledState = reactExports.useState(defaultProp);
69078
+ const [value] = uncontrolledState;
69079
+ const prevValueRef = reactExports.useRef(value);
69080
+ const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
69081
+ reactExports.useEffect(() => {
69082
+ if (prevValueRef.current !== value) {
69083
+ handleChange(value);
69084
+ prevValueRef.current = value;
69085
+ }
69086
+ }, [
69087
+ value,
69088
+ prevValueRef,
69089
+ handleChange
69090
+ ]);
69091
+ return uncontrolledState;
69092
+ }
69093
+ const $1746a345f3d73bb7$var$useReactId = React$1["useId".toString()] || (() => void 0);
69094
+ let $1746a345f3d73bb7$var$count = 0;
69095
+ function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
69096
+ const [id, setId] = reactExports.useState($1746a345f3d73bb7$var$useReactId());
69097
+ $9f79659886946c16$export$e5c5a5f917a5871c(() => {
69098
+ if (!deterministicId)
69099
+ setId(
69100
+ (reactId) => reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
69101
+ );
69102
+ }, [
69103
+ deterministicId
69104
+ ]);
69105
+ return deterministicId || (id ? `radix-${id}` : "");
69106
+ }
69107
+ const $409067139f391064$var$COLLAPSIBLE_NAME = "Collapsible";
69108
+ const [$409067139f391064$var$createCollapsibleContext, $409067139f391064$export$952b32dcbe73087a] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($409067139f391064$var$COLLAPSIBLE_NAME);
69109
+ const [$409067139f391064$var$CollapsibleProvider, $409067139f391064$var$useCollapsibleContext] = $409067139f391064$var$createCollapsibleContext($409067139f391064$var$COLLAPSIBLE_NAME);
69110
+ const $409067139f391064$export$6eb0f7ddcda6131f = /* @__PURE__ */ reactExports.forwardRef((props, forwardedRef) => {
69111
+ const { __scopeCollapsible, open: openProp, defaultOpen, disabled, onOpenChange, ...collapsibleProps } = props;
69112
+ const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
69113
+ prop: openProp,
69114
+ defaultProp: defaultOpen,
69115
+ onChange: onOpenChange
69116
+ });
69117
+ return /* @__PURE__ */ reactExports.createElement($409067139f391064$var$CollapsibleProvider, {
69118
+ scope: __scopeCollapsible,
69119
+ disabled,
69120
+ contentId: $1746a345f3d73bb7$export$f680877a34711e37(),
69121
+ open,
69122
+ onOpenToggle: reactExports.useCallback(
69123
+ () => setOpen(
69124
+ (prevOpen) => !prevOpen
69125
+ ),
69126
+ [
69127
+ setOpen
69128
+ ]
69129
+ )
69130
+ }, /* @__PURE__ */ reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$6({
69131
+ "data-state": $409067139f391064$var$getState(open),
69132
+ "data-disabled": disabled ? "" : void 0
69133
+ }, collapsibleProps, {
69134
+ ref: forwardedRef
69135
+ })));
69136
+ });
69137
+ const $409067139f391064$var$TRIGGER_NAME = "CollapsibleTrigger";
69138
+ const $409067139f391064$export$c135dce7b15bbbdc = /* @__PURE__ */ reactExports.forwardRef((props, forwardedRef) => {
69139
+ const { __scopeCollapsible, ...triggerProps } = props;
69140
+ const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$TRIGGER_NAME, __scopeCollapsible);
69141
+ return /* @__PURE__ */ reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends$6({
69142
+ type: "button",
69143
+ "aria-controls": context.contentId,
69144
+ "aria-expanded": context.open || false,
69145
+ "data-state": $409067139f391064$var$getState(context.open),
69146
+ "data-disabled": context.disabled ? "" : void 0,
69147
+ disabled: context.disabled
69148
+ }, triggerProps, {
69149
+ ref: forwardedRef,
69150
+ onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, context.onOpenToggle)
69151
+ }));
69152
+ });
69153
+ const $409067139f391064$var$CONTENT_NAME = "CollapsibleContent";
69154
+ const $409067139f391064$export$aadde00976f34151 = /* @__PURE__ */ reactExports.forwardRef((props, forwardedRef) => {
69155
+ const { forceMount, ...contentProps } = props;
69156
+ const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME, props.__scopeCollapsible);
69157
+ return /* @__PURE__ */ reactExports.createElement(
69158
+ $921a889cee6df7e8$export$99c2b779aa4e8b8b,
69159
+ {
69160
+ present: forceMount || context.open
69161
+ },
69162
+ ({ present }) => /* @__PURE__ */ reactExports.createElement($409067139f391064$var$CollapsibleContentImpl, _extends$6({}, contentProps, {
69163
+ ref: forwardedRef,
69164
+ present
69165
+ }))
69166
+ );
69167
+ });
69168
+ const $409067139f391064$var$CollapsibleContentImpl = /* @__PURE__ */ reactExports.forwardRef((props, forwardedRef) => {
69169
+ const { __scopeCollapsible, present, children, ...contentProps } = props;
69170
+ const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME, __scopeCollapsible);
69171
+ const [isPresent, setIsPresent] = reactExports.useState(present);
69172
+ const ref = reactExports.useRef(null);
69173
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
69174
+ const heightRef = reactExports.useRef(0);
69175
+ const height = heightRef.current;
69176
+ const widthRef = reactExports.useRef(0);
69177
+ const width = widthRef.current;
69178
+ const isOpen = context.open || isPresent;
69179
+ const isMountAnimationPreventedRef = reactExports.useRef(isOpen);
69180
+ const originalStylesRef = reactExports.useRef();
69181
+ reactExports.useEffect(() => {
69182
+ const rAF = requestAnimationFrame(
69183
+ () => isMountAnimationPreventedRef.current = false
69184
+ );
69185
+ return () => cancelAnimationFrame(rAF);
69186
+ }, []);
69187
+ $9f79659886946c16$export$e5c5a5f917a5871c(() => {
69188
+ const node = ref.current;
69189
+ if (node) {
69190
+ originalStylesRef.current = originalStylesRef.current || {
69191
+ transitionDuration: node.style.transitionDuration,
69192
+ animationName: node.style.animationName
69193
+ };
69194
+ node.style.transitionDuration = "0s";
69195
+ node.style.animationName = "none";
69196
+ const rect = node.getBoundingClientRect();
69197
+ heightRef.current = rect.height;
69198
+ widthRef.current = rect.width;
69199
+ if (!isMountAnimationPreventedRef.current) {
69200
+ node.style.transitionDuration = originalStylesRef.current.transitionDuration;
69201
+ node.style.animationName = originalStylesRef.current.animationName;
69202
+ }
69203
+ setIsPresent(present);
69204
+ }
69205
+ }, [
69206
+ context.open,
69207
+ present
69208
+ ]);
69209
+ return /* @__PURE__ */ reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$6({
69210
+ "data-state": $409067139f391064$var$getState(context.open),
69211
+ "data-disabled": context.disabled ? "" : void 0,
69212
+ id: context.contentId,
69213
+ hidden: !isOpen
69214
+ }, contentProps, {
69215
+ ref: composedRefs,
69216
+ style: {
69217
+ [`--radix-collapsible-content-height`]: height ? `${height}px` : void 0,
69218
+ [`--radix-collapsible-content-width`]: width ? `${width}px` : void 0,
69219
+ ...props.style
69220
+ }
69221
+ }), isOpen && children);
69222
+ });
69223
+ function $409067139f391064$var$getState(open) {
69224
+ return open ? "open" : "closed";
69225
+ }
69226
+ const $409067139f391064$export$be92b6f5f03c0fe9 = $409067139f391064$export$6eb0f7ddcda6131f;
69227
+ const $409067139f391064$export$41fb9f06171c75f4 = $409067139f391064$export$c135dce7b15bbbdc;
69228
+ const $409067139f391064$export$7c6e2c02157bb7d2 = $409067139f391064$export$aadde00976f34151;
69229
+ const $1bf158f521e1b1b4$var$ACCORDION_NAME = "Accordion";
69230
+ const $1bf158f521e1b1b4$var$ACCORDION_KEYS = [
69231
+ "Home",
69232
+ "End",
69233
+ "ArrowDown",
69234
+ "ArrowUp",
69235
+ "ArrowLeft",
69236
+ "ArrowRight"
69237
+ ];
69238
+ const [$1bf158f521e1b1b4$var$Collection, $1bf158f521e1b1b4$var$useCollection, $1bf158f521e1b1b4$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($1bf158f521e1b1b4$var$ACCORDION_NAME);
69239
+ const [$1bf158f521e1b1b4$var$createAccordionContext, $1bf158f521e1b1b4$export$9748edc328a73be1] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($1bf158f521e1b1b4$var$ACCORDION_NAME, [
69240
+ $1bf158f521e1b1b4$var$createCollectionScope,
69241
+ $409067139f391064$export$952b32dcbe73087a
69242
+ ]);
69243
+ const $1bf158f521e1b1b4$var$useCollapsibleScope = $409067139f391064$export$952b32dcbe73087a();
69244
+ const $1bf158f521e1b1b4$export$a766cd26d0d69044 = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
69245
+ const { type, ...accordionProps } = props;
69246
+ const singleProps = accordionProps;
69247
+ const multipleProps = accordionProps;
69248
+ return /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$Collection.Provider, {
69249
+ scope: props.__scopeAccordion
69250
+ }, type === "multiple" ? /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionImplMultiple, _extends$6({}, multipleProps, {
69251
+ ref: forwardedRef
69252
+ })) : /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionImplSingle, _extends$6({}, singleProps, {
69253
+ ref: forwardedRef
69254
+ })));
69255
+ });
69256
+ $1bf158f521e1b1b4$export$a766cd26d0d69044.propTypes = {
69257
+ type(props) {
69258
+ const value = props.value || props.defaultValue;
69259
+ if (props.type && ![
69260
+ "single",
69261
+ "multiple"
69262
+ ].includes(props.type))
69263
+ return new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`.");
69264
+ if (props.type === "multiple" && typeof value === "string")
69265
+ return new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`.");
69266
+ if (props.type === "single" && Array.isArray(value))
69267
+ return new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`.");
69268
+ return null;
69269
+ }
69270
+ };
69271
+ const [$1bf158f521e1b1b4$var$AccordionValueProvider, $1bf158f521e1b1b4$var$useAccordionValueContext] = $1bf158f521e1b1b4$var$createAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME);
69272
+ const [$1bf158f521e1b1b4$var$AccordionCollapsibleProvider, $1bf158f521e1b1b4$var$useAccordionCollapsibleContext] = $1bf158f521e1b1b4$var$createAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME, {
69273
+ collapsible: false
69274
+ });
69275
+ const $1bf158f521e1b1b4$var$AccordionImplSingle = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
69276
+ const { value: valueProp, defaultValue, onValueChange = () => {
69277
+ }, collapsible = false, ...accordionSingleProps } = props;
69278
+ const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
69279
+ prop: valueProp,
69280
+ defaultProp: defaultValue,
69281
+ onChange: onValueChange
69282
+ });
69283
+ return /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionValueProvider, {
69284
+ scope: props.__scopeAccordion,
69285
+ value: value ? [
69286
+ value
69287
+ ] : [],
69288
+ onItemOpen: setValue,
69289
+ onItemClose: React.useCallback(
69290
+ () => collapsible && setValue(""),
69291
+ [
69292
+ collapsible,
69293
+ setValue
69294
+ ]
69295
+ )
69296
+ }, /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionCollapsibleProvider, {
69297
+ scope: props.__scopeAccordion,
69298
+ collapsible
69299
+ }, /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionImpl, _extends$6({}, accordionSingleProps, {
69300
+ ref: forwardedRef
69301
+ }))));
69302
+ });
69303
+ const $1bf158f521e1b1b4$var$AccordionImplMultiple = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
69304
+ const { value: valueProp, defaultValue, onValueChange = () => {
69305
+ }, ...accordionMultipleProps } = props;
69306
+ const [value1 = [], setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
69307
+ prop: valueProp,
69308
+ defaultProp: defaultValue,
69309
+ onChange: onValueChange
69310
+ });
69311
+ const handleItemOpen = React.useCallback(
69312
+ (itemValue) => setValue(
69313
+ (prevValue = []) => [
69314
+ ...prevValue,
69315
+ itemValue
69316
+ ]
69317
+ ),
69318
+ [
69319
+ setValue
69320
+ ]
69321
+ );
69322
+ const handleItemClose = React.useCallback(
69323
+ (itemValue) => setValue(
69324
+ (prevValue = []) => prevValue.filter(
69325
+ (value) => value !== itemValue
69326
+ )
69327
+ ),
69328
+ [
69329
+ setValue
69330
+ ]
69331
+ );
69332
+ return /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionValueProvider, {
69333
+ scope: props.__scopeAccordion,
69334
+ value: value1,
69335
+ onItemOpen: handleItemOpen,
69336
+ onItemClose: handleItemClose
69337
+ }, /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionCollapsibleProvider, {
69338
+ scope: props.__scopeAccordion,
69339
+ collapsible: true
69340
+ }, /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionImpl, _extends$6({}, accordionMultipleProps, {
69341
+ ref: forwardedRef
69342
+ }))));
69343
+ });
69344
+ const [$1bf158f521e1b1b4$var$AccordionImplProvider, $1bf158f521e1b1b4$var$useAccordionContext] = $1bf158f521e1b1b4$var$createAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME);
69345
+ const $1bf158f521e1b1b4$var$AccordionImpl = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
69346
+ const { __scopeAccordion, disabled, dir, orientation = "vertical", ...accordionProps } = props;
69347
+ const accordionRef = React.useRef(null);
69348
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(accordionRef, forwardedRef);
69349
+ const getItems = $1bf158f521e1b1b4$var$useCollection(__scopeAccordion);
69350
+ const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
69351
+ const isDirectionLTR = direction === "ltr";
69352
+ const handleKeyDown = $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event) => {
69353
+ var _triggerCollection$cl;
69354
+ if (!$1bf158f521e1b1b4$var$ACCORDION_KEYS.includes(event.key))
69355
+ return;
69356
+ const target = event.target;
69357
+ const triggerCollection = getItems().filter((item) => {
69358
+ var _item$ref$current;
69359
+ return !((_item$ref$current = item.ref.current) !== null && _item$ref$current !== void 0 && _item$ref$current.disabled);
69360
+ });
69361
+ const triggerIndex = triggerCollection.findIndex(
69362
+ (item) => item.ref.current === target
69363
+ );
69364
+ const triggerCount = triggerCollection.length;
69365
+ if (triggerIndex === -1)
69366
+ return;
69367
+ event.preventDefault();
69368
+ let nextIndex = triggerIndex;
69369
+ const homeIndex = 0;
69370
+ const endIndex = triggerCount - 1;
69371
+ const moveNext = () => {
69372
+ nextIndex = triggerIndex + 1;
69373
+ if (nextIndex > endIndex)
69374
+ nextIndex = homeIndex;
69375
+ };
69376
+ const movePrev = () => {
69377
+ nextIndex = triggerIndex - 1;
69378
+ if (nextIndex < homeIndex)
69379
+ nextIndex = endIndex;
69380
+ };
69381
+ switch (event.key) {
69382
+ case "Home":
69383
+ nextIndex = homeIndex;
69384
+ break;
69385
+ case "End":
69386
+ nextIndex = endIndex;
69387
+ break;
69388
+ case "ArrowRight":
69389
+ if (orientation === "horizontal") {
69390
+ if (isDirectionLTR)
69391
+ moveNext();
69392
+ else
69393
+ movePrev();
69394
+ }
69395
+ break;
69396
+ case "ArrowDown":
69397
+ if (orientation === "vertical")
69398
+ moveNext();
69399
+ break;
69400
+ case "ArrowLeft":
69401
+ if (orientation === "horizontal") {
69402
+ if (isDirectionLTR)
69403
+ movePrev();
69404
+ else
69405
+ moveNext();
69406
+ }
69407
+ break;
69408
+ case "ArrowUp":
69409
+ if (orientation === "vertical")
69410
+ movePrev();
69411
+ break;
69412
+ }
69413
+ const clampedIndex = nextIndex % triggerCount;
69414
+ (_triggerCollection$cl = triggerCollection[clampedIndex].ref.current) === null || _triggerCollection$cl === void 0 || _triggerCollection$cl.focus();
69415
+ });
69416
+ return /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionImplProvider, {
69417
+ scope: __scopeAccordion,
69418
+ disabled,
69419
+ direction: dir,
69420
+ orientation
69421
+ }, /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$Collection.Slot, {
69422
+ scope: __scopeAccordion
69423
+ }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$6({}, accordionProps, {
69424
+ "data-orientation": orientation,
69425
+ ref: composedRefs,
69426
+ onKeyDown: disabled ? void 0 : handleKeyDown
69427
+ }))));
69428
+ });
69429
+ const $1bf158f521e1b1b4$var$ITEM_NAME = "AccordionItem";
69430
+ const [$1bf158f521e1b1b4$var$AccordionItemProvider, $1bf158f521e1b1b4$var$useAccordionItemContext] = $1bf158f521e1b1b4$var$createAccordionContext($1bf158f521e1b1b4$var$ITEM_NAME);
69431
+ const $1bf158f521e1b1b4$export$d99097c13d4dac9f = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
69432
+ const { __scopeAccordion, value, ...accordionItemProps } = props;
69433
+ const accordionContext = $1bf158f521e1b1b4$var$useAccordionContext($1bf158f521e1b1b4$var$ITEM_NAME, __scopeAccordion);
69434
+ const valueContext = $1bf158f521e1b1b4$var$useAccordionValueContext($1bf158f521e1b1b4$var$ITEM_NAME, __scopeAccordion);
69435
+ const collapsibleScope = $1bf158f521e1b1b4$var$useCollapsibleScope(__scopeAccordion);
69436
+ const triggerId = $1746a345f3d73bb7$export$f680877a34711e37();
69437
+ const open1 = value && valueContext.value.includes(value) || false;
69438
+ const disabled = accordionContext.disabled || props.disabled;
69439
+ return /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionItemProvider, {
69440
+ scope: __scopeAccordion,
69441
+ open: open1,
69442
+ disabled,
69443
+ triggerId
69444
+ }, /* @__PURE__ */ React.createElement($409067139f391064$export$be92b6f5f03c0fe9, _extends$6({
69445
+ "data-orientation": accordionContext.orientation,
69446
+ "data-state": $1bf158f521e1b1b4$var$getState(open1)
69447
+ }, collapsibleScope, accordionItemProps, {
69448
+ ref: forwardedRef,
69449
+ disabled,
69450
+ open: open1,
69451
+ onOpenChange: (open) => {
69452
+ if (open)
69453
+ valueContext.onItemOpen(value);
69454
+ else
69455
+ valueContext.onItemClose(value);
69456
+ }
69457
+ })));
69458
+ });
69459
+ const $1bf158f521e1b1b4$var$HEADER_NAME = "AccordionHeader";
69460
+ const $1bf158f521e1b1b4$export$5e3e5deaaf81ee41 = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
69461
+ const { __scopeAccordion, ...headerProps } = props;
69462
+ const accordionContext = $1bf158f521e1b1b4$var$useAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME, __scopeAccordion);
69463
+ const itemContext = $1bf158f521e1b1b4$var$useAccordionItemContext($1bf158f521e1b1b4$var$HEADER_NAME, __scopeAccordion);
69464
+ return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.h3, _extends$6({
69465
+ "data-orientation": accordionContext.orientation,
69466
+ "data-state": $1bf158f521e1b1b4$var$getState(itemContext.open),
69467
+ "data-disabled": itemContext.disabled ? "" : void 0
69468
+ }, headerProps, {
69469
+ ref: forwardedRef
69470
+ }));
69471
+ });
69472
+ const $1bf158f521e1b1b4$var$TRIGGER_NAME = "AccordionTrigger";
69473
+ const $1bf158f521e1b1b4$export$94e939b1f85bdd73 = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
69474
+ const { __scopeAccordion, ...triggerProps } = props;
69475
+ const accordionContext = $1bf158f521e1b1b4$var$useAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME, __scopeAccordion);
69476
+ const itemContext = $1bf158f521e1b1b4$var$useAccordionItemContext($1bf158f521e1b1b4$var$TRIGGER_NAME, __scopeAccordion);
69477
+ const collapsibleContext = $1bf158f521e1b1b4$var$useAccordionCollapsibleContext($1bf158f521e1b1b4$var$TRIGGER_NAME, __scopeAccordion);
69478
+ const collapsibleScope = $1bf158f521e1b1b4$var$useCollapsibleScope(__scopeAccordion);
69479
+ return /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$Collection.ItemSlot, {
69480
+ scope: __scopeAccordion
69481
+ }, /* @__PURE__ */ React.createElement($409067139f391064$export$41fb9f06171c75f4, _extends$6({
69482
+ "aria-disabled": itemContext.open && !collapsibleContext.collapsible || void 0,
69483
+ "data-orientation": accordionContext.orientation,
69484
+ id: itemContext.triggerId
69485
+ }, collapsibleScope, triggerProps, {
69486
+ ref: forwardedRef
69487
+ })));
69488
+ });
69489
+ const $1bf158f521e1b1b4$var$CONTENT_NAME = "AccordionContent";
69490
+ const $1bf158f521e1b1b4$export$985b9a77379b54a0 = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
69491
+ const { __scopeAccordion, ...contentProps } = props;
69492
+ const accordionContext = $1bf158f521e1b1b4$var$useAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME, __scopeAccordion);
69493
+ const itemContext = $1bf158f521e1b1b4$var$useAccordionItemContext($1bf158f521e1b1b4$var$CONTENT_NAME, __scopeAccordion);
69494
+ const collapsibleScope = $1bf158f521e1b1b4$var$useCollapsibleScope(__scopeAccordion);
69495
+ return /* @__PURE__ */ React.createElement($409067139f391064$export$7c6e2c02157bb7d2, _extends$6({
69496
+ role: "region",
69497
+ "aria-labelledby": itemContext.triggerId,
69498
+ "data-orientation": accordionContext.orientation
69499
+ }, collapsibleScope, contentProps, {
69500
+ ref: forwardedRef,
69501
+ style: {
69502
+ ["--radix-accordion-content-height"]: "var(--radix-collapsible-content-height)",
69503
+ ["--radix-accordion-content-width"]: "var(--radix-collapsible-content-width)",
69504
+ ...props.style
69505
+ }
69506
+ }));
69507
+ });
69508
+ function $1bf158f521e1b1b4$var$getState(open) {
69509
+ return open ? "open" : "closed";
69510
+ }
69511
+ const $1bf158f521e1b1b4$export$be92b6f5f03c0fe9 = $1bf158f521e1b1b4$export$a766cd26d0d69044;
69512
+ const $1bf158f521e1b1b4$export$6d08773d2e66f8f2 = $1bf158f521e1b1b4$export$d99097c13d4dac9f;
69513
+ const $1bf158f521e1b1b4$export$8b251419efc915eb = $1bf158f521e1b1b4$export$5e3e5deaaf81ee41;
69514
+ const $1bf158f521e1b1b4$export$41fb9f06171c75f4 = $1bf158f521e1b1b4$export$94e939b1f85bdd73;
69515
+ const $1bf158f521e1b1b4$export$7c6e2c02157bb7d2 = $1bf158f521e1b1b4$export$985b9a77379b54a0;
69516
+ const Accordion = $1bf158f521e1b1b4$export$be92b6f5f03c0fe9;
69517
+ const AccordionItem = reactExports.forwardRef(({ className: className2, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx(
69518
+ $1bf158f521e1b1b4$export$6d08773d2e66f8f2,
69519
+ {
69520
+ ref,
69521
+ className: cn("border-b", className2),
69522
+ ...props
69523
+ }
69524
+ ));
69525
+ AccordionItem.displayName = "AccordionItem";
69526
+ const AccordionTrigger = reactExports.forwardRef(({ className: className2, children, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx($1bf158f521e1b1b4$export$8b251419efc915eb, { className: "flex", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
69527
+ $1bf158f521e1b1b4$export$41fb9f06171c75f4,
69528
+ {
69529
+ ref,
69530
+ className: cn(
69531
+ "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
69532
+ className2
69533
+ ),
69534
+ ...props,
69535
+ children: [
69536
+ children,
69537
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4 transition-transform duration-200 shrink-0" })
69538
+ ]
69539
+ }
69540
+ ) }));
69541
+ AccordionTrigger.displayName = $1bf158f521e1b1b4$export$41fb9f06171c75f4.displayName;
69542
+ const AccordionContent = reactExports.forwardRef(({ className: className2, children, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx(
69543
+ $1bf158f521e1b1b4$export$7c6e2c02157bb7d2,
69544
+ {
69545
+ ref,
69546
+ className: cn(
69547
+ "overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
69548
+ className2
69549
+ ),
69550
+ ...props,
69551
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pt-0 pb-4", children })
69552
+ }
69553
+ ));
69554
+ AccordionContent.displayName = $1bf158f521e1b1b4$export$7c6e2c02157bb7d2.displayName;
69555
+ function ValPatches({
69556
+ api,
69557
+ patches: patchIdsByModule,
69558
+ onCommit,
69559
+ onCancel
69560
+ }) {
69561
+ const [loading, setLoading] = reactExports.useState(false);
69562
+ reactExports.useEffect(() => {
69563
+ const handler = (e) => {
69564
+ if (e.key === "Escape") {
69565
+ onCancel();
69566
+ }
69567
+ };
69568
+ window.addEventListener("keydown", handler);
69569
+ return () => window.removeEventListener("keydown", handler);
69570
+ }, []);
69571
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container, { children: [
69572
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-end p-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: onCancel, children: /* @__PURE__ */ jsxRuntimeExports.jsx(X$2, {}) }) }),
69573
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center h-full p-8 gap-y-5", children: [
69574
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "block font-sans text-xl font-bold", children: "Review changes" }),
69575
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: Object.entries(patchIdsByModule).map(([moduleId, patchIds]) => /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Accordion, { type: "single", collapsible: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs($1bf158f521e1b1b4$export$d99097c13d4dac9f, { value: moduleId, children: [
69576
+ /* @__PURE__ */ jsxRuntimeExports.jsxs($1bf158f521e1b1b4$export$94e939b1f85bdd73, { className: "grid grid-cols-[1fr_min-content] gap-x-2", children: [
69577
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: moduleId }),
69578
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "flex", children: [
69579
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Diff, { size: 14 }),
69580
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: patchIds.length }),
69581
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { size: 14 }) })
69582
+ ] })
69583
+ ] }),
69584
+ /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Accordion, { type: "multiple", children: patchIds.map((patchId) => /* @__PURE__ */ jsxRuntimeExports.jsxs($1bf158f521e1b1b4$export$d99097c13d4dac9f, { value: patchId, children: [
69585
+ /* @__PURE__ */ jsxRuntimeExports.jsx($1bf158f521e1b1b4$export$94e939b1f85bdd73, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-x-5", children: [
69586
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Changed by: John Smith" }),
69587
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Changed at: 2024-01-04 13:25:00" }),
69588
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
69589
+ "img",
69590
+ {
69591
+ className: "h-[14px] w-[14px]",
69592
+ src: "https://randomuser.me/api/portraits/men/3.jpg"
69593
+ }
69594
+ ),
69595
+ /* @__PURE__ */ jsxRuntimeExports.jsx(X$2, { size: 14 }),
69596
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { size: 14 })
69597
+ ] }) }),
69598
+ /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: 'Changed to: "Foo bar"' }) })
69599
+ ] })) }) })
69600
+ ] }) }) }, moduleId)) }),
69601
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-x-4", children: [
69602
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "secondary", onClick: onCancel, children: "Cancel" }),
69603
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
69604
+ Button,
69605
+ {
69606
+ disabled: Object.keys(patchIdsByModule).length === 0 || loading,
69607
+ onClick: () => {
69608
+ setLoading(true);
69609
+ api.postCommit({ patches: patchIdsByModule }).then((res) => {
69610
+ if (result.isErr(res)) {
69611
+ console.error(res.error);
69612
+ alert("Could not commit patches: " + res.error.message);
69613
+ } else {
69614
+ console.log("Committed patches: ", res.value);
69615
+ onCommit();
69616
+ }
69617
+ }).finally(() => {
69618
+ setLoading(false);
69619
+ });
69620
+ },
69621
+ children: loading ? "Committing..." : "Commit"
69622
+ }
69623
+ )
69624
+ ] })
69625
+ ] })
69626
+ ] });
69627
+ }
69628
+ function Container({
69629
+ children
69630
+ }) {
69631
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-full w-full rounded-lg bg-gradient-to-br from-background/90 from-40% to-background backdrop-blur-lg text-primary drop-shadow-2xl", children });
69632
+ }
69633
+ const Input = reactExports.forwardRef(
69634
+ ({ className: className2, type, ...props }, ref) => {
69635
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
69636
+ "input",
69637
+ {
69638
+ type,
69639
+ className: cn(
69640
+ "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
69641
+ className2
69642
+ ),
69643
+ ref,
69644
+ ...props
69645
+ }
69646
+ );
69647
+ }
69648
+ );
69649
+ Input.displayName = "Input";
68378
69650
  function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
68379
69651
  const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
68380
69652
  reactExports.useEffect(() => {
@@ -68873,20 +70145,6 @@ function $d3863c46a17e8a28$var$removeLinks(items) {
68873
70145
  (item) => item.tagName !== "A"
68874
70146
  );
68875
70147
  }
68876
- const $1746a345f3d73bb7$var$useReactId = React$1["useId".toString()] || (() => void 0);
68877
- let $1746a345f3d73bb7$var$count = 0;
68878
- function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
68879
- const [id, setId] = reactExports.useState($1746a345f3d73bb7$var$useReactId());
68880
- $9f79659886946c16$export$e5c5a5f917a5871c(() => {
68881
- if (!deterministicId)
68882
- setId(
68883
- (reactId) => reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
68884
- );
68885
- }, [
68886
- deterministicId
68887
- ]);
68888
- return deterministicId || (id ? `radix-${id}` : "");
68889
- }
68890
70148
  const sides = ["top", "right", "bottom", "left"];
68891
70149
  const min = Math.min;
68892
70150
  const max = Math.max;
@@ -70842,51 +72100,6 @@ const $f1701beae083dbae$export$602eac185826482c = /* @__PURE__ */ reactExports.f
70842
72100
  ref: forwardedRef
70843
72101
  })), container) : null;
70844
72102
  });
70845
- function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop, defaultProp, onChange = () => {
70846
- } }) {
70847
- const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
70848
- defaultProp,
70849
- onChange
70850
- });
70851
- const isControlled = prop !== void 0;
70852
- const value1 = isControlled ? prop : uncontrolledProp;
70853
- const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
70854
- const setValue = reactExports.useCallback((nextValue) => {
70855
- if (isControlled) {
70856
- const setter = nextValue;
70857
- const value = typeof nextValue === "function" ? setter(prop) : nextValue;
70858
- if (value !== prop)
70859
- handleChange(value);
70860
- } else
70861
- setUncontrolledProp(nextValue);
70862
- }, [
70863
- isControlled,
70864
- prop,
70865
- setUncontrolledProp,
70866
- handleChange
70867
- ]);
70868
- return [
70869
- value1,
70870
- setValue
70871
- ];
70872
- }
70873
- function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp, onChange }) {
70874
- const uncontrolledState = reactExports.useState(defaultProp);
70875
- const [value] = uncontrolledState;
70876
- const prevValueRef = reactExports.useRef(value);
70877
- const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
70878
- reactExports.useEffect(() => {
70879
- if (prevValueRef.current !== value) {
70880
- handleChange(value);
70881
- prevValueRef.current = value;
70882
- }
70883
- }, [
70884
- value,
70885
- prevValueRef,
70886
- handleChange
70887
- ]);
70888
- return uncontrolledState;
70889
- }
70890
72103
  function $010c2913dbd2fe3d$export$5cae361ad82dce8b(value) {
70891
72104
  const ref = reactExports.useRef({
70892
72105
  value,
@@ -71230,7 +72443,7 @@ var RemoveScroll = reactExports.forwardRef(function(props, parentRef) {
71230
72443
  onWheelCapture: nothing,
71231
72444
  onTouchMoveCapture: nothing
71232
72445
  }), callbacks = _a[0], setCallbacks = _a[1];
71233
- var forwardProps = props.forwardProps, children = props.children, className2 = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? "div" : _b, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]);
72446
+ var forwardProps = props.forwardProps, children = props.children, className2 = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container2 = _b === void 0 ? "div" : _b, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]);
71234
72447
  var SideCar2 = sideCar;
71235
72448
  var containerRef = useMergeRefs([ref, parentRef]);
71236
72449
  var containerProps = __assign(__assign({}, rest), callbacks);
@@ -71238,7 +72451,7 @@ var RemoveScroll = reactExports.forwardRef(function(props, parentRef) {
71238
72451
  reactExports.Fragment,
71239
72452
  null,
71240
72453
  enabled && reactExports.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref }),
71241
- forwardProps ? reactExports.cloneElement(reactExports.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : reactExports.createElement(Container, __assign({}, containerProps, { className: className2, ref: containerRef }), children)
72454
+ forwardProps ? reactExports.cloneElement(reactExports.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : reactExports.createElement(Container2, __assign({}, containerProps, { className: className2, ref: containerRef }), children)
71242
72455
  );
71243
72456
  });
71244
72457
  RemoveScroll.defaultProps = {
@@ -72779,6 +73992,17 @@ function ValFormField({
72779
73992
  }
72780
73993
  );
72781
73994
  }
73995
+ if ((typeof source === "object" || source === null) && (schema == null ? void 0 : schema.type) === "file") {
73996
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
73997
+ FileField,
73998
+ {
73999
+ path,
74000
+ registerPatchCallback,
74001
+ onSubmit,
74002
+ defaultValue: source
74003
+ }
74004
+ );
74005
+ }
72782
74006
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
72783
74007
  "Unsupported schema: ",
72784
74008
  schema.type,
@@ -72790,14 +74014,14 @@ function ValFormField({
72790
74014
  ")"
72791
74015
  ] });
72792
74016
  }
72793
- function createImagePatch(path, data, filename, metadata) {
74017
+ function createFilePatch(path, data, filename, metadata) {
72794
74018
  if (!data || !metadata) {
72795
74019
  return [];
72796
74020
  }
72797
74021
  const shaSuffix = metadata.sha256.slice(0, 5);
72798
74022
  const newFilePath = function() {
72799
74023
  const mimeType = getMimeType(data) ?? "unknown";
72800
- const newExt = mimeTypeToFileExt(mimeType);
74024
+ const newExt = mimeTypeToFileExt(mimeType) ?? "unknown";
72801
74025
  if (filename) {
72802
74026
  let cleanFilename = filename.split(".").slice(0, -1).join(".") || filename;
72803
74027
  const maybeShaSuffixPos = cleanFilename.lastIndexOf("_");
@@ -72830,7 +74054,7 @@ function createImagePatch(path, data, filename, metadata) {
72830
74054
  }
72831
74055
  ];
72832
74056
  }
72833
- function createImageMetadataPatch(path, metadata) {
74057
+ function createFileMetadataPatch(path, metadata) {
72834
74058
  const metadataPath = path + "/metadata";
72835
74059
  return [
72836
74060
  {
@@ -72840,6 +74064,150 @@ function createImageMetadataPatch(path, metadata) {
72840
74064
  }
72841
74065
  ];
72842
74066
  }
74067
+ const textEncoder = new TextEncoder();
74068
+ function readFile(ev) {
74069
+ return new Promise((resolve, reject) => {
74070
+ var _a;
74071
+ const file = (_a = ev.currentTarget.files) == null ? void 0 : _a[0];
74072
+ const reader = new FileReader();
74073
+ reader.addEventListener("load", () => {
74074
+ const result2 = reader.result;
74075
+ if (typeof result2 === "string") {
74076
+ const sha256 = Internal.getSHA256Hash(textEncoder.encode(result2));
74077
+ const mimeType = getMimeType(result2);
74078
+ resolve({
74079
+ src: result2,
74080
+ filename: file == null ? void 0 : file.name,
74081
+ sha256,
74082
+ mimeType,
74083
+ fileExt: mimeType && mimeTypeToFileExt(mimeType)
74084
+ });
74085
+ } else if (!result2) {
74086
+ reject({ message: "Empty result" });
74087
+ } else {
74088
+ reject({ message: "Unexpected file result type", result: result2 });
74089
+ }
74090
+ });
74091
+ if (file) {
74092
+ reader.readAsDataURL(file);
74093
+ }
74094
+ });
74095
+ }
74096
+ function FileField({
74097
+ path,
74098
+ defaultValue,
74099
+ onSubmit,
74100
+ registerPatchCallback
74101
+ }) {
74102
+ var _a, _b;
74103
+ const [data, setData] = reactExports.useState(
74104
+ null
74105
+ );
74106
+ const [loading, setLoading] = reactExports.useState(false);
74107
+ const [metadata, setMetadata] = reactExports.useState();
74108
+ const [url, setUrl] = reactExports.useState();
74109
+ reactExports.useEffect(() => {
74110
+ const url2 = defaultValue && Internal.convertFileSource(defaultValue).url;
74111
+ setUrl(url2);
74112
+ }, [defaultValue]);
74113
+ reactExports.useEffect(() => {
74114
+ if (registerPatchCallback) {
74115
+ registerPatchCallback(async (path2) => {
74116
+ return createFilePatch(
74117
+ path2,
74118
+ (data == null ? void 0 : data.src) ?? null,
74119
+ (data == null ? void 0 : data.filename) ?? null,
74120
+ metadata
74121
+ );
74122
+ });
74123
+ }
74124
+ }, [data, defaultValue]);
74125
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldContainer, { children: [
74126
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-fit", children: [
74127
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
74128
+ "div",
74129
+ {
74130
+ className: "flex flex-col justify-start p-2 border border-b-0 rounded-sm rounded-b-none gap-y-4 bg-background text-foreground border-input",
74131
+ children: data || url ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative flex flex-col justify-center items-center min-h-[100px] min-w-[200px]", children: [
74132
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(File, {}) }),
74133
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: data == null ? void 0 : data.filename })
74134
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Select file below" })
74135
+ },
74136
+ path
74137
+ ),
74138
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4 border border-t-0 rounded-b-sm bg-background border-input", children: [
74139
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
74140
+ "label",
74141
+ {
74142
+ htmlFor: `img_input:${path}`,
74143
+ className: "block px-1 py-2 text-sm text-center rounded-md cursor-pointer bg-primary text-background",
74144
+ children: "Update"
74145
+ }
74146
+ ),
74147
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
74148
+ "input",
74149
+ {
74150
+ hidden: true,
74151
+ id: `img_input:${path}`,
74152
+ type: "file",
74153
+ onChange: (ev) => {
74154
+ readFile(ev).then((res) => {
74155
+ setData({ src: res.src, filename: res.filename });
74156
+ if (res.mimeType) {
74157
+ setMetadata({
74158
+ sha256: res.sha256,
74159
+ mimeType: res.mimeType
74160
+ });
74161
+ } else {
74162
+ setMetadata(void 0);
74163
+ }
74164
+ }).catch((err2) => {
74165
+ console.error(err2.message);
74166
+ setData(null);
74167
+ setMetadata(void 0);
74168
+ });
74169
+ }
74170
+ }
74171
+ )
74172
+ ] })
74173
+ ] }),
74174
+ onSubmit && /* @__PURE__ */ jsxRuntimeExports.jsx(
74175
+ SubmitButton,
74176
+ {
74177
+ loading,
74178
+ enabled: !!data || ((_a = defaultValue == null ? void 0 : defaultValue.metadata) == null ? void 0 : _a.mimeType) !== (metadata == null ? void 0 : metadata.mimeType) || ((_b = defaultValue == null ? void 0 : defaultValue.metadata) == null ? void 0 : _b.sha256) !== (metadata == null ? void 0 : metadata.sha256),
74179
+ onClick: () => {
74180
+ if (data) {
74181
+ setLoading(true);
74182
+ onSubmit(
74183
+ (path2) => Promise.resolve(
74184
+ createFilePatch(
74185
+ path2,
74186
+ data.src,
74187
+ data.filename ?? null,
74188
+ metadata
74189
+ )
74190
+ )
74191
+ ).finally(() => {
74192
+ setLoading(false);
74193
+ setData(null);
74194
+ setMetadata(void 0);
74195
+ });
74196
+ } else if (metadata) {
74197
+ setLoading(true);
74198
+ onSubmit(
74199
+ (path2) => Promise.resolve(createFileMetadataPatch(path2, metadata))
74200
+ ).finally(() => {
74201
+ setLoading(false);
74202
+ setData(null);
74203
+ setMetadata(void 0);
74204
+ });
74205
+ }
74206
+ }
74207
+ }
74208
+ )
74209
+ ] });
74210
+ }
72843
74211
  function ImageField({
72844
74212
  path,
72845
74213
  defaultValue,
@@ -72860,7 +74228,7 @@ function ImageField({
72860
74228
  reactExports.useEffect(() => {
72861
74229
  if (registerPatchCallback) {
72862
74230
  registerPatchCallback(async (path2) => {
72863
- return createImagePatch(
74231
+ return createFilePatch(
72864
74232
  path2,
72865
74233
  (data == null ? void 0 : data.src) ?? null,
72866
74234
  (data == null ? void 0 : data.filename) ?? null,
@@ -72986,7 +74354,7 @@ function ImageField({
72986
74354
  setLoading(true);
72987
74355
  onSubmit(
72988
74356
  (path2) => Promise.resolve(
72989
- createImagePatch(
74357
+ createFilePatch(
72990
74358
  path2,
72991
74359
  data.src,
72992
74360
  data.filename ?? null,
@@ -73001,7 +74369,7 @@ function ImageField({
73001
74369
  } else if (metadata) {
73002
74370
  setLoading(true);
73003
74371
  onSubmit(
73004
- (path2) => Promise.resolve(createImageMetadataPatch(path2, metadata))
74372
+ (path2) => Promise.resolve(createFileMetadataPatch(path2, metadata))
73005
74373
  ).finally(() => {
73006
74374
  setLoading(false);
73007
74375
  setData(null);
@@ -77213,6 +78581,7 @@ Showing stack trace of: 1. ${fatalErrors[0].message}`;
77213
78581
  },
77214
78582
  []
77215
78583
  );
78584
+ const [patchModalOpen, setPatchModalOpen] = reactExports.useState(false);
77216
78585
  const allModuleIds = Object.entries(modules || {}).flatMap(
77217
78586
  ([moduleId, valModule]) => {
77218
78587
  if ((valModule == null ? void 0 : valModule.schema) && (valModule == null ? void 0 : valModule.source)) {
@@ -77247,13 +78616,26 @@ Showing stack trace of: 1. ${fatalErrors[0].message}`;
77247
78616
  className: "relative w-full h-[100] overflow-hidden font-serif antialiased bg-background text-primary",
77248
78617
  "data-mode": theme2,
77249
78618
  children: [
78619
+ patchModalOpen && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed z-5 top-[16px] left-[16px] w-[calc(100%-32px-50px-16px)] h-[calc(100svh-32px)]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
78620
+ ValPatches,
78621
+ {
78622
+ patches,
78623
+ api,
78624
+ onCancel: () => {
78625
+ setPatchModalOpen(false);
78626
+ },
78627
+ onCommit: () => {
78628
+ setPatchResetId((patchResetId) => patchResetId + 1);
78629
+ }
78630
+ }
78631
+ ) }),
77250
78632
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed -translate-y-1/2 right-4 top-1/2 z-overlay", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
77251
78633
  ValMenu,
77252
78634
  {
77253
78635
  direction: "vertical",
77254
78636
  api,
77255
78637
  patches,
77256
- onCommit: () => setPatchResetId((prev) => prev + 1)
78638
+ onClickPatches: () => setPatchModalOpen((prev) => !prev)
77257
78639
  }
77258
78640
  ) }),
77259
78641
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: "val-fullscreen-hover", ref: hoverElemRef }),
@@ -78335,454 +79717,6 @@ function hasArrayChanged() {
78335
79717
  let b = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
78336
79718
  return a.length !== b.length || a.some((item, index2) => !Object.is(item, b[index2]));
78337
79719
  }
78338
- const $409067139f391064$var$COLLAPSIBLE_NAME = "Collapsible";
78339
- const [$409067139f391064$var$createCollapsibleContext, $409067139f391064$export$952b32dcbe73087a] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($409067139f391064$var$COLLAPSIBLE_NAME);
78340
- const [$409067139f391064$var$CollapsibleProvider, $409067139f391064$var$useCollapsibleContext] = $409067139f391064$var$createCollapsibleContext($409067139f391064$var$COLLAPSIBLE_NAME);
78341
- const $409067139f391064$export$6eb0f7ddcda6131f = /* @__PURE__ */ reactExports.forwardRef((props, forwardedRef) => {
78342
- const { __scopeCollapsible, open: openProp, defaultOpen, disabled, onOpenChange, ...collapsibleProps } = props;
78343
- const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
78344
- prop: openProp,
78345
- defaultProp: defaultOpen,
78346
- onChange: onOpenChange
78347
- });
78348
- return /* @__PURE__ */ reactExports.createElement($409067139f391064$var$CollapsibleProvider, {
78349
- scope: __scopeCollapsible,
78350
- disabled,
78351
- contentId: $1746a345f3d73bb7$export$f680877a34711e37(),
78352
- open,
78353
- onOpenToggle: reactExports.useCallback(
78354
- () => setOpen(
78355
- (prevOpen) => !prevOpen
78356
- ),
78357
- [
78358
- setOpen
78359
- ]
78360
- )
78361
- }, /* @__PURE__ */ reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$6({
78362
- "data-state": $409067139f391064$var$getState(open),
78363
- "data-disabled": disabled ? "" : void 0
78364
- }, collapsibleProps, {
78365
- ref: forwardedRef
78366
- })));
78367
- });
78368
- const $409067139f391064$var$TRIGGER_NAME = "CollapsibleTrigger";
78369
- const $409067139f391064$export$c135dce7b15bbbdc = /* @__PURE__ */ reactExports.forwardRef((props, forwardedRef) => {
78370
- const { __scopeCollapsible, ...triggerProps } = props;
78371
- const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$TRIGGER_NAME, __scopeCollapsible);
78372
- return /* @__PURE__ */ reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends$6({
78373
- type: "button",
78374
- "aria-controls": context.contentId,
78375
- "aria-expanded": context.open || false,
78376
- "data-state": $409067139f391064$var$getState(context.open),
78377
- "data-disabled": context.disabled ? "" : void 0,
78378
- disabled: context.disabled
78379
- }, triggerProps, {
78380
- ref: forwardedRef,
78381
- onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, context.onOpenToggle)
78382
- }));
78383
- });
78384
- const $409067139f391064$var$CONTENT_NAME = "CollapsibleContent";
78385
- const $409067139f391064$export$aadde00976f34151 = /* @__PURE__ */ reactExports.forwardRef((props, forwardedRef) => {
78386
- const { forceMount, ...contentProps } = props;
78387
- const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME, props.__scopeCollapsible);
78388
- return /* @__PURE__ */ reactExports.createElement(
78389
- $921a889cee6df7e8$export$99c2b779aa4e8b8b,
78390
- {
78391
- present: forceMount || context.open
78392
- },
78393
- ({ present }) => /* @__PURE__ */ reactExports.createElement($409067139f391064$var$CollapsibleContentImpl, _extends$6({}, contentProps, {
78394
- ref: forwardedRef,
78395
- present
78396
- }))
78397
- );
78398
- });
78399
- const $409067139f391064$var$CollapsibleContentImpl = /* @__PURE__ */ reactExports.forwardRef((props, forwardedRef) => {
78400
- const { __scopeCollapsible, present, children, ...contentProps } = props;
78401
- const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME, __scopeCollapsible);
78402
- const [isPresent, setIsPresent] = reactExports.useState(present);
78403
- const ref = reactExports.useRef(null);
78404
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
78405
- const heightRef = reactExports.useRef(0);
78406
- const height = heightRef.current;
78407
- const widthRef = reactExports.useRef(0);
78408
- const width = widthRef.current;
78409
- const isOpen = context.open || isPresent;
78410
- const isMountAnimationPreventedRef = reactExports.useRef(isOpen);
78411
- const originalStylesRef = reactExports.useRef();
78412
- reactExports.useEffect(() => {
78413
- const rAF = requestAnimationFrame(
78414
- () => isMountAnimationPreventedRef.current = false
78415
- );
78416
- return () => cancelAnimationFrame(rAF);
78417
- }, []);
78418
- $9f79659886946c16$export$e5c5a5f917a5871c(() => {
78419
- const node = ref.current;
78420
- if (node) {
78421
- originalStylesRef.current = originalStylesRef.current || {
78422
- transitionDuration: node.style.transitionDuration,
78423
- animationName: node.style.animationName
78424
- };
78425
- node.style.transitionDuration = "0s";
78426
- node.style.animationName = "none";
78427
- const rect = node.getBoundingClientRect();
78428
- heightRef.current = rect.height;
78429
- widthRef.current = rect.width;
78430
- if (!isMountAnimationPreventedRef.current) {
78431
- node.style.transitionDuration = originalStylesRef.current.transitionDuration;
78432
- node.style.animationName = originalStylesRef.current.animationName;
78433
- }
78434
- setIsPresent(present);
78435
- }
78436
- }, [
78437
- context.open,
78438
- present
78439
- ]);
78440
- return /* @__PURE__ */ reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$6({
78441
- "data-state": $409067139f391064$var$getState(context.open),
78442
- "data-disabled": context.disabled ? "" : void 0,
78443
- id: context.contentId,
78444
- hidden: !isOpen
78445
- }, contentProps, {
78446
- ref: composedRefs,
78447
- style: {
78448
- [`--radix-collapsible-content-height`]: height ? `${height}px` : void 0,
78449
- [`--radix-collapsible-content-width`]: width ? `${width}px` : void 0,
78450
- ...props.style
78451
- }
78452
- }), isOpen && children);
78453
- });
78454
- function $409067139f391064$var$getState(open) {
78455
- return open ? "open" : "closed";
78456
- }
78457
- const $409067139f391064$export$be92b6f5f03c0fe9 = $409067139f391064$export$6eb0f7ddcda6131f;
78458
- const $409067139f391064$export$41fb9f06171c75f4 = $409067139f391064$export$c135dce7b15bbbdc;
78459
- const $409067139f391064$export$7c6e2c02157bb7d2 = $409067139f391064$export$aadde00976f34151;
78460
- const $1bf158f521e1b1b4$var$ACCORDION_NAME = "Accordion";
78461
- const $1bf158f521e1b1b4$var$ACCORDION_KEYS = [
78462
- "Home",
78463
- "End",
78464
- "ArrowDown",
78465
- "ArrowUp",
78466
- "ArrowLeft",
78467
- "ArrowRight"
78468
- ];
78469
- const [$1bf158f521e1b1b4$var$Collection, $1bf158f521e1b1b4$var$useCollection, $1bf158f521e1b1b4$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($1bf158f521e1b1b4$var$ACCORDION_NAME);
78470
- const [$1bf158f521e1b1b4$var$createAccordionContext, $1bf158f521e1b1b4$export$9748edc328a73be1] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($1bf158f521e1b1b4$var$ACCORDION_NAME, [
78471
- $1bf158f521e1b1b4$var$createCollectionScope,
78472
- $409067139f391064$export$952b32dcbe73087a
78473
- ]);
78474
- const $1bf158f521e1b1b4$var$useCollapsibleScope = $409067139f391064$export$952b32dcbe73087a();
78475
- const $1bf158f521e1b1b4$export$a766cd26d0d69044 = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
78476
- const { type, ...accordionProps } = props;
78477
- const singleProps = accordionProps;
78478
- const multipleProps = accordionProps;
78479
- return /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$Collection.Provider, {
78480
- scope: props.__scopeAccordion
78481
- }, type === "multiple" ? /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionImplMultiple, _extends$6({}, multipleProps, {
78482
- ref: forwardedRef
78483
- })) : /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionImplSingle, _extends$6({}, singleProps, {
78484
- ref: forwardedRef
78485
- })));
78486
- });
78487
- $1bf158f521e1b1b4$export$a766cd26d0d69044.propTypes = {
78488
- type(props) {
78489
- const value = props.value || props.defaultValue;
78490
- if (props.type && ![
78491
- "single",
78492
- "multiple"
78493
- ].includes(props.type))
78494
- return new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`.");
78495
- if (props.type === "multiple" && typeof value === "string")
78496
- return new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`.");
78497
- if (props.type === "single" && Array.isArray(value))
78498
- return new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`.");
78499
- return null;
78500
- }
78501
- };
78502
- const [$1bf158f521e1b1b4$var$AccordionValueProvider, $1bf158f521e1b1b4$var$useAccordionValueContext] = $1bf158f521e1b1b4$var$createAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME);
78503
- const [$1bf158f521e1b1b4$var$AccordionCollapsibleProvider, $1bf158f521e1b1b4$var$useAccordionCollapsibleContext] = $1bf158f521e1b1b4$var$createAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME, {
78504
- collapsible: false
78505
- });
78506
- const $1bf158f521e1b1b4$var$AccordionImplSingle = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
78507
- const { value: valueProp, defaultValue, onValueChange = () => {
78508
- }, collapsible = false, ...accordionSingleProps } = props;
78509
- const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
78510
- prop: valueProp,
78511
- defaultProp: defaultValue,
78512
- onChange: onValueChange
78513
- });
78514
- return /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionValueProvider, {
78515
- scope: props.__scopeAccordion,
78516
- value: value ? [
78517
- value
78518
- ] : [],
78519
- onItemOpen: setValue,
78520
- onItemClose: React.useCallback(
78521
- () => collapsible && setValue(""),
78522
- [
78523
- collapsible,
78524
- setValue
78525
- ]
78526
- )
78527
- }, /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionCollapsibleProvider, {
78528
- scope: props.__scopeAccordion,
78529
- collapsible
78530
- }, /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionImpl, _extends$6({}, accordionSingleProps, {
78531
- ref: forwardedRef
78532
- }))));
78533
- });
78534
- const $1bf158f521e1b1b4$var$AccordionImplMultiple = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
78535
- const { value: valueProp, defaultValue, onValueChange = () => {
78536
- }, ...accordionMultipleProps } = props;
78537
- const [value1 = [], setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
78538
- prop: valueProp,
78539
- defaultProp: defaultValue,
78540
- onChange: onValueChange
78541
- });
78542
- const handleItemOpen = React.useCallback(
78543
- (itemValue) => setValue(
78544
- (prevValue = []) => [
78545
- ...prevValue,
78546
- itemValue
78547
- ]
78548
- ),
78549
- [
78550
- setValue
78551
- ]
78552
- );
78553
- const handleItemClose = React.useCallback(
78554
- (itemValue) => setValue(
78555
- (prevValue = []) => prevValue.filter(
78556
- (value) => value !== itemValue
78557
- )
78558
- ),
78559
- [
78560
- setValue
78561
- ]
78562
- );
78563
- return /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionValueProvider, {
78564
- scope: props.__scopeAccordion,
78565
- value: value1,
78566
- onItemOpen: handleItemOpen,
78567
- onItemClose: handleItemClose
78568
- }, /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionCollapsibleProvider, {
78569
- scope: props.__scopeAccordion,
78570
- collapsible: true
78571
- }, /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionImpl, _extends$6({}, accordionMultipleProps, {
78572
- ref: forwardedRef
78573
- }))));
78574
- });
78575
- const [$1bf158f521e1b1b4$var$AccordionImplProvider, $1bf158f521e1b1b4$var$useAccordionContext] = $1bf158f521e1b1b4$var$createAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME);
78576
- const $1bf158f521e1b1b4$var$AccordionImpl = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
78577
- const { __scopeAccordion, disabled, dir, orientation = "vertical", ...accordionProps } = props;
78578
- const accordionRef = React.useRef(null);
78579
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(accordionRef, forwardedRef);
78580
- const getItems = $1bf158f521e1b1b4$var$useCollection(__scopeAccordion);
78581
- const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
78582
- const isDirectionLTR = direction === "ltr";
78583
- const handleKeyDown = $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event) => {
78584
- var _triggerCollection$cl;
78585
- if (!$1bf158f521e1b1b4$var$ACCORDION_KEYS.includes(event.key))
78586
- return;
78587
- const target = event.target;
78588
- const triggerCollection = getItems().filter((item) => {
78589
- var _item$ref$current;
78590
- return !((_item$ref$current = item.ref.current) !== null && _item$ref$current !== void 0 && _item$ref$current.disabled);
78591
- });
78592
- const triggerIndex = triggerCollection.findIndex(
78593
- (item) => item.ref.current === target
78594
- );
78595
- const triggerCount = triggerCollection.length;
78596
- if (triggerIndex === -1)
78597
- return;
78598
- event.preventDefault();
78599
- let nextIndex = triggerIndex;
78600
- const homeIndex = 0;
78601
- const endIndex = triggerCount - 1;
78602
- const moveNext = () => {
78603
- nextIndex = triggerIndex + 1;
78604
- if (nextIndex > endIndex)
78605
- nextIndex = homeIndex;
78606
- };
78607
- const movePrev = () => {
78608
- nextIndex = triggerIndex - 1;
78609
- if (nextIndex < homeIndex)
78610
- nextIndex = endIndex;
78611
- };
78612
- switch (event.key) {
78613
- case "Home":
78614
- nextIndex = homeIndex;
78615
- break;
78616
- case "End":
78617
- nextIndex = endIndex;
78618
- break;
78619
- case "ArrowRight":
78620
- if (orientation === "horizontal") {
78621
- if (isDirectionLTR)
78622
- moveNext();
78623
- else
78624
- movePrev();
78625
- }
78626
- break;
78627
- case "ArrowDown":
78628
- if (orientation === "vertical")
78629
- moveNext();
78630
- break;
78631
- case "ArrowLeft":
78632
- if (orientation === "horizontal") {
78633
- if (isDirectionLTR)
78634
- movePrev();
78635
- else
78636
- moveNext();
78637
- }
78638
- break;
78639
- case "ArrowUp":
78640
- if (orientation === "vertical")
78641
- movePrev();
78642
- break;
78643
- }
78644
- const clampedIndex = nextIndex % triggerCount;
78645
- (_triggerCollection$cl = triggerCollection[clampedIndex].ref.current) === null || _triggerCollection$cl === void 0 || _triggerCollection$cl.focus();
78646
- });
78647
- return /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionImplProvider, {
78648
- scope: __scopeAccordion,
78649
- disabled,
78650
- direction: dir,
78651
- orientation
78652
- }, /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$Collection.Slot, {
78653
- scope: __scopeAccordion
78654
- }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$6({}, accordionProps, {
78655
- "data-orientation": orientation,
78656
- ref: composedRefs,
78657
- onKeyDown: disabled ? void 0 : handleKeyDown
78658
- }))));
78659
- });
78660
- const $1bf158f521e1b1b4$var$ITEM_NAME = "AccordionItem";
78661
- const [$1bf158f521e1b1b4$var$AccordionItemProvider, $1bf158f521e1b1b4$var$useAccordionItemContext] = $1bf158f521e1b1b4$var$createAccordionContext($1bf158f521e1b1b4$var$ITEM_NAME);
78662
- const $1bf158f521e1b1b4$export$d99097c13d4dac9f = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
78663
- const { __scopeAccordion, value, ...accordionItemProps } = props;
78664
- const accordionContext = $1bf158f521e1b1b4$var$useAccordionContext($1bf158f521e1b1b4$var$ITEM_NAME, __scopeAccordion);
78665
- const valueContext = $1bf158f521e1b1b4$var$useAccordionValueContext($1bf158f521e1b1b4$var$ITEM_NAME, __scopeAccordion);
78666
- const collapsibleScope = $1bf158f521e1b1b4$var$useCollapsibleScope(__scopeAccordion);
78667
- const triggerId = $1746a345f3d73bb7$export$f680877a34711e37();
78668
- const open1 = value && valueContext.value.includes(value) || false;
78669
- const disabled = accordionContext.disabled || props.disabled;
78670
- return /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionItemProvider, {
78671
- scope: __scopeAccordion,
78672
- open: open1,
78673
- disabled,
78674
- triggerId
78675
- }, /* @__PURE__ */ React.createElement($409067139f391064$export$be92b6f5f03c0fe9, _extends$6({
78676
- "data-orientation": accordionContext.orientation,
78677
- "data-state": $1bf158f521e1b1b4$var$getState(open1)
78678
- }, collapsibleScope, accordionItemProps, {
78679
- ref: forwardedRef,
78680
- disabled,
78681
- open: open1,
78682
- onOpenChange: (open) => {
78683
- if (open)
78684
- valueContext.onItemOpen(value);
78685
- else
78686
- valueContext.onItemClose(value);
78687
- }
78688
- })));
78689
- });
78690
- const $1bf158f521e1b1b4$var$HEADER_NAME = "AccordionHeader";
78691
- const $1bf158f521e1b1b4$export$5e3e5deaaf81ee41 = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
78692
- const { __scopeAccordion, ...headerProps } = props;
78693
- const accordionContext = $1bf158f521e1b1b4$var$useAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME, __scopeAccordion);
78694
- const itemContext = $1bf158f521e1b1b4$var$useAccordionItemContext($1bf158f521e1b1b4$var$HEADER_NAME, __scopeAccordion);
78695
- return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.h3, _extends$6({
78696
- "data-orientation": accordionContext.orientation,
78697
- "data-state": $1bf158f521e1b1b4$var$getState(itemContext.open),
78698
- "data-disabled": itemContext.disabled ? "" : void 0
78699
- }, headerProps, {
78700
- ref: forwardedRef
78701
- }));
78702
- });
78703
- const $1bf158f521e1b1b4$var$TRIGGER_NAME = "AccordionTrigger";
78704
- const $1bf158f521e1b1b4$export$94e939b1f85bdd73 = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
78705
- const { __scopeAccordion, ...triggerProps } = props;
78706
- const accordionContext = $1bf158f521e1b1b4$var$useAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME, __scopeAccordion);
78707
- const itemContext = $1bf158f521e1b1b4$var$useAccordionItemContext($1bf158f521e1b1b4$var$TRIGGER_NAME, __scopeAccordion);
78708
- const collapsibleContext = $1bf158f521e1b1b4$var$useAccordionCollapsibleContext($1bf158f521e1b1b4$var$TRIGGER_NAME, __scopeAccordion);
78709
- const collapsibleScope = $1bf158f521e1b1b4$var$useCollapsibleScope(__scopeAccordion);
78710
- return /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$Collection.ItemSlot, {
78711
- scope: __scopeAccordion
78712
- }, /* @__PURE__ */ React.createElement($409067139f391064$export$41fb9f06171c75f4, _extends$6({
78713
- "aria-disabled": itemContext.open && !collapsibleContext.collapsible || void 0,
78714
- "data-orientation": accordionContext.orientation,
78715
- id: itemContext.triggerId
78716
- }, collapsibleScope, triggerProps, {
78717
- ref: forwardedRef
78718
- })));
78719
- });
78720
- const $1bf158f521e1b1b4$var$CONTENT_NAME = "AccordionContent";
78721
- const $1bf158f521e1b1b4$export$985b9a77379b54a0 = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
78722
- const { __scopeAccordion, ...contentProps } = props;
78723
- const accordionContext = $1bf158f521e1b1b4$var$useAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME, __scopeAccordion);
78724
- const itemContext = $1bf158f521e1b1b4$var$useAccordionItemContext($1bf158f521e1b1b4$var$CONTENT_NAME, __scopeAccordion);
78725
- const collapsibleScope = $1bf158f521e1b1b4$var$useCollapsibleScope(__scopeAccordion);
78726
- return /* @__PURE__ */ React.createElement($409067139f391064$export$7c6e2c02157bb7d2, _extends$6({
78727
- role: "region",
78728
- "aria-labelledby": itemContext.triggerId,
78729
- "data-orientation": accordionContext.orientation
78730
- }, collapsibleScope, contentProps, {
78731
- ref: forwardedRef,
78732
- style: {
78733
- ["--radix-accordion-content-height"]: "var(--radix-collapsible-content-height)",
78734
- ["--radix-accordion-content-width"]: "var(--radix-collapsible-content-width)",
78735
- ...props.style
78736
- }
78737
- }));
78738
- });
78739
- function $1bf158f521e1b1b4$var$getState(open) {
78740
- return open ? "open" : "closed";
78741
- }
78742
- const $1bf158f521e1b1b4$export$be92b6f5f03c0fe9 = $1bf158f521e1b1b4$export$a766cd26d0d69044;
78743
- const $1bf158f521e1b1b4$export$6d08773d2e66f8f2 = $1bf158f521e1b1b4$export$d99097c13d4dac9f;
78744
- const $1bf158f521e1b1b4$export$8b251419efc915eb = $1bf158f521e1b1b4$export$5e3e5deaaf81ee41;
78745
- const $1bf158f521e1b1b4$export$41fb9f06171c75f4 = $1bf158f521e1b1b4$export$94e939b1f85bdd73;
78746
- const $1bf158f521e1b1b4$export$7c6e2c02157bb7d2 = $1bf158f521e1b1b4$export$985b9a77379b54a0;
78747
- const Accordion = $1bf158f521e1b1b4$export$be92b6f5f03c0fe9;
78748
- const AccordionItem = reactExports.forwardRef(({ className: className2, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx(
78749
- $1bf158f521e1b1b4$export$6d08773d2e66f8f2,
78750
- {
78751
- ref,
78752
- className: cn("border-b", className2),
78753
- ...props
78754
- }
78755
- ));
78756
- AccordionItem.displayName = "AccordionItem";
78757
- const AccordionTrigger = reactExports.forwardRef(({ className: className2, children, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx($1bf158f521e1b1b4$export$8b251419efc915eb, { className: "flex", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
78758
- $1bf158f521e1b1b4$export$41fb9f06171c75f4,
78759
- {
78760
- ref,
78761
- className: cn(
78762
- "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
78763
- className2
78764
- ),
78765
- ...props,
78766
- children: [
78767
- children,
78768
- /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4 transition-transform duration-200 shrink-0" })
78769
- ]
78770
- }
78771
- ) }));
78772
- AccordionTrigger.displayName = $1bf158f521e1b1b4$export$41fb9f06171c75f4.displayName;
78773
- const AccordionContent = reactExports.forwardRef(({ className: className2, children, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx(
78774
- $1bf158f521e1b1b4$export$7c6e2c02157bb7d2,
78775
- {
78776
- ref,
78777
- className: cn(
78778
- "overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
78779
- className2
78780
- ),
78781
- ...props,
78782
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pt-0 pb-4", children })
78783
- }
78784
- ));
78785
- AccordionContent.displayName = $1bf158f521e1b1b4$export$7c6e2c02157bb7d2.displayName;
78786
79720
  /**
78787
79721
  * React Router DOM v6.20.0
78788
79722
  *