@jxsuite/studio 10.5.0 → 10.6.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.
- package/data/locales/en/elements.json +434 -0
- package/data/webdata.json +116 -139
- package/dist/chunks/{2020-7sx2vexa.js → 2020-rqm7qrje.js} +3 -3
- package/dist/chunks/adapter-cyy8vbcx.js +4 -0
- package/dist/chunks/add-new-flow-8cgtejv2.js +4 -0
- package/dist/chunks/{cf-account-picker-ajh60k54.js → cf-account-picker-v3qd2dhw.js} +3 -3
- package/dist/chunks/cf-settings-1fnw874z.js +4 -0
- package/dist/chunks/{color-area-gbcftzh3.js → color-area-frd9y9q6.js} +2 -2
- package/dist/chunks/{color-field-85136598.js → color-field-rebpbe33.js} +3 -3
- package/dist/chunks/{color-slider-w1s3ndd8.js → color-slider-6bzmk3s7.js} +2 -2
- package/dist/chunks/color-t2bnnj8y.js +4 -0
- package/dist/chunks/{combobox-dk98wc5x.js → combobox-c49x7gf1.js} +2 -2
- package/dist/chunks/components-y8yhdd7d.js +4 -0
- package/dist/chunks/content-source-9e7qvmsf.js +4 -0
- package/dist/chunks/convert-to-repeater-pd2w4z21.js +4 -0
- package/dist/chunks/editor-mb9jzdrw.js +4 -0
- package/dist/chunks/entry-commands-at0wnx3f.js +4 -0
- package/dist/chunks/extension-sections-4z9qq0gh.js +4 -0
- package/dist/chunks/file-ops-dtdvjmza.js +4 -0
- package/dist/chunks/files-8pf70854.js +4 -0
- package/dist/chunks/format-host-fd3m2y2a.js +4 -0
- package/dist/chunks/fs-events-hrk29vcv.js +4 -0
- package/dist/chunks/grid-open-bh74v82z.js +4 -0
- package/dist/chunks/{grid-view-0v4hjspb.js → grid-view-a51mgzmq.js} +10 -10
- package/dist/chunks/{icons-j9eksgew.js → icons-qp8fn1k8.js} +2 -2
- package/dist/chunks/{iframe-entry-4zqtn3ry.js → iframe-entry-mpwe5pwk.js} +4 -4
- package/dist/chunks/{iframe-entry-2x9bn5ng.js → iframe-entry-msd43x9h.js} +4 -4
- package/dist/chunks/iframe-entry-rt8jz5t8.js +5 -0
- package/dist/chunks/{iframe-entry-54kwwhmg.js → iframe-entry-v40cr813.js} +2 -2
- package/dist/chunks/iframe-host-q0s0wwy3.js +4 -0
- package/dist/chunks/{image-bake-m8gzaan9.js → image-bake-q9ajdjsj.js} +3 -3
- package/dist/chunks/{image-editor-0afyws7c.js → image-editor-ke9std9b.js} +2 -2
- package/dist/chunks/index-57ang7ma.js +4 -0
- package/dist/chunks/index-eytr7av4.js +17 -0
- package/dist/chunks/{index-2q88g57p.js → index-x495reff.js} +3 -3
- package/dist/chunks/{javascript-5sxtr1g7.js → javascript-qe34bvaz.js} +3 -3
- package/dist/chunks/{jsonMode-m6sf47hq.js → jsonMode-m8rseh31.js} +8 -8
- package/dist/chunks/jx-validate-bbd1mary.js +4 -0
- package/dist/chunks/layers-panel-wcjtdqsa.js +4 -0
- package/dist/chunks/layers-yscpys6q.js +4 -0
- package/dist/chunks/{listbox-k5p41049.js → listbox-tktzq5xj.js} +2 -2
- package/dist/chunks/lit-html-qm5wbhqz.js +4 -0
- package/dist/chunks/media-library-2hfff88g.js +4 -0
- package/dist/chunks/media-open-4pb05cne.js +4 -0
- package/dist/chunks/media-picker-bzktmmwr.js +4 -0
- package/dist/chunks/{menu-26nez152.js → menu-xc3cbgsd.js} +2 -2
- package/dist/chunks/{monaco-binding-1s2b8snq.js → monaco-binding-7t38arh9.js} +3 -3
- package/dist/chunks/monaco-buffer-3vz94c9f.js +4 -0
- package/dist/chunks/monaco-setup-fstdew02.js +4 -0
- package/dist/chunks/notify-gbdcckrh.js +4 -0
- package/dist/chunks/parse-fpdzgk4c.js +4 -0
- package/dist/chunks/platform-9g72gdqr.js +4 -0
- package/dist/chunks/{popover-fhdnt4be.js → popover-cnmsav6b.js} +2 -2
- package/dist/chunks/publish-panel-91x1cb5d.js +4 -0
- package/dist/chunks/publish-quick-e2dmf7eg.js +4 -0
- package/dist/chunks/publish-workspace-1x8mnzrj.js +4 -0
- package/dist/chunks/quick-search-2m4y6p1x.js +4 -0
- package/dist/chunks/references-yg1g9rwx.js +4 -0
- package/dist/chunks/right-panel-7mfyhzrk.js +4 -0
- package/dist/chunks/source-control-rrc4jgp5.js +4 -0
- package/dist/chunks/{split-qh21j2b0.js → split-d15yencd.js} +2 -2
- package/dist/chunks/{studio-r5g7fx7q.js → studio-0jhhznxy.js} +6 -6
- package/dist/chunks/studio-0nb57pjg.js +7 -0
- package/dist/chunks/{studio-bpzwhn88.js → studio-0wa4wv4s.js} +4 -4
- package/dist/chunks/studio-0z8kp4xk.js +5 -0
- package/dist/chunks/{studio-jqvke4ac.js → studio-18gc5t3v.js} +4 -4
- package/dist/chunks/{studio-xh6rf05g.js → studio-1b79rpcb.js} +4 -4
- package/dist/chunks/studio-211q5j7m.js +4 -0
- package/dist/chunks/studio-213pyfxh.js +16 -0
- package/dist/chunks/studio-2b1smjvp.js +5 -0
- package/dist/chunks/{studio-dst8y8vh.js → studio-2v6tc9jp.js} +4 -4
- package/dist/chunks/studio-30j0wz99.js +5 -0
- package/dist/chunks/studio-3kmqhwtt.js +5 -0
- package/dist/chunks/studio-44drsmhw.js +5 -0
- package/dist/chunks/{studio-d5f7sskn.js → studio-495b6f2r.js} +4 -4
- package/dist/chunks/{studio-g65t6svn.js → studio-4gthb2fd.js} +4 -4
- package/dist/chunks/{studio-bmwgj8ez.js → studio-4xadhxj1.js} +4 -4
- package/dist/chunks/{studio-zav9hgb3.js → studio-52mzbxqm.js} +4 -4
- package/dist/chunks/{studio-thgexj3w.js → studio-56mmnsw8.js} +7 -7
- package/dist/chunks/studio-59hz8f4r.js +5 -0
- package/dist/chunks/{studio-bk0anq3b.js → studio-5k9mfafh.js} +3 -3
- package/dist/chunks/{studio-qarg1xf9.js → studio-5qez462c.js} +5 -5
- package/dist/chunks/studio-6tnpg0vx.js +5 -0
- package/dist/chunks/studio-6w8mt734.js +6 -0
- package/dist/chunks/studio-7hm04x5z.js +5 -0
- package/dist/chunks/studio-8atmfjjm.js +7 -0
- package/dist/chunks/{studio-69g6a0jn.js → studio-8n99z71s.js} +4 -4
- package/dist/chunks/{studio-ep1384t9.js → studio-8vmad6x2.js} +4 -4
- package/dist/chunks/{studio-6sxnqqw8.js → studio-93p5k4r4.js} +4 -4
- package/dist/chunks/{studio-hy936516.js → studio-9gb0m81w.js} +4 -4
- package/dist/chunks/{studio-ek4fb4eb.js → studio-a4ymg4vd.js} +4 -4
- package/dist/chunks/studio-anc8067x.js +5 -0
- package/dist/chunks/{studio-ketrgtph.js → studio-dbdt67kr.js} +5 -5
- package/dist/chunks/studio-dbex091t.js +5 -0
- package/dist/chunks/{studio-nngc45ct.js → studio-dj8ctxey.js} +4 -4
- package/dist/chunks/{studio-pgze9p34.js → studio-ed9bz68j.js} +5 -5
- package/dist/chunks/{studio-4ncxzw5m.js → studio-fe2d1fp5.js} +4 -4
- package/dist/chunks/{studio-m8hesdrw.js → studio-fgp4cyy3.js} +4 -4
- package/dist/chunks/{studio-151kgn69.js → studio-ft706q02.js} +4 -4
- package/dist/chunks/{studio-pv1ts08p.js → studio-g79s1dyg.js} +5 -5
- package/dist/chunks/{studio-zkkt13qd.js → studio-gahswxp4.js} +4 -4
- package/dist/chunks/{studio-x5ffyssw.js → studio-gbqc12bk.js} +4 -4
- package/dist/chunks/{studio-4jy967rj.js → studio-gxphbetb.js} +5 -5
- package/dist/chunks/studio-hdf01j7q.js +7 -0
- package/dist/chunks/studio-hf259xzd.js +48 -0
- package/dist/chunks/studio-jbva4wxw.js +5 -0
- package/dist/chunks/{studio-td3h1644.js → studio-jj9gf1qc.js} +4 -4
- package/dist/chunks/studio-jsjg3mjv.js +5 -0
- package/dist/chunks/studio-jtvb8hd7.js +5 -0
- package/dist/chunks/{studio-c72v1kwc.js → studio-kp4vzrct.js} +4 -4
- package/dist/chunks/{studio-s4k1v7dt.js → studio-kpx02gaa.js} +6 -6
- package/dist/chunks/{studio-3yr1zdp9.js → studio-kv1728ex.js} +8 -8
- package/dist/chunks/studio-m25ry0mf.js +5 -0
- package/dist/chunks/studio-mcbwmkyh.js +5 -0
- package/dist/chunks/studio-meajkr51.js +5 -0
- package/dist/chunks/studio-mkjrjpr2.js +6 -0
- package/dist/chunks/{studio-nv5eq0f7.js → studio-mr084886.js} +181 -181
- package/dist/chunks/{studio-43pynnhz.js → studio-mrb10hv3.js} +4 -4
- package/dist/chunks/{studio-7qqb7hb8.js → studio-nhpg405j.js} +4 -4
- package/dist/chunks/{studio-n271vdsg.js → studio-nsec0hxm.js} +41 -41
- package/dist/chunks/{studio-ztzf8mce.js → studio-nv0mh0p5.js} +4 -4
- package/dist/chunks/studio-pafmb06w.js +5 -0
- package/dist/chunks/{studio-4s5bka8t.js → studio-pgftd79b.js} +4 -4
- package/dist/chunks/{studio-wn2cmf9q.js → studio-pk961xgz.js} +4 -4
- package/dist/chunks/studio-pzbr7g05.js +5 -0
- package/dist/chunks/{studio-15mfah02.js → studio-qcc5hsw2.js} +6 -6
- package/dist/chunks/studio-qfq58c8n.js +5 -0
- package/dist/chunks/{studio-j3bq30yz.js → studio-qvb2jr83.js} +4 -4
- package/dist/chunks/studio-r85zw6ay.js +5 -0
- package/dist/chunks/{studio-f69wcajk.js → studio-s0kwce5w.js} +5 -5
- package/dist/chunks/studio-s6ymkf3q.js +14 -0
- package/dist/chunks/{studio-8ncm9zwx.js → studio-s7p5ccxa.js} +4 -4
- package/dist/chunks/{studio-zzgp5yka.js → studio-s9jjap3x.js} +4 -4
- package/dist/chunks/{studio-ber1dgte.js → studio-t5hde1ws.js} +4 -4
- package/dist/chunks/studio-vj9yv897.js +5 -0
- package/dist/chunks/{studio-ajfq4fmr.js → studio-wmak8xjw.js} +4 -4
- package/dist/chunks/{studio-k05g7efh.js → studio-wqsmvtqj.js} +4 -4
- package/dist/chunks/studio-x3z3rhej.js +5 -0
- package/dist/chunks/{studio-7qr8k0v2.js → studio-xb55kpmy.js} +4 -4
- package/dist/chunks/{studio-f3awr5nc.js → studio-xxtdajmv.js} +7 -7
- package/dist/chunks/{studio-1a7zshnv.js → studio-xxttcym1.js} +4 -4
- package/dist/chunks/{studio-czpmzs9r.js → studio-y2zsnzye.js} +7 -7
- package/dist/chunks/{studio-9f5vcb4w.js → studio-y3tjh2xb.js} +3 -3
- package/dist/chunks/studio-y4f1rdsj.js +5 -0
- package/dist/chunks/studio-ybkd5w8k.js +5 -0
- package/dist/chunks/{studio-cv6gnjqd.js → studio-yetr4gg1.js} +4 -4
- package/dist/chunks/{studio-ehj3csbm.js → studio-z295anhs.js} +5 -5
- package/dist/chunks/{studio-pte5w7rf.js → studio-z89e6wpg.js} +8 -8
- package/dist/chunks/{studio-4z0cdh16.js → studio-zbwr6prc.js} +3 -3
- package/dist/chunks/{studio-w3aafbpk.js → studio-zdbsv5q2.js} +3 -3
- package/dist/chunks/{studio-eq5vqn1q.js → studio-zvthj8hg.js} +4 -4
- package/dist/chunks/toast-2kn2vrn4.js +4 -0
- package/dist/chunks/{toast-host-g3r2s0kn.js → toast-host-3rxeyj3d.js} +3 -3
- package/dist/chunks/{tooltip-gtx40bjg.js → tooltip-ghkxkasp.js} +2 -2
- package/dist/chunks/{tree-a19s1c05.js → tree-vw4nc63s.js} +2 -2
- package/dist/chunks/{tsMode-3f116hth.js → tsMode-7gngmamr.js} +7 -7
- package/dist/chunks/workspace-gv0hxgsm.js +4 -0
- package/dist/chunks/workspace-home-j7e0mjy5.js +4 -0
- package/dist/chunks/{ws-client-cb49m87s.js → ws-client-vs11sxc5.js} +3 -3
- package/dist/iframe-entry.js +14 -14
- package/dist/manifest.json +84 -83
- package/dist/studio.js +80 -80
- package/package.json +12 -12
- package/src/browse/preview-style.ts +2 -1
- package/src/canvas/canvas-render.ts +6 -1
- package/src/canvas/iframe-drop.ts +84 -1
- package/src/canvas/iframe-entry.ts +9 -6
- package/src/canvas/iframe-render.ts +13 -0
- package/src/collab/collab-session.ts +2 -2
- package/src/commands/levels.ts +1 -1
- package/src/create/add-new-flow.ts +2 -1
- package/src/editor/convert-targets.ts +2 -23
- package/src/editor/slash-menu.ts +35 -17
- package/src/files/files.ts +18 -0
- package/src/format/format-choices.ts +5 -5
- package/src/format/format-host.ts +35 -3
- package/src/grid/redirects-grid.ts +4 -4
- package/src/locale/element-names.ts +131 -0
- package/src/panels/dnd.ts +3 -1
- package/src/panels/elements-panel.ts +93 -36
- package/src/panels/imports-panel.ts +3 -2
- package/src/panels/navigator-panels.ts +10 -10
- package/src/panels/panel-registry.ts +3 -3
- package/src/panels/site-panel.ts +2 -1
- package/src/panels/style-panel.ts +2 -1
- package/src/panels/styles-panel.ts +2 -2
- package/src/platforms/cloud.ts +5 -2
- package/src/services/ai-command-tools.ts +2 -1
- package/src/services/ai-project-tools.ts +18 -5
- package/src/services/jxn-language.ts +110 -0
- package/src/services/model-uri.ts +3 -0
- package/src/services/monaco-setup.ts +6 -2
- package/src/settings/contributed-section.ts +2 -1
- package/src/settings/extension-commands.ts +2 -1
- package/src/settings/general-settings.ts +2 -2
- package/src/settings/settings-document.ts +5 -5
- package/src/shell.ts +1 -1
- package/src/studio.ts +28 -11
- package/src/style/variables-view.ts +2 -2
- package/src/surfaces/panel-elements.json +466 -206
- package/src/surfaces/panel-elements.ts +61 -25
- package/src/tabs/project-config.ts +13 -13
- package/src/tabs/tab.ts +7 -2
- package/src/types.ts +11 -2
- package/src/view.ts +9 -2
- package/src/workspace/tab-workspace.ts +2 -2
- package/src/workspace/workspace-back.ts +2 -2
- package/dist/chunks/adapter-12dxr3z7.js +0 -4
- package/dist/chunks/add-new-flow-any4pw2q.js +0 -4
- package/dist/chunks/cf-settings-hbj16kh3.js +0 -4
- package/dist/chunks/color-thzpppyc.js +0 -4
- package/dist/chunks/components-a98hzqw9.js +0 -4
- package/dist/chunks/content-source-jq3fjs3w.js +0 -4
- package/dist/chunks/convert-to-repeater-g66r6qp1.js +0 -4
- package/dist/chunks/editor-rth1rzj8.js +0 -4
- package/dist/chunks/entry-commands-02j0s19w.js +0 -4
- package/dist/chunks/extension-sections-rqrs7dr0.js +0 -4
- package/dist/chunks/file-ops-6a49er4c.js +0 -4
- package/dist/chunks/files-b2p9y0yz.js +0 -4
- package/dist/chunks/format-host-7xe57k1s.js +0 -4
- package/dist/chunks/fs-events-0xsy168g.js +0 -4
- package/dist/chunks/grid-open-h3q4fjy5.js +0 -4
- package/dist/chunks/iframe-entry-m24fza30.js +0 -5
- package/dist/chunks/iframe-host-8jcmaktg.js +0 -4
- package/dist/chunks/index-7nj2375a.js +0 -4
- package/dist/chunks/jx-validate-808zgbgy.js +0 -4
- package/dist/chunks/layers-0ffdtqjn.js +0 -4
- package/dist/chunks/layers-panel-rw62wtvf.js +0 -4
- package/dist/chunks/lit-html-9bz9rcfv.js +0 -4
- package/dist/chunks/media-library-2a5hdbek.js +0 -4
- package/dist/chunks/media-open-069kzhj4.js +0 -4
- package/dist/chunks/media-picker-4p4pd28y.js +0 -4
- package/dist/chunks/monaco-buffer-m9fd2dka.js +0 -4
- package/dist/chunks/monaco-setup-e0crh3v6.js +0 -4
- package/dist/chunks/notify-re3js157.js +0 -4
- package/dist/chunks/parse-hee7ne9b.js +0 -4
- package/dist/chunks/platform-rywy3tkg.js +0 -4
- package/dist/chunks/publish-panel-czkpg8m4.js +0 -4
- package/dist/chunks/publish-quick-b9wbhqj6.js +0 -4
- package/dist/chunks/publish-workspace-yy6d23b7.js +0 -4
- package/dist/chunks/quick-search-tp7pjnmv.js +0 -4
- package/dist/chunks/references-wd2yj8s1.js +0 -4
- package/dist/chunks/right-panel-x971k0zc.js +0 -4
- package/dist/chunks/source-control-k4p00hpe.js +0 -4
- package/dist/chunks/studio-1d8m5s38.js +0 -16
- package/dist/chunks/studio-35pmfjtx.js +0 -5
- package/dist/chunks/studio-44xqe0b7.js +0 -4
- package/dist/chunks/studio-48yzqzqr.js +0 -5
- package/dist/chunks/studio-5rq3e4q5.js +0 -5
- package/dist/chunks/studio-6hcfm9q3.js +0 -5
- package/dist/chunks/studio-6mf31e16.js +0 -5
- package/dist/chunks/studio-8w5pa88p.js +0 -7
- package/dist/chunks/studio-9c6cbq2c.js +0 -4
- package/dist/chunks/studio-aaw7wxv8.js +0 -5
- package/dist/chunks/studio-afx9brsc.js +0 -5
- package/dist/chunks/studio-dmgh2rrj.js +0 -5
- package/dist/chunks/studio-erjccagy.js +0 -5
- package/dist/chunks/studio-ex1644g2.js +0 -5
- package/dist/chunks/studio-gw83z798.js +0 -7
- package/dist/chunks/studio-j52ks8q7.js +0 -5
- package/dist/chunks/studio-kefs4sz4.js +0 -5
- package/dist/chunks/studio-m3jrjfhy.js +0 -14
- package/dist/chunks/studio-n4pnf0sw.js +0 -5
- package/dist/chunks/studio-ncwx602y.js +0 -5
- package/dist/chunks/studio-nzp0sqjg.js +0 -5
- package/dist/chunks/studio-ph17an19.js +0 -5
- package/dist/chunks/studio-q509sqt8.js +0 -5
- package/dist/chunks/studio-s49y6m5b.js +0 -5
- package/dist/chunks/studio-t46rt6gx.js +0 -5
- package/dist/chunks/studio-veh91hjv.js +0 -5
- package/dist/chunks/studio-vswmz40d.js +0 -6
- package/dist/chunks/studio-w4mfaaam.js +0 -5
- package/dist/chunks/studio-x5py815g.js +0 -5
- package/dist/chunks/studio-z6s56dzz.js +0 -5
- package/dist/chunks/studio-ze1sm147.js +0 -7
- package/dist/chunks/studio-zn7ysyzb.js +0 -5
- package/dist/chunks/toast-w11qpkyz.js +0 -4
- package/dist/chunks/workspace-home-61n1jz3q.js +0 -4
- package/dist/chunks/workspace-sheek6zw.js +0 -4
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{Wt,bl,xy,an,xn,ia,Kn,Da,wh,Z,Jd,Xd,fi,g,h,pn,Co,ng,f1,sc,ig,rg,td,w1,h_,IR,Qd,Ft,Ry}from"./studio-s49y6m5b.js";import{w,xl}from"./studio-bk0anq3b.js";import{tu,ef}from"./studio-x5py815g.js";import{p}from"./studio-xh6rf05g.js";import{CA,fl,Rx,u,sy}from"./studio-1d8m5s38.js";import{ae}from"./studio-q509sqt8.js";import{zu,Jl}from"./studio-ep1384t9.js";import{Tn,nt,Kr,i1}from"./studio-cv6gnjqd.js";import{Vt}from"./studio-w3aafbpk.js";import{Kl,T0,Ib,LD,ST,CT,kT,ET}from"./studio-pte5w7rf.js";import{aa,Ot}from"./studio-z6s56dzz.js";import{Ep,Rm,ks,QD,Tp}from"./studio-15mfah02.js";import{ll}from"./studio-j3bq30yz.js";import{bt,Yb,ec,Vc,oh,Op,EC,ji}from"./studio-aaw7wxv8.js";import{ml,zo,Zs,Xs,Uo}from"./studio-czpmzs9r.js";import{Zl,Nm,Rp}from"./studio-ek4fb4eb.js";import{ju,iT}from"./studio-zkkt13qd.js";import{_i}from"./studio-ze1sm147.js";import{mT}from"./studio-nngc45ct.js";import{qs,sl}from"./studio-6mf31e16.js";import{Xc}from"./studio-w4mfaaam.js";import{tf,x,wn,wl}from"./studio-zn7ysyzb.js";import{hf,E,I}from"./studio-1a7zshnv.js";import{Me,v_}from"./studio-bmwgj8ez.js";import{me,te,b}from"./studio-9f5vcb4w.js";import{n,qe,m}from"./studio-erjccagy.js";import{ce}from"./studio-7qqb7hb8.js";var je={$schema:"https://jxsuite.com/schema/v1",$id:"StudioEmptyState",$description:"The one empty-state pattern (studio-ui-guidelines.md §11), as the document every region draws it from. Nine surfaces had already copied it into their own JSON — the Source Control panel's (since folded into `publish-workspace.json`), `logic-panel.json`, `panel-outline.json` and the rest each carry a `[part=\"empty\"]` block written from the same rules — because `panels/empty-state.ts` is a lit template a document cannot call. This is the copy those were waiting for: the region that has NO document of its own hands its box to this one instead of rendering the helper, so a shell with three surfaces still lit and eight converted has one empty state rather than two. The copy rules stay where they are stated, in `panels/empty-state.ts`'s header: one sentence saying what the region is FOR, the action that fills it, and one shared verb across equivalent surfaces. Nothing here decides any of them — the adapter is handed a message, an optional second sentence and a list of buttons, and this draws exactly that.",tagName:"div",attributes:{part:"empty","data-compact":"${state.compact ? '' : null}"},style:{$description:"What `.empty-state`, `.empty-state--teach`, `.empty-state-message`, `.empty-state-detail`, `.empty-state-actions`, `.empty-state-action` and the `--compact` pair said across `styles/overlays.css` and `styles/panels.css`, keyed on `part`. Neither stylesheet loses its rules: `ui/expression-editor.ts` still renders the lit helper for its own compact state, so this is a copy until that surface converts. Two values did not travel. `.empty-state`'s `font-size: 13px` was a number nothing else in the shell uses and is the kit's `--jx-text-md`; `.empty-state-detail`'s `var(--spectrum-font-size-50, 11px)` resolves only inside `<sp-theme>`, and a document mounted into a Navigator body or a canvas stage is outside it, so it would silently have taken its hard-coded fallback on every paint — it is `--jx-text-sm`, which is the step it was.",display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-6)",textAlign:"center",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",'& [part="empty-message"]':{margin:"0",maxWidth:"34ch",lineHeight:"1.5"},'& [part="empty-detail"]':{$description:"The second sentence: where the region's content comes from. Dimmer than the first, because the first is the one a reader has to take in.",margin:"0",maxWidth:"34ch",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)",opacity:"0.8"},'& [part="empty-actions"]':{display:"flex",flexWrap:"wrap",justifyContent:"center",gap:"var(--jx-space-3)"},'& [part="empty-action"]':{flex:"none"},"&[data-compact]":{$description:"An inline section inside an otherwise populated panel — tighter and left-aligned, because it sits directly above its own add form rather than filling a region on its own.",alignItems:"flex-start",gap:"var(--jx-space-2)",padding:"var(--jx-space-3) var(--jx-space-4)",textAlign:"left",fontSize:"var(--jx-text-sm)"},'&[data-compact] [part="empty-actions"]':{justifyContent:"flex-start"}},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"${state.message}"},{tagName:"div",attributes:{part:"empty-detail-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasDetail"},cases:{true:{tagName:"p",attributes:{part:"empty-detail"},textContent:"${state.detail}"}}},{tagName:"div",attributes:{part:"empty-actions-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasActions"},cases:{true:{tagName:"div",attributes:{part:"empty-actions"},children:[{$prototype:"Array",items:{$ref:"#/state/actions"},key:{$ref:"$map/item/id"},map:{tagName:"jx-button",attributes:{part:"empty-action"},$props:{size:"sm",variant:"secondary",disabled:{$ref:"$map/item/disabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runAction"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"${$map.item.label}"}]}}]}}}]};E("empty-state",je);function Tt(e){let t=document.createElement("div");t.style.display="contents";let a=[],r=b({...Ce(e),runAction:(s)=>{a[Number(s)]?.()}});a=Oe(e);let i=null,o=!1;return I("empty-state",r,t).then((s)=>{if(o){s.dispose();return}i=s}),{dispose(){o=!0,i?.dispose(),i=null,t.replaceChildren()},host:t,update(s){a=Oe(s),Object.assign(r,Ce(s))}}}function Ce(e){let t=e.actions??[];return{actions:t.map((a,r)=>({disabled:Boolean(a.disabled),id:String(r),label:a.label})),compact:Boolean(e.compact),detail:e.detail??"",hasActions:t.length>0,hasDetail:(e.detail??"")!=="",message:e.message}}function Oe(e){return(e.actions??[]).map((t)=>t.run)}var Fe=new WeakMap;function Mu(e,t){let a=Fe.get(e);if(a)return a.update(t),a.host;let r=Tt(t);return Fe.set(e,r),r.host}var kt=new Set(["entry"]);function cb(e){let t=bl(e.id);if(t)return t;let a=e.session.ui.canvasMode;if(a==="git-diff")return"publish";if(a==="media"||a==="image")return"media";if(kt.has(a))return"content";let r=Zl(e.id);if(r)return r.kind==="data"?"design":"content";if(e.documentPath===an)return"styles";return Kn(e.documentPath)?"content":"design"}var Et=new Set(["edit","design","stylebook"]);function kE(e){return e.documentPath!==null&&Zl(e.id)===null&&Et.has(e.session.ui.canvasMode)}function Ac(e,t=u.workspace){let a=g.tabs.get(e);return a!==void 0&&cb(a)===t}function ne(e,t=u.workspace){return e.tabOrder.filter((a)=>Ac(a,t))}function IN(e){let t=g.mruOrder.find((a)=>Ac(a,e));if(t)return t;for(let a of g.panes){let r=a.tabOrder.find((i)=>Ac(i,e));if(r)return r}return null}function EE(e,t){if(e.activeTabId&&Ac(e.activeTabId,t))return e.activeTabId;return g.mruOrder.find((a)=>e.tabOrder.includes(a)&&Ac(a,t))??e.tabOrder.find((a)=>Ac(a,t))??null}var Le={$schema:"https://jxsuite.com/schema/v1",$id:"StudioTabStrip",$description:"One pane's tab strip, as a Jx document over the kit: a real `tablist` of `jx-tab`s, or — for a pane that owns no document — the derivation chip naming what it is a projection of, and in both cases one trailing button. `panels/tab-strip.ts` keeps every decision: which pane a host is drawing, what each tab is called (the shortest unique suffix, and a page's ROUTE), what its tooltip says, whether closing it needs a prompt, what the overflow chevron lists and what the context menu offers. This document owns the markup, the ARIA, the keyboard and the style, and it holds THREE things the old chip drew by hand and the kit now draws: the tab's own selected state (`aria-selected`, not an `.active` class), its close button, and its dirty dot. The three that are Studio's alone go in `jx-tab`'s slots — the drill-in marker in `icon`, the hold pill in `status`, the pin toggle in `actions` (ui.md §5.4) — which is the gap that kept this strip out of the tab pattern until now. **Drag is `@atlaskit/pragmatic-drag-and-drop`, not native HTML5 DnD**: a chip carries no `draggable` attribute and no `ondrag*` handler, because `panels/tab-strip.ts` registers every chip and every strip as a pragmatic source/target through `onNodeCreated` and resolves a completed drag in `panels/tab-drop.ts`. What is left here is three SCOPE comparisons, exactly as `files-panel.json` marks a row under drag: `data-dragging` on the chip being carried, `data-drop` on the chip a drop would land beside, `data-drop-tail` on the strip when the drop is its empty tail.",tagName:"div",attributes:{part:"strip-row","data-focused":"${state.focused ? '' : null}",hidden:"${state.mode === 'empty' ? '' : null}"},onmousedown:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/focusPane"},value:[]}]},style:{$description:"`styles/shell.css`'s `.tab-strip*` rules and `styles/canvas.css`'s pane-state rules, keyed on `part` and carried in. What did NOT come with them is the point: the chip's own hover, its selected underline, its close button and its dirty dot are `jx-tab`'s, and the strip's flex row and hairline are `jx-tabs`'s. What is left here is the pane strip's own shape — the scroll container the chevron exists for, the 11px type of a chrome row, the states the PANE model adds (pinned, preview, dragging, an unfocused pane's dimmed underline), and the three slotted marks.",display:"flex",alignItems:"stretch",minWidth:"0",background:"var(--bg-panel)",borderBottom:"1px solid var(--border)",fontFamily:"var(--jx-font-sans)","&[hidden]":{display:"none"},'& [part="tabs"]':{$description:"`.tab-strip`. The kit's strip draws its own hairline; the ROW draws this one, so the strip's is taken off rather than doubled. The scrollbar is hidden by design — the wheel handler is a mouse affordance and the chevron is the pointer-independent route to the same tabs — so `overflow-x: auto` here is a scrolling box with no visible bar.",flex:"1 1 auto",minWidth:"0",gap:"0",padding:"0 var(--jx-space-2)",border:"0",overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none",fontSize:"var(--jx-text-sm)","&::-webkit-scrollbar":{display:"none"}},'& [part="tabs"][data-drop-tail]::after':{$description:"The strip's own tail target: a drop onto the empty space after the last chip, or onto a pane whose strip carries no chips at all — an empty pane made a target during a drag by `panels/tab-strip.ts`'s `project`. A fixed-width bar rather than a background tint, so it reads the same as a chip's own `data-drop` edge instead of a second visual language for the same gesture.",content:'""',flex:"0 0 2px",alignSelf:"stretch",background:"var(--accent)"},'& [part="tab"]':{$description:"`.tab-strip-tab`. The kit's tab caps itself at 220px and reserves a control's height; a chrome row is tighter than that and its labels are the shortest unique suffix, so both are re-declared. `flex-shrink: 0` is what makes the strip scroll rather than squeeze fifteen documents into one width.",gap:"var(--jx-space-1)",padding:"4px var(--jx-space-2)",minHeight:"0",maxWidth:"none",flexShrink:"0",marginBlockEnd:"0",color:"var(--fg-dim)",cursor:"pointer",":hover":{color:"var(--fg)",background:"var(--hover-bg)"},'&[aria-selected="true"]':{color:"var(--fg)",borderBlockEndColor:"var(--accent)"},"&[data-dragging]":{opacity:"0.4"},"&[data-drop]":{$description:"The chip a drop would land BESIDE. An inset shadow rather than a border, so the indicator draws no layout shift mid-drag — the same reason `files-panel.json`'s row indicators are backgrounds rather than borders.",boxShadow:"inset 2px 0 0 var(--accent)"}},'& [part="tab"] [part="label"]':{maxWidth:"140px"},'& [part="tab"][data-preview] [part="label"]':{fontStyle:"italic"},'&:not([data-focused]) [part="tab"][aria-selected="true"]':{$description:"The unfocused pane's strip still says which of ITS documents is current, in a colour that does not compete with the pane holding the keyboard.",borderBlockEndColor:"var(--border)"},'& [part="tab"] [part="close"]':{$description:"`.tab-strip-close`'s reveal, applied to the kit's own close button: a row of fifteen ✕ glyphs is noise, so the affordance appears on the tab under the pointer and on the current one. The button keeps its own 24px target either way (SC 2.5.8) — this moves no pixel of layout.",opacity:"0"},'& [part="tab"]:hover [part="close"], & [part="tab"][aria-selected="true"] [part="close"]':{opacity:"1"},'& [part="origin"]':{$description:"`.tab-strip-origin` — the drill-in marker, in `jx-tab`'s icon slot. Hidden from assistive technology by the document that writes it: a reader hears where a document was opened from in the tooltip, and an arrow announced beside a file name says nothing.",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",lineHeight:"1"},'& [part="pill"]':{$description:'`.entry-pill` — the hold pill (site-architecture.md §7.6), in `jx-tab`\'s status slot. It is ON THE CHIP and not only inside the entry editor because the mistake it prevents, publishing something you believed was private, is made while glancing at a row of tabs. "Published" is deliberately as visible as "Draft": a state you can only see one half of is a state you cannot check. The two Spectrum colours it used to name are `--jx-signal` against `--jx-bg`, which flips with the theme where a fixed yellow and a fixed black did not.',padding:"0 5px",borderRadius:"var(--radius)",background:"var(--bg)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",lineHeight:"15px",whiteSpace:"nowrap"},'& [part="pill"][data-held]':{background:"var(--jx-signal)",color:"var(--jx-bg)"},'& [part="pin"]':{$description:"`.tab-strip-pin`, in `jx-tab`'s actions slot, on the current chip and on a pinned one (the rule below). A click on it never also selects the tab, and that is the KIT's doing now rather than a `stopPropagation` this document has to remember: `jx-tab` stops a click inside its actions slot exactly as it stops one on its own close button.",display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",padding:"0",border:"none",background:"none",color:"var(--fg-dim)",font:"inherit",fontSize:"var(--jx-text-md)",lineHeight:"1",borderRadius:"var(--radius)",cursor:"pointer",":hover":{background:"var(--hover-bg)",color:"var(--fg)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-1px"}},'& [part="tab"]:not([aria-selected="true"]):not([data-pinned]) [part="pin"]':{$description:"An inactive, unpinned chip draws no pin and keeps no box for one. It was `opacity: 0` here and revealed on hover, so the invisible button still took 16px of the chip and every click on it: the centre of a short chip (the Media home's, beside its viewer tab) was the pin, so the click toggled a pin nobody could see and the tab did not activate. A box that takes clicks is a control, and a control is either shown or absent. The current chip shows its pin, a pinned chip shows its mark, and any chip pins from its context menu (`document.togglePinned`).",display:"none"},'& [part="tab"][data-pinned] [part="pin"]':{color:"var(--accent)"},'& [part="derivation"]':{$description:"A LENS pane's strip: one chip naming the projection and the document it projects, where an ordinary pane draws tab chips. It is not a tab and must not look like one — no close ✕ of its own, because a lens owns no document to close. Its vertical box is a tab chip's, `4px` top and bottom plus the 2px underline `[part=\"tab\"]` reserves, so the lens's one-chip row sits on the same baseline grid as the tab row in the pane beside it; `tab-strip.test.ts` compares the two declarations rather than the two boxes, because happy-dom lays nothing out and a 19px strip against a 28px one is the class of defect only a picture catches. Horizontally it is 10px rather than a chip's 8px: this row is one chip wide with nothing to sit beside, and a chip's tighter inset exists so several of them read as a series.",display:"flex",flex:"1 1 auto",alignItems:"baseline",gap:"6px",minWidth:"0",padding:"4px 10px",borderBottom:"2px solid transparent",whiteSpace:"nowrap",overflow:"hidden"},'& [part="preset"]':{color:"var(--fg)",fontSize:"var(--jx-text-md)"},'& [part="subject"]':{color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",textOverflow:"ellipsis",overflow:"hidden"},'& [part="overflow"]':{$description:"`.tab-strip-overflow`. It sits OUTSIDE the scrolling strip, so it stays reachable at any scroll offset — which is the whole point of it. One button draws both trailing affordances, because they are the same control in the same place: the chevron that lists the tabs currently out of view, and, on a derived pane, the ✕ that is a lens's only exit.",flex:"0 0 auto",display:"flex",alignItems:"center",justifyContent:"center",width:"22px",padding:"0",border:"none",borderLeft:"1px solid var(--border)",background:"none",color:"var(--fg-dim)",font:"inherit",fontSize:"var(--jx-text-lg)",lineHeight:"1",cursor:"pointer",":hover":{background:"var(--hover-bg)",color:"var(--fg)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="overflow"][hidden]':{display:"none"}},children:[{$description:"One row draws one pane, and a pane is either a set of open documents or a projection of somebody else's. A third answer — a pane with neither — draws nothing at all, which is the case with no branch here: the row itself is `hidden`.",tagName:"div",attributes:{part:"body"},style:{$description:"The switch container generates no box: the branch inside it IS the row's flex item, so a lens chip and a tab strip sit at the same depth and take the same `flex` the row gives them.",display:"contents"},$switch:{$ref:"#/state/mode"},cases:{tabs:{tagName:"jx-tabs",attributes:{part:"tabs",label:"${state.stripLabel}",selected:"${state.active}","data-drop-tail":"${state.dropTail ? '' : null}"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/activate"},value:[{$ref:"event#/detail"}]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closeTab"},value:[{$ref:"event#/detail"}]}]},onwheel:{$ref:"#/state/wheel"},children:[{$prototype:"Array",items:{$ref:"#/state/tabs"},key:{$ref:"$map/item/key"},map:{tagName:"jx-tab",attributes:{part:"tab","data-tab":"${$map.item.key}",value:"${$map.item.key}",label:"${$map.item.label}",title:"${$map.item.title}",closable:"",dirty:"${$map.item.dirty ? '' : null}","data-pinned":"${$map.item.pinned ? '' : null}","data-preview":"${$map.item.preview ? '' : null}","data-dragging":"${state.dragKey === $map.item.key ? '' : null}","data-drop":"${state.dropIndex === $map.item.index ? '' : null}"},ondblclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/promote"},value:[{$ref:"$map/item/key"}]}]},onauxclick:{$prototype:"Function",body:[{if:{operator:"===",target:{$ref:"event#/button"},value:1},then:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/closeTab"},value:[{$ref:"$map/item/key"}]}]}]},oncontextmenu:{$prototype:"Function",body:[{preventDefault:!0},{stopPropagation:!0},{operator:"call",target:{$ref:"#/state/context"},value:[{$ref:"$map/item/key"},{$ref:"event#/clientX"},{$ref:"event#/clientY"}]}]},children:[{$description:"The drill-in marker: this document was opened FROM another one. `jx-tab`'s icon slot draws it before the label, which is where it has always been.",tagName:"span",attributes:{slot:"icon",part:"origin","aria-hidden":"true",hidden:"${$map.item.origin ? null : ''}"},textContent:"↳"},{$description:"The hold pill. It is a `<span>` in the status slot rather than a mounted document of its own, which is what kept it a lit fragment inside `content/entry-editor.ts` until the strip converted: a document mounted per chip would be an async mount inside a synchronous rebuild. `entryHoldPill` states the two facts; this draws them.",tagName:"span",attributes:{slot:"status",part:"pill",title:"${$map.item.pillTitle}","data-held":"${$map.item.held ? '' : null}",hidden:"${$map.item.pill ? null : ''}"},textContent:"${$map.item.pill}"},{$description:"The pin, in the actions slot. `title` is the whole accessible name (studio-ui-guidelines.md §10): the glyph is hidden, so a matching `aria-label` would announce it twice. `tabindex` follows the tab's own selectedness, exactly as the close button's does — the strip is ONE stop in the tab order, and a control inside every chip that took the platform's default would make fifteen.",tagName:"button",attributes:{slot:"actions",part:"pin",type:"button",title:"${$map.item.pinTitle}",tabindex:"${$map.item.tabindex}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/togglePin"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"span",attributes:{part:"pin-glyph","aria-hidden":"true"},textContent:"${$map.item.pinGlyph}"}]}]}}]},derivation:{$description:`THE CHIP FINISHES ITS OWN SENTENCE, and both halves are the flow's: two of the presets are labelled with an unfinished phrase — "Same page at", "Same page in" — because the interesting half is the value, and a chip whose source pane shows nothing says "no document" rather than trailing off.`,tagName:"div",attributes:{part:"derivation",title:"${state.chipTitle}"},children:[{tagName:"span",attributes:{part:"preset"},textContent:"${state.preset}"},{tagName:"span",attributes:{part:"subject"},textContent:"${state.subject}"}]}}},{tagName:"button",attributes:{part:"overflow",type:"button",title:"${state.trailingTitle}",hidden:"${state.trailing ? null : ''}"},onclick:{$prototype:"Function",body:[{stopPropagation:!0},{operator:"call",target:{$ref:"#/state/openTrailing"},value:[{$ref:"event#/currentTarget"}]}]},children:[{tagName:"span",attributes:{part:"overflow-glyph","aria-hidden":"true"},textContent:"${state.trailingGlyph}"}]}]};E("tab-strip",Le);function Nt(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function Ht(e){let t=e?.$map,a=m(t)?t.item:void 0,r=m(a)?a.key:void 0;return n(r)?r:""}function Ae(e,t,a){let r=b({...t,...a,dragKey:"",dropIndex:-1,dropTail:!1});e.replaceChildren();let i=null,o=!1,s=null;return I("tab-strip",r,e,{onNodeCreated:(l,c,d,f)=>{if(o||!(l instanceof HTMLElement))return;let y=Nt(d);if(y==="tabs"){s=l,a.stripHost(l);return}if(y==="tab"){let S=Ht(f);if(S)a.chipHost(l,S)}}}).then((l)=>{if(o){l.dispose();return}i=l}),{dispose(){o=!0,i?.dispose(),i=null,s=null,e.replaceChildren()},drag(l){r.dragKey=l.dragKey,r.dropIndex=l.dropIndex,r.dropTail=l.dropTail},strip:()=>s,update(l){r.focused=l.focused,r.stripLabel=l.stripLabel,r.active=l.active,r.tabs=l.tabs,r.preset=l.preset,r.subject=l.subject,r.chipTitle=l.chipTitle,r.trailing=l.trailing,r.trailingTitle=l.trailingTitle,r.trailingGlyph=l.trailingGlyph,r.mode=l.mode}}}function De(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),a.push.apply(a,r)}return a}function Re(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?De(Object(a),!0).forEach(function(r){ml(e,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):De(Object(a)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(a,r))})}return e}var It={top:function e(t,a){return Math.abs(a.y-t.top)},right:function e(t,a){return Math.abs(t.right-a.x)},bottom:function e(t,a){return Math.abs(t.bottom-a.y)},left:function e(t,a){return Math.abs(a.x-t.left)}};function fe(e,t){var a,r,{element:i,input:o,allowedEdges:s}=t,l={x:o.clientX,y:o.clientY},c=i.getBoundingClientRect(),d=s.map(function(y){return{edge:y,value:It[y](c,l)}}),f=(a=(r=d.sort(function(y,S){return y.value-S.value})[0])===null||r===void 0?void 0:r.edge)!==null&&a!==void 0?a:null;return Re(Re({},e),{},ml({},re,f))}function he(e){var t;return(t=e[re])!==null&&t!==void 0?t:null}var re=Symbol("closestEdge");function _e(e){var{startIndex:t,closestEdgeOfTarget:a,indexOfTarget:r,axis:i}=e;if(t===-1||r===-1)return t;if(t===r)return t;if(a==null)return r;var o=i==="vertical"&&a==="bottom"||i==="horizontal"&&a==="right",s=t<r;if(s)return o?r:r-1;return o?r+1:r}function Pu(e){return m(e)&&(e.type==="tab"||e.type==="file-tree"&&e.entryType==="file")}function ge(e,t,a){if(pn(t)?.derived)iT(t);if(!Ry(e,t,a))return;td(e),Ft(e)}async function jt(e,t,a){let r=[...g.tabs.values()].find((o)=>o.documentPath===e);if(r){ge(r.id,t,a);return}await _i(e,{focus:!0,paneId:t});let i=[...g.tabs.values()].find((o)=>o.documentPath===e);if(i)ge(i.id,t,a)}function Je(e,t){if(e.tabId===void 0)return e.index;return t==="left"?e.index:e.index+1}async function Mt(e,t){let a=he(t);if(e.type==="tab"){if(e.paneId===t.paneId){let r=pn(t.paneId);if(!r)return;let i=r.tabOrder.indexOf(e.tabId);if(i===-1)return;let o=t.tabId===void 0?r.tabOrder.length-1:_e({axis:"horizontal",closestEdgeOfTarget:a,indexOfTarget:t.index,startIndex:i});if(o!==i)IR(e.tabId,o);return}ge(e.tabId,t.paneId,Je(t,a));return}await jt(e.path,t.paneId,Je(t,a))}async function Ct(e,t){if(e.type==="tab"){if(f1(e.tabId))td(e.tabId);return}let a=sc(t.paneId);if(await _i(e.path,{paneId:a.id}),![...g.tabs.values()].some((i)=>i.documentPath===e.path)&&rg(a))ig(a.id)}async function Ve(e,t){if(!t||!Pu(e.data))return;let a=e.data;if(t.data.type==="tab-slot"){await Mt(a,t.data);return}if(t.data.type==="pane-edge")await Ct(a,t.data)}var we=null,ie=null,z=new Map,_=new Map,k=new Map,L=new Map,O=new Map,J=null,j=null,N=null,U=new Map,oe=new Map,ve=null;function Lt(e){return`pane.${e}/tabs`}function At(e){return hf(Lt(e.id))??we}function NN(e){Dt(),we=e,ve=Xs({onDragStart({source:t}){if(!Pu(t.data))return;j=t.data.type==="tab"?{kind:"tab",tabId:t.data.tabId}:{kind:"file",path:t.data.path},be(),ye()},onDrag({location:t}){if(!j)return;let[a]=t.current.dropTargets,r=a?.data;N=r?.type==="tab-slot"?{index:r.tabId===void 0?-1:r.index,paneId:r.paneId,tail:r.tabId===void 0}:null,ye()},onDrop({location:t,source:a}){if(!Pu(a.data))return;let[r]=t.current.dropTargets;j=null,N=null,ye(),be(),Ve(a,r)}}),ie=me(),ie.run(()=>{te(()=>{g.activePaneId;for(let t of g.panes)t.id,t.tabOrder,t.activeTabId;u.workspace;for(let t of g.tabs.values()){t.session.ui.canvasMode,t.doc.dirty,ll(t),t.documentPath,t.pinned,t.preview,t.session.openedFrom;for(let a of QD(sl(t.documentPath)?.def))t.doc.content.frontmatter[a]}w1(),be()})})}function Dt(){Jt(),Se(),ze(),ie?.stop(),ie=null,ve?.(),ve=null;for(let e of k.keys())$e(e);for(let e of k.values())e.dispose();k.clear(),L.clear(),we=null,j=null,N=null,z.clear(),O.clear(),_.clear()}function $e(e){let t=U.get(e);if(t){for(let a of t.values())a();U.delete(e)}oe.get(e)?.(),oe.delete(e)}function be(){let e=sy(),t=new Map;for(let r of g.panes){let i=At(r);if(i&&(!t.has(i)||ng(r.id)))t.set(i,r)}let a=new Set;for(let[r,i]of t){if(e||i.derived)Rt(i,r);_.set(i.id,r),a.add(i.id)}for(let[r,i]of _){if(a.has(r))continue;if(_.delete(r),z.delete(r),O.delete(r),!t.has(i))$e(i),k.get(i)?.dispose(),k.delete(i),L.delete(i)}}function Rt(e,t){let a=We(e);L.set(t,{mode:a.mode,paneId:e.id});let r=k.get(t);if(r)r.update(a);else k.set(t,Ae(t,a,Ut(t)));if(Xt(t,a),k.get(t)?.strip()&&e.activeTabId!==z.get(e.id))z.set(e.id,e.activeTabId),le.add(t);_t(t)}var V=new Map,le=new Set;function _t(e){if(V.has(e))return;V.set(e,requestAnimationFrame(()=>{V.delete(e);let t=F(e);if(t&&sy())zt(t,e);le.delete(e)}))}function Jt(){for(let e of V.values())cancelAnimationFrame(e);V.clear(),le.clear()}function zt(e,t){let a=k.get(t)?.strip();if(a&&le.has(t))[...a.children].find((r)=>r instanceof HTMLElement&&r.dataset.tab===e.activeTabId)?.scrollIntoView({block:"nearest",inline:"nearest"});Zt(e,t)}function F(e){let t=L.get(e)?.paneId;return g.panes.find((a)=>a.id===t)??null}function Ut(e){return{activate:(t)=>{Ft(t)},chipHost:(t,a)=>{Kt(e,t,a)},closeTab:(t)=>{db(t)},context:(t,a,r)=>{let i=g.tabs.get(t);if(i)la(i,a,r)},focusPane:()=>{Co(F(e)?.id??fi)},openTrailing:(t)=>{Qt(e,t)},promote:(t)=>{td(t)},stripHost:(t)=>{Yt(e,t)},togglePin:(t)=>{let a=g.tabs.get(t);if(a)h_(t,!a.pinned)},wheel:(t,a)=>{ea(a)}}}function Bt(e,t){let a=ae(),r=bt(e.id)??bt(t.sourcePaneId),i=t.kind==="lens"&&t.preset==="breakpoint"?`${ju.breakpoint} ${t.media?ji(t.media):"Base"}`:t.kind==="companion"&&t.preset==="locale"?`${ju.locale} ${t.locale?Wt(t.locale):"—"}`:ju[t.preset],o=r?Ld(r):"no document";return{active:"",chipTitle:`${i} · ${r?.documentPath??"no document"}`,focused:ng(e.id),mode:"derivation",preset:i,stripLabel:se(e),subject:o,tabs:[],trailing:!0,trailingGlyph:"✕",trailingTitle:a?.get("pane.unsplit")?.title??"Close Side Pane"}}function se(e){return e.id===fi?"Open documents":"Open documents in the side pane"}function Gt(e){return{active:"",chipTitle:"",focused:ng(e.id),mode:"empty",preset:"",stripLabel:se(e),subject:"",tabs:[],trailing:!1,trailingGlyph:"",trailingTitle:""}}function We(e){let{derived:t}=e,a=ne(e);if(t&&a.length===0)return Bt(e,t);if(a.length===0){if(j)return{active:"",chipTitle:"",focused:ng(e.id),mode:"tabs",preset:"",stripLabel:se(e),subject:"",tabs:[],trailing:!1,trailingGlyph:"⌄",trailingTitle:"Show hidden tabs"};return z.set(e.id,null),O.set(e.id,!1),Gt(e)}let r=Ue(e);return{active:e.activeTabId??"",chipTitle:"",focused:ng(e.id),mode:"tabs",preset:"",stripLabel:se(e),subject:"",tabs:a.flatMap((i)=>qt(e,i,e.tabOrder.indexOf(i),r)),trailing:O.get(e.id)===!0,trailingGlyph:"⌄",trailingTitle:"Show hidden tabs"}}function qt(e,t,a,r){let i=g.tabs.get(t);if(!i)return[];let o=LD(i);return[{dirty:i.doc.dirty||ll(i),held:o?.held??!1,index:a,key:t,label:r.get(t)??"Untitled",origin:Boolean(i.session.openedFrom),pill:o?.text??"",pillTitle:o?.title??"",pinGlyph:i.pinned?"◉":"◎",pinTitle:i.pinned?"Unpin":"Pin",pinned:i.pinned,preview:i.preview,tabindex:t===e.activeTabId?"0":"-1",title:ca(i)}]}function Kt(e,t,a){let r=U.get(e);if(!r)r=new Map,U.set(e,r);r.get(a)?.();let i=zo(Uo({element:t,canDrag({input:o}){let s=v_(o.clientX,o.clientY);return!(s instanceof Element&&s.closest('[part="pin"], [part="close"]'))},getInitialData(){return{paneId:F(e)?.id,tabId:a,type:"tab"}}}),Zs({canDrop({source:o}){return Pu(o.data)},element:t,getData({element:o,input:s}){let l=F(e);if(!l)return{type:"tab-slot-refused"};return fe({index:l.tabOrder.indexOf(a),paneId:l.id,tabId:a,type:"tab-slot"},{allowedEdges:["left","right"],element:o,input:s})}}));r.set(a,i)}function Yt(e,t){oe.get(e)?.();let a=Zs({canDrop({source:r}){return Pu(r.data)},element:t,getData(){let r=F(e);return r?{index:r.tabOrder.length,paneId:r.id,type:"tab-slot"}:{type:"tab-slot-refused"}}});oe.set(e,a)}function Xt(e,t){if(t.mode!=="tabs"){$e(e);return}let a=new Set(t.tabs.map((i)=>i.key)),r=U.get(e);if(!r)return;for(let[i,o]of r)if(!a.has(i))o(),r.delete(i)}function ye(){let e=j?.kind==="tab"?j.tabId:"";for(let[t,a]of L){let r=k.get(t);if(!r)continue;let i=N!==null&&N.paneId===a.paneId;r.drag({dragKey:e,dropIndex:i&&N?N.index:-1,dropTail:i&&N?N.tail:!1})}}function Zt(e,t){let a=k.get(t),r=a?.strip();if(!a||!r)return;let i=r.scrollWidth>r.clientWidth;if(i!==(O.get(e.id)===!0))O.set(e.id,i),a.update(We(e))}function Qt(e,t){let a=F(e);if(!a)return;if(L.get(e)?.mode==="derivation"){nt("pane.unsplit",void 0,"Tabs");return}na(a,Ue(a),t)}function ea(e){if(e.ctrlKey)return;let t=e.currentTarget;if(!(t instanceof HTMLElement)||t.scrollWidth<=t.clientWidth)return;let a=Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY;if(!a)return;e.preventDefault(),t.scrollLeft+=a}function ta(e=g.activePaneId){let t=g.panes.find((d)=>d.id===e),a=_.get(e),r=a?k.get(a)?.strip()??null:null;if(!t||!r)return[];let i=r.scrollLeft,o=i+r.clientWidth,s=[],l=ne(t),c=[...r.querySelectorAll('[part="tab"]')];for(let[d,f]of c.entries()){let y=l[d];if(y&&(f.offsetLeft<i||f.offsetLeft+f.offsetWidth>o))s.push(y)}return s}function Se(){J?.close(),J=null}function na(e,t,a){Se();let r=ta(e.id),i=r.length>0?r:ne(e),o=Me(a??document.body);J=Vt({label:"Hidden tabs",onClosed:(s)=>{if(J===s)J=null},opener:a,place:(s)=>({x:Math.max(4,o.right-s.width),y:o.bottom}),placement:"block-end span-inline-start",region:"tab-overflow",rows:i.map((s)=>({checked:s===e.activeTabId?"true":"false",destructive:!1,disabled:!1,dividerAbove:!1,id:s,run:()=>{Ft(s)},title:t.get(s)??"Untitled"}))})}var W=null;function ze(){W?.close(),W=null}function ra(e){let t={},a=ks(sl(e.documentPath)?.def);if(a)t.hold=Kl(e)[a.field]!==!0;return t}function oa(e){let t=Object.entries(e),a=t.length===1?t[0]?.[1]:void 0;if(!qe(a))return;return a?"false":"true"}function sa(e){let t=ae();if(!t)return[];let a=ra(e),r=[],i;for(let o of t.forPlacement("context/tab")){let s=o.args;if(!(s?.required??[]).every((S)=>(S in a)))continue;let l={};for(let S of Object.keys(s?.properties??{}))if(S in a)l[S]=a[S];let c=r.length>0&&o.group!==i;({group:i}=o);let d=t.disabledReason(o.id),f=oa(l),y={destructive:o.destructive===!0,dividerAbove:c,id:o.id,title:o.title};if(f!==void 0)y.checked=f;r.push(d===void 0?{...y,disabled:!1,run:()=>{Tn(t,o.id,l,"Tabs")}}:{...y,disabled:!0,requires:d})}return r}function la(e,t,a){ze(),Se(),Ft(e.id);let r=sa(e);if(r.length===0)return;W=Vt({label:"Tab actions",onClosed:(i)=>{if(W===i)W=null},origin:{x:t,y:a},region:"tab",rows:r})}function dm(e){let t=e.replace(/^\.\//,"");if(!t.startsWith("pages/"))return null;let r=t.slice(6).replace(/\.[^./]+$/,"").split("/").filter((i)=>i!=="");if(r.at(-1)==="index")r.pop();return`/${r.join("/")}`}function da(e){let t=e.map((a)=>{let r=a.documentPath;if(!r)return{depth:0,fixed:!0,id:a.id,label:a.fallback,parts:[]};let i=dm(r);if(i!==null)return{depth:0,fixed:!0,id:a.id,label:i,parts:[]};let o=r.split("/").filter((s)=>s!==""&&s!==".");return{depth:1,fixed:!1,id:a.id,label:o.slice(-1).join("/")||r,parts:o}});for(;;){let a=new Map;for(let i of t){let o=a.get(i.label);if(o)o.push(i);else a.set(i.label,[i])}let r=!1;for(let i of a.values()){if(i.length<2)continue;for(let o of i){if(o.fixed||o.depth>=o.parts.length)continue;o.depth+=1,o.label=o.parts.slice(-o.depth).join("/"),r=!0}}if(!r)break}return new Map(t.map((a)=>[a.id,a.label]))}function Ue(e){return da(e.tabOrder.flatMap((t)=>{let a=g.tabs.get(t);return a?[{documentPath:a.documentPath,fallback:Nm(a.id)??xy(a.id)??"Untitled",id:t}]:[]}))}function ca(e){let t=e.documentPath||Nm(e.id)||xy(e.id)||"Untitled",a=e.session.openedFrom,r=a?.documentPath?`${t}
|
|
2
|
-
Opened from ${a.documentPath}`:t;return e.preview?`${r}
|
|
3
|
-
Preview — double-click to keep open`:r}function Ld(e){let t=e.documentPath;if(!t)return Nm(e.id)??"Untitled";return dm(t)??t.split("/").at(-1)??t}function Be(e){let t=ef(e),a=ll(e);if(!e.doc.dirty&&!t&&!a)return!1;let r=xn(e);if(!r.active)return!0;if(ia(e))return!0;if(t||a)return!0;return r.peers.filter((o)=>o.state.focusedPath===e.documentPath).length===0}function xe(e){if(ia(e))return`You have read access to this session, so "${Ld(e)}" has changes that were never published and have nowhere to be saved. Closing discards them.`;if(ef(e))return`"${Ld(e)}" has text in its editor that the document could not be given — the `+"source does not parse, or a collaborator holds the source lock. Saving would write the file without it, so it is not offered. Closing discards that text.";return null}async function pa(e){let t=xe(e);if(t)return Kr("Changes Cannot Be Saved",t,{cancelLabel:"Keep Editing",confirmLabel:"Close Without Saving",destructive:!0});let a=await i1("Unsaved Changes",`"${Ld(e)}" has unsaved changes.`,{discardLabel:"Close Without Saving"});if(a==="cancel")return!1;return a==="discard"||await Rp(e)}async function db(e){let t=g.tabs.get(e);if(!t)return;if(await tu(t),!g.tabs.has(e))return;if(Be(t)&&!await pa(t))return;Qd(e)}async function TE(e){let t=[...g.tabs.values()];for(let c of t)await tu(c);let a=[...g.tabs.values()].filter((c)=>Be(c));if(a.length===0)return!0;let r=a.length===1?`"${Ld(a[0])}" has unsaved changes`:`${a.length} documents have unsaved changes`,i=a.filter((c)=>xe(c)!==null),o=a.filter((c)=>xe(c)===null),s=i.length===1?`"${Ld(i[0])}"`:`${i.length} of them`;if(o.length===0)return Kr("Changes Cannot Be Saved",`${e} closes every open document, and ${r}. ${s} cannot be saved at all, so saving would leave work behind. Closing discards it.`,{cancelLabel:"Keep Editing",confirmLabel:"Close Without Saving",destructive:!0});let l=await i1("Unsaved Changes",i.length===0?`${e} closes every open document, and ${r}.`:`${e} closes every open document, and ${r}. ${s} cannot be saved at `+`all — saving writes the other ${o.length} and discards ${i.length===1?"that one":"those"}.`,{discardLabel:"Close Without Saving",saveLabel:i.length===0?"Save All":`Save ${o.length} of ${a.length}`});if(l==="cancel")return!1;if(l==="discard")return!0;for(let c of o)if(!await Rp(c))return!1;return!0}function Ge(e,t){if(!n(t)||t.trim()==="")return[...e];return[{attributes:{content:t,name:"description"},tagName:"meta"},...e]}function Ke(e,t,a){let r=e.doc.content.frontmatter,i=wh(e.documentPath,t),o=i?.schema,s=o?.properties,l=new Set(o?.required||[]),c=[];if(s){for(let[d,f]of Object.entries(s)){if(a.has(d))continue;c.push({entry:f,field:d,value:r[d]})}for(let[d,f]of Object.entries(r)){if(s[d]||d.startsWith("$")||a.has(d))continue;c.push({entry:{type:qe(f)?"boolean":"string"},field:d,value:f})}}else for(let[d,f]of Object.entries(r)){if(d.startsWith("$")||a.has(d))continue;c.push({entry:{type:qe(f)?"boolean":"string"},field:d,value:f})}return{collection:i,fields:c,hasSchema:Boolean(s),requiredFields:l}}function B(e){return n(e)?e:""}function ua(e){return{checked:!1,hasNote:!1,hasThumb:!1,isSet:!1,kind:"text",label:e,note:"",options:[],placeholder:"",thumb:"",value:""}}function Ye(e,t,a,r,i){let o=e.replaceAll(/([A-Z])/g," $1").replace(/^./,(d)=>d.toUpperCase()),s=ua(o+(r.has(e)?" *":""));s.isSet=a!==void 0&&a!==""&&a!==!1;let l=(d)=>String(d)||void 0,c=zu(t);if(c!==null){let d=B(a),f=mT(c,i.rerender);if(s.kind="select",s.value=d,f===null)return s.options=[{label:"Loading…",value:d}],{parse:l,row:s};if("error"in f)return s.kind="text",s.hasNote=!0,s.note=`Could not list ${c} entries — ${f.error}`,{parse:l,row:s};let y=d!==""&&!f.ids.includes(d);if(s.options=[{label:"—",value:""},...y?[{label:`${d} — not found`,value:d}]:[],...f.ids.map((S)=>({label:S,value:S}))],f.ids.length===0)s.hasNote=!0,s.note=`No ${c} entries yet.`;return{parse:l,row:s}}if(t.type==="boolean")return s.kind="boolean",s.checked=Boolean(a),{parse:(d)=>d===!0?!0:void 0,row:s};if(t.type==="array")return s.value=Array.isArray(a)?a.join(", "):B(a),s.placeholder="comma, separated",{parse:(d)=>{let f=String(d);return f?f.split(",").map((y)=>y.trim()).filter(Boolean):void 0},row:s};if(Array.isArray(t.enum))return s.kind="select",s.value=B(a),s.options=[{label:"—",value:""},...t.enum.map((d)=>({label:d,value:d}))],{parse:l,row:s};if(Da(t.format)){let d=B(a);return s.kind="media",s.value=d,s.hasThumb=d!==""&&aa.has(Ot(d)),s.thumb=s.hasThumb?Xc(d):"",{parse:l,row:s}}if(t.type==="number")return s.kind="number",s.value=a===void 0?"":String(a),{parse:(d)=>{let f=String(d).trim(),y=Number(f);return f===""||Number.isNaN(y)?void 0:y},row:s};return s.value=B(a),s.placeholder=t.format==="date"?"YYYY-MM-DD":"",{parse:l,row:s}}var Xe="https://fonts.googleapis.com/css2?",Ze=["https://fonts.googleapis.com","https://fonts.gstatic.com"];function sw(e){return e?.tagName==="link"&&e.attributes?.rel==="stylesheet"&&n(e.attributes.href)&&e.attributes.href.startsWith(Xe)}function Te(e){return e?.tagName==="link"&&e.attributes?.rel==="preconnect"&&n(e.attributes.href)&&Ze.includes(e.attributes.href)}function TN(e){let t=e.match(/family=([^&:]+)/);if(!t)return"";return decodeURIComponent(t[1].replaceAll("+"," "))}function $N(e){return`${Xe}family=${encodeURIComponent(e).replaceAll("%20","+")}&display=swap`}function LN(e){for(let t of Ze)if(!e.some((r)=>r?.tagName==="link"&&r.attributes?.rel==="preconnect"&&r.attributes.href===t)){let r={href:t,rel:"preconnect"};if(t==="https://fonts.gstatic.com")r.crossorigin="";e.push({attributes:r,tagName:"link"})}}function RN(e){if(!e.some((a)=>sw(a)))return e.filter((a)=>!Te(a));return e}var Qe={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPanelPage",$description:"The Inspector's Page tab (specs/studio.md §6), the former Navigator Page panel: everything the open document says about itself before anybody reads its body — its frontmatter, the layout it is poured into, its title, description, viewport and icon, its OpenGraph card, and the raw `$head` tags no structured control owns. ONE row vocabulary across the first four sections, told apart by `kind`, because a Title, a Layout picker and a schema-driven frontmatter field differ in what they COMMIT rather than in what they look like — and what they commit is `panels/head-panel.ts`'s decision, reached by the row's `key`. Nothing here knows what a `$head` entry is, which of them are managed, what a content collection is or that a page has a layout: the flow hands over sections whose every field is already a string and this draws them. The Custom Tags section is the one different shape — a read-only list plus the form that adds to it — because those rows are markup a reader is being SHOWN rather than a value they are editing.",tagName:"div",attributes:{part:"page"},style:{$description:"The eleven `.imports-*` and four `.head-*` rules in `styles/panels.css` plus the row vocabulary the panel used to borrow from `styles/inspector.css` (`.style-row`, `.style-row-label`, `.set-dot`) and `styles/overlays.css` (`.media-picker`, `.media-picker-thumb`). The borrowed ones are TRANSCRIBED rather than shared, because a document emits no class, so a class cannot style it, and the lit panels that still draw a `.style-row` go on owning those rules until they convert. Four token repairs travel with them. `--spectrum-font-size-50` resolved only inside `<sp-theme>` and a document is mounted outside it, so every rule that read it would silently have taken its 11px fallback and stopped following the theme; each is `--jx-text-sm` here, and the two bare `10px` literals are `--jx-text-xs`. `.imports-count` read `--text-hint`, a name NO stylesheet in this package defines — an unresolvable custom property makes the whole declaration invalid at computed-value time, so the count has been inheriting its colour rather than taking the one written for it, and it says `--fg-dim`, which is what it was drawing anyway. And `.head-section-body .style-row > sp-textfield` reached INSIDE another component to widen it, which a part cannot do and no longer has to: `[part=\"widget\"]` is the field itself. Two things changed on purpose. THE CLEAR DOT IS A BUTTON — it was a `<span>` with a click handler and no role, so a row's only route to clearing its value could not be reached from the keyboard at all. AND THE ADD FORM IS STATE, not three `ref()` handles read at submit time: a document binding writes only when the scope moves, so the flow states what each field holds and clearing one after a successful add is a real change the runtime carries back.",display:"block",overflowY:"auto",padding:"var(--jx-space-2)",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="section"]':{marginBottom:"var(--jx-space-4)"},'& [part="section-header"]':{$description:'The uppercase band every section opens with. It is the only thing that ever styled a section title, which is why `[part="title"]` carries no declaration of its own: the weight, the size, the colour and the letter-spacing are all inherited from here.',display:"flex",alignItems:"center",gap:"6px",padding:"6px 8px 2px",fontSize:"var(--jx-text-sm)",fontWeight:"600",color:"var(--fg-dim)",textTransform:"uppercase",letterSpacing:"0.5px"},'& [part="count"]':{fontWeight:"400",color:"var(--fg-dim)"},'& [part="seo-button"]':{$description:"The door to Search appearance, pushed to the right edge of the band so the section still reads as a heading and the button as its affordance. The band's own uppercasing and tracking stop here: this is a sentence, not a heading.",marginLeft:"auto",textTransform:"none",letterSpacing:"normal"},'& [part="body"]':{padding:"0 var(--jx-space-2)"},'& [part="row"]':{$description:"studio-ui-guidelines.md §4.1's standard form row, stacked: the label sits above a control that takes the whole width. `min-width: 0` is what keeps it honest in a 240px dock (studio-ui-guidelines.md §4.6) — a field refuses to shrink below its own min-content without it.",display:"flex",flexDirection:"column",alignItems:"stretch",gap:"2px",padding:"2px 0",minWidth:"0"},'& [part="row-label"]':{display:"flex",alignItems:"center",gap:"4px",fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)"},'& [part="chip"]':{$description:"studio-ui-guidelines.md §4.2's set dot: a 6px accent dot, drawn only where the value is set on this document, that clears it when pressed. A real `button` — it is pressable, and it is the row's only keyboard route to clearing — stripped of the chrome a button brings so the row still reads as a label with a dot beside it.",width:"6px",height:"6px",padding:"0",border:"none",borderRadius:"50%",background:"var(--accent)",cursor:"pointer",flexShrink:"0"},'& [part="chip"]:hover':{background:"var(--danger)"},'& [part="chip"]:focus-visible':{outline:"var(--jx-focus-ring)",outlineOffset:"2px"},'& [part="row-name"]':{$description:"The visible label, `aria-hidden` in the markup: every control in the row carries the same words as its own accessible name, so a label node in the tree as well would have each field announced twice. That is the trade the kit's naming makes — a control names itself — and it is also why this row needs no minted ids.",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="widget"]':{width:"100%",minWidth:"0"},'& [part="readout"]':{$description:"A derived value set as text in the field's place, monospaced because a URL is read character by character.",display:"block",padding:"2px 0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--font-mono, monospace)",fontSize:"var(--jx-text-sm)"},'& [part="row-action"]':{alignSelf:"flex-start"},'& [part="note"]':{$description:"What the row could not find out — the entries of a referenced collection that is empty, or the reason listing it failed. A sentence under the control, in the row's own label size, so it reads as part of the field rather than as an error banner.",margin:"0",fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)"},'& [part="media"]':{display:"flex",alignItems:"center",gap:"4px",minWidth:"0"},'& [part="media"] [part="widget"]':{flex:"1",minWidth:"0"},'& [part="thumb"]':{width:"24px",height:"24px",objectFit:"cover",borderRadius:"var(--radius)",border:"1px solid var(--border)",flexShrink:"0"},'& [part="list"]':{padding:"0 var(--jx-space-2)"},'& [part="tag-row"]':{display:"flex",alignItems:"center",gap:"4px",padding:"3px var(--jx-space-2)",borderRadius:"var(--radius)",fontSize:"var(--jx-text-sm)"},'& [part="tag-row"]:hover':{background:"var(--hover-bg)"},'& [part="tag-name"]':{fontWeight:"500",whiteSpace:"nowrap"},'& [part="tag-value"]':{$description:"What the tag says. It takes the row's slack and ellipses rather than wrapping, because a row is a line and a wrapped value would push the remove button off the one the eye is on. The `title` beside it is what makes the full text readable when it does.",flex:"1",minWidth:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--font-mono, monospace)",fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)"},'& [part="empty"]':{$description:"The compact teaching state, drawn here rather than by `panels/empty-state.ts`: that helper is a lit template, and a surface is a document or a lit template and never a mix. It keeps the compact variant's shape — left-aligned, above the add form that IS its action, so it offers no button of its own (empty-state rule 2's stated exception).",margin:"0",padding:"var(--jx-space-3) var(--jx-space-4)",maxWidth:"34ch",lineHeight:"1.5",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="add"]':{display:"flex",alignItems:"center",gap:"4px",padding:"var(--jx-space-2)"},'& [part="add"] [part="field"]':{flex:"1",minWidth:"0"},'& [part="tag-picker"]':{minWidth:"70px"}},children:[{$prototype:"Array",items:{$ref:"#/state/sections"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"section","data-section":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"section-header"},children:[{tagName:"span",attributes:{part:"title"},textContent:"${$map.item.title}"},{tagName:"div",attributes:{part:"seo-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasSeo"},cases:{true:{tagName:"jx-action-button",attributes:{part:"seo-button"},$props:{size:"sm",quiet:!0,label:"Search appearance",hint:"Preview how this page appears in search and when shared"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openSeo"},value:[]}]},children:[{tagName:"span",textContent:"Search appearance…"}]}}}]},{tagName:"div",attributes:{part:"body"},children:[{$prototype:"Array",items:{$ref:"$map/item/rows"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"row","data-prop":"${$map.item.prop}"},children:[{tagName:"div",attributes:{part:"row-label"},children:[{tagName:"div",attributes:{part:"chip-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/isSet"},cases:{true:{tagName:"button",attributes:{part:"chip",type:"button",title:"${$map.item.clearLabel}","aria-label":"${$map.item.clearLabel}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clear"},value:[{$ref:"$map/item/key"}]}]}}}},{tagName:"span",attributes:{part:"row-name","aria-hidden":"true"},textContent:"${$map.item.label}"}]},{tagName:"div",attributes:{part:"widget-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/kind"},cases:{text:{tagName:"jx-textfield",attributes:{part:"widget"},$props:{size:"sm",label:"${$map.item.label}",placeholder:{$ref:"$map/item/placeholder"},value:{$ref:"$map/item/value"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commitText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},textarea:{tagName:"jx-textfield",attributes:{part:"widget"},$props:{size:"sm",multiline:!0,rows:3,label:"${$map.item.label}",placeholder:{$ref:"$map/item/placeholder"},value:{$ref:"$map/item/value"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commitText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},number:{tagName:"jx-number-field",attributes:{part:"widget"},$props:{size:"sm",label:"${$map.item.label}",value:{$ref:"$map/item/value"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNumber"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},boolean:{tagName:"jx-checkbox",attributes:{part:"widget"},$props:{size:"sm",label:"${$map.item.label}",checked:{$ref:"$map/item/checked"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setBoolean"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]}},readout:{$description:"A value the document derives rather than stores, such as a page's URL, which is its file's place under `pages/`. Shown, never edited here: an editable URL would be a rename, and a rename is the file tree's.",tagName:"output",attributes:{part:"readout","aria-label":"${$map.item.label}"},textContent:"${$map.item.value}"},select:{tagName:"jx-select",attributes:{part:"widget"},$props:{size:"sm",label:"${$map.item.label}",options:{$ref:"$map/item/options"},value:{$ref:"$map/item/value"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setChoice"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},media:{tagName:"div",attributes:{part:"media"},children:[{tagName:"div",attributes:{part:"thumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasThumb"},cases:{true:{tagName:"img",attributes:{part:"thumb",src:"${$map.item.thumb}",alt:""}}}},{tagName:"jx-textfield",attributes:{part:"widget"},$props:{size:"sm",label:"${$map.item.label}",placeholder:"/image.jpg",value:{$ref:"$map/item/value"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commitText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"upload"},$props:{size:"sm",quiet:!0,icon:"upload-simple",label:"Upload media",hint:"Upload media"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/upload"},value:[{$ref:"$map/item/key"}]}]}},{tagName:"jx-action-button",attributes:{part:"browse"},$props:{size:"sm",quiet:!0,icon:"image",label:"Browse media",hint:"Browse media"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/browse"},value:[{$ref:"$map/item/key"},{$ref:"event#/currentTarget"}]}]}}]}}},{tagName:"div",attributes:{part:"action-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasAction"},cases:{true:{$description:"The row's one door elsewhere, named for what it opens: the Layout row's Edit template opens the layout in Design.",tagName:"jx-button",attributes:{part:"row-action"},$props:{size:"sm",variant:"secondary"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runRowAction"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"span",textContent:"${$map.item.action}"}]}}},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasNote"},cases:{true:{tagName:"p",attributes:{part:"note"},textContent:"${$map.item.note}"}}}]}}]}]}},{tagName:"div",attributes:{part:"section","data-section":"custom"},children:[{tagName:"div",attributes:{part:"section-header"},children:[{tagName:"span",attributes:{part:"title"},textContent:"Custom Tags"},{tagName:"span",attributes:{part:"count"},textContent:"${state.customCount}"}]},{tagName:"div",attributes:{part:"custom-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/customState"},cases:{empty:{tagName:"p",attributes:{part:"empty"},textContent:"Custom tags add your own meta, link and script elements to this page — analytics, verification, a webfont. Add one below."},listed:{tagName:"div",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/customEntries"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"tag-row","data-tag":"${$map.item.key}"},children:[{tagName:"span",attributes:{part:"tag-name",title:"${$map.item.value}"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"tag-value"},textContent:"${$map.item.value}"},{tagName:"jx-action-button",attributes:{part:"remove"},$props:{icon:"x",size:"sm",quiet:!0,label:"${$map.item.removeLabel}",hint:"Remove"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeEntry"},value:[{$ref:"$map/item/key"}]}]}}]}}]}}},{tagName:"div",attributes:{part:"add","data-add":"tag"},children:[{tagName:"jx-select",attributes:{part:"tag-picker","data-field":"tag"},$props:{size:"sm",label:"Tag",options:{$ref:"#/state/tagOptions"},value:{$ref:"#/state/addTag"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editTag"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"jx-textfield",attributes:{part:"field","data-field":"attr"},$props:{size:"sm",label:"Attribute",placeholder:"Attribute (e.g. name)",value:{$ref:"#/state/addAttr"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAttr"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/addEntry"},value:[]}]}}]}},{tagName:"jx-textfield",attributes:{part:"field","data-field":"value"},$props:{size:"sm",label:"Value",placeholder:"Value",value:{$ref:"#/state/addValue"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editValue"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/addEntry"},value:[]}]}}]}},{tagName:"jx-action-button",attributes:{part:"add-button","data-add":"tag"},$props:{icon:"plus",size:"sm",quiet:!0,label:"Add tag",hint:"Add tag"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/addEntry"},value:[]}]}}]}]}]};E("panel-page",Qe);function et(e,t){e.sections=t.sections,e.customCount=t.customCount,e.customState=t.customState,e.customEntries=t.customEntries,e.addTag=t.addTag,e.addAttr=t.addAttr,e.addValue=t.addValue,e.tagOptions=t.tagOptions}function fa(){return{addAttr:"",addTag:"",addValue:"",customCount:"0",customEntries:[],customState:"empty",sections:[],tagOptions:[]}}var G=new WeakMap;function tt(e,t,a){let r=G.get(e);if(r&&(r.handle===null||r.handle.root.isConnected)){et(r.scope,t);return}r?.handle?.dispose(),e.textContent="";let i=b({...fa(),...a});et(i,t);let o={handle:null,scope:i};G.set(e,o),I("panel-page",i,e).then((s)=>{if(G.get(e)!==o){s.dispose();return}o.handle=s})}function de(e){let t=G.get(e);if(!t)return;G.delete(e),t.handle?.dispose(),e.textContent=""}var at={$schema:"https://jxsuite.com/schema/v1",$id:"StudioEntryInspector",$description:"The Inspector's Entry tab (specs/studio.md §6, §22.5): one collection entry's own settings while it is written on the canvas, the Content-Entry board's sidebar. Its status (a hold rule's label, or Published), its fields as the collection's schema types them, the URL its collection page publishes it at, and the file it is stored in. `content/entry-inspector.ts` keeps every decision; the field form is an island it fills, `ui/schema-form.ts`'s, the same form the form-only entry editor draws.",tagName:"div",attributes:{part:"entry","data-jx-region":"${state.region}"},style:{$description:"A column of sections, each a small uppercase heading over its rows, like the Page tab beside it.",display:"flex",flexDirection:"column",gap:"var(--jx-space-4)",padding:"var(--jx-space-3)",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="section"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},'& [part="section-title"]':{margin:"0",fontSize:"var(--jx-text-sm)",fontWeight:"700",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--fg-dim)"},'& [part="head"]':{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:"var(--jx-space-2)"},'& [part="kind"]':{fontWeight:"600"},'& [part="status"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="status"][data-held="true"]':{color:"var(--warning)"},'& [part="note"]':{margin:"0",fontSize:"var(--jx-text-sm)",lineHeight:"1.5",color:"var(--fg-dim)"},'& [part="url"]':{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",wordBreak:"break-all"},'& [part="path"]':{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",color:"var(--fg)",wordBreak:"break-all"},'& [part="fields-head"]':{display:"flex",alignItems:"center",justifyContent:"space-between"}},children:[{tagName:"section",attributes:{part:"section","aria-labelledby":"entry-inspector-entry"},children:[{tagName:"div",attributes:{part:"head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"entry-inspector-entry"},textContent:"Entry"},{tagName:"span",attributes:{part:"status","data-held":"${state.held ? 'true' : 'false'}"},textContent:"${state.status}"}]},{tagName:"span",attributes:{part:"kind"},textContent:"${state.kind}"},{tagName:"div",attributes:{part:"hold-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/holdSwitch"},cases:{shown:{$description:"The entry's hold switch, on a collection whose rules offer one: the one field every such collection has in common. The state this shares (site-architecture.md §7.6). A setter: the switch names the state it reaches.",tagName:"jx-switch",attributes:{part:"hold"},$props:{checked:{$ref:"#/state/holdOn"},hint:"${state.holdHint}",size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setHold"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"${state.holdLabel}"}]}}}]},{tagName:"section",attributes:{part:"section","aria-labelledby":"entry-inspector-fields"},children:[{tagName:"div",attributes:{part:"fields-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"entry-inspector-fields"},textContent:"Fields"},{tagName:"jx-action-button",attributes:{part:"edit-fields"},$props:{size:"sm",quiet:!0,hint:"Edit this collection's fields in Project Settings",haspopup:"dialog"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFields"},value:[]}]},children:[{tagName:"span",textContent:"Edit"}]}]},{tagName:"div",attributes:{part:"fields-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/fieldsState"},cases:{form:{tagName:"div",attributes:{part:"fields"}},none:{tagName:"p",attributes:{part:"note"},textContent:"This collection declares no fields. Edit adds some in Project Settings."}}}]},{tagName:"section",attributes:{part:"section","aria-labelledby":"entry-inspector-page"},children:[{tagName:"div",attributes:{part:"fields-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"entry-inspector-page"},textContent:"Page"},{$description:"The door to Search appearance, the same `document.openSeo` the Page tab's button runs: an entry's search title, description and social image are its frontmatter too (studio.md §4.2).",tagName:"jx-action-button",attributes:{part:"seo-button"},$props:{size:"sm",quiet:!0,label:"Search appearance",hint:"Preview how this entry appears in search and when shared",haspopup:"dialog"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openSeo"},value:[]}]},children:[{tagName:"span",textContent:"Search appearance…"}]}]},{tagName:"div",attributes:{part:"url-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/urlState"},cases:{shown:{tagName:"code",attributes:{part:"url"},textContent:"${state.url}"},none:{tagName:"p",attributes:{part:"note"},textContent:"Entries of this collection have no page of their own."},unlisted:{$description:"The collection has a page, but the page lists the ids it publishes (`$paths.values`) and this entry is not one of them: naming a URL the build never writes would be a link to nothing.",tagName:"p",attributes:{part:"note"},textContent:"Not published: this collection's page lists the entries it publishes, and this is not one of them."},loading:{tagName:"p",attributes:{part:"note"},textContent:"Finding the page this entry is published at…"}}},{tagName:"p",attributes:{part:"note"},children:[{tagName:"span",textContent:"Stored as "},{tagName:"code",attributes:{part:"path"},textContent:"${state.path}"},{tagName:"span",textContent:"${state.storage}"}]}]}]};E("entry-inspector",at);function ga(e,t){e.region=t.region,e.kind=t.kind,e.status=t.status,e.holdSwitch=t.holdSwitch,e.holdOn=t.holdOn,e.holdLabel=t.holdLabel,e.holdHint=t.holdHint,e.held=t.held,e.fieldsState=t.fieldsState,e.urlState=t.urlState,e.url=t.url,e.path=t.path,e.storage=t.storage}function ba(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function rt(e,t,a,r){e.replaceChildren();let i=b({...t,...a}),o=null,s=!1,l=I("entry-inspector",i,e,{onNodeCreated:(c,d,f)=>{if(!s&&c instanceof HTMLElement&&ba(f)==="fields")r.fieldsSlot(c)}}).then((c)=>{if(s)c.dispose();else o=c;return c});return{attached:()=>{if(s)return!1;let c=o?.root;return c===void 0?!0:e.contains(c)},dispose(){s=!0,o?.dispose(),o=null},ready:l,update:(c)=>ga(i,c)}}var ya="inspector/entry";function ot(e){let t=Kn(e?.documentPath);return t!==null&&!t.fileBacked}function st(e){let t=e.documentPath??"",r=Kn(t)?.name??"",i=qs(r),o=Kl(e),s=i?.def,l=Ep(s,o),c=ks(s),d=r===""?null:oh(r,Vc(t)),f=d?EC(d,t,o):null,y=t.endsWith(".json");return{fieldsState:i?.schema?"form":"none",held:l!==null,holdHint:Tp(l),holdLabel:c?.label??"",holdOn:c!==null&&o[c.field]===!0,holdSwitch:c?"shown":"hidden",kind:Yb(ec(r)?.item??"entry"),path:t,region:ya,status:Rm(s,o),storage:y?". Its fields are the file itself.":". Fields are its frontmatter, and the body is its Markdown.",url:f??"",urlState:d===void 0?"loading":f?"shown":d?"unlisted":"none"}}var v=null;function lt(e,t){let a=qs(Kn(t.documentPath)?.name??"");if(!e.formHost||!a?.schema)return;let r=Kl(t),i=Jl("entry-inspector",ET(a.schema,a.schema,r),r,{context:CT(t),errors:kT(a,r),onChange:(o)=>T0(t,o),rerender:e.redraw,ui:ST(a.schema)});if(i.parentNode!==e.formHost)e.formHost.replaceChildren(i)}function it(e,t){let a=st(t);if(a.fieldsState==="none")e.formHost=null;e.handle.update(a),lt(e,t)}function q(e){if(!v||e!==void 0&&v.host!==e)return;v.unlisten(),v.scope.stop(),v.handle.dispose(),v=null}function dt(e,t){if(v&&v.host===e&&v.tabId===t.id&&v.handle.attached()){it(v,t);return}q();let a=me(),r=()=>{if(v===i)it(i,t)},i={formHost:null,handle:rt(e,st(t),{openFields:()=>{let o=Kn(t.documentPath)?.name;nt("settings.open",o?{entry:o,section:"content"}:{section:"content"},"Entry")},openSeo:()=>{nt("document.openSeo",void 0,"Entry")},setHold:(o)=>Ib(t,o)},{fieldsSlot:(o)=>{if(v===i)i.formHost=o,lt(i,t)}}),host:e,redraw:r,scope:a,tabId:t.id,unlisten:Op(r)};v=i,a.run(()=>{te(()=>{t.doc.document,t.doc.content.frontmatter,x?.projectConfig?.content,r()})})}var A=null;async function $E(){try{A=(await p().listDirectory("layouts")).filter((a)=>a.type==="file"&&a.name.endsWith(".json")).map((a)=>({name:a.name.replace(/\.json$/,"").replaceAll(/[-_]+/g," ").replaceAll(/\b\w/g,(r)=>r.toUpperCase()),path:`./layouts/${a.name}`}))}catch{A=[]}return A}async function va(){await $E(),wn("rightPanel","seoModal")}function aw(){A=null,ja()}function xa(){if(A===null)va();return A}var lw=[{attr:"name",key:"description",label:"Description"},{attr:"name",key:"viewport",label:"Viewport"}],cw=[{attr:"property",key:"og:title",label:"Title"},{attr:"property",key:"og:description",label:"Description",multiline:!0},{attr:"property",key:"og:image",label:"Image",media:!0},{attr:"property",key:"og:type",label:"Type"}],ct=new Set([...lw,...cw].map((e)=>e.key)),pt=new Set(["title"]);function wa(e){return He(e)?new Set([...pt,"description"]):pt}function LE(e){let t=dw(e.$head??[],"name","description");if(t)return String(t.attributes?.content??"");return n(e.description)?e.description:""}function YS(e,t){if(!dw(e.$head??[],"name","description")&&n(e.description)){if(t)e.description=t;else delete e.description;return}uw(e,"name","description",t)}function dw(e,t,a){return e.find((r)=>r?.tagName==="meta"&&r.attributes?.[t]===a)}function RE(e,t){return e.find((a)=>a?.tagName==="link"&&a.attributes?.rel===t)}function $a(e){if(!e?.tagName)return!1;if(e.tagName==="meta"){let t=String(e.attributes?.name??""),a=String(e.attributes?.property??"");return Boolean(t&&ct.has(t))||Boolean(a&&ct.has(a))}if(e.tagName==="link"&&e.attributes?.rel==="icon")return!0;return!1}function uw(e,t,a,r){if(!e.$head)e.$head=[];let i=e.$head.findIndex((o)=>o?.tagName==="meta"&&o.attributes?.[t]===a);if(r){let o={attributes:{[t]:a,content:r},tagName:"meta"};if(i!==-1)e.$head[i]=o;else e.$head.push(o)}else if(i!==-1)e.$head.splice(i,1)}function ZS(e,t,a){if(!e.$head)e.$head=[];let r=e.$head.findIndex((i)=>i?.tagName==="link"&&i.attributes?.rel===t);if(a){let i={attributes:{href:a,rel:t},tagName:"link"};if(r!==-1)e.$head[r]=i;else e.$head.push(i)}else if(r!==-1)e.$head.splice(r,1)}function Sa(e){if(!e?.tagName)return"unknown";let t=e.attributes??{};if(t.name)return`<meta name="${String(t.name)}">`;if(t.property)return`<meta property="${String(t.property)}">`;if(t.rel&&t.href)return`<link rel="${String(t.rel)}">`;if(t.src)return`<script src="${String(t.src)}">`;if(t.charset)return`<meta charset="${String(t.charset)}">`;return`<${e.tagName}>`}function Ta(e){let t=e?.attributes??{};return String(t.content??t.href??t.src??e?.textContent??"")}var yt="Jx Site",vt={donor:null,source:"none",value:""};function ke(e,t,a){let r=null;for(let i of e)if(i?.tagName==="meta"&&i.attributes?.[t]===a)r=String(i.attributes.content??"");return r}function K(e,t,a){let r=ke(e.page,t,a);if(r!==null)return{donor:null,source:"page",value:r};let i=ke(e.layout,t,a);if(i!==null)return{donor:e.layoutName??"the layout",source:"layout",value:i};let o=ke(e.site,t,a);if(o!==null)return{donor:"Site head",source:"site",value:o};return vt}function ka(e,t){let a=e.trim();if(a)return{donor:null,source:"page",value:a};let r=t?.trim();if(r)return{donor:"Site name",source:"site",value:r};return{donor:"the build",source:"build",value:yt}}function Ea(e,t){let a=e??"",r=a.split("/").filter((s)=>s!=="");if(!t||e===null)return{crumb:a||"/",host:"",href:null};let i;try{i=new URL(a,t)}catch{return{crumb:a||"/",host:"",href:null}}let{host:o}=i;return{crumb:[o,...r].join(" › "),host:o,href:i.href}}var xt=new Map([["description",160],["og:description",200],["og:title",60],["title",60]]),Pa=new Intl.Segmenter("en-US",{granularity:"grapheme"});function IE(e){let t=0;for(let a of Pa.segment(e))t+=1;return t}var ut="Search appearance";function DN(e,t){xl((a)=>a.source===ut);for(let a of e.warnings){let r={action:"document.openSeo",key:`seo.${a.id}`,source:ut,tier:"problem"};if(t!==void 0)r.path=t;w.warn(a.message,r)}return e.warnings.length}function ub(e,t){return e.fields.find((a)=>a.key===t)??{...vt,key:t,label:t,limit:xt.get(t)??null}}function Na(e){return[...e.site,...e.layout,...e.page].some((t)=>t?.tagName==="title")}function Ha(e,t){let a=[],r=(o)=>e.fields.find((s)=>s.key===o);if(r("title")?.source==="build")a.push({field:"title",id:"title-missing",message:`Neither this page nor the project names a title, so the build ships “${yt}”.`});if(r("description")?.value.trim()==="")a.push({field:"description",id:"description-missing",message:"No description reaches this page from the site, its layout or the page itself — a "+"result row shows whatever text the engine picks instead."});if(r("og:title")?.value.trim()==="")a.push({field:"og:title",id:"og-title-missing",message:"No og:title — a shared link carries no headline of its own."});if(r("og:description")?.value.trim()==="")a.push({field:"og:description",id:"og-description-missing",message:"No og:description — a shared link carries no summary of its own."});if(r("og:image")?.value.trim()==="")a.push({field:"og:image",id:"og-image-missing",message:"No og:image — a shared link renders as a text-only card."});for(let o of e.fields){let s=IE(o.value);if(o.limit!==null&&s>o.limit){let l=o.key.endsWith("description")?"summaries":"headlines";a.push({field:o.key,id:`${o.key}-long`,message:`${o.label} is ${s} characters; ${l} are cut near ${o.limit}.`})}}if(e.url.href===null)a.push({field:"url",id:"site-url-missing",message:"Project Settings names no site URL, so the build emits no canonical link and no og:url."});if(Na(t))a.push({field:"title",id:"head-title-ignored",message:"A <title> element in $head is discarded — the build writes the title from the "+"document's own title property."});return a}function Ia(e,t){let a=(s,l,c)=>({...c,key:s,label:l,limit:xt.get(s)??null}),r=[a("title","Title",ka(t.pageTitle,t.siteName)),a("description","Description",K(e,"name","description")),a("og:title","Social title",K(e,"property","og:title")),a("og:description","Social description",K(e,"property","og:description")),a("og:image","Social image",K(e,"property","og:image")),a("og:type","Social type",K(e,"property","og:type"))],i=Ea(t.route,t.siteUrl),o={fields:r,url:i};return{...o,warnings:Ha(o,e)}}var Pe=null,Ne=[],Y=null;function ja(){Pe=null,Ne=[],Y=null}async function Ma(e){if(Y===e)return;Y=e;let t=await Rx(e);if(Y!==e)return;Y=null,Pe=e,Ne=t?.$head??[],wn("seoModal")}function wt(e){return e.replace(/^\.\//,"").replace(/^layouts\//,"").replace(/\.json$/,"").replaceAll(/[-_/]+/g," ").replaceAll(/\b\w/g,(t)=>t.toUpperCase())||e}function Ca(e,t){let a=He(e)?fl(t):null;if(a===null)return{entries:[],name:null};let r=wt(a);if(a===Pe)return{entries:Ne,name:r};return Ma(a),{entries:[],name:r}}function NE(e,t){let a=x?.projectConfig,r=Ca(e,t.$layout),i=e?.documentPath,o={pageTitle:n(t.title)?t.title:"",route:i?dm(i):null};if(a?.name!==void 0)o.siteName=a.name;if(a?.url!==void 0)o.siteUrl=a.url;return Ia({layout:r.entries,layoutName:r.name,page:Ge(t.$head??[],t.description),site:a?.$head??[]},o)}function He(e){let t=e?.documentPath;return Boolean(t&&x?.isSiteProject&&(t.startsWith("pages/")||t.startsWith("./pages/")))}function XS(e,t){let a={...e};if(t.title!==void 0)a.title=t.title;if(n(t.description))a.description=t.description;if(n(t.$layout)||t.$layout===!1)a.$layout=t.$layout;if(t.$head!==void 0)a.$head=t.$head;return a}function DE(e,t,a){if(!e)return;let r=e.doc.content.frontmatter,i=XS({},r).$head,o={};if(n(r.title))o.title=r.title;if(n(r.description))o.description=r.description;if(i)o.$head=[...i];if(n(r.$layout)||r.$layout===!1)o.$layout=r.$layout;a(o);let s=o.$head&&o.$head.length>0?o.$head:void 0,l=o.$layout!==r.$layout,c=o.title!==r.title,d=n(r.description)&&o.description!==r.description,f=JSON.stringify(s)!==JSON.stringify(i);if(l||c||d||f)Z(e,(y)=>{if(l)Xd(y,"$layout",n(o.$layout)||o.$layout===!1?o.$layout:void 0);if(c)Xd(y,"title",o.title);if(d)Xd(y,"description",n(o.description)?o.description:void 0);if(f)Xd(y,"$head",s)});t()}var P=null,H=null,ue="meta",Q="",ee="",T=new Map,Ie=new Map;function Oa(e){let t=e?.documentPath?dm(e.documentPath):null;if(t===null)return null;return{...C("__url","url","URL"),kind:"readout",value:t}}var Ee=new Map,R=new Map,Fa=[{label:"meta",value:"meta"},{label:"link",value:"link"},{label:"script",value:"script"}];function C(e,t,a){return{action:"",checked:!1,clearLabel:`Clear ${t}`,hasAction:!1,hasNote:!1,hasThumb:!1,isSet:!1,key:e,kind:"text",label:a,note:"",options:[],placeholder:"",prop:t,thumb:"",value:""}}function $t(e,t){e.hasThumb=t!==""&&aa.has(Ot(t)),e.thumb=e.hasThumb?Xc(t):""}function La(e,t){let a=n(e.title)?e.title:"";return T.set("title",{images:!1,clear:()=>t((r)=>{delete r.title}),commit:(r)=>t((i)=>{let o=String(r).trim();if(o)i.title=o;else delete i.title})}),{...C("title","title","Title"),clearLabel:"Clear title",isSet:Boolean(a),placeholder:"Page title…",value:a}}function mt(e,t,a){let r=String(dw(t,e.attr,e.key)?.attributes?.content??""),i=`meta:${e.attr}:${e.key}`;T.set(i,{images:e.media===!0,clear:()=>a((s)=>uw(s,e.attr,e.key,"")),commit:(s)=>a((l)=>uw(l,e.attr,e.key,e.media?String(s):String(s).trim()))});let o=C(i,e.key,e.label);if(o.isSet=Boolean(r),o.value=r,e.media)return o.kind="media",$t(o,r),o;return o.kind=e.multiline?"textarea":"text",o.placeholder=e.key==="viewport"?"width=device-width, initial-scale=1":`${e.label}…`,o}function Aa(e,t){let a=LE(e),r="meta:name:description";T.set("meta:name:description",{images:!1,clear:()=>t((o)=>YS(o,"")),commit:(o)=>t((s)=>YS(s,String(o).trim()))});let i=C("meta:name:description","description","Description");return i.isSet=Boolean(a),i.value=a,i.kind="text",i.placeholder="Description…",i}function Ra(e,t){let a=String(RE(e,"icon")?.attributes?.href??"");T.set("link:icon",{images:!0,clear:()=>t((i)=>ZS(i,"icon","")),commit:(i)=>t((o)=>ZS(o,"icon",String(i)))});let r=C("link:icon","icon","Icon");return r.isSet=Boolean(a),r.kind="media",r.value=a,$t(r,a),r}function _a(e,t,a){if(!He(e))return null;let r=xa();if(r===null)return null;let i=t.$layout,o=x?.projectConfig?.defaults?.layout,s=o?wt(o):"";T.set("__layout",{images:!1,clear:()=>a((d)=>{delete d.$layout}),commit:(d)=>{let f=String(d);a((y)=>{if(f==="__default__")delete y.$layout;else if(f==="__none__")y.$layout=!1;else y.$layout=f}),CA()}});let l=C("__layout","layout","Layout");l.kind="select",l.isSet=i!==void 0,l.options=[{label:s?`Default (${s})`:"Default",value:"__default__"},{label:"None",value:"__none__"},...r.map((d)=>({label:d.name,value:d.path}))],l.value=i===!1?"__none__":i||"__default__";let c=fl(i);if(c)l.action="Edit template",l.hasAction=!0,Ie.set("__layout",()=>{(ce("b2p9y0yz"),import("./files-b2p9y0yz.js")).then(({openFileInTab:d})=>d(c.replace(/^\.\//,"")))});return{hasSeo:!1,key:"layout",rows:[l],title:"Layout"}}function Ja(e){if(!e||e.doc.mode!=="content")return null;let{collection:t,fields:a,hasSchema:r,requiredFields:i}=Ke(e,x?.projectConfig,wa(e));if(a.length===0&&!r)return null;return{hasSeo:!1,key:"frontmatter",rows:a.map((s)=>{let l=`fm:${s.field}`,{parse:c,row:d}=Ye(s.field,s.entry,s.value,i,{rerender:D});return T.set(l,{images:d.kind==="media"&&s.entry.format==="image",clear:()=>Z(e,(f)=>Xd(f,s.field)),commit:(f)=>Z(e,(y)=>Xd(y,s.field,c(f)))}),Object.assign(C(l,s.field,d.label),d,{clearLabel:`Clear ${s.field}`})}),title:t?`Frontmatter (${t.name})`:"Frontmatter"}}function Va(e){Ee.clear();let t=[];for(let a of e){if($a(a)||sw(a)||Te(a))continue;let r=`tag:${t.length}`;Ee.set(r,a);let i=Sa(a);t.push({key:r,label:i,removeLabel:`Remove ${i}`,value:Ta(a)})}return t}function Wa(e){T.clear(),Ie.clear();let t=h.value,a=e.document,r=a.$head??[],i=[],o=Ja(t);if(o)i.push(o);let s=_a(t,a,e.applyMutation);if(s)i.push(s);let l=Oa(t);i.push({hasSeo:!0,key:"page",rows:[La(a,e.applyMutation),...l?[l]:[],...lw.map((d)=>d.key==="description"?Aa(a,e.applyMutation):mt(d,r,e.applyMutation)),Ra(r,e.applyMutation)],title:"Page"},{hasSeo:!1,key:"opengraph",rows:cw.map((d)=>mt(d,r,e.applyMutation)),title:"OpenGraph"});let c=Va(r);return{addAttr:Q,addTag:ue,addValue:ee,customCount:String(c.length),customEntries:c,customState:c.length===0?"empty":"listed",sections:i,tagOptions:Fa}}function D(){if(!P||!H)return;tt(P,Wa(H),Ba)}function ft(){for(let{timer:e}of R.values())clearTimeout(e);R.clear()}function X(e){let t=R.get(e);if(t)clearTimeout(t.timer),R.delete(e)}function pe(e,t){X(e),T.get(e)?.commit(t)}function za(){let e=H,t=Q.trim(),a=ee.trim();if(!e||!t||!a)return;let r=ue||"meta";Q="",ee="",D();let i={attributes:{},tagName:r};if(r==="meta")i.attributes={content:a,name:t};else if(r==="link")i.attributes={href:a,rel:t};else if(r==="script")i.attributes={[t]:a};e.applyMutation((o)=>{if(!o.$head)o.$head=[];o.$head.push(i)}),e.rerender()}function Ua(e){let t=H,a=Ee.get(e);if(!t||!a)return;t.applyMutation((r)=>{if(!r.$head)return;let i=r.$head.indexOf(a);if(i!==-1)r.$head.splice(i,1)}),t.rerender()}var ht=null;function gt(){return ht??=(ce("4p4pd28y"),import("./media-picker-4p4pd28y.js")),ht}var Ba={addEntry:za,browse:(e,t)=>{X(e),gt().then((a)=>{if(t instanceof HTMLElement)a.showMediaPickerPopover(t,(r)=>{T.get(e)?.commit(r)},{images:T.get(e)?.images??!0})})},clear:(e)=>{X(e),T.get(e)?.clear()},commitText:(e,t)=>pe(e,t),editAttr:(e)=>{Q=e,D()},editText:(e,t)=>{X(e);let a=()=>{R.delete(e),T.get(e)?.commit(t)};R.set(e,{commit:a,timer:setTimeout(a,tf)})},editTag:(e)=>{ue=e,D()},editValue:(e)=>{ee=e,D()},openSeo:()=>{ae()?.run("document.openSeo")},removeEntry:Ua,runRowAction:(e)=>{Ie.get(e)?.()},setBoolean:(e,t)=>pe(e,t),setChoice:(e,t)=>pe(e,t),setNumber:(e,t)=>pe(e,t),upload:(e)=>{X(e),gt().then((t)=>{t.pickAndUpload((a)=>{T.get(e)?.commit(a)})})}};function Ga(e,t){if(e!==P)ue="meta",Q="",ee="",ft();if(t.document!==H?.document)ft();P=e,H=t,D()}function OE(e){if(!e)return"Document";if(e.startsWith("pages/"))return"Page";if(e.startsWith("layouts/"))return"Template";if(e.startsWith("components/"))return"Component";let t=Kn(e);return t&&!t.fileBacked?"Entry":"Document"}var qa="A component has no page settings: its title, search and social details come from the page that uses it.";function Ka(e){return{actions:[{label:"Edit tag and props",run:()=>{wl(e,{selection:[[]],ui:{rightTab:"properties"}})}}],detail:"Its tag name and the props it takes are set on its root element.",message:qa}}var ON="Open a page to edit its title, description and social preview.",M=null;function AE(e){if(M&&M!==e){if(q(M),de(M),P===M)P=null,H=null}M=e,hw()}function hw(){let e=M;if(!e)return;let t=h.value;if(!t||ot(t)){if(de(e),P===e)P=null,H=null;if(t)dt(e,t);else q(e);return}if(q(e),OE(t.documentPath)==="Component"){if(de(e),P===e)P=null,H=null;let r=Mu(e,Ka(t));if(e.firstChild!==r||e.childNodes.length!==1)e.replaceChildren(r);return}let a=t.doc.mode==="content";Ga(e,{applyMutation:a?(r)=>DE(h.value,hw,r):(r)=>{Jd(h.value,r)},document:a?XS(t.doc.document,t.doc.content.frontmatter):t.doc.document,rerender:hw})}
|
|
4
|
-
export{sw,TN,$N,LN,RN,cb,kE,Ac,IN,EE,Pu,NN,dm,Ld,db,TE,Mu,$E,aw,lw,cw,LE,YS,dw,RE,uw,ZS,IE,DN,ub,NE,XS,DE,OE,ON,AE,hw};
|
|
5
|
-
|
|
6
|
-
//# debugId=CA946FC0407F0B0864756E2164756E21
|
|
7
|
-
//# sourceMappingURL=studio-8w5pa88p.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{jn,vy,Wt,ln,gr,qx,tP,xn,Pe,Na,n_,St,r_,Hi,qn,Se,pi,ER,Tr,Fe,Kn,Z,ro,xh,Gp,Xe,Jp,fi,g,h,pn,Co,Yp}from"./studio-s49y6m5b.js";import{w}from"./studio-bk0anq3b.js";import{st,br,Zp,nd}from"./studio-x5py815g.js";import{p,ve}from"./studio-xh6rf05g.js";import{rd,Wi}from"./studio-ex1644g2.js";import{mf,su,zy,sd,Is,$r,Ns,ja,yf,cc,Uy,pM,To,rr,Nh,qy}from"./studio-m3jrjfhy.js";import{KC,De,Uc,qc}from"./studio-43pynnhz.js";import{yy,mh,zp}from"./studio-48yzqzqr.js";import{la,Ot}from"./studio-z6s56dzz.js";import{ml,zo,Zs,Xs,Uo}from"./studio-czpmzs9r.js";import{ae}from"./studio-q509sqt8.js";import{tr,SA,UL,$x,Lx,$s,Hp,fl,Rx,qL,u,tR}from"./studio-1d8m5s38.js";import{ph,oc,gy,fh}from"./studio-w4mfaaam.js";import{oo,zt,Vi,ko,x,nu,nf,kh,wn}from"./studio-zn7ysyzb.js";import{re,oa}from"./studio-151kgn69.js";import{Me,v_}from"./studio-bmwgj8ez.js";import{me,te,le}from"./studio-9f5vcb4w.js";import{N_}from"./studio-eq5vqn1q.js";import{n,J,Q,S,m,Oe,Rr,Jn,ur,it,cd}from"./studio-erjccagy.js";import{ce}from"./studio-7qqb7hb8.js";var Ar=128,iL="fullRender",XO="mountCanvas",QO="patchBatch",tn="prepareRender",qr={derivedResolves:0,derivedRetargets:0,escalations:0,fullRenders:0,hostRenderPosts:0,lastEscalationReason:"",lastFullRenderMs:0,p95FullRenderMs:0,panelRenders:0,patchedOps:0,renderPreparations:0,skippedFullRenders:0,timings:{}};globalThis.__jxCanvasPerf=qr;var Qt=new Map;function nn(){try{return typeof localStorage<"u"&&Boolean(localStorage.getItem("jx-canvas-debug"))}catch{return!1}}function en(){return typeof performance<"u"&&Q(performance.now)?performance.now():0}function on(e,t){if(nn())console.debug(`[jx-canvas] ${e}`,t??"")}function mx(e){qr.escalations+=1,qr.lastEscalationReason=e,on("escalation",e)}function Ir(e){if(e.length===0)return 0;let t=e.toSorted((r,i)=>r-i),o=Math.min(t.length-1,Math.ceil(t.length*0.95)-1);return t[Math.max(0,o)]??0}function Dr(e,t){let o=Number.isFinite(t)&&t>0?t:0,r=Qt.get(e);if(!r)r=[],Qt.set(e,r);if(r.push(o),r.length>Ar)r.shift();let i=qr.timings[e],a={count:(i?.count??0)+1,lastMs:o,maxMs:Math.max(i?.maxMs??0,o),p95Ms:Ir(r),totalMs:(i?.totalMs??0)+o};if(qr.timings[e]=a,e===iL)qr.lastFullRenderMs=a.lastMs,qr.p95FullRenderMs=a.p95Ms;on(`span:${e}`,`${o.toFixed(2)}ms`)}function rn(e){let t=en(),o=nn(),r=`jx-${e}-start`;if(o)try{performance.mark(r)}catch{}let i=!1;return()=>{if(i)return qr.timings[e]?.lastMs??0;i=!0;let a=en()-t;if(o)try{performance.measure(`jx-${e}`,r),performance.clearMarks(r)}catch{}return Dr(e,a),a}}function IC(e,t){let o=rn(e);try{return t()}finally{o()}}async function NC(e,t){let o=rn(e);try{return await t()}finally{o()}}function vo(){return br(g.activePaneId)}function bt(e){let t=pn(e),o=t?.derived,r=o?.kind==="lens"?pn(o.sourcePaneId)?.activeTabId:t?.activeTabId;return r?g.tabs.get(r)??null:null}function Vo(e){return pn(e)?.derived??null}function yC(e){if(!e)return[];let t=[];for(let o of g.panes)if(bt(o.id)?.id===e.id)t.push(br(o.id));return t}function z(e){for(let t of Zp()){let o=t.panels.find((r)=>r.canvas===e);if(o)return{panel:o,surface:t}}return null}function an(e){let t=e.canvas,o=t?z(t):null;return o?bt(o.surface.paneId):null}function Ta(e){let t=e?.session.ui,o=t?.canvasMode??"design";return t?.preview&&(o==="edit"||o==="design")?"preview":o}function Ur(e){let t=Vo(e);if(t?.kind==="lens"){let o=t.mode;return bt(e)?.session.ui?.preview&&(o==="edit"||o==="design")?"preview":o}return Ta(bt(e))}function ul(e){let t=Vo(e);if(t?.kind==="lens"&&t.preset==="breakpoint")return t.media;return bt(e)?.session.ui.activeMedia??null}function at(e){return nd(e)?.paneId??fi}function pe(e){return bt(at(e))}function yx(e){return mf(e)!==null}function Pp(e){return mf(e)}function Wo(e){if(!e)return{baseWidth:320,featureQueries:[],sizeBreakpoints:[]};let t=[],o=[],r=320;for(let[i,a]of Object.entries(e)){if(i==="--"){let c=String(a).match(/^(\d+)\s*px$/);r=c?Number(c[1]):320;continue}let l=a.match(/min-width:\s*([\d.]+)px/),s=a.match(/max-width:\s*([\d.]+)px/);if(l)o.push({name:i,query:a,type:"min",width:Number(l[1])});else if(s)o.push({name:i,query:a,type:"max",width:Number(s[1])});else t.push({name:i,query:a})}return o.sort((i,a)=>i.type==="min"?i.width-a.width:a.width-i.width),{baseWidth:r,featureQueries:t,sizeBreakpoints:o}}function kr(e,t){let o=new Set;for(let r of e)if(r.type==="min"&&t>=r.width)o.add(r.name);else if(r.type==="max"&&t<=r.width)o.add(r.name);return o}function sn(e,t){let o=kr(e,t),r=null;for(let i of e){if(!o.has(i.name))continue;let a=Math.abs(i.width-t);if(r===null){r=i;continue}let l=Math.abs(r.width-t);if(a<l||a===l&&i.width<r.width)r=i}return r?.name??null}function aA(e,t,o=8){let r=null;for(let i of t){let a=Math.abs(i-e);if(a>o)continue;if(r===null||a<Math.abs(r-e))r=i}return r??e}var OC={$id:"elements-meta",title:"HTML Element Metadata",description:"Inline scoping and inline toolbar action metadata for HTML elements.",$convertGroups:{text:["p","h1","h2","h3","h4","h5","h6","blockquote"],container:["div","section","article","aside","main","header","footer","nav","search"],list:["ul","ol"]},$defs:{p:{$convertTo:"text",$convertToWhenEmpty:["text","container"],$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"u",label:"Underline",command:"underline"},{tag:"del",label:"Strikethrough",command:"strikethrough"},{tag:"sup",label:"Superscript",command:"superscript"},{tag:"sub",label:"Subscript",command:"subscript"},{tag:"code",label:"Code",command:"code"},{tag:"a",label:"Link",command:"link"}]},h1:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"code",label:"Code",command:"code"},{tag:"a",label:"Link",command:"link"}]},h2:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h3:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h4:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h5:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h6:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},li:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},td:{$inlineChildren:["em","strong","del","code","a","span","br","b","i","u","sub","sup","s"],$inlineActions:"p"},th:{$inlineChildren:["em","strong","del","code","a","span","br","b","i","u","sub","sup","s"],$inlineActions:"p"},blockquote:{$convertTo:"text",$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},figcaption:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},caption:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},summary:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},dt:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},dd:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},label:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},a:{$inlineChildren:["em","strong","code","span","br","b","i","u","sub","sup"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"code",label:"Code",command:"code"}]},span:{$inlineChildren:["em","strong","del","code","a","br","b","i","u","sub","sup","s"],$inlineActions:"p"},div:{$convertTo:"container",$convertToWhenEmpty:["container","text"],$inlineChildren:[]},section:{$convertTo:"container",$inlineChildren:[]},article:{$convertTo:"container",$inlineChildren:[]},nav:{$convertTo:"container",$inlineChildren:[]},main:{$convertTo:"container",$inlineChildren:[]},header:{$convertTo:"container",$inlineChildren:[]},footer:{$convertTo:"container",$inlineChildren:[]},aside:{$convertTo:"container",$inlineChildren:[]},ul:{$convertTo:"list",$inlineChildren:[]},ol:{$convertTo:"list",$inlineChildren:[]},pre:{$inlineChildren:["code"]},table:{$inlineChildren:[]},thead:{$inlineChildren:[]},tbody:{$inlineChildren:[]},tr:{$inlineChildren:[]}}};var jm=OC.$defs,Lr=new Set(["pre"]),Cs=new Set(Object.entries(jm).filter(([e,t])=>!Lr.has(e)&&(t.$inlineChildren?.length??0)>0).map(([e])=>e));var cn=new Set(["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"]);function lt(e,t){if(!t)return cn.has(e);let o=jm[t];if(!o||!o.$inlineChildren)return!1;return o.$inlineChildren.includes(e)}function rA(e){let t=jm[e];if(!t)return null;let o=t.$inlineActions;if(n(o))o=jm[o]?.$inlineActions??void 0;if(!Array.isArray(o))return null;return o}var _r=null;function gx(e,t){if(!S(e))return!1;let o=(it(e.tagName)||"div").toLowerCase();if(t){let r=(it(t.tagName)||"div").toLowerCase();return lt(o,r)}return cn.has(o)}function oA(){return _r!==null}function Te(e){return!e||e==="base"?null:e}function bx(e){let t=e.panels;if(t.length===0)return null;if(t.length===1)return t[0];let o=ul(e.paneId);for(let r of t){if(o===null&&r.mediaName==="base")return r;if(r.mediaName===o)return r}return t[0]}function un(){return bx(vo())}function sA(e,t){if(!e)return t;let o=t;for(let r=zt(o);r;r=zt(o)){let i=re(e,o),a=re(e,r);if(!i||!a)break;let l=(it(i.tagName)||"div").toLowerCase(),s=(it(a.tagName)||"div").toLowerCase();if(!lt(l,s))break;o=r}return o}var Hm=240,lA=8,cA=16,Ne=new Map;function ct(e){return Wo(tr(e.doc.document.$media))}function AC(e){let{baseWidth:t,sizeBreakpoints:o}=ct(e),r=e.session.ui.activeMedia;return o.find((i)=>i.name===r)?.width??t}function jr(e,t){let o=Ne.get(e);if(!o)return null;if(!t||o.tabId!==t.id||o.media!==t.session.ui.activeMedia)return Ne.delete(e),null;return o.width}function dA(e,t){let o=t?AC(t):0;return jr(e.paneId,t)??o}function PC(e){Ne.delete(e)}function uA(e){let{baseWidth:t,sizeBreakpoints:o}=ct(e);return[t,...o.map((r)=>r.width)]}function MC(e,t,o){let{sizeBreakpoints:r}=ct(t),i=sn(r,o);return t.session.ui.activeMedia=i,Ne.set(e,{media:i,tabId:t.id,width:o}),i}var ut={invokerTags:qy,popoverTags:Nh};function sL(e,t){if(!e||!t)return null;for(let o=t.length;o>=0;o-=1){let r=t.slice(0,o),i=re(e,r);if(S(i)&&ja(i,ut))return r}return null}function dn(e,t){let o=e.doc.document;if(!o)return null;if(t){let r=re(o,t);return S(r)&&ja(r,ut)?t:null}return sL(o,Pe(e.session.selection))}function fn(){let e=h.value?.doc.document;return e?pM(e,ut):!1}var gn=["toggle-popover","show-popover","hide-popover","show-modal","close","request-close"],dt=new Set(["show-modal","close","request-close"]),pt=new Set(["toggle-popover","show-popover","hide-popover"]),Fr=["any","closerequest","none"],Vr=new Set(gn),Wr=new Set(Fr),Br=new Set(["button"]);function _(e){return $r(e)==="dialog"}function mn(e){return e.startsWith("--")}function zr(e){let t=[];for(let{node:o}of cc(e)){let r=yf(o);if(_(o)&&r!==null&&!t.includes(r))t.push(r)}return t}function hn(e){for(let{node:t}of cc(e))if(_(t))return!0;return!1}function Kr(e){let t=e.oncommand;return t!==void 0&&t!==null}function Gr(e,t){for(let{node:o}of cc(e)){if(o===e)continue;let r=$r(o);if(r==="button"){let i=Is(o,"command"),a=Is(o,"commandfor");if(i!==null&&(i==="close"||i==="request-close")&&(a===null||a===t))return!0}if(r==="form"&&Is(o,"method")?.toLowerCase()==="dialog")return!0}return!1}function zO(e,t){let o=[...cc(e,[],null,t)],r=zr(e),i=Uy(e,t),a=r.length>0||i.length>0,l=new Map,s=new Map;for(let{node:d}of o){let f=yf(d);if(f!==null&&!l.has(f))l.set(f,d);if($r(d)==="button"){let v=Is(d,"commandfor"),y=Is(d,"command");if(v!==null){let b=s.get(v)??new Set;b.add(y??""),s.set(v,b)}}}let c=[];for(let{node:d,path:f}of o)if(c.push(...Zr(d,f,l,r,i,a,t)),_(d))c.push(...Yr(d,f,s));return c}function Zr(e,t,o,r,i,a,l){let s=[],c=$r(e),d=l?.invokerTags?.has(c)??!1,f=Is(e,"command"),v=Is(e,"commandfor");if(!(f!==null||v!==null||("command"in sd(e))||("commandfor"in sd(e))))return s;let b=Ns(e,"the element");if(!Br.has(c)&&!d)return s.push({detail:"`command` and `commandfor` are attributes of `HTMLButtonElement` and of no other "+"interface — not even `<input>`, which `popovertarget` does allow. Elsewhere they parse "+`and do nothing. Make it a <button>, or remove both attributes. ${rr}`,fix:"invoker",message:`<${c||"element"}> carries command/commandfor, which only <button> supports.`,path:t,rule:"invoker-not-button",severity:"error"}),s;if(f!==null&&!Vr.has(f)&&!mn(f))return s.push({detail:`\`command\` is an enumerated attribute taking ${gn.map((E)=>`\`${E}\``).join(", ")}, or a custom command starting with \`--\`. Anything else is the invalid-value state, and a button in that state does nothing when clicked. ${rr}`,message:`${b} declares command="${f}", which is not a built-in or --custom command.`,path:t,rule:"command-invalid",severity:"error"}),s;if(v!==null){let E=o.get(v),k=r.includes(v),O=i.includes(v);if(!E&&a){let H=[...r,...i].map((V)=>`"${V}"`).join(", ");return s.push({detail:`No element in this document has the id "${v}". The dialogs and popovers here are: ${H}. A commandfor that names nothing does nothing, silently. ${rr}`,message:`commandfor="${v}" names nothing in this document.`,path:t,rule:"command-target-missing",severity:"error"}),s}if(f!==null&&E){if(dt.has(f)&&!_(E))s.push({detail:`\`${f}\` acts on a <dialog>, and "${v}" is ${O?"a popover":`a <${$r(E)||"element"}>`}. The click is ignored. ${O?"Use `toggle-popover`, `show-popover` or `hide-popover` for a popover.":"Point it at a dialog, or make the target one."} ${rr}`,message:`${b} sends ${f} to "${v}", which is not a dialog.`,path:t,rule:"command-target-mismatch",severity:"error"});else if(pt.has(f)&&!ja(E,l))s.push({detail:`\`${f}\` acts on a popover, and "${v}" is ${k?"a dialog":`a <${$r(E)||"element"}>`} that declares no \`popover\`. The click is ignored. ${k?"Use `show-modal`, `close` or `request-close` for a dialog.":"Give the target a `popover` attribute, or point the button elsewhere."} ${rr}`,message:`${b} sends ${f} to "${v}", which is not a popover.`,path:t,rule:"command-target-mismatch",severity:"error"});else if(mn(f)&&!Kr(E))s.push({detail:`A custom command is a \`CommandEvent\` dispatched at its target, and "${v}" has no `+"`oncommand` handler to answer it — so the click does nothing. Add one that switches on "+`\`event#/command\`, or use a built-in command. ${rr}`,message:`${b} sends ${f} to "${v}", which handles no command.`,path:t,rule:"custom-command-unhandled",severity:"warn"})}}return s}function Yr(e,t,o){let r=[],i=Ns(e,"the dialog"),a=yf(e),{style:l}=e,s=Is(e,"closedby");if(s!==null&&!Wr.has(s))r.push({detail:`\`closedby\` is an enumerated attribute taking \`any\` (light dismiss and Escape), \`closerequest\` (Escape only, the default for a modal) or \`none\`. Anything else is the invalid-value default, \`auto\`, which is the same as leaving it out. ${rr}`,message:`${i} declares closedby="${s}", which is not any, closerequest or none.`,path:t,rule:"dialog-closedby-invalid",severity:"error"});if(To(l,"display")!==null)r.push({detail:`A closed dialog is hidden by the browser's own \`dialog:not([open]) { display: none }\`. That rule is UA-origin, so any author \`display\` beats it, and the dialog is laid out on every page whether or not anyone opened it. \`display\` belongs in the \`&[open]\` rule and nowhere else. ${rr}`,fix:"display",message:`${i} sets display in its base rule.`,path:t,rule:"dialog-display",severity:"error"});let c=a===null?void 0:o.get(a),d=Is(e,"open")!==null||sd(e).open===!0||e.open===!0;if(a!==null&&!c?.has("show-modal")&&!d)r.push({detail:`No <button> in this document opens it with \`command="show-modal"\`. If it is opened from another file or from a function that calls \`showModal()\`, this is fine; otherwise there is no way for a reader to open it. ${rr}`,message:`${i} has no invoker in this document.`,path:t,rule:"dialog-no-invoker",severity:"warn"});if(c?.has("show-modal")&&s==="none"&&!Gr(e,a))r.push({detail:`A modal dialog makes everything outside it inert, so the only ways out are the ones it offers: \`closedby="none"\` turns off Escape and light dismiss, and nothing inside it closes it. A reader who opens it cannot leave. Add a <button command="close"> inside, or drop \`closedby="none"\`. ${rr}`,message:`${i} opens modally, closes on nothing, and has no close button.`,path:t,rule:"modal-without-close",severity:"error"});return r}function aL(e,t){if(!e||!t)return null;for(let o=t.length;o>=0;o-=1){let r=t.slice(0,o),i=re(e,r);if(S(i)&&_(i))return r}return null}function FC(e,t){let o=e.doc.document;if(!o)return null;if(t){let r=re(o,t);return S(r)&&_(r)?t:null}return aL(o,Pe(e.session.selection))}function vn(){let e=h.value?.doc.document;return e?hn(e):!1}var Xr=/\[\.\.\.(\w+)\]|\[(\w+)\]/g;function yn(e){return e.split("\\").join("/").replace(/^\.\//,"").replace(/^\//,"").replace(/^pages\//,"")}function wo(e){let t=yn(e),o=t.slice(t.lastIndexOf("/")+1),r=o.lastIndexOf(".");if(r>0)t=t.slice(0,t.length-(o.length-r));if(t.endsWith("/index"))t=t.slice(0,-6)||"/";else if(t==="index")t="/";if(!t.startsWith("/"))t=`/${t}`;let i=[],a=!1,l=!1,s=t.replaceAll(Xr,(c,d,f)=>{if(a=!0,d)return l=!0,i.push(d),"*";return i.push(f),`:${f}`});return{isCatchAll:l,isDynamic:a,params:i,urlPattern:s}}function Bc(e){if(!e)return"/";return wo(e).urlPattern}function hl(e){if(!e)return[];return wo(e).params}function nh(e,t){let o=yn(e).split("/");if(!o.every((l)=>l!==""&&l[0]!=="_"))return!1;if(t===void 0)return!0;let r=o.at(-1)??"",i=r.lastIndexOf("."),a=i>0?r.slice(i).toLowerCase():"";return a!==""&&new Set(t).has(a)}function vC(e,t){if(e.isDynamic!==t.isDynamic)return e.isDynamic?1:-1;if(e.isCatchAll!==t.isCatchAll)return e.isCatchAll?1:-1;return e.urlPattern.localeCompare(t.urlPattern)}function Jb(e){let t=e.document?.$paths,o=e.frontmatter?.$paths;return t??o??null}var Ae=new Map;function qO(){Ae.clear()}function wC(e,t){if(!t)return Promise.resolve({});let o=`${e??""}::${JSON.stringify(t)}`,r=Ae.get(o);if(!r)r=Qr(t).catch((i)=>(Ae.delete(o),console.warn("page-params: failed to enumerate $paths values:",i),{})),Ae.set(o,r);return r}async function Qr(e){if(Array.isArray(e)){let t={};for(let o of e)for(let[r,i]of Object.entries(o))Re(t,r,i);return t}if("contentType"in e&&n(e.contentType)&&e.contentType){let t=e.param??"slug",o=e.field??"id",r=await ti(e.contentType),i={[t]:[]};if(!Array.isArray(r))return i;let a=r;for(let l of a)Re(i,t,o==="id"?l.id:l.data?.[o]??l.id);return i}if("values"in e&&Array.isArray(e.values)){let t=e.param??"value",o={[t]:[]};for(let r of e.values)Re(o,t,r);return o}if("$ref"in e&&n(e.$ref)&&e.$ref){let t=e.param??"id",o=e.field??"id",r=await p().readFile(e.$ref.replace(/^\.\//,"")),i=JSON.parse(r),a={[t]:[]};if(!Array.isArray(i))return a;for(let l of i)Re(a,t,m(l)?l[o]??l.id??l:l);return a}return{}}async function ei(){let e=await rd();for(let t of e){let o=t.classes?.find((r)=>r.name==="ContentCollection");if(o)return o.path}return"@jxsuite/parser/ContentCollection.class.json"}async function ti(e){let t={$prototype:"ContentCollection",$src:await ei(),contentType:e},o=p();if(o.resolveClass)return o.resolveClass(t);return fetch("/__jx_resolve__",{body:JSON.stringify(t),headers:{"content-type":"application/json"},method:"POST"}).then((r)=>{if(!r.ok)throw Error(`Class resolution failed: ${r.status}`);return r.json()})}function Re(e,t,o){if(o===null||o===void 0||o==="")return;let r=String(o);e[t]??=[];let i=e[t];if(!i.includes(r))i.push(r)}function xC(e,t,o){if(Object.keys(t).length===0)return e;let r=Pn(e,t);return r.state??={},r.state.$page={params:{...t},title:n(r.title)?r.title:"",url:Bc(o)},r}function _C(e){if(!e)return[];return Object.keys(e).filter((t)=>{let o=e[t];return m(o)&&n(o.$prototype)&&n(o.$src)&&JSON.stringify(o).includes('"#/$params/')})}async function bn(e,t,o){if(t.length===0)return;let r=p(),{resolveClass:i}=r;if(!i)return;let{state:a}=e;if(!a)return;await Promise.all(t.map(async(l)=>{let s=a[l];if(!m(s))return;let c={...s};if(o)c.$base=o;try{a[l]=await i.call(r,c)}catch(d){console.warn(`page-params: failed to resolve state.${l} for preview:`,d)}}))}function Cn(e,t){let o=ni(e,t);if(o!==null)return o;if(Array.isArray(e))return e.map((r)=>Cn(r,t));return m(e)?Pn(e,t):e}function Pn(e,t){let o={};for(let[r,i]of Object.entries(e))o[r]=Cn(i,t);return o}function ni(e,t){if(!Oe(e)||!e.$ref.startsWith("#/$params/"))return null;return t[e.$ref.slice(10)]??null}function G(e){return bt(e.paneId)}function fe(e){let t=Vo(e.paneId);if(t?.kind==="lens")return t.zoom;return G(e)?.session.ui.zoom??1}function Bm(e=vo()){return fe(e)}function $e(e,t){let o=Vo(e.paneId);if(o?.kind==="lens"){o.zoom=t;return}let r=G(e);if(r)r.session.ui.zoom=t}function oi(e){return Boolean(e.canvas&&e.viewport)}function Mp(e,t,o,r=null){let a={_width:r||null,canvas:null,element:null,mediaName:e||"",ready:!1,renderScope:null,scrollContainer:null,viewport:null},l=[];if(r&&!o)l.push(`--panel-viewport-w:${r}px`);if(r)l.push(`--panel-canvas-w:${r}px`);return{item:{fullWidth:o,header:t?"shown":"hidden",key:e??"",label:t??"",mediaAttr:e,widthVars:l.join(";")},panel:a}}function hA(e,t){for(let{item:o,panel:r}of e){let i=(a)=>t.panelNode(o.key,a);r.element=i("panel"),r.viewport=i("panel-viewport"),r.canvas=i("panel-canvas")}}function pA(e,t){let o=e.find((i)=>i.item.key===t);if(!o)return;let r=an(o.panel);if(r)r.session.ui.activeMedia=Te(o.item.mediaAttr)}function ht(e){if(!e.panzoomWrap)return;let t=e.wrap.clientWidth,o=e.panzoomWrap.scrollWidth,r=fe(e),i=t-o*r;e.panX=i>=0?i/2:16,e.panY=0}function vx(e){if(e.centerObserver)e.centerObserver.disconnect(),e.centerObserver=null;if(!e.panzoomWrap)return;e.needsCenter=!0,e.centerObserver=new ResizeObserver(()=>{if(!e.needsCenter){e.centerObserver?.disconnect(),e.centerObserver=null;return}ht(e),Ys(e)}),e.centerObserver.observe(e.panzoomWrap),ht(e)}function Ys(e){if(!e.panzoomWrap)return;let t=fe(e);e.panzoomWrap.style.transform=`translate(${e.panX}px, ${e.panY}px) scale(${t})`,wn("overlays")}var vt=0.25,yt=3;function Tn(e){return Math.min(yt,Math.max(vt,e))}function ri(e,t,o){let r=e.wrap.querySelector('[part="edit-canvas"]'),i=e.panels[0]?.canvas;if(!r||!i)return null;let a=e.wrap.querySelector('[part="edit-column"]'),l=a?Me(a).width:0,s=t&&l>0?l/t:1,c=o;if(c===null){let d=Me(r);c=d.top+d.height/2}return{layoutY:Math.max(0,(c-Me(i).top)/s),scroller:r,zoom:s}}function ah(e=vo(),t=null){if(Ur(e.paneId)!=="edit")return;let[o]=e.panels;if(!o||!oi(o))return;let r=o.canvas,i=r.querySelector("iframe"),a=G(e)?.session.ui.editZoom??1,l=ri(e,o._width??null,t);if(a===1){if(o._width=null,r.style.width="",r.style.transform="",r.style.transformOrigin="",i)i.style.width="100%";o.viewport.style.height=""}else{let s=e.wrap.querySelector('[part="edit-column"]');if(!s)return;let c=Me(s).width;if(c<=0)return;let d=c/a;if(o._width=d,r.style.width=`${d}px`,r.style.transform=`scale(${a})`,r.style.transformOrigin="top left",i)i.style.width=`${d}px`,o.viewport.style.height=`${i.offsetHeight*a}px`}if(l)l.scroller.scrollTop+=l.layoutY*(a-l.zoom);wn("overlays")}function Fp(e,t=vo()){let o=G(t);if(!o)return;o.session.ui.editZoom=Tn(e),ah(t)}var ft=new Map,mt=new Map;function fA(e,t=vo(),o=null){let r=G(t);if(!r)return;if(r.session.ui.editZoom=Tn(e),mt.set(t.paneId,o),ft.has(t.paneId))return;ft.set(t.paneId,requestAnimationFrame(()=>{ft.delete(t.paneId);let i=mt.get(t.paneId)??null;mt.delete(t.paneId),ah(t,i)}))}function ii(e){let t=getComputedStyle(e).getPropertyValue("--boards-inset").trim(),o=Number(t.replace(/px$/,""));return Number.isFinite(o)?o:0}function Mn(e,t,o){if(!e.panzoomWrap)return;let r=e.wrap.clientWidth,i=e.wrap.clientHeight-ii(e.panzoomWrap),a=24,l=32,s=0,{panels:c}=e;for(let de of c)s+=de._width||800;s+=a*Math.max(0,c.length-1)+l;let d=fe(e),y=Me(e.panzoomWrap).height/d+l,b=r/s,E=i/y,k=t==="width"?b:Math.min(b,E),O=Math.min(o,Math.max(K,k));$e(e,O);let H=s*O,V=y*O;e.panX=Math.max(0,(r-H)/2),e.panY=Math.max(0,(i-V)/2),Ys(e)}function mA({maxZoom:e=U,surface:t=vo()}={}){Ie("page",t),Mn(t,"page",e)}var K=0.05,U=5;function Nn(e){return Math.min(U,Math.max(K,e))}var ai="page",xt=["width","page","none"];function si(e,t,o){let r=t[o];if(li(r))return r;if(J(r)&&r>=K&&r<=U)return r;throw RangeError(`command "${e}" argument "${o}": expected ${xt.map((i)=>`"${i}"`).join(" | ")} or a number in [${K}, ${U}], got ${JSON.stringify(r)}`)}function li(e){return n(e)&&xt.includes(e)}var Rn=new Map;function On(e){let t=G(e);if(!t)return null;let o=Vo(e.paneId)?.kind==="lens"?`::${e.paneId}`:"";return`${t.id}::${t.documentPath??""}${o}`}function Ie(e,t){let o=On(t);if(o)Rn.set(o,e)}function jC(e=vo()){let t=On(e);return(t===null?void 0:Rn.get(t))??ai}function An(e,t=vo()){let o=e??jC(t);if(o==="none"){Ys(t);return}if(J(o)){$e(t,Nn(o)),Ys(t);return}Mn(t,o,1)}function lL(e,t=vo()){Ie(e,t),An(e,t)}function Vm(e,t=vo(),o=null){if(!G(t))return;let i=Nn(e),a=i/fe(t);if(Ie(i,t),t.panzoomWrap&&a!==1){let l=Me(t.panzoomWrap),s=Me(t.wrap),c=o?.clientX??s.left+s.width/2,d=o?.clientY??s.top+s.height/2;t.panX+=(c-l.left)*(1-a),t.panY+=(d-l.top)*(1-a),t.needsCenter=!1}$e(t,i),Ys(t)}function HC(e){if(e.wrap.clientWidth<=0){Ys(e);return}An(jC(e),e)}function gA(e=vo()){if(Ie(1,e),!e.panzoomWrap)return;$e(e,1),ht(e),Ys(e)}function $n(e,t){let o=Me(In(e)??e.wrap),r=t.top+t.height/2-o.top;return o.height/2-r}function In(e){return bx(e)?.scrollContainer??null}function ci(e,t,o){let r=In(e);if(!r){kn(e,t);return}let i=r.scrollTop-t;if(o){r.scrollTo({behavior:"smooth",top:i});return}r.scrollTop=i}function BC(e,t=vo()){ci(t,$n(t,e),!1)}function Dn(e,t=vo()){let o=Me(t.wrap);if(e.top>=o.top&&e.top+e.height<=o.top+o.height)return;let r=$n(t,e),i=Math.max(t.panY,0)-t.panY,a=Math.min(r,i);if(a!==0)t.needsCenter=!1,kn(t,a)}function kn(e,t){let o=e.panY,r=o+t,i=performance.now(),a=250,l=(s)=>{let c=Math.min((s-i)/250,1),d=c*(2-c);if(e.panY=o+(r-o)*d,Ys(e),c<1)requestAnimationFrame(l)};requestAnimationFrame(l)}var ui=["edit","design","preview","source","stylebook","tokens","grid","git-diff"],gt=ui.filter((e)=>e!=="git-diff"),ke=new Set(["edit","design"]);function di(e){return ke.has(e)}var cL=["edit","design","preview"];function mi(e){return cL.filter((t)=>e.capabilities.modes.includes(t))}function bA(e){return mi(e).filter((t)=>t!=="preview")}function dL(e){let t=e.session.ui.canvasMode;return di(t)?t:null}function uL(e){return{available:e.capabilities.modes.includes("preview")&&ke.has(e.session.ui.canvasMode),on:e.session.ui.preview===!0}}function hL(e,t,o){if(t==="preview"){if(ke.has(e.session.ui.canvasMode))e.session.ui.preview=!0;return}if(e.session.ui.preview=!1,e.session.ui.canvasMode!==t)o(e,t)}var Sn=new Set(["design","stylebook","git-diff"]),D=(e)=>e.document.open,En=["auto","light","dark"];function gi(e){function t(l){let s=h.value;if(!s)throw RangeError(`command "${l}" needs an open document; no tab is active`);return s}function o(l,s){let{pane:c}=s;if(c===void 0)return t(l);let d=St(l,s,"pane"),f=bt(d);if(!f)throw RangeError(`command "${l}" argument "pane": "${d}" has no open document`);return f}let r={pane:Fe("Which pane to render this way. Defaults to the focused one.")};function i(l){e.renderPane(a(l))}function a(l){let{pane:s}=l;return n(s)?s:g.activePaneId}return[{args:Se({mode:pi(gt,"The canvas mode to switch the active pane to.")}),category:"View",id:"canvas.setMode",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:D,aiTool:{description:"Switch the active document's editor mode. edit and design put its element tree on the canvas, where the document tools work; preview renders it as a visitor sees it; source shows the JSON; stylebook, tokens and grid open other editors. Use it to return a document to edit or design when the tree tools are refused.",name:"set_canvas_mode",report:({after:l,args:s})=>{let c=qn("canvas.setMode",s,"mode",gt),d=l.editor.kind==="canvas"?"the document tools address its element tree":"the tree-editing tools are unavailable until it returns to edit or design";return`The active document is in ${c} mode; ${d}.`}},run:(l,s)=>{let c=qn("canvas.setMode",s,"mode",gt),d=t("canvas.setMode"),{modes:f}=d.capabilities;if(!f.includes(c))throw RangeError(`command "canvas.setMode" argument "mode": "${c}" is not a mode this document `+`supports — it declares: ${f.join(", ")}`);if(c==="preview"){let v=d.session.ui.canvasMode;if(!ke.has(v))throw RangeError(`command "canvas.setMode" argument "mode": "preview" composes with the edit and design base modes; this pane is in "${v}"`);d.session.ui.preview=!0;return}d.session.ui.preview=!1,e.setCanvasMode(d,c)},title:"Set Canvas Mode"},{args:Se({zoom:ER("Pan-zoom scale, 1 = 100%.",{maximum:U,minimum:K})}),category:"View",id:"canvas.setZoom",level:"document",menus:["palette"],group:"3_canvas",requires:"a document on the pan-zoom surface",when:D,enablement:()=>Sn.has(e.getCanvasMode()),run:(l,s)=>{t("canvas.setZoom"),Vm(r_("canvas.setZoom",s,"zoom",K,U))},title:"Set Zoom"},{args:Se({fit:{description:'How the document is framed: "width" | "page" | "none", or a numeric pan-zoom scale.',oneOf:[{enum:[...xt],type:"string"},{maximum:U,minimum:K,type:"number"}]}}),category:"View",id:"canvas.setFit",level:"document",menus:["palette"],group:"3_canvas",requires:"a document on the pan-zoom surface",when:D,enablement:()=>Sn.has(e.getCanvasMode()),run:(l,s)=>{t("canvas.setFit"),lL(si("canvas.setFit",s,"fit"))},title:"Set Fit"},{args:Se({zoom:ER("Edit-mode content zoom, 1 = 100%.",{maximum:yt,minimum:vt})}),category:"View",id:"canvas.setEditZoom",level:"document",menus:["palette"],group:"3_canvas",requires:"a document in edit mode",when:D,enablement:()=>e.getCanvasMode()==="edit",run:(l,s)=>{t("canvas.setEditZoom"),Fp(r_("canvas.setEditZoom",s,"zoom",vt,yt))},title:"Set Edit Zoom"},{args:{additionalProperties:!1,properties:{...r,width:{description:"How wide the Edit column should render, in CSS pixels, or null to go back to the chosen breakpoint's own width.",type:["number","null"]}},required:["width"],type:"object"},category:"View",id:"canvas.setEditWidth",level:"document",menus:["palette"],group:"3_canvas",requires:"a document in edit mode",when:D,enablement:()=>e.getCanvasMode()==="edit",run:(l,s)=>{let c=o("canvas.setEditWidth",s),{width:d}=s;if(d===null){PC(a(s)),i(s);return}MC(a(s),c,r_("canvas.setEditWidth",s,"width",Hm,1e4)),i(s)},title:"Set Edit Width"},{args:{additionalProperties:!1,properties:{...r,media:{description:"A breakpoint key the document renders under, or null for the base rendering.",type:["string","null"]}},required:["media"],type:"object"},category:"View",id:"canvas.setBreakpoint",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:D,run:(l,s)=>{let c=o("canvas.setBreakpoint",s),{media:d}=s;if(d!==null&&!n(d))throw RangeError('command "canvas.setBreakpoint" argument "media": expected a breakpoint key or null');let f=Object.keys(tr(c.doc.document.$media));if(d!==null&&!f.includes(d))throw RangeError(`command "canvas.setBreakpoint" argument "media": "${d}" is not a breakpoint this `+`document defines — it defines: ${f.length>0?f.join(", "):"nothing"}`);c.session.ui.activeMedia=d,i(s)},title:"Set Breakpoint"},{args:Se({...r,scheme:pi(En,"Which color scheme the canvas renders in.")},["scheme"]),category:"View",id:"canvas.setColorScheme",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:D,run:(l,s)=>{let c=o("canvas.setColorScheme",s);c.session.ui.previewColorScheme=qn("canvas.setColorScheme",s,"scheme",En),i(s)},title:"Set Color Scheme"},{args:Se({...r,locale:Fe("BCP 47 tag this pane renders as.")},["locale"]),category:"View",id:"i18n.switchLocale",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document in a project that declares more than one locale",when:(l)=>l.document.open&&l.project.isMultilingual,run:(l,s)=>{let c=o("i18n.switchLocale",s),d=St("i18n.switchLocale",s,"locale"),f=$s();if(f===null||!f.locales.includes(d))throw RangeError(`command "i18n.switchLocale" argument "locale": "${d}" is not a locale this `+`project declares — it declares: ${f===null?"nothing":f.locales.join(", ")}`);c.session.ui.previewLocale=d,i(s)},title:"Set Rendering Language"},{args:Se({...r,visible:Tr("True to draw the page's layout elements, false to hide them.")},["visible"]),category:"View",id:"canvas.setLayoutVisible",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:D,run:(l,s)=>{let c=o("canvas.setLayoutVisible",s);c.session.ui.showLayout=Hi("canvas.setLayoutVisible",s,"visible"),i(s)},title:"Show Layout Elements"},{args:Se({...r,open:Tr("True to draw the popover open, false to close it."),path:{description:"Document path of the popover. Defaults to the popover the selection is in or at.",items:{type:["string","number"]},type:"array"}},[]),category:"View",enablement:()=>fn(),group:"3_canvas",id:"canvas.setPopoverOpen",level:"document",menus:["palette"],requires:"a popover in the open document",run:(l,s)=>{let c=o("canvas.setPopoverOpen",s),d=s.path,f=s.open===void 0?!0:Hi("canvas.setPopoverOpen",s,"open");if(!f&&d===void 0){e.setOpenPopover(c,null);return}let v=dn(c,d);if(v===null)throw RangeError('command "canvas.setPopoverOpen" argument "path": names no popover in this document — '+"a popover is an element with a `popover` attribute, and <dialog> is not one");e.setOpenPopover(c,f?v:null)},title:"Show Popover",when:D},{args:Se({...r,open:Tr("True to draw the dialog open, false to close it."),path:{description:"Document path of the dialog. Defaults to the dialog the selection is in or at.",items:{type:["string","number"]},type:"array"}},[]),category:"View",enablement:()=>vn(),group:"3_canvas",id:"canvas.setDialogOpen",level:"document",menus:["palette"],requires:"a dialog in the open document",run:(l,s)=>{let c=o("canvas.setDialogOpen",s),d=s.path,f=s.open===void 0?!0:Hi("canvas.setDialogOpen",s,"open");if(!f&&d===void 0){e.setOpenDialog(c,null);return}let v=FC(c,d);if(v===null)throw RangeError('command "canvas.setDialogOpen" argument "path": names no dialog in this document — '+"a dialog is a <dialog> element, and a popover is not one");e.setOpenDialog(c,f?v:null)},title:"Show Dialog",when:D},{args:{additionalProperties:!1,properties:{...r,open:{default:!0,description:"True to open the resolving-with popover, false to close it.",type:"boolean"}},required:[],type:"object"},category:"View",id:"canvas.setResolvingOpen",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:D,run:(l,s)=>{o("canvas.setResolvingOpen",s);let{open:c,pane:d}=s;e.setResolvingOpen(n(d)?d:g.activePaneId,c===void 0||Hi("canvas.setResolvingOpen",s,"open"))},title:"Show Resolving Values"},{args:{additionalProperties:!1,properties:{...r,name:Fe("The prop's name, as the component's state declares it."),value:{description:"The test value — any JSON. Null clears it and the prop returns to its default.",type:["string","number","boolean","array","object","null"]}},required:["name"],type:"object"},category:"View",id:"canvas.setTestProp",level:"document",menus:["palette"],group:"3_canvas",requires:"an open component document",when:D,run:(l,s)=>{let c=o("canvas.setTestProp",s),d=St("canvas.setTestProp",s,"name"),f=Object.keys(c.doc.document.state??{});if(!f.includes(d))throw RangeError(`command "canvas.setTestProp" argument "name": "${d}" is not a prop this component `+`declares — it declares: ${f.length>0?f.join(", "):"nothing"}`);let{value:v}=s,y={...c.session.ui.previewProps};if(v===null||v===void 0)delete y[d];else y[d]=v;c.session.ui.previewProps=Object.keys(y).length>0?y:null,i(s)},title:"Set Test Value"},{args:{additionalProperties:!1,properties:{...r,name:Fe("The route parameter's name, without brackets."),value:Fe("The value to preview the route with. Empty clears it.")},required:["name","value"],type:"object"},category:"View",id:"canvas.setRouteParam",level:"document",menus:["palette"],group:"3_canvas",requires:"an open page with a dynamic route",when:D,run:(l,s)=>{let c=o("canvas.setRouteParam",s),d=St("canvas.setRouteParam",s,"name"),f=hl(c.documentPath);if(!f.includes(d))throw RangeError(`command "canvas.setRouteParam" argument "name": "${d}" is not a parameter of this `+`route — it has: ${f.length>0?f.join(", "):"none"}`);c.session.ui.previewParams={...c.session.ui.previewParams,[d]:St("canvas.setRouteParam",s,"value")},i(s)},title:"Set Route Parameter"}]}function yA(e,t){e.registerAll(gi(t))}function wx(e=vo()){let t=ul(e.paneId),o=e.panels;for(let r of o){let i=r.element?.querySelector('[part="panel-header"]');if(i){let a=t===null&&r.mediaName==="base"||t===r.mediaName;i.toggleAttribute("data-active",a)}}}var Ct="jx:canvas";function Hn(e){let{target:t,source:o,targetOrigin:r,acceptOrigin:i,token:a}=e,l=new Set,s=(c)=>{if(i!=="*"&&c.origin!==i)return;let d=c.data;if(!S(d)||!(Ct in d)||d[Ct]!==a)return;let f="payload"in d?d.payload:void 0;for(let v of l)v(f)};return o.addEventListener("message",s),{dispose(){l.clear(),o.removeEventListener("message",s)},onMessage(c){return l.add(c),()=>l.delete(c)},post(c){t.postMessage({[Ct]:a,payload:c},r)}}}var Pt=null;function Ln(){return Pt}function Kb(e){if(Pt){Pt(e);return}window.open(e,"_blank","noopener,noreferrer")}function Gb(e,t,o,r=null,i=null,a=[]){if(!e.state)e.state={};let l={};if(i!==null)l.defaultLocale=i.defaultLocale,l.locales=i.locales;e.state.$site={name:t.name??"Jx Site",url:t.url??"",...l,...t.state};let s=(n(e.$lang)?e.$lang:void 0)??tP(o.urlPattern,i)??t.defaults?.lang,c=a.map((f)=>({code:f.locale,current:f.urlPattern===o.urlPattern,dir:vy(f.locale),label:Wt(f.locale),url:f.urlPattern})),d={params:o._pathParams??{},title:e.title??e._pageTitle??t.name??"",url:o.urlPattern};if(c.length>0)d.alternates=c;if(o.pagination){let{first:f,itemCount:v,last:y,next:b,number:E,pageCount:k,pageSize:O,pages:H,prev:V}=o.pagination;d.pagination={first:f,itemCount:v,last:y,next:b,number:E,pageCount:k,pageSize:O,pages:H.map(({current:de,number:oe,url:P})=>({current:de,number:oe,url:P})),prev:V}}if(s!==void 0)d.dir=vy(s),d.locale=s;if(e.state.$page=d,t.state){for(let[f,v]of Object.entries(t.state))if(f!=="$site"&&f!=="$page"&&!(f in e.state))e.state[f]=v}if(t.$media)e.$media={...t.$media,...e.$media};if(t.imports&&Object.keys(t.imports).length>0){if(!e.imports)e.imports={};for(let[f,v]of Object.entries(t.imports))if(!(f in e.imports))e.imports[f]=r&&(v.startsWith("./")||v.startsWith("../"))?r(v,o):v}if(t.$elements?.length)if(!e.$elements?.length)e.$elements=[...t.$elements];else{let f=new Set,v=[];for(let y of[...t.$elements,...e.$elements]){let b=n(y)?y:S(y)?y.$ref:void 0;if(b&&!f.has(b))f.add(b),v.push(y)}e.$elements=v}return e}var vi=new Set(["img","video","source","iframe","audio"]),_n="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",wt="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3E%3Crect%20width='32'%20height='32'%20fill='%23d0d0d0'/%3E%3C/svg%3E";function UO(e,t){e.addEventListener("error",(o)=>{let{target:r}=o;if(r instanceof HTMLImageElement&&r.getAttribute("src")!==wt)r.setAttribute("src",wt),r.removeAttribute("srcset"),r.dataset.placeholder=""},{capture:!0,signal:t})}var yi=/(src|poster|image|bg|background|icon|logo|photo|avatar|thumbnail|cover|banner)$/i;function Fn(e){return yi.test(e)}var xi=/(?<![\w$.])(?:item|index|\$map)\b/u;function Y(e){if(n(e))return e.includes("${")&&xi.test(e);return Jn(e)&&n(e.$ref)&&/^(?:#\/)?\$map\//u.test(e.$ref)}function Je(e,t){if(e==="href"||e==="action")return"";if(Fn(e))return wt;if(n(t))return He(t);return Jn(t)&&n(t.$ref)?Un(t.$ref):""}var bi=new Set(["p","h1","h2","h3","h4","h5","h6","blockquote","li","dt","dd","th","td","span","strong","em","small","mark","code","abbr","q","sub","sup","time","a","button","label","legend","caption","summary","pre","option"]),Ci=new Set(["div","section","article","aside","header","footer","main","nav","figure","figcaption","details","fieldset","form","ul","ol","dl","table"]);var Pi=["width","height","inlineSize","blockSize"];function Si(e){let{style:t}=e;if(!S(t))return!1;return Pi.some((o)=>{let r=t[o],i=J(r)?String(r):n(r)?r.trim():"";return i!==""&&i!=="auto"})}function wi(e){if(!e.tagName||e.textContent||e.innerHTML)return null;if(e.$__layout)return null;if(Array.isArray(e.children)&&e.children.length>0)return null;if(ur(e.children))return null;if(Si(e))return null;if(bi.has(it(e.tagName)))return"empty-text-placeholder";if(Ci.has(it(e.tagName)))return"empty-container-placeholder";return null}function He(e){return e.replaceAll(/\$\{([^}]+)\}/g,"❪ $1 ❫")}function Ei(e){return He(e.replaceAll(/\s*\?\?\s*\[\s*\]\s*(?=\})/gu,""))}function Ti(e,t){let o=e.map;return{children:S(o)?[q(o,Mi(e.items,t))]:[],className:"repeater-perimeter",tagName:"div"}}function Vn(e){return JSON.stringify(e)}function Wn(e){let t=e.startsWith("#/")?e.slice(2):e,[o,...r]=t.split("/"),i=o==="state"||o==="$map"?o:null;if(i===null)return null;let a=r.map((l)=>l.replaceAll("~1","/").replaceAll("~0","~"));return i+a.map((l)=>`?.[${Vn(l)}]`).join("")}function Et(e,t){if(t===null)return`(${e})`;return`((r) => ((item, index, $map) => (${e}))(r, 0, { index: 0, item: r }))(${t})`}function Mi(e,t){if(Array.isArray(e))return`${Vn(e)}[0]`;if(Oe(e)){let r=Wn(e.$ref);return r===null?null:`${Et(r,t)}?.[0]`}let o=n(e)?Bn(e):[];if(n(e)&&o.length===1&&Ni(e,o[0]))return`${Et(o[0].expr,t)}?.[0]`;return null}function Ni(e,t){return t.start===0&&t.end===e.length-1}function Bn(e){let t=[],o=e.indexOf("${");while(o!==-1){let r=0,i=-1;for(let a=o+1;a<e.length;a+=1)if(e[a]==="{")r+=1;else if(e[a]==="}"){if(r-=1,r===0){i=a;break}}if(i===-1)break;t.push({end:i,expr:e.slice(o+2,i),start:o}),o=e.indexOf("${",i+1)}return t}function zn(e,t=null){let o=Bn(e);if(o.length===0)return e;let r="",i=0;for(let{start:a,end:l,expr:s}of o)r+=e.slice(i,a),r+=`\${(() => { try { return ${Et(s,t)}; } catch { return ""; } })()}`,i=l+1;return r+e.slice(i)}function Ri(e,t){let o=e.startsWith("#/")?e.slice(2):e;if(o!=="$map"&&!o.startsWith("$map/"))return{$ref:e};let r=Wn(e);return t===null||r===null?void 0:zn(`\${${r}}`,t)}function Un(e){return`{${e.startsWith("#/state/")?e.slice(8):e}}`}function Tt(e,t=null){return q(e,t)}function q(e,t){if(Array.isArray(e))return e.map((s)=>q(s,t));if(!Jn(e))return e;if(e.$prototype==="Array")return Ti(e,t);let o=e,r={},i=!1,a=n(o.tagName)&&vi.has(o.tagName);if(a){let{attributes:s,src:c}=o,d=s?.src,f=o.poster,v=s?.poster;if(!(c&&c!==""||d&&d!=="")&&!(f&&f!==""||v&&v!==""))i=!0}for(let[s,c]of Object.entries(o))if(s==="state"||s==="$media"||s==="$elements")r[s]=c;else if(s==="$props"&&nu(c)){let d={};for(let[f,v]of Object.entries(c))if(!Y(v))d[f]=v;else if(n(v))d[f]=Fn(f)||f==="href"||f==="action"?Je(f,v):zn(v,t);else if(Oe(v)){let y=Ri(v.$ref,t);if(y!==void 0)d[f]=y}else d[f]=v;r[s]=d}else if(s==="children"){if(Array.isArray(c))r.children=c.map((d)=>q(d,t));else if(Jn(c)&&c.$prototype==="Array")r.children=[q(c,t)];else if(!ur(c))r.children=q(c,t)}else if(s==="cases"&&o.$switch&&nu(c)){let[d]=Object.entries(c);if(d){let[,f]=d;r.children=nu(f)&&!(Jn(f)&&f.$ref)?[q(f,t)]:[{style:{background:"color-mix(in srgb, var(--danger) 8%, transparent)",border:"1px dashed color-mix(in srgb, var(--danger) 40%, transparent)",borderRadius:"4px",color:"var(--danger)",fontFamily:"'JetBrains Mono', 'SF Mono', 'Fira Code', monospace",fontSize:"11px",fontStyle:"italic",padding:"6px 10px"},tagName:"div",textContent:`[$switch: ${Object.keys(c).join(" | ")}]`}]}}else if(s==="attributes"&&a&&nu(c)){let d={};for(let[f,v]of Object.entries(c))if((f==="src"||f==="poster")&&(v===""||v==null||Y(v)))i=!0,d[f]=_n;else d[f]=Y(v)?Je(f,v):v;r.attributes=d}else if(s==="attributes"&&nu(c)){let d={};for(let[f,v]of Object.entries(c))d[f]=Y(v)?Je(f,v):v;r.attributes=d}else if(s==="style")if(nu(c)){let d={};for(let[f,v]of Object.entries(c))if(!Y(v))d[f]=v;r.style=d}else r.style=c;else if(s==="$switch"&&n(c)&&c.includes("${"))r[s]=He(c);else if(s==="textContent"&&n(c)&&c.includes("${"))r[s]=He(c);else if(s==="textContent"&&Jn(c)&&c.$ref)r[s]=Un(c.$ref);else if(a&&(s==="src"||s==="poster"))if(c===""||c==null||Y(c))i=!0,r[s]=_n;else r[s]=c;else if(Y(c))r[s]=Je(s,c);else if(n(c)||Jn(c)&&c.$ref)r[s]=c;else r[s]=q(c,t);if(ur(o.children)){r.textContent=Ei(o.children);let{attributes:s}=r;r.attributes=nu(s)?{...s,contenteditable:"false"}:{contenteditable:"false"}}let l=wi(r);if(l)r.className=r.className?`${r.className} ${l}`:l;if(i){let s=n(r.className)?r.className:"";if(!s.includes("empty-media-placeholder"))r.className=s?`${s} empty-media-placeholder`:"empty-media-placeholder"}return r}function SC(e){let t=e?.tagName;return n(t)&&t.includes("-")}function Oi(e){return S(e)&&!Array.isArray(e)}function Gn(e){if(e===void 0)return null;if(Oi(e)){if(e.$expression||e.$compute||e.$prototype||e.$handler)return null;return"default"in e||"type"in e?"signal":"literal"}return n(e)&&e.includes("${")?null:"literal"}function KO(e){let t=e?.state??{},o=[];for(let[r,i]of Object.entries(t)){if(cd(r))continue;let a=Gn(i);if(!a)continue;let l=a==="signal"?i.default:i;o.push({name:r,value:l})}return o}function Zn(e,t){let o={...e.state},r=!1;for(let[i,a]of Object.entries(t)){let l=o[i],s=Gn(l);if(!s)continue;o[i]=s==="signal"?{...l,default:a}:a,r=!0}if(!r)return e;return{...e,state:o}}var Ai=new Set(["data","media","metadata","news","series","species"]),$i=new Set(["archive","catalog","catalogue","collection","directory","faq","gallery","inventory","library","menu","portfolio","showcase"]);function CC(e){return e.replaceAll(/[_-]+/g," ").replaceAll(/([a-z\d])([A-Z])/g,"$1 $2").trim().replaceAll(/\s+/g," ").toLowerCase()}function ih(e){let t=/[_-]|[a-z\d][A-Z]/.test(e)?CC(e):e,o=t.lastIndexOf(" "),r=t.slice(o+1);if($i.has(r.toLowerCase()))return`${t} item`;return`${t.slice(0,o+1)}${Ii(r)}`}function Ii(e){if(Ai.has(e.toLowerCase()))return e;if(/[^aeiou]ies$/.test(e))return`${e.slice(0,-3)}y`;if(/(?:ss|x|ch|sh|z)es$/.test(e))return e.slice(0,-2);if(/(?:us|is|ss)$/.test(e))return e;if(e.endsWith("s"))return e.slice(0,-1);return e}function Yb(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Zb(e){return(e.replaceAll("\\","/").split("/").pop()??e).replace(/\.[^.]+$/,"").replaceAll(/[-_]+/g," ").replaceAll(/\b\w/g,(o)=>o.toUpperCase())}var hi="pages";function Mt(){return x?.projectConfig?.content??{}}function Yn(e){return e!==void 0&&/\.[\da-z]+$/i.test(e.replace(/\/+$/,""))}var Di={fileBacked:!1,item:"page",key:hi,kind:"pages",title:"Pages"};function Fm(){let e=Object.entries(Mt()).map(([t,o])=>({fileBacked:Yn(o.source),item:ih(t),key:t,kind:"collection",title:Yb(CC(t))}));return[Di,...e]}function tL(){return Fm().map((e)=>e.key)}function fx(e){let t=Mt()[e]?.source;return t!==void 0&&Yn(t)?t.replace(/^\.\//,""):null}function GO(e){return Mt()[e]?.schema??null}function ec(e){return Fm().find((t)=>t.key===e)??null}function tc(e){if(!e)return null;let t=e.replaceAll("\\","/").replace(/^\.\//,"");if(la.has(Ot(t)))return null;if(t.startsWith("pages/"))return nh(t)?hi:null;return Kn(t)?.name??null}function rh(e){if(!e)return!1;let t=Kn(e);if(!t||t.fileBacked)return!1;let o=Ot(e);return o!==".json"&&o!==".csv"}function JO(e,t){if(e===void 0||t)return{entries:!0,pages:!0,scan:!0};let o=e.map((r)=>r.replaceAll("\\","/").replace(/^\.\//,""));return{entries:o.some((r)=>{let i=tc(r);return i!==null&&i!==hi}),pages:o.some((r)=>r.startsWith("pages/")),scan:!1}}function ki(e,t,o){let r=e?.state??t?.state,i=`#/$params/${o}`;for(let a of Object.values(m(r)?r:{})){if(!m(a)||a.$prototype!=="ContentEntry")continue;let{contentType:l,id:s}=a;if(m(s)&&s.$ref===i&&n(l)&&l!=="")return l}return null}function kC(e,t){let o=Jb({document:e,frontmatter:t}),r=null,i=null,a=null,l=null;if(o&&!Array.isArray(o)&&"contentType"in o){let d=o.contentType;r=n(d)&&d!==""?d:null;let f="param"in o?o.param:void 0;i=n(f)&&f!==""?f:null;let v="field"in o?o.field:void 0;a=n(v)&&v!==""&&v!=="id"?v:null}else if(o&&!Array.isArray(o)&&"values"in o){let d="param"in o?o.param:void 0,f=n(d)&&d!==""?d:null;r=f===null?null:ki(e,t,f),i=r===null?null:f;let v=o.values;l=r!==null&&Array.isArray(v)?v.flatMap((y)=>{let b=Rt(y);return b===null?[]:[b]}):null}let s=e?.$layout??t?.$layout,c=n(s)||s===!1?s:void 0;return{contentType:r,field:a,layout:c,param:i,...l!==null&&{values:l}}}async function nL(e){let t={contentType:null,field:null,layout:void 0,param:null};try{let o=await p().readFile(e);if(e.endsWith(".json"))return kC(JSON.parse(o),null);let{parseSourceForPath:r}=await (ce("6a49er4c"),import("./file-ops-6a49er4c.js")),i=await r(e,o);return kC(i.document,i.frontmatter)}catch{return t}}var W=null,ge=null,Nt=0,Le=new Set;async function Xn(e,t){let o;try{o=await p().listDirectory(e)}catch{return}await Promise.all(o.map(async(r)=>{if(r.type==="directory")await Xn(r.path,t);else t.push(r.path)}))}async function Ji(){let e=[];await Xn("pages",e);let t=e.filter((a)=>a.includes("[")&&nh(a)).toSorted(),o=await Promise.all(t.map(async(a)=>[a,await nL(a)])),{i18n:r}=ln(x?.projectConfig??{}),i=new Map;for(let[a,l]of o)if(l.contentType){let s={field:l.field,layout:l.layout,locale:qx(a,r),param:l.param,path:a,pattern:wo(a).urlPattern,...l.values&&{values:l.values}};i.set(l.contentType,[...i.get(l.contentType)??[],s])}return i}function At(){if(W)return Promise.resolve(W);if(!ve()||!x)return Promise.resolve(new Map);if(!ge){let e=Nt;ge=Ji().then((t)=>{if(e===Nt){W=t,ge=null;for(let o of Le)o()}return t})}return ge}function Qn(e,t){if(!e||e.length===0)return null;let o=jn(t),r=ln(x?.projectConfig??{}).i18n?.defaultLocale??null;return(o===null?void 0:e.find((i)=>i.locale===o))??(r===null?void 0:e.find((i)=>i.locale===r))??e.find((i)=>i.locale===null)??e[0]}function Vc(e){if(!e)return null;return gr(e,ln(x?.projectConfig??{}).i18n)}function oh(e,t){if(!W){At();return}return Qn(W.get(e),t)}function YO(e){if(!W){At();return}return W.get(e)??[]}async function _e(e,t){let o=await At();return Qn(o.get(e),t)}function Xb(){Nt+=1,W=null,ge=null}function Op(e){return Le.add(e),()=>{Le.delete(e)}}function Rt(e){if(n(e)&&e!=="")return e;return J(e)&&Number.isFinite(e)?String(e):null}function EC(e,t,o){if(!e)return null;let r=t.split("/").pop()??t,i=r.lastIndexOf("."),a=i>0?r.slice(0,i):r,l=e.field===null?null:Rt(o?.[e.field]),s=t.endsWith(".json")?Rt(o?.id):null,c=l??s??a;if(e.values&&!e.values.includes(c))return null;if(e.param)return e.pattern.replace(`:${e.param}`,c);return e.pattern.replace(/:[A-Za-z_]\w*/,c)}function TC(e,t){if(e===!1)return null;if(n(e)&&e!=="")return e;if(t?.layout===!1)return null;if(n(t?.layout)&&t.layout!=="")return t.layout;return x?.projectConfig?.defaults?.layout??null}function ZO(){Xb(),Le.clear()}function $C(e){return e.startsWith("pages/")||e.startsWith("./pages/")}function Li(e,t){let o=t.split("/"),r={};for(let[i,a]of e.split("/").entries()){let l=o[i];if(a.startsWith(":")&&l!==void 0)r[a.slice(1)]=l}return r}async function _i(e){let{documentPath:t,fields:o,isEntry:r,params:i}=e;if(!r)return{_pathParams:{...i},sourcePath:t,urlPattern:Bc(t)};let a=Kn(t),l=a?await _e(a.name,Vc(t)):null,s=EC(l,t,o);if(!l||s===null)return{_pathParams:{},sourcePath:t,urlPattern:l?.pattern??"/"};return{_pathParams:Li(l.pattern,s),sourcePath:l.path,urlPattern:s}}async function LC(e,t){if(!t)return null;let o=await _i(e),r=e.fields?.title,i=n(e.title)?e.title:n(r)?r:null,a={state:{}};if(i!==null)a.title=i;if(n(e.lang))a.$lang=e.lang;let l=Gb(a,t,o,null,ln(t).i18n),{$page:s,$site:c}=l.state??{};return s===void 0||c===void 0?null:{$page:s,$site:c}}var je=new Map;function RC(){je=new Map}function Fi(e){if(!e.startsWith("#/state/"))return null;let[t]=e.slice(8).split("/");return t?t.replaceAll("~1","/").replaceAll("~0","~"):null}function $t(e){if(n(e))return e.includes("${");if(Array.isArray(e))return e.some((t)=>$t(t));return m(e)&&Object.values(e).some((t)=>$t(t))}function eo(e,t){if(n(e.$src))return e.$src;return n(e.$prototype)&&Object.hasOwn(t,e.$prototype)?t[e.$prototype]??null:null}function It(e,t={}){return m(e)&&n(e.$prototype)&&eo(e,t)!==null&&!$t(e)}function to(e,t){return Object.entries(e.state??{}).filter(([,o])=>m(o)&&!n(o.$src)&&It(o,t)).map(([o])=>o)}function no(e){let t=new Set,o=(i)=>{if(Array.isArray(i)){for(let a of i)o(a);return}if(!Jn(i))return;if(i.$prototype==="Array"&&Oe(i.items)){let a=Fi(i.items.$ref);if(a)t.add(a)}o(i.map),o(i.children);for(let a of Object.values(i.cases??{}))o(a)};o(e.children);let r=e.state??{};return[...t].filter((i)=>It(r[i]))}function qi(e,t){return console.warn(`canvas: could not resolve state.${e} before the render:`,t),null}async function io(e,t,o,r={}){let i=p(),{resolveClass:a}=i,l=e.state;if(t.length===0||!a||!l)return e;let s={...l};return await Promise.all(t.map(async(c)=>{let d=s[c];if(!It(d,r))return;let f={...d,$src:eo(d,r)};if(o)f.$base=o;let v=JSON.stringify(f),y=je.get(v);if(!y)y=a.call(i,f).then((E)=>E??null,(E)=>(je.delete(v),qi(c,E))),je.set(v,y);let b=await y;if(b!==null)s[c]=b})),{...e,state:s}}function ao(e,t=[]){if(!S(e))return null;if(Array.isArray(e.children)){let o=e.children.findIndex((r)=>S(r)&&!r.$__layout);if(o!==-1)return{offset:o,prefix:[...t,"children"]};for(let r=0;r<e.children.length;r++){let i=e.children[r];if(S(i)&&i.$__layout){let a=ao(i,[...t,"children",r]);if(a)return a}}}return null}function Dt(e,t,o=[]){if(!S(e))return;if(e.$__layout={file:t,path:o},Array.isArray(e.children))for(let[r,i]of e.children.entries()){if(n(i))continue;Dt(i,t,[...o,"children",r])}if(Array.isArray(e.$elements)){for(let[r,i]of e.$elements.entries())if(!n(i))Dt(i,t,[...o,"$elements",r])}}async function so(e,t=new Set){let o=e.replace(/^\.\//,"");if(t.has(o))return null;t.add(o);let r=await Rx(e);if(!r)return null;Dt(r,o);let i=r.$layout;if(!n(i)||!i)return r;let a=await so(i,t);if(!a)return r;let l=qL(a,r);return delete l.$layout,l}function Bi(e,t){for(let o of e??[]){if(!S(o)||!n(o.$ref)||!/^\.\.?\//.test(o.$ref))continue;let r=o.$__layout;if(!m(r)||!n(r.file))continue;let i=new URL(o.$ref,`jx-project:/${r.file}`).pathname.replace(/^\//,"");o.$ref=qc(t,i)}}function lo(e,t){if(e.$layout!==void 0)return e.$layout;let o=t?.doc.content.frontmatter.$layout;return n(o)||o===!1?o:void 0}async function zi(e,t,o){let r=lo(e,t),i=o?Kn(o):null,a=i?await _e(i.name,Vc(o)):null;return TC(r,a)}async function co(e,t,o=null){let r={documentPath:t?.documentPath,mode:t?.doc.mode},i=o??Ta(t),a=i==="preview"?structuredClone(le(e)):Tt(nf(e)),l=!1,s=r.documentPath&&x?.isSiteProject&&$C(r.documentPath),c=!s&&Boolean(x?.isSiteProject)&&rh(r.documentPath),d=null,f=0;if((s||c)&&t?.session.ui.showLayout!==!1){let P=c?await zi(e,t,r.documentPath):fl(lo(e,t));if(P){let N=await so(P);if(N){let L=i==="preview"?structuredClone(le(e)):a,T=qL(N,L);if(a=i==="preview"?T:Tt(nf(T)),l=!0,r.documentPath)Bi(a.$elements,r.documentPath);let A=ao(T);d=A?.prefix??null,f=A?.offset??0}}}let v=x?.projectConfig;if(s&&v){if(a={...a,state:{...a.state}},a.imports)a.imports={...a.imports};Gb(a,v,{urlPattern:Bc(r.documentPath)})}let y=oc(x?.projectRoot),b=r.documentPath?new URL(r.documentPath,y).href:void 0,E=gy(r.documentPath,fh());if(s&&t){let{previewParams:P}=t.session.ui;if(Object.keys(P).length>0){let N=_C(e.state??null);a=xC(a,P,r.documentPath),await bn(a,N,b)}}if((s||c)&&r.documentPath){let P=await LC({documentPath:r.documentPath,fields:c?t?.doc.content.frontmatter??null:null,isEntry:c,lang:e.$lang,params:t?.session.ui.previewParams??{},title:e.title},x?.projectConfig);if(P)a={...a,state:{...a.state,...P}}}let k=await rd(),O=UL(k),H=to(a,O);if(i!=="preview")H.push(...no(e));if(a=await io(a,[...new Set(H)],b,O),!s&&t&&SC(a)){let{previewProps:P}=t.session.ui;if(P&&Object.keys(P).length>0)a=Zn(a,P)}let V=new Set;if(i!=="preview")(function P(N,L){if(!S(N))return;if(N.$prototype==="Array"){V.add(L.join("/"));let T=N.map;if(S(T))P(T,[...L,"map"]);return}if(Array.isArray(N.children))for(let[T,A]of N.children.entries()){if(n(A))continue;P(A,[...L,"children",T])}else if(Rr(N.children))P(N.children,[...L,"children"]);if(N.$switch&&N.cases)for(let[T,A]of Object.entries(N.cases))P(A,[...L,"cases",T])})(e,[]);let de=r.documentPath!=null&&(r.documentPath.startsWith("layouts/")||r.documentPath.startsWith("./layouts/")),oe=$x(a.$elements);if((r.mode==="content"||l||de)&&De.length>0){let P=new Set(oe.map((T)=>S(T)?T.$ref:T)),N=new Map(De.map((T)=>[T.tagName,T])),L=KC(a);if(a.tagName)L.add(it(a.tagName));for(let T of L)for(let A of N.get(T)?.uses??[])L.add(A);for(let T of L){let A=N.get(T);if(A&&A.source!=="npm"&&A.path){let rt=qc(r.documentPath??null,A.path);if(!P.has(rt))oe.push({$ref:rt}),P.add(rt)}}}if(oe.length>0)a.$elements=oe;return a.imports=SA(a.imports,k),a.$media=tr(a.$media),a.$head=Lx(a.$head),{assets:E,docBase:b,mapperCtx:{arrayPaths:[...V],canvasMode:i,layoutWrapped:l,pageContentOffset:f,pageContentPrefix:d},renderDoc:a,siteStyle:x?.projectConfig?.style??null}}function ji(e){if(e==="--")return"Base";return e.replace(/^--/,"").replaceAll("-"," ").replaceAll(/\b\w/g,(t)=>t.toUpperCase())||e}var uo=new Set(["script","style","link","iframe","object","embed"]);function sh(e){let t={tagName:e};if(/^h[1-6]$/.test(e))t.textContent="Heading";else if(e==="p")t.textContent="Paragraph text";else if(e==="span"||e==="strong"||e==="em"||e==="small"||e==="mark"||e==="code"||e==="abbr"||e==="q"||e==="sub"||e==="sup"||e==="time")t.textContent="Text";else if(e==="a")t.textContent="Link",t.attributes={href:"#"};else if(e==="button")t.textContent="Button";else if(e==="label")t.textContent="Label";else if(e==="legend")t.textContent="Legend";else if(e==="caption")t.textContent="Caption";else if(e==="summary")t.textContent="Summary";else if(e==="li"||e==="dt"||e==="dd"||e==="th"||e==="td"||e==="option")t.textContent="Item";else if(e==="blockquote")t.textContent="Quote";else if(e==="pre")t.textContent="Preformatted text";else if(e==="input")t.attributes={placeholder:"Enter text...",type:"text"};else if(e==="img")t.attributes={alt:"Image"};else if(e==="iframe")t.attributes={src:""};else if(e==="slot")t.children=[{tagName:"p",textContent:"Slot content"}];else if(e==="select")t.children=[{tagName:"option",textContent:"Option 1"}];else if(e==="ul"||e==="ol")t.children=[{tagName:"li",textContent:"Item"}];else if(e==="dl")t.children=[{tagName:"dt",textContent:"Term"},{tagName:"dd",textContent:"Definition"}];else if(e==="table")t.children=[{children:[{children:[{tagName:"th",textContent:"Header"}],tagName:"tr"}],tagName:"thead"},{children:[{children:[{tagName:"td",textContent:"Cell"}],tagName:"tr"}],tagName:"tbody"}];else if(e==="details")t.children=[{tagName:"summary",textContent:"Summary"},{tagName:"p",textContent:"Detail content"}];return t}function kt(e){return S(e)&&n(e.$ref)?e.$ref:null}function Ve(e){if(e.source!=="npm"||!e.package)return null;return e.modulePath?`${e.package}/${e.modulePath}`:e.package}function Ki(e,t){let o=Ve(e);if(o)return o;return e.path?{$ref:qc(t,e.path)}:null}function rL(e,t,o){let r=Ve(t);if(r)return e.some((a)=>n(a)&&(a===r||a===t.package));if(!t.path)return!1;let i=ie(qc(o,t.path));return e.some((a)=>{let l=kt(a);return l!==null&&ie(l)===i})}function ie(e){return e.replace(/^(?:\.\/)+/,"")}function Qb(e,t,o){let r=Ki(t,o);if(!r)return[...e];let a=Ve(t)&&t.modulePath?e.filter((l)=>l!==t.package):[...e];return rL(a,t,o)?a:[...a,r]}function oL(e,t,o){let r=Ve(t);if(r)return e.filter((a)=>!(n(a)&&(a===r||a===t.package)));if(!t.path)return[...e];let i=ie(qc(o,t.path));return e.filter((a)=>{let l=kt(a);return l===null||ie(l)!==i})}function eA(e,t){return e.filter((o)=>!n(o)||!(o===t||o.startsWith(`${t}/`)))}function tA(e,t){let o=ie(t);return e.filter((r)=>{let i=kt(r);return i===null||ie(i)!==o})}var Ui="Components";function Ap(e,t){let o=Gi(e,t);if(o)Xe(e,[],"$elements",o)}function Gi(e,t){if(!n(t)||!t.includes("-"))return null;let o=De.find((a)=>a.tagName===t);if(!o)return null;let r=e.doc.document.$elements??[],i=Qb(r,o,e.documentPath??null);return i.length===r.length?null:i}function DC(e){let t=De.find((o)=>o.tagName===e);return t?Uc(t):null}function nA(){return De.map((e)=>({component:!0,description:(e.source==="npm"?e.package:e.path)??"",group:Ui,label:`<${e.tagName}>`,tag:e.tagName}))}function X(e){if(!e)return[];if(Array.isArray(e.children))return e.children;return n(e.textContent)&&e.textContent.length>0?[e.textContent]:[]}function he(e){let t=0;for(let o of e)t+=n(o)?o.length:he(X(o));return t}function Jt(e,t,o){let r=[],i=0;for(let a of e){if(i>=o)break;if(n(a)){let d=i+a.length;if(d>t){let f=a.slice(Math.max(0,t-i),Math.max(0,Math.min(o,d)-i));if(f)r.push(f)}i=d;continue}let l=X(a),s=he(l),c=i+s;if(s===0){if(i>=t&&i<o)r.push({...a})}else if(c>t){let d=Jt(l,Math.max(0,t-i),Math.min(o,c)-i);if(d.length>0)r.push(Zi(a,d))}i=c}return r}function Zi(e,t){let{children:o,textContent:r,...i}=e;if(t.length===0)return{...i,textContent:""};if(t.length===1&&n(t[0]))return{...i,textContent:t[0]};return{...i,children:t}}function po(e){let t=[];for(let o of e){if(n(o)){if(o.length===0)continue;let r=t.at(-1);if(n(r)){t[t.length-1]=r+o;continue}}t.push(o)}return t}function fo(e,t,o,r,i=""){return po([...Jt(e,0,t),...i?[i]:[],...Jt(o,r,he(o))])}function Ht(e){let t=po(e);if(t.length===0)return{textContent:""};if(t.length===1&&n(t[0]))return{textContent:t[0]};return{children:t}}function mo(e){if(!e)return!0;if(e.textContent!=null&&e.textContent.trim()==="")return!0;let t=e.children;if(!t)return!1;if(t.length===0)return!0;let[o]=t;if(t.length===1&&n(o)&&o.trim()==="")return!0;return t.length===1&&S(o)&&o.tagName==="br"}function Lt(e){return{index:Vi(e),parentPath:zt(e)}}function go(e,t,o,r,i={}){if(!e)return;let a=re(e.doc.document,t);if(o){if(a&&JSON.stringify(a.children)===JSON.stringify(o))return;Z(e,(l)=>{if(a?.textContent!=null)Xe(l,t,"textContent");Xe(l,t,"children",o)},{coalesceKey:i.coalesceKey??null})}else if(r!=null){if(a&&a.textContent===r&&!a.children)return;Z(e,(l)=>{if(a?.children)Xe(l,t,"children");Xe(l,t,"textContent",r)},{coalesceKey:i.coalesceKey??null})}}function ho(e,t,o,r){if(!e)return!1;let i=re(e.doc.document,t);if(!i)return!1;if(`${i.$props?.[o]??""}`===r)return!1;return Z(e,(l)=>{Jp(l,t,o,r)}),!0}function yo(e,t,o){if(!e)return null;let r=re(e.doc.document,t),i=re(e.doc.document,o);if(!r||!i)return null;if(oa(t,o)||oa(o,t))return null;let a=X(i),l=X(r),s=he(a),c=Ht([...a,...l]);return Z(e,(d)=>{if(c.children){if(i.textContent!=null)Xe(d,o,"textContent");Xe(d,o,"children",c.children)}else{if(i.children)Xe(d,o,"children");Xe(d,o,"textContent",c.textContent??"")}if(xh(d,t),xo(d,zt(t)),Yp(e))d.session.selection=[o]}),{offset:s,path:o}}function xo(e,t){let o=t;while(o.length>0){let r=re(e.doc.document,o),i=r?.children;if(!r||!Array.isArray(i)||i.length>0)return;let a=zt(o);if(xh(e,o),!a)return;o=a}}function bo(e,t,o,r){let{parentPath:i,index:a}=Lt(t),l=[...i,"children",a+1];if(!e)return l;let s={tagName:"p"};if(r.textContent!=null)s.textContent=r.textContent;else if(r.children)s.children=r.children;else s.textContent="";return Z(e,(c)=>{if(o.textContent!=null)Xe(c,t,"children"),Xe(c,t,"textContent",o.textContent);else if(o.children)Xe(c,t,"textContent"),Xe(c,t,"children",o.children);if(ro(c,i,a+1,s),Yp(e))c.session.selection=[l]}),l}function Yi(e,t,o,r){let{parentPath:i,index:a}=Lt(t),l=mo(r),s=l?a:a+1,c=[...i,"children",s];if(!e)return c;return Z(e,(d)=>{if(l)xh(d,t);else if(r?.children)Xe(d,t,"textContent"),Xe(d,t,"children",r.children);else if(r?.textContent!=null)Xe(d,t,"children"),Xe(d,t,"textContent",r.textContent);if(ro(d,i,s,o),Ap(d,o.tagName),Yp(e))d.session.selection=[c]}),c}function Po(e,t,o,r){let i=o.component===!0?DC(o.tag):null;if(i)return Yi(e,t,i,r);if(mo(r)){if(!e)return t;return Z(e,(d)=>{Xe(d,t,"tagName",o.tag),Xe(d,t,"children");let f=sh(o.tag);if(f.textContent&&f.textContent!=="Paragraph text")Xe(d,t,"textContent",f.textContent);else Xe(d,t,"textContent");if(Yp(e))d.session.selection=[t]}),t}let{parentPath:a,index:l}=Lt(t),s=[...a,"children",l+1];if(!e)return s;let c=sh(o.tag);return Z(e,(d)=>{if(r?.children)Xe(d,t,"textContent"),Xe(d,t,"children",r.children);else if(r?.textContent!=null)Xe(d,t,"children"),Xe(d,t,"textContent",r.textContent);if(ro(d,a,l+1,structuredClone(c)),Yp(e))d.session.selection=[s]}),s}function So(e,t,o,r,i){if(!e)return null;let a=re(e.doc.document,t.path),l=re(e.doc.document,o.path);if(!a||!l)return null;if(oa(t.path,o.path)||oa(o.path,t.path))return null;let s=Ht(fo(X(a),t.offset,X(l),o.offset,i)),c=[...r,o.path].toSorted(Xi);return Z(e,(d)=>{if(s.children){if(a.textContent!=null)Xe(d,t.path,"textContent");Xe(d,t.path,"children",s.children)}else{if(a.children)Xe(d,t.path,"children");Xe(d,t.path,"textContent",s.textContent??"")}for(let f of c)if(re(d.doc.document,f))xh(d,f),xo(d,zt(f));if(Yp(e))d.session.selection=[t.path]}),{offset:t.offset+i.length,path:t.path}}function Xi(e,t){let o=Math.min(e.length,t.length);for(let r=0;r<o;r++){let i=e[r],a=t[r];if(i===a)continue;if(J(i)&&J(a))return a-i;return String(a).localeCompare(String(i))}return t.length-e.length}function I(e,t=1){return{height:e.height*t,left:e.x*t,top:e.y*t,width:e.width*t}}function iA(e,t,o=1){return{x:(e.x-t.left)/o,y:(e.y-t.top)/o}}function qe(e,t){if(!t){e.style.display="none";return}e.style.display="block",e.style.left=`${t.left}px`,e.style.top=`${t.top}px`,e.style.width=`${t.width}px`,e.style.height=`${t.height}px`}function Eo(e=document){let t=e.createElement("div");t.className="jx-canvas-iframe-overlay",t.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:2";let o=e.createElement("div");o.className="overlay-box overlay-selection",o.style.display="none";let r=e.createElement("div");r.className="overlay-label",r.style.display="none",o.append(r);let i=e.createElement("div");i.className="overlay-box overlay-hover",i.style.display="none";let a=e.createElement("div");a.className="canvas-drop-indicator",a.style.display="none";let l=e.createElement("button");l.className="insertion-helper",l.textContent="+",l.style.pointerEvents="auto",l.style.display="none";let s=e.createElement("div");s.className="canvas-replace-target",s.style.display="none";let c=e.createElement("div");c.className="overlay-presence-group";let d=e.createElement("div");return d.className="overlay-coselection-group",t.append(i,o,d,a,s,l,c),{dispose:()=>t.remove(),insertButton:l,root:t,setDropIndicator:(f,v="inside")=>ea(a,f,v),setHover:(f)=>qe(i,f),setInsertZone:(f,v="center")=>Qi(l,f,v),setReplaceTarget:(f)=>qe(s,f),setSuppressed:(f)=>{t.style.display=f?"none":""},setCoSelection:(f)=>{d.replaceChildren();for(let v of f){let y=e.createElement("div");y.className="overlay-box overlay-selection overlay-coselection",qe(y,v),d.append(y)}},setPresence:(f)=>{c.replaceChildren();for(let v of f){let y=e.createElement("div");y.className="overlay-box overlay-presence",y.style.cssText=`position:absolute;display:block;pointer-events:none;outline:1.5px solid ${v.color};outline-offset:1px;left:${v.placement.left}px;top:${v.placement.top}px;width:${v.placement.width}px;height:${v.placement.height}px`;let b=e.createElement("div");b.className="overlay-presence-tag",b.textContent=v.label,b.style.cssText=`position:absolute;top:-18px;left:-2px;padding:1px 5px;border-radius:3px;font:10px/1.4 sans-serif;color:#fff;white-space:nowrap;background:${v.color}`,y.append(b),c.append(y)}},setSelection:(f,v=null)=>{if(qe(o,f),f&&v)r.textContent=v,r.style.display="block";else r.style.display="none"}}}function Qi(e,t,o){if(!t){e.style.display="none",e.classList.remove("visible");return}e.dataset.edge=o,e.classList.add("visible"),e.style.display="grid",e.style.left=`${t.left+t.width/2}px`,e.style.top=`${t.top+t.height/2}px`,e.style.translate="-50% -50%"}function ea(e,t,o){if(!t){e.style.display="none";return}if(e.style.display="block",e.style.left=`${t.left}px`,e.style.width=`${t.width}px`,o==="inside"){e.className="canvas-drop-indicator inside",e.style.top=`${t.top}px`,e.style.height=`${t.height}px`;return}e.className="canvas-drop-indicator line",e.style.height="",e.style.top=`${o==="top"?t.top:t.top+t.height}px`}function Wc(e){return JSON.stringify(e)}var j=null;function ta(e){if(j?.isConnected)return j;let t=e.createElement("div");return t.className="jx-drag-ghost",t.style.cssText="position:fixed;left:0;top:0;z-index:9999;pointer-events:none;display:none;padding:2px 8px;border-radius:4px;font-size:12px;line-height:1.4;white-space:nowrap;background:var(--accent,#3b82f6);color:var(--accent-fg,#fff);box-shadow:0 2px 8px rgba(0,0,0,0.25);transform:translate(8px,8px)",e.body.append(t),j=t,t}function pL(e,t,o,r=document){let i=ta(r);i.textContent=e,i.style.left=`${t}px`,i.style.top=`${o}px`,i.style.display="block"}function VC(e,t){if(!j||j.style.display==="none")return;j.style.left=`${e}px`,j.style.top=`${t}px`}function lh(){if(j)j.style.display="none"}var Mo=function(){if(typeof window>"u")return null;var e=new Image;return e.src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",e}();function pl(e){var t=e.nativeSetDragImage;if(t&&Mo)t(Mo,0,0)}function No(e,t){if(e==null)return{};var o={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;o[r]=e[r]}return o}function Ro(e,t){if(e==null)return{};var o,r,i=No(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)o=a[r],t.indexOf(o)===-1&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}function We(e,t){var o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return!1;return o.every(function(i){return Object.is(e[i],t[i])})}function Oo(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:We,t=null;return function(o){if(t&&e(t.value,o))return t.value;return t={value:o},t.value}}var na=["block"];function Ao(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),o.push.apply(o,r)}return o}function $o(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?Ao(Object(o),!0).forEach(function(r){ml(e,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Ao(Object(o)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))})}return e}function ra(e){return{x:(e.right+e.left)/2,y:(e.bottom+e.top)/2}}function _t(e){var{client:t,borderBox:o}=e,r=o.height/4;if(t.y<=o.top+r)return"reorder-above";if(t.y>=o.bottom-r)return"reorder-below";return"make-child"}function ia(e){var{element:t,input:o,currentLevel:r,indentPerLevel:i,mode:a}=e,l={x:o.clientX,y:o.clientY},s=t.getBoundingClientRect();if(a==="standard"){var c=_t({borderBox:s,client:l});return{type:c,indentPerLevel:i,currentLevel:r}}var d=ra(s);if(a==="expanded"){var f=_t({borderBox:s,client:l});return{type:f==="reorder-above"?f:"make-child",indentPerLevel:i,currentLevel:r}}var v=i*r;if(l.x<s.left+v){if(l.y<d.y)return{type:"reorder-above",indentPerLevel:i,currentLevel:r};var y=(l.x-s.left)/i,b=Math.max(Math.floor(y),0);return{type:"reparent",desiredLevel:b,indentPerLevel:i,currentLevel:r}}return{type:_t({borderBox:s,client:l}),indentPerLevel:i,currentLevel:r}}function Io(e,t){if(e.type!==t.type)return!1;if(e.type==="instruction-blocked"&&t.type==="instruction-blocked")return Io(e.desired,t.desired);return We(e,t)}var aa=Oo(Io);function sa(e){var{desired:t,block:o}=e;if(o!==null&&o!==void 0&&o.includes(t.type)&&t.type!=="instruction-blocked"){var r={type:"instruction-blocked",desired:t};return r}return t}function xx(e,t){var o=t.block,r=Ro(t,na),i=ia(r),a=sa({desired:i,block:o}),l=aa(a);return $o($o({},e),{},ml({},Be,l))}function jp(e){var t;return(t=e[Be])!==null&&t!==void 0?t:null}var Be=Symbol("tree-item-instruction");var Do=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="320" height="180" viewBox="0 0 320 180"><rect width="320" height="180" fill="#808080" fill-opacity="0.16"/><g fill="#808080" fill-opacity="0.38"><circle cx="118" cy="64" r="14"/><path d="M60 140l52-50 34 30 38-46 76 66z"/></g></svg>')}`;function ca(e){let t=e.getAttribute("src")?.trim()??"",o=e.getAttribute("srcset")?.trim()??"";if(t!==""||o!=="")return!1;return!(e.parentElement?.localName==="picture"?e.parentElement:null)?.querySelector("source[srcset]:not([srcset=''])")}function jt(e){if(ca(e))e.setAttribute("data-jx-image-placeholder",""),e.setAttribute("src",Do);else if(e.hasAttribute("data-jx-image-placeholder")&&e.getAttribute("src")!==Do)e.removeAttribute("data-jx-image-placeholder")}function Ho(e){return e.localName==="img"}function Jo(e){if(e.nodeType!==e.ELEMENT_NODE||!("querySelectorAll"in e))return[];let t=e,o=[...t.querySelectorAll("img")];return Ho(t)?[t,...o]:o}function Lo(e){for(let r of Jo(e))jt(r);let o=new(e.ownerDocument.defaultView?.MutationObserver??MutationObserver)((r)=>{for(let i of r){if(i.type==="attributes"){let{target:a}=i;if(a.nodeType===a.ELEMENT_NODE&&"localName"in a){let l=a;if(Ho(l))jt(l)}continue}for(let a of i.addedNodes)for(let l of Jo(a))jt(l)}});return o.observe(e,{attributeFilter:["src","srcset"],attributes:!0,childList:!0,subtree:!0}),()=>o.disconnect()}async function _x(e,t=new Map){su(!0);try{if(!await ua(e))return _o(e.tagName);let o=document.createElement(e.tagName);for(let i of e.props||[])if(i.default!==void 0&&i.default!=="false"&&i.default!=="''"){let a=String(i.default).replaceAll(/^'|'$/g,"");o.setAttribute(i.name,a)}let r=o;for(let[i,a]of t)r[i]=a;return Lo(o),o}catch(o){return console.warn("Component preview failed:",e.tagName,o),_o(e.tagName)}}async function ua(e){if(e.source==="npm")return Boolean(customElements.get(e.tagName));if(e.path&&!e.path.endsWith(".json"))return!1;let t=x?.projectRoot;return await zy(`${location.origin}/${t?`${t}/`:""}${e.path}`),!0}function _o(e){let t=document.createElement("div");return t.style.cssText="padding:12px;border:1px dashed var(--border);border-radius:var(--radius);color:var(--fg-dim)",t.textContent=`<${e}>`,t}var da='[part="outline"]',Ft='[part="row"]',pa='[part="verbs"]',ze=null;function vA(){if(ze!==null)cancelAnimationFrame(ze);for(let e of st.dndCleanups)e();st.dndCleanups=[],ze=requestAnimationFrame(()=>{ze=null;let e=kh?.querySelector(da);if(!e)return;for(let o of e.querySelectorAll("[data-dnd-row]")){let r=o.dataset.value.split("/").map((c)=>/^\d+$/.test(c)?Math.trunc(Number(c)):c),i=Math.trunc(Number(o.dataset.dndDepth))||0,a=Object.hasOwn(o.dataset,"dndVoid"),l=Object.hasOwn(o.dataset,"dndExpanded"),s=zo(Uo({canDrag({element:c,input:d}){if(v_(d.clientX,d.clientY)?.closest(pa))return!1;return!0},element:o,getInitialData(){return{path:r,type:"tree-node"}},onGenerateDragPreview({nativeSetDragImage:c}){pl({nativeSetDragImage:c})},onDragStart(){if(o.dataset.dragging="",st.layerDragSourceHeight=o.offsetHeight,l)fa(o,e)},onDrop(){if(delete o.dataset.dragging,l)wn("leftPanel")}}),Zs({element:o,canDrop({source:c}){let d=c.data.path;if(Array.isArray(d)&&oa(d,r))return!1;return!0},getData({input:c,element:d}){return xx({path:r},{block:a?["make-child"]:[],currentLevel:i,element:d,indentPerLevel:16,input:c,mode:l?"expanded":"standard"})},onDragEnter({self:c}){jo(o,c.data,e)},onDrag({self:c}){jo(o,c.data,e)},onDrop(){ye(e)}}));st.dndCleanups.push(s)}let t=Xs({onDrop({source:o,location:r}){ye(e);let[i]=r.current.dropTargets;if(!i)return;let a=jp(i.data);if(!a||a.type==="instruction-blocked")return;let l=o.data,s=i.data.path;if(!Array.isArray(s))return;let c=l.type==="tree-node"&&o.element,d=c&&Object.hasOwn(c.dataset,"dndExpanded");if(ey(h.value,a,l,s),d){let f=h.value,v=Pe(f?.session.selection);if(v)st._layersCollapsed||=new Set,st._layersCollapsed.add(v.join("/"))}},onDropTargetChange({location:o}){let[r]=o.current.dropTargets;if(r&&!jp(r.data))ye(e)}});st.dndCleanups.push(t)})}function wA(){requestAnimationFrame(()=>{let e=kh?.querySelector(".components-section");if(!e)return;for(let t of e.querySelectorAll("[data-component-tag]")){let o=t.dataset.componentTag;if(!o)continue;let r=De.find((s)=>s.tagName===o);if(!r)continue;let i=t.querySelector(".element-card-preview");if(i&&!i.querySelector(o))_x(r).then((s)=>{i.textContent="",i.append(s)});let a=Uc(r),l=Uo({element:t,getInitialData(){return{fragment:structuredClone(a),type:"block"}},onGenerateDragPreview({nativeSetDragImage:s}){pl({nativeSetDragImage:s})}});st.dndCleanups.push(l)}})}function xA(){requestAnimationFrame(()=>{let e=kh?.querySelector('[part="content"]');if(!e)return;for(let t of e.querySelectorAll("[data-block-tag]")){let o=t.dataset.blockTag,r=t.querySelector(".element-card-preview");if(r&&!r.firstChild){let l=document.createElement(uo.has(o)?"span":o);l.textContent=o,r.append(l)}let i=sh(o),a=Uo({element:t,getInitialData(){return{fragment:structuredClone(i),type:"block"}},onGenerateDragPreview({nativeSetDragImage:l}){pl({nativeSetDragImage:l})}});st.dndCleanups.push(a)}})}function fa(e,t){let o=`${e.dataset.value}/`,r=t.querySelectorAll(Ft);for(let i of r)if(i.dataset.value?.startsWith(o))i.style.display="none"}function jo(e,t,o){let r=jp(t);if(st._currentDropTargetRow&&st._currentDropTargetRow!==e)delete st._currentDropTargetRow.dataset.drop;if(!r||r.type==="instruction-blocked"){ye(o);return}if(r.type==="make-child"){ye(o),e.dataset.drop="",st._currentDropTargetRow=e;return}delete e.dataset.drop,st._currentDropTargetRow=e;let i=[...o.querySelectorAll(Ft)],a=i.indexOf(e),l=st.layerDragSourceHeight;for(let[s,c]of i.entries()){if(c.dataset.dragging!==void 0)continue;if(r.type==="reorder-above")c.style.transform=s>=a?`translateY(${l}px)`:"";else c.style.transform=s>a?`translateY(${l}px)`:""}}function ye(e){if(st._currentDropTargetRow)delete st._currentDropTargetRow.dataset.drop,st._currentDropTargetRow=null;let t=e.querySelectorAll(Ft);for(let o of t)o.style.transform="",o.style.display=""}function Fo(e,t,o){if(t==="make-child")return{index:oo(re(e,o)).length,parent:o};let r=zt(o),i=Vi(o);if(!r||!J(i))return;if(t==="reorder-above")return{index:i,parent:r};if(t==="reorder-below")return{index:i+1,parent:r};return null}function ey(e,t,o,r){if(!e)return;if(o.type==="tree-node"){let i=o.path,a=Fo(e.doc.document,t.type,r);if(a)Z(e,(l)=>Gp(l,i,a.parent,a.index))}else if(o.type==="block"){let i=Fo(e.doc.document,t.type,r);if(i===void 0)return;let a=o.fragment;if(i)Z(e,(l)=>{ro(l,i.parent,i.index,structuredClone(a)),Ap(l,a.tagName),l.session.selection=[[...i.parent,"children",i.index]]})}}function qo(e){let t={};for(let[o,r]of Object.entries(e?.nesting??{}))if(o!=="_root")t[o]=r?.inline===!0;for(let o of e?.inline??[])t[o]=!1;return t}function F(e){return JSON.parse(JSON.stringify(e))}var et=new WeakMap,C=new Set,ne=0,be=new Map,ar=-1,sr=0,ma=600;function fL(e){return ar===e&&Date.now()-sr<=ma}var Bo=0,lr=new Set;function ga(e,t){let o;try{o=new URL(e,t.iframe.src||ph())}catch{return}if(!["http:","https:","mailto:","tel:"].includes(o.protocol))return;let r=o.href,i=Ln();if(i){i(r);return}window.open(r,"_blank","noopener,noreferrer")}function mL(e){lr.add(e)}function ha(e){return lr.delete(e)}var B=new Map,se=new Map,Ce=new Map,va=300;function gL(e,t,o,r=va){let i=null;for(let s of C){if(!s.iframe.isConnected){C.delete(s);continue}if(s.ready&&!s.stylebook&&e!==null&&s.tabId===e){i=s;break}}if(!i)return Promise.resolve(null);Bo+=1;let a=Bo,l=F(t);return i.channel.post({contextPath:o?[...o]:null,exprs:l,gen:i.lastRenderedGen,kind:"evalExpr",reqId:a}),new Promise((s)=>{let c=setTimeout(()=>{B.delete(a),se.delete(a),s(null)},r);se.set(a,i),B.set(a,(d)=>{clearTimeout(c),se.delete(a),s(d)})})}var Ko=0,ue=new Map,ya=250;function bL(e,t=ya){let o=[];for(let r of C){if(!r.iframe.isConnected){C.delete(r);continue}if(r.ready&&!r.stylebook&&e!==null&&r.tabId===e)o.push(r)}if(o.length===0)return Promise.resolve();return new Promise((r)=>{let i=o.length,a=setTimeout(()=>{for(let c of s)ue.delete(c),Ce.delete(c);r()},t),l=()=>{if(i-=1,i===0)clearTimeout(a),r()},s=[];for(let c of o){Ko+=1;let d=Ko;s.push(d),ue.set(d,l),Ce.set(d,c),c.channel.post({kind:"flushEdits",reqId:d})}})}function WC(e){return et.get(e)??null}function ty(e){for(let t of C){if(!t.iframe.isConnected)continue;let o=Me(t.iframe);if(e.x>=o.left&&e.x<=o.right&&e.y>=o.top&&e.y<=o.bottom)return t}return null}function ny(e,t,o){ne+=1,be.set(ne,o);let r=t.type==="tree-node"?{path:[...t.path],type:"tree-node"}:{type:t.type};return e.channel.post({dragSeq:ne,gen:e.lastRenderedGen,kind:"dragStart",src:r}),ne}function zC(){return ne}function nc(e){let t=Me(e.iframe),o=e.iframe.clientWidth>0?t.width/e.iframe.clientWidth:1;return{rect:t,scale:o}}function cr(e){if(e.stylebook)return"stylebook";return e.tabId??"unbound"}function yL(){let e=[];for(let t of C){if(!t.iframe.isConnected){C.delete(t);continue}let o=`canvas[${cr(t)}]`;if(!t.ready){e.push(`${o}: frame has not handshaked`);continue}let r=[...t.pendingTabIds.keys()];if(r.length>0)e.push(`${o}: gen ${r.join(", ")} unacked`);if(t.pendingPatches>0)e.push(`${o}: ${t.pendingPatches} unacked patch(es)`);if(t.pendingMeasures.size>0)e.push(`${o}: ${t.pendingMeasures.size} measure(s) in flight`);let{idle:i}=t;if(!i){e.push(`${o}: no quiescence report yet`);continue}if(i.gen!==t.lastRenderedGen)e.push(`${o}: quiescence is for gen ${i.gen}, DOM is gen ${t.lastRenderedGen}`);if(!i.fonts)e.push(`${o}: fonts still loading`);if(i.animations>0)e.push(`${o}: ${i.animations} running animation(s)`);if(i.images>0)e.push(`${o}: ${i.images} pending image retry(ies)`)}if(B.size>0)e.push(`canvas: ${B.size} expression eval(s) in flight`);return e}var xa=500,ba=2,Ca=40;function dr(){let e=h.value?.id??null,t=null;for(let o of C){if(!o.iframe.isConnected){C.delete(o);continue}if(!o.ready||o.stylebook)continue;if(o.tabId===e)return o;t??=o}return t}function pr(e,t){let{rect:o,scale:r}=nc(e),i=o.left+t.x*r,a=o.top+t.y*r,l=t.width*r,s=t.height*r;return{height:s,left:i,top:a,width:l,x:i+l/2,y:a+s/2}}function we(e,t){return new Promise((o)=>{e.measureSeq+=1;let r=e.measureSeq,i=setTimeout(()=>{e.pendingMeasures.delete(r),o(null)},xa);e.pendingMeasures.set(r,(a)=>{clearTimeout(i);let[l]=a;o(l?pr(e,l.rect):null)}),e.channel.post({kind:"measure",paths:[[...t]],reqId:r})})}function vL(e){let t=WC(e),o=t?.lastHover;if(!t||!o)return null;return{settle:async()=>(await we(t,o.path))?.top??null,top:pr(t,o.rect).top}}function wL(e){let t=dr();return t?we(t,e):Promise.resolve(null)}function Pa(e){return new Promise((t)=>{let o=Number.NaN,r=0,i=0,a=()=>{let{top:l}=Me(e.iframe);if(r=l===o?r+1:0,o=l,i+=1,r>=ba||i>=Ca){t();return}requestAnimationFrame(a)};requestAnimationFrame(a)})}async function iy(e){let t=dr();return t?pF(t,e):null}async function pF(e,t){let o=await we(e,t);if(!o)return null;let r=z(e.canvasEl)?.surface;return BC({height:o.height,top:o.top},r),await Pa(e),we(e,t)}function DF(e,t){let o=WC(e);return o?we(o,t):Promise.resolve(null)}function Sa(e){let t=e.canvasEl.parentElement;if(!t)return;let o=/scale\(([\d.]+)\)/.exec(e.canvasEl.style.transform),r=o?Number(o[1]):1;t.style.height=r===1?"":`${e.iframe.offsetHeight*r}px`}function fr(e){if(e.preview){e.iframe.style.height="100%",e.iframe.style.minHeight="0px";return}if(e.contentHeight===null)return;e.iframe.style.height=`${e.contentHeight}px`,e.iframe.style.minHeight=e.contentFragment?"0px":"480px",Sa(e)}function Ut(e,t){if(e.preview=t,e.overlay.setSuppressed(t),t)e.pendingEnterEdit=null;fr(e)}function xL(e,t){Ut(Zt(e),t)}function zc(e,t){if(!e.iframe.isConnected)return;e.channel.post(t)}function Sx(e){be.delete(e)}function Cx(e){e.overlay.setDropIndicator(null)}var mr=null;function _L(e){mr=e}var wa=300,hr=null;function SL(e){hr=e}var Gt=null;function CL(e){Gt=e}function Ea(e,t,o){if((t?Ma(t.tagName):!1)&&t){e.overlay.setDropIndicator(null),e.overlay.setReplaceTarget(I(t.rect));return}e.overlay.setReplaceTarget(null),e.overlay.setDropIndicator(o?I(o.referenceRect):null,o?.edge)}function Go(e){e.overlay.setReplaceTarget(null),e.overlay.setDropIndicator(null)}function Ma(e){return e==="img"||e==="video"||e==="source"}function Ra(e,t){if(e.dataset.jxGutterDrop==="1")return;e.dataset.jxGutterDrop="1",e.addEventListener("dragover",(o)=>{if(![...o.dataTransfer?.types??[]].includes("Files"))return;if(o.preventDefault(),o.dataTransfer)o.dataTransfer.dropEffect="copy"}),e.addEventListener("drop",(o)=>{let r=o.dataTransfer?.files,i=t();if(!r?.length||!i||i.stylebook)return;o.preventDefault(),Gt?.(M(i),[...r],null,null)})}var Ge=null;function kL(e){Ge=e}var Ze=null;function EL(e){Ze=e}var vr=null;function TL(e){vr=e}function Zo(e,t){let o=[...t];for(;;){let r=e.get(Wc(o));if(r)return r;if(o.length<2)return null;o=o.slice(0,-2)}}var R=null;function $L(){let e=R;return Boolean(e?.editing&&e.iframe.isConnected)}var Ye=null;function LL(e){Ye=e}var Kt=null;function RL(e){Kt=e}var Yo=null,yr=null;function IL(e){yr=e}function NL(e,t){for(let o of C){if(!o.iframe.isConnected){C.delete(o);continue}if(o.ready&&o.tabId===e.id&&!o.preview)o.popoverOpen=t,o.channel.post({kind:"setPopoverOpen",path:t})}}function DL(e,t){for(let o of C){if(!o.iframe.isConnected){C.delete(o);continue}if(o.ready&&o.tabId===e.id&&!o.preview)o.dialogOpen=t,o.channel.post({kind:"setDialogOpen",path:t})}}function UC(e,t){let o=0;for(let r of C){if(!r.iframe.isConnected){C.delete(r);continue}if(r.ready&&r.tabId===t){let i=z(r.canvasEl)?.surface;if(!i){mx("host-stage-unresolved");continue}let a=i.renderGeneration,l=tt?.host===r?tt.paths:void 0;nt(r),r.channel.post(l?{echoPaths:l,forwardOps:e,gen:a,kind:"patch"}:{forwardOps:e,gen:a,kind:"patch"}),r.pendingPatches+=1,o+=1}}return o}var tt=null,Oa=0;function Xo(e,t,o){tt={host:e,paths:t};try{o()}finally{tt=null}}var Vt=null,qt=null;function Aa(e,t,o){return!e&&t===o}function $a(e,t){let o=M(e);if(!o)return;let r=re(o.doc.document,t);if(!r)return;UC([{key:"$props",op:"set-key",path:t,value:r.$props}],o.id)}function M(e){return e.tabId?g.tabs.get(e.tabId)??null:null}function OL(e){return M(e)}function Ke(e){let t=z(e.canvasEl)?.surface.paneId;if(t)Co(t)}var Ia=Object.freeze([]);function Da(){let e=new Map;for(let t of g.panes){let o=t.activeTabId?g.tabs.get(t.activeTabId):null;if(!o)continue;let r=o.session.selection;r.map((i)=>i.join("/")).join("|"),e.set(o.id,r)}return e}function ka(){if(Yo)return;let e=me(!0);e.run(()=>{te(()=>{let t=Da();u.stylebook.selection;for(let o of C)ot(o,(o.tabId?t.get(o.tabId):null)??Ia)})}),Yo={stop:()=>e.stop()}}function nt(e){if(!e.ready)return;let t=mh(),o=zp();if(t===e.postedVersions&&o===e.postedRevisions)return;let r=e.postedVersions===null;if(e.postedVersions=t,e.postedRevisions=o,r&&Object.keys(t).length===0&&Object.keys(o).length===0)return;e.channel.post({kind:"assetVersions",revisions:o,versions:t})}var Qo=!1,Bt=!1;function Ja(){if(Qo)return;Qo=!0,me(!0).run(()=>{te(()=>{if(yy.value,Bt)return;Bt=!0,queueMicrotask(()=>{Bt=!1,Ha()})})})}function Ha(){for(let e of C){if(!e.iframe.isConnected){C.delete(e);continue}nt(e)}}var er=!1,Ue=null;function La(){if(er)return;er=!0,me(!0).run(()=>{te(()=>{for(let t of g.panes){let o=t.activeTabId?g.tabs.get(t.activeTabId):null;if(!o)continue;let{peers:r}=xn(o);r.map((i)=>JSON.stringify(i.state.structuralSelection??null)).join("|")}if(Ue)clearTimeout(Ue);Ue=setTimeout(()=>{Ue=null;for(let t of C)xr(t)},100)})})}function xr(e){if(e.stylebook||!e.ready||!e.iframe.isConnected)return;let t=M(e),o=t?xn(t).peers:[];e.presenceMeta.clear();let r=[];for(let i of o){let{structuralSelection:a}=i.state;if(!a||i.state.focusedPath!==t?.documentPath)continue;for(let l of a){let s=[...l];r.push(s),e.presenceMeta.set(JSON.stringify(s),{color:i.state.user.color,label:i.state.user.name??i.state.user.login})}}if(r.length===0){e.presenceReqId=-1,e.overlay.setPresence([]);return}e.measureSeq+=1,e.presenceReqId=e.measureSeq,e.channel.post({kind:"measure",paths:r,reqId:e.presenceReqId})}function ot(e,t){if(e.stylebook){_a(e);return}let o=Pe(t);if(e.selectionPath=o,e.selectionPaths=t,!e.iframe.isConnected){C.delete(e);return}if(!o){e.selReqId=-1,e.coSelectionKeys.clear(),e.overlay.setSelection(null),e.overlay.setCoSelection([]);return}if(!e.ready)return;let r=Na(t.slice(0,-1));e.coSelectionKeys=new Set(r.map((i)=>JSON.stringify(i))),e.measureSeq+=1,e.selReqId=e.measureSeq,e.channel.post({kind:"measure",paths:[[...o],...r],reqId:e.selReqId})}function _a(e){if(!e.iframe.isConnected){C.delete(e);return}let t=u.stylebook.selection,o=t?e.stylebook?.tagToCardPath.get(t):void 0;if(!t||!o){e.selReqId=-1,e.overlay.setSelection(null);return}if(!e.ready)return;e.measureSeq+=1,e.selReqId=e.measureSeq,e.channel.post({kind:"measure",paths:[[...o]],reqId:e.selReqId})}function nr(){return N_("../canvas.html")}function Cr(e){e.channel.dispose();for(let[t,o]of B)if(se.get(t)===e)B.delete(t),se.delete(t),o(null);for(let[t,o]of ue)if(Ce.get(t)===e)ue.delete(t),Ce.delete(t),o();for(let[,t]of e.pendingMeasures)t([]);if(e.pendingMeasures.clear(),e.pendingTabIds.clear(),Ee(e),R===e)R=null;e.overlay.root.remove(),e.iframe.remove(),et.delete(e.canvasEl),C.delete(e)}function Fa(){if(!ve())return nr();return p().canvasUrl||nr()}function ry(e){let t=0;for(let o of new Set(C))if(e.contains(o.canvasEl))Cr(o),t+=1;return t}function Zt(e){let t=Fa(),o=et.get(e);if(o){if(o.canvasUrl===t)return o;Cr(o)}let r=location.origin,i=crypto.randomUUID(),a=new URL(t,location.href).origin,l=document.createElement("iframe");l.className="jx-canvas-iframe",l.title="Canvas — live page render",l.style.cssText="width:100%;min-height:480px;height:100%;border:0;display:block;background:#fff";let s=new URL(t,location.href);if(s.searchParams.set("token",i),location.protocol==="http:"||location.protocol==="https:")s.searchParams.set("parentOrigin",r);if(l.src=a===r?`${s.pathname}${s.search}`:s.href,!e.style.position)e.style.position="relative";let c=Eo(document);e.replaceChildren(l,c.root),Ra(e,()=>WC(e));let d=Hn({acceptOrigin:a,source:window,target:{postMessage:(v,y)=>l.contentWindow?.postMessage(v,y)},targetOrigin:a,token:i}),f={canvasEl:e,canvasUrl:t,channel:d,contentFragment:!1,contentHeight:null,hiddenPaths:new Set,popoverOpen:null,dialogOpen:null,editing:!1,editingProp:null,iframe:l,insertHideTimer:null,insertHover:!1,coSelectionKeys:new Set,insertZone:null,lastRenderedGen:-1,lastHover:null,lastSelectionRect:null,lastSnapshotSeq:0,measureSeq:0,overlay:c,panReqId:-1,pending:null,postedVersions:null,postedRevisions:null,idle:null,pendingEnterEdit:null,pendingMeasures:new Map,pendingPatches:0,pendingTabIds:new Map,presenceMeta:new Map,presenceReqId:-1,preview:!1,ready:!1,selectionPath:null,selectionPaths:[],selReqId:-1,snapshot:null,stylebook:null,tabId:null};return c.insertButton.addEventListener("click",(v)=>Wa(f,v)),c.insertButton.addEventListener("mouseenter",()=>{f.insertHover=!0,Ee(f)}),c.insertButton.addEventListener("mouseleave",()=>{f.insertHover=!1,Sr(f)}),d.onMessage((v)=>za(f,v)),et.set(e,f),C.add(f),ka(),La(),Ja(),f}function Va(e,t){Ee(e),e.insertZone=t,e.overlay.setInsertZone(I(t.rect),t.edge)}function Pr(e){Ee(e),e.insertZone=null,e.insertHover=!1,e.overlay.setInsertZone(null)}function qa(e){let t=e.overlay.insertButton;return e.insertHover||t.matches(":hover")}function Sr(e){Ee(e),e.insertHideTimer=setTimeout(()=>{if(e.insertHideTimer=null,qa(e))return;Pr(e)},wa)}function Ee(e){if(e.insertHideTimer!==null)clearTimeout(e.insertHideTimer),e.insertHideTimer=null}function Wa(e,t){t.stopPropagation(),t.preventDefault();let o=e.insertZone;if(!o)return;hr?.(e.overlay.insertButton,o)}var Ba=new Set(["contextMenu","dragOver","dropResult","editCommit","editCommitProp","editInput","editInsert","editMerge","editRangeReplace","editSplit","editStart","fileDragOver","fileDrop","hit","hover","insertZones","layoutHit","nativeDragEnter"]);function za(e,t){if(e.preview&&Ba.has(t.kind))return;switch(t.kind){case"ready":{e.ready=!0;let o=Yt?.();if(o)e.channel.post({chords:o.chords,kind:"keymap",mac:o.mac});if(e.postedVersions=null,e.postedRevisions=null,nt(e),e.pending)e.channel.post(e.pending),e.pending=null;ot(e,e.selectionPaths);return}case"paneFocus":{Ke(e),Kt?.();return}case"popoverTargetClick":{let o=M(e);if(!o||e.preview)return;let r=JSON.stringify(o.session.ui.openPopover)===JSON.stringify(t.targetPath),i=t.action==="show"||t.action==="toggle"&&!r;if(i||r)ae()?.run("canvas.setPopoverOpen",{open:i,path:t.targetPath});return}case"commandTargetClick":{let o=M(e);if(!o||e.preview)return;let r=(a)=>JSON.stringify(a)===JSON.stringify(t.targetPath),i=re(o.doc.document,t.targetPath);if(!Jn(i))return;if(pt.has(t.command)){if(!ja(i))return;let a=t.command==="show-popover"||t.command==="toggle-popover"&&!r(o.session.ui.openPopover);if(a||r(o.session.ui.openPopover))ae()?.run("canvas.setPopoverOpen",{open:a,path:t.targetPath})}else if(dt.has(t.command)){if(!_(i))return;let a=t.command==="show-modal";if(a||r(o.session.ui.openDialog))ae()?.run("canvas.setDialogOpen",{open:a,path:t.targetPath})}return}case"hit":{Ke(e),Kt?.(),tR(null);let o=null,r=z(e.canvasEl)?.panel;if(r?.mediaName&&!r.mediaName.startsWith("git-diff")){o=Te(r.mediaName);let a=M(e);if(a)a.session.ui.activeMedia=o}if(Ze?.dismiss(),e.stylebook){let a=Zo(e.stylebook.pathToTag,t.hit.path);if(vr?.(a,o),a){let l=I(t.hit.rect);e.overlay.setSelection(l,`<${a}>`),e.lastSelectionRect=l}else e.overlay.setSelection(null);return}e.selectionPath=t.hit.path,e.selectionPaths=[t.hit.path];let i=M(e);if(i)i.session.selection=t.additive?n_(i.session.selection,t.hit.path):[t.hit.path];{let a=I(t.hit.rect);e.overlay.setSelection(a),e.lastSelectionRect=a}return}case"layoutHit":{if(e.stylebook)return;Ke(e),Ze?.dismiss(),tR(t.hit),e.selectionPath=null,e.selectionPaths=[];let o=M(e);if(o)o.session.selection=[];let r=I(t.hit.rect);e.overlay.setSelection(r,`LAYOUT · ${t.hit.layoutFile}`),e.lastSelectionRect=r,wn("rightPanel");return}case"hover":{if(e.stylebook){let o=t.hit?Zo(e.stylebook.pathToTag,t.hit.path):null,r=u.stylebook.selection;if(t.hit&&o&&o!==r)e.overlay.setHover(I(t.hit.rect));else e.overlay.setHover(null);return}e.lastHover=t.hit,Za(e,t.hit);return}case"insertZones":{if(e.stylebook)return;let o=t.zones?.[0]??null;if(o)Va(e,o);else Sr(e);return}case"geometry":{let o=e.pendingMeasures.get(t.reqId);if(o){e.pendingMeasures.delete(t.reqId),o(t.hits);return}if(t.reqId===e.presenceReqId){e.presenceReqId=-1;let r=[];for(let i of t.hits){let a=e.presenceMeta.get(JSON.stringify(i.path));if(a)r.push({...a,placement:I(i.rect)})}e.overlay.setPresence(r);return}if(t.reqId===e.panReqId){e.panReqId=-1;let[r]=t.hits;if(r){let{rect:i,scale:a}=nc(e);Dn({height:r.rect.height*a,top:r.rect.y*a+i.top})}return}if(t.reqId===e.selReqId){let r=JSON.stringify(e.selectionPath),i=[],a=null;if(e.stylebook){let[s]=t.hits;a=s?I(s.rect):null}else for(let s of t.hits){let c=JSON.stringify(s.path);if(c===r)a=I(s.rect);else if(e.coSelectionKeys.has(c))i.push(I(s.rect))}let l=e.stylebook?u.stylebook.selection:null;e.overlay.setSelection(a,l?`<${l}>`:null),e.overlay.setCoSelection(i),e.lastSelectionRect=a,e.hiddenPaths=new Set((t.hidden??[]).map((s)=>JSON.stringify(s)))}return}case"evalResult":{let o=B.get(t.reqId);if(!o)return;B.delete(t.reqId),se.delete(t.reqId),o(t.gen===e.lastRenderedGen?t.results:null);return}case"renderComplete":{if(e.pendingTabIds.has(t.gen))e.tabId=e.pendingTabIds.get(t.gen)??null;for(let o of e.pendingTabIds.keys())if(o<=t.gen)e.pendingTabIds.delete(o);or(e,t.gen);return}case"patchComplete":{e.pendingPatches=Math.max(0,e.pendingPatches-1),or(e,t.gen);return}case"idle":{e.idle={animations:t.animations,fonts:t.fonts,gen:t.gen,images:t.images};return}case"renderError":{e.pendingTabIds.delete(t.gen);let o=M(e);if(o)o.session.canvas.refreshing=!1,wn("leftPanel");w.error("The page could not be rendered.",{detail:t.message,key:`canvas.render:${cr(e)}`,source:"Canvas"});return}case"dataScope":{if(t.gen!==e.lastRenderedGen)return;let o=M(e);if(o)o.session.canvas.scope=t.scope,o.session.canvas.refreshing=!1;wn("leftPanel");return}case"contentHeight":{e.contentHeight=t.height,e.contentFragment=t.fragment,fr(e);return}case"dragOver":{if(t.dragSeq!==ne)return;if(t.cursor)ar=t.dragSeq,sr=Date.now();if(t.gen!==e.lastRenderedGen)return;if(t.preview)e.overlay.setDropIndicator(I(t.preview.referenceRect),t.preview.edge);else e.overlay.setDropIndicator(null);if(t.cursor){let o=nc(e);VC(t.cursor.x*o.scale+o.rect.left,t.cursor.y*o.scale+o.rect.top)}return}case"nativeDragEnter":{if(e.stylebook)return;mr?.(e);return}case"dragEnd":{e.overlay.setDropIndicator(null),lh(),be.delete(t.dragSeq);return}case"dropResult":{if(t.dragSeq!==ne||t.gen!==e.lastRenderedGen)return;if(t.instruction&&t.targetPath){let o=be.get(t.dragSeq);if(o)ey(M(e),{type:t.instruction},o,t.targetPath)}be.delete(t.dragSeq),e.overlay.setDropIndicator(null),lh();return}case"fileDragOver":{if(e.stylebook)return;Ea(e,t.hit,t.preview);return}case"fileDragLeave":{Go(e);return}case"fileDrop":{if(Go(e),e.stylebook)return;Gt?.(M(e),t.files,t.hit,t.preview);return}case"patchError":{e.pendingPatches=Math.max(0,e.pendingPatches-1);let o=z(e.canvasEl)?.surface;if(o)yr?.(o.paneId);return}case"forwardKey":{Ga(t.event);return}case"forwardWheel":{Ua(e,t);return}case"editStart":{if(R&&R!==e)R.editing=!1,R.editingProp=null,R.snapshot=null;if(R=e,t.prop!==void 0&&qt===Wc(t.path))xe(e,t.path,void 0,t.prop);qt=null,Oa+=1,e.editing=!0,e.editingProp=t.prop??null,e.snapshot=null,e.lastSnapshotSeq=0,Ye?.();return}case"selectionChanged":{if(t.seq<=e.lastSnapshotSeq)return;if(e.lastSnapshotSeq=t.seq,e.snapshot=t,!e.editing)e.editing=!0,R=e;Ye?.();return}case"flushComplete":{let o=ue.get(t.reqId);if(o)ue.delete(t.reqId),Ce.delete(t.reqId),o();return}case"editInput":{let o=M(e);if(o)o.doc.dirty=!0;return}case"editCommit":{let o=()=>go(M(e),t.path,t.children,t.textContent);if(t.inPlace)Xo(e,[t.path],o);else o();return}case"editCommitProp":{let o=()=>ho(M(e),t.path,t.prop,t.value);if(t.inPlace){Xo(e,[t.path],o),Vt=Wc(t.path);return}let r=o();if(Aa(r,Vt,Wc(t.path)))$a(e,t.path);Vt=null,qt=r?Wc(t.path):null;return}case"editMerge":{let o=yo(M(e),t.fromPath,t.intoPath);if(o)xe(e,o.path,o.offset);return}case"editRangeReplace":{let o=So(M(e),t.from,t.to,t.between,t.text);if(o)xe(e,o.path,o.offset);return}case"editSplit":{xe(e,bo(M(e),t.path,t.before,t.after));return}case"editInsert":{xe(e,Po(M(e),t.path,t.cmd,t.commitData));return}case"slashShow":{let{rect:o,scale:r}=nc(e),i=t.rect.x*r+o.left,a=t.rect.y*r+o.top,l={filter:t.filter,onDismiss:()=>e.channel.post({kind:"slashDismissed"}),onSelect:(s)=>e.channel.post({cmd:{...s},kind:"slashSelect"}),rect:{bottom:a+t.rect.height*r,height:t.rect.height*r,left:i,top:a,width:t.rect.width*r}};if(t.showFilter===!0)l.showFilter=!0;Ge?.show(l);return}case"slashNav":{Ge?.nav(t.key);return}case"slashDismiss":{Ge?.dismiss();return}case"previewNavigate":{ga(t.href,e);return}case"contextMenu":{if(e.stylebook)return;Ke(e);let{rect:o,scale:r}=nc(e);Ze?.show({clientX:t.x*r+o.left,clientY:t.y*r+o.top,path:t.path?[...t.path]:null});return}case"editEnd":{if(!e.editing)return;if(e.editing=!1,e.editingProp=null,e.snapshot=null,R===e)R=null;Ye?.();break}default:break}}function or(e,t){if(e.lastRenderedGen=t,ot(e,e.selectionPaths),xr(e),Pr(e),es(e),e.pendingEnterEdit&&t>=e.pendingEnterEdit.minGen){let{offset:o,path:r,prop:i}=e.pendingEnterEdit;if(e.pendingEnterEdit=null,e.tabId!==null&&e.tabId===pe(e.canvasEl)?.id)Ka(e,r,o,i)}}function xe(e,t,o,r){let i={minGen:e.lastRenderedGen,path:[...t]};if(o!==void 0)i.offset=o;if(r!==void 0)i.prop=r;e.pendingEnterEdit=i}function Ka(e,t,o,r){let i={kind:"enterEdit",path:[...t]};if(o!==void 0)i.offset=o;if(r!==void 0)i.prop=r;e.channel.post(i)}function Ua(e,t){let{rect:o,scale:r}=nc(e),i=nd(e.canvasEl)?.wrap;if(!i)return;i.dispatchEvent(new WheelEvent("wheel",{bubbles:!0,cancelable:!0,clientX:o.left+t.x*r,clientY:o.top+t.y*r,ctrlKey:t.ctrlKey,deltaX:t.deltaX,deltaY:t.deltaY,metaKey:t.metaKey,shiftKey:t.shiftKey}))}function Ga(e){document.dispatchEvent(new KeyboardEvent("keydown",{altKey:e.altKey,bubbles:!0,cancelable:!0,code:e.code,ctrlKey:e.ctrlKey,key:e.key,metaKey:e.metaKey,shiftKey:e.shiftKey}))}function Za(e,t){if(!t||ko(t.path,e.selectionPath)){e.overlay.setHover(null);return}e.overlay.setHover(I(t.rect))}var Ya=4,ee=new Map;function Xa(e){let t=ee.get(e);if(t)return ee.delete(e),ee.set(e,t),t;let o=new Map;ee.set(e,o);for(let r of ee.keys()){if(ee.size<=Ya)break;ee.delete(r)}return o}function Qa(e,t,o,r,i,a=null){let l=Xa(e),s=r?.id??null,c=l.get(t);if(c&&c.tabId===o&&c.viewTabId===s&&c.mode===a)return c.payload;let d=ha(i),f=NC(tn,async()=>{qr.renderPreparations+=1;let v=await co(t,r,a),y=F(v.renderDoc),b=F(t),E=o?g.tabs.get(o)??null:null,k=Wi(E?.doc.sourceFormat)?.studio?.elements,O=k?qo(k):void 0,H={assets:v.assets,doc:y,docBase:v.docBase??`${ph()}/`,mapperCtx:v.mapperCtx,mode:v.mapperCtx.canvasMode,shadowDoc:b,siteStyle:v.siteStyle};if(O)H.editableTags=O;if(d)H.allowAutoRequests=!0;return H});return l.set(t,{mode:a,payload:f,tabId:o,viewTabId:s}),f}async function AL(e,t,o,r,i=null,a=pe(o),l=null,s=null){let c=Zt(o);c.pendingTabIds.set(e,i),c.stylebook=null,c.iframe.style.width=r?`${r}px`:"100%";let f={...await Qa(e,t,i,a,at(o),l),colorScheme:Er(a),gen:e,kind:"render",locale:Nr(a),popoverOpen:a?.session.ui.openPopover??null,dialogOpen:a?.session.ui.openDialog??null};if(s)f.diffMarks=s;c.popoverOpen=f.popoverOpen??null,c.dialogOpen=f.dialogOpen??null,Ut(c,f.mode==="preview"),wr(c,f)}function wr(e,t){if(qr.hostRenderPosts+=1,e.ready){nt(e),e.channel.post(t);return}let o=e.pending;if(o?.kind==="render"&&o.gen>t.gen){e.pendingTabIds.delete(t.gen);return}e.pending=t}function PL(e,t,o,r){let i=Zt(o);i.pendingTabIds.set(e,null),i.stylebook={pathToTag:t.pathToTag,tagToCardPath:t.tagToCardPath},Ut(i,!1),i.pendingEnterEdit=null,i.iframe.style.width=r?`${r}px`:"100%";let a=F(t.doc),l=F(t.doc),s={assets:null,colorScheme:Er(pe(o)),locale:Nr(pe(o)),doc:a,docBase:`${ph()}/`,gen:e,kind:"render",mapperCtx:{arrayPaths:[],canvasMode:"stylebook",layoutWrapped:!1,pageContentOffset:null,pageContentPrefix:null},mode:"stylebook",shadowDoc:l,siteStyle:null};wr(i,s)}function Er(e){let t=e?.session.ui.previewColorScheme;return t==="light"||t==="dark"?t:null}function ML(e,t){for(let o of C){if(!o.iframe.isConnected){C.delete(o);continue}if(t&&!t.contains(o.iframe))continue;if(o.ready)o.channel.post({kind:"setColorScheme",scheme:e})}}function Mr(e){return e===null?null:{dir:vy(e),locale:e}}function Nr(e){return Mr(e?Hp(e.session.ui.previewLocale,e.documentPath):null)}function FL(e,t){let o=vy(e);for(let r of C){if(!r.iframe.isConnected){C.delete(r);continue}if(t&&!t.contains(r.iframe))continue;if(r.ready)r.channel.post({dir:o,kind:"setLocale",locale:e});else if(r.pending?.kind==="render")r.pending={...r.pending,locale:Mr(e)}}}function jL(e,t){let o=F(e),r=0;for(let i of C){if(!i.iframe.isConnected){C.delete(i);continue}if(i.ready)i.channel.post({base:t,doc:o,kind:"redefineElement"}),r+=1}return r}function HL(){let e=x?.projectConfig;if(!e)return;let t=F(e.style??null),o=F(e.$media??{});for(let r of C){if(!r.iframe.isConnected){C.delete(r);continue}if(r.ready&&!r.stylebook)r.channel.post({kind:"siteStyleUpdate",media:o,siteStyle:t})}}function kx(e){let t=0,o=F(e);for(let r of C){if(!r.iframe.isConnected){C.delete(r);continue}if(r.ready&&r.stylebook)r.channel.post({gen:r.lastRenderedGen,kind:"styleUpdate",style:o}),t+=1,ot(r,r.selectionPaths)}return t}var Qe=null;function Or(e,t){if(!e?.stylebook||!e.ready)return!1;let o=e.stylebook.tagToCardPath.get(t);if(!o)return!1;return e.measureSeq+=1,e.panReqId=e.measureSeq,e.channel.post({kind:"measure",paths:[[...o]],reqId:e.panReqId}),!0}function BL(e){Qe=Or(Xt(),e)?null:e}function es(e){let t=Qe;if(t===null||!e.stylebook)return;if(u.stylebook.selection!==t){Qe=null;return}if(e===Xt()&&Or(e,t))Qe=null}function ic(){let e=R;if(!e||!e.iframe.isConnected)return{editing:!1,editingProp:null,snapshot:null};return{editing:e.editing,editingProp:e.editingProp,snapshot:e.snapshot}}var Yt=null;function VL(e,t){Yt=e,t?.(()=>ir()),ir()}function ir(){let e=Yt?.();if(!e)return;for(let t of C){if(!t.iframe.isConnected){C.delete(t);continue}if(t.ready)t.channel.post({chords:e.chords,kind:"keymap",mac:e.mac})}}function ch(e){let t=R;if(!t||!t.ready)return;t.channel.post({intent:e,kind:"applyFormat"})}function WL(){let e=R;if(!e||!e.ready)return;e.channel.post({kind:"openSlash"})}function Ex(){let e=R;if(e?.editing&&e.ready&&e.iframe.isConnected)e.channel.post({kind:"endEdit"})}function Xt(){let e=un();return e?WC(e.canvas):null}function qC(){let e=R,t=e??Xt();if(!t)return null;let{rect:o,scale:r}=nc(t);if(t.lastSelectionRect)return{height:t.lastSelectionRect.height*r,left:t.lastSelectionRect.left*r+o.left,top:t.lastSelectionRect.top*r+o.top,width:t.lastSelectionRect.width*r};let i=t===e?t.snapshot?.rect:null;if(i)return{height:i.height*r,left:i.x*r+o.left,top:i.y*r+o.top,width:i.width*r};return null}
|
|
2
|
-
export{vo,bt,Vo,yC,Ta,Ur,ul,zO,Kb,Gb,wo,Bc,hl,nh,vC,UO,Jb,qO,wC,xC,_C,SC,KO,CC,ih,Yb,Zb,hi,Fm,tL,fx,GO,ec,tc,rh,JO,kC,nL,Vc,oh,YO,Xb,Op,EC,TC,ZO,$C,LC,RC,iL,XO,QO,qr,mx,IC,NC,ji,sh,rL,Qb,oL,eA,tA,Ap,DC,nA,iA,Wc,OC,jm,rA,gx,oA,bx,sA,yx,Pp,Wo,aA,Hm,lA,cA,AC,dA,PC,uA,MC,sL,aL,FC,Bm,Mp,hA,pA,vx,Ys,ah,Fp,fA,mA,jC,lL,Vm,HC,gA,BC,cL,bA,dL,uL,hL,yA,wx,pL,VC,lh,pl,xx,jp,_x,vA,wA,xA,ey,fL,mL,gL,bL,WC,ty,ny,zC,nc,yL,vL,wL,iy,pF,DF,xL,zc,Sx,Cx,_L,SL,CL,kL,EL,TL,$L,LL,RL,IL,NL,DL,UC,OL,ry,AL,PL,ML,FL,jL,HL,kx,BL,ic,VL,ch,WL,Ex,qC};
|
|
3
|
-
|
|
4
|
-
//# debugId=8CDD77C4755AC90464756E2164756E21
|
|
5
|
-
//# sourceMappingURL=studio-aaw7wxv8.js.map
|