1import{a as mi,b as gi}from"/build/_shared/chunk-AGA3KMI7.js";import{A as Vt,C as A,D as Ut,F as re,G as pn,H as Oe,I as Gt,J as Kt,K as ze,L as Xt,M as Y,N as Yt,O as Jt,Q as qt,R as ke,S as Zt,a as pi,b as hi,c as fi,d as Rt,e as Ot,g as zt,h as kt,i as Lt,j as Ce,k as Mt,l as jt,m as At,n as ie,o as Bt,p as Te,q as De,r as he,s as Ee,t as fe,u as Nt,v as Re,w as Wt,x as $t,y as Ht,z as Ft}from"/build/_shared/chunk-AW5ZJZLL.js";import{$ as We,$a as Pe,$b as rt,A as ye,Aa as Ln,Ab as et,Ac as lt,Ba as Ge,Bb as nt,Bc as ct,Bd as Ct,Ca as Mn,Cb as nn,Cc as dt,Da as Ke,Dd as oe,Ea as jn,Ec as rn,Ed as Tt,Fa as An,Fb as tt,Fd as Dt,Ga as Bn,Gb as xe,Gd as un,Hb as ot,Ia as Xe,Id as Et,Ja as ue,Ka as Ye,Kb as it,Kc as ut,Lc as Ie,Ma as U,Mb as ti,Na as Nn,O as Cn,Oa as Q,Od as Se,P as Tn,Pa as be,Pb as pe,Pc as an,Q as Ne,Qa as Je,Ra as qe,Sa as Wn,T as Dn,Ta as $n,Tc as pt,Ub as we,Wa as Hn,X as En,Xb as oi,Ya as _e,Yc as sn,Za as Ze,_a as Fn,_b as ii,ab as Vn,ac as ri,ad as ht,bd as ft,cb as Un,cc as ai,cd as mt,da as $e,ed as gt,fa as ee,fb as Gn,fc as si,fd as vt,ga as ne,gb as K,gc as tn,gd as yt,h as Pn,ha as He,hd as ln,i as xn,ia as ce,ib as Kn,id as cn,ja as Fe,jb as Qe,jc as li,k as ve,kb as X,kc as at,la as Rn,lc as ci,mb as en,mc as di,na as E,nc as ui,o as ni,od as bt,p as Be,pa as R,pd as _t,q as B,qa as Ve,qb as Xn,qd as Pt,r as wn,ra as On,rb as Yn,rd as dn,sa as k,sd as xt,ta as Ue,tc as st,td as wt,u as In,ua as N,ud as F,va as H,vb as Jn,wa as de,wd as It,xa as Z,xb as qn,xd as St,y as Sn,ya as zn,yb as Zn,yc as te,za as kn,zb as Qn,zc as on}from"/build/_shared/chunk-6LJHK7HY.js";import{a as Qo,b as ei}from"/build/_shared/chunk-FYRGPKYK.js";import{e as j}from"/build/_shared/chunk-76K4WF2D.js";var e=j(ei()),s=j(Qo());var mn=j(ri());var Me=j(ti());var os=j(hi()),is=j(ui()),rs=j(si()),as=j(fi()),ss=j(ai()),ls=j(di()),cs=j(li()),Mo=j(ni()),ds=j(ii()),gn=j(ci());var ps=j(pi()),hs=j(oi());var jo=j(mi()),Ao=j(gi());var vn=t=>{let{actions:n,children:o,actionProps:r,onActionComplete:i}=t;return(0,e.jsx)(rn,{onReset:i,hooks:n,args:r,children:o})},vi=t=>{let{badges:n,children:o,badgeProps:r,...i}=t;return(0,e.jsx)(rn,{...i,hooks:n,args:r,children:o})},yi=[];function bi(t){let{children:n,flatIndex:o,index:r,params:i,payload:c,siblingIndex:a}=t,{navigate:l,navigateIntent:d}=pe(),u=we(),{panes:p,expand:h}=Ce(),f=(0,s.useMemo)(()=>u?.panes||yi,[u?.panes]),v=(0,s.useMemo)(()=>p?.[p.length-2],[p]),m=r-1,y=(0,s.useCallback)(b=>{let _=f[m]||[],I=_[a],D=b(_,I),S=[...f.slice(0,m),D,...f.slice(m+1)],C={...u||{},panes:S};return setTimeout(()=>l(C),0),C},[m,l,f,u,a]),w=(0,s.useCallback)(b=>{y((_,I)=>[..._.slice(0,a),{...I,payload:b},..._.slice(a+1)])},[y,a]),P=(0,s.useCallback)(b=>{y((_,I)=>[..._.slice(0,a),{...I,params:b},..._.slice(a+1)])},[y,a]),g=(0,s.useCallback)(b=>{let{id:_,parentRefPath:I,type:D,template:S}=b;l({panes:[...f.slice(0,m+1),[{id:_,params:{template:S.id,parentRefPath:xn(I),type:D},payload:S.params}]]})},[m,l,f]),x=(0,s.useMemo)(()=>({index:o,groupIndex:m,siblingIndex:a,payload:c,params:i,hasGroupSiblings:f[m]?f[m].length>1:!1,groupLength:f[m]?f[m].length:0,routerPanesState:f,ChildLink:Mt,BackLink:kt,ReferenceChildLink:jt,handleEditReference:g,ParameterizedLink:At,replaceCurrent:function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};y(()=>[{id:b.id||"",payload:b.payload,params:b.params||{}}])},closeCurrent:()=>{y((b,_)=>b.length>1?b.filter(I=>I!==_):b)},closeCurrentAndAfter:function(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)&&v&&h(v.element),l({panes:[...f.slice(0,m)]},{replace:!0})},duplicateCurrent:b=>{y((_,I)=>{let D={...I,payload:b?.payload||I.payload,params:b?.params||I.params};return[..._.slice(0,a),D,..._.slice(a)]})},setView:b=>{let _=(0,mn.default)(i,"view");return P(b?{..._,view:b}:_)},setParams:P,setPayload:w,navigateIntent:d}),[o,m,a,c,i,f,g,P,w,d,y,v,l,h]);return(0,e.jsx)(zt.Provider,{value:x,children:n})}function _i(t,n,o,r){var i,c;let a={flex:t.left.flex+t.right.flex,width:t.left.width+t.right.width},l=(i=n.minWidth)!=null?i:De,d=(c=o.minWidth)!=null?c:De,u=Math.min(n.maxWidth||1/0,a.width-d),p=Math.min(o.maxWidth||1/0,a.width-l),h=l-t.left.width,f=t.right.width-p;h<f&&(h=f);let v=t.right.width-d,m=u-t.left.width;v>m&&(v=m);let y=Math.min(Math.max(r,h),v),w=t.left.width+y,P=t.right.width-y,g=w/a.width*a.flex,x=P/a.width*a.flex;return{leftFlex:g,leftW:w,rightFlex:x,rightW:P}}function Pi(t,n){let o=[],r=n;for(;r!==t;){let i=r.parentElement;if(!i)return o;let a=Array.from(i.childNodes).indexOf(r);if(o.unshift(a),i===t)return o;r=i}return o}var Qt=[];function xi(t,n){let o=new WeakMap;for(let i of n)o.set(i,Pi(t,i));let r=(i,c)=>{let a=o.get(i)||Qt,l=o.get(c)||Qt,d=Math.max(a.length,l.length);for(let u=0;u<d;u+=1){let p=a[u]||-1,h=l[u]||-1;if(p!==h)return p-h}return 0};n.sort(r)}function wi(){let t=[],n=[],o=new WeakMap,r=new Set,i={},c=null,a=0,l=null,d=new Map,u=!1;function p(g){r.add(g),l===g&&(l=null),P()}function h(g){r.delete(g),l=g,P()}function f(g,x){return o.set(g,{...x,original:x}),n.push(g),c&&xi(c,n),h(g),()=>{let b=n.indexOf(g);b>-1&&n.splice(b,1),o.delete(g),P()}}function v(g,x,b){var _,I,D,S;let C=n.indexOf(x),O=o.get(x);if(!O)return;let z=n[C+1],L=o.get(z);if(L){if(g==="start"&&(u=!0,i.left={element:x,flex:O.flex||1,width:x.offsetWidth},i.right={element:z,flex:L.flex||1,width:z.offsetWidth},P()),g==="move"&&i.left&&i.right){d=new Map;let{leftW:T,rightW:M,leftFlex:W,rightFlex:$}=_i(i,O,L,b);d.set(x,{flex:W,width:T}),d.set(z,{flex:$,width:M}),P()}if(g==="end"){u=!1;let T=d.get(x),M=d.get(z);o.set(x,{...O,currentMinWidth:0,currentMaxWidth:(_=O.maxWidth)!=null?_:1/0,flex:(I=T?.flex)!=null?I:O.flex}),o.set(z,{...L,currentMinWidth:0,currentMaxWidth:(D=O.maxWidth)!=null?D:1/0,flex:(S=M?.flex)!=null?S:L.flex}),d=new Map,delete i.left,delete i.right,P()}}}function m(g){c=g}function y(g){a=g,P()}function w(g){return t.push(g),()=>{let x=t.push(g);x>-1&&t.splice(x,1)}}
1return{collapse:p,expand:h,mount:f,resize:v,setRootElement:m,setRootWidth:y,subscribe:w};function P(){var g,x,b,_;if(!a)return;let I=[];for(let T of n)T!==l&&I.unshift(T);l&&I.unshift(l);let D=new WeakMap,S=I.length,C=I[0],O=(S-1)*Te,z=a-O;for(let T of I){let M=o.get(T);if(!M)continue;let W=M.currentMinWidth||M.minWidth||De,$=T===C,ge=r.has(T),V=W>z,q=$?!1:ge||V,G=d.get(T);D.set(T,{element:T,collapsed:q,currentMinWidth:(g=G?.width)!=null?g:M.currentMinWidth,currentMaxWidth:(x=G?.width)!=null?x:M.currentMaxWidth,flex:(_=(b=G?.flex)!=null?b:M.flex)!=null?_:1}),q?z-=Te:z-=W-Te}let L=[];for(let T of n){let M=D.get(T);M&&L.push(M)}for(let T of t)T({expandedElement:l||n[n.length-1]||null,panes:L,resizing:u})}}function Ii(t){let{children:n,minWidth:o,onCollapse:r,onExpand:i,...c}=t,a=(0,s.useMemo)(()=>wi(),[]),[l,d]=(0,s.useState)(null),u=ce(l),p=u?.width||0,h=p===void 0||!o?void 0:p<o,[f,v]=(0,s.useState)({expandedElement:null,panes:[],resizing:!1});(0,s.useEffect)(()=>a.setRootElement(l),[a,l]),(0,s.useEffect)(()=>a.setRootWidth(p),[a,p]),(0,s.useEffect)(()=>a.subscribe(v),[a]),(0,s.useEffect)(()=>{h!==void 0&&(h&&r&&r(),!h&&i&&i())},[h,r,i]);let m=(0,s.useMemo)(()=>({collapse:a.collapse,collapsed:h,expand:a.expand,expandedElement:f.expandedElement,mount:a.mount,panes:f.panes,resize:a.resize,resizing:f.resizing}),[h,a,f.expandedElement,f.panes,f.resizing]);return(0,e.jsx)(Lt.Provider,{value:m,children:(0,e.jsx)($t,{"data-ui":"PaneLayout",...c,"data-collapsed":h?"":void 0,"data-resizing":f.resizing?"":void 0,"data-mounted":p?"":void 0,ref:d,children:n})})}function Si(t){let{documentId:n,documentType:o,flex:r}=t,{collapsed:i}=Ee(),{closeInspector:c,inspector:a}=A(),{features:l}=Y(),d=(0,s.useCallback)(()=>{a&&c(a.name)},[c,a]);if(i||!a)return null;let u=(0,s.createElement)(a.component,{onClose:d,documentId:n,documentType:o});return l.resizablePanes?(0,e.jsx)(Yt,{as:"aside","data-ui":"DocumentInspectorPanel",flex:r,maxWidth:Xt,minWidth:ze,children:u}):(0,e.jsx)(R,{as:"aside","data-ui":"DocumentInspectorPanel",flex:r,children:u})}var Ci=Object.defineProperty,Ti=(t,n,o)=>n in t?Ci(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,hn=(t,n,o)=>(Ti(t,typeof n!="symbol"?n+"":n,o),o),J=class extends Error{constructor(n){let{message:o,context:r,helpId:i,cause:c}=n;super(o),hn(this,"cause"),hn(this,"context"),hn(this,"helpId"),this.context=r,this.helpId=i,this.cause=c}},eo=new WeakMap;function Ae(t){let n=eo.get(t);if(n)return n;let o=rt();return eo.set(t,o),o}var no=new WeakMap;function Bo(t,n){let o=no.get(t)||new Map;if(o){let c=o.get(n);if(c)return c}let r=t[n];if(typeof r!="function")throw new Error("Expected property `".concat(n,"` to be a function but got ").concat(typeof r," instead."));let i=r.bind(t);return o.set(n,i),no.set(t,o),i}var Di=t=>!!t&&typeof t?.then=="function",Ei=t=>te(t)?typeof t.serialize=="function":!1,Ri=t=>(n,o,r)=>{try{return t(n,o,r)}catch(i){throw i instanceof J?i:new J({message:typeof i?.message=="string"?i.message:"",context:o,cause:i})}},Oi=t=>function(){return t(...arguments).pipe(nt(1),Vn())};function No(t){let n=Ri(Oi(t((o,r,i)=>{if(!o)throw new J({message:"Pane returned no child",context:r,helpId:"structure-item-returned-no-child"});return Di(o)||Kn(o)?Gn(o).pipe(xe(c=>n(c,r,i))):Ei(o)?n(o.serialize(r),r,i):typeof o=="function"?n(o(r.id,r),r,i):K(o)})));return n}async function zi(t){let n=new Map,r=No(d=>(u,p,h)=>{let f=u&&"".concat(Ae(u),"-").concat(p.path.join("__")),v=f&&n.get(f);if(v)return v;let m=d(u,p,h);return f&&n.set(f,m),m}),i=[[{id:"__edit__".concat(t.params.id),params:{...(0,mn.default)(t.params,["id"]),type:t.params.type},payload:t.payload}]];async function c(d){let{currentId:u,flatIndex:p,intent:h,params:f,parent:v,path:m,payload:y,unresolvedPane:w,levelIndex:P,structureContext:g}=d;var x;if(!w)return[];let{id:b,type:_,...I}=f,S=await Qe(r(w,{id:u,splitIndex:0,parent:v,path:m,index:p,params:{},payload:void 0,structureContext:g},p));return S.type==="document"&&S.id===b?[{panes:[...m.slice(0,m.length-1).map(C=>[{id:C}]),[{id:b,params:I,payload:y}]],depthIndex:m.length,levelIndex:P}]:(x=S.canHandleIntent)!=null&&x.call(S,h,f,{pane:S,index:p})||S.type==="documentList"&&S.schemaTypeName===_&&S.options.filter==="_type == $type"?[{panes:[...m.map(C=>[{id:C}]),[{id:f.id,params:I,payload:y}]],depthIndex:m.length,levelIndex:P}]:S.type==="list"&&S.child&&S.items?(await Promise.all(S.items.map((C,O)=>C.type==="divider"?Promise.resolve([]):c({currentId:C._id||C.id,flatIndex:p+1,intent:h,params:f,parent:S,path:[...m,C.id],payload:y,unresolvedPane:typeof S.child=="function"?Bo(S,"child"):S.child,levelIndex:O,structureContext:g})))).flat():[]}let l=(await c({currentId:"root",flatIndex:0,levelIndex:0,intent:t.intent,params:t.params,parent:null,path:[],payload:t.payload,unresolvedPane:t.rootPaneNode,structureContext:t.structureContext})).sort((d,u)=>d.depthIndex===u.depthIndex?d.levelIndex-u.levelIndex:d.depthIndex-u.depthIndex)[0];return l?l.panes:i}var ki=(t,n)=>{let o=t.replace(/^__edit__/,""),{params:r,payload:i,structureContext:{resolveDocumentNode:c}}=n,{type:a,template:l}=r;if(!a)throw new Error("Document type for document with ID ".concat(o," was not provided in the router params."));let d=c({schemaType:a,documentId:o}).id("editor");return l&&(d=d.initialValueTemplate(l,i)),d.serialize()};function Li(t){var n,o;return"contextHash(".concat(JSON.stringify({id:t.id,parentId:parent&&Ae(parent),path:t.path,index:t.index,splitIndex:t.splitIndex,serializeOptionsIndex:(n=t.serializeOptions)==null?void 0:n.index,serializeOptionsPath:(o=t.serializeOptions)==null?void 0:o.path}),")")}var to=t=>{let n={type:t.type,id:t.routerPaneSibling.id,params:t.routerPaneSibling.params||{},payload:t.routerPaneSibling.payload||null,flatIndex:t.flatIndex,groupIndex:t.groupIndex,siblingIndex:t.siblingIndex,path:t.path,paneNode:t.type==="resolvedMeta"?Ae(t.paneNode):null};return"metaHash(".concat(JSON.stringify(n),")")};function Le(t){let{unresolvedPane:n,flattenedRouterPanes:o,parent:r,path:i,resolvePane:c,structureContext:a}=t,[l,...d]=o,u=d[0],p={id:l.routerPaneSibling.id,splitIndex:l.siblingIndex,parent:r,path:[...i,l.routerPaneSibling.id],index:l.flatIndex,params:l.routerPaneSibling.params||{},payload:l.routerPaneSibling.payload,structureContext:a};try{return c(n,p,l.flatIndex).pipe(xe(h=>{let f={type:"resolvedMeta",...l,paneNode:h,path:p.path},v=d.map((y,w)=>({type:"loading",path:[...p.path,...d.slice(w).map((x,b)=>"[".concat(y.flatIndex+b,"]"))],paneNode:null,...y}
1));if(!d.length)return K([f]);let m;return u?.routerPaneSibling.id.startsWith("__edit__")?m=Le({unresolvedPane:ki,flattenedRouterPanes:d,parent:r,path:p.path,resolvePane:c,structureContext:a}):l.groupIndex===u?.groupIndex?m=Le({unresolvedPane:n,flattenedRouterPanes:d,parent:r,path:i,resolvePane:c,structureContext:a}):m=Le({unresolvedPane:typeof h.child=="function"?Bo(h,"child"):h.child,flattenedRouterPanes:d,parent:h,path:p.path,resolvePane:c,structureContext:a}),en(K([f,...v]),m.pipe(X(y=>[f,...y])))}))}catch(h){if(h instanceof J&&(h.context&&console.warn("Pane resolution error at index ".concat(h.context.index).concat(h.context.splitIndex>0?" for split pane index ".concat(h.context.splitIndex):"",": ").concat(h.message).concat(h.helpId?" - see ".concat(tn(h.helpId)):""),h),h.helpId==="structure-item-returned-no-child"))return K([]);throw h}}function Mi(t){let{routerPanesStream:n,rootPaneNode:o,initialCacheState:r={cacheKeysByFlatIndex:[],flattenedRouterPanes:[],resolvedPaneCache:new Map,resolvePane:()=>Yn},structureContext:i}=t;return n.pipe(X(a=>[[{id:"root"}],...a]),X(a=>a.flatMap((d,u)=>d.map((p,h)=>({routerPaneSibling:p,groupIndex:u,siblingIndex:h}))).map((d,u)=>({...d,flatIndex:u}))),tt([]),et(),X(a=>{let[l,d]=a;for(let u=0;u<d.length;u++){let p=l[u],h=d[u];if(!(0,Me.default)(p,h))return{flattenedRouterPanes:d,diffIndex:u}}return{flattenedRouterPanes:d,diffIndex:d.length}}),nn((a,l)=>{let{cacheKeysByFlatIndex:d,resolvedPaneCache:u}=a,{flattenedRouterPanes:p,diffIndex:h}=l,f=d.slice(0,h+1),v=d.slice(h+1),m=new Set(f.flatMap(P=>Array.from(P))),y=v.flatMap(P=>Array.from(P)).filter(P=>!m.has(P));for(let P of y)u.delete(P);return{flattenedRouterPanes:p,cacheKeysByFlatIndex:d,resolvedPaneCache:u,resolvePane:No(P=>(g,x,b)=>{let _=g&&"".concat(Ae(g),"-").concat(Li(x)),I=_&&u.get(_);if(I)return I;let D=P(g,x,b);if(!_)return D;let S=d[b]||new Set;return S.add(_),d[b]=S,u.set(_,D),D})}},r),xe(a=>{let{flattenedRouterPanes:l,resolvePane:d}=a;return Le({unresolvedPane:o,flattenedRouterPanes:l,parent:null,path:[],resolvePane:d,structureContext:i})})).pipe(nn((a,l)=>l.map((d,u)=>{let p=a[u];return!p||d.type!=="loading"?d:p.routerPaneSibling.id===d.routerPaneSibling.id?p:d}),[]),Qn((a,l)=>{if(a.length!==l.length)return!1;for(let d=0;d<l.length;d++){let u=a[d],p=l[d];if(to(u)!==to(p))return!1}return!0}))}function ji(){let t=(0,s.useMemo)(()=>new Un(1),[]),n=(0,s.useMemo)(()=>t.asObservable().pipe(X(r=>r?.panes||[])),[t]),{state:o}=pe();return(0,s.useEffect)(()=>{t.next(o)},[o,t]),n}function Ai(){let[t,n]=(0,s.useState)();if(t)throw t;let{structureContext:o,rootPaneNode:r}=Y(),[i,c]=(0,s.useState)({paneDataItems:[],resolvedPanes:[],routerPanes:[]}),a=ji();return(0,s.useEffect)(()=>{let d=Mi({rootPaneNode:r,routerPanesStream:a,structureContext:o}).pipe(X(u=>{let p=u.reduce((v,m)=>{let y=v[m.groupIndex]||[];return y[m.siblingIndex]=m.routerPaneSibling,v[m.groupIndex]=y,v},[]),h=p.length,f=u.map(v=>{var m;let{groupIndex:y,flatIndex:w,siblingIndex:P,routerPaneSibling:g,path:x}=v,b=g.id,_=p[y+1];return{active:y===h-2,childItemId:(m=_?.[0].id)!=null?m:null,index:w,itemId:g.id,groupIndex:y,key:"".concat(v.type==="loading"?"unknown":v.paneNode.id,"-").concat(b,"-").concat(P),pane:v.type==="loading"?re:v.paneNode,params:g.params||{},path:x.join(";"),payload:g.payload,selected:w===u.length-1,siblingIndex:P}});return{paneDataItems:f,routerPanes:p,resolvedPanes:f.map(v=>v.pane)}})).subscribe({next:u=>c(u),error:u=>n(u)});return()=>d.unsubscribe()},[r,a,o]),i}async function Bi(t,n,o){if(n&&o)return{id:n,type:o};if(!n&&o)return{id:at(),type:o};if(n&&!o){let r=await Qe(t.resolveTypeForDocument(n));return{id:n,type:r}}throw new J({message:"Neither document `id` or `type` was provided when trying to resolve intent."})}var Ni={},Wi=(0,s.memo)(function(){let{navigate:n}=pe(),o=we((0,s.useCallback)(d=>{let u=typeof d.intent=="string"?d.intent:void 0;return u?{intent:u,params:te(d.params)?d.params:Ni,payload:d.payload}:void 0},[])),{rootPaneNode:r,structureContext:i}=Y(),c=un(),[a,l]=(0,s.useState)(null);if(a)throw a;return(0,s.useEffect)(()=>{if(o){let{intent:d,params:u,payload:p}=o,h=!1;async function f(){let{id:v,type:m}=await Bi(c,typeof u.id=="string"?u.id:void 0,typeof u.type=="string"?u.type:void 0);if(h)return;let y=await zi({intent:d,params:{...u,id:v,type:m},payload:p,rootPaneNode:r,structureContext:i});h||n({panes:y},{replace:!0})}return f().catch(l),()=>{h=!0}}},[c,o,n,r,i]),null}),oo=Object.freeze,$i=Object.defineProperty,Hi=(t,n)=>oo($i(t,"raw",{value:oo(n||t.slice())})),io,Fi=B.span(io||(io=Hi([` 2 &:not(:last-child)::after { 3 content: ' \u279D '; 4 opacity: 0.5; 5 } 6`])));function Vi(t){return t.replace(/\(\.\.\.\)\./g,`(...) 7 .`).replace(/__WEBPACK_IMPORTED_MODULE_\d+_+/g,"").replace(/___default\./g,".").replace(new RegExp(" \\(https?:\\/\\/".concat(window.location.host),"g")," (")}function Ui(t){let{error:n}=t;if(!(n instanceof J))throw n;let{cause:o}=n,r=o?.stack||n.stack,i=r&&!(o instanceof ke)&&!n.message.includes("Module build failed:"),c=o instanceof ke?o.path:[],a=o instanceof ke&&o.helpId||n.helpId,l=(0,s.useCallback)(()=>{window.location.reload()},[]);return(0,e.jsx)(H,{height:"fill",overflow:"auto",padding:4,sizing:"border",tone:"critical",children:(0,e.jsxs)(Z,{children:[(0,e.jsx)(kn,{as:"h2",children:"Encountered an error while reading structure"}),(0,e.jsxs)(H,{marginTop:4,padding:4,radius:2,overflow:"auto",shadow:1,tone:"inherit",children:[c.length>0&&(0,e.jsxs)(U,{space:2,children:[(0,e.jsx)(Ve,{children:"Structure path"}),(0,e.jsx)(de,{children:c.slice(1).map((d,u)=>(0,e.jsx)(Fi,{children:d},"".concat(d,"-").concat(u)))})]}),(0,e.jsxs)(U,{marginTop:4,space:2,children:[(0,e.jsx)(Ve,{children:"Error"}),(0,e.jsx)(de,{children:i?Vi(r):n.message})]}),a&&(0,e.jsx)(R,{marginTop:4,children:(0,e.jsx)(E,{children:(0,e.jsx)("a",{href:tn(a),rel:"noopener noreferrer",target:"_blank",children:"View documentation"})})}),(0,e.jsx)(R,{marginTop:4,children:(0,e.jsx)(N,{text:"Reload",icon:We,tone:"primary",onClick:l})})]})]})})}function Gi(t){let{isSelected:n,pane:o,paneKey:r}=t,i=te(o)&&o.type||null;return(0,e.jsxs)(he,{id:r,selected:n,children:[(0,e.jsx)(Re,{title:"Unknown pane type"}),(0,e.jsx)(fe,{children:(0,e.jsx)(R,{padding:4,children:typeof i=="string"?(0,e.jsxs)(E,{as:"p",muted:!0,children:["Structure item of type ",(0,e.jsx)("code",{children:i})," is not a known entity."]}):(0,e.jsxs)(E,{as:"p",muted:!0,children:["Structure item is missing required ",(0,e.jsx)("code",{children:"type"})," property."]})})})]})}function Ki(t){let n=[{ms:300,message:"Loading\u2026"}
7,{ms:5e3,message:"Still loading\u2026"}];if(sn){let r=["Check console for errors?","Is your observable/promise resolving?",t.length>0?"Structure path: ".concat(t.join(" \u279D ")):""];n.push({ms:1e4,message:r.join(` 8`)})}let o=K(null);return Xn(...n.map(r=>{let{ms:i,message:c}=r;return o.pipe(qn(c),Zn(i))}))}var ro=Object.freeze,Xi=Object.defineProperty,Yi=(t,n)=>ro(Xi(t,"raw",{value:ro(n||t.slice())})),ao,Ji="Loading\u2026",qi=B(k)(ao||(ao=Yi([` 9 opacity: 0; 10 transition: opacity 200ms; 11 12 &[data-mounted] { 13 opacity: 1; 14 } 15`]))),me=(0,s.memo)(t=>{let{delay:n=300,flex:o,message:r=Ki,minWidth:i,paneKey:c,path:a,selected:l,title:d,tone:u}=t,p=(0,s.useMemo)(()=>typeof r=="function"?r(a?a.split(";"):[]):r,[r,a]),[h,f]=(0,s.useState)(()=>typeof p=="string"?p:Ji);(0,s.useEffect)(()=>{if(typeof p!="object"||typeof p.subscribe=="function")return;let g=p.subscribe(f);return()=>g.unsubscribe()},[p]);let[v,m]=(0,s.useState)(null),[y,w]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{if(v)return jn(()=>w(!0))},[v]),(0,e.jsx)(he,{flex:o,id:c,minWidth:i,selected:l,tone:u,children:(0,e.jsx)(fe,{children:(0,e.jsxs)(qi,{align:"center","data-mounted":y?"":void 0,direction:"column",height:"fill",justify:"center",ref:m,children:[(0,e.jsx)(Ue,{muted:!0}),(d||h)&&(0,e.jsx)(R,{marginTop:3,children:(0,e.jsx)(E,{align:"center",muted:!0,size:1,children:d||h})})]})})})});me.displayName="LoadingPane";var Zi={component:(0,s.lazy)(()=>import("/build/_shared/index-e553c86e-IZZXEMQ3.js")),document:(0,s.lazy)(()=>import("/build/_shared/index-c02bc045-P6BK43H4.js")),documentList:(0,s.lazy)(()=>import("/build/_shared/index-619c39ab-EOXF224Z.js")),list:(0,s.lazy)(()=>import("/build/_shared/index-1bf5a5bd-LL67U5KR.js"))},Qi=(0,s.memo)(function(n){let{active:o,childItemId:r,groupIndex:i,index:c,itemId:a,pane:l,paneKey:d,params:u,payload:p,path:h,selected:f,siblingIndex:v}=n,m=Zi[l.type]||Gi;return(0,e.jsx)(bi,{flatIndex:c,index:i,params:u,payload:p,siblingIndex:v,children:(0,e.jsx)(s.Suspense,{fallback:(0,e.jsx)(me,{paneKey:d,path:h,selected:f}),children:(0,e.jsx)(m,{childItemId:r||"",index:c,itemId:a,isActive:o,isSelected:f,paneKey:d,pane:l})})})},(t,n)=>{let{params:o={},payload:r=null,...i}=t,{params:c={},payload:a=null,...l}=n;if(!(0,Me.default)(o,c)||!(0,Me.default)(r,a))return!1;let d=new Set([...Object.keys(i),...Object.keys(l)]);for(let u of d)if(i[u]!==l[u])return!1;return!0});function Wo(t){let{children:n,currentMinWidth:o,flex:r,minWidth:i,paneKey:c,title:a="Error",tone:l="critical"}=t;return(0,e.jsxs)(he,{currentMinWidth:o,flex:r,id:c,minWidth:i,tone:l,children:[(0,e.jsx)(Re,{title:a}),(0,e.jsx)(fe,{overflow:"auto",children:(0,e.jsx)(R,{paddingX:4,paddingY:5,children:n})})]})}function er(t){return t==="delete"?`An error occurred while attempting to delete this document. 16 This usually means that there are other documents that refers to it.`:t==="unpublish"?`An error occurred while attempting to unpublish this document. 17 This usually means that there are other documents that refers to it.`:"An error occurred during ".concat(t)}function nr(t){return t==="publish"?"The document was published":t==="unpublish"?"The document was unpublished. A draft has been created from the latest published version.":t==="discardChanges"?"All changes since last publish has now been discarded. The discarded draft can still be recovered from history":t==="delete"?"The document was successfully deleted":"Successfully performed ".concat(t," on document")}var tr=["patch","commit"],or=(0,s.memo)(function(){let{push:n}=Pe(),{documentId:o,documentType:r}=A(),i=_t(o,r),c=(0,s.useRef)(i),a=ie();return(0,s.useEffect)(()=>{if(!i||i===c.current)return;let l;return i.type==="error"&&n({closable:!0,duration:3e4,status:"error",title:er(i.op
17),description:(0,e.jsxs)("details",{children:[(0,e.jsx)("summary",{children:"Details"}),i.error.message]})}),i.type==="success"&&!tr.includes(i.op)&&n({closable:!0,status:"success",title:nr(i.op)}),i.type==="success"&&i.op==="delete"&&(l=setTimeout(()=>a.closeCurrentAndAfter(),0)),c.current=i,()=>clearTimeout(l)},[i,a,n]),null});function ir(t,n,o){let r=Et(),[i,c]=(0,s.useState)(o),a=(0,s.useMemo)(()=>r.forNamespace("desk-tool"),[r]),l=(0,s.useMemo)(()=>t?a.forNamespace(t).forKey(n):a.forKey(n),[a,t,n]);(0,s.useEffect)(()=>{let u=l.listen(o).subscribe({next:c});return()=>u?.unsubscribe()},[o,n,t,l]);let d=(0,s.useCallback)(u=>{c(u),l.set(u)},[l]);return(0,s.useMemo)(()=>[i,d],[d,i])}var ae={id:"parsed",title:"Parsed"},se={id:"raw",title:"Raw JSON"},rr=[ae,se],je=(0,Ao.default)(1e3);function $o(t,n){let o=je.get(t);return o===void 0?(je.set(t,Array.isArray(n)||te(n)),$o(t,n)):o}function ar(t){let{path:n}=t,o=je.get(n);o!==void 0&&je.set(n,!o)}function Ho(t){let n=window.getSelection();if(n){let o=document.createRange();n.removeAllRanges(),o.selectNodeContents(t),n.addRange(o)}}function so(t){Ho(t.currentTarget)}function sr(t){t.keyCode===65&&(t.metaKey||t.ctrlKey)&&(t.preventDefault(),Ho(t.currentTarget))}function lr(t){return te(t)&&on(t._id)&&on(t._type)}var lo=Object.freeze,cr=Object.defineProperty,dr=(t,n)=>lo(cr(t,"raw",{value:lo(n||t.slice())})),co,ur=B.div(t=>{let{theme:n}=t,{color:o,fonts:r,space:i}=n.sanity;return Be(co||(co=dr([` 18 & .json-inspector, 19 & .json-inspector .json-inspector__selection { 20 font-family: `,`; 21 font-size: `,`px; 22 line-height: `,`px; 23 color: var(--card-code-fg-color); 24 } 25 26 & .json-inspector .json-inspector__leaf { 27 padding-left: `,`; 28 } 29 30 & .json-inspector .json-inspector__leaf.json-inspector__leaf_root { 31 padding-top: `,`; 32 padding-left: 0; 33 } 34 35 & .json-inspector > .json-inspector__leaf_root > .json-inspector__line > .json-inspector__key { 36 display: none; 37 } 38 39 & .json-inspector .json-inspector__line { 40 display: block; 41 position: relative; 42 cursor: default; 43 } 44 45 & .json-inspector .json-inspector__line::after { 46 content: ''; 47 position: absolute; 48 top: 0; 49 left: -200px; 50 right: -50px; 51 bottom: 0; 52 z-index: -1; 53 pointer-events: none; 54 } 55 56 & .json-inspector .json-inspector__line:hover::after { 57 background: var(--card-code-bg-color); 58 } 59 60 & .json-inspector .json-inspector__leaf_composite > .json-inspector__line { 61 cursor: pointer; 62 } 63 64 & .json-inspector .json-inspector__leaf_composite > .json-inspector__line::before { 65 content: '\u25B8 '; 66 margin-left: calc(0 - `,` + 3px); 67 font-size: `,`px; 68 line-height: `,`px; 69 } 70 71 & 72 .json-inspector 73 .json-inspector__leaf_expanded.json-inspector__leaf_composite 74 > .json-inspector__line::before { 75 content: '\u25BE '; 76 font-size: `,`px; 77 line-height: `,`px; 78 } 79 80 & .json-inspector .json-inspector__radio, 81 & .json-inspector .json-inspector__flatpath { 82 display: none; 83 } 84 85 & .json-inspector .json-inspector__value { 86 margin-left: `,`; 87 } 88 89 & 90 .json-inspector 91 > .json-inspector__leaf_root 92 > .json-inspector__line 93 > .json-inspector__key 94 + .json-inspector__value { 95 margin: 0; 96 } 97 98 & .json-inspector .json-inspector__key { 99 color: `,`; 100 } 101 102 & .json-inspector .json-inspector__value_helper, 103 & .json-inspector .json-inspector__value_null { 104 color: `,`; 105 } 106 107 & .json-inspector .json-inspector__not-found { 108 padding-top: `,`; 109 } 110 111 & .json-inspector .json-inspector__value_string { 112 color: `,`; 113 } 114 115 & .json-inspector .json-inspector__value_boolean { 116 color: `,`; 117 } 118 119 & .json-inspector .json-inspector__value_number { 120 color: `,`; 121 } 122 123 & .json-inspector .json-inspector__show-original { 124 display: inline-block; 125 padding: 0 6px; 126 cursor: pointer; 127 } 128 129 & .json-inspector .json-inspector__show-original:hover { 130 color: inherit; 131 } 132 133 & .json-inspector .json-inspector__show-original::before { 134 content: '\u2194'; 135 } 136 137 & .json-inspector .json-inspector__show-original:hover::after { 138 content: ' expand'; 139 } 140 `])),r.code.family,r.code.sizes[2].fontSize,r.code.sizes[2].lineHeight,ne(i[4]),ne(i[3]),ne(i[4]),r.code.sizes[2].fontSize,r.code.sizes[2].lineHeight,r.code.sizes[2].fontSize,r.code.sizes[2].lineHeight,ne(i[4]/2),o.syntax.property,o.syntax.constant,ne(i[3]),o.syntax.string,o.syntax.boolean,o.syntax.number)});function pr(t){let{onChange:n,query:o}=t,r=(0,s.useCallback)(i=>n(i.target.value),[n]);return(0,e.jsx)(Nn,{icon:Dn,onChange:r,placeholder:"Search",radius:2,value:o||""})}function hr(t){let{value:n}=t,{onInspectClose:o,paneKey:r}=A(),i="".concat(r,"_inspect_"),[c,a]=ir("desk-tool","inspect-view-preferred-view-mode-".concat(r),"parsed"),l=rr.find(p=>p.id===c),d=(0,s.useCallback)(()=>{a(ae.id)},[a]),u=(0,s.useCallback)(()=>{a(se.id)},[a]);return(0,e.jsx)(be,{id:"".concat(i,"dialog"),header:lr(n)?(0,e.jsxs)(e.Fragment,{children:["Inspecting"," ",(0,e.jsx)("em",{children:(0,e.jsx)(Ot,{document:n})})]}):(0,e.jsx)("em",{children:"No value"}),onClose:o,onClickOutside:o,width:3,children:(0,e.jsxs)(k,{direction:"column",height:"fill",children:[(0,e.jsx)(H,{padding:3,shadow:1,style:{position:"sticky",bottom:0,zIndex:3},children:(0,e.jsxs)(Ze,{space:1,children:[(0,e.jsx)(_e,{"aria-controls":"".concat(i,"tabpanel"),fontSize:1,id:"".concat(i,"tab-").concat(ae.id),label:ae.title,onClick:d,selected:l===ae}),(0,e.jsx)(_e,{"aria-controls":"".concat(i,"tabpanel"),fontSize:1,id:"".concat(i,"tab-").concat(se.id),label:se.title,onClick:u,selected:l===se})]})}),(0,e.jsxs)(Fn,{"aria-labelledby":"".concat(i,"tab-").concat(c),flex:1,id:"".concat(i,"tabpanel"),overflow:"auto",padding:4,style:{outline:"none"},children:[l===ae&&(0,e.jsx)(ur,{children:(0,e.jsx)(jo.default,{data:n,isExpanded:$o,onClick:ar,search:pr})}),l===se&&(0,e.jsx)(de,{language:"json",tabIndex:0,onKeyDown:sr,onDoubleClick:so,onFocus:so,children:JSON.stringify(n,null,2)})]})]})})}var uo=Object.freeze,fr=Object.defineProperty,mr=(t,n)=>uo(fr(t,"raw",{value:uo(n||t.slice())})),po,gr=B(H)(po||(po=mr([` 141 position: relative; 142 z-index: 50; 143`])));function vr(t){let{revisionId:n}=t,{documentId:o,documentType:r}=A(),{restore:i}=bt(o,r),{navigateIntent:c}=pe(),a=(0,s.useCallback)(()=>{n&&(i.execute(n),c("edit",{id:o,type:r}))},[o,r,c,i,n]);return(0,e.jsx)(gr,{"data-testid":"deleted-document-banner",shadow:1,tone:"transparent",children:(0,e.jsx)(Z,{paddingX:4,paddingY:n?2:3,sizing:"border",width:1,children:(0,e.jsxs)(k,{align:"center",children:[(0,e.jsx)(E,{size:1,children:(0,e.jsx)(Ne,{})}),(0,e.jsxs)(k,{align:"center",gap:2,flex:1,marginLeft:3,children:[(0,e.jsx)(E,{size:1,children:"This document has been deleted."}),n&&(0,e.jsx)(N,{fontSize:1,padding:2,mode:"bleed",tone:"primary",onClick:a,text:"Restore most recent version"})]})]})})})}var ho=Object.freeze,yr=Object.defineProperty,Fo=(t,n)=>ho(yr(t,"raw",{value:ho(n||t.slice())})),fo,mo,br=B(H)(fo||(fo=Fo([` 144 position: relative; 145 z-index: 50; 146`]))),go=B(E)(mo||(mo=Fo([` 147 & > * { 148 overflow: hidden; 149 overflow: clip; 150 white-space: nowrap; 151 text-overflow: ellipsis; 152 } 153`]))),Vo=(0,s.memo)(()=>{var t,n,o,r,i,c;let a=Dt(),{params:l,groupIndex:d,routerPanesState:u,replaceCurrent:p,BackLink:h}=ie(),f=(t=u[d])==null?void 0:t[0].id,v=u[d-1],m=v?.[0],y=m?.id,w=Boolean((n=m?.params)==null?void 0:n.rev),P=(0,s.useMemo)(()=>l?.parentRefPath&&ve(l.parentRefPath)||null,[l?.parentRefPath]),g=it(()=>{let _=P?.[0];if(!y||!_||!P)return K({loading:!1});let I=st(y),D=ve(_),S=D.findIndex(C=>typeof C=="object"&&"_key"in C);return en(K({loading:!0}),a.unstable_observePathsDocumentPair(I,S===-1?D:D.slice(0,S)).pipe(Jn(750),X(C=>{let{draft:O,published:z}=C;var L;return{loading:!1,result:{availability:{draft:O.availability,published:z.availability},refValue:(L=Pn(O.snapshot||z.snapshot,P))==null?void 0:L._ref}}})))},[a,y,P],{loading:!0}),x=(0,s.useCallback)(()=>{var _;g.loading||(_=g.result)!=null&&_.refValue&&p({id:g.result.refValue,params:l})},[g.loading,g.result,p,l]);return!y||!P||w||g.loading||!((o=g.result)!=null&&o.availability.draft.available)&&!((r=g.result)!=null&&r.availability.published.available)||((i=g.result)==null?void 0:i.refValue)===f?null:(0,e.jsx)(br,{shadow:1,tone:"caution","data-testid":"reference-changed-banner",children:(0,e.jsx)(Z,{paddingX:4,paddingY:2,sizing:"border",width:1,children:(0,e.jsxs)(k,{align:"center",children:[(0,e.jsx)(E,{size:1,children:(0,e.jsx)($e,{})}),(c=g.result)!=null&&c.refValue?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(R,{flex:1,marginLeft:3,children:(0,e.jsx)(go,{title:"This reference has changed since you opened it.",size:1,children:"This reference has changed since you opened it."})}),(0,e.jsx)(R,{marginLeft:3,children:(0,e.jsx)(N,{onClick:x,icon:We,fontSize:1,mode:"ghost",padding:2,space:2,text:"Reload reference"})})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(R,{flex:1,marginLeft:3,children:(0,e.jsx)(go,{title:"This reference has been removed since you opened it.",size:1,children:"This reference has been removed since you opened it."})}),(0,e.jsx)(R,{marginLeft:3,children:(0,e.jsx)(N,{as:h,icon:ye,fontSize:1,mode:"ghost",padding:2,space:2,text:"Close reference"})})]})]})})})});Vo.displayName="ReferenceChangedBanner";var vo=Object.freeze,_r=Object.defineProperty,Pr=(t,n)=>vo(_r(t,"raw",{value:vo(n||t.slice())})),yo,xr=B(H)(yo||(yo=Pr([` 154 position: relative; 155 z-index: 50; 156`])));function wr(t){let{granted:n,requiredPermission:o}=t;var r,i;let c=It(),a=((r=c?.roles)==null?void 0:r.length)!==1,l=Ir(((i=c?.roles)==null?void 0:i.map(d=>(0,e.jsx)("code",{children:d.title},d.name)))||[],", ");return n?null:(0,e.jsx)(xr,{"data-testid":"permission-check-banner",shadow:1,tone:"transparent",children:(0,e.jsx)(Z,{paddingX:4,paddingY:3,sizing:"border",width:1,children:(0,e.jsxs)(k,{align:"flex-start",children:[(0,e.jsx)(E,{size:1,children:(0,e.jsx)(Ne,{})}),(0,e.jsx)(R,{flex:1,marginLeft:3,children:(0,e.jsxs)(E,{size:1,children:["Your role",a&&"s"," ",l," ",a?"do":"does"," not have permissions to"," ",o," this document."]})})]})})})}function Ir(t,n){return t.reduce((o,r)=>o===null?[r]:o.concat([n,r]),null)}function Sr(t){let n=(0,s.useRef)();return(0,s.useEffect)(()=>{n.current=t},[t]),n.current}var Cr=1e3*60*60*24*24;function Tr(t){let n=Pe(),o=Sr(t.enabled);(0,s.useEffect)(()=>{!o&&t.enabled&&n.push({...t,duration:Cr}),o&&!t.enabled&&n.push({...t,duration:.01})},[t,n,o])}var Dr=t=>t.preventDefault(),Er=(0,s.forwardRef)(function(n,o){var r;let{hidden:i,margins:c}=n,{collapsedFieldSets:a,collapsedPaths:l,displayed:d,editState:u,documentId:p,documentType:h,fieldActions:f,onChange:v,validation:m,ready:y,formState:w,onFocus:P,onBlur:g,onSetCollapsedPath:x,onPathOpen:b,onSetCollapsedFieldSet:_,onSetActiveFieldGroup:I}=A(),D=un(),S=Tt(p),C=(0,s.useMemo)(()=>pt(),[]),O=(r=u?.transactionSyncLock)==null?void 0:r.enabled;
156Tr({id:"sync-lock-".concat(p),status:"warning",enabled:O,title:"Syncing document\u2026",description:"Please hold tight while the document is synced. This usually happens right after the document has been published, and it shouldn't take more than a few seconds"}),(0,s.useEffect)(()=>{let W=D.pair.documentEvents(p,h).pipe(ot($=>{$.type==="mutation"&&C.publish(Rr($)),$.type==="rebase"&&C.publish(Or($))})).subscribe();return()=>{W.unsubscribe()}},[p,D,h,C]);let z=Boolean(d?._rev);(0,s.useEffect)(()=>{z&&C.publish({type:"mutation",patches:[],snapshot:d})},[z]);let[L,T]=(0,s.useState)(null);(0,s.useEffect)(()=>{y&&!w?.focusPath.length&&L&&An(L)},[y]);let M=(0,s.useCallback)(W=>{T(W),typeof o=="function"?o(W):o&&(o.current=W)},[o]);return(0,e.jsx)(Z,{hidden:i,paddingX:4,paddingTop:5,paddingBottom:9,sizing:"border",width:1,children:(0,e.jsx)(gt,{margins:c,children:(0,e.jsx)(R,{as:"form",onSubmit:Dr,ref:M,children:y?w===null?(0,e.jsx)(R,{padding:2,children:(0,e.jsx)(E,{children:"This form is hidden"})}):(0,e.jsx)(ft,{__internal_fieldActions:f,__internal_patchChannel:C,collapsedFieldSets:a,collapsedPaths:l,focusPath:w.focusPath,changed:w.changed,focused:w.focused,groups:w.groups,id:"root",members:w.members,onChange:v,onFieldGroupSelect:I,onPathBlur:g,onPathFocus:P,onPathOpen:b,onSetFieldSetCollapsed:_,onSetPathCollapsed:x,presence:S,readOnly:w.readOnly,schemaType:w.schemaType,validation:m,value:w.value}):(0,e.jsx)(Rt,{ms:300,children:(0,e.jsxs)(k,{align:"center",direction:"column",height:"fill",justify:"center",children:[(0,e.jsx)(Ue,{muted:!0}),(0,e.jsx)(R,{marginTop:3,children:(0,e.jsx)(E,{align:"center",muted:!0,size:1,children:"Loading document"})})]})})})})})});function Rr(t){let n=t.mutations.map(o=>o.patch).filter(Boolean);return{type:"mutation",snapshot:t.document,patches:Se(t.origin,n)}}function Or(t){let n=t.remoteMutations.map(r=>r.patch).filter(Boolean),o=t.localMutations.map(r=>r.patch).filter(Boolean);return{type:"rebase",snapshot:t.document,patches:Se("remote",n).concat(Se("local",o))}}function zr(){let{activeViewId:t,paneKey:n,views:o}=A(),r="".concat(n,"tabpanel");return(0,e.jsx)(Ze,{space:1,children:o.map((i,c)=>{var a;return(0,e.jsx)(kr,{icon:i.icon,id:"".concat(n,"tab-").concat(i.id),isActive:t===i.id,label:(0,e.jsx)(e.Fragment,{children:i.title}),tabPanelId:r,viewId:c===0?null:(a=i.id)!=null?a:null},i.id)})})}function kr(t){let{isActive:n,tabPanelId:o,viewId:r}=t,{ready:i}=A(),{setView:c}=ie(),a=(0,s.useCallback)(()=>c(r),[c,r]);return(0,e.jsx)(_e,{...t,"aria-controls":o,disabled:!i,fontSize:1,selected:n,onClick:a})}function Lr(){let{connectionState:t,schemaType:n,title:o,value:r}=A(),i=Boolean(r)&&t==="connected",{error:c,value:a}=an({enabled:i,schemaType:n,value:r});return t!=="connected"?(0,e.jsx)(e.Fragment,{}):o?(0,e.jsx)(e.Fragment,{children:o}):r?c?(0,e.jsxs)(e.Fragment,{children:["Error: ",c.message]}):(0,e.jsx)(e.Fragment,{children:a?.title||(0,e.jsx)("span",{style:{color:"var(--card-muted-fg-color)"},children:"Untitled"})}):(0,e.jsxs)(e.Fragment,{children:["New ",n?.title||n?.name]})}var Mr=(0,s.memo)((0,s.forwardRef)(function(n,o){let{onMenuAction:r,onPaneClose:i,onPaneSplit:c,menuItems:a,menuItemGroups:l,schemaType:d,timelineStore:u,ready:p,views:h,unstable_languageFilter:f}=A(),{features:v}=Y(),{index:m,BackLink:y,hasGroupSiblings:w}=ie(),{actions:P}=ht(),g=(0,s.useMemo)(()=>Vt({actionHandler:r,fieldActions:P,menuItems:a,menuItemGroups:l}),[r,P,l,a]),x=(0,s.useMemo)(()=>g.filter(Ht),[g]),b=(0,s.useMemo)(()=>g.filter(Ft),[g]),_=h.length>1,I=oe(u,T=>T.revTime),{collapsed:D,isLast:S}=Ee(),C=S&&!D?-1:0,O=v.splitViews&&c&&h.length>1,z=O&&w,L=!z&&!v.backButton;return(0,e.jsx)(Re,{ref:o,loading:!p,title:(0,e.jsx)(Lr,{}),tabs:_&&(0,e.jsx)(zr,{}),tabIndex:C,backButton:v.backButton&&m>0&&(0,e.jsx)(N,{as:y,"data-as":"a",icon:In,mode:"bleed",padding:2}),subActions:(0,e.jsx)(Jt,{chunk:I,mode:"rev",placement:"bottom-end"}),actions:(0,e.jsxs)(k,{align:"center",gap:1,children:[f.length>0&&(0,e.jsx)(e.Fragment,{children:f.map((T,M)=>(0,s.createElement)(T,{key:"language-filter-".concat(M),schemaType:d}
156))}),x.map(T=>(0,e.jsx)(Wt,{node:T},T.key)),(0,e.jsx)(Bt,{nodes:b},"context-menu"),O&&(0,e.jsx)(Q,{content:(0,e.jsx)(E,{size:1,style:{whiteSpace:"nowrap"},children:"Split pane right"}),padding:2,placement:"bottom",portal:!0,children:(0,e.jsx)(N,{"aria-label":"Split pane right",icon:En,mode:"bleed",onClick:c},"split-pane-button")}),z&&(0,e.jsx)(N,{icon:ye,mode:"bleed",onClick:i,title:"Close split pane"},"close-view-button"),L&&(0,e.jsx)(N,{icon:ye,mode:"bleed",title:"Close pane group",as:y},"close-view-button")]})})})),bo=Object.freeze,jr=Object.defineProperty,Ar=(t,n)=>bo(jr(t,"raw",{value:bo(n||t.slice())})),_o,Br=B(R)({position:"relative"}),Nr=B(ct)(t=>{let{$disabled:n}=t;return n?{height:"100%"}:Be(_o||(_o=Ar([` 157 height: 100%; 158 overflow: auto; 159 position: relative; 160 scroll-behavior: smooth; 161 outline: none; 162 `])))}),Wr=function(n){let{footerHeight:o,isInspectOpen:r,rootElement:i,setDocumentPanelPortalElement:c}=n,{activeViewId:a,displayed:l,documentId:d,editState:u,inspector:p,value:h,views:f,ready:v,schemaType:m,permissions:y,isPermissionsLoading:w,isDeleting:P,isDeleted:g,timelineStore:x,formState:b}=A(),{collapsed:_}=Ce(),{collapsed:I}=Ee(),D=Xe(),{features:S}=Y(),[C,O]=(0,s.useState)(null),z=ce(C),L=(0,s.useRef)(null),[T,M]=(0,s.use
162State)(null),W=(0,s.useRef)(null),$=h._createdAt?"update":"create",ge=(0,s.useMemo)(()=>{if(b)return b.groups.find(le=>le.selected)},[b]),V=(0,s.useMemo)(()=>f.find(le=>le.id===a)||f[0]||{type:"form"},[a,f]),q=S.splitPanes&&L.current||D.element,G=(0,s.useMemo)(()=>_?[z?.height||0,0,o?o+2:2,0]:[0,0,2,0],[_,o,z]),Yo=V.type!=="form",Jo=(0,s.useMemo)(()=>V.type==="component"&&V.component&&(0,s.createElement)(V.component,{document:{draft:u?.draft||null,displayed:l||h,historical:l,published:u?.published||null},documentId:d,options:V.options,schemaType:m}),[V,l,d,u?.draft,u?.published,m,h]),qo=oe(x,le=>le.lastNonDeletedRevId);(0,s.useEffect)(()=>{T?.scrollTo&&T.scrollTo(0,0)},[d,T]),(0,s.useEffect)(()=>{q&&c(q)},[q,c]);let Zo=(0,s.useMemo)(()=>r?(0,e.jsx)(hr,{value:l||h}):null,[r,l,h]),_n=Boolean(!I&&p);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Mr,{ref:O}),(0,e.jsx)(fe,{children:(0,e.jsxs)(k,{height:"fill",children:[(S.resizablePanes||!_n)&&(0,e.jsx)(Br,{flex:2,overflow:"hidden",children:(0,e.jsx)(ue,{element:q,__unstable_elements:{documentScrollElement:T},children:(0,e.jsx)(Ge,{element:T,children:(0,e.jsxs)(vt,{scrollElement:T,containerElement:W,children:[V.type==="form"&&!w&&v&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(wr,{granted:Boolean(y?.granted),requiredPermission:$}),!P&&g&&(0,e.jsx)(vr,{revisionId:qo}),(0,e.jsx)(Vo,{})]}),(0,e.jsxs)(Nr,{$disabled:_||!1,"data-testid":"document-panel-scroller",ref:M,children:[(0,e.jsx)(Er,{hidden:Yo,margins:G,ref:W},d+(v?"_ready":"_pending")),Jo]},"".concat(ge?.name,"-").concat(d,"}")),Zo,(0,e.jsx)("div",{"data-testid":"document-panel-portal",ref:L})]})})})}),_n&&(0,e.jsx)(Ge,{element:i,children:(0,e.jsx)(Si,{documentId:d,documentType:m.name,flex:1})})]})})]})},Uo=["left","bottom"],$r={small:0,medium:1,large:2,full:"auto"};function Hr(t){let{dialog:n,referenceElement:o}=t;return(0,e.jsx)(Ye,{content:(0,e.jsx)(Fr,{dialog:n}),fallbackPlacements:Uo,open:!0,placement:"top",portal:!0,preventOverflow:!0,referenceElement:o})}function Fr(t){let{dialog:n}=t,{cancelButtonIcon:o,cancelButtonText:r,confirmButtonIcon:i,confirmButtonText:c,message:a,onCancel:l,onConfirm:d,tone:u}=n,{isTopLayer:p}=Ke(),[h,f]=(0,s.useState)(null),v=(0,s.useCallback)(()=>{p&&l()},[p,l]),m=(0,s.useCallback)(y=>{y.key==="Escape"&&p&&l()},[p,l]);return He(v,[h]),Fe(m),(0,e.jsxs)(k,{direction:"column",ref:f,style:{minWidth:320-16,maxWidth:400},children:[(0,e.jsx)(R,{flex:1,overflow:"auto",padding:4,children:(0,e.jsx)(E,{children:a})}),(0,e.jsx)(R,{paddingX:4,paddingY:3,style:{borderTop:"1px solid var(--card-border-color)"},children:(0,e.jsxs)(zn,{columns:2,gap:2,children:[(0,e.jsx)(N,{icon:o,onClick:l,mode:"ghost",text:r||"Cancel"}),(0,e.jsx)(N,{icon:i,onClick:d,text:c||"Confirm",tone:u})]})})]})}function Vr(t){let{dialog:n}=t,o=(0,s.useId)(),r=n.footer&&(0,e.jsx)(R,{paddingX:4,paddingY:3,children:n.footer});return(0,e.jsx)(Ie,{zOffset:"fullscreen",children:(0,e.jsx)(be,{__unstable_hideCloseButton:n.showCloseButton===!1,footer:r,header:n.header,id:o,onClose:n.onClose,onClickOutside:n.onClose,width:n.width===void 0?1:$r[n.width],children:(0,e.jsx)(R,{padding:4,children:n.content})})})}function Ur(t){let{dialog:n,referenceElement:o}=t;return(0,e.jsx)(Ye,{content:(0,e.jsx)(Gr,{dialog:n}),fallbackPlacements:Uo,open:!0,placement:"top",portal:!0,preventOverflow:!0,referenceElement:o})}function Gr(t){let{dialog:n}=t,{content:o,onClose:r}=n,{isTopLayer:i}=Ke(),[c,a]=(0,s.useState)(null),l=(0,s.useCallback)(()=>{i&&r()},[i,r]),d=(0,s.useCallback)(u=>{u.key==="Escape"&&i&&r()},[i,r]);return He(l,[c]),Fe(d),(0,e.jsx)("div",{ref:a,children:o})}function Po(t){let{children:n}=t,{element:o,elements:r}=Xe(),i=r?.[pn]||o;return(0,e.jsx)(ue,{element:i,children:n})}function yn(t){let{dialog:n,referenceElement:o=null}=t,r=(0,s.useId)();if(n.type==="confirm")return(0,e.jsx)(Hr,{dialog:n,referenceElement:o});if(n.type==="popover")return(0,e.jsx)(Ur,{dialog:n,referenceElement:o});if(n.type==="dialog"||!n.type)return(0,e.jsx)(Po,{children:(0,e.jsx)(Vr,{dialog:n})});if(n.type==="custom")return(0,e.jsx)(Po,{children:n?.component});let i=n;return console.warn("Unsupported modal type ".concat(i.type)),(0,e.jsx)(be,{id:r,onClose:i.onClose,onClickOutside:i.onClose,width:2,children:(0,e.jsx)(R,{padding:4,children:i.content||(0,e.jsxs)(e.Fragment,{children:["Unexpected modal type (",(0,e.jsx)("code",{children:i.type}),")"]})})})}function Kr(t){let{actionStates:n,disabled:o}
162=t,r=(0,s.useId)(),i=(0,s.useRef)(null),[c,a]=(0,s.useState)(-1),[l,d]=(0,s.useState)(null),u=(0,s.useCallback)(f=>{a(f)},[]),p=(0,s.useMemo)(()=>({placement:"top-end",portal:!0,preventOverflow:!0}),[]),h=n[c];return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)($n,{id:"".concat(r,"-action-menu"),button:(0,e.jsx)(N,{"data-testid":"action-menu-button","aria-label":"Open document actions",disabled:o,icon:Sn,mode:"ghost",ref:i}),menu:(0,e.jsx)(Wn,{padding:1,children:n.map((f,v)=>(0,e.jsx)(Xr,{actionState:f,disabled:o,index:v,onAction:u},v))}),popover:p,ref:d}),h&&h.dialog&&(0,e.jsx)(Ie,{zOffset:"paneFooter",children:(0,e.jsx)(yn,{dialog:h.dialog,referenceElement:l})})]})}function Xr(t){let{actionState:n,disabled:o,index:r,onAction:i}=t,{onHandle:c}=n,a=(0,s.useCallback)(()=>{i(r),c&&c()},[r,i,c]),l=n.title&&(0,e.jsx)(R,{padding:2,children:(0,e.jsx)(E,{size:1,children:n.title})});return(0,e.jsx)(Hn,{"data-testid":"action-".concat(n.label.replace(" ","")),disabled:o||Boolean(n.disabled),onClick:a,padding:0,tone:n.tone,children:(0,e.jsx)(Q,{content:l,disabled:!l,fallbackPlacements:["left","bottom"],placement:"top",portal:!0,children:(0,e.jsxs)(k,{align:"center",paddingX:3,children:[(0,e.jsxs)(k,{flex:1,paddingY:3,children:[n.icon&&(0,e.jsx)(R,{marginRight:3,children:(0,e.jsxs)(E,{children:[(0,s.isValidElement)(n.icon)&&n.icon,(0,Mo.isValidElementType)(n.icon)&&(0,s.createElement)(n.icon)]})}),(0,e.jsx)(E,{children:n.label})]}),n.shortcut&&(0,e.jsx)(R,{marginLeft:3,children:(0,e.jsx)(qe,{keys:String(n.shortcut).split("+").map(d=>d.slice(0,1).toUpperCase()+d.slice(1))})})]})})})}function Go(t){let{disabled:n,showMenu:o,states:r}=t,[i,...c]=r,[a,l]=(0,s.useState)(null),d=(0,s.useMemo)(()=>!i||!i.title&&!i.shortcut?null:(0,e.jsxs)(k,{padding:2,style:{maxWidth:300},align:"center",children:[(0,e.jsx)(E,{size:1,children:i.title}),i.shortcut&&(0,e.jsx)(R,{marginLeft:i.title?2:0,children:(0,e.jsx)(qe,{keys:String(i.shortcut).split("+").map(u=>u.slice(0,1).toUpperCase()+u.slice(1).toLowerCase())})})]}),[i]);return(0,e.jsxs)(k,{children:[i&&(0,e.jsx)(Bn,{zOffset:200,children:(0,e.jsx)(Q,{disabled:!d,content:d,portal:!0,placement:"top",children:(0,e.jsx)(U,{flex:1,children:(0,e.jsx)(N,{"data-testid":"action-".concat(i.label),disabled:n||Boolean(i.disabled),icon:i.icon,onClick:i.onHandle,ref:l,text:i.label,tone:i.tone||"primary"})})})}),o&&c.length>0&&(0,e.jsx)(R,{marginLeft:1,children:(0,e.jsx)(Kr,{actionStates:c,disabled:n})}),i&&i.dialog&&(0,e.jsx)(yn,{dialog:i.dialog,referenceElement:a})]})}var Yr=(0,s.memo)(function(){let{actions:n,connectionState:o,documentId:r,editState:i}=A();return!n||!i?null:(0,e.jsx)(vn,{actions:n,actionProps:i,children:c=>{let{states:a}=c;return(0,e.jsx)(Go,{disabled:o!=="connected",showMenu:n.length>1,states:a},r)}})}),Jr=(0,s.memo)(function(){let{connectionState:n,editState:o,timelineStore:r}=A(),i=oe(r,u=>u.revTime),c=i?.id||"",a=(o?.draft||o?.published||{})._rev===c,l=(0,s.useMemo)(()=>({...o||{},revision:c}),[o,c]),d=(0,s.useMemo)(()=>[Ut],[]);return(0,e.jsx)(vn,{actions:d,actionProps:l,children:u=>{let{states:p}=u;return(0,e.jsx)(Go,{disabled:n!=="connected"||Boolean(a),showMenu:!1,states:p})}})}),qr={primary:"primary",success:"positive",warning:"caution",danger:"critical"};function Zr(t){let{states:n}=t;return(0,e.jsx)(Ln,{space:1,children:n.map((o,r)=>
162(0,e.jsx)(Q,{content:o.title&&(0,e.jsx)(R,{padding:2,children:(0,e.jsx)(E,{size:1,children:o.title})}),disabled:!o.title,placement:"top",portal:!0,children:(0,e.jsx)(On,{fontSize:1,mode:"outline",paddingX:2,paddingY:1,radius:4,tone:o.color?qr[o.color]:void 0,style:{whiteSpace:"nowrap"},children:o.label})},String(r)))})}function Qr(){let{badges:t,editState:n}=A();return!n||!t?null:(0,e.jsx)(vi,{badges:t,badgeProps:n,children:o=>{let{states:r}=o;return(0,e.jsx)(Zr,{states:r})}})}var xo=Object.freeze,ea=Object.defineProperty,na=(t,n)=>xo(ea(t,"raw",{value:xo(n||t.slice())})),wo,ta=B(k)(wo||(wo=na([` 163 cursor: default; 164`])));function oa(t){let{collapsed:n,disabled:o,lastPublished:r,lastUpdated:i,liveEdit:c}=t,a=F(r||"",{minimal:!0,agoSuffix:!0}),l=F(r||"",{minimal:!0}),d=F(i||"",{minimal:!0,agoSuffix:!0}),u=F(i||"",{minimal:!0}),p=F(i||"",{minimal:!1,agoSuffix:!0}),h=F(r||"",{minimal:!1,agoSuffix:!0}),f=c?"Last updated ".concat(p):"Last published ".concat(h);return(0,e.jsx)(ta,{align:"center","data-ui":"SessionLayout",sizing:"border",children:(0,e.jsx)(Q,{placement:"top",portal:!0,content:(0,e.jsx)(U,{padding:3,space:3,children:(0,e.jsx)(E,{size:1,children:c?(0,e.jsxs)(e.Fragment,{children:["Last updated"," ",(0,e.jsx)("abbr",{"aria-label":i?p:h,children:i?d:a})]}):(0,e.jsxs)(e.Fragment,{children:["Last published ",(0,e.jsx)("abbr",{"aria-label":h,children:a})]})})}),children:(0,e.jsx)(N,{mode:"bleed",tone:c?"critical":"positive",tabIndex:-1,disabled:o,"aria-label":f,children:(0,e.jsxs)(k,{align:"center",children:[(0,e.jsx)(R,{marginRight:n?0:3,children:(0,e.jsx)(E,{size:2,"aria-hidden":"true",children:c?(0,e.jsx)(Cn,{}):(0,e.jsx)(Tn,{})})}),!n&&(0,e.jsx)(E,{size:1,weight:"medium",children:c?(0,e.jsx)("abbr",{"aria-label":f,children:i?u:l}):(0,e.jsx)("abbr",{"aria-label":f,children:l})})]})})})})}var Io=Object.freeze,ia=Object.defineProperty,bn=(t,n)=>
164Io(ia(t,"raw",{value:Io(n||t.slice())})),So,Co,To,ra=B(ee.path)(So||(So=bn([` 165 transform-origin: center; 166`]))),aa=t=>(0,e.jsx)(ee.circle,{fill:"none",r:"8",cx:"12.5",cy:"12.5",strokeWidth:"1.2",...t}),sa=t=>(0,e.jsx)(ra,{fill:"none",d:"M14 17.5619L11.5 20.5L14.5 23.0619M11 7.43811L13.5 4.50001L10.5 1.93811",...t}),la=t=>(0,e.jsx)(ee.path,{d:"M9.5 12.1316L11.7414 14.5L16 10",...t}),ca=t=>(0,e.jsx)(ee.path,{d:"M15 7L18 10M6 19L7 15L17 5L20 8L10 18L6 19Z",...t}),da=wn(Co||(Co=bn([` 167 0% { 168 transform: rotate(0); 169 } 170 100% { 171 transform: rotate(360deg); 172 } 173`]))),ua=B.g(To||(To=bn([` 174 transform-origin: center; 175 176 &[data-rotate] { 177 animation: `,` 1s ease-in-out infinite; 178 } 179`])),da),pa={syncing:{scale:1,transition:{duration:0}},saved:{scale:[1,.8,1.2,.9,1.1,.95,1.05,.99,1],transition:{duration:.5,delay:.2}},changes:{transition:{duration:0}}},ha={syncing:{strokeDasharray:"0, 0, 23, 3, 23, 3",strokeDashoffset:10,opacity:1,transition:{duration:0}},saved:{strokeDasharray:"0, 0, 23, 0, 23, 0",strokeDashoffset:10,opacity:1,transition:{duration:.2}},changes:{strokeDasharray:"0, 60, 23, 0, 23, 0",strokeDashoffset:0,opacity:0,transition:{duration:.5}}},fa={syncing:{opacity:1,transition:{duration:0}},saved:{opacity:0,transition:{duration:.2}},changes:{opacity:0}},ma={syncing:{pathLength:0,transition:{duration:0}},saved:{pathLength:1,transition:{delay:.4,duration:.3}},changes:{pathLength:0,transition:{duration:.2}}},ga={syncing:{pathLength:0,transition:{duration:0}},saved:{pathLength:0,transition:{duration:0}},changes:{pathLength:1,transition:{duration:.4,delay:.5}}};function va(t){let{status:n}=t;return n?(0,e.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",stroke:"currentColor",strokeWidth:"1.2","data-sanity-icon":"",children:(0,e.jsxs)(ee.g,{variants:pa,initial:n,animate:n,children:[(0,e.jsxs)(ua,{"data-rotate":n==="changes"?void 0:"",children:[(0,e.jsx)(sa,{variants:fa,initial:n,animate:n}),(0,e.jsx)(aa,{variants:ha,initial:n,animate:n})]}),(0,e.jsx)(la,{variants:ma,initial:n,animate:n}),(0,e.jsx)(ca,{variants:ga,initial:n,animate:n})]})}):null}var ya=s.default.forwardRef(function(n,o){let{collapsed:r,status:i,lastUpdated:c,...a}=n,l=F(c||"",{minimal:!0}),d=F(c||"",{minimal:!0,agoSuffix:!0}),u=F(c||"",{minimal:!1,agoSuffix:!0}),p=(0,s.useMemo)(()=>i==="syncing"?{text:"Saving...",tone:void 0}:i==="changes"?{text:l,tone:"caution"}:i==="saved"?{text:"Saved!",tone:"positive"}:{},[i,l]);return i?(0,e.jsx)(Q,{placement:"top",portal:!0,disabled:i!=="changes",content:(0,e.jsxs)(U,{padding:3,space:3,children:[(0,e.jsx)(E,{size:1,weight:"semibold",children:"Review changes"}),(0,e.jsxs)(E,{size:1,muted:!0,children:["Changes saved ",(0,e.jsx)("abbr",{"aria-label":u,children:d})]})]}),children:(0,e.jsx)(N,{mode:"bleed",justify:"flex-start",tone:p?.tone,...a,"data-testid":"review-changes-button",ref:o,"aria-label":"Review changes",children:(0,e.jsxs)(k,{align:"center",children:[(0,e.jsx)(R,{marginRight:r?0:3,"aria-hidden":"true",children:(0,e.jsx)(E,{children:(0,e.jsx)(va,{status:i})})}),!r&&(0,e.jsx)(E,{size:1,weight:"medium",children:p?.text})]})})}):null}),ba=s.default.memo(ya),_a=1e3,Pa=3e3,xa=(0,s.memo)(function(){var n;let{changesOpen:o,documentId:r,documentType:i,editState:c,onHistoryClose:a,onHistoryOpen:l,timelineStore:d,value:u}=A(),p=xt(r,i),h=u?._updatedAt,f=(n=c?.published)==null?void 0:n._updatedAt,v=Boolean(c?.liveEdit),m=Boolean(c?.published),y=Boolean(c?.draft),[w,P]=(0,s.useState)(null),g=ce(w),x=!g||g?.width<300,[b,_]=(0,s.useState)(null),I=oe(d,C=>C.onOlderRevision);(0,s.useEffect)(()=>{if(b==="syncing"&&!p.isSyncing){let C=setTimeout(()=>_("saved"),_a);return()=>clearTimeout(C)}if(b==="saved"){let C=setTimeout(()=>_(null),Pa);return()=>clearTimeout(C)}},[b,h,p.isSyncing]),(0,s.useLayoutEffect)(()=>{_(null)},[r]),(0,s.useLayoutEffect)(()=>{p.isSyncing&&_("syncing")},[p.isSyncing,h]);let D=(0,s.useMemo)(()=>(0,e.jsx)(ba,{lastUpdated:h,status:b||(y?"changes":void 0),onClick:o?a:l,disabled:I,selected:o,collapsed:x}),[y,o,a,l,h,I,b,x]),S=(0,s.useMemo)(()=>(v||m)&&(0,e.jsx)(R,{marginRight:1,children:(0,e.jsx)(oa,{disabled:I,lastPublished:f,lastUpdated:h,liveEdit:v,collapsed:x})}),[x,f,h,v,m,I]);return(0,e.jsxs)(k,{align:"center","data-ui":"DocumentSparkline",ref:P,children:[S,(0,e.jsxs)(k,{align:"center",flex:1,children:[D,!x&&(0,e.jsx)(R,{marginLeft:3,children:(0,e.jsx)(Qr,{})})]})]})}),Do=Object.freeze,wa=Object.defineProperty,Ia=(t,n)=>Do(wa(t,"raw",{value:Do(n||t.slice())})),Eo,Sa=B(R)(Eo||(Eo=Ia([` 180 min-width: 10em; 181 max-width: 16em; 182`])));function Ca(t){let{actionsBoxRef:n}=t,{badges:o,timelineStore:r}=A(),i=oe(r,c=>c.onOlderRevision);return(0,s.useMemo)(()=>(0,e.jsx)(R,{paddingLeft:2,paddingRight:[2,3],paddingY:2,children:(0,e.jsxs)(k,{align:"center",children:[(0,e.jsx)(R,{flex:[1,2],children:o&&(0,e.jsx)(xa,{})}),(0,e.jsx)(Sa,{flex:1,marginLeft:[1,3],ref:n,children:i?(0,e.jsx)(Jr,{}):(0,e.jsx)(Yr,{})})]})}),[n,o,i])}function Ta(t){let{actionsBoxElement:n,activeIndex:o,as:r="div",children:i,id:c,onActionStart:a,onKeyDown:l,rootRef:d,states:u,...p}=t,h=u[o],f=(0,s.useCallback)(v=>{let m=u.filter(w=>w.shortcut&&(0,gn.default)(w.shortcut,v)),y=m[0];if(m.length>1&&console.warn('Keyboard shortcut conflict: More than one document action matches the shortcut "'.concat(y.shortcut,'"')),y&&!y.disabled&&y.onHandle){v.preventDefault(),y.onHandle(),a(u.indexOf(y));return}l&&l(v)},[a,l,u]);return(0,s.createElement)(r,{id:c,onKeyDown:f,tabIndex:-1,...p,ref:d},[i,h&&h.dialog&&(0,e.jsx)(Ie,{zOffset:"paneFooter",children:(0,e.jsx)(yn,{dialog:h.dialog,referenceElement:n})})])}var Ko=s.default.memo(t=>{let{actionsBoxElement:n,as:o="div",children:r,...i}=t,{actions:c,editState:a}
182=A(),[l,d]=(0,s.useState)(-1),u=(0,s.useCallback)(h=>{d(h)},[]),p=(0,s.useMemo)(()=>a&&{...a,onComplete:()=>{},revision:void 0},[a]);return!p||!c?null:(0,e.jsx)(vn,{actionProps:p,actions:c,children:h=>{let{states:f}=h;return(0,e.jsx)(Ta,{...i,activeIndex:l,actionsBoxElement:n,as:o,onActionStart:u,states:f,children:r})}})});Ko.displayName="DocumentActionShortcuts";var Ro=Object.freeze,Da=Object.defineProperty,Ea=(t,n)=>Ro(Da(t,"raw",{value:Ro(n||t.slice())})),Oo,zo=["fixed","fixed","absolute"],Ra=B(dt)(Oo||(Oo=Ea([` 183 flex: 1; 184 display: flex; 185 flex-direction: column; 186 min-height: 0; 187 min-width: 0; 188`]))),gs=(0,s.memo)(function(n){let{name:o}=cn();return(0,e.jsx)(ln,{name:n.pane.source||o,children:(0,e.jsx)(Oa,{...n})})});function Oa(t){var n;let{pane:o,paneKey:r}=t,{resolveNewDocumentOptions:i}=cn().document,c=ie(),a=za(o.options,c.params),{documentType:l,isLoaded:d}=St(a.id,a.type),u=(0,s.useMemo)(()=>i({type:"document",documentId:a.id,schemaType:a.type}),[a.id,a.type,i]),[p,h]=Ct({templateItems:u}),f=d&&!h,v=(0,s.useMemo)(()=>f&&l&&a.type!==l?ka(t,a,l):t,[t,l,f,a]),{ReferenceChildLink:m,handleEditReference:y,groupIndex:w,routerPanesState:P}=c,g=((n=P[w+1])==null?void 0:n[0].params)||{},x=P.length,{parentRefPath:b}=g,_=(0,s.useMemo)(()=>b?{path:ve(b),state:w>=x-1?"none":w>=x-2?"selected":"pressed"}:{path:[],state:"none"},[b,w,x]);return a.type==="*"&&!f?(0,e.jsx)(me,{flex:2.5,minWidth:320,paneKey:r,title:"Loading document\u2026"}):l?(0,e.jsx)(qt,{...v,children:(0,e.jsx)(mt,{EditReferenceLinkComponent:m,onEditReference:y,initialValueTemplateItems:p,activePath:_,children:(0,e.jsx)(La,{})})},"".concat(l,"-").concat(a.id)):(0,e.jsx)(Wo,{flex:2.5,minWidth:320,paneKey:r,title:(0,e.jsx)(e.Fragment,{children:"The document was not found"}),children:(0,e.jsx)(U,{space:4,children:(0,e.jsxs)(E,{as:"p",children:["The document type is not defined, and a document with the ",(0,e.jsx)("code",{children:a.id})," ","identifier could not be found."]})})})}function za(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=wt();return(0,s.useMemo)(()=>{if(t.type&&t.type!=="*")return t;let r=t.template||n.template,i=r?o.find(a=>a.id===r):void 0,c=i?.schemaType;return c?{...t,type:c}:t},[t,n.template,o])}function ka(t,n,o){return{...t,pane:{...t.pane,options:{...n,type:o}}}}function La(){let{changesOpen:t,documentType:n,inspector:o,inspectOpen:r,onFocus:i,onPathOpen:c,onHistoryOpen:a,onKeyUp:l,paneKey:d,schemaType:u,value:p}=A(),{collapsed:h}=Ce(),f=ut(),[v,m]=(0,s.useState)(null),[y,w]=(0,s.useState)(null),[P,g]=(0,s.useState)(null),[x,b]=(0,s.useState)(null),_=ce(y),I=_?.height,D=(0,s.useCallback)(O=>{c(O),i(O)},[c,i]),S=Kt+(o?ze:0),C=Gt+(o?ze:0);return u?(0,e.jsxs)(Ko,{actionsBoxElement:P,as:he,currentMinWidth:S,"data-testid":"document-pane",flex:2.5,id:d,minWidth:C,onKeyUp:l,rootRef:m,children:[(0,e.jsx)(Je,{position:zo,zOffset:f.portal,children:(0,e.jsx)(k,{direction:"column",flex:1,height:h?void 0:"fill",children:(0,e.jsx)(Ra,{"data-testid":"change-connector-root",isReviewChangesOpen:t,onOpenReviewChanges:a,onSetFocus:D,children:(0,e.jsx)(Wr,{footerHeight:I||null,isInspectOpen:r,rootElement:v,setDocumentPanelPortalElement:b})})})}),(0,e.jsx)(ue,{__unstable_elements:{[pn]:x},children:(0,e.jsx)(Je,{position:zo,zOffset:f.portal,children:(0,e.jsx)(Nt,{ref:w,children:(0,e.jsx)(Ca,{actionsBoxRef:g})})})}),(0,e.jsx)(or,{})]}):(0,e.jsx)(Wo,{currentMinWidth:S,flex:2.5,minWidth:C,paneKey:d,title:(0,e.jsxs)(e.Fragment,{children:["Unknown document type: ",(0,e.jsx)("code",{children:n})]}),tone:"caution",children:(0,e.jsxs)(U,{space:4,children:[n&&(0,e.jsxs)(E,{as:"p",children:["This document has the schema type ",(0,e.jsx)("code",{children:n}),", which is not defined as a type in the local content studio schema."]}),!n&&(0,e.jsx)(E,{as:"p",children:"This document does not exist, and no schema type was specified for it."}),sn&&p&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(E,{as:"p",children:"Here is the JSON representation of the document:"}),(0,e.jsx)(H,{padding:3,overflow:"auto",radius:2,shadow:1,tone:"inherit",children:(0,e.jsx)(de,{language:"json",size:[1,1,2],children:JSON.stringify(p,null,2)})})]})]})})}function Ma(){return(0,e.jsx)(H,{height:"fill",children:(0,e.jsx)(k,{align:"center",height:"fill",justify:"center",padding:4,sizing:"border",children:(0,e.jsx)(Z,{width:0,children:(0,e.jsx)(H,{padding:4,radius:2,shadow:1,tone:"caution",children:(0,e.jsxs)(k,{children:[(0,e.jsx)(R,{children:(0,e.jsx)(E,{size:1,children:(0,e.jsx)($e,{})})}),(0,e.jsxs)(U,{flex:1,marginLeft:3,space:3,children:[(0,e.jsx)(E,{as:"h1",size:1,weight:"bold",children:"No document types"}),(0,e.jsx)(E,{as:"p",muted:!0,size:1,children:"Please define at least one document type in your schema."}),(0,e.jsx)(E,{as:"p",muted:!0,size:1,children:(0,e.jsx)("a",{href:"https://www.sanity.io/docs/create-a-schema-and-configure-sanity-studio",target:"_blank",rel:"noreferrer",children:"Learn how to add a document type \u2192"})})]})]})})})})})}var ja=t=>{let{documentId:n,documentType:o}=t,r=Pt(n,o),i=dn(),c=!r?.published&&!r?.draft,a=r?.draft||r?.published,l=i.get(o),{value:d,isLoading:u}=an({enabled:!0,schemaType:l,value:a}),p=c?"New ".concat(l?.title||l?.name):d?.title||"Untitled",h=r.ready&&!u,f=Xo(p);return(0,s.useEffect)(()=>{h&&(document.title=f)},[p,h,f]),null},fn=t=>{let{title:n}=t,o=Xo(n);return(0,s.useEffect)(()=>{document.title=o},[o,n]),null},Aa=t=>{let{resolvedPanes:n}=t;if(!n?.length)return null;let o=n[n.length-1];return Na(o)?(0,e.jsx)(fn,{}):Ba(o)?o?.title?(0,e.jsx)(fn,{title:o.title}):(0,e.jsx)(ja,{documentId:o.options.id,documentType:o.options.type}):(0,e.jsx)(fn,{title:o?.title})};function Xo(t){let n=Y().structureContext.title;return[t,n].filter(o=>o).join(" | ")}function Ba(t){return t!==re&&t.type==="document"}function Na(t){return t===re}var ko=Object.freeze,Wa=Object.defineProperty,$a=(t,n)=>ko(Wa(t,"raw",{value:ko(n||t.slice())})),Lo,Ha=B(Ii)(Lo||(Lo=$a([` 189 min-height: 100%; 190 min-width: 320px; 191`]))),Fa=(0,gn.default)("mod+s"),Va=(0,s.memo)(function(n){let{onPaneChange:o}=n;var r;let{push:i}
191=Pe(),c=dn(),{layoutCollapsed:a,setLayoutCollapsed:l}=Y(),{paneDataItems:d,resolvedPanes:u}=Ai(),p=we((0,s.useCallback)(P=>typeof P.intent=="string",[])),{sanity:{media:h}}=Rn(),[f,v]=(0,s.useState)(null),m=(0,s.useCallback)(()=>l(!0),[l]),y=(0,s.useCallback)(()=>l(!1),[l]);return(0,s.useEffect)(()=>{u.length&&o(u)},[o,u]),(0,s.useEffect)(()=>{let P=g=>{Fa(g)&&(g.preventDefault(),i({closable:!0,id:"auto-save-message",status:"info",title:"Your work is automatically saved!",duration:4e3}))};return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[i]),((r=c._original)==null?void 0:r.types.some(lt))?(0,e.jsxs)(ue,{element:f||null,children:[(0,e.jsxs)(Ha,{flex:1,height:a?void 0:"fill",minWidth:h[1],onCollapse:m,onExpand:y,children:[d.map(P=>{let{active:g,childItemId:x,groupIndex:b,itemId:_,key:I,pane:D,index:S,params:C,path:O,payload:z,siblingIndex:L,selected:T}=P;return(0,e.jsx)(s.Fragment,{children:D===re?(0,e.jsx)(me,{paneKey:I,path:O,selected:T}):(0,e.jsx)(Qi,{active:g,groupIndex:b,index:S,pane:D,childItemId:x,itemId:_,paneKey:I,params:C,payload:z,path:O,selected:T,siblingIndex:L})},"".concat(D===re?"loading":D.type,"-").concat(S))}),d.length<=1&&p&&(0,e.jsx)(me,{paneKey:"intent-resolver"})]}),(0,e.jsx)(Aa,{resolvedPanes:u}),(0,e.jsx)("div",{"data-portal":"",ref:v})]}):(0,e.jsx)(Ma,{})});function Ua(t){let{tool:{options:n}}=t,{unstable_sources:o}=yt(),[r]=o,{source:i,defaultDocumentNode:c,structure:a}=n||{};(0,s.useEffect)(()=>(Oe([]),()=>Oe([])),[]);let[{error:l},d]=(0,s.useState)({error:null});return l?(0,e.jsx)(Ui,{error:l}):(0,e.jsx)(Mn,{onCatch:d,children:(0,e.jsx)(ln,{name:i||r.name,children:(0,e.jsxs)(Zt,{defaultDocumentNode:c,structure:a,children:[(0,e.jsx)(Va,{onPaneChange:Oe}),(0,e.jsx)(Wi,{})]})})})}var vs=Object.freeze({__proto__:null,default:Ua});export{ir as a,gs as b,vs as c}; 192//# sourceMappingURL=/build/_shared/chunk-DYWG5ZN2.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.