PageSourceSearch

https://amiensfootball.com/_next/static/chunks/c23fc295-84cba16e93f04e33.js

js amiensfootball.com collected 2026-10-02 17:38:18 UTC 284,266 bytes, 596 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5478],{96528:(e,t,n)=>{let i;n.d(t,{Cw:()=>ov,EG:()=>r9,GG:()=>s$,GU:()=>lZ,Gp:()=>n0,Gt:()=>la,Ih:()=>e5,KN:()=>tt,QM:()=>tj,RG:()=>tM,Ru:()=>lO,Zv:()=>e9,bV:()=>nq,bt:()=>tE,c0:()=>rO,pl:()=>tY,y6:()=>tn});var r=n(71930),l=n(65312),s=n(95155),o=n(85467),a=n(91896),d=n(98199),c=n(12115),u=n(35186),p=n(27948),m=n(48388),h=n(1927),f=n(6363),x=n(16142),g=n(54561),b=n(51569),y=n(2744),j=n(85050),v=n(2423),_=n(28556),w=n(6376),S=n(35815),k=n(54100),C=n(80722),I=n(72015),E=n(16975),z=n(11096),T=n(44257),A=n(52661),P=n(34920),R=n(94123),M=n(31843),D=n(96681),$=n(98258),B=n(8676),Y=n(97561),L=n(97908),O=n(55633),H=n(34090),V=n(10028),N=n(14283),Z=n(18212),F=n(33751),K=n(75341),W=n(28278),J=n(50633),U=n(97993),G=n(79931),Q=n(31562),q=n(99506),X=n(84707),ee=n(61319),et=n(84911),en=n(78062),ei=n(99937),er=n(41105),el=n(59816),es=n(24664),eo=n(87785),ea=n(97163),ed=n(84802),ec=n(40131),eu=n(38210),ep=n(81405),em=n(51297),eh=n(86126),ef=n(3221),ex=n(24848),eg=n(58496),eb=n(25849),ey=n(58635),ej=n(81549),ev=n(80499),e_=n(52504),ew=n(93823),eS=n(87953),ek=n(52308),eC=n(85792),eI=n(71843),eE=n(75600),ez=n(53234),eT=n(60002),eA=n(3134);let eP="diffView",eR="previousDocument",eM="nextDocument";function eD(){let e,t,n,i=(0,o.c)(9),{navigate:r,state:l}=(0,_.rd)();i[0]!==r||i[1]!==l?(e=e=>{let{mode:t,previousDocument:n,nextDocument:i}=e,s={...eu(l._searchParams),...t?{[eP]:t}:{},...n?{[eR]:[n.type,n.id].join(",")}:{},...i?{[eM]:[i.type,i.id].join(",")}:{}};r({...l,_searchParams:ep(s)})},i[0]=r,i[1]=l,i[2]=e):e=i[2];let s=e;i[3]!==r||i[4]!==l?(t=()=>{r({...l,_searchParams:(l._searchParams??[]).filter(e$)})},i[3]=r,i[4]=l,i[5]=t):t=i[5];let a=t;return i[6]!==a||i[7]!==s?(n={navigateDiffView:s,exitDiffView:a},i[6]=a,i[7]=s,i[8]=n):n=i[8],n}function e$(e){let[t]=e;return![eP,eR,eM].includes(t)}let eB=["version"];function eY({onParamsError:e}={}){let{state:t}=(0,_.rd)(),n=new URLSearchParams(t._searchParams),i=n.get(eR),r=n.get(eM),l=n.get(eP),s=[i,r,l].some(e=>null!==e),o=(0,c.useMemo)(()=>(function({previousDocument:e,nextDocument:t,mode:n}){let i=[],[r,l]=e.split(",").filter(Boolean),[s,o]=t.split(",").filter(Boolean);return eB.includes(n)||i.push(["invalidModeParam",n]),(typeof r>"u"||typeof l>"u")&&i.push(["invalidPreviousDocumentParam",e]),(typeof s>"u"||typeof o>"u")&&i.push(["invalidNextDocumentParam",t]),0!==i.length?{result:"error",errors:i}:{result:"success",params:{mode:n,documents:{previous:{type:r,id:l},next:{type:s,id:o}}}}})({previousDocument:i??"",nextDocument:r??"",mode:l??""}),[l,r,i]);return(0,c.useEffect)(()=>{"error"===o.result&&s&&e?.(o.errors)},[s,e,o]),"error"===o.result?{isActive:!1}:{state:"ready",isActive:!0,...o.params}}function eL(e){return null!==e}function eO(e,t){return(0,m._4)(e)?"published":(0,m.R8)(e)?"draft":t.find(({_id:t})=>(0,h._hI)(t)===(0,m._S)(e))}let eH=g.I4.header`
2  display: grid;
3  grid-area: header;
4  grid-template-columns: 1fr min-content 1fr;
5  border-block-end: 1px solid var(--card-border-color);
6`,eV=g.I4.div`
7  display: flex;
8  justify-content: space-between;
9  align-items: center;
10`,eN=({documentId:e,state:t})=>{let{t:n}=(0,h.Bdt)(r.Z7),{data:i}=(0,h.gn8)({documentId:e}),{exitDiffView:l,navigateDiffView:o}=eD(),{documents:d}=eY(),u=(0,h.K0D)(),f=i.flatMap(e=>(0,m._S)(e)??[]),x=(0,c.useMemo)(()=>u.data.filter(e=>{let t=(0,h._hI)(e._id);return"u">typeof t&&f.includes(t)}),[u.data,f]),g=(0,c.useCallback)(e=>{"u">typeof d?.previous&&o({previousDocument:{...d.previous,id:e}})},[d?.previous,o]),b=(0,c.useCallback)(e=>{"u">typeof d?.next&&o({nextDocument:{...d.next,id:e}})},[d?.next,o]);return(0,s.jsxs)(eH,{children:[(0,s.jsxs)(eV,{children:[(0,s.jsx)(a.az,{padding:4,children:(0,s.jsx)(a.EY,{as:"h1",size:1,muted:!0,children:n("compare-versions.title")})}),"u">typeof d?.previous&&(0,s.jsx)(eZ,{releases:x,onSelectRelease:g,role:"previous",documentId:e,state:t,document:d.previous})]}),(0,s.jsx)(a.so,{align:"center",paddingX:3,children:(0,s.jsx)(a.EY,{size:1,children:(0,s.jsx)(p.ppF,{})})}),(0,s.jsxs)(eV,{children:["u">typeof d?.next&&(0,s.jsx)(eZ,{releases:x,onSelectRelease:b,role:"next",documentId:e,state:t,document:d.next}),(0,s.jsx)(a.az,{padding:3,style:{justifySelf:"end"},children:(0,s.jsx)(a.$n,{icon:p.USm,mode:"bleed",onClick:l,padding:2})})]})]})},eZ=({releases:e=[],onSelectRelease:t,role:n,documentId:i,document:o})=>{let{published:d,draft:u}=(0,h.zX2)((0,m.IM)(o.id),o.type),f=(0,c.useMemo)(()=>eO(o.id,e),[o.id,e]),{t:x}=(0,h.Bdt)(r.Z7),{t:g}=(0,h.Bdt)(),{document:{drafts:{enabled:b}}}=(0,h.hA9)();return(0,s.jsx)(l.IU,{id:n,button:(0,s.jsx)(a.$n,{type:"button",mode:"bleed",padding:2,paddingRight:3,radius:"full",selected:!0,...function({selected:e,tCore:t,tStructure:n}){if(typeof e>"u")return{text:t("common.loading"),tone:"neutral",disabled:!0};if((0,h.Jrl)(e)){let n=e?(0,h.Y73)(e):"neutral";return{text:e?.metadata.title||t("release.placeholder-untitled-release"),icon:(0,s.jsx)(h.Rdi,{padding:1,tone:n}),iconRight:e&&(0,h.KJ$)(e)?(0,s.jsx)(p.XAi,{}):void 0,tone:n}}let i="published"===e?"positive":"caution";return{text:n(["compare-versions.status",e].join(".")),icon:(0,s.jsx)(h.Rdi,{padding:1,tone:i}),tone:i}}({selected:f,tCore:g,tStructure:x})}),menu:(0,s.jsxs)(a.W1,{children:[d&&(0,s.jsx)(eF,{type:"published",onSelect:t,isSelected:"published"===f,documentId:i}),b&&u&&(0,s.jsx)(eF,{type:"draft",onSelect:t,isSelected:"draft"===f,documentId:i}),e.map(e=>(0,s.jsx)(eF,{release:e,onSelect:t,isSelected:"string"!=typeof f&&f?._id===e._id,documentId:i},e._id))]})})},eF=({type:e,release:t,onSelect:n,isSelected:i,documentId:l})=>{let{t:o}=(0,h.Bdt)(),{t:d}=(0,h.Bdt)(r.Z7),u=(0,c.useCallback)(()=>{"draft"===e?n((0,m.T4)(l)):"published"===e?n((0,m.IM)(l)):"u">typeof t?._id&&n((0,m.ct)(l,(0,h._hI)(t._id)))},[e,n,l,t?._id]);if(e)return(0,s.jsx)(a.Dr,{padding:1,paddingRight:3,onClick:u,pressed:i,children:(0,s.jsxs)(a.so,{gap:1,children:[(0,s.jsx)(h.Rdi,{padding:2,tone:"published"===e?"positive":"caution"}),(0,s.jsx)(a.az,{paddingY:2,children:(0,s.jsx)(a.EY,{size:1,weight:"medium",children:d(["compare-versions.status",e].join("."))})})]})});let f=t?(0,h.Y73)(t):"neutral";return(0,s.jsx)(a.Dr,{padding:1,paddingRight:3,onClick:u,pressed:i,children:(0,s.jsxs)(a.so,{gap:1,children:[(0,s.jsx)(h.Rdi,{padding:2,tone:f}),(0,s.jsxs)(a.BJ,{flex:1,paddingY:2,paddingRight:2,space:2,children:[(0,s.jsx)(a.EY,{size:1,weight:"medium",children:t.metadata.title||o("release.placeholder-untitled-release")}),["asap","undecided"].includes(t.metadata.releaseType)&&(0,s.jsx)(a.EY,{muted:!0,size:1,children:o(`release.type.${t.metadata.releaseType}`)}),"scheduled"===t.metadata.releaseType&&(0,s.jsx)(a.EY,{muted:!0,size:1,children:(0,h.drb)(t)})]}),(0,s.jsx)(a.so,{flex:"none",children:(0,h.KJ$)(t)&&(0,s.jsx)(a.az,{padding:2,children:(0,s.jsx)(a.EY,{size:1,children:(0,s.jsx)(p.XAi,{})})})})]})})},eK=g.I4.div`
11  --offset-block: 40px;
12  display: grid;
13  height: calc(100vh - var(--offset-block));
14  min-height: 0;
15  overflow: hidden;
16  grid-template-areas:
17    'header header'
18    'previous-document next-document';
19  grid-template-columns: 1fr 1fr;
20  grid-template-rows: min-content minmax(0, 1fr);
21`;function eW(e){return e.document?.components?.unstable_layout}function eJ(e){return e.path}function eU(e,t){return ex(e.path,t.path)}let eG=g.I4.div`
22  position: relative;
23  height: 100%;
24  overflow: auto;
25  scroll-behavior: smooth;
26  scrollbar-width: var(--scrollbar-width);
27  overscroll-behavior: contain;
28  will-change: scroll-position;
29`,eQ=(0,g.I4)(a.Zp)`
30  position: relative;
31  grid-area: var(--grid-area);
32`,eq=(0,g.I4)(a.mc)`
33  width: auto;
34`,eX=(0,c.forwardRef)(function(e,t){let n,i,r,l,p,m,f,x,g,b,y,j,v=(0,o.c)(36),{role:_,documentType:w,documentId:S,scrollElement:k,syncChannel:C,compareDocument:I}=e,E=(0,c.useRef)(null),[z,T]=(0,c.useState)(null),[A,P]=(0,c.useState)(null);v[0]!==I||v[1]!==S||v[2]!==w||v[3]!==_||v[4]!==k||v[5]!==C?(n=()=>(0,s.jsx)(e0,{compareDocument:I,documentId:S,documentType:w,role:_,scrollElement:k,syncChannel:C}),v[0]=I,v[1]=S,v[2]=w,v[3]=_,v[4]=k,v[5]=C,v[6]=n):n=v[6];let R=n;v[7]!==R?(i={pick:eW,defaultComponent:R},v[7]=R,v[8]=i):i=v[8];let M=(0,h.A1m)(i);v[9]===Symbol.for("react.memo_cache_sentinel")?(r={isInteractive:!1,onOpenReviewChanges:ef,onSetFocus:ef,isReviewChangesOpen:!1},v[9]=r):r=v[9];let D=`${_}-document`;v[10]!==D?(l={"--grid-area":D},v[10]=D,v[11]=l):l=v[11];let $=l,B="next"===_,Y="next"!==_&&"none";v[12]!==Y?(p={"--scrollbar-width":Y},v[12]=Y,v[13]=p):p=v[13];let L=p;return v[14]!==M||v[15]!==S||v[16]!==w?(m=(0,s.jsx)(d.Co,{position:"absolute",children:(0,s.jsx)(eq,{ref:E,padding:4,width:1,children:(0,s.jsx)(M,{documentId:S,documentType:w})})}),v[14]=M,v[15]=S,v[16]=w,v[17]=m):m=v[17],v[18]!==z||v[19]!==m?(f=(0,s.jsx)(a.GD,{element:z,children:m}),v[18]=z,v[19]=m,v[20]=f):f=v[20],v[21]!==t||v[22]!==L||v[23]!==f?(x=(0,s.jsx)(eG,{ref:t,style:L,children:f}),v[21]=t,v[22]=L,v[23]=f,v[24]=x):x=v[24],v[25]===Symbol.for("react.memo_cache_sentinel")?(g=(0,s.jsx)("div",{"data-testid":"diffView-document-panel-portal",ref:T}),v[25]=g):g=v[25],v[26]!==x||v[27]!==$||v[28]!==B?(b=(0,s.jsxs)(eQ,{ref:P,style:$,borderLeft:B,children:[x,g]}),v[26]=x,v[27]=$,v[28]=B,v[29]=b):b=v[29],v[30]!==A||v[31]!==b?(y=(0,s.jsx)(a.EZ,{element:A,children:b}),v[30]=A,v[31]=b,v[32]=y):y=v[32],v[33]!==k||v[34]!==y?(j=(0,s.jsx)(u.HJ.Provider,{value:r,children:(0,s.jsx)(h.tmD,{children:(0,s.jsx)(h.jsZ,{scrollElement:k,containerElement:E,children:y})})}),v[33]=k,v[34]=y,v[35]=j):j=v[35],j}),e0=({role:e,documentType:t,documentId:n,syncChannel:i,compareDocument:r})=>{var l,a;let d=function(e){let t,n,i,r=(0,o.c)(4),{compareDocument:l}=e;r[0]!==l.id?(t=(0,m.IM)(l.id),r[0]=l.id,r[1]=t):t=r[1];let s=l.type;r[2]!==l.id?(n=(0,m._S)(l.id),r[2]=l.id,r[3]=n):n=r[3];let a=(0,h.zX2)(t,s,"low",n);e:{if((0,m.A_)(l.id)){i=a.version??void 0;break e}if((0,m.R8)(l.id)){i=a.draft??void 0;break e}if((0,m._4)(l.id)){i=a.published??void 0;break e}i=void 0}return i}({compareDocument:r}),{data:p}=(0,h.K0D)(),[f]=(0,c.useState)(()=>(0,h.Ijd)()),x=(0,c.useMemo)(()=>eO(n,p),[n,p]),{formState:g,onChange:b,onFocus:y,onBlur:j,onSetActiveFieldGroup:v,onSetCollapsedFieldSet:_,onSetCollapsedPath:w,collapsedFieldSets:S,ready:k,collapsedPaths:C,schemaType:I,value:z,onProgrammaticFocus:T,...A}=(0,h.Lay)({documentId:(0,m.IM)(n),documentType:t,selectedPerspectiveName:(l=n,(0,m.A_)(l)?(0,m._S)(l):(0,m._4)(l)?"published":void 0),releaseId:(0,m._S)(n),comparisonValue:d,displayInlineChanges:!0}),P=null===g||!k,M=function(e){let t,n,i,r=(0,o.c)(11),{syncChannel:l,id:s}=e;r[0]!==s||r[1]!==l?(t=e=>l.next({...e,source:s}),r[0]=s,r[1]=l,r[2]=t):t=r[2];let a=t;if(r[3]!==s||r[4]!==l){let e;r[6]!==s?(e=e=>{let{source:t}=e;return t!==s},r[6]=s,r[7]=e):e=r[7],n=l.pipe((0,R.F)(eU),(0,Y.p)(e),(0,E.T)(eJ)),r[3]=s,r[4]=l,r[5]=n}else n=r[5];let d=n;return r[8]!==d||r[9]!==a?(i={path:d,push:a},r[8]=d,r[9]=a,r[10]=i):i=r[10],i}({id:e,syncChannel:i}),D=(0,c.useCallback)(t=>{A.onPathOpen(t),M.push({source:e,path:t})},[A,M,e]);return(0,c.useEffect)(()=>{let e=M.path.subscribe(T);return()=>e.unsubscribe()},[T,M.path]),P?(0,s.jsx)(h.gd4,{showText:!0}):(0,s.jsx)(u.pn.Provider,{value:{enabled:!1,mode:null},children:(0,s.jsx)(h.okx,{__internal_patchChannel:f,id:`diffView-pane-${e}`,onChange:b,onPathFocus:y,onPathOpen:D,onPathBlur:j,onFieldGroupSelect:v,onSetFieldSetCollapsed:_,onSetPathCollapsed:w,collapsedPaths:C,collapsedFieldSets:S,focusPath:g.focusPath,changed:g.changed,focused:g.focused,groups:g.groups,validation:g.validation,members:g.members,perspective:"draft"===(a=x)?"drafts":a,hasUpstreamVersion:g.hasUpstreamVersion,presence:g.presence,schemaType:I,value:z,compareValue:d})})},e1=g.I4.a`
35  flex: 1;
36  text-decoration: none;
37  color: inherit;
38`,e2=e=>{let t,n,i=(0,o.c)(6),{children:r,documentId:l,documentType:a}=e;i[0]!==l||i[1]!==a?(t={intent:"edit",params:{id:l,type:a}},i[0]=l,i[1]=a,i[2]=t):t=i[2];let{href:d}=(0,_.cQ)(t);return i[3]!==r||i[4]!==d?(n=(0,s.jsx)(e1,{href:d,target:"_blank",rel:"noopener noreferrer",children:r}),i[3]=r,i[4]=d,i[5]=n):n=i[5],n},e3=e=>{var t;let n,i,r,a,d,p,m,h,f,x,g,b,y=(0,o.c)(24),{documentId:j}=e,{documents:v,state:_,mode:w}=eY(),{exitDiffView:S}=eD(),k=((f=(0,o.c)(1))[0]===Symbol.for("react.memo_cache_sentinel")?(h=new N.B,f[0]=h):h=f[0],h),[C,I]=(0,c.useState)(null),[E,z]=(0,c.useState)(null),T=(0,c.useContext)(u.DA);y[0]!==T?(n={...T,disableNew:!0,EditReferenceLinkComponent:e2},y[0]=T,y[1]=n):n=y[1];let A=n;return y[2]!==E||y[3]!==C?(i=[C,E],y[2]=E,y[3]=C,y[4]=i):i=y[4],t=i,(b=(0,o.c)(3))[0]!==t?(x=()=>{let e=t.filter(eL);if(0===e.length)return;let n=new eh.Ay(e);return()=>n.destroy()},g=[t],b[0]=t,b[1]=x,b[2]=g):(x=b[1],g=b[2]),(0,c.useEffect)(x,g),y[5]!==j||y[6]!==w||y[7]!==_?(r="version"===w&&(0,s.jsx)(eN,{documentId:j,state:_}
38),y[5]=j,y[6]=w,y[7]=_,y[8]=r):r=y[8],y[9]!==v||y[10]!==E||y[11]!==C||y[12]!==_||y[13]!==k?(a="ready"===_&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eX,{documentType:v.previous.type,documentId:v.previous.id,role:"previous",ref:I,scrollElement:C,syncChannel:k,compareDocument:v.previous}),(0,s.jsx)(eX,{documentType:v.next.type,documentId:v.next.id,role:"next",ref:z,scrollElement:E,syncChannel:k,compareDocument:v.previous})]}),y[9]=v,y[10]=E,y[11]=C,y[12]=_,y[13]=k,y[14]=a):a=y[14],y[15]!==r||y[16]!==a?(d=(0,s.jsxs)(eK,{children:[r,a]}),y[15]=r,y[16]=a,y[17]=d):d=y[17],y[18]!==S||y[19]!==d?(p=(0,s.jsx)(l.lG,{id:"diffView",width:"auto",onClose:S,padding:!1,__unstable_hideCloseButton:!0,children:d}),y[18]=S,y[19]=d,y[20]=p):p=y[20],y[21]!==A||y[22]!==p?(m=(0,s.jsx)(u.DA.Provider,{value:A,children:p}),y[21]=A,y[22]=p,y[23]=m):m=y[23],m},e4=e=>{let t,n,i,l=(0,o.c)(9),{children:a,documentId:c}=e,u=(0,d.dj)(),{t:p}=(0,h.Bdt)(r.Z7);l[0]!==p||l[1]!==u?(t={onParamsError:e=>{u.push({id:"diffViewParamsParsingError",status:"error",title:p("compare-version.error.invalidParams.title"),description:(0,s.jsx)("ul",{children:e.map(e=>{let[t,n]=e;return(0,s.jsx)("li",{children:p(`compare-version.error.${t}`,{input:n})},t)})})})}},l[0]=p,l[1]=u,l[2]=t):t=l[2];let{isActive:m}=eY(t);return l[3]!==c||l[4]!==m?(n=m&&(0,s.jsx)(e3,{documentId:c}),l[3]=c,l[4]=m,l[5]=n):n=l[5],l[6]!==a||l[7]!==n?(i=(0,s.jsxs)(s.Fragment,{children:[a,n]}),l[6]=a,l[7]=n,l[8]=i):i=l[8],i};function e5(){let e=(0,c.useContext)(u._U);if(!e)throw Error("PaneLayout: missing context value");return e}let e6=(0,g.I4)(a.Wd)`
39  position: relative;
40  width: 1px;
41  min-width: 1px;
42
43  &:before {
44    content: '';
45    display: block;
46    position: absolute;
47    top: 0;
48    left: 0;
49    bottom: 0;
50    width: 1px;
51    background-color: var(--card-border-color);
52  }
53
54  &:not([data-disabled]) {
55    cursor: ew-resize;
56    width: 9px;
57    min-width: 9px;
58    margin: 0 -4px;
59
60    &:before {
61      left: 4px;
62    }
63
64    &:after {
65      content: '';
66      display: block;
67      position: absolute;
68      top: 0;
69      left: 0;
70      width: 9px;
71      bottom: 0;
72      background-color: var(--card-border-color);
73      opacity: 0;
74      transition: opacity 150ms;
75    }
76
77    &[data-dragging]:after,
78    &:hover:after {
79      opacity: 0.2;
80    }
81  }
82`;function e7(e){let t,n,i=(0,o.c)(7),{disabled:r,element:l}=e,{resize:a}=e5(),[d,u]=(0,c.useState)(!1);i[0]!==l||i[1]!==a?(t=e=>{if(!l)return;u(!0),e.preventDefault();let t=e.pageX;a("start",l,0);let n=e=>{e.preventDefault(),a("move",l,e.pageX-t)},i=e=>{e.preventDefault(),u(!1),window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",i),a("end",l,0)};window.addEventListener("mousemove",n),window.addEventListener("mouseup",i)},i[0]=l,i[1]=a,i[2]=t):t=i[2];let p=t,m=r?"":void 0,h=d?"":void 0;return i[3]!==p||i[4]!==m||i[5]!==h?(n=(0,s.jsx)(e6,{"data-disabled":m,"data-dragging":h,onMouseDown:p}),i[3]=p,i[4]=m,i[5]=h,i[6]=n):n=i[6],n}let e8=(0,g.I4)(a.Zp)`
83  outline: none;
84
85  // NOTE: This will render a border to the right side of each pane
86  // without taking up physical space.
87  box-shadow: 1px 0 0 var(--card-border-color);
88`,e9=(0,c.forwardRef)(function(e,t){let n,i,r,l,d,p,m,f,x,g,b,y,j,v,_,w,S,k,C,I,E,z,T,A,P,R,M,D,$,B=(0,o.c)(86);B[0]!==e?({children:n,currentMinWidth:r,currentMaxWidth:i,flex:f,id:l,minWidth:p,maxWidth:d,selected:x,...m}=e,B[0]=e,B[1]=n,B[2]=i,B[3]=r,B[4]=l,B[5]=d,B[6]=p,B[7]=m,B[8]=f,B[9]=x):(n=B[1],i=B[2],r=B[3],l=B[4],d=B[5],p=B[6],m=B[7],f=B[8],x=B[9]);let Y=void 0===f?1:f,L=void 0!==x&&x,[O,H]=(0,c.useState)(null),{collapse:V,collapsed:N,expand:Z,expandedElement:F,mount:K,panes:W}=e5();
88if(B[10]!==W||B[11]!==O){let e;B[14]!==O?(e=e=>e.element===O,B[14]=O,B[15]=e):e=B[15],b=(g=W.find(e))&&W.indexOf(g),B[10]=W,B[11]=O,B[12]=g,B[13]=b}else g=B[12],b=B[13];let J=b,U="number"==typeof J?W[J+1]:void 0,G=J===W.length-1,Q=F===O,q=!N&&(g?.collapsed||!1),X=U?.collapsed||!1,ee=(0,c.useRef)(null),et=g?.flex??Y,en=g?.currentMinWidth??r,ei=g?.currentMaxWidth??i;B[16]===Symbol.for("react.memo_cache_sentinel")?(y=()=>ee.current,B[16]=y):y=B[16],(0,c.useImperativeHandle)(t,y),B[17]===Symbol.for("react.memo_cache_sentinel")?(j=e=>{H(e),ee.current=e},B[17]=j):j=B[17];let er=j;B[18]!==i||B[19]!==r||B[20]!==Y||B[21]!==l||B[22]!==d||B[23]!==p||B[24]!==K||B[25]!==O?(v=()=>{if(O)return K(O,{currentMinWidth:r,currentMaxWidth:i,flex:Y,id:l,minWidth:p,maxWidth:d})},_=[r,i,Y,l,p,d,K,O],B[18]=i,B[19]=r,B[20]=Y,B[21]=l,B[22]=d,B[23]=p,B[24]=K,B[25]=O,B[26]=v,B[27]=_):(v=B[26],_=B[27]),(0,c.useLayoutEffect)(v,_),B[28]!==V||B[29]!==O?(w=()=>{O&&V(O)},B[28]=V,B[29]=O,B[30]=w):w=B[30];let el=w;B[31]!==Z||B[32]!==O?(S=()=>{O&&Z(O)},B[31]=Z,B[32]=O,B[33]=S):S=B[33];let es=S,eo=!N&&q;B[34]!==el||B[35]!==es||B[36]!==G||B[37]!==J||B[38]!==O||B[39]!==eo?(k={collapse:el,collapsed:eo,expand:es,index:J,isLast:G,rootElement:O},B[34]=el,B[35]=es,B[36]=G,B[37]=J,B[38]=O,B[39]=eo,B[40]=k):k=B[40];let ea=k;e:{if(N){C=void 0;break e}if(q){C=51;break e}if(0===en||G){C=p||204;break e}C=en||p||204}let ed=C;t:{if(q){I=51;break t}if(N&&G){I=void 0;break t}if(G){if(d){I=ei??d;break t}I=void 0;break t}I=ei??d}let ec=I,eu=N&&!G;B[41]!==q||B[42]!==G||B[43]!==N||B[44]!==X||B[45]!==O?(E=!G&&!N&&(0,s.jsx)(h.wG1,{zOffset:"paneResizer",children:(0,s.jsx)(e7,{disabled:q||X,element:O})}),B[41]=q,B[42]=G,B[43]=N,B[44]=X,B[45]=O,B[46]=E):E=B[46];let ep=E,em=ec===1/0?void 0:ec;B[47]!==et||B[48]!==ed||B[49]!==em?(z={flex:et,minWidth:ed,maxWidth:em},B[47]=et,B[48]=ed,B[49]=em,B[50]=z):z=B[50];let eh=z,ef=N?void 0:"hidden",ex=q?"":void 0,eg=L?"":void 0;return B[51]!==q||B[52]!==ei||B[53]!==en||B[54]!==Q||B[55]!==et||B[56]!==ec||B[57]!==ed||B[58]!==J?(T=!1,B[51]=q,B[52]=ei,B[53]=en,B[54]=Q,B[55]=et,B[56]=ec,B[57]=ed,B[58]=J,B[59]=T):T=B[59],B[60]!==n||B[61]!==eu?(A=!eu&&(0,s.jsx)(a.so,{direction:"column",height:"fill",children:n}),B[60]=n,B[61]=eu,B[62]=A):A=B[62],B[63]!==O||B[64]!==A?(P=(0,s.jsx)(a.EZ,{element:O,children:A}),B[63]=O,B[64]=A,B[65]=P):P=B[65],B[66]!==eu||B[67]!==l||B[68]!==J||B[69]!==m||B[70]!==eh||B[71]!==ef||B[72]!==ex||B[73]!==eg||B[74]!==T||B[75]!==P?(R=(0,s.jsxs)(e8,{"data-testid":"pane","data-ui":"Pane",tone
88:"inherit",hidden:eu,id:l,overflow:ef,...m,"data-pane-collapsed":ex,"data-pane-index":J,"data-pane-selected":eg,ref:er,style:eh,children:[T,P]}),B[66]=eu,B[67]=l,B[68]=J,B[69]=m,B[70]=eh,B[71]=ef,B[72]=ex,B[73]=eg,B[74]=T,B[75]=P,B[76]=R):R=B[76],B[77]!==G||B[78]!==R?(M=(0,s.jsx)(h.mLG,{isLastPane:G,children:R}),B[77]=G,B[78]=R,B[79]=M):M=B[79],B[80]!==ea||B[81]!==M?(D=(0,s.jsx)(h.wG1,{zOffset:"pane",children:(0,s.jsx)(u.OD.Provider,{value:ea,children:M})}),B[80]=ea,B[81]=M,B[82]=D):D=B[82],B[83]!==ep||B[84]!==D?($=(0,s.jsxs)(s.Fragment,{children:[D,ep]}),B[83]=ep,B[84]=D,B[85]=$):$=B[85],$}),te=(0,g.I4)(a.Zp)`
89  position: relative;
90  outline: none;
91`;function tt(){let e=(0,c.useContext)(u.OD);if(!e)throw Error("Pane: missing context value");return e}te.displayName="PaneContent__root";let tn=(0,c.forwardRef)(function(e,t){let n,i,r,l,a,d,c=(0,o.c)(14);c[0]!==e?({as:n,children:i,overflow:r,padding:l,...a}=e,c[0]=e,c[1]=n,c[2]=i,c[3]=r,c[4]=l,c[5]=a):(n=c[1],i=c[2],r=c[3],l=c[4],a=c[5]);let{collapsed:u}=tt(),{collapsed:p}=e5(),m=p?void 0:r;return c[6]!==n||c[7]!==i||c[8]!==u||c[9]!==l||c[10]!==t||c[11]!==a||c[12]!==m?(d=(0,s.jsx)(te,{"data-testid":"pane-content",forwardedAs:n,...a,flex:1,hidden:u,overflow:m,padding:l,ref:t,tone:"inherit",children:i}),c[6]=n,c[7]=i,c[8]=u,c[9]=l,c[10]=t,c[11]=a,c[12]=m,c[13]=d):d=c[13],d});function ti(e){return e?e.toLocaleLowerCase().replaceAll(" ",""):""}let tr={constrainSize:!0,placement:"left-start",portal:!0};function tl(e){let t,n,i,r,l=(0,o.c)(35),{disabled:d,isAfterGroup:c,node:u}=e,p=(0,h.Bvg)("i18n"in u?u:void 0);if("divider"===u.type){let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)(a.Nj,{}),l[0]=e):e=l[0],e}l[1]!==p||l[2]!==u?(t=p(u),l[1]=p,l[2]=u,l[3]=t):t=l[3];let{title:m}=t;if("group"===u.type){let e,t,n,i;if(0===u.children.length)return null;if(u.expanded){let e,t,n;return l[4]!==c?(e=c&&(0,s.jsx)(a.Nj,{}),l[4]=c,l[5]=e):e=l[5],l[6]!==d||l[7]!==u.children||l[8]!==u.disabled?(t=u.children.map((e,t)=>(0,s.jsx)(tl,{disabled:d||!!u.disabled,isAfterGroup:u.children[t-1]?.type==="group",node:e},e.key)),l[6]=d,l[7]=u.children,l[8]=u.disabled,l[9]=t):t=l[9],l[10]!==e||l[11]!==t?(n=(0,s.jsxs)(s.Fragment,{children:[e,t]}),l[10]=e,l[11]=t,l[12]=n):n=l[12],n}l[13]!==c?(e=c&&(0,s.jsx)(a.Nj,{}),l[13]=c,l[14]=e):e=l[14];let r=u.icon;return l[15]!==d||l[16]!==u.children||l[17]!==u.disabled?(t=u.children.map((e,t)=>(0,s.jsx)(tl,{disabled:d||!!u.disabled,isAfterGroup:u.children[t-1]?.type==="group",node:e},e.key)),l[15]=d,l[16]=u.children,l[17]=u.disabled,l[18]=t):t=l[18],l[19]!==d||l[20]!==u.icon||l[21]!==t||l[22]!==m?(n=(0,s.jsx)(ed.r,{disabled:d,icon:r,popover:tr,text:m,children:t}),l[19]=d,l[20]=u.icon,l[21]=t,l[22]=m,l[23]=n):n=l[23],l[24]!==e||l[25]!==n?(i=(0,s.jsxs)(s.Fragment,{children:[e,n]}),l[24]=e,l[25]=n,l[26]=i):i=l[26],i}return l[27]!==c?(n=c&&(0,s.jsx)(a.Nj,{}),l[27]=c,l[28]=n):n=l[28],l[29]!==d||l[30]!==u?(i=(0,s.jsx)(ts,{disabled:d,node:u}),l[29]=d,l[30]=u,l[31]=i):i=l[31],l[32]!==n||l[33]!==i?(r=(0,s.jsxs)(s.Fragment,{children:[n,i]}),l[32]=n,l[33]=i,l[34]=r):r=l[34],r}function ts(e){let t,n=(0,o.c)(5),{node:i}=e;if(i.intent){let t;return n[0]!==i.intent||n[1]!==e?(t=(0,s.jsx)(ta,{...e,intent:i.intent}),n[0]=i.intent,n[1]=e,n[2]=t):t=n[2],t}return n[3]!==e?(t=(0,s.jsx)(to,{...e}),n[3]=e,n[4]=t):t=n[4],t}function to(e){let t,n,i,r,d=(0,o.c)(17),{disabled:c,node:u}=e;d[0]!==u.disabled?(t="object"==typeof u.disabled&&(0,s.jsx)(a.EY,{size:1,children:u.disabled.reason}),d[0]=u.disabled,d[1]=t):t=d[1];let m=t,{title:f}=(0,h.FP1)(u),x=c||!!u.disabled;d[2]!==u.hotkey?(n=u.hotkey?.split("+"),d[2]=u.hotkey,d[3]=n):n=d[3];let g=u.iconRight||u.selected&&p.Nrt,b=`action-${ti(u.title)}`;return d[4]!==u.icon||d[5]!==u.onAction||d[6]!==u.selected||d[7]!==u.tone||d[8]!==x||d[9]!==n||d[10]!==g||d[11]!==b||d[12]!==f?(i=(0,s.jsx)(l.Dr,{disabled:x,hotkeys:n,icon:u.icon,iconRight:g,onClick:u.onAction,pressed:u.selected,text:f,tone:u.tone,"data-testid":b}),d[4]=u.icon,d[5]=u.onAction,d[6]=u.selected,d[7]=u.tone,d[8]=x,d[9]=n,d[10]=g,d[11]=b,d[12]=f,d[13]=i):i=d[13],d[14]!==i||d[15]!==m?(r=(0,s.jsx)(h.FUn,{content:m,placement:"left",children:i}),d[14]=i,d[15]=m,d[16]=r):r=d[16],r}function ta(e){let t,n,i,r,d,c,u=(0,o.c)(23),{disabled:m,intent:f,node:x}=e;u[0]!==x.disabled?(t="object"==typeof x.disabled&&(0,s.jsx)(a.EY,{size:1,children:x.disabled.reason}),u[0]=x.disabled,u[1]=t):t=u[1];let g=t;u[2]!==f.params||u[3]!==f.type?(n={intent:f.type,params:f.params},u[2]=f.params,u[3]=f.type,u[4]=n):n=u[4];let b=(0,_.cQ)(n);u[5]!==b||u[6]!==x?(i=e=>{b.onClick(e),x.onAction()},u[5]=b,u[6]=x,u[7]=i):i=u[7];let y=i,{title:j}=(0,h.FP1)(x),v=m||!!x.disabled;
91u[8]!==x.hotkey?(r=x.hotkey?.split("+"),u[8]=x.hotkey,u[9]=r):r=u[9];let w=x.selected?p.Nrt:void 0;return u[10]!==y||u[11]!==b.href||u[12]!==x.icon||u[13]!==x.selected||u[14]!==x.tone||u[15]!==v||u[16]!==r||u[17]!==w||u[18]!==j?(d=(0,s.jsx)(l.Dr,{as:"a",disabled:v,hotkeys:r,href:b.href,icon:x.icon,iconRight:w,onClick:y,pressed:x.selected,text:j,tone:x.tone}),u[10]=y,u[11]=b.href,u[12]=x.icon,u[13]=x.selected,u[14]=x.tone,u[15]=v,u[16]=r,u[17]=w,u[18]=j,u[19]=d):d=u[19],u[20]!==d||u[21]!==g?(c=(0,s.jsx)(h.FUn,{content:g,placement:"left",children:d}),u[20]=d,u[21]=g,u[22]=c):c=u[22],c}let td={constrainSize:!0,placement:"bottom",portal:!0};function tc(e,t){return e.some(e=>"item"===e.type&&e.tone===t||"group"===e.type&&tc(e.children,t))}function tu(e){let t,n,i,r,d,u=(0,o.c)(13),{nodes:p,actionsNodes:m}=e,f=(0,c.useId)(),x=tc(p,"critical"),g=tc(p,"caution"),b=x?"critical":g?"caution":void 0;return u[0]!==b?(t=(0,s.jsx)(h.VJU,{tone:b,"data-testid":"pane-context-menu-button"}),u[0]=b,u[1]=t):t=u[1],u[2]!==m?(n=m&&(0,s.jsxs)(s.Fragment,{children:[m,(0,s.jsx)(a.Nj,{})]}),u[2]=m,u[3]=n):n=u[3],u[4]!==p?(i=p.map((e,t)=>{let n=p[t-1]?.type==="group";return(0,s.jsx)(tl,{isAfterGroup:n,node:e},e.key)}),u[4]=p,u[5]=i):i=u[5],u[6]!==n||u[7]!==i?(r=(0,s.jsxs)(a.W1,{children:[n,i]}),u[6]=n,u[7]=i,u[8]=r):r=u[8],u[9]!==f||u[10]!==t||u[11]!==r?(d=(0,s.jsx)(l.IU,{button:t,id:f,menu:r,popover:td}),u[9]=f,u[10]=t,u[11]=r,u[12]=d):d=u[12],d}let tp=(0,g.I4)(a.Wd)`
92  position: sticky;
93  bottom: 0;
94`,tm=(0,g.I4)(a.Zp)`
95  padding-bottom: env(safe-area-inset-bottom);
96`,th=(0,c.forwardRef)(function(e,t){let n,i,r=(0,o.c)(7),{children:l,padding:d}=e,{collapsed:c}=tt();return r[0]!==l||r[1]!==d?(n=(0,s.jsx)(tm,{tone:"inherit",children:(0,s.jsx)(a.az,{padding:d,children:l})}),r[0]=l,r[1]=d,r[2]=n):n=r[2],r[3]!==c||r[4]!==t||r[5]!==n?(i=(0,s.jsx)(h.wG1,{zOffset:"paneFooter",children:(0,s.jsx)(tp,{"data-testid":"pane-footer",hidden:c,ref:t,children:n})}),r[3]=c,r[4]=t,r[5]=n,r[6]=i):i=r[6],i}),tf=(0,g.I4)(a.Wd)(({$border:e})=>(0,g.AH)`
97    line-height: 0;
98    position: sticky;
99    top: 0;
100
101    &:not([data-collapsed]):after {
102      content: '';
103      display: block;
104      position: absolute;
105      left: 0;
106      right: 0;
107      bottom: -1px;
108      border-bottom: 1px solid ${e?"var(--card-border-color)":"transparent"};
109      opacity: 1;
110    }
111  `),tx=(0,g.I4)(a.so)`
112  transform-origin: calc(51px / 2);
113
114  [data-collapsed] > div > & {
115    transform: rotate(90deg);
116  }
117`,tg=(0,g.I4)(a.Zp)(({theme:e})=>{let{fg:t,bg:n}=e.sanity.color.card.enabled;return(0,g.AH)`
118    background-color: ${n};
119
120    [data-ui='Text'] {
121      color: ${t};
122    }
123  `}),tb=(0,g.I4)(d.r5)`
124  width: 66%;
125  max-width: 175px;
126`,ty=(0,g.I4)(a.EY)`
127  cursor: default;
128  outline: none;
129`,tj=(0,c.forwardRef)(function(e,t){let n,i,r,l,c,u,p,m,f,x,g,b,y,j=(0,o.c)(48),{actions:v,backButton:_,border:w,contentAfter:S,loading:k,subActions:C,tabs:I,tabIndex:E,title:z,appendTitle:T}=e,{collapse:A,collapsed:P,expand:R,rootElement:M}=tt(),D=(0,d.sQ)(M||null),$=P?D?.height||window.innerHeight:void 0;j[0]!==$?(n={width:$},j[0]=$,j[1]=n):n=j[1];let B=n;j[2]!==A||j[3]!==P?(i=()=>{P||A()},j[2]=A,j[3]=P,j[4]=i):i=j[4];let Y=i;j[5]!==P||j[6]!==R?(r=()=>{P&&R()},j[5]=P,j[6]=R,j[7]=r):r=j[7];let L=r,O=!!(!P&&(I||C)),H=P?"":void 0,V=P?"":void 0;j[8]!==_?(l=_&&(0,s.jsx)(a.az,{flex:"none",children:_}),j[8]=_,j[9]=l):l=j[9];let N=_?1:2;j[10]!==k?(c=k&&(0,s.jsx)(a.az,{children:(0,s.jsx)(tb,{animated:!0,radius:1,size:1})}),j[10]=k,j[11]=c):c=j[11],j[12]!==T||j[13]!==k||j[14]!==z?(u=!k&&(0,s.jsxs)(a.so,{align:"center",gap:1,children:[(0,s.jsx)(ty,{size:1,textOverflow:"ellipsis",weight:"semibold",children:z}),T]}),j[12]=T,j[13]=k,j[14]=z,j[15]=u):u=j[15],j[16]!==Y||j[17]!==N||j[18]!==c||j[19]!==u||j[20]!==E?(p=(0,s.jsxs)(tg,{__unstable_focusRing:!0,flex:1,onClick:Y,paddingLeft:N,padding:2,tabIndex:E,children:[c,u]}),j[16]=Y,j[17]=N,j[18]=c,j[19]=u,j[20]=E,j[21]=p):p=j[21],j[22]!==v||j[23]!==P?(m=v&&(0,s.jsx)(a.az,{hidden:P,children:(0,s.jsx)(h.wG1,{zOffset:"paneHeader",children:v})}),j[22]=v,j[23]=P,j[24]=m):m=j[24],j[25]!==p||j[26]!==m||j[27]!==l?(f=(0,s.jsxs)(a.so,{align:"flex-start",ga
129p:3,children:[l,p,m]}),j[25]=p,j[26]=m,j[27]=l,j[28]=f):f=j[28],j[29]!==P||j[30]!==O||j[31]!==C||j[32]!==I?(x=O&&(0,s.jsxs)(a.so,{align:"center",hidden:P,overflow:"auto",children:[(0,s.jsx)(a.az,{flex:1,marginRight:3*!!C,children:I}),C]}),j[29]=P,j[30]=O,j[31]=C,j[32]=I,j[33]=x):x=j[33],j[34]!==L||j[35]!==B||j[36]!==f||j[37]!==x?(g=(0,s.jsxs)(tx,{direction:"column",gap:3,onClick:L,padding:3,sizing:"border",style:B,children:[f,x]}),j[34]=L,j[35]=B,j[36]=f,j[37]=x,j[38]=g):g=j[38];let Z=!P&&S;return j[39]!==g||j[40]!==Z||j[41]!==V?(b=(0,s.jsx)(h.wG1,{zOffset:"paneHeader",children:(0,s.jsxs)(a.Zp,{"data-collapsed":V,tone:"inherit",children:[g,Z]})}),j[39]=g,j[40]=Z,j[41]=V,j[42]=b):b=j[42],j[43]!==w||j[44]!==t||j[45]!==b||j[46]!==H?(y=(0,s.jsx)(a.XS,{zOffset:100,children:(0,s.jsx)(tf,{$border:w,"data-collapsed":H,"data-testid":"pane-header",ref:t,children:b})}),j[43]=w,j[44]=t,j[45]=b,j[46]=H,j[47]=y):y=j[47],y});function tv(e){return e.disabled?{disabledReason:"object"==typeof e.disabled?e.disabled.reason:void 0,ariaLabel:"object"==typeof e.disabled&&"string"==typeof e.disabled?.reason?e.disabled.reason:"This is disabled",isDisabled:!!e.disabled}:{disabledReason:void 0,ariaLabel:void 0,isDisabled:!1}}function t_(e){let t=(0,o.c)(4),{node:n}=e;if("item"===n.type){let e;return t[0]!==n?(e=(0,s.jsx)(tw,{node:n}),t[0]=n,t[1]=e):e=t[1],e}if("group"===n.type){let e;return t[2]!==n?(e=(0,s.jsx)(tk,{node:n}),t[2]=n,t[3]=e):e=t[3],e}return console.warn('unknown menu node (expected `type: "item" | "group"`):',n),null}function tw(e){let t,n,i,r,l,a=(0,o.c)(23),{node:d}=e,{title:c}=(0,h.FP1)(d),{t:u}=(0,h.Bdt)();if(d.intent){let t;return a[0]!==d.intent||a[1]!==e?(t=(0,s.jsx)(tS,{...e,intent:d.intent}),a[0]=d.intent,a[1]=e,a[2]=t):t=a[2],t}a[3]!==d?(t=tv(d),a[3]=d,a[4]=t):t=a[4];let{disabledReason:p,ariaLabel:m,isDisabled:f}=t;a[5]!==m||a[6]!==u||a[7]!==c?(n=m||c||u("status-button.aria-label"),a[5]=m,a[6]=u,a[7]=c,a[8]=n):n=a[8],a[9]!==f||a[10]!==d.hotkey?(i=!f&&d.hotkey?d.hotkey.split("+"):void 0,a[9]=f,a[10]=d.hotkey,a[11]=i):i=a[11];let x=f?p:c;return a[12]!==i||a[13]!==x?(r={hotkeys:i,content:x},a[12]=i,a[13]=x,a[14]=r):r=a[14],a[15]!==f||a[16]!==d.icon||a[17]!==d.onAction||a[18]!==d.selected||a[19]!==d.tone||a[20]!==n||a[21]!==r?(l=(0,s.jsx)(h.pfD,{disabled:f,icon:d.icon,onClick:d.onAction,selected:d.selected,tone:d.tone,"aria-label":n,tooltipProps:r}),a[15]=f,a[16]=d.icon,a[17]=d.onAction,a[18]=d.selected,a[19]=d.tone,a[20]=n,a[21]=r,a[22]=l):l=a[22],l}function tS(e){let t,n,i,r,l,a,d,c=(0,o.c)(27),{intent:u,node:p}=e;c[0]!==u.params||c[1]!==u.type?(t={intent:u.type,params:u.params},c[0]=u.params,c[1]=u.type,c[2]=t):t=c[2];let m=(0,_.cQ)(t),{t:f}=(0,h.Bdt)();c[3]!==m||c[4]!==p?(n=e=>{m.onClick(e),p.onAction()},c[3]=m,c[4]=p,c[5]=n):n=c[5];let x=n;c[6]!==p?(i=tv(p),c[6]=p,c[7]=i):i=c[7];let{disabledReason:g,ariaLabel:b,isDisabled:y}=i;c[8]!==b||c[9]!==p.title||c[10]!==f?(r=b||p.title||f("status-button.aria-label"),c[8]=b,c[9]=p.title,c[10]=f,c[11]=r):r=c[11],c[12]!==y||c[13]!==p.hotkey?(l=!y&&p.hotkey?p.hotkey.split("+"):void 0,c[12]=y,c[13]=p.hotkey,c[14]=l):l=c[14];let j=y?g:p.title;return c[15]!==l||c[16]!==j?(a={hotkeys:l,content:j,placement:"bottom",portal:!0},c[15]=l,c[16]=j,c[17]=a):a=c[17],c[18]!==x||c[19]!==m.href||c[20]!==y||c[21]!==p.icon||c[22]!==p.selected||c[23]!==p.tone||c[24]!==r||c[25]!==a?(d=(0,s.jsx)(h.pfD,{forwardedAs:"a",disabled:y,href:m.href,icon:p.icon,onClick:x,selected:p.selected,tone:p.tone,"aria-label":r,tooltipProps:a}),c[18]=x,c[19]=m.href,c[20]=y,c[21]=p.icon,c[22]=p.selected,c[23]=p.tone,c[24]=r,c[25]=a,c[26]=d):d=c[26],d}function tk(e){let t,n,i,r,d,u=(0,o.c)(16),{node:m}=e,{title:f}=(0,h.FP1)(m),x=!!m.disabled,g=m.icon??p.KSC;u[0]!==m.title?(t={content:m.title,portal:!0},u[0]=m.title,u[1]=t):t=u[1],u[2]!==x||u[3]!==g||u[4]!==t||u[5]!==f?(n=(0,s.jsx)(l.$n,{disabled:x,icon:g,label:f,mode:"bleed",tooltipProps:t}),u[2]=x,u[3]=g,u[4]=t,u[5]=f,u[6]=n):n=u[6];let b=(0,c.useId)();return u[7]!==m.children||u[8]!==m.disabled?(i=m.children.map((e,t)=>(0,s.jsx)(tl,{disabled:!!m.disabled,isAfterGroup:m.children[t-1]?.type==="group",node:e},e.key)),u[7]=m.children,u[8]=m.disabled,u[9]=i):i=u[9],u[10]!==i?(r=(0,s.jsx)(a.W1,{children:i}
129),u[10]=i,u[11]=r):r=u[11],u[12]!==n||u[13]!==b||u[14]!==r?(d=(0,s.jsx)(l.IU,{button:n,id:b,menu:r}),u[12]=n,u[13]=b,u[14]=r,u[15]=d):d=u[15],d}let tC=(0,g.I4)(a.Zp)`
130  transition: opacity 200ms;
131  position: relative;
132  z-index: 1;
133  padding-left: env(safe-area-inset-left);
134  padding-right: env(safe-area-inset-right);
135  opacity: 0;
136
137  &:not([hidden]) {
138    display: flex;
139  }
140
141  &:not([data-collapsed]) {
142    overflow: auto;
143  }
144
145  &[data-mounted] {
146    opacity: 1;
147  }
148
149  &[data-resizing] {
150    pointer-events: none;
151  }
152`,tI=[];function tE(e){let t,n,i,r,l,a,p,m,h,f,x,g,b,y,j,v,_,w=(0,o.c)(41);w[0]!==e?({children:t,minWidth:n,onCollapse:i,onExpand:r,...l}=e,w[0]=e,w[1]=t,w[2]=n,w[3]=i,w[4]=r,w[5]=l):(t=w[1],n=w[2],i=w[3],r=w[4],l=w[5]);let[S]=(0,c.useState)(tz),[k,C]=(0,c.useState)(null),I=(0,d.sQ)(k)?.width||0,E=void 0!==I&&n?I<n:void 0;w[6]===Symbol.for("react.memo_cache_sentinel")?(a={expandedElement:null,panes:[],resizing:!1},w[6]=a):a=w[6];let[z,T]=(0,c.useState)(a);w[7]!==S||w[8]!==k?(p=()=>S.setRootElement(k),m=[S,k],w[7]=S,w[8]=k,w[9]=p,w[10]=m):(p=w[9],m=w[10]),(0,c.useEffect)(p,m),w[11]!==S||w[12]!==I?(h=()=>S.setRootWidth(I),f=[S,I],w[11]=S,w[12]=I,w[13]=h,w[14]=f):(h=w[13],f=w[14]),(0,c.useEffect)(h,f),w[15]!==S?(x=()=>S.subscribe(T),g=[S],w[15]=S,w[16]=x,w[17]=g):(x=w[16],g=w[17]),(0,c.useEffect)(x,g),w[18]!==E||w[19]!==i||w[20]!==r?(b=()=>{void 0!==E&&(E&&i&&i(),!E&&r&&r())},y=[E,i,r],w[18]=E,w[19]=i,w[20]=r,w[21]=b,w[22]=y):(b=w[21],y=w[22]),(0,c.useEffect)(b,y),w[23]!==E||w[24]!==S.collapse||w[25]!==S.expand||w[26]!==S.mount||w[27]!==S.resize||w[28]!==z.expandedElement||w[29]!==z.panes||w[30]!==z.resizing?(j={collapse:S.collapse,collapsed:E,expand:S.expand,expandedElement:z.expandedElement,mount:S.mount,panes:z.panes,resize:S.resize,resizing:z.resizing},w[23]=E,w[24]=S.collapse,w[25]=S.expand,w[26]=S.mount,w[27]=S.resize,w[28]=z.expandedElement,w[29]=z.panes,w[30]=z.resizing,w[31]=j):j=w[31];let A=j,P=E?"":void 0,R=z.resizing?"":void 0,M=I?"":void 0;return w[32]!==t||w[33]!==l||w[34]!==P||w[35]!==R||w[36]!==M?(v=(0,s.jsx)(tC,{"data-ui":"PaneLayout",...l,"data-collapsed":P,"data-resizing":R,"data-mounted":M,ref:C,children:t}),w[32]=t,w[33]=l,w[34]=P,w[35]=R,w[36]=M,w[37]=v):v=w[37],w[38]!==A||w[39]!==v?(_=(0,s.jsx)(u._U.Provider,{value:A,children:v}),w[38]=A,w[39]=v,w[40]=_):_=w[40],_}function tz(){return function(){let e=[],t=[],n=new WeakMap,i=new Set,r={},l=null,s=0,o=null,a=new Map,d=!1;function c(e){i.delete(e),o=e,u()}return{collapse:function(e){i.add(e),o===e&&(o=null),u()},expand:c,mount:function(e,i){return n.set(e,{...i,original:i}),t.push(e),l&&function(e,t){let n=new WeakMap;for(let i of t)n.set(i,function(e,t){let n=[],i=t;for(;i!==e;){let t=i.parentElement;if(!t)break;let r=Array.from(t.childNodes).indexOf(i);if(n.unshift(r),t===e)break;i=t}return n}(e,i));t.sort((e,t)=>{let i=n.get(e)||tI,r=n.get(t)||tI,l=Math.max(i.length,r.length);for(let e=0;e<l;e+=1){let t=i[e]||-1,n=r[e]||-1;if(t!==n)return t-n}return 0})}(l,t),c(e),()=>{let i=t.indexOf(e);i>-1&&t.splice(i,1),n.delete(e),u()}},resize:function(e,i,l){let s=t.indexOf(i),o=n.get(i);if(!o)return;let c=t[s+1],p=n.get(c);if(p){if("start"===e&&(d=!0,r.left={element:i,flex:o.flex||1,width:i.offsetWidth},r.right={element:c,flex:p.flex||1,width:c.offsetWidth},u()),"move"===e&&r.left&&r.right){let e,t,n,s,d,m,h,f,x,g,b,y;a=new Map;let{leftW:j,rightW:v,leftFlex:_,rightFlex:w}=(e={flex:r.left.flex+r.right.flex,width:r.left.width+r.right.width},t=o.minWidth??204,n=p.minWidth??204,s=Math.min(o.maxWidth||1/0,e.width-n),d=Math.min(p.maxWidth||1/0,e.width-t),m=t-r.left.width,m<(h=r.right.width-d)&&(m=h),f=r.right.width-n,f>(x=s-r.left.width)&&(f=x),g=Math.min(Math.max(l,m),f),b=r.left.width+g,y=r.right.width-g,{leftFlex:b/e.width*e.flex,leftW:b,rightFlex:y/e.width*e.flex,rightW:y});a.set(i,{flex:_,width:j}),a.set(c,{flex:w,width:v}),u()}if("end"===e){d=!1;let e=a.get(i),t=a.get(c);n.set(i,{...o,currentMinWidth:0,currentMaxWidth:o.maxWidth??1/0,flex:e?.flex??o.flex}),n.set(c,{...p,currentMinWidth:0,currentMaxWidth:o.maxWidth??1/0,flex:t?.flex??p.flex}),a=new Map,delete r.left,delete r.right,u()}}},setRootElement:function(e){l=e},setRootWidth:function(e){s=e,u()},subscribe:function(t){return e.push(t),()=>{let n=e.push(t);n>-1&&e.splice(n,1)}}};function u(){if(!s)return;let r=[];for(let e of t)e!==o&&r.unshift(e);o&&r.unshift(o);let l=new WeakMap,c=r.length,u=r[0],p=s-(c-1)*51;for(let e of r){let t=n.get(e);if(!t)continue;let r=t.currentMinWidth||t.minWidth||204,s=e===u,o=i.has(e),d=r>p,c=!s&&(o||d),m=a.get(e);l.set(e,{element:e,collapsed:c,currentMinWidth:m?.width??t.currentMinWidth,currentMaxWidth:m?.width??t.currentMaxWidth,flex:m?.flex??t.flex??1}),c?p-=51:p-=r-51}let m=[];for(let e of t){let t=l.get(e);t&&m.push(t)}for(let n of e)n({expandedElement:o||t[t.length-1]||null,panes:m,resizing:d})}}()}function tT(e){let t,n,i,r=(0,o.c)(12),{children:l,currentMinWidth:d,flex:c,minWidth:u,paneKey:p,title:m,tone:h}=e,f=void 0===m?"Error":m,x=void 0===h?"critical":h;return r[0]!==f?(t=(0,s.jsx)(tj,{title:f}),r[0]=f,r[1]=t):t=r[1],r[2]!==l?(n=(0,s.jsx)(tn,{overflow:"auto",children:(0,s.jsx)(a.az,{paddingX:4,paddingY:5,children:l})}),r[2]=l,r[3]=n):n=r[3],r[4]!==d||r[5]!==c||r[6]!==u||r[7]!==p||r[8]!==t||r[9]!==n||r[10]!==x?(i=(0,s.jsxs)(e9,{currentMinWidth:d,flex:c,id:p,minWidth:u,tone:x,children:[t,n]}),r[4]=d,r[5]=c,r[6]=u,r[7]=p,r[8]=t,r[9]=n,r[10]=x,r[11]=i):i=r[11],i}function tA(e){let t,n,i,r=(0,o.c)(6),{children:l,ms:a}=e,d=void 0===a?0:a,[u,p]=(0,c.useState)(d<=0);if(r[0]!==d?(t=()=>{if(d<=0)return;let e=setTimeout(()=>p(!0),d);return()=>{clearTimeout(e)}},n=[d],r[0]=d,r[1]=t,r[2]=n):(t=r[1],n=r[2]),(0,c.useEffect)(t,n),!u||!l){let e;return r[3]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)(s.Fragment,{}),r[3]=e):e=r[3],e}return r[4]!==l?(i="function"==typeof l?l():l,r[4]=l,r[5]=i):i=r[5],i}function tP(e){let t=[{ms:300,messageKey:"panes.resolving.default-message"},{ms:5e3,messageKey:"panes.resolving.slow-resolve-message"}];if(h.Cu5){let n=["Check console for errors?","Is your observable/promise resolving?",e.length>0?`Structure path: ${e.join(" ➝ ")}`:""];t.push({ms:1e4,message:n.join(`
153`)})}let n=(0,Z.of)(null);return(0,F.h)(...t.map(e=>n.pipe((0,C.u)("messageKey"in e?{messageKey:e.messageKey}:{message:e.message}),(0,I.c)(e.ms))))}let tR=(0,g.I4)(a.so)`
154  opacity: 0;
155  transition: opacity 200ms;
156
157  &[data-mounted] {
158    opacity: 1;
159  }
160`,tM=(0,c.memo)(e=>{let t,n,i,l,a,u,p,m,f,x,g=(0,o.c)(28),{delay:b,flex:y,message:j,minWidth:v,paneKey:_,path:w,selected:S,title:k,tone:C}=e,I=void 0===b?300:b,E=void 0===j?tP:j,{t:z}=(0,h.Bdt)(r.Z7);e:{if("function"==typeof E){let e;g[0]!==E||g[1]!==w?(e=E(w?w.split(";"):[]),g[0]=E,g[1]=w,g[2]=e):e=g[2],t=e;break e}t=E}let T=t;g[3]!==T||g[4]!==z?(n=()=>"string"==typeof T?T:z("panes.resolving.default-message"),g[3]=T,g[4]=z,g[5]=n):n=g[5];let[A,P]=(0,c.useState)(n);g[6]!==T||g[7]!==z?(i=()=>
160{if("object"!=typeof T||"function"!=typeof T.subscribe)return;let e=T.subscribe(e=>{P("messageKey"in e?z(e.messageKey):e.message)});return()=>e.unsubscribe()},l=[T,z],g[6]=T,g[7]=z,g[8]=i,g[9]=l):(i=g[8],l=g[9]),(0,c.useEffect)(i,l);let[R,M]=(0,c.useState)(null),[D,$]=(0,c.useState)(!1);g[10]!==R?(a=()=>{if(R)return(0,d.X)(()=>$(!0))},u=[R],g[10]=R,g[11]=a,g[12]=u):(a=g[11],u=g[12]),(0,c.useEffect)(a,u);let B=D?"":void 0,Y=k||A;g[13]!==Y?(p=(0,s.jsx)(h.gd4,{showText:!0,title:Y}),g[13]=Y,g[14]=p):p=g[14],g[15]!==p||g[16]!==B?(m=(0,s.jsx)(tR,{align:"center","data-mounted":B,direction:"column",height:"fill",justify:"center",ref:M,children:p}),g[15]=p,g[16]=B,g[17]=m):m=g[17];let L=m;return g[18]!==L||g[19]!==I?(f=(0,s.jsx)(tn,{children:L}),g[18]=L,g[19]=I,g[20]=f):f=g[20],g[21]!==y||g[22]!==v||g[23]!==_||g[24]!==S||g[25]!==f||g[26]!==C?(x=(0,s.jsx)(e9,{flex:y,id:_,minWidth:v,selected:S,tone:C,children:f}),g[21]=y,g[22]=v,g[23]=_,g[24]=S,g[25]=f,g[26]=C,g[27]=x):x=g[27],x});function tD(){let e=(0,c.useContext)(u.Fi);if(!e)throw Error("DocumentPane: missing context value");return e}function t$(e){let t,n,i=(0,o.c)(8),{children:r,documentId:l,documentType:a}=e;return i[0]!==r||i[1]!==l||i[2]!==a?(t=(0,s.jsx)(tB,{documentId:l,documentType:a,children:r}),i[0]=r,i[1]=l,i[2]=a,i[3]=t):t=i[3],i[4]!==l||i[5]!==a||i[6]!==t?(n=(0,s.jsx)(h.ByQ,{documentId:l,documentType:a,children:t}),i[4]=l,i[5]=a,i[6]=t,i[7]=n):n=i[7],n}function tB(e){let t,n,i,r,l,a,d=(0,o.c)(26),{children:u,documentId:p,documentType:m}=e,{enabled:f}=(0,h.Dsj)(),{connectionState:x,onPathOpen:g,inspector:b,openInspector:y}=tD(),{selectedReleaseId:j}=(0,h.QO2)(),{params:v,setParams:w}=ny(),{resolveIntentLink:S}=(0,_.rd)(),k=v?.comment,C=(0,c.useRef)(v);d[0]!==v?(t=()=>{C.current=v},n=[v],d[0]=v,d[1]=t,d[2]=n):(t=d[1],n=d[2]),(0,c.useLayoutEffect)(t,n),d[3]!==p||d[4]!==m||d[5]!==S?(i=e=>{let t=S("edit",{id:p,type:m,inspect:h.nHq,comment:e});return`${window.location.origin}${t}`},d[3]=p,d[4]=m,d[5]=S,d[6]=i):i=d[6];let I=i;d[7]!==w?(r=()=>{w({...C.current,comment:void 0})},d[7]=w,d[8]=r):r=d[8];let E=r;d[9]!==b?.name||d[10]!==y?(l=()=>{b?.name!==h.nHq&&y(h.nHq)},d[9]=b?.name,d[10]=y,d[11]=l):l=d[11];let z=l;if(!f){let e;return d[12]!==u?(e=(0,s.jsx)(s.Fragment,{children:u}),d[12]=u,d[13]=e):e=d[13],e}let T=b?.name===h.nHq,A="connecting"===x;return d[14]!==u||d[15]!==p||d[16]!==m||d[17]!==I||d[18]!==E||d[19]!==z||d[20]!==g||d[21]!==k||d[22]!==j||d[23]!==T||d[24]!==A?(a=(0,s.jsx)(h.ixz,{documentId:p,documentType:m,getCommentLink:I,isCommentsOpen:T,isConnecting:A,onClearSelectedComment:E,onCommentsOpen:z,onPathOpen:g,selectedCommentId:k,sortOrder:"desc",type:"field",releaseId:j,children:u}),d[14]=u,d[15]=p,d[16]=m,d[17]=I,d[18]=E,d[19]=z,d[20]=g,d[21]=k,d[22]=j,d[23]=T,d[24]=A,d[25]=a):a=d[25],a}function tY(){let e=(0,c.useContext)(u.DI);if(!e)throw Error("StructureTool: missing context value");return e}tM.displayName="Memo(LoadingPane)";let tL={},tO="inspect:",tH=[{id:"inspectors"},{id:"links"}],tV="sanity/structure/history";function tN(e){let{documentId:t,documentType:n,inspectors:i,onMenuItems:r}=e,l=i.length,[a,d]=(0,c.useState)(()=>Array.from(Array(l)));(0,c.useEffect)(()=>{if(a.length!==l){let e=Array.from(Array(l));for(let t=0;t<l;t++)e[t]=a[t];d(e)}},[l,a]);let u=(0,c.useCallback)((e,t)=>{d(n=>{let i=[...n];return i[e]=t,i})},[]);(0,c.useEffect)(()=>{r(a.filter(Boolean))},[a,r]);let p=(0,c.useMemo)(()=>i.map((e,i)=>e.useMenuItem?[function({documentId:e,documentType:t,index:n,setMenuItem:i,useMenuItem:r}){return(0,c.memo)(function(){let l,s,a,d=(0,o.c)(4);d[0]===Symbol.for("react.memo_cache_sentinel")?(l={documentId:e,documentType:t},d[0]=l):l=d[0];let u=r(l),p=(0,h.$6H)(u);return d[1]!==p?(s=()=>{i(n,p)},a=[p],d[1]=p,d[2]=s,d[3]=a):(s=d[2],a=d[3]),(0,c.useEffect)(s,a),null})}({documentId:t,documentType:n,index:i,setMenuItem:u,useMenuItem:e.useMenuItem}),e.name]:[()=>null,""]),[t,n,i,u]);return(0,s.jsx)(s.Fragment,{children:p.map(([e,t])=>t&&(0,s.jsx)(e,{},t))})}function tZ(){let e,t,n,i,l=(0,o.c)(22),{connectionState:s,schemaType:a,editState:d,isDeleted:c,lastRevisionDocument:u}=tD(),{selectedPerspectiveName:p}=(0,h.QO2)(),{t:m}=(0,h.Bdt)(r.Z7);e:{if(c){e=u;break e}
160if(p&&(0,h.xo4)(p)){e=d?.published;break e}e=d?.version||d?.draft||d?.published}let f=e,x=!!f;t:{if(c&&u&&a)try{let e;l[0]!==u||l[1]!==a?(e=(0,h.hCw)(u,a),l[0]=u,l[1]=a,l[2]=e):e=l[2],t=e;break t}catch(e){console.warn("Failed to prepare preview for deleted document:",e),t=null;break t}t=null}let g=t,b=x&&!c;l[3]!==f||l[4]!==a||l[5]!==b?(n={enabled:b,schemaType:a,value:f},l[3]=f,l[4]=a,l[5]=b,l[6]=n):n=l[6];let{error:y,value:j}=(0,h.MOl)(n);if("connecting"===s&&!x){let e;return l[7]===Symbol.for("react.memo_cache_sentinel")?(e={error:void 0,title:void 0},l[7]=e):e=l[7],e}if(c&&g){let e;return l[8]!==g.title?(e={error:void 0,title:g.title},l[8]=g.title,l[9]=e):e=l[9],e}if(!j&&!c){let e,t,n=a?.title||a?.name;return l[10]!==m||l[11]!==n?(e=m("panes.document-header-title.new.text",{schemaType:n}),l[10]=m,l[11]=n,l[12]=e):e=l[12],l[13]!==e?(t={error:void 0,title:e},l[13]=e,l[14]=t):t=l[14],t}if(y){let e,t;return l[15]!==y.message||l[16]!==m?(e=m("panes.document-list-pane.error.text",{error:y.message}),l[15]=y.message,l[16]=m,l[17]=e):e=l[17],l[18]!==e?(t={error:e,title:void 0},l[18]=e,l[19]=t):t=l[19],t}let v=j?.title;return l[20]!==v?(i={error:void 0,title:v},l[20]=v,l[21]=i):i=l[21],i}tN.displayName="DocumentInspectorMenuItemsResolver";let tF=["patch","commit"],tK=(0,c.memo)(function(){let e,t,n,i,l,a=(0,o.c)(13),{push:u}=(0,d.dj)(),{documentId:p,documentType:m,value:f}=tD(),x=tZ(),g=x.error,b=(0,h.cUp)(p,m),y=(0,c.useRef)(b),j=ny(),{t:v}=(0,h.Bdt)(r.Z7),{handleOpenDialog:_}=(0,h.pDY)();e:{if(!x.title&&!g&&!tF.includes(b?.op)&&"string"==typeof f.title&&b?.type==="success"){e=f.title;break e}e=x.title}let w=e;a[0]!==v||a[1]!==w?(t=w||v("panes.document-operation-results.operation-undefined-title"),a[0]=v,a[1]=w,a[2]=t):t=a[2];let S=t;a[3]!==S?(n=S.length>25?`${S.slice(0,25)}...`:S,a[3]=S,a[4]=n):n=a[4];let k=n;return a[5]!==k||a[6]!==b||a[7]!==_||a[8]!==j||a[9]!==u||a[10]!==v?(i=()=>{let e;if(b&&b!==y.current){if("error"===b.type){if((0,h.rML)(b.error))return void _("document_action");u({closable:!0,duration:3e4,status:"error",title:v("panes.document-operation-results.operation-error",{context:b.op}),description:(0,s.jsxs)("details",{children:[(0,s.jsx)("summary",{children:v("panes.document-operation-results.error.summary.title")}),b.error.message]})})}return"success"!==b.type||tF.includes(b.op)||u({closable:!0,status:"success",title:(0,s.jsx)(h.HTc,{context:b.op,i18nKey:"panes.document-operation-results.operation-success",t:v,values:{op:b.op,title:k},components:{Strong:"strong"}})}),"success"===b.type&&"delete"===b.op&&(e=setTimeout(()=>j.closeCurrentAndAfter(),0)),y.current=b,()=>clearTimeout(e)}},l=[b,j,u,v,k,_],a[5]=k,a[6]=b,a[7]=_,a[8]=j,a[9]=u,a[10]=v,a[11]=i,a[12]=l):(i=a[11],l=a[
16012]),(0,c.useEffect)(i,l),null}),tW=(0,g.I4)(a.Zp)({position:"relative",zIndex:"1",lineHeight:"0"});function tJ(e){let t,n,i,d,c,u,m,f,x,g,b,y,j=(0,o.c)(25);j[0]!==e?({as:i,children:t,closeButtonLabel:n,onClose:d,title:u,...c}=e,j[0]=e,j[1]=t,j[2]=n,j[3]=i,j[4]=d,j[5]=c,j[6]=u):(t=j[1],n=j[2],i=j[3],d=j[4],c=j[5],u=j[6]);let{t:v}=(0,h.Bdt)(r.Z7);return j[7]!==u?(m=(0,s.jsx)(a.az,{flex:1,padding:3,children:(0,s.jsx)(a.EY,{as:"h1",size:1,weight:"medium",children:u})}),j[7]=u,j[8]=m):m=j[8],j[9]!==v?(f=v("document-inspector.close-button.tooltip"),j[9]=v,j[10]=f):f=j[10],j[11]!==f?(x={content:f},j[11]=f,j[12]=x):x=j[12],j[13]!==n||j[14]!==d||j[15]!==x?(g=(0,s.jsx)(a.az,{flex:"none",padding:1,children:(0,s.jsx)(l.$n,{"aria-label":n,icon:p.USm,mode:"bleed",onClick:d,tooltipProps:x})}),j[13]=n,j[14]=d,j[15]=x,j[16]=g):g=j[16],j[17]!==m||j[18]!==g?(b=(0,s.jsxs)(a.so,{padding:2,children:[m,g]}),j[17]=m,j[18]=g,j[19]=b):b=j[19],j[20]!==t||j[21]!==i||j[22]!==c||j[23]!==b?(y=(0,s.jsxs)(tW,{...c,as:i,children:[b,t]}),j[20]=t,j[21]=i,j[22]=c,j[23]=b,j[24]=y):y=j[24],y}function tU(e){let t,n,i,r=(0,o.c)(14),{documentId:l,documentType:d,flex:c}=e,{collapsed:u}=tt(),{closeInspector:p,inspector:m}=tD(),{features:f}=tY();r[0]!==p||r[1]!==m?(t=()=>{m&&p(m.name)},r[0]=p,r[1]=m,r[2]=t):t=r[2];let x=t;if(u||!m)return null;let g=m.component;r[3]!==g||r[4]!==l||r[5]!==d||r[6]!==x?(n=(0,s.jsx)(g,{onClose:x,documentId:l,documentType:d}),r[3]=g,r[4]=l,r[5]=d,r[6]=x,r[7]=n):n=r[7];let b=n;if(f.resizablePanes){let e;return r[8]!==b||r[9]!==c?(e=(0,s.jsx)(h.cMO,{as:"aside","data-ui":"DocumentInspectorPanel",flex:c,resizerPosition:"left",maxWidth:540,minWidth:320,children:b}),r[8]=b,r[9]=c,r[10]=e):e=r[10],e}return r[11]!==b||r[12]!==c?(i=(0,s.jsx)(a.az,{as:"aside","data-ui":"DocumentInspectorPanel",flex:c,children:b}),r[11]=b,r[12]=c,r[13]=i):i=r[13],i}function tG(e,t,n){let i,r,l,s,a=(0,o.c)(16),d=(0,h.P$5)();a[0]!==t||a[1]!==e?(i=["studio.structure-tool",e,t].filter(Boolean),a[0]=t,a[1]=e,a[2]=i):i=a[2];let c=i.join(".");if(a[3]!==n||a[4]!==d||a[5]!==c){let e;a[7]!==n?(e=e=>null===e?n:e,a[7]=n,a[8]=e):e=a[8],r=d.getKey(c).pipe((0,E.T)(e)),a[3]=n,a[4]=d,a[5]=c,a[6]=r}else r=a[6];let u=(0,v.J)(r,n);a[9]!==d||a[10]!==c||a[11]!==u?(l=e=>{e!==u&&d.setKey(c,e)},a[9]=d,a[10]=c,a[11]=u,a[12]=l):l=a[12];let p=l;return a[13]!==p||a[14]!==u?(s=[u,p],a[13]=p,a[14]=u,a[15]=s):s=a[15],s}let tQ={id:"parsed",title:"document-inspector.view-mode.parsed"},tq={id:"raw",title:"document-inspector.view-mode.raw-json"},tX=[tQ,tq],t0=new ey({maxSize:1e3});function t1(e){let{path:t}=e,n=t0.get(t);void 0!==n&&t0.set(t,!n)}function t2(e){let t=window.getSelection();if(t){let n=document.createRange();t.removeAllRanges(),n.selectNodeContents(e),t.addRange(n)}}function t3(e){t2(e.currentTarget)}function t4(e){65===e.keyCode&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),t2(e.currentTarget))}let t5=g.I4.div(({theme:e})=>{let{color:t,fonts:n,space:i}=e.sanity;return(0,g.AH)`
161    & .json-inspector,
162    & .json-inspector .json-inspector__selection {
163      font-family: ${n.code.family};
164      font-size: ${n.code.sizes[1].fontSize}px;
165      line-height: ${n.code.sizes[1].lineHeight}px;
166      color: var(--card-code-fg-color);
167    }
168
169    & .json-inspector .json-inspector__leaf {
170      padding-left: ${(0,a.D0)(i[4])};
171    }
172
173    & .json-inspector .json-inspector__leaf.json-inspector__leaf_root {
174      padding-top: ${(0,a.D0)(i[3])};
175      padding-left: 0;
176    }
177
178    & .json-inspector > .json-inspector__leaf_root > .json-inspector__line > .json-inspector__key {
179      display: none;
180    }
181
182    & .json-inspector .json-inspector__line {
183      display: block;
184      position: relative;
185      cursor: default;
186    }
187
188    & .json-inspector .json-inspector__line::after {
189      content: '';
190      position: absolute;
191      top: 0;
192      left: -200px;
193      right: -50px;
194      bottom: 0;
195      z-index: -1;
196      pointer-events: none;
197    }
198
199    & .json-inspector .json-inspector__line:hover::after {
200      background: var(--card-code-bg-color);
201    }
202
203    & .json-inspector .json-inspector__leaf_composite > .json-inspector__line {
204      cursor: pointer;
205    }
206
207    & .json-inspector .json-inspector__leaf_composite > .json-inspector__line::before {
208      content: '▸ ';
209      margin-left: calc(0 - ${(0,a.D0)(i[4])} + 3px);
210      font-size: ${n.code.sizes[1].fontSize}px;
211      line-height: ${n.code.sizes[1].lineHeight}px;
212    }
213
214    &
215      .json-inspector
216      .json-inspector__leaf_expanded.json-inspector__leaf_composite
217      > .json-inspector__line::before {
218      content: '▾ ';
219      font-size: ${n.code.sizes[1].fontSize}px;
220      line-height: ${n.code.sizes[1].lineHeight}px;
221    }
222
223    & .json-inspector .json-inspector__radio,
224    & .json-inspector .json-inspector__flatpath {
225      display: none;
226    }
227
228    & .json-inspector .json-inspector__value {
229      margin-left: ${(0,a.D0)(i[4]/2)};
230    }
231
232    &
233      .json-inspector
234      > .json-inspector__leaf_root
235      > .json-inspector__line
236      > .json-inspector__key
237      + .json-inspector__value {
238      margin: 0;
239    }
240
241    & .json-inspector .json-inspector__key {
242      color: ${t.syntax.property};
243    }
244
245    & .json-inspector .json-inspector__value_helper,
246    & .json-inspector .json-inspector__value_null {
247      color: ${t.syntax.constant};
248    }
249
250    & .json-inspector .json-inspector__not-found {
251      padding-top: ${(0,a.D0)(i[3])};
252    }
253
254    & .json-inspector .json-inspector__value_string {
255      color: ${t.syntax.string};
256    }
257
258    & .json-inspector .json-inspector__value_boolean {
259      color: ${t.syntax.boolean};
260    }
261
262    & .json-inspector .json-inspector__value_number {
263      color: ${t.syntax.number};
264    }
265
266    & .json-inspector .json-inspector__show-original {
267      display: inline-block;
268      padding: 0 6px;
269      cursor: pointer;
270    }
271
272    & .json-inspector .json-inspector__show-original:hover {
273      color: inherit;
274    }
275
276    & .json-inspector .json-inspector__show-original::before {
277      content: '↔';
278    }
279
280    & .json-inspector .json-inspector__show-original:hover::after {
281      content: ' expand';
282    }
283  `});function t6(e){let t,n,i,l=(0,o.c)(8),{onChange:d,query:c}=e;l[0]!==d?(t=e=>d(e.target.value),l[0]=d,l[1]=t):t=l[1];let u=t,{t:m}=(0,h.Bdt)(r.Z7);l[2]!==m?(n=m("document-inspector.search.placeholder"),l[2]=m,l[3]=n):n=l[3];let f=c||"";return l[4]!==u||l[5]!==n||l[6]!==f?(i=(0,s.jsx)(a.ks,{icon:p.WIv,onChange:u,placeholder:n,radius:2,value:f}),l[4]=u,l[5]=n,l[6]=f,l[7]=i):i=l[7],i}function t7(e){let t,n,i,c,u,p,m,f,x,g,b,y,j,v,_,w,S=(0,o.c)(49),{value:k}=e,{onInspectClose:C,paneKey:I}=tD(),E=`${I}_inspect_`,[z,T]=tG("inspect-view-mode",null,"parsed");S[0]!==z?(t=tX.find(e=>e.id===z),S[0]=z,S[1]=t):t=S[1];let A=t;S[2]!==T?(n=()=>{T(tQ.id)},S[2]=T,S[3]=n):n=S[3];let P=n;S[4]!==T?(i=()=>{T(tq.id)},S[4]=T,S[5]=i):i=S[5];let R=i,{t:M}=(0,h.Bdt)(r.Z7),D=`${E}dialog`;S[6]!==M||S[7]!==k?(c=(0,h.u4i)(k)&&(0,h.KgX)(k._id)&&(0,h.KgX)(k._type)?(0,s.jsx)(h.HTc,{t:M,i18nKey:"document-inspector.dialog.title",components:{DocumentTitle:()=>(0,s.jsx)("em",{children:(0,s.jsx)(ld,{document:k})})}}):(0,s.jsx)("em",{children:M("document-inspector.dialog.title-no-value")}),S[6]=M,S[7]=k,S[8]=c):c=S[8],S[9]===Symbol.for("react.memo_cache_sentinel")?(u={position:"sticky",bottom:0,zIndex:3},S[9]=u):u=S[9];let $=`${E}tabpanel`,B=`${E}tab-${tQ.id}`;S[10]!==M?(p=M(tQ.title),S[10]=M,S[11]=p):p=S[11];let Y=A===tQ;S[12]!==P||S[13]!==$||S[14]!==B||S[15]!==p||S[16]!==Y?(m=(0,s.jsx)(l.oz,{"aria-controls":$,id:B,label:p,onClick:P,selected:Y}),S[12]=P,S[13]=$,S[14]=B,S[15]=p,S[16]=Y,S[17]=m):m=S[17];let L=`${E}tabpanel`,O=`${E}tab-${tq.id}`;S[18]!==M?(f=M(tq.title),S[18]=M,S[19]=f):f=S[19];let H=A===tq;S[20]!==R||S[21]!==L||S[22]!==O||S[23]!==f||S[24]!==H?(x=(0,s.jsx)(l.oz,{"aria-controls":L,id:O,label:f,onClick:R,selected:H}),S[20]=R,S[21]=L,S[22]=O,S[23]=f,S[24]=H,S[25]=x):x=S[25],S[26]!==m||S[27]!==x?(g=(0,s.jsx)(a.Zp,{padding:3,paddingTop:0,shadow:1,style:u,children:(0,s.jsxs)(a.wb,{space:1,children:[m,x]})}),S[26]=m,S[27]=x,S[28]=g):g=S[28];let V=`${E}tab-${z}`,N=`${E}tabpanel`;return S[29]===Symbol.for("react.memo_cache_sentinel")?(b={outline:"none"},S[29]=b):b=S[29],S[30]!==k||S[31]!==A?(y=A===tQ&&(0,s.jsx)(t5,{children:(0,s.jsx)(eb.A,{data:k,isExpanded:function e(t,n){let i=t0.get(t);return void 0===i?(t0.set(t,Array.isArray(n)||(0,h.u4i)(n)),e(t,n)):i},onClick:t1,search:t6,filterOptions:{ignoreCase:!0}})}),S[30]=k,S[31]=A,S[32]=y):y=S[32],S[33]!==k||S[34]!==A?(j=A===tq&&(0,s.jsx)(a.Cy,{language:"json",tabIndex:0,onKeyDown:t4,onDoubleClick:t3,onFocus:t3,size:1,children:JSON.stringify(k,null,2)}),S[33]=k,S[34]=A,S[35]=j):j=S[35],S[36]!==V||S[37]!==N||S[38]!==y||S[39]!==j?(v=(0,s.jsxs)(d.Kp,{"aria-labelledby":V,flex:1,id:N,overflow:"auto",padding:4,style:b,children:[y,j]}),S[36]=V,S[37]=N,S[38]=y,S[39]=j,S[40]=v):v=S[40],S[41]!==g||S[42]!==v?(_=(0,s.jsxs)(a.so,{direction:"column",height:"fill",children:[g,v]}),S[41]=g,S[42]=v,S[43]=_):_=S[43],S[44]!==C||S[45]!==_||S[46]!==D||S[47]!==c?(w=(0,s.jsx)(l.lG,{bodyHeight:"fill",id:D,header:c,onClose:C,onClickOutside:C,padding:!1,width:2,children:_}),S[44]=C,S[45]=_,S[46]=D,S[47]=c,S[48]=w):w=S[48],w}function t8(e){let t,n,i,r,d,c,u,p,m,h,f,x=(0,o.c)(22);x[0]!==e?({action:n,content:i,icon:t,tone:d,paddingY:c,...r}=e,x[0]=e,x[1]=t,x[2]=n,x[3]=i,x[4]=r,x[5]=d,x[6]=c):(t=x[1],n=x[2],i=x[3],r=x[4],d=x[5],c=x[6]);let g=void 0===d?"transparent":d,b=void 0===c?2:c;return x[7]!==t?(u=t&&(0,s.jsx)(a.EY,{size:0,children:(0,s.jsx)(t,{})}),x[7]=t,x[8]=u):u=x[8],x[9]!==i?(p=(0,s.jsx)(a.so,{align:"center",flex:1,gap:2,paddingY:2,children:i}),x[9]=i,x[10]=p):p=x[10],x[11]!==n?(m=n&&(0,s.jsx)(l.$n,{...n,mode:n.mode||"ghost",tone:n.tone||"default"}),x[11]=n,x[12]=m):m=x[12],x[13]!==u||x[14]!==p||x[15]!==m?(h=(0,s.jsxs)(a.so,{align:"center",gap:3,paddingX:2,children:[u,p,m]}),x[13]=u,x[14]=p,x[15]=m,x[16]=h):h=x[16],x[17]!==b||x[18]!==r||x[19]!==h||x[20]!==g?(f=(0,s.jsx)(a.az,{padding:1,children:(0,s.jsx)(a.Zp,{radius:3,paddingX:2,paddingY:b,tone:g,...r,children:h})}),x[17]=b,x[18]=r,x[19]=h,x[20]=g,x[21]=f):f=x[21],f}function t9(){let e=(0,o.c)(3),{isDeleted:t,isDeleting:n,ready:i}=tD(),{selectedPerspective:r}=(0,h.QO2)();if(!i)return null;if(!(0,h.xo4)(r)&&!(0,h.o2j)(r)&&"archived"===r.state){let t;return e[0]!==r?(t=(0,s.jsx)(nt,{release:r}),e[0]=r,e[1]=t):t=e[1],t}if(t&&!n){let t;return e[2]===Symbol.for("react.memo_cache_sentinel")?(t=(0,s.jsx)(ne,{}),e[2]=t):t=e[2],t}}function ne(){let e,t,n,i,l,d,c=(0,o.c)(17),{documentId:u,documentType:m}=tD(),{restore:f}=(0,h.QSs)(u,m),{navigateIntent:x}=(0,_.rd)();c[0]!==u||c[1]!==m||c[2]!==x||c[3]!==f?(e=()=>{f.execute("lastRevision"),x("edit",{id:u,type:m})},c[0]=u,c[1]=m,c[2]=x,c[3]=f,c[4]=e):e=c[4];let g=e,{t:b}=(0,h.Bdt)(r.Z7);return c[5]!==b?(t=b("banners.deleted-document-banner.restore-button.text"),c[5]=b,c[6]=t):t=c[6],c[7]!==g||c[8]!==t?(n={onClick:g,text:t},c[7]=g,c[8]=t,c[9]=n):n=c[9],c[10]!==b?(i=b("banners.deleted-document-banner.text"),c[10]=b,c[11]=i):i=c[11],c[12]!==i?(l=(0,s.jsx)(a.EY,{size:1,weight:"medium",children:i}),c[12]=i,c[13]=l):l=c[13],c[14]!==n||c[15]!==l?(d=(0,s.jsx)(t8,{action:n,content:l,"data-testid":"deleted-document-banner",icon:p.Eoh}),c[14]=n,c[15]=l,c[16]=d):d=c[16],d}let nt=e=>{let t,n,i,r=(0,o.c)(8),{release:l}=e,{t:d}=(0,h.Bdt)();return r[0]!==l.metadata?.title||r[1]!==d?(t=l.metadata?.title||d("release.placeholder-untitled-release"),r[0]=l.metadata?.title,r[1]=d,r[2]=t):t=r[2],r[3]!==t?(n={title:t},r[3]=t,r[4]=n):n=r[4],r[5]!==d||r[6]!==n?(i=(0,s.jsx)(t8,{tone:"caution",content:(0,s.jsx)(a.EY,{size:1,weight:"medium",children:(0,s.jsx)(h.HTc,{t:d,i18nKey:"banners.deleted-release-banner.text",values:n})}),"data-testid":"deleted-release-banner",icon:p.tkA}),r[5]=d,r[6]=n,r[7]=i):i=r[7],i};function nn(){let e,t,n=(0,o.c)(5),{schemaType:i}=tD(),{t:l}=(0,h.Bdt)(r.Z7);return(0,f.fq)(i)?(n[0]!==l?(e=(0,s.jsx)(h.HTc,{t:l,i18nKey:"banners.deprecated-document-type-banner.text"}),n[0]=l,n[1]=e):e=n[1],n[2]!==i.deprecated.reason||n[3]!==e?(t=(0,s.jsx)(t8,{content:(0,s.jsxs)(a.EY,{size:1,weight:"medium",children:[e," ",i.deprecated.reason]}),"data-testid":"deprecated-document-type-banner",icon:p.YZv}),n[2]=i.deprecated.reason,n[3]=e,n[4]=t):t=n[4],t):null}let ni=(0,em.g_)({name:"Ask To Edit Dialog Opened",version:1,description:'User clicked the "Ask to edit" button in the document permissions banner'}),nr=(0,em.g_)({name:"Ask To Edit Request Sent",version:1,description:"User sent a role change request from the dialog"}),nl=(0,g.I4)(a.az)`
284  box-sizing: border-box;
285`;function ns(e){let t,n,i,u,p,m,f,x,g,b,y,j,_,w,S,k=(0,o.c)(56),{onClose:C,onRequestSubmitted:I}=e,{t:A}=(0,h.Bdt)(r.Z7),P=(0,ec.Jr)(),R=`request-permissions-${(0,c.useId)()}`,M=(0,h.M91)();k[0]===Symbol.for("react.memo_cache_sentinel")?(t={apiVersion:"2024-09-26"},k[0]=t):t=k[0];let D=(0,h.tH7)(t),$=(0,d.dj)(),B=(0,h.YKH)(),[Y,L]=(0,c.useState)(!1),[O,H]=(0,c.useState)(""),[V,N]=(0,c.useState)(),[F,K]=(0,c.useState)(!1),[W,J]=(0,c.useState)(!1);e:{let e,t="administrator";if(!M||!D){let e;k[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Z.of)(t),k[1]=e):e=k[1],n=e;break e}if(k[2]!==D.observable||k[3]!==M){let n,i;k[5]===Symbol.for("react.memo_cache_sentinel")?(n=e=>e.filter(na).find(no)?"editor":t,k[5]=n):n=k[5],k[6]===Symbol.for("react.memo_cache_sentinel")?(i=()=>(0,Z.of)(t),k[6]=i):i=k[6],e=D.observable.request({url:`/projects/${M}/roles`}).pipe((0,E.T)(n),(0,T.Z)(t),(0,z.W)(i)),k[2]=D.observable,k[3]=M,k[4]=e}else e=k[4];n=e}let U=(0,v.J)(n);k[7]!==D||k[8]!==O||k[9]!==I||k[10]!==M||k[11]!==U||k[12]!==P||k[13]!==$?(i=()=>{L(!0),D.request({url:`/access/project/${M}/requests`,method:"post",body:{note:O,requestUrl:window?.location.href,requestedRole:U,type:"role"}}).then(e=>{e&&(I&&I(),P.log(nr),$.push({title:"Edit access requested"}))}).catch(e=>{let t=e?.response?.statusCode,n=e?.response?.body?.message;429===t&&(K(!0),N(n)),409===t?(J(!0),N(n)):$.push({title:"There was a problem submitting your request.",status:"error"})}).finally(()=>{L(!1)})}
285,k[7]=D,k[8]=O,k[9]=I,k[10]=M,k[11]=U,k[12]=P,k[13]=$,k[14]=i):i=k[14];let G=i,Q=B.fullscreen;k[15]!==A?(u=A("request-permission-dialog.header.text"),k[15]=A,k[16]=u):u=k[16],k[17]!==A?(p=A("confirm-dialog.cancel-button.fallback-text"),k[17]=A,k[18]=p):p=k[18],k[19]!==C||k[20]!==p?(m={onClick:C,text:p},k[19]=C,k[20]=p,k[21]=m):m=k[21];let q=F||W;return k[22]!==A?(f=A("request-permission-dialog.confirm-button.text"),k[22]=A,k[23]=f):f=k[23],k[24]!==Y||k[25]!==G||k[26]!==q||k[27]!==f?(x={onClick:G,loading:Y,disabled:q,text:f,tone:"primary",type:"submit"},k[24]=Y,k[25]=G,k[26]=q,k[27]=f,k[28]=x):x=k[28],k[29]!==x||k[30]!==m?(g={cancelButton:m,confirmButton:x},k[29]=x,k[30]=m,k[31]=g):g=k[31],k[32]!==A?(b=A("request-permission-dialog.description.text"),k[32]=A,k[33]=b):b=k[33],k[34]!==b?(y=(0,s.jsx)(a.EY,{children:b}),k[34]=b,k[35]=y):y=k[35],k[36]!==W||k[37]!==F||k[38]!==Y||k[39]!==V||k[40]!==O||k[41]!==G||k[42]!==A?(j=F||W?(0,s.jsx)(a.Zp,{tone:"caution",padding:3,radius:2,shadow:1,children:(0,s.jsxs)(a.EY,{size:1,children:[F&&(0,s.jsx)(s.Fragment,{children:V??A("request-permission-dialog.warning.limit-reached.text")}),W&&(0,s.jsx)(s.Fragment,{children:V??A("request-permission-dialog.warning.denied.text")})]})}):(0,s.jsxs)(a.BJ,{space:3,paddingBottom:0,children:[(0,s.jsx)(a.ks,{placeholder:A("request-permission-dialog.note-input.placeholder.text"),disabled:Y,onKeyDown:e=>{"Enter"===e.key&&G()},maxLength:150,value:O,onChange:e=>{H(e.currentTarget.value)}}),(0,s.jsx)(a.EY,{align:"right",muted:!0,size:1,children:`${O.length}/150`})]}),k[36]=W,k[37]=F,k[38]=Y,k[39]=V,k[40]=O,k[41]=G,k[42]=A,k[43]=j):j=k[43],k[44]!==y||k[45]!==j?(_=(0,s.jsx)(nl,{children:(0,s.jsxs)(a.BJ,{space:4,children:[y,j]})}),k[44]=y,k[45]=j,k[46]=_):_=k[46],k[47]!==R||k[48]!==C||k[49]!==g||k[50]!==_||k[51]!==u?(w=(0,s.jsx)(l.lG,{width:1,id:R,header:u,footer:g,onClose:C,onClickOutside:C,children:_}),k[47]=R,k[48]=C,k[49]=g,k[50]=_,k[51]=u,k[52]=w):w=k[52],k[53]!==w||k[54]!==B.fullscreen?(S=(0,s.jsx)(d.Co,{position:"fixed",zOffset:Q,children:w}),k[53]=w,k[54]=B.fullscreen,k[55]=S):S=k[55],S}function no(e){return"editor"===e.name}function na(e){return e?.appliesToUsers}(0,g.I4)(a.so).attrs({align:"center",direction:"column",justify:"center"})`
286  height: 110px;
287`;let nd={loading:!0,error:!1,status:void 0},nc={loading:!1,error:!1,status:"none"},nu={loading:!1,error:!1,status:"declined"},np={loading:!1,error:!1,status:"pending"},nm={loading:!1,error:!1,status:"expired"};function nh(e){let t,n,i,l,d,u,m,f,x=(0,o.c)(29),{requiredPermission:g}=e,b=(0,h.iZK)(),{data:y,loading:j,error:_}=(()=>{let e,t,n,i=(0,o.c)(9);i[0]===Symbol.for("react.memo_cache_sentinel")?(e={apiVersion:"2024-07-01"},i[0]=e):e=i[0];let r=(0,h.tH7)(e),l=(0,h.M91)();e:{var s,a;let e;if(!r||!l){let e;i[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Z.of)(nc),i[1]=e):e=i[1],t=e;break e}i[2]!==r||i[3]!==l?(s=r,a=l,e=s.observable.request({url:"/access/requests/me",tag:"use-role-requests-status"}).pipe((0,E.T)(e=>{if(!e||0===e.length)return nc;let t=e.filter(e=>e.resourceId===a&&"role"===e.type),n=t.find(e=>"declined"===e.status);return n&&(0,ej.A)((0,ev.A)(new Date(n.createdAt),2),new Date)?nu:t.find(e=>"pending"===e.status&&(0,ej.A)((0,ev.A)(new Date(e.createdAt),2),new Date))?np:t.find(e=>"pending"===e.status&&(0,e_.A)((0,ev.A)(new Date(e.createdAt),2),new Date))?nm:nc}),(0,z.W)(e=>(console.error("Failed to fetch access requests",e),(0,Z.of)({loading:!1,error:!0,status:void 0}))),(0,T.Z)(nd)),i[2]=r,i[3]=l,i[4]=e):e=i[4],t=e}let d=t,{loading:c,error:u,status:p}=(0,v.J)(d,nd);return i[5]!==u||i[6]!==c||i[7]!==p?(n={data:p,loading:c,error:u},i[5]=u,i[6]=c,i[7]=p,i[8]=n):n=i[8],n})(),[w,S]=(0,c.useState)(!1),k="pending"===y||"declined"===y||w,C=b?.roles||[],I=1===C.length&&"viewer"===C[0].name,[A,P]=(0,c.useState)(!1);x[0]===Symbol.for("react.memo_cache_sentinel")?(t={style:"short"},x[0]=t):t=x[0];let R=(0,h.FfM)(t),{t:M}=(0,h.Bdt)(r.Z7),D=(0,ec.Jr)(),$=C.map(nx),B=R.formatToParts($).map(nf);return x[1]!==B?(n={Roles:()=>(0,s.jsx)(s.Fragment,{children:B})},x[1]=B,x[2]=n):n=x[2],x[3]!==$||x[4]!==B.length?(i={count:B.length,roles:$},x[3]=$,x[4]=B.length,x[5]=i):i=x[5],x[6]!==g||x[7]!==M||x[8]!==n||x[9]!==i?(l=(0,s.jsx)(a.EY,{size:1,weight:"medium",children:(0,s.jsx)(h.HTc,{t:M,i18nKey:"banners.permission-check-banner.missing-permission",components:n,values:i,context:g})}),x[6]=g,x[7]=M,x[8]=n,x[9]=i,x[10]=l):l=x[10],x[11]!==I||x[12]!==k||x[13]!==_||x[14]!==j||x[15]!==y||x[16]!==P||x[17]!==M||x[18]!==D?(d=I&&y&&!_&&!j?{onClick:k?void 0:()=>{P(!0),D.log(ni)},text:M(k?"banners.permission-check-banner.request-permission-button.sent":"banners.permission-check-banner.request-permission-button.text"),tone:k?"default":"primary",disabled:k,mode:k?"bleed":void 0}:void 0,x[11]=I,x[12]=k,x[13]=_,x[14]=j,x[15]=y,x[16]=P,x[17]=M,x[18]=D,x[19]=d):d=x[19],x[20]!==l||x[21]!==d?(u=(0,s.jsx)(t8,{content:l,action:d,"data-testid":"permission-check-banner",icon:p.Eoh}),x[20]=l,x[21]=d,x[22]=u):u=x[22],x[23]!==P||x[24]!==A?(m=A&&(0,s.jsx)(ns,{onClose:()=>P(!1),onRequestSubmitted:()=>{S(!0),P(!1)}}),x[23]=P,x[24]=A,x[25]=m):m=x[25],x[26]!==u||x[27]!==m?(f=(0,s.jsxs)(s.Fragment,{children:[u,m]}),x[26]=u,x[27]=m,x[28]=f):f=x[28],f}function nf(e){return"element"===e.type?(0,s.jsx)("code",{children:e.value},e.value):e.value}function nx(e){return e.title}
287let ng=(0,c.memo)(()=>{let e=(0,h.yKO)(),{selectedReleaseId:t}=(0,h.QO2)(),{params:n,groupIndex:i,routerPanesState:l,replaceCurrent:o,BackLink:d}=ny(),u=l[i]?.[0].id,f=l[i-1]?.[0],x=f?.id,g=!!f?.params?.rev,b=(0,c.useMemo)(()=>n?.parentRefPath&&(0,es.sH)(n.parentRefPath)||null,[n?.parentRefPath]),{t:y}=(0,h.Bdt)(r.Z7),j=(0,c.useMemo)(()=>{let n=b?.[0];if(!x||!n||!b)return(0,Z.of)({loading:!1});let i=(0,m.IM)(x),r=(0,es.sH)(n),l=r.findIndex(e=>"object"==typeof e&&"_key"in e);return(0,K.x)((0,Z.of)({loading:!0}),e.unstable_observePathsDocumentPair(i,-1===l?r:r.slice(0,l),{version:t}).pipe((0,A.B)(750),(0,E.T)(({draft:e,published:t,version:n})=>({loading:!1,result:{availability:{draft:e.availability,published:t.availability,...n?.availability?{version:n.availability}:{}},refValue:(0,es.Jt)(n?.snapshot||e.snapshot||t.snapshot,b)?._ref}}))))},[t,e,x,b]),_=(0,v.J)(j,{loading:!0}),w=(0,c.useCallback)(()=>{_.loading||_.result?.refValue&&o({id:_.result.refValue,params:n})},[_.loading,_.result,o,n]);return x&&b&&!g&&!_.loading&&(_.result?.availability.draft.available||_.result?.availability.published.available)&&_.result?.refValue!==u?(0,s.jsx)(t8,{action:_.result?.refValue?{onClick:w,icon:p.Fjq,text:y("banners.reference-changed-banner.reason-changed.reload-button.text")}:{as:d,icon:p.USm,text:y("banners.reference-changed-banner.reason-removed.close-button.text")},"data-testid":"reference-changed-banner",content:(0,s.jsx)(a.EY,{size:1,weight:"medium",children:y(_.result?.refValue?"banners.reference-changed-banner.reason-changed.text":"banners.reference-changed-banner.reason-removed.text")}),icon:p.sAQ,tone:"caution"}):null});function nb(){let e,t=(0,o.c)(2),{t:n}=(0,h.Bdt)(r.Z7);return t[0]!==n?(e=(0,s.jsx)(t8,{tone:"caution",icon:p.sAQ,content:(0,s.jsx)(a.EY,{size:1,children:(0,s.jsx)(h.HTc,{t:n,i18nKey:"banners.scheduled-draft-override-banner.text"})})}),t[0]=n,t[1]=e):e=t[1],e}function ny(){return(0,c.useContext)(u.l4)}function nj(){let{t:e}=(0,h.Bdt)(r.Z7),{t:t}=(0,h.Bdt)(),{data:n}=(0,h.gJZ)(),{params:i,setParams:l}=ny(),o=(0,c.useMemo)(()=>n.find(e=>(0,h._hI)(e._id)===i?.historyVersion),[n,i?.historyVersion]),d=(0,c.useMemo)(()=>o?.state==="published"?"banners.published-release.description":o&&(0,h._9c)(o)?"banners.archived-scheduled-draft.description":"banners.archived-release.description",[o]),u=o?.metadata.title||t("release.placeholder-untitled-release");return(0,s.jsx)(t8,{tone:"caution",content:(0,s.jsx)(a.EY,{size:1,children:(0,s.jsx)(h.HTc,{t:e,i18nKey:d,values:{title:u},components:{VersionBadge:(0,h.bSq)(o)}})}),action:i?.archivedRelease?void 0:{text:"Go back to published version",onClick:()=>{l({...i,rev:i?.historyEvent||void 0,since:void 0,historyVersion:void 0})}}})}ng.displayName="Memo(ReferenceChangedBanner)";let nv=g.I4.img`
288  object-fit: cover;
289  width: 100%;
290  height: 100%;
291  height: 180px;
292  display: flex;
293`,n_=e=>{let t,n,i,d,u,m,f,x,g,b,y,j,v=(0,o.c)(22),{onClose:_}=e,{t:w}=(0,h.Bdt)(r.Z7),S=(0,c.useRef)(null);return v[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>[S.current],v[0]=t):t=v[0],(0,a.PR)(_,t),v[1]===Symbol.for("react.memo_cache_sentinel")?(n=(0,s.jsx)(nv,{src:"https://cdn.sanity.io/images/pyrmmpch/production/b47224e2f3a7d1747e43b9da1ac31739250e628b-632x376.png",alt:"Canvas"}),v[1]=n):n=v[1],v[2]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)(a.EY,{size:1,weight:"semibold",children:"Canvas"}),v[2]=i):i=v[2],v[3]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsxs)(a.so,{paddingY:1,gap:2,children:[i,(0,s.jsx)(a.EY,{size:1,muted:!0,children:(0,s.jsx)(p.v5M,{})})]}),v[3]=d):d=v[3],v[4]!==w?(u=w("canvas.banner.popover-heading"),v[4]=w,v[5]=u):u=v[5],v[6]!==u?(m=(0,s.jsx)(a.az,{paddingTop:3,children:(0,s.jsx)(a.DZ,{size:1,children:u})}),v[6]=u,v[7]=m):m=v[7],v[8]!==w?(f=w("canvas.banner.popover-description"),v[8]=w,v[9]=f):f=v[9],v[10]!==f?(x=(0,s.jsx)(a.az,{paddingTop:4,children:(0,s.jsx)(a.EY,{size:1,children:f})}),v[10]=f,v[11]=x):x=v[11],v[12]!==m||v[13]!==x?(g=(0,s.jsxs)(a.so,{paddingX:4,paddingBottom:4,paddingTop:3,direction:"column",children:[d,m,x]}),v[12]=m,v[13]=x,v[14]=g):g=v[14],v[15]!==w?(b=w("canvas.banner.popover-button-text"),v[15]=w,v[16]=b):b=v[16],v[17]!==b?(y=(0,s.jsx)(a.so,{width:"full",gap:3,justify:"flex-end",paddingX:4,paddingBottom:4,children:(0,s.jsx)(l.$n,{mode:"bleed",text:b,autoF
293ocus:!0,tone:"primary",href:"https://snty.link/canvas-docs",target:"_blank",rel:"noopener noreferrer",as:"a",iconRight:p.ZPM})}),v[17]=b,v[18]=y):y=v[18],v[19]!==y||v[20]!==g?(j=(0,s.jsx)(a.Zp,{radius:3,overflow:"hidden",width:0,ref:S,children:(0,s.jsxs)(a.mc,{width:0,children:[n,g,y]})}),v[19]=y,v[20]=g,v[21]=j):j=v[21],j},nw=e=>{let t,n,i,d,u,m,f,x,g=(0,o.c)(17),{documentId:b}=e,{t:y}=(0,h.Bdt)(r.Z7),[j,v]=(0,c.useState)(!1),_=(0,h.tfA)(b);e:{let e;if("published"===_){let e;g[0]!==y?(e=y("canvas.banner.linked-text.published"),g[0]=y,g[1]=e):e=g[1],t=e;break e}if("draft"===_){let e;g[2]!==y?(e=y("canvas.banner.linked-text.draft"),g[2]=y,g[3]=e):e=g[3],t=e;break e}g[4]!==y?(e=y("canvas.banner.linked-text.version"),g[4]=y,g[5]=e):e=g[5],t=e}let w=t;g[6]===Symbol.for("react.memo_cache_sentinel")?(n=()=>v(nk),g[6]=n):n=g[6];let S=n;g[7]===Symbol.for("react.memo_cache_sentinel")?(i=()=>v(!1),g[7]=i):i=g[7];let k=i;return g[8]!==w?(d=(0,s.jsx)(a.EY,{size:1,weight:"medium",children:w}),g[8]=w,g[9]=d):d=g[9],g[10]===Symbol.for("react.memo_cache_sentinel")?(u=(0,s.jsx)(n_,{onClose:k}),m=(0,s.jsx)(l.$n,{tooltipProps:null,mode:"bleed",tone:"default",icon:p.YzR,onClick:S}),g[10]=u,g[11]=m):(u=g[10],m=g[11]),g[12]!==j?(f=(0,s.jsx)(l.AM,{open:j,size:0,tone:"default",portal:!0,placement:"bottom-start",content:u,children:m}),g[12]=j,g[13]=f):f=g[13],g[14]!==d||g[15]!==f?(x=(0,s.jsxs)(a.so,{align:"center",gap:2,children:[d,f]}),g[14]=d,g[15]=f,g[16]=x):x=g[16],x};function nS(){let e,t,n,i,l=(0,o.c)(10),{documentId:a,displayed:d}=tD(),{t:c}=(0,h.Bdt)(r.Z7),u=d?._id||a,{companionDoc:p}=(0,h.G2c)(u),m=(0,h.aqr)(p?.canvasDocumentId,"banner");return p?(l[0]!==u?(e=(0,s.jsx)(nw,{documentId:u}),l[0]=u,l[1]=e):e=l[1],l[2]!==c?(t=c("canvas.banner.edit-in-canvas-action"),l[2]=c,l[3]=t):t=l[3],l[4]!==m||l[5]!==t?(n={mode:"ghost",text:t,onClick:m},l[4]=m,l[5]=t,l[6]=n):n=l[6],l[7]!==e||l[8]!==n?(i=(0,s.jsx)(t8,{tone:"neutral","data-test-id":"canvas-linked-banner",paddingY:0,content:e,action:n}),l[7]=e,l[8]=n,l[9]=i):i=l[9],i):null}function nk(e){return!e}let nC=e=>{let t,n,i,l,d,c,u,m,f,x=(0,o.c)(27),{schemaType:g,selectedPerspective:b,reason:y}=e,{t:j}=(0,h.Bdt)(r.Z7),{document:v}=(0,h.hA9)(),{drafts:_}=v,{enabled:w}=_;x[0]!==w||x[1]!==g?(t=e=>{let{perspective:t}=e;return{disabled:!(0,h.CW3)({selectedPerspective:t,isDraftModelEnabled:w,schemaType:g}).result}},x[0]=w,x[1]=g,x[2]=t):t=x[2];let S=t;return x[3]!==y||x[4]!==j?(n="PUBLISHED_NOT_WRITEABLE"===y&&j("banners.choose-new-document-destination.cannot-create-published-document"),x[3]=y,x[4]=j,x[5]=n):n=x[5],x[6]!==y||x[7]!==j?(i="DRAFTS_NOT_WRITEABLE"===y&&j("banners.choose-new-document-destination.cannot-create-draft-document"),x[6]=y,x[7]=j,x[8]=i):i=x[8],x[9]!==y||x[10]!==b||x[11]!==j?(l="RELEASE_NOT_ACTIVE"===y&&(0,h.Jrl)(b)&&(0,s.jsx)(h.HTc,{t:j,i18nKey:"banners.choose-new-document-destination.release-inactive",values:{title:b.metadata.title},components:{VersionBadge:(0,h.bSq)(b)}}),x[9]=y,x[10]=b,x[11]=j,x[12]=l):l=x[12],x[13]!==j?(d=j("banners.choose-new-document-destination.choose-destination"),x[13]=j,x[14]=d):d=x[14],x[15]!==d?(c=(0,s.jsxs)(s.Fragment,{children:[" ",d]}),x[15]=d,x[16]=c):c=x[16],x[17]!==n||x[18]!==i||x[19]!==l||x[20]!==c?(u=(0,s.jsxs)(a.EY,{size:1,children:[n,i,l,c]}),x[17]=n,x[18]=i,x[19]=l,x[20]=c,x[21]=u):u=x[21],x[22]!==S?(m=(0,s.jsx)(h.GCV,{menuItemProps:S}),x[22]=S,x[23]=m):m=x[23],x[24]!==m||x[25]!==u?(f=(0,s.jsx)(t8,{tone:"caution",icon:p.sAQ,content:(0,s.jsxs)(a.so,{align:"center",gap:2,children:[u,m]})}),x[24]=m,x[25]=u,x[26]=f):f=x[26],f};function nI(){let e,t,n=(0,o.c)(5),{value:i}=tD(),{documentLinkedBannerContent:r}=(0,h.eaL)().components??{};n[0]!==i?(e=(0,h.G_3)(i),n[0]=i,n[1]=e):e=n[1];let l=e;return r&&l?(n[2]!==r||n[3]!==l?(t=(0,s.jsx)(t8,{tone:"transparent","data-test-id":"sanity-create-read-only-banner",content:(0,s.jsx)(r,{metadata:l})}),n[2]=r,n[3]=l,n[4]=t):t=n[4],t):null}function nE({documentId:e,currentRelease:t,isScheduledRelease:n}){let i=(0,h.Y73)(t??h.k0f),{t:l}=(0,h.Bdt)(r.Z7),{t:u}=(0,h.Bdt)(),{createVersion:p}=(0,h.wI4)(),[m,f]=(0,c.useState)(),x=(0,d.dj)(),g=(0,c.useCallback)(async()=>
293{if(t._id){f({status:"creating",lastUpdate:new Date});try{await p((0,h._hI)(t._id),e),f({status:"created",lastUpdate:new Date})}catch(e){x.push({status:"error",closable:!0,title:l("banners.release.error.title"),description:l("banners.release.error.description",{message:e.message})}),f(void 0)}}},[p,t._id,e,l,x]),b=function(e){let t,n,i,r=(0,o.c)(4);r[0]===Symbol.for("react.memo_cache_sentinel")?(t=new Date,r[0]=t):t=r[0];let[l,s]=(0,c.useState)(t);return 200!==r[1]?(n=()=>{let e=setInterval(()=>{s(new Date)},200);return()=>clearInterval(e)},i=[200],r[1]=200,r[2]=n,r[3]=i):(n=r[2],i=r[3]),(0,c.useEffect)(n,i),l}(200);return(0,h.B1J)({status:"info",id:"add-document-to-release",enabled:m?.status==="created"&&b.getTime()-m.lastUpdate.getTime()>1e3,closable:!0,title:l("banners.release.waiting.title"),description:l("banners.release.waiting.description")}),(0,s.jsx)(t8,{tone:i,content:(0,s.jsx)(a.EY,{size:1,children:(0,s.jsx)(h.HTc,{i18nKey:"banners.release.not-in-release",t:l,values:{title:t?.metadata?.title||u("release.placeholder-untitled-release")},components:{VersionBadge:(0,h.bSq)(t)}})}),action:n?void 0:{text:l("banners.release.action.add-to-release"),tone:i,disabled:!!m,onClick:g,mode:"default"}})}let nz=(0,em.g_)({name:"LiveEdit Draft Resolved",version:1,description:"User resolved a draft of a live edit document to continue editing"}),nT=e=>{let t,n,i,d,u,f,x,g,b,y,j,v,_,w,S,k=(0,o.c)(47),{displayed:C,documentId:I,schemaType:E,i18nKey:z,isEditBlocking:T}=e,{t:A}=(0,h.Bdt)(r.Z7),[P,R]=(0,c.useState)(!1),[M,D]=(0,c.useState)(!1),$=(0,ec.Jr)(),{publish:B,discardChanges:Y}=(0,h.QSs)(I,C?._type||"");k[0]!==B||k[1]!==$?(t=()=>{B.execute(),R(!0),$.log(nz,{liveEditResolveType:"publish"})},k[0]=B,k[1]=$,k[2]=t):t=k[2];let L=t;k[3]!==Y||k[4]!==$?(n=()=>{Y.execute(),D(!0),$.log(nz,{liveEditResolveType:"discard"})},k[3]=Y,k[4]=$,k[5]=n):n=k[5];let O=n;k[6]===Symbol.for("react.memo_cache_sentinel")?(i=()=>()=>{R(!1),D(!1)},k[6]=i):i=k[6],(0,c.useEffect)(i);let H=eD();k[7]!==H||k[8]!==C?._id||k[9]!==E.name?(d=()=>{typeof C?._id>"u"||H.navigateDiffView({mode:"version",previousDocument:{type:E.name,id:(0,m.IM)(C?._id)},nextDocument:{type:E.name,id:(0,m.T4)(C?._id)}})},k[7]=H,k[8]=C?._id,k[9]=E.name,k[10]=d):d=k[10];let V=d;return k[11]!==E.title?(u={schemaType:E.title},k[11]=E.title,k[12]=u):u=k[12],k[13]!==z||k[14]!==A||k[15]!==u?(f=(0,s.jsx)(a.EY,{size:1,weight:"medium",children:(0,s.jsx)(h.HTc,{t:A,i18nKey:z,values:u})}),k[13]=z,k[14]=A,k[15]=u,k[16]=f):f=k[16],k[17]!==A?(x=A("banners.obsolete-draft.actions.compare-draft.text"),k[17]=A,k[18]=x):x=k[18],k[19]!==V||k[20]!==x?(g=(0,s.jsx)(l.$n,{text:x,mode:"ghost",onClick:V}),k[19]=V,k[20]=x,k[21]=g):g=k[21],k[22]!==A?(b=A("banners.obsolete-draft.actions.publish-draft.text"),k[22]=A,k[23]=b):b=k[23],k[24]!==T||k[25]!==A?(y=T?{content:A("banners.live-edit-draft-banner.publish.tooltip")}:{},k[24]=T,k[25]=A,k[26]=y):y=k[26],k[27]!==L||k[28]!==P||k[29]!==y||k[30]!==b?(j=(0,s.jsx)(l.$n,{onClick:L,text:b,tooltipProps:y,loading:P,tone:"positive"}),k[27]=L,k[28]=P,k[29]=y,k[30]=b,k[31]=j):j=k[31],k[32]!==A?(v=A("banners.obsolete-draft.actions.discard-draft.text"),k[32]=A,k[33]=v):v=k[33],k[34]!==T||k[35]!==A?(_=T?{content:A("banners.live-edit-draft-banner.discard.tooltip")}:{},k[34]=T,k[35]=A,k[36]=_):_=k[36],k[37]!==O||k[38]!==M||k[39]!==v||k[40]!==_?(w=(0,s.jsx)(l.$n,{onClick:O,text:v,tooltipProps:_,loading:M,tone:"caution"}),k[37]=O,k[38]=M,k[39]=v,k[40]=_,k[41]=w):w=k[41],k[42]!==j||k[43]!==w||k[44]!==f||k[45]!==g?(S=(0,s.jsx)(t8,{content:(0,s.jsxs)(a.so,{align:"center",justify:"space-between",gap:2,children:[f,g,j,w]}),"data-testid":"live-edit-type-banner",icon:p.YZv}),k[42]=j,k[43]=w,k[44]=f,k[45]=g,k[46]=S):S=k[46],S};function nA(e){let t,n,i=(0,o.c)(4),{documentId:r,isPinnedDraftOrPublished:l}=e;i[0]!==r?(t={documentId:r},i[0]=r,i[1]=t):t=i[1];let a=(0,h.Jr6)(t);return(0,m.A_)(r)&&a&&l?(i[2]!==r?(n=(0,s.jsx)(nP,{documentId:r}),i[2]=r,i[3]=n):n=i[3],n):null}function nP({documentId:e}){let{data:t}=(0,h.K0D)(),n=(0,h._T7)(),i=(0,m._S)(e)??"",l=(0,c.useMemo)(()=>t.find(e=>e._id.includes(i)),[t,i]),{t:o}=(0,h.Bdt)(),{data:d}=(0,h.gn8)({documentId:e}),u=(0,c.useMemo)(()=>t.filter(e=>d.find(t=>{let n=(0,m._S)(t)??"";return(0,h._hI)(e._id)===n})).map(e=>e.metadata.title||o("release.placeholder-untitled-release")),[t,d,o]),p=l&&(0,h.Y73)(l),{t:f}=(0,h.Bdt)(r.Z7),x=(0,c.useCallback)(async()=>{n(i)},[i,n]);return(0,s.jsx)(t8,{tone:p,"data-testid":"open-release-to-edit-banner",content:(0,s.jsx)(a.EY,{size:1,children:(0,s.jsx)(a.so,{direction:"row",gap:1,wrap:"wrap",children:u.length>1?(0,s.jsx)(h.HTc,{t:f,i18nKey:"banners.release.navigate-to-edit-description-multiple",components:{VersionBadge:()=>(0,s.jsxs)(h.RwK,{children:[" ",u[0]]})},values:{count:u.length-1}}):(0,s.jsx)(h.HTc,{t:f,i18nKey:"banners.release.navigate-to-edit-description-single",components:{VersionBadge:()=>(0,s.jsxs)(h.RwK,{children:[" ",u[0]]})}})})}),action:{text:f("banners.release.action.open-to-edit"),tone:p,onClick:x,mode:"default"}})}function nR(){let e,t,n=(0,o.c)(4),{revisionNotFound:i}=tD(),{t:l}=(0,h.Bdt)(r.Z7);return i?(n[0]!==l?(e=l("banners.revision-not-found.description"),n[0]=l,n[1]=e):e=n[1],n[2]!==e?(t=(0,s.jsx)(t8,{tone:"caution","data-test-id":"revision-not-found-banner",icon:p.sAQ,content:(0,s.jsx)(a.EY,{size:1,children:e})}),n[2]=e,n[3]=t):t=n[3],t):null}function nM(e){let t,n,i,r,l,d=(0,o.c)(12),{currentRelease:c}=e,u=c??h.k0f;d[0]!==u?(t=(0,h.Y73)(u),d[0]=u,d[1]=t):t=d[1];let m=t,{t:f}=(0,h.Bdt)();return d[2]!==c?(n=(0,h.drb)(c),d[2]=c,d[3]=n):n=d[3],d[4]!==n?(i={date:n},d[4]=n,d[5]=i):i=d[5],d[6]!==i||d[7]!==f?(r=(0,s.jsx)(a.EY,{size:1,children:(0,s.jsx)(h.HTc,{t:f,i18nKey:"release.banner.scheduled-for-publishing-on",values:i})}),d[6]=i,d[7]=f,d[8]=r):r=d[8],d[9]!==r||d[10]!==m?(l=(0,s.jsx)(t8,{tone:m,icon:p.XAi,content:r}),d[9]=r,d[10]=m,d[11]=l):l=d[11],l}function nD(){let e=(0,o.c)(18),{value:t,editState:n}=tD(),{selectedPerspective:i}=(0,h.QO2)(),l=(0,h.YW1)(t)||n?.version&&(0,h.YW1)(n?.version),{t:d}=(0,h.Bdt)(r.Z7),{t:c}=(0,h.Bdt)();if((0,h.Jrl)(i)&&l){let t,n,r,l,o,u,m;e[0]!==i.metadata?.title||e[1]!==c?(t=i.metadata?.title||c("release.placeholder-untitled-release"),e[0]=i.metadata?.title,e[1]=c,e[2]=t):t=e[2];let f=t;return e[3]!==f?(n={title:f},e[3]=f,e[4]=n):n=e[4],e[5]!==i?(r=(0,h.bSq)(i),e[5]=i,e[6]=r):r=e[6],e[7]!==r?(l={VersionBadge:r},e[7]=r,e[8]=l):l=e[8],e[9]!==d||e[10]!==n||e[11]!==l?(o=(0,s.jsx)(a.EY,{size:1,children:(0,s.jsx)(h.HTc,{t:d,i18nKey:"banners.unpublished-release-banner.text",values:n,components:l})}),e[9]=d,e[10]=n,e[11]=l,e[12]=o):o=e[12],e[13]!==d?(u=(0,s.jsx)(a.EY,{size:1,children:(0,s.jsx)(h.HTc,{t:d,i18nKey:"banners.unpublished-release-banner.text-with-published"})}),e[13]=d,e[14]=u):u=e[14],e[15]!==o||e[16]!==u?(m=(0,s.jsx)(t8,{tone:"critical",content:(0,s.jsxs)(a.BJ,{space:2,children:[o,u]}),icon:p.wvk}),e[15]=o,e[16]=u,e[17]=m):m=e[17],m}return null}let n$=(0,g.I4)(a.BJ)`
294  ${({theme:e})=>(0,g.AH)`
295      @supports not (container-type: inline-size) {
296        display: none !important;
297      }
298
299      container-type: inline-size;
300
301      [data-heading] {
302        font-size: ${e.sanity.fonts.heading.sizes[4].fontSize}px;
303        line-height: ${e.sanity.fonts.heading.sizes[4].lineHeight}px;
304        overflow-wrap: break-word;
305        text-wrap: pretty;
306      }
307
308      @container (max-width: 560px) {
309        [data-heading] {
310          font-size: ${e.sanity.fonts.heading.sizes[3].fontSize}px;
311          line-height: ${e.sanity.fonts.heading.sizes[3].lineHeight}px;
312        }
313      }
314
315      @container (max-width: 420px) {
316        [data-heading] {
317          font-size: ${e.sanity.fonts.heading.sizes[2].fontSize}px;
318          line-height: ${e.sanity.fonts.heading.sizes[2].lineHeight}px;
319        }
320      }
321    `}
322`,nB=e=>{let t,n,i,d,c=(0,o.c)(14),{documentId:u,schemaType:m,title:f}=e,x=u===m.name,g=m.description,{t:b}=(0,h.Bdt)(r.Z7);if(!1===m.__experimental_formPreviewTitle)return null;c[0]!==g||c[1]!==x||c[2]!==m.name||c[3]!==m.title?(t=!x&&(0,s.jsxs)(a.cV,{space:1,children:[(0,s.jsx)(a.EY,{muted:!0,size:1,children:m.title??m.name}),g&&(0,s.jsx)(l.m_,{content:g,placement:"right",children:(0,s.jsx)(p.YzR,{"data-testid":"schema-description-icon"})})]}),c[0]=g,c[1]=x,c[2]=m.name,c[3]=m.title,c[4]=t):t=c[4];let y=!f;return c[5]!==b||c[6]!==f?(n=f??b("document-view.form-view.form-title-fallback"),
322c[5]=b,c[6]=f,c[7]=n):n=c[7],c[8]!==y||c[9]!==n?(i=(0,s.jsx)(a.DZ,{as:"h2","data-heading":!0,muted:y,"data-testid":"document-panel-document-title",children:n}),c[8]=y,c[9]=n,c[10]=i):i=c[10],c[11]!==t||c[12]!==i?(d=(0,s.jsxs)(n$,{marginBottom:6,space:4,children:[t,i]}),c[11]=t,c[12]=i,c[13]=d):d=c[13],d},nY=e=>e.preventDefault(),nL=(0,c.forwardRef)(function(e,t){let n,i,l,u,p,m,f,x,g,b,y,j,v,_,w,S=(0,o.c)(77),{hidden:k,margins:C}=e,{collapsedFieldSets:I,collapsedPaths:E,displayed:z,editState:T,documentId:A,documentType:R,fieldActions:M,onChange:D,validation:$,ready:B,formState:Y,onFocus:L,connectionState:O,onBlur:H,onSetCollapsedPath:V,onPathOpen:N,onSetCollapsedFieldSet:Z,onSetActiveFieldGroup:F,openPath:K,compareValue:W,hasUpstreamVersion:J}=tD(),{selectedReleaseId:U,selectedPerspective:G}=(0,h.QO2)(),Q=(0,h.q3J)(),q=(0,h.cVB)(A),{title:X}=tZ(),[ee]=(0,c.useState)(nO),et=T?.transactionSyncLock?.enabled,{t:en}=(0,h.Bdt)(r.Z7);S[0]!==en?(n=en("document-view.form-view.sync-lock-toast.title"),S[0]=en,S[1]=n):n=S[1],S[2]!==en?(i=en("document-view.form-view.sync-lock-toast.description"),S[2]=en,S[3]=i):i=S[3],S[4]!==et||S[5]!==n||S[6]!==i?(l={id:"sync-lock",status:"warning",enabled:et,title:n,description:i,closable:!0},S[4]=et,S[5]=n,S[6]=i,S[7]=l):l=S[7],(0,h.B1J)(l),S[8]!==A||S[9]!==Q.pair||S[10]!==R||S[11]!==ee||S[12]!==U?(u=()=>{let e=Q.pair.documentEvents(A,R,U).pipe((0,P.M)(e=>{var t,n;let i,r,l;"mutation"===e.type&&ee.publish((i=(t=e).mutations.map(e=>e.patch).filter(Boolean),{type:"mutation",snapshot:t.document,patches:(0,h.i6N)(t.origin,i)})),"rebase"===e.type&&ee.publish((r=(n=e).remoteMutations.map(e=>e.patch).filter(Boolean),l=n.localMutations.map(e=>e.patch).filter(Boolean),{type:"rebase",snapshot:n.document,patches:(0,h.i6N)("remote",r).concat((0,h.i6N)("local",l))}))})).subscribe();return()=>{e.unsubscribe()}},S[8]=A,S[9]=Q.pair,S[10]=R,S[11]=ee,S[12]=U,S[13]=u):u=S[13],S[14]!==A||S[15]!==Q||S[16]!==R||S[17]!==ee||S[18]!==U?(p=[A,Q,R,ee,U],S[14]=A,S[15]=Q,S[16]=R,S[17]=ee,S[18]=U,S[19]=p):p=S[19],(0,c.useEffect)(u,p);let ei=!!z?._rev;S[20]!==ee||S[21]!==z?(m=()=>{ee.publish({type:"mutation",patches:[],snapshot:z})},S[20]=ee,S[21]=z,S[22]=m):m=S[22];let er=(0,eS.J)(m);S[23]!==er||S[24]!==ei?(f=()=>{ei&&er()},S[23]=er,S[24]=ei,S[25]=f):f=S[25],S[26]!==ei?(x=[ei],S[26]=ei,S[27]=x):x=S[27],(0,c.useEffect)(f,x);let[el,es]=(0,c.useState)(null),[eo,ea]=(0,c.useState)(!1);S[28]!==eo||S[29]!==el||S[30]!==Y?.focusPath.length||S[31]!==B?(g=()=>{!eo&&B&&!Y?.focusPath.length&&el&&(ea(!0),(0,d.s5)(el))},S[28]=eo,S[29]=el,S[30]=Y?.focusPath.length,S[31]=B,S[32]=g):g=S[32];let ed=Y?.focusPath.length;S[33]!==eo||S[34]!==el||S[35]!==B||S[36]!==ed?(b=[eo,el,ed,B],S[33]=eo,S[34]=el,S[35]=B,S[36]=ed,S[37]=b):b=S[37],(0,c.useEffect)(g,b),S[38]!==t?(y=e=>{es(e),"function"==typeof t?t(e):t&&(t.current=e)},S[38]=t,S[39]=y):y=S[39];let ec=y,eu="reconnecting"===O||Y?.readOnly||!T?.ready,ep=eu?"true":void 0;return S[40]!==I||S[41]!==E||S[42]!==W||S[43]!==O||S[44]!==A||S[45]!==T?.draft||S[46]!==T?.published||S[47]!==M||S[48]!==Y||S[49]!==J||S[50]!==k||S[51]!==eu||S[52]!==H||S[53]!==D||S[54]!==L||S[55]!==N||S[56]!==F||S[57]!==Z||S[58]!==V||S[59]!==K||S[60]!==ee||S[61]!==q||S[62]!==G||S[63]!==en||S[64]!==X||S[65]!==$?(j="connecting"!==O||T?.draft||T?.published?null===Y||k?(0,s.jsx)(a.az,{padding:2,children:(0,s.jsx)(a.EY,{children:en("document-view.form-view.form-hidden")})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(nB,{documentId:A,schemaType:Y.schemaType,title:X}),(0,s.jsx)(h.okx,{__internal_fieldActions:M,__internal_patchChannel:ee,changed:Y.changed,collapsedFieldSets:I,collapsedPaths:E,compareValue:W??void 0,focused:Y.focused,focusPath:Y.focusPath,groups:Y.groups,id:"root",members:Y.members,onChange:D,onFieldGroupSelect:F,onPathBlur:H,onPathFocus:L,onPathOpen:N,onSetFieldSetCollapsed:Z,onSetPathCollapsed:V,openPath:K,perspective:G,hasUpstreamVersion:J,presence:q,readOnly:eu,schemaType:Y.schemaType,validation:$,value:Y.value})]}):(0,s.jsx)(tA,{ms:300,children:(0,s.jsxs)(a.so,{align:"center",direction:"column",height:"fill",justify:"center",children:[(0,s.jsx)(a.y$,{muted:!0}
322),(0,s.jsx)(a.az,{marginTop:3,children:(0,s.jsx)(a.EY,{align:"center",muted:!0,size:1,children:en("document-view.form-view.loading")})})]})}),S[40]=I,S[41]=E,S[42]=W,S[43]=O,S[44]=A,S[45]=T?.draft,S[46]=T?.published,S[47]=M,S[48]=Y,S[49]=J,S[50]=k,S[51]=eu,S[52]=H,S[53]=D,S[54]=L,S[55]=N,S[56]=F,S[57]=Z,S[58]=V,S[59]=K,S[60]=ee,S[61]=q,S[62]=G,S[63]=en,S[64]=X,S[65]=$,S[66]=j):j=S[66],S[67]!==ec||S[68]!==ep||S[69]!==j?(v=(0,s.jsx)(a.az,{as:"form",onSubmit:nY,ref:ec,"data-testid":"form-view","data-read-only":ep,children:j}),S[67]=ec,S[68]=ep,S[69]=j,S[70]=v):v=S[70],S[71]!==C||S[72]!==v?(_=(0,s.jsx)(h.MLZ,{margins:C,children:v}),S[71]=C,S[72]=v,S[73]=_):_=S[73],S[74]!==k||S[75]!==_?(w=(0,s.jsx)(a.mc,{hidden:k,paddingX:4,paddingTop:5,paddingBottom:9,sizing:"border",width:1,children:_}),S[74]=k,S[75]=_,S[76]=w):w=S[76],w});function nO(){return(0,h.Ijd)()}function nH(){let e,t,n=(0,o.c)(11),{activeViewId:i,paneKey:r,views:l}=tD(),d=`${r}tabpanel`;if(n[0]!==i||n[1]!==r||n[2]!==d||n[3]!==l){let t;n[5]!==i||n[6]!==r||n[7]!==d?(t=(e,t)=>(0,s.jsx)(nV,{icon:e.icon,id:`${r}tab-${e.id}`,isActive:i===e.id,label:e.title,tabPanelId:d,viewId:0===t?null:e.id??null},e.id),n[5]=i,n[6]=r,n[7]=d,n[8]=t):t=n[8],e=l.map(t),n[0]=i,n[1]=r,n[2]=d,n[3]=l,n[4]=e}else e=n[4];return n[9]!==e?(t=(0,s.jsx)(a.wb,{space:1,children:e}),n[9]=e,n[10]=t):t=n[10],t}function nV(e){let t,n,i,r,a,d,c,u,p,m=(0,o.c)(20);m[0]!==e?({icon:t,id:n,isActive:i,label:r,tabPanelId:d,viewId:c,...a}=e,m[0]=e,m[1]=t,m[2]=n,m[3]=i,m[4]=r,m[5]=a,m[6]=d,m[7]=c):(t=m[1],n=m[2],i=m[3],r=m[4],a=m[5],d=m[6],c=m[7]);let{ready:h,editState:f}=tD(),{setView:x}=ny();m[8]!==x||m[9]!==c?(u=()=>x(c),m[8]=x,m[9]=c,m[10]=u):u=m[10];let g=u,b=!h&&!f?.draft&&!f?.published;return m[11]!==g||m[12]!==t||m[13]!==n||m[14]!==i||m[15]!==r||m[16]!==a||m[17]!==b||m[18]!==d?(p=(0,s.jsx)(l.oz,{...a,"aria-controls":d,disabled:b,icon:t,id:n,label:r,onClick:g,selected:i}),m[11]=g,m[12]=t,m[13]=n,m[14]=i,m[15]=r,m[16]=a,m[17]=b,m[18]=d,m[19]=p):p=m[19],p}function nN(){let e,t,n=(0,o.c)(18),{connectionState:i,schemaType:l,title:a,value:d}=tD(),{title:c,error:u}=tZ(),{t:p}=(0,h.Bdt)(r.Z7);if("connecting"===i&&!d){let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)(s.Fragment,{}),n[0]=e):e=n[0],e}if(a){let e;return n[1]!==a?(e=(0,s.jsx)(s.Fragment,{children:a}),n[1]=a,n[2]=e):e=n[2],e}if(!d){let e,t,i=l?.title||l?.name;return n[3]!==p||n[4]!==i?(e=p("panes.document-header-title.new.text",{schemaType:i}),n[3]=p,n[4]=i,n[5]=e):e=n[5],n[6]!==e?(t=(0,s.jsx)(s.Fragment,{children:e}),n[6]=e,n[7]=t):t=n[7],t}if(u){let e,t;return n[8]!==u||n[9]!==p?(e=p("panes.document-header-title.error.text",{error:u}),n[8]=u,n[9]=p,n[10]=e):e=n[10],n[11]!==e?(t=(0,s.jsx)(s.Fragment,{children:e}),n[11]=e,n[12]=t):t=n[12],t}return n[13]!==c||n[14]!==p?(e=c||(0,s.jsx)("span",{style:{color:"var(--card-muted-fg-color)"},children:p("panes.document-header-title.untitled.text")}),n[13]=c,n[14]=p,n[15]=e):e=n[15],n[16]!==e?(t=(0,s.jsx)(s.Fragment,{children:e}),n[16]=e,n[17]=t):t=n[17],t}let nZ=e=>{let t,n,i,d,c,u,m=(0,o.c)(16);m[0]!==e?({documentExists:t,...n}=e,m[0]=e,m[1]=t,m[2]=n):(t=m[1],n=m[2]);let{isFavorited:f,isReady:x,favorite:g,unfavorite:b}=(0,h.$_6)(n),{t:y}=(0,h.Bdt)(r.Z7),j=f?"document.favorites.remove-from-favorites":"document.favorites.add-to-favorites";m[3]!==y||m[4]!==j?(i=y(j),m[3]=y,m[4]=j,m[5]=i):i=m[5];let v=i,_=f?b:g,w=!x||!t;return m[6]!==v?(d={content:(0,s.jsx)(a.EY,{size:1,children:v}),placement:"right"},m[6]=v,m[7]=d):d=m[7],m[8]!==f?(c=(0,s.jsx)(a.EY,{size:1,children:f?(0,s.jsx)(p.WmX,{}):(0,s.jsx)(p.Gg5,{})}),m[8]=f,m[9]=c):c=m[9],m[10]!==v||m[11]!==_||m[12]!==w||m[13]!==d||m[14]!==c?(u=(0,s.jsx)(l.$n,{mode:"bleed",onClick:_,disabled:w,"aria-label":v,"aria-live":"assertive",tooltipProps:d,children:c}),m[10]=v,m[11]=_,m[12]=w,m[13]=d,m[14]=c,m[15]=u):u=m[15],u},nF=(0,c.memo)(function(){let e,t,n,i,a,d,c=(0,o.c)(24),{editState:u,connectionState:m,views:f,documentId:x,displayed:g}=tD(),{features:b}=tY(),{index:y,BackLink:j}=ny(),{activeWorkspace:v}=(0,h.VrO)(),_=f.length>1,{collapsed:w,isLast:S}=tt(),k=S&&!w?-1:0,C=b.backButton&&y>0,{t:I}=(0,h.Bdt)(r.Z7);c[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)(nN,{}),c[0]=e):e=c[0];let E=e;c[1]!==_?(t=_&&(0,s.jsx)(nH,{}),c[1]=_,c[2]=t):t=c[2];let z=t;
322c[3]!==j||c[4]!==C||c[5]!==I?(n=C&&(0,s.jsx)(l.$n,{as:j,"data-as":"a",icon:p.A60,mode:"bleed",tooltipProps:{content:I("pane-header.back-button.text")}}),c[3]=j,c[4]=C,c[5]=I,c[6]=n):n=c[6];let T=n,A=g?._id??x,P=g?._type??"";c[7]!==v.dataset||c[8]!==v.projectId?(i=[v.projectId,v.dataset],c[7]=v.dataset,c[8]=v.projectId,c[9]=i):i=c[9];let R=i.join("."),M=(u?.ready&&(u.version??u.draft??u.published)!==null)??!1;c[10]!==v.dataset||c[11]!==v.name||c[12]!==v.projectId||c[13]!==A||c[14]!==P||c[15]!==R||c[16]!==M?(a=(0,s.jsx)(h.m2r,{capability:"comlink",condition:"available",children:(0,s.jsx)(nZ,{resourceType:"studio",documentId:A,documentType:P,resourceId:R,schemaName:v.name,projectId:v.projectId,dataset:v.dataset,documentExists:M})}),c[10]=v.dataset,c[11]=v.name,c[12]=v.projectId,c[13]=A,c[14]=P,c[15]=R,c[16]=M,c[17]=a):a=c[17];let D=a,$="connecting"===m&&!u?.draft&&!u?.published;return c[18]!==T||c[19]!==D||c[20]!==$||c[21]!==k||c[22]!==z?(d=(0,s.jsx)(tj,{loading:$,title:E,tabs:z,tabIndex:k,backButton:T,appendTitle:D}),c[18]=T,c[19]=D,c[20]=$,c[21]=k,c[22]=z,c[23]=d):d=c[23],d}),nK=(0,g.I4)(a.az)({position:"relative"}),nW=(0,g.I4)(h.PaW)(({$disabled:e})=>e?{height:"100%"}:(0,g.AH)`
323    height: 100%;
324    overflow: auto;
325    position: relative;
326    scroll-behavior: smooth;
327    outline: none;
328  `),nJ=function(e){let t,n,i,r,l,d,u,p,f,x,g,b,y,j,v,_,w=(0,o.c)(109),{footerHeight:S,headerHeight:k,isInspectOpen:C,rootElement:I,setDocumentPanelPortalElement:E,footer:z}=e,{activeViewId:T,displayed:A,documentId:P,editState:R,inspector:M,value:D,views:$,ready:B,schemaType:Y,permissions:L,isPermissionsLoading:O}=tD();if(w[0]!==D){let e=(0,h.G_3)(D);t=(0,h.Y07)(e),w[0]=D,w[1]=t}else t=w[1];let H=t,{params:V}=ny(),{collapsed:N}=e5(),{collapsed:Z}=tt(),F=(0,a.WP)(),{features:K}=tY(),[W,J]=(0,c.useState)(null),[U,G]=(0,c.useState)(null),Q=(0,c.useRef)(null),q=(0,h.hA9)(),X=D._createdAt?"update":"create";w[2]!==T||w[3]!==$?(n=$.find(e=>e.id===T)||$[0]||{type:"form"},w[2]=T,w[3]=$,w[4]=n):n=w[4];let ee=n,et=K.splitPanes&&W||F.element;e:{let e;if(N){let e,t=k||0,n=S?S+2:2;w[5]!==t||w[6]!==n?(e=[t,0,n,0],w[5]=t,w[6]=n,w[7]=e):e=w[7],i=e;break e}w[8]===Symbol.for("react.memo_cache_sentinel")?(e=[0,0,2,0],w[8]=e):e=w[8],i=e}let en=i,ei="form"!==ee.type;w[9]!==ee.component||w[10]!==ee.options||w[11]!==ee.type||w[12]!==A||w[13]!==P||w[14]!==R?.draft||w[15]!==R?.published||w[16]!==Y||w[17]!==D?(r=()=>{if("component"===ee.type&&ee.component){let e=ee.component;return(0,s.jsx)(e,{document:{draft:R?.draft||null,displayed:A||D,historical:A,published:R?.published||null},documentId:P,options:ee.options,schemaType:Y})}return!1},w[9]=ee.component,w[10]=ee.options,w[11]=ee.type,w[12]=A,w[13]=P,w[14]=R?.draft,w[15]=R?.published,w[16]=Y,w[17]=D,w[18]=r):r=w[18],w[19]!==r?(l=r(),w[19]=r,w[20]=l):l=w[20];let er=l;w[21]!==U?(d=()=>{U?.scrollTo&&U.scrollTo(0,0)},w[21]=U,w[22]=d):d=w[22],w[23]!==P||w[24]!==U?(u=[P,U],w[23]=P,w[24]=U,w[25]=u):u=w[25],(0,c.useEffect)(d,u),w[26]!==et||w[27]!==E?(p=()=>{et&&E(et)},f=[et,E],w[26]=et,w[27]=E,w[28]=p,w[29]=f):(p=w[28],f=w[29]),(0,c.useEffect)(p,f),w[30]!==A||w[31]!==C||w[32]!==D?(x=C?(0,s.jsx)(t7,{value:A||D}):null,w[30]=A,w[31]=C,w[32]=D,w[33]=x):x=w[33];let el=x,es=!!(!Z&&M),{selectedPerspective:eo,selectedReleaseId:ea}=(0,h.QO2)(),ed=V?.historyVersion;w[34]!==A||w[35]!==P||w[36]!==ed?(g={historyVersion:ed,displayed:A,documentId:P},w[34]=A,w[35]=P,w[36]=ed,w[37]=g):g=w[37];let ec=(0,h.LJ4)(g);t:{let e,t,n,i,r,l,o,a,d,c,u,p,f,x;if(V?.historyVersion){let e;w[38]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)(nj,{}),w[38]=e):e=w[38],b=e;break t}w[39]!==eo?(e=(0,h.Jrl)(eo)&&(0,h.KJ$)(eo),w[39]=eo,w[40]=e):e=w[40];let g=e,y=!!(g&&A?._id&&(0,m._S)(A?._id)===ea);if(w[41]!==R||w[42]!==Y||w[43]!==eo||w[44]!==q.document.drafts.enabled?(n=function({isSelectedPerspectiveWriteable:e,editState:t}){return(0,h.cX9)(t)&&!e.result}({isSelectedPerspectiveWriteable:t=(0,h.CW3)({selectedPerspective:eo,isDraftModelEnabled:q.document.drafts.enabled,schemaType:Y}),editState:R}),w[41]=R,w[42]=Y,w[43]=eo,w[44]=q.document.drafts.enabled,w[45]=t,w[46]=n):(t=w[45],n=w[46]),n){let e;w[47]!==t.reason||w[48]!==t.result||w[49]!==Y||w[50]!==eo?(e=!t.result&&(0,s.jsx)(nC,{schemaType:Y,selectedPerspective:eo,reason:t.reason}
328),w[47]=t.reason,w[48]=t.result,w[49]=Y,w[50]=eo,w[51]=e):e=w[51],b=e;break t}if(y){let e;w[52]!==eo?(e=(0,s.jsx)(nM,{currentRelease:eo}),w[52]=eo,w[53]=e):e=w[53],b=e;break t}let j=ec.currentReleases.some(h._9c);if("drafts"===eo&&j){let e;w[54]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)(nb,{}),w[54]=e):e=w[54],b=e;break t}w[55]!==eo?(i=(0,h.sBy)(eo),w[55]=eo,w[56]=i):i=w[56];let v=i,_=R?.version&&(0,h.YW1)(R?.version);if(A?._id&&(0,m._S)(A._id)!==ea&&B&&!v&&!1===(0,h.cX9)(R)&&!_){let e;w[57]!==g||w[58]!==eo||w[59]!==D._id?(e=(0,s.jsx)(nE,{documentId:D._id,currentRelease:eo,isScheduledRelease:g}),w[57]=g,w[58]=eo,w[59]=D._id,w[60]=e):e=w[60],b=e;break t}let S=function({editState:e,workspace:t,schemaType:n}){if(!e?.ready)return{result:void 0};let i=null!==e.draft,{document:{drafts:{enabled:r}}}=t;return!1===i?{result:!1}:r?!0===n.liveEdit?{result:!0,reason:"LIVE_EDIT_ACTIVE"}:{result:!1}:{result:!0,reason:"DRAFT_MODEL_INACTIVE"}}({editState:R,workspace:q,schemaType:Y});if("form"===ee.type&&!ea&&S.result){if("DRAFT_MODEL_INACTIVE"===S.reason){let e;w[61]!==A||w[62]!==P||w[63]!==Y?(e=(0,s.jsx)(nT,{displayed:A,documentId:P,schemaType:Y,i18nKey:"banners.obsolete-draft.draft-model-inactive.text"}),w[61]=A,w[62]=P,w[63]=Y,w[64]=e):e=w[64],b=e;break t}if("LIVE_EDIT_ACTIVE"===S.reason){let e;w[65]!==A||w[66]!==P||w[67]!==Y?(e=(0,s.jsx)(nT,{displayed:A,documentId:P,schemaType:Y,i18nKey:"banners.live-edit-draft-banner.text",isEditBlocking:!0}),w[65]=A,w[66]=P,w[67]=Y,w[68]=e):e=w[68],b=e;break t}}if("form"!==ee.type||O){b=null;break t}w[69]!==H?(r=H&&(0,s.jsx)(nI,{}),w[69]=H,w[70]=r):r=w[70],w[71]!==L?.granted||w[72]!==X?(l=!L?.granted&&(0,s.jsx)(nh,{requiredPermission:X}),w[71]=L?.granted,w[72]=X,w[73]=l):l=w[73],w[74]===Symbol.for("react.memo_cache_sentinel")?(o=(0,s.jsx)(nR,{}),a=(0,s.jsx)(ng,{}),d=(0,s.jsx)(nn,{}),c=(0,s.jsx)(nS,{}),u=(0,s.jsx)(t9,{}),p=(0,s.jsx)(nD,{}),w[74]=o,w[75]=a,w[76]=d,w[77]=c,w[78]=u,w[79]=p):(o=w[74],a=w[75],d=w[76],c=w[77],u=w[78],p=w[79]);let k=A?._id??P;w[80]!==v||w[81]!==k?(f=(0,s.jsx)(nA,{documentId:k,isPinnedDraftOrPublished:v}),w[80]=v,w[81]=k,w[82]=f):f=w[82],w[83]!==r||w[84]!==l||w[85]!==f?(x=(0,s.jsxs)(s.Fragment,{children:[r,l,o,a,d,c,u,p,f]}),w[83]=r,w[84]=l,w[85]=f,w[86]=x):x=w[86],b=x}let eu=b;w[87]!==U?(y={documentScrollElement:U},w[87]=U,w[88]=y):y=w[88];let ep=y,em=K.resizablePanes||!es;return w[89]!==er||w[90]!==eu||w[91]!==U||w[92]!==z||w[93]!==ei||w[94]!==el||w[95]!==N||w[96]!==en||w[97]!==et||w[98]!==ep||w[99]!==em?(j=em&&(0,s.jsxs)(a.so,{height:"fill",direction:"column",width:"fill",flex:2,children:[(0,s.jsxs)(h.wG1,{zOffset:"paneHeader",children:[eu,(0,s.jsx)(nF,{})]}),(0,s.jsx)(nK,{flex:2,children:(0,s.jsx)(a.GD,{element:et,__unstable_elements:ep,children:(0,s.jsx)(a.EZ,{element:U,children:(0,s.jsxs)(h.jsZ,{scrollElement:U,containerElement:Q,children:[(0,s.jsxs)(nW,{$disabled:N||!1,"data-testid":"document-panel-scroller",ref:G,children:[(0,s.jsx)(nL,{hidden:ei,margins:en,ref:Q}),er]}),el,(0,s.jsx)("div",{"data-testid":"document-panel-portal",ref:J})]})})})}),z]}),w[89]=er,w[90]=eu,w[91]=U,w[92]=z,w[93]=ei,w[94]=el,w[95]=N,w[96]=en,w[97]=et,w[98]=ep,w[99]=em,w[100]=j):j=w[100],w[101]!==P||w[102]!==I||w[103]!==Y||w[104]!==es?(v=es&&(0,s.jsx)(a.EZ,{element:I,children:(0,s.jsx)(tU,{documentId:P,documentType:Y.name,flex:1})}),w[101]=P,w[102]=I,w[103]=Y,w[104]=es,w[105]=v):v=w[105],w[106]!==j||w[107]!==v?(_=(0,s.jsx)(tn,{children:(0,s.jsxs)(a.so,{height:"fill",children:[j,v]})}),w[106]=j,w[107]=v,w[108]=_):_=w[108],_};function nU(e){return("item"===e.type||"group"===e.type)&&e.renderAsButton}nJ.displayName="DocumentPanel";let nG=ea(nU);function nQ(e){let{fieldActions:t=[],menuItems:n,menuItemGroups:i}=e,r=[],l=0;for(let e=0;e<t.length;e+=1){let n=t[e];r.push(function e(t,n){return"divider"===t.type?{type:"divider",key:n}:"group"===t.type?{type:"group",key:n,children:t.children.map((t,i)=>e(t,`${n}-${i}-${t.type}`)),disabled:t.disabled,expanded:t.expanded??!0,icon:t.icon,title:t.title,i18n:t.i18n,renderAsButton:t.renderAsButton??!1}:{type:"item",key:n,intent:t.intent,disabled:t.disabled,icon:t.icon,iconRight:t.iconRight,onAction:t.onAction,renderAsButton:t.renderAsButton??!1,selected:t.selected,title:t.title,i18n:t.i18n,tone:t.tone}}(n,`${e}-${n.type}`))}l+=r.length;let s=[];for(let e of i)s.find(t=>t.key===e.id)||s.push({type:"group",key:e.id,children:[],expanded:!0,renderAsButton:!1,title:e.title,i18n:e.i18n});let o=[];for(let t=0;t<n.length;t+=1){let i=n[t],r=i.group&&s.find(e=>e.key===i.group),a="string"==typeof i.disabled?{reason:i.disabled}:i.disabled;i.group&&!r&&(r={type:"group",key:i.group,disabled:a,expanded:!0,icon:i.icon,title:i.group,children:[],renderAsButton:!1},s.push(r)),r?r.children.push({type:"item",key:`${l+t}-item`,hotkey:i.shortcut,icon:i.icon,intent:i.intent,disabled:a,onAction:()=>e.actionHandler(i),renderAsButton:i.showAsAction??!1,selected:i.selected,title:i.title,i18n:i.i18n,tone:i.tone}):o.push({type:"item",key:`${l+t}-item`,hotkey:i.shortcut,icon:i.icon,intent:i.intent,disabled:a,onAction:()=>e.actionHandler(i),renderAsButton:i.showAsAction??!1,selected:i.selected,title:i.title,i18n:i.i18n,tone:i.tone})}return[...o,...s,...r]}let nq=!1,nX=Object.freeze({}),n0=Symbol("LOADING_PANE"),n1="documentPanelPortalElement",n2=["left","bottom"],n3={small:0,medium:1,large:2,full:"auto"};function n4(e){let t,n,i,l=(0,o.c)(16),{dialog:a,referenceElement:d}=e,{t:c}=(0,h.Bdt)(r.Z7),{cancelButtonIcon:u,cancelButtonText:p,confirmButtonIcon:m,confirmButtonText:f,message:x,onCancel:g,onConfirm:b,tone:y}=a;return l[0]!==p||l[1]!==c?(t=p||c("confirm-dialog.cancel-button.fallback-text"),l[0]=p,l[1]=c,l[2]=t):t=l[2],l[3]!==f||l[4]!==c?(n=f||c("confirm-dialog.confirm-button.fallback-text"),l[3]=f,l[4]=c,l[5]=n):n=l[5],l[6]!==u||l[7]!==m||l[8]!==x||l[9]!==g||l[10]!==b||l[11]!==d||l[12]!==t||l[13]!==n||l[14]!==y?(i=(0,s.jsx)(ed.e,{cancelButtonIcon:u,cancelButtonText:t,confirmButtonIcon:m,confirmButtonText:n,message:x,onCancel:g,onConfirm:b,open:!0,referenceElement:d,tone:y,placement:"top",fallbackPlacements:n2}),l[6]=u,l[7]=m,l[8]=x,l[9]=g,l[10]=b,l[11]=d,l[12]=t,l[13]=n,l[14]=y,l[15]=i):i=l[15],i}function n5(e){let t,n,i,r=(0,o.c)(12),{dialog:l}=e,u=(0,c.useId)();r[0]!==l.footer?(t=l.footer&&(0,s.jsx)(a.az,{paddingX:4,paddingY:3,children:l.footer}),r[0]=l.footer,r[1]=t):t=r[1];let p=t,m=!1===l.showCloseButton,f=void 0===l.width?1:n3[l.width];return r[2]!==l.content?(n=(0,s.jsx)(a.az,{padding:4,children:l.content}),r[2]=l.content,r[3]=n):n=r[3],r[4]!==l.header||r[5]!==l.onClose||r[6]!==u||r[7]!==p||r[8]!==m||r[9]!==f||r[10]!==n?(i=(0,s.jsx)(h.wG1,{zOffset:"fullscreen",children:(0,s.jsx)(d.lG,{animate:!0,__unstable_hideCloseButton:m,footer:p,header:l.header,id:u,onClose:l.onClose,onClickOutside:l.onClose,width:f,children:n})}),r[4]=l.header,r[5]=l.onClose,r[6]=u,r[7]=p,r[8]=m,r[9]=f,r[10]=n,r[11]=i):i=r[11],i}function n6(e){let t,n,i=(0,o.c)(5),{dialog:r,referenceElement:l}=e;return i[0]!==r?(t=(0,s.jsx)(n7,{dialog:r}),i[0]=r,i[1]=t):t=i[1],i[2]!==l||i[3]!==t?(n=(0,s.jsx)(a.AM,{content:t,fallbackPlacements:n2,open:!0,placement:"top",portal:!0,preventOverflow:!0,referenceElement:l}),i[2]=l,i[3]=t,i[4]=n):n=i[4],n}function n7(e){let t,n,i,r=(0,o.c)(6),{dialog:l}=e,{content:d,onClose:u}=l,{isTopLayer:p}=(0,a.Z4)(),m=(0,c.useRef)(null);return r[0]!==p||r[1]!==u?(t=e=>{"Escape"===e.key&&p&&u()},r[0]=p,r[1]=u,r[2]=t):t=r[2],(0,a.Pm)(t),r[3]===Symbol.for("react.memo_cache_sentinel")?(n=()=>[m.current],r[3]=n):n=r[3],(0,a.PR)(p&&u,n),r[4]!==d?(i=(0,s.jsx)("div",{ref:m,children:d}),r[4]=d,r[5]=i):i=r[5],i}function n8(e){let t,n=(0,o.c)(3),{children:i}=e,{element:r,elements:l}=(0,a.WP)(),d=l?.[n1]||r;return n[0]!==i||n[1]!==d?(t=(0,s.jsx)(a.GD,{element:d,children:i}),n[0]=i,n[1]=d,n[2]=t):t=n[2],t}function n9(e){let t,n,i=(0,o.c)(17),{dialog:r,referenceElement:d}=e,u=void 0===d?null:d,p=(0,c.useId)();if("confirm"===r.type){let e;return i[0]!==r||i[1]!==u?(e=(0,s.jsx)(n4,{dialog:r,referenceElement:u}),i[0]=r,i[1]=u,i[2]=e):e=i[2],e}if("popover"===r.type){let e;return i[3]!==r||i[4]!==u?(e=(0,s.jsx)(n6,{dialog:r,referenceElement:u}),i[3]=r,i[4]=u,i[5]=e):e=i[5],e}if("dialog"===r.type||!r.type){let e;return i[6]!==r?(e=(0,s.jsx)(n8,{children:(0,s.jsx)(n5,{dialog:r})}),i[6]=r,i[7]=e):e=i[7],e}if("custom"===r.type){let e,t=r?.component;return i[8]!==t?(e=(0,s.jsx)(n8,{children:t}),i[8]=t,i[9]=e):e=i[9],e}return console.warn(`Unsupported modal type ${r.type}`),i[10]!==r.content||i[11]!==r.type?(t=r.content||(0,s.jsxs)(a.EY,{size:1,children:["Unexpected modal type (",(0,s.jsx)("code",{children:r.type}),")"]}),i[10]=r.content,i[11]=r.type,i[12]=t):t=i[12],i[13]!==p||i[14]!==t||i[15]!==r.onClose?
328(n=(0,s.jsx)(l.lG,{id:p,onClose:r.onClose,onClickOutside:r.onClose,width:1,children:t}),i[13]=p,i[14]=t,i[15]=r.onClose,i[16]=n):n=i[16],n}let ie=(0,c.memo)(function(e){let t,n,i,r,l=(0,o.c)(9),{actionStates:a,children:d,referenceElement:u}=e,[p,m]=(0,c.useState)(-1),f=a[p];l[0]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{m(e)},l[0]=t):t=l[0];let x=t;l[1]!==d?(n=d({handleAction:x}),l[1]=d,l[2]=n):n=l[2];let g=n;return l[3]!==f||l[4]!==u?(i=f&&f.dialog&&(0,s.jsx)(h.wG1,{zOffset:"paneFooter",children:(0,s.jsx)(n9,{dialog:f.dialog,referenceElement:u})}),l[3]=f,l[4]=u,l[5]=i):i=l[5],l[6]!==g||l[7]!==i?(r=(0,s.jsxs)(s.Fragment,{children:[i,g]}),l[6]=g,l[7]=i,l[8]=r):r=l[8],r});function it(e){let t,n,i,d=(0,o.c)(10),{actionStates:u,disabled:p}=e,m=(0,c.useId)(),[f,x]=(0,c.useState)(null);d[0]===Symbol.for("react.memo_cache_sentinel")?(t={placement:"top-end",portal:!0,preventOverflow:!0},d[0]=t):t=d[0];let g=t,{t:b}=(0,h.Bdt)(r.Z7);d[1]!==u||d[2]!==p||d[3]!==m||d[4]!==b?(n=e=>{let{handleAction:t}=e;return(0,s.jsx)(l.IU,{id:`${m}-action-menu`,button:(0,s.jsx)(h.VJU,{"aria-label":b("buttons.action-menu-button.aria-label"),disabled:p,"data-testid":"action-menu-button",tooltipProps:{content:b("buttons.action-menu-button.tooltip")}}),menu:(0,s.jsx)(a.W1,{padding:1,children:u.map((e,n)=>(0,s.jsx)(ii,{actionState:e,disabled:p,index:n,onAction:t},n))}),popover:g,ref:x})},d[1]=u,d[2]=p,d[3]=m,d[4]=b,d[5]=n):n=d[5];let y=n;return d[6]!==u||d[7]!==f||d[8]!==y?(i=(0,s.jsx)(ie,{actionStates:u,referenceElement:f,children:y}),d[6]=u,d[7]=f,d[8]=y,d[9]=i):i=d[9],i}function ii(e){let t,n,i,r,a=(0,o.c)(18),{actionState:d,disabled:c,index:u,onAction:p}=e,{onHandle:m}=d;a[0]!==u||a[1]!==p||a[2]!==m?(t=()=>{p(u),m&&m()},a[0]=u,a[1]=p,a[2]=m,a[3]=t):t=a[3];let h=t;a[4]!==d.shortcut?(n=d.shortcut?String(d.shortcut).split("+").map(ir):void 0,a[4]=d.shortcut,a[5]=n):n=a[5];let f=n,x=`action-${d.label.replace(" ","")}`,g=c||!!d.disabled;return a[6]!==d.disabled||a[7]!==d.title?(i=d.disabled&&{tooltipProps:{content:d.title}},a[6]=d.disabled,a[7]=d.title,a[8]=i):i=a[8],a[9]!==d.icon||a[10]!==d.label||a[11]!==d.tone||a[12]!==h||a[13]!==f||a[14]!==x||a[15]!==g||a[16]!==i?(r=(0,s.jsx)(l.Dr,{"data-testid":x,disabled:g,hotkeys:f,icon:d.icon,onClick:h,text:d.label,tone:d.tone,...i}),a[9]=d.icon,a[10]=d.label,a[11]=d.tone,a[12]=h,a[13]=f,a[14]=x,a[15]=g,a[16]=i,a[17]=r):r=a[17],r}function ir(e){return e.slice(0,1).toUpperCase()+e.slice(1)}let il={NOTHING_TO_DELETE:"action.delete.disabled.nothing-to-delete",NOT_READY:"action.delete.disabled.not-ready"},is=e=>{let t,n,i,l,a,d=(0,o.c)(36),{id:u,type:m,draft:f,onComplete:x,release:g}=e,{setIsDeleting:b}=tD(),{delete:y}=(0,h.QSs)(u,m,g),[j,v]=(0,c.useState)(!1),[_,w]=(0,c.useState)(!1),{t:S}=(0,h.Bdt)(r.Z7);d[0]!==x?(t=()=>{w(!1),x()},d[0]=x,d[1]=t):t=d[1];let k=t;d[2]!==y||d[3]!==x||d[4]!==b?(n=()=>{v(!0),w(!1),b(!0),y.execute(),x()},d[2]=y,d[3]=x,d[4]=b,d[5]=n):n=d[5];let C=n;d[6]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{w(!0)},d[6]=i):i=d[6];let I=i;d[7]!==u||d[8]!==g||d[9]!==m?(l={id:u,type:m,version:g,permission:"delete"},d[7]=u,d[8]=g,d[9]=m,d[10]=l):l=d[10];let[E,z]=(0,h.LyQ)(l),T=(0,h.iZK)();e:{let e,t,n,i;if(!z&&!E?.granted){let e,t,n;d[11]!==S?(e=S("action.delete.label"),d[11]=S,d[12]=e):e=d[12],d[13]!==T?(t=(0,s.jsx)(h.TLO,{context:"delete-document",currentUser:T}),d[13]=T,d[14]=t):t=d[14],d[15]!==e||d[16]!==t?(n={tone:"critical",icon:p.ucK,disabled:!0,label:e,title:t},d[15]=e,d[16]=t,d[17]=n):n=d[17],a=n;break e}let r=j||!!y.disabled||z;d[18]!==y.disabled||d[19]!==S?(e=y.disabled&&S(il[y.disabled])||"",d[18]=y.disabled,d[19]=S,d[20]=e):e=d[20],d[21]!==j||d[22]!==S?(t=S(j?"action.delete.running.label":"action.delete.label"),d[21]=j,d[22]=S,d[23]=t):t=d[23],d[24]!==f?._id||d[25]!==k||d[26]!==C||d[27]!==u||d[28]!==_||d[29]!==m?(n=_&&{type:"custom",component:(0,s.jsx)(lA,{action:"delete",id:f?._id||u,type:m,onCancel:k,onConfirm:C})},d[24]=f?._id,d[25]=k,d[26]=C,d[27]=u,d[28]=_,d[29]=m,d[30]=n):n=d[30],d[31]!==r||d[32]!==e||d[33]!==t||d[34]!==n?(i={tone:"critical",icon:p.ucK,disabled:r,title:e,label:t,shortcut:"Ctrl+Alt+D",onHandle:I,dialog:n},d[31]=r,d[32]=e,d[33]=t,d[34]=n,d[35]=i):i=d[35],a=i}return a};is.action="delete",is.displayName="DeleteAction";let io={NO_CHANGES:"action.discard-changes.disabled.no-change",NOT_PUBLISHED:"action.discard-changes.disabled.not-published",NOT_READY:"action.discard-changes.disabled.not-ready"},ia=({id:e,type:t,published:n,liveEdit:i,onComplete:l,release:o})=>{let{discardChanges:a}=(0,h.QSs)(e,t,o),[d,u]=(0,c.useState)(!1),[f,x]=(0,h.LyQ)({id:e,type:t,version:o,permission:"discardDraft"}),g=(0,h.iZK)(),{displayed:b}=tD(),{t:y}=(0,h.Bdt)(r.Z7),j=b?._id&&(0,m._4)(b?._id),v=(0,c.useCallback)(()=>{a.execute(),l()},[a,l]),_=(0,c.useCallback)(()=>{u(!0)},[]),w=(0,c.useMemo)(()=>d&&{type:"confirm",tone:"critical",onCancel:l,onConfirm:v,message:y("action.discard-changes.confirm-dialog.confirm-discard-changes")}
328,[v,d,l,y]);return(0,c.useMemo)(()=>!n||i||j?null:x||f?.granted?{tone:"critical",icon:p.NAP,disabled:!!a.disabled||x,title:y(a.disabled&&io[a.disabled]||""),label:y("action.discard-changes.label"),onHandle:_,dialog:w}:{tone:"critical",icon:p.NAP,disabled:!0,label:y("action.discard-changes.label"),title:(0,s.jsx)(h.TLO,{context:"discard-changes",currentUser:g})},[g,w,a.disabled,_,x,j,i,f?.granted,n,y])};ia.action="discardChanges",ia.displayName="DiscardChangesAction";let id={NOTHING_TO_DUPLICATE:"action.duplicate.disabled.nothing-to-duplicate",NOT_READY:"action.duplicate.disabled.not-ready"},ic=({id:e,type:t,onComplete:n,release:i,mapDocument:l})=>{let o=(0,h.q3J)(),{duplicate:a}=(0,h.QSs)(e,t,i),{navigateIntent:d}=(0,_.rd)(),[u,m]=(0,c.useState)(!1),[f,g]=(0,h.LyQ)({id:e,type:t,version:i,permission:"duplicate"}),{t:b}=(0,h.Bdt)(r.Z7),y=(0,h.iZK)(),j=(0,c.useCallback)(async()=>{let i=(0,x.A)();m(!0);let r=(0,W._)(o.pair.operationEvents(e,t).pipe((0,Y.p)(e=>"duplicate"===e.op&&"success"===e.type)));a.execute(i,{mapDocument:l}),await r,d("edit",{id:i,type:t}),n()},[o.pair,a,e,l,d,n,t]);return(0,c.useMemo)(()=>g||f?.granted?{icon:p.TdU,disabled:u||!!a.disabled||g,label:b(u?"action.duplicate.running.label":"action.duplicate.label"),title:a.disabled?b(id[a.disabled]):"",onHandle:j}:{icon:p.TdU,disabled:!0,label:b("action.duplicate.label"),title:(0,s.jsx)(h.TLO,{context:"duplicate-document",currentUser:y})},[y,a.disabled,j,u,g,f?.granted,b])};ic.action="duplicate",ic.displayName="DuplicateAction";let iu=e=>{let t,n,i,l,s,a,d=(0,o.c)(27),{id:u,type:m,revision:f,onComplete:x,release:g}=e,{restore:b}=(0,h.QSs)(u,m,g),{revisionNotFound:y}=tD(),j=(0,h.cUp)(u,m),{navigateIntent:v}=(0,_.rd)(),w=(0,c.useRef)(j),[S,k]=(0,c.useState)(!1),{t:C}=(0,h.Bdt)(r.Z7);d[0]!==x||d[1]!==b||d[2]!==f?(t=()=>{b.execute(f),x()},d[0]=x,d[1]=b,d[2]=f,d[3]=t):t=d[3];let I=t;d[4]!==j||d[5]!==u||d[6]!==v||d[7]!==m?(n=()=>{j&&j!==w.current&&("success"===j.type&&"restore"===j.op&&v("edit",{id:u,type:m}),w.current=j)},i=[j,u,v,m],d[4]=j,d[5]=u,d[6]=v,d[7]=m,d[8]=n,d[9]=i):(n=d[8],i=d[9]),(0,c.useEffect)(n,i),d[10]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{k(!0)},d[10]=l):l=d[10];let E=l;e:{if(S){let e,t;d[11]!==C?(e=C("action.restore.confirm.message"),d[11]=C,d[12]=e):e=d[12],d[13]!==I||d[14]!==x||d[15]!==e?(t={type:"confirm",tone:"critical",onCancel:x,onConfirm:I,message:e},d[13]=I,d[14]=x,d[15]=e,d[16]=t):t=d[16],s=t;break e}s=null}let z=s,T="@initial"===f,A=void 0===f;t:{let e,t,n;if(A||y){a=null;break t}d[17]!==C?(e=C("action.restore.label"),d[17]=C,d[18]=e):e=d[18];let i=T?"action.restore.disabled.cannot-restore-initial":"action.restore.tooltip";d[19]!==C||d[20]!==i?(t=C(i),d[19]=C,d[20]=i,d[21]=t):t=d[21],d[22]!==z||d[23]!==T||d[24]!==e||d[25]!==t?(n={label:e,tone:"caution",onHandle:E,title:t,icon:p.AAk,dialog:z,disabled:T},d[22]=z,d[23]=T,d[24]=e,d[25]=t,d[26]=n):n=d[26],a=n}return a};iu.action="restore",iu.displayName="HistoryRestoreAction";let ip=(0,em.g_)({name:"Document Published",version:1,description:'User clicked the "Publish" button in the document pane'}),im={LIVE_EDIT_ENABLED:"action.publish.live-edit.publish-disabled",ALREADY_PUBLISHED:"action.publish.already-published.no-time-ago.tooltip",NO_CHANGES:"action.publish.no-changes.tooltip",NOT_READY:"action.publish.disabled.not-ready"},ih={status:"published"};function ix(e,t,n){return"ALREADY_PUBLISHED"===e&&t?(0,s.jsx)(ig,{publishedAt:t}):n(im[e])}function ig(e){let t,n,i,l=(0,o.c)(6),{publishedAt:a}=e,{t:d}=(0,h.Bdt)(r.Z7);l[0]===Symbol.for("react.memo_cache_sentinel")?(t={useTemporalPhrase:!0},l[0]=t):t=l[0];let c=(0,h.Vq9)(a,t);return l[1]!==d||l[2]!==c?(n=d("action.publish.already-published.tooltip",{timeSincePublished:c}),l[1]=d,l[2]=c,l[3]=n):n=l[3],l[4]!==n?(i=(0,s.jsx)("span",{children:n}),l[4]=n,l[5]=i):i=l[5],i}let ib=e=>{let t,n,i,l,a,d,u,x,g,b,y,j=(0,o.c)(79),{id:v,type:_,liveEdit:w,draft:S,published:k,release:C}=e,[I,E]=(0,c.useState)(null),{publish:z}=(0,h.QSs)(v,_),T=(0,h.dWw)(v,_),A=(0,h.M7h)(v,_),{changesOpen:P,documentId:R,documentType:M,value:D}=tD(),$=(0,h.zX2)(R,M),{t:B}=(0,h.Bdt)(r.Z7);j[0]!==$?.draft||j[1]!==$?.published?(t=$?.draft||$?.published||{},j[0]=$?.draft,j[1]=$?.published,j[2]=t):t=j[2];let Y=t._rev;j[3]!==T.validation?(n=T.validation.some(f.Uw),j[3]=T.validation,j[4]=n):n=j[4];let L=n,[O,H]=(0,c.useState)(!1),V=A.isSyncing,N=T.isValidating;j[5]!==v||j[6]!==_?(i={id:v,type:_,permission:"publish"},j[5]=v,j[6]=_,j[7]=i):i=j[7];let[Z,F]=(0,h.LyQ)(i),K=(0,h.iZK)();j[8]!==L||j[9]!==z.disabled||j[10]!==k||j[11]!==B?(l=z.disabled?
328ix(z.disabled,(k||{})._updatedAt,B)||"":L?B("action.publish.validation-issues.tooltip"):"",j[8]=L,j[9]=z.disabled,j[10]=k,j[11]=B,j[12]=l):l=j[12];let W=l,J=k?._rev;j[13]!==J||j[14]!==z?(a=()=>{z.execute(),E({status:"publishing",publishRevision:J})},j[13]=J,j[14]=z,j[15]=a):a=j[15];let U=a;j[16]!==U||j[17]!==L||j[18]!==V||j[19]!==O||j[20]!==Y||j[21]!==T.isValidating||j[22]!==T.revision?(d=()=>{let e=!1===T.isValidating&&T.revision!==Y;O&&!V&&e&&(L||U(),H(!1))},j[16]=U,j[17]=L,j[18]=V,j[19]=O,j[20]=Y,j[21]=T.isValidating,j[22]=T.revision,j[23]=d):d=j[23],j[24]!==U||j[25]!==L||j[26]!==V||j[27]!==N||j[28]!==O||j[29]!==Y||j[30]!==T.isValidating||j[31]!==T.revision?(u=[V,U,L,O,T.revision,Y,N,T.isValidating],j[24]=U,j[25]=L,j[26]=V,j[27]=N,j[28]=O,j[29]=Y,j[30]=T.isValidating,j[31]=T.revision,j[32]=u):u=j[32],(0,c.useEffect)(d,u),j[33]!==J||j[34]!==I?(x=()=>{let e=I?.status==="publishing"&&J!==I.publishRevision,t=e?ih:null,n=setTimeout(()=>{E(t)},e?200:4e3);return()=>clearTimeout(n)},j[33]=J,j[34]=I,j[35]=x):x=j[35],j[36]!==P||j[37]!==J||j[38]!==I?(g=[P,I,J],j[36]=P,j[37]=J,j[38]=I,j[39]=g):g=j[39],(0,c.useEffect)(x,g);let G=(0,ec.Jr)();j[40]!==U||j[41]!==S?._createdAt||j[42]!==k||j[43]!==Y||j[44]!==A.isSyncing||j[45]!==G||j[46]!==T.isValidating||j[47]!==T.revision?(b=()=>{G.log(ip,{publishedImmediately:!S?._createdAt,previouslyPublished:!!k}),A.isSyncing||T.isValidating||T.revision!==Y?H(!0):U()},j[40]=U,j[41]=S?._createdAt,j[42]=k,j[43]=Y,j[44]=A.isSyncing,j[45]=G,j[46]=T.isValidating,j[47]=T.revision,j[48]=b):b=j[48];let Q=b;e:{let e,t,n;if(C||w){y=null;break e}if((0,m._4)(D._id)&&null!==S){let e,t,n;j[49]!==B?(e=B("action.publish.label"),j[49]=B,j[50]=e):e=j[50];let i=k?._updatedAt;j[51]!==B||j[52]!==i?(t=ix("ALREADY_PUBLISHED",i,B),j[51]=B,j[52]=i,j[53]=t):t=j[53],j[54]!==e||j[55]!==t?(n={tone:"default",icon:p.VQ$,label:e,title:t,disabled:!0},j[54]=e,j[55]=t,j[56]=n):n=j[56],y=n;break e}if(!F&&!Z?.granted){let e,t,n;j[57]!==B?(e=B("action.publish.label"),j[57]=B,j[58]=e):e=j[58],j[59]!==K?(t=(0,s.jsx)(h.TLO,{context:"publish-document",currentUser:K}),j[59]=K,j[60]=t):t=j[60],j[61]!==e||j[62]!==t?(n={tone:"default",icon:p.VQ$,label:e,title:t,disabled:!0},j[61]=e,j[62]=t,j[63]=n):n=j[63],y=n;break e}let i=!!(O||$?.transactionSyncLock?.enabled||I?.status==="publishing"||I?.status==="published"||L||z.disabled),r=i||F;j[64]!==O||j[65]!==I?.status||j[66]!==B?(e=B(I?.status==="published"?"action.publish.published.label":O||I?.status==="publishing"?"action.publish.running.label":"action.publish.draft.label"),j[64]=O,j[65]=I?.status,j[66]=B,j[67]=e):e=j[67],j[68]!==O||j[69]!==I?.status||j[70]!==B||j[71]!==W?(t=O?B("action.publish.waiting"):I?.status==="published"||I?.status==="publishing"?null:W,j[68]=O,j[69]=I?.status,j[70]=B,j[71]=W,j[72]=t):t=j[72];let l=i||O?null:"Ctrl+Alt+P";j[73]!==Q||j[74]!==r||j[75]!==e||j[76]!==t||j[77]!==l?(n={disabled:r,tone:"default",label:e,icon:p.VQ$,title:t,shortcut:l,onHandle:Q},j[73]=Q,j[74]=r,j[75]=e,j[76]=t,j[77]=l,j[78]=n):n=j[78],y=n}return y};ib.action="publish",ib.displayName="PublishAction";let iy={NOT_PUBLISHED:"action.unpublish.disabled.not-published",NOT_READY:"action.unpublish.disabled.not-ready",LIVE_EDIT_ENABLED:"action.unpublish.disabled.live-edit-enabled"},ij=({id:e,type:t,draft:n,onComplete:i,liveEdit:l,release:o})=>{let{unpublish:a}=(0,h.QSs)(e,t),[d,u]=(0,c.useState)(!1),[m,f]=(0,h.LyQ)({id:e,type:t,permission:"unpublish"}),x=(0,h.iZK)(),{t:g}=(0,h.Bdt)(r.Z7),{selectedPerspective:b}=(0,h.QO2)(),y="drafts"===b,j=(0,c.useCallback)(()=>{u(!1),i()},[i]),v=(0,c.useCallback)(()=>{u(!1),a.execute(),i()},[i,a]),_=(0,c.useMemo)(()=>d?{type:"dialog",onClose:i,content:(0,s.jsx)(lA,{id:n?._id||e,type:t,action:"unpublish",onCancel:j,onConfirm:v})}:null,[n,e,j,v,d,i,t]);return(0,c.useMemo)(()=>o||y||l?null:f||m?.granted?{tone:"critical",icon:p.wvk,disabled:!!a.disabled||f,label:g("action.unpublish.label"),title:a.disabled?g(iy[a.disabled]):"",onHandle:()=>u(!0),dialog:_}:{tone:"critical",icon:p.wvk,label:"Unpublish",title:(0,s.jsx)(h.TLO,{context:"unpublish-document",currentUser:x}),disabled:!0},[o,y,l,f,m?.granted,a.disabled,g,_,x])};ij.action="unpublish",ij.displayName="UnpublishAction";let iv=(0,c.memo)(function(e){let t,n,i,r,d,u,p,m,f,x=(0,o.c)(37),{disabled:g,states:b}=e,{__internal_tasks:y}=(0,h.For)(),{editState:j}=tD(),{params:v}=ny(),_=!!v?.rev,{selectedReleaseId:w}=(0,h.QO2)();x[0]!==b?([t,...n]=b,x[0]=b,x[1]=t,x[2]=n):(t=x[1],n=x[2]);let[S,k]=(0,c.useState)(null);e:{let e,n,r,o;
328if(!t||!t.title&&!t.shortcut){i=null;break e}x[3]===Symbol.for("react.memo_cache_sentinel")?(e={maxWidth:300},x[3]=e):e=x[3],x[4]!==t.title?(n=t.title&&(0,s.jsx)(a.EY,{size:1,children:t.title}),x[4]=t.title,x[5]=n):n=x[5],x[6]!==t.shortcut?(r=t.shortcut&&(0,s.jsx)(l.qW,{"data-testid":"document-status-bar-hotkeys",fontSize:1,style:{marginTop:-4,marginBottom:-4},keys:String(t.shortcut).split("+").map(ik)}),x[6]=t.shortcut,x[7]=r):r=x[7],x[8]!==n||x[9]!==r?(o=(0,s.jsxs)(a.so,{style:e,align:"center",gap:3,children:[n,r]}),x[8]=n,x[9]=r,x[10]=o):o=x[10],i=o}let C=i;x[11]!==j?.liveEdit||x[12]!==t||x[13]!==w||x[14]!==_?(r=_?!!t:w?t&&!(0,h.UYh)(t):t&&!j?.liveEdit,x[11]=j?.liveEdit,x[12]=t,x[13]=w,x[14]=_,x[15]=r):r=x[15];let I=r;x[16]!==t||x[17]!==n||x[18]!==I?(d=I?n:[t,...n],x[16]=t,x[17]=n,x[18]=I,x[19]=d):d=x[19];let E=d,z=y&&y.footerAction;return x[20]!==g||x[21]!==t||x[22]!==I||x[23]!==C?(u=I&&(0,s.jsx)(a.XS,{zOffset:200,children:(0,s.jsx)(l.m_,{disabled:!C,content:C,placement:"top",children:(0,s.jsx)(a.BJ,{children:(0,s.jsx)(l.$n,{"data-testid":`action-${ti(t.label)}`,disabled:g||!!t.disabled,icon:t.icon,onClick:t.onHandle,ref:k,text:t.label,tone:t.tone||"primary"})})})}),x[20]=g,x[21]=t,x[22]=I,x[23]=C,x[24]=u):u=x[24],x[25]!==g||x[26]!==E?(p=E.length>0&&(0,s.jsx)(it,{actionStates:E,disabled:g}),x[25]=g,x[26]=E,x[27]=p):p=x[27],x[28]!==S||x[29]!==t||x[30]!==I?(m=I&&t&&t.dialog&&(0,s.jsx)(n9,{dialog:t.dialog,referenceElement:S}),x[28]=S,x[29]=t,x[30]=I,x[31]=m):m=x[31],x[32]!==z||x[33]!==u||x[34]!==p||x[35]!==m?(f=(0,s.jsxs)(a.so,{align:"center",gap:1,children:[z,u,p,m]}),x[32]=z,x[33]=u,x[34]=p,x[35]=m,x[36]=f):f=x[36],f}),i_=(0,c.memo)(function(){let e,t,n,i,r,l=(0,o.c)(14),{actions:a,connectionState:d,documentId:c,editState:u,isInitialValueLoading:p}=tD();l[0]!==a?(e=a??[],l[0]=a,l[1]=e):e=l[1],l[2]!==e?(t=e.filter(iC),l[2]=e,l[3]=t):t=l[3];let m=t;l[4]!==u||l[5]!==p?(n=u?{...u,initialValueResolved:!p}:null,l[4]=u,l[5]=p,l[6]=n):n=l[6];let h=n;l[7]!==d||l[8]!==c?(i=e=>{let{states:t}=e;return(0,s.jsx)(iv,{disabled:"connected"!==d,states:t},c)},l[7]=d,l[8]=c,l[9]=i):i=l[9];let f=i;return 0!==m.length&&h?(l[10]!==h||l[11]!==m||l[12]!==f?(r=(0,s.jsx)(lK,{actions:m,actionProps:h,group:"default",children:f}),l[10]=h,l[11]=m,l[12]=f,l[13]=r):r=l[13],r):null}),iw=(0,c.memo)(function(){let e,t,n,i,r=(0,o.c)(13),{actions:l,connectionState:a,editState:d,revisionId:c,isInitialValueLoading:u}=tD(),p=(d?.draft||d?.published||{})._rev===c;r[0]!==d||r[1]!==u||r[2]!==c?(e=d?{...d,revision:c||void 0,initialValueResolved:!u}:null,r[0]=d,r[1]=u,r[2]=c,r[3]=e):e=r[3];let m=e;r[4]!==l?(t=(l??[]).filter(iS).slice(-1),r[4]=l,r[5]=t):t=r[5];let h=t;r[6]!==a||r[7]!==p?(n=e=>{let{states:t}=e;return(0,s.jsx)(iv,{disabled:"connected"!==a||!!p,states:t})},r[6]=a,r[7]=p,r[8]=n):n=r[8];let f=n;return m?(r[9]!==m||r[10]!==h||r[11]!==f?(i=(0,s.jsx)(lK,{actions:h,actionProps:m,group:"default",children:f}),r[9]=m,r[10]=h,r[11]=f,r[12]=i):i=r[12],i):null});function iS(e){return e.action===iu.action}function ik(e){return e.slice(0,1).toUpperCase()+e.slice(1).toLowerCase()}function iC(e){return!iS(e)}let iI=e=>{let t=(0,o.c)(16),{release:n}=e,{t:i}=(0,h.Bdt)();if("archived"===n.state){let e,n;return t[0]!==i?(e=i("release.chip.tooltip.archived"),t[0]=i,t[1]=e):e=t[1],t[2]!==e?(n=(0,s.jsx)(a.EY,{size:1,children:e}),t[2]=e,t[3]=n):n=t[3],n}if("asap"===n.metadata.releaseType){let e,n;return t[4]!==i?(e=i("release.type.asap"),t[4]=i,t[5]=e):e=t[5],t[6]!==e?(n=(0,s.jsx)(a.EY,{size:1,children:e}),t[6]=e,t[7]=n):n=t[7],n}if("scheduled"===n.metadata.releaseType){let e,r="active"===n.state;return t[8]!==r||t[9]!==n||t[10]!==i?(e=n.metadata.intendedPublishAt&&(0,s.jsx)(a.EY,{size:1,children:r?(0,s.jsx)(h.HTc,{t:i,i18nKey:"release.chip.tooltip.intended-for-date",values:{date:(0,h.drb)(n)}}):(0,s.jsx)(h.HTc,{t:i,i18nKey:"release.chip.tooltip.scheduled-for-date",values:{date:(0,h.drb)(n)}})}),t[8]=r,t[9]=n,t[10]=i,t[11]=e):e=t[11],e}if("undecided"===n.metadata.releaseType){let e,n;return t[12]!==i?(e=i("release.type.undecided"),t[12]=i,t[13]=e):e=t[13],t[14]!==e?(n=(0,s.jsx)(a.EY,{size:1,children:e}),t[14]=e,t[15]=n):n=t[15],n}return null},iE={dateStyle:"medium",timeStyle:"short"}
328,iz=(0,c.memo)(function(){let{selectedReleaseId:e,selectedPerspectiveName:t}=(0,h.QO2)(),{t:n}=(0,h.Bdt)(),i=(0,h._T7)(),{params:r,setParams:l}=ny(),o=(0,h.ixk)(iE),{loading:d}=(0,h.K0D)(),u=(0,h.I07)(),{editState:p,displayed:f,documentType:x,documentId:g}=tD(),b=f&&!f._createdAt,y=(0,h.Rcw)(),j=(0,h.LJ4)({historyVersion:r?.historyVersion,displayed:f,documentId:g}),v=(0,h.Jr6)({documentId:g}),_=(0,h.hA9)(),{onSetScheduledDraftPerspective:w}=(0,h.B3H)(),S=(0,c.useCallback)(e=>()=>{if((0,h.Jrl)(e)&&(0,h._9c)(e))return void w((0,h._hI)(e._id));"published"===e&&r?.historyVersion&&l({...r,rev:r?.historyEvent||void 0,since:void 0,historyVersion:void 0});let t=(0,h.Jrl)(e)?(0,h._hI)(e._id):e===y?"":e;r?.scheduledDraft?l({...r,scheduledDraft:void 0},{perspective:t}):i(t)},[i,l,r,y,w]),k=u.get(x),C=!!k&&!0===k.liveEdit,I=(0,c.useMemo)(()=>(!C||!!e)&&!p?.published,[C,e,p?.published]),E=(0,c.useCallback)(e=>{if(!r?.historyVersion){let t=p?.version&&(0,h.YW1)(p?.version)&&(0,h._hI)(e._id)===(0,m._S)(p?.version?._id);return{selected:!!((0,h._hI)(e._id)===(0,m._S)(f?._id||"")||t)}}let t=(0,h._hI)(e._id)===r.historyVersion;return{selected:t,disabled:t}},[f?._id,p?.version,r?.historyVersion]),z=(0,c.useMemo)(()=>!!(C&&!p?.draft?._id&&!e||(0,m._4)(f?._id||"")&&(0,h.xo4)(t||"")),[f?._id,p?.draft?._id,C,t,e]),T=(0,c.useMemo)(()=>{let e=f?._id||"";return!(z||r?.historyVersion||t||(0,m.A_)(e))&&(!!(0,m.R8)(e)||!((0,m._4)(e)&&p?.published&&(0,h.xo4)(t||"")))},[f?._id,p?.published,z,r?.historyVersion,t]),A=(0,c.useMemo)(()=>!!v||!!b&&!!e||(!!p?.draft||!!C)&&!!(b&&e||C),[p?.draft,b,C,v,e]),P=_.document.drafts?.enabled;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h.FCT,{tooltipContent:(0,s.jsx)(a.EY,{size:1,children:p?.published&&p?.published?._updatedAt?(0,s.jsx)(h.HTc,{t:n,i18nKey:"release.chip.tooltip.published-date",values:{date:o.format(new Date(p?.published._updatedAt))}}):(0,s.jsx)(s.Fragment,{children:n("release.chip.tooltip.not-published")})}),disabled:I,onClick:S("published"),selected:z,text:n("release.chip.published"),tone:"positive",contextValues:{documentId:p?.published?._id||p?.id||"",menuReleaseId:p?.published?._id||p?.id||"",releases:j.notCurrentReleases,releasesLoading:d,documentType:x,fromRelease:"published",isVersion:!1,disabled:!p?.published}}),P&&(0,s.jsx)(h.FCT,{tooltipContent:(0,s.jsx)(a.EY,{size:1,children:p?.draft?(0,s.jsx)(s.Fragment,{children:p?.draft._updatedAt?(0,s.jsx)(h.HTc,{t:n,i18nKey:"release.chip.tooltip.edited-date",values:{date:o.format(new Date(p?.draft._updatedAt))}}):(0,s.jsx)(h.HTc,{t:n,i18nKey:"release.chip.tooltip.created-date",values:{date:o.format(new Date(p?.draft._createdAt))}})}):(0,s.jsx)(s.Fragment,{children:n(C?"release.chip.tooltip.draft-disabled.live-edit":"release.chip.tooltip.no-edits")})}),selected:T,disabled:A,text:n("release.chip.draft"),tone:p?.draft?"caution":"neutral",onClick:S("drafts"),contextValues:{documentId:p?.draft?._id||p?.published?._id||p?.id||"",menuReleaseId:p?.draft?._id||p?.published?._id||p?.id||"",releases:j.notCurrentReleases,releasesLoading:d,documentType:x,fromRelease:"draft",isVersion:!1}}),j.inCreation&&(0,s.jsx)(h.FCT,{tooltipContent:(0,s.jsx)(iI,{release:j.inCreation}),selected:!0,onClick:()=>{},locked:!1,tone:(0,h.Y73)(j.inCreation),text:j.inCreation.metadata.title||n("release.placeholder-untitled-release"),contextValues:{disabled:!0,documentId:f?._id||"",menuReleaseId:j.inCreation._id,releases:j.notCurrentReleases,releasesLoading:d,documentType:x,fromRelease:(0,h._hI)(j.inCreation._id),releaseState:j.inCreation.state,isVersion:!0,release:j.inCreation}}),f&&j.currentReleases?.map(e=>(0,s.jsx)(h.FCT,{tooltipContent:(0,s.jsx)(iI,{release:e}),...E(e),onClick:S(e),text:e.metadata.title||n("release.placeholder-untitled-release"),tone:(0,h.Y73)(e),locked:(0,h.KJ$)(e),contextValues:{documentId:f?._id||"",menuReleaseId:e._id,releases:j.notCurrentReleases,releasesLoading:d,documentType:x,fromRelease:(0,h._hI)(e._id),releaseState:e.state,isVersion:!0,isGoingToUnpublish:!!p?.version&&(0,h.YW1)(p?.version),release:e}},e._id))]})}),iT=(0,g.I4)(a.Zp)(e=>{let t=(0,ek.JW)(e.theme);return(0,g.AH)`
329    scrollbar-width: none;
330    z-index: 1;
331    flex: 1;
332    position: relative;
333    > div {
334      &::-webkit-scrollbar {
335        width: 0;
336        height: 0;
337      }
338    }
339
340    ${e.$showGradient&&(0,g.AH)`
341      &::after {
342        content: '';
343        display: block;
344        position: absolute;
345        top: 0;
346        right: 0;
347        bottom: 0;
348        width: 150px;
349        background: linear-gradient(to right, ${(0,ek.B3)(t.color.bg,0)}, var(--card-bg-color));
350        transition: 'opacity 300ms ease-out';
351        pointer-events: none;
352      }
353    `}
354  `}),iA=(0,c.memo)((0,c.forwardRef)(function(e,t){let{menuItems:n}=e,{actions:i,editState:d,onMenuAction:u,isInitialValueLoading:m,onPaneClose:f,onPaneSplit:x,menuItemGroups:g,schemaType:b,connectionState:y,views:j,unstable_languageFilter:v}=tD(),{features:_}=tY(),{index:w,BackLink:S,hasGroupSiblings:k}=ny(),{actions:C}=(0,h.vM8)(),[I,E]=(0,c.useState)(null),z=(0,c.useRef)(null),T=function(e){let t,n,i=(0,o.c)(3),[r,l]=(0,c.useState)(!1);return i[0]!==e?(t=()=>{let t=()=>{let t=e.current;if(!t)return;let{scrollWidth:n,clientWidth:i}=t;if(!(n>i))return void l(!1);let{scrollLeft:r}=t;l(!(r+i>=n))},{intersectionObserver:n,mutationObserver:i}=function(){t();let n=e.current;if(!n)return{intersectionObserver:null,mutationObserver:null};let i=new IntersectionObserver(e=>{let t=e[0];t&&l(!t.isIntersecting)}),r=()=>{i.disconnect();let e=n.children[n.children.length-1];i.observe(e)};r();let s=new MutationObserver(()=>{r(),t()});return s.observe(n,{childList:!0,subtree:!1}),{intersectionObserver:i,mutationObserver:s}}();return()=>{n?.disconnect(),i?.disconnect()}},n=[e],i[0]=e,i[1]=t,i[2]=n):(t=i[1],n=i[2]),(0,c.useEffect)(t,n),r}(z),A=(0,c.useMemo)(()=>(i??[]).filter(e=>!iS(e)),[i]),P=(0,c.useMemo)(()=>nQ({actionHandler:u,fieldActions:C,menuItems:n,menuItemGroups:g}),[u,C,g,n]),R=(0,c.useMemo)(()=>P.filter(nU),[P]),M=(0,c.useMemo)(()=>P.filter(nG),[P]),{collapsed:D,isLast:$}=tt(),B=_.splitViews&&x&&j.length>1,Y=B&&k,L=_.backButton&&w>0,O=!Y&&!L&&!!S,{t:H}=(0,h.Bdt)(r.Z7),V=(0,c.useCallback)(({states:e})=>(0,s.jsx)(iP,{contextMenuNodes:M,setReferenceElement:E,referenceElement:I,states:e}),[M,I]),N=(0,c.useMemo)(()=>(0,s.jsx)(nN,{}),[]),Z=(0,c.useMemo)(()=>L&&(0,s.jsx)(l.$n,{as:S,"data-as":"a",icon:p.A60,mode:"bleed",tooltipProps:{content:H("pane-header.back-button.text")}}),[S,L,H]),F=(0,c.useMemo)(()=>(0,s.jsxs)(a.so,{align:"center",gap:1,children:[v.length>0&&(0,s.jsx)(s.Fragment,{children:v.map((e,t)=>(0,s.jsx)(e,{schemaType:b},`language-filter-${t}`))}),R.map(e=>(0,s.jsx)(t_,{node:e},e.key)),d&&(0,s.jsx)(lK,{actions:A,actionProps:{...d,initialValueResolved:!m},group:"paneActions",children:V}),B&&(0,s.jsx)(l.$n,{"aria-label":H("buttons.split-pane-button.aria-label"),icon:p.CwM,mode:"bleed",onClick:x,tooltipProps:{content:H("buttons.split-pane-button.tooltip")}},"split-pane-button"),Y&&(0,s.jsx)(l.$n,{icon:p.USm,mode:"bleed",onClick:f,tooltipProps:{content:H("buttons.split-pane-close-button.title")}},"close-view-button"),O&&(0,s.jsx)(l.$n,{icon:p.USm,mode:"bleed",tooltipProps:{content:H("buttons.split-pane-close-group-button.title")},as:S},"close-view-button")]}),[S,A,d,m,R,f,x,V,b,O,B,Y,H,v]);return(0,s.jsx)(l.vE,{children:D?(0,s.jsx)(tj,{border:!0,ref:t,loading:"connecting"===y&&!d?.draft&&!d?.published,title:N,tabIndex:$&&!D?-1:0,backButton:Z}):(0,s.jsx)(a.Zp,{hidden:D,style:{lineHeight:0},borderBottom:!0,children:(0,s.jsxs)(a.so,{gap:3,paddingY:3,children:[(0,s.jsx)(iT,{$showGradient:T,children:(0,s.jsx)(a.so,{flex:1,gap:1,overflow:"auto",paddingX:3,"data-testid":"document-perspective-list",ref:z,children:(0,s.jsx)(iz,{})})}),(0,s.jsx)(a.az,{flex:"none",paddingRight:3,children:F})]})})})})),iP=(0,c.memo)(function(e){let t,n=(0,o.c)(5),{setReferenceElement:i,referenceElement:r,contextMenuNodes:l}=e,a=(0,c.useDeferredValue)(e.states);return n[0]!==l||n[1]!==r||n[2]!==i||n[3]!==a?(t=(0,s.jsx)(iR,{setReferenceElement:i,referenceElement:r,contextMenuNodes:l,states:a}),n[0]=l,n[1]=r,n[2]=i,n[3]=a,n[4]=t):t=n[4],t}),iR=(0,c.memo)(function(e){let t,n,i=(0,o.c)(8),{states:r,setReferenceElement:l,contextMenuNodes:a,referenceElement:d}=e;i[0]!==a||i[1]!==l||i[2]!==r?(t=e=>{let{handleAction:t}=e;return(0,s.jsx)("div",{ref:l,children:(0,s.jsx)(tu,{nodes:a,actionsNodes:r.length>0?r.map((e,n)=>(0,s.jsx)(ii,{actionState:e,disabled:!!e.disabled,index:n,onAction:t},e.label)):void 0},"context-menu")})},i[0]=a,i[1]=l,i[2]=r,i[3]=t):t=i[3];let c=t;return i[4]!==d||i[5]!==c||i[6]!==r?(n=(0,s.jsx)(ie,{actionStates:r,referenceElement:d,children:c}),i[4]=d,i[5]=c,i[6]=r,i[7]=n):n=i[7],n});function iM(e){let t,n,i=(0,o.c)(3),{size:r}=e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(t={pointerEvents:"none",visibility:"hidden",
354width:0},i[0]=t):t=i[0],i[1]!==r?(n=(0,s.jsx)(l.$n,{"aria-hidden":!0,disabled:!0,size:r,style:t,text:"-"}),i[1]=r,i[2]=n):n=i[2],n}let iD={primary:"primary",success:"positive",warning:"caution",danger:"critical"},i$=(0,c.memo)(function(e){let t,n,i=(0,o.c)(4),{states:r}=e;return 0===r.length?null:(i[0]!==r?(t=r.map(iO),i[0]=r,i[1]=t):t=i[1],i[2]!==t?(n=(0,s.jsx)(a.cV,{space:1,children:t}),i[2]=t,i[3]=n):n=i[3],n)}),iB=(0,c.memo)(function(e){let t,n=(0,o.c)(2),i=(0,c.useDeferredValue)(e.states);return n[0]!==i?(t=(0,s.jsx)(i$,{states:i}),n[0]=i,n[1]=t):t=n[1],t});function iY(){let e,t=(0,o.c)(3),{badges:n,editState:i}=tD();return i&&n?(t[0]!==n||t[1]!==i?(e=(0,s.jsx)(lU,{badges:n,badgeProps:i,children:iL}),t[0]=n,t[1]=i,t[2]=e):e=t[2],e):null}function iL(e){let{states:t}=e;return(0,s.jsx)(iB,{states:t})}function iO(e,t){return(0,s.jsx)(l.m_,{content:e.title,disabled:!e.title,placement:"top",portal:!0,children:(0,s.jsx)(a.Ex,{fontSize:1,mode:"outline",paddingX:2,paddingY:1,radius:4,tone:e.color?iD[e.color]:void 0,style:{whiteSpace:"nowrap"},children:e.label})},`${e.label}-${t}`)}let iH={create:p.REV,delete:p.ucK,discardDraft:p.USm,initial:p.REV,editDraft:p.qUP,editLive:p.qUP,publish:p.VQ$,unpublish:p.wvk},iV=(0,g.I4)(p.YJP)`
355  transition: transform 200ms;
356  &[data-expanded='true'] {
357    transform: rotate(-90deg);
358  }
359`;function iN(e){let t,n,i,a,d,c=(0,o.c)(14),{isExpanded:u,onExpand:p}=e,{t:m}=(0,h.Bdt)(r.Z7);c[0]!==u||c[1]!==p?(t=e=>{e.stopPropagation(),function(e){if(e)return;let t=document.getElementById(i5);if(t){let e=t.children[0];if(!(e.scrollHeight>e.clientHeight)){let t=getComputedStyle(e).overflowY;e.style.overflowY="hidden",setTimeout(()=>{e.style.overflowY=t},0)}}}(u),p()},c[0]=u,c[1]=p,c[2]=t):t=c[2];let f=t;return c[3]!==u?(n=(0,s.jsx)(iV,{"data-expanded":u}),c[3]=u,c[4]=n):n=c[4],c[5]!==u||c[6]!==m?(i=m(u?"timeline-item.menu.action-collapse":"timeline-item.menu.action-expand"),c[5]=u,c[6]=m,c[7]=i):i=c[7],c[8]!==i?(a={content:i},c[8]=i,c[9]=a):a=c[9],c[10]!==f||c[11]!==n||c[12]!==a?(d=(0,s.jsx)(l.$n,{mode:"bleed",icon:n,tooltipProps:a,onClick:f}),c[10]=f,c[11]=n,c[12]=a,c[13]=d):d=c[13],d}let iZ=(0,g.I4)(a.BJ)`
360  max-width: 200px;
361`,iF=(0,g.I4)(a.so)`
362  max-height: ${e=>e.$maxHeight};
363  min-width: 244px;
364`,iK=(0,g.I4)(a.az)(({$visible:e})=>(0,g.AH)`
365    opacity: 0;
366    pointer-events: none;
367    transition: opacity 0.2s;
368
369    ${e&&(0,g.AH)`
370      opacity: 1;
371      pointer-events: auto;
372    `}
373  `),iW={initial:"timeline.operation.created-initial",create:"timeline.operation.created",publish:"timeline.operation.published",editLive:"timeline.operation.edited-live",editDraft:"timeline.operation.edited-draft",unpublish:"timeline.operation.unpublished",discardDraft:"timeline.operation.draft-discarded",delete:"timeline.operation.deleted"};function iJ(e){let t,n,i=(0,o.c)(9),{maxLength:r,userIds:l,size:d,withTooltip:c}=e,u=void 0===c||c;if(i[0]!==l||i[1]!==u){let e;i[3]!==u?(e=e=>(0,s.jsx)(h.H8m,{user:e,withTooltip:u},e),i[3]=u,i[4]=e):e=i[4],t=l.map(e),i[0]=l,i[1]=u,i[2]=t}else t=i[2];return i[5]!==r||i[6]!==d||i[7]!==t?(n=(0,s.jsx)(a.GE,{maxLength:r,size:d,children:t}),i[5]=r,i[6]=d,i[7]=t,i[8]=n):n=i[8],n}let iU=(0,g.I4)(a.so)(e=>{let t=(0,ek.JW)(e.theme),n=e.$color;return(0,g.AH)`
374    --card-icon-color: ${t.color.avatar[n].fg};
375    background-color: ${t.color.avatar[n].bg};
376    box-shadow: 0 0 0 1px var(--card-bg-color);
377
378    position: absolute;
379    width: ${t.avatar.sizes[0].size}px;
380    height: ${t.avatar.sizes[0].size}px;
381    right: -3px;
382    bottom: -3px;
383    border-radius: 50%;
384  `}),iG={initial:"blue",create:"blue",publish:"green",editLive:"green",editDraft:"yellow",unpublish:"orange",discardDraft:"orange",delete:"red",withinSelection:"magenta"},iQ={minimal:!0,useTemporalPhrase:!0},iq=(0,g.I4)(d.EA)(e=>{let t=(0,ek.JW)(e.theme);return(0,g.AH)`
385    width: 6ch;
386    height: ${t.font.text.sizes[0].lineHeight}px;
387  `}),iX=e=>{let t,n,i,r=(0,o.c)(10),{userId:l}=e,[d,c]=(0,h.Jd3)(l);return r[0]!==c||r[1]!==d?(t=(0,s.jsx)(a.az,{children:c||!d?(0,s.jsx)(h.LIN,{animated:!0}):(0,s.jsx)(h.H8m,{user:d})}),r[0]=c,r[1]=d,r[2]=t):t=r[2],r[3]!==c||r[4]!==d?(n=(0,s.jsx)(a.az,{children:c||!d?.displayName?(0,s.jsx)(a.EY,{size:1,children:(0,s.jsx)(iq,{animated:!0})}):(0,s.jsx)(a.EY,{muted:!0,size:1,children:d.displayName})}
387),r[3]=c,r[4]=d,r[5]=n):n=r[5],r[6]!==t||r[7]!==n||r[8]!==l?(i=(0,s.jsxs)(a.so,{align:"center",gap:2,padding:1,children:[t,n]},l),r[6]=t,r[7]=n,r[8]=l,r[9]=i):i=r[9],i},i0=e=>{let t,n,i,r,l=(0,o.c)(9),{collaborators:d}=e,{t:c}=(0,h.Bdt)("studio");return l[0]!==c?(t=c("timeline.changes.title"),l[0]=c,l[1]=t):t=l[1],l[2]!==t?(n=(0,s.jsx)(a.az,{padding:1,paddingBottom:2,children:(0,s.jsx)(a.EY,{size:1,weight:"medium",children:t})}),l[2]=t,l[3]=n):n=l[3],l[4]!==d?(i=d.map(i2),l[4]=d,l[5]=i):i=l[5],l[6]!==n||l[7]!==i?(r=(0,s.jsxs)(a.BJ,{paddingBottom:1,children:[n,i]}),l[6]=n,l[7]=i,l[8]=r):r=l[8],r};function i1(e){let t,n,i,r,d,c,u,p,m,f,x,g,b,y,j,v,_,w,S,k,C,I=(0,o.c)(55),{chunk:E,isSelected:z,onSelect:T,collaborators:A,optionsMenu:P}=e,{t:R}=(0,h.Bdt)("studio"),{type:M,endTimestamp:D}=E;I[0]!==M?(t=iH[M],I[0]=M,I[1]=t):t=I[1];let $=t;I[2]!==E.authors?(n=Array.from(E.authors),I[2]=E.authors,I[3]=n):n=I[3];let B=n;I[4]!==A?(i=A?Array.from(A):[],I[4]=A,I[5]=i):i=I[5];let Y=i,L="delete"!==M;I[6]===Symbol.for("react.memo_cache_sentinel")?(r={dateStyle:"medium",timeStyle:"short"},I[6]=r):r=I[6];let O=(0,h.ixk)(r);I[7]!==D?(d=new Date(D),I[7]=D,I[8]=d):d=I[8];let H=(0,h.Vq9)(d||"",iQ);if(I[9]!==O||I[10]!==D){let e=new Date(D);c=O.format(e),I[9]=O,I[10]=D,I[11]=c}else c=I[11];let V=c;I[12]!==E||I[13]!==L||I[14]!==T?(u=e=>{e.preventDefault(),e.stopPropagation(),L&&T(E)},I[12]=E,I[13]=L,I[14]=T,I[15]=u):u=I[15];let N=u;I[16]===Symbol.for("react.memo_cache_sentinel")?(p={position:"relative"},I[16]=p):p=I[16],I[17]!==B?(m=(0,s.jsx)(iJ,{maxLength:3,userIds:B,size:2}),I[17]=B,I[18]=m):m=I[18];let Z=iG[M];return I[19]!==$?(f=$&&(0,s.jsx)($,{}),I[19]=$,I[20]=f):f=I[20],I[21]!==f?(x=(0,s.jsx)(a.EY,{size:0,children:f}),I[21]=f,I[22]=x):x=I[22],I[23]!==Z||I[24]!==x?(g=(0,s.jsx)(iU,{align:"center",justify:"center",$color:Z,children:x}),I[23]=Z,I[24]=x,I[25]=g):g=I[25],I[26]!==g||I[27]!==m?(b=(0,s.jsxs)("div",{style:p,children:[m,g]}),I[26]=g,I[27]=m,I[28]=b):b=I[28],I[29]!==R||I[30]!==M?(y=R(iW[M])||(0,s.jsx)("code",{children:M}),I[29]=R,I[30]=M,I[31]=y):y=I[31],I[32]!==y?(j=(0,s.jsx)(a.EY,{size:1,weight:"medium",children:y}),I[32]=y,I[33]=j):j=I[33],I[34]!==V||I[35]!==D||I[36]!==H?(v=(0,s.jsx)(a.EY,{as:"time",size:1,muted:!0,dateTime:D,title:V,children:H}),I[34]=V,I[35]=D,I[36]=H,I[37]=v):v=I[37],I[38]!==j||I[39]!==v?(_=(0,s.jsxs)(a.BJ,{space:2,children:[j,v]}),I[38]=j,I[39]=v,I[40]=_):_=I[40],I[41]!==Y?(w=Y.length>0&&(0,s.jsx)(a.so,{flex:1,justify:"flex-end",align:"center",children:(0,s.jsx)(l.m_,{placement:"top",content:(0,s.jsx)(i0,{collaborators:Y}),portal:!0,children:(0,s.jsx)(a.az,{paddingLeft:2,paddingY:2,children:(0,s.jsx)(iJ,{maxLength:3,userIds:Y,size:0,withTooltip:!1})})})}),I[41]=Y,I[42]=w):w=I[42],I[43]!==b||I[44]!==_||I[45]!==w?(S=(0,s.jsxs)(a.so,{align:"center",gap:3,children:[b,_,w]}),I[43]=b,I[44]=_,I[45]=w,I[46]=S):S=I[46],I[47]!==E.id||I[48]!==N||I[49]!==z||I[50]!==S?(k=(0,s.jsx)(a.Zp,{as:"button",onClick:N,padding:2,pressed:z,radius:2,"data-ui":"timelineItem","data-testid":"timeline-item-button","data-chunk-id":E.id,children:S}),I[47]=E.id,I[48]=N,I[49]=z,I[50]=S,I[51]=k):k=I[51],I[52]!==P||I[53]!==k?(C=(0,s.jsxs)(a.so,{align:"center",gap:1,children:[k,P]}),I[52]=P,I[53]=k,I[54]=C):C=I[54],C}function i2(e){return(0,s.jsx)(iX,{userId:e},e)}let i3=e=>"publish"!==e.type,i4=e=>"publish"===e.type,i5="timeline-list-wrapper",i6=({chunks:e,hasMoreChunks:t,lastChunk:n,onLoadMore:i,onSelect:r,listMaxHeight:l="calc(100vh - 280px)"})=>{let[o,d]=(0,c.useState)(!1),{t:u}=(0,h.Bdt)("studio"),p=n?.id,m=(0,c.useMemo)(()=>(function(e){let t=[];for(let n of e){if(i4(n)){t.push({...n,type:"publish",children:[],collaborators:new Set});continue}if(i3(n)){let e=function(e){let t=null;for(let n=e.length-1;n>=0;n--){let i=e[n];if(i4(i)){t=i;break}if("editDraft"!==i.type)break}return t}(t);if("editDraft"===n.type&&e?.type==="publish"){Array.from(n.authors).forEach(t=>{e.collaborators.add(t)}),e.children.push(n.id),t.push({...n,parentId:e.id});continue}}i3(n)&&t.push(n)}return t})(e),[e]),[f,x]=(0,c.useState)(()=>{if(p){let e=m.find(e=>e.id===p);if(e&&i3(e)&&e.parentId)return new Set([e.parentId])}return new Set});(0,c.useEffect)(()=>
387{if(p){let e=m.find(e=>e.id===p);if(e&&i3(e)&&e.parentId){let t=e.parentId;x(e=>{if(e.has(t))return e;let n=new Set(e);return n.add(t),n})}}},[m,p]);let g=(0,c.useMemo)(()=>m.filter(e=>!!i4(e)||!e.parentId||f.has(e.parentId)),[m,f]);(0,c.useEffect)(()=>{g.length<16&&t&&i()},[g,t,i]);let b=(0,c.useCallback)(e=>()=>x(t=>{let n=new Set(t);return t.has(e)?n.delete(e):n.add(e),n}),[]),y=(0,c.useMemo)(()=>p?g.findIndex(e=>e.id===p):-1,[p,g]),j=(0,c.useCallback)(t=>{let n=e.find(e=>e.id===t.id);n?r(n):(console.error("TimelineItem: chunk not found"),r(t))},[e,r]),v=(0,c.useCallback)((e,{activeIndex:n})=>(0,s.jsxs)(a.az,{paddingBottom:1,paddingTop:+(0===n),paddingRight:1,paddingLeft:i3(e)&&e.parentId?4:1,children:[(0,s.jsx)(i1,{chunk:e,isSelected:p===e.id,onSelect:j,collaborators:i4(e)?e.collaborators:void 0,optionsMenu:i4(e)&&e.children.length>0?(0,s.jsx)(iN,{isExpanded:f.has(e.id),onExpand:b(e.id)}):null}),n===g.length-1&&t&&(0,s.jsx)(h.gd4,{})]}),[f,g.length,b,j,t,p]);return(0,c.useEffect)(()=>d(!0),[]),(0,s.jsxs)(iK,{$visible:!y||o,"data-ui":"timeline",children:[0===g.length&&(0,s.jsxs)(iZ,{padding:3,space:3,children:[(0,s.jsx)(a.EY,{size:1,weight:"medium",children:u("timeline.error.no-document-history-title")}),(0,s.jsx)(a.EY,{muted:!0,size:1,children:u("timeline.error.no-document-history-description")})]}),g.length>0&&(0,s.jsx)(iF,{direction:"column",$maxHeight:l,id:i5,children:(0,s.jsx)(h.oIj,{activeItemDataAttr:"data-hovered",ariaLabel:u("timeline.list.aria-label"),autoFocus:"list",initialIndex:y,initialScrollAlign:"center",itemHeight:57,items:g,onEndReached:i,onEndReachedIndexOffset:20,overscan:5,renderItem:v,wrapAround:!1})})]})};function i7(e){let t,n,i,r,l,d,c=(0,o.c)(14),{versionError:u}=e,{t:m}=(0,h.Bdt)("studio");return c[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,s.jsx)(h.SxK,{tone:"critical",children:(0,s.jsx)(p.YZv,{})}),c[0]=t):t=c[0],c[1]!==m||c[2]!==u?(n=m(u?"timeline.error.load-document-changes-version-title":"timeline.error.load-document-changes-title"),c[1]=m,c[2]=u,c[3]=n):n=c[3],c[4]!==n?(i=(0,s.jsx)(h.SxK,{size:1,tone:"critical",weight:"medium",children:n}),c[4]=n,c[5]=i):i=c[5],c[6]!==m||c[7]!==u?(r=m(u?"timeline.error.load-document-changes-version-description":"timeline.error.load-document-changes-description"),c[6]=m,c[7]=u,c[8]=r):r=c[8],c[9]!==r?(l=(0,s.jsx)(h.SxK,{size:1,tone:"critical",children:r}),c[9]=r,c[10]=l):l=c[10],c[11]!==i||c[12]!==l?(d=(0,s.jsxs)(a.so,{align:"flex-start",gap:3,padding:4,children:[t,(0,s.jsxs)(a.BJ,{space:4,children:[i,l]})]}),c[11]=i,c[12]=l,c[13]=d):d=c[13],d}i6.displayName="Timeline";let i8=(0,g.I4)(l.AM)`
388  overflow: hidden;
389  overflow: clip;
390`,i9="timeline-menu";function re({chunk:e,mode:t,placement:n}){let{setTimelineRange:i,timelineError:r,ready:o,timelineStore:u}=tD(),[m,f]=(0,c.useState)(!1),[x,g]=(0,c.useState)(null),[b,y]=(0,c.useState)(null),j=(0,d.dj)(),v=(0,h.SfM)(u,e=>e.chunks),_=(0,h.SfM)(u,e=>e.isLoading),w=(0,h.SfM)(u,e=>e.hasMoreChunks),S=(0,h.SfM)(u,e=>e.realRevChunk),k=(0,h.SfM)(u,e=>e.sinceTime),{t:C}=(0,h.Bdt)("studio"),I=(0,c.useCallback)(()=>{f(!0)},[]),E=(0,c.useCallback)(()=>{f(!1)},[]),z=(0,c.useCallback)(e=>{m&&("Escape"===e.key||"Tab"===e.key)&&(E(),x?.focus())},[x,E,m]);(0,a.Pm)(z),(0,a.PR)(m&&E,()=>[x,b]);let T=(0,c.useCallback)(e=>{try{let[t,n]=u?.findRangeForRev(e)||[null,null];i(t,n)}catch(e){j.push({closable:!0,description:e.message,status:"error",title:C("timeline.error.unable-to-load-revision")})}},[i,C,u,j]),A=(0,c.useCallback)(e=>{try{let[t,n]=u?.findRangeForSince(e)||[null,null];i(t,n)}catch(e){j.push({closable:!0,description:e.message,status:"error",title:C("timeline.error.unable-to-load-revision")})}},[i,C,u,j]),P=(0,c.useCallback)(()=>{_||u?.loadMore()},[_,u]),R=(0,c.useMemo)(()=>{if(r)return(0,s.jsx)(i7,{});if("rev"===t)return(0,s.jsx)(i6,{chunks:v,hasMoreChunks:w,lastChunk:S,onLoadMore:P,onSelect:T});let e=S?v.filter(e=>e.index<S.index):v;return(0,s.jsx)(i6,{chunks:e,hasMoreChunks:w,lastChunk:k,onLoadMore:P,onSelect:A})},[v,P,w,t,S,T,A,k,r]),M={timestamp:{dateStyle:"medium",timeStyle:"short"}},D=e?C(iW[e.type],{context:"timestamp",timestamp:new Date(e?.endTimestamp),formatParams:M}):C("timeline.latest-revision"),$=e?C("timeline.since",{timestamp:new Date(e?.endTimestamp),formatParams:M}):C("timeline.since-version-missing"),B="rev"===t?D:$,Y=(0,c.useMemo)(()=>({[i9]:b}),[b]);return(0,s.jsx)(a.GD,{__unstable_elements:Y,children:(0,s.jsx)(i8,{"data-testid":"timeline-menu",constrainSize:!0,content:m&&R,"data-ui":"versionMenu",open:m,placement:n,matchReferenceWidth:!0,portal:!0,ref:y,
390children:(0,s.jsx)(a.so,{width:"fill",children:(0,s.jsx)(l.$n,{"data-testid":m?"timeline-menu-close-button":"timeline-menu-open-button",disabled:!o,mode:"ghost",onClick:m?E:I,ref:g,selected:m,width:"fill",tooltipProps:null,justify:"space-between",style:{maxWidth:"100%"},iconRight:p.D3D,text:o?B:C("timeline.loading-history")})})})})}let rt=(0,g.I4)(y.P.path)`
391  transform-origin: center;
392`,rn=e=>{let t,n=(0,o.c)(2);return n[0]!==e?(t=(0,s.jsx)(y.P.circle,{fill:"none",r:"8",cx:"12.5",cy:"12.5",strokeWidth:"1.2",...e}),n[0]=e,n[1]=t):t=n[1],t},ri=e=>{let t,n=(0,o.c)(2);return n[0]!==e?(t=(0,s.jsx)(rt,{fill:"none",d:"M14 17.5619L11.5 20.5L14.5 23.0619M11 7.43811L13.5 4.50001L10.5 1.93811",...e}),n[0]=e,n[1]=t):t=n[1],t},rr=e=>{let t,n=(0,o.c)(2);return n[0]!==e?(t=(0,s.jsx)(y.P.path,{d:"M9.5 12.1316L11.7414 14.5L16 10",...e}),n[0]=e,n[1]=t):t=n[1],t},rl=(0,g.i7)`
393  0% {
394    transform: rotate(0);
395  }
396  100% {
397    transform: rotate(360deg);
398  }
399`,rs=g.I4.g`
400  transform-origin: center;
401
402  &[data-rotate] {
403    animation: ${rl} 1s ease-in-out infinite;
404  }
405`,ro={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}}},ra={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}}},rd={syncing:{opacity:1,transition:{duration:0}},saved:{opacity:0,transition:{duration:.2}},changes:{opacity:0}},rc={syncing:{pathLength:0,transition:{duration:0}},saved:{pathLength:1,transition:{delay:.4,duration:.3}},changes:{pathLength:0,transition:{duration:.2}}};function ru(e){let t,n,i,r,l,a=(0,o.c)(13),{status:d}=e;if(!d)return null;let c="changes"===d?void 0:"";return a[0]!==d?(t=(0,s.jsx)(ri,{variants:rd,initial:d,animate:d}),n=(0,s.jsx)(rn,{variants:ra,initial:d,animate:d}),a[0]=d,a[1]=t,a[2]=n):(t=a[1],n=a[2]),a[3]!==c||a[4]!==t||a[5]!==n?(i=(0,s.jsxs)(rs,{"data-rotate":c,children:[t,n]}),a[3]=c,a[4]=t,a[5]=n,a[6]=i):i=a[6],a[7]!==d?(r=(0,s.jsx)(rr,{variants:rc,initial:d,animate:d}),a[7]=d,a[8]=r):r=a[8],a[9]!==d||a[10]!==i||a[11]!==r?(l=(0,s.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",stroke:"currentColor",strokeWidth:"1.2","data-sanity-icon":"animated-status-icon",children:(0,s.jsxs)(y.P.g,{variants:ro,initial:d,animate:d,children:[i,r]})}),a[9]=d,a[10]=i,a[11]=r,a[12]=l):l=a[12],l}let rp={saved:{i18nKey:"status-bar.document-status-pulse.status.saved.text",tone:"positive"},syncing:{i18nKey:"status-bar.document-status-pulse.status.syncing.text",tone:"default"}},rm=e=>{let t,n,i,l,d,c=(0,o.c)(13),{status:u}=e,{t:p}=(0,h.Bdt)(r.Z7);if("saved"!==u&&"syncing"!==u)return null;let m=rp[u];return c[0]!==u?(t=(0,s.jsx)(ru,{status:u}),c[0]=u,c[1]=t):t=c[1],c[2]!==m.tone||c[3]!==t?(n=(0,s.jsx)(h.SxK,{size:1,tone:m.tone,children:t}),c[2]=m.tone,c[3]=t,c[4]=n):n=c[4],c[5]!==m.i18nKey||c[6]!==p?(i=p(m.i18nKey),c[5]=m.i18nKey,c[6]=p,c[7]=i):i=c[7],c[8]!==i?(l=(0,s.jsx)(a.EY,{muted:!0,size:1,children:i}),c[8]=i,c[9]=l):l=c[9],c[10]!==n||c[11]!==l?(d=(0,s.jsxs)(a.so,{align:"center",gap:2,"data-testid":"pane-footer-document-status-pulse",children:[n,l]}),c[10]=n,c[11]=l,c[12]=d):d=c[12],d},rh={minimal:!0,useTemporalPhrase:!0},rf=y.P.create(a.$n),rx=y.P.create(a.az),rg=()=>{let e,t,n=(0,o.c)(2);return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)("div",{style:{margin:-5},children:(0,s.jsx)(h.LIN,{$size:0,animated:!0})}),n[0]=e):e=n[0],n[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,s.jsxs)(a.so,{align:"center",gap:3,paddingLeft:1,paddingRight:2,paddingY:2,children:[e,(0,s.jsx)(d.EA,{animated:!0,style:{width:"80px",height:"15px"},radius:2})]}),n[1]=t):t=n[1],t},rb=e=>{let t,n,i,r,l,d,c,u,p=(0,o.c)(17),{author:m,translationKey:f,timestamp:x}=e,{onHistoryOpen:g,inspector:b,onHistoryClose:y}=tD(),{t:j}=(0,h.Bdt)(),v=(0,h.Vq9)(void 0===x?"":x,rh);p[0]===Symbol.for("react.memo_cache_sentinel")?(t={opacity:1},n={opacity:0}
405,i={opacity:0},p[0]=t,p[1]=n,p[2]=i):(t=p[0],n=p[1],i=p[2]);let _=b?.name===tV?y:g;return p[3]!==m?(r=m&&(0,s.jsx)("div",{style:{margin:-5},children:(0,s.jsx)(h.H8m,{user:m,size:0})}),p[3]=m,p[4]=r):r=p[4],p[5]!==j||p[6]!==f?(l=j(f),p[5]=j,p[6]=f,p[7]=l):l=p[7],p[8]!==v||p[9]!==l?(d=(0,s.jsxs)(a.EY,{muted:!0,size:1,children:[l," ",v]}),p[8]=v,p[9]=l,p[10]=d):d=p[10],p[11]!==r||p[12]!==d?(c=(0,s.jsxs)(a.so,{align:"center",flex:"none",gap:3,children:[r,d]}),p[11]=r,p[12]=d,p[13]=c):c=p[13],p[14]!==_||p[15]!==c?(u=(0,s.jsx)(rf,{"data-testid":"pane-footer-document-status",animate:t,initial:n,exit:i,mode:"bleed",onClick:_,padding:2,muted:!0,children:c}),p[14]=_,p[15]=c,p[16]=u):u=p[16],u},ry=()=>{let{editState:e}=tD(),{selectedPerspective:t}=(0,h.QO2)(),n=(0,c.useMemo)(()=>(0,h.xo4)(t)&&e?.published?._updatedAt?{translationKey:h.uMx.published.createDocumentVersion,timestamp:e.published._updatedAt}:e?.version?._updatedAt?{translationKey:e?.version?._updatedAt===e?.version?._createdAt?h.uMx.version.createDocumentVersion:h.uMx.version.editDocumentVersion,timestamp:e.version._updatedAt}:e?.draft?._updatedAt?{translationKey:e?.draft?._updatedAt===e?.draft?._createdAt?h.uMx.draft.createDocumentVersion:h.uMx.draft.editDocumentVersion,timestamp:e.draft._updatedAt}:null,[t,e?.published?._updatedAt,e?.version?._updatedAt,e?.version?._createdAt,e?.draft?._updatedAt,e?.draft?._createdAt]);return n?(0,s.jsx)(rb,{author:"",translationKey:n.translationKey,timestamp:n.timestamp}):null},rj=()=>{let e,t=(0,o.c)(6),{events:n,loading:i}=(0,h.LJN)(),r=n?.[0];if(!r&&i){let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)(rg,{}),t[0]=e):e=t[0],e}if(!r){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)(ry,{}),t[1]=e):e=t[1],e}let l=h.uMx[r.documentVariantType][r.type];return t[2]!==r.author||t[3]!==r.timestamp||t[4]!==l?(e=(0,s.jsx)(rb,{author:r.author,translationKey:l,timestamp:r.timestamp}),t[2]=r.author,t[3]=r.timestamp,t[4]=l,t[5]=e):e=t[5],e},rv=()=>{let e,t,n=(0,o.c)(8),{timelineStore:i}=tD(),r=(0,h.SfM)(i,rw),l=(0,h.SfM)(i,rS),a=r?.[0];if(!a&&l){let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)(rg,{}),n[0]=e):e=n[0],e}if(!a){let e;return n[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)(ry,{}),n[1]=e):e=n[1],e}n[2]!==a.authors?(e=Array.from(a.authors),n[2]=a.authors,n[3]=e):e=n[3];let d=e[0],c=iW[a.type];return n[4]!==d||n[5]!==a.endTimestamp||n[6]!==c?(t=(0,s.jsx)(rb,{author:d,translationKey:c,timestamp:a.endTimestamp}),n[4]=d,n[5]=a.endTimestamp,n[6]=c,n[7]=t):t=n[7],t};function r_(){let e,t,n,i,r,l,a,d=(0,o.c)(18),{documentId:u,documentType:p,editState:m,value:f}=tD(),[x,g]=(0,c.useState)(null),b=(0,h.For)().beta?.eventsAPI?.documents,y=(0,h.M7h)(u,p,m?.release),v=f?._updatedAt;return d[0]!==x||d[1]!==y.isSyncing?(e=()=>{if("syncing"===x&&!y.isSyncing){let e=setTimeout(()=>g("saved"),1e3);return()=>clearTimeout(e)}if("saved"===x){let e=setTimeout(()=>g(null),3e3);return()=>clearTimeout(e)}},d[0]=x,d[1]=y.isSyncing,d[2]=e):e=d[2],d[3]!==v||d[4]!==x||d[5]!==y.isSyncing?(t=[x,v,y.isSyncing],d[3]=v,d[4]=x,d[5]=y.isSyncing,d[6]=t):t=d[6],(0,c.useEffect)(e,t),d[7]===Symbol.for("react.memo_cache_sentinel")?(n=()=>{g(null)},d[7]=n):n=d[7],d[8]!==u?(i=[u],d[8]=u,d[9]=i):i=d[9],(0,c.useLayoutEffect)(n,i),d[10]!==y.isSyncing?(r=()=>{y.isSyncing&&g("syncing")},d[10]=y.isSyncing,d[11]=r):r=d[11],d[12]!==v||d[13]!==y.isSyncing?(l=[y.isSyncing,v],d[12]=v,d[13]=y.isSyncing,d[14]=l):l=d[14],(0,c.useLayoutEffect)(r,l),d[15]!==b||d[16]!==x?(a=(0,s.jsx)(j.N,{children:x?(0,s.jsx)(rx,{paddingLeft:2,animate:{opacity:1},initial:{opacity:0}
405,exit:{opacity:0},children:(0,s.jsx)(rm,{status:x||void 0})}):(0,s.jsx)(s.Fragment,{children:b?(0,s.jsx)(rj,{}):(0,s.jsx)(rv,{})})}),d[15]=b,d[16]=x,d[17]=a):a=d[17],a}function rw(e){return e.chunks}function rS(e){return e.isLoading}let rk=(0,g.I4)(a.EY)`
406  color: var(--card-muted-fg-color);
407
408  em {
409    color: var(--card-fg-color);
410    font-weight: 500;
411    font-style: normal;
412  }
413`;function rC(){let e,t,n,i,r=(0,o.c)(9),{displayed:l,revisionNotFound:d}=tD(),m=(0,c.useContext)(u.Pc),f=m?.revision,x=m?.events.find(e=>e.id===f?.revisionId),{t:g}=(0,h.Bdt)(),b=x?.timestamp||l?._updatedAt||l?._createdAt,y=b?(0,s.jsx)(h.HTc,{t:g,i18nKey:"document-status.revision-from",values:{date:(0,ew.A)(new Date(b),"MMM d, yyyy '@' pp")}}):null;r[0]!==y?(e={name:"revision",text:y,tone:"caution"},r[0]=y,r[1]=e):e=r[1];let j=e;return r[2]===Symbol.for("react.memo_cache_sentinel")?(t=(0,s.jsx)(a.az,{flex:"none",children:(0,s.jsx)(a.EY,{size:1,children:(0,s.jsx)(p.G2W,{})})}),r[2]=t):t=r[2],r[3]!==j||r[4]!==d||r[5]!==g?(n=d?(0,s.jsx)(h.HTc,{t:g,i18nKey:"document-status.revision-not-found"}):j.text,r[3]=j,r[4]=d,r[5]=g,r[6]=n):n=r[6],r[7]!==n?(i=(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(a.so,{flex:1,gap:3,padding:2,children:[t,(0,s.jsx)(a.az,{flex:1,children:(0,s.jsx)(rk,{size:1,textOverflow:"ellipsis",children:n})})]})}),r[7]=n,r[8]=i):i=r[8],i}let rI=y.P.create(a.Zp);function rE(e){let t,n,i,r,l,d,u,p,m=(0,o.c)(22),{actionsBoxRef:f,createLinkMetadata:x}=e,{editState:g,onChange:b,revisionNotFound:y}=tD(),{params:j}=ny(),v=void 0===j?tL:j,{selectedPerspective:_}=(0,h.QO2)(),{title:w}=tZ(),S=(0,h.eaL)().components?.documentLinkedActions,k=!!v.rev,[C,I]=(0,c.useState)(null),[E,z]=(0,c.useState)(null);m[0]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{I(e.contentRect.width<480)},m[0]=t):t=m[0];let T=t;m[1]!==E?(n={element:E,onResize:T},m[1]=E,m[2]=n):n=m[2],function(e){let t,n,i=(0,o.c)(4),{element:r,onResize:l}=e;i[0]!==r||i[1]!==l?(t=()=>(r&&h.bCC.observe(r,l),()=>{r&&h.bCC.unobserve(r)}),n=[r,l],i[0]=r,i[1]=l,i[2]=t,i[3]=n):(t=i[2],n=i[3]),(0,c.useLayoutEffect)(t,n)}(n);e:{let e=!!(g?.ready&&"boolean"==typeof C);
413if(_){if((0,h.xo4)(_)){i=e&&!!g?.published;break e}if((0,h.Jrl)(_)){i=e&&!!g?.version;break e}}i=e}let A=i;if(x&&(0,h.Y07)(x)&&S){let e;m[3]!==S||m[4]!==x||m[5]!==b||m[6]!==w?(e=(0,s.jsx)(S,{metadata:x,panelPortalElementId:n1,onDocumentChange:b,documentTitle:w}),m[3]=S,m[4]=x,m[5]=b,m[6]=w,m[7]=e):e=m[7],r=e}else if(k){let e;m[8]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)(iw,{}),m[8]=e):e=m[8],r=e}else{let e;m[9]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)(i_,{}),m[9]=e):e=m[9],r=e}if(k&&y)return null;let P=k?"revision":"published";m[10]===Symbol.for("react.memo_cache_sentinel")?(l={opacity:.2},m[10]=l):l=m[10],m[11]===Symbol.for("react.memo_cache_sentinel")?(d={opacity:1,transition:{duration:.3}},m[11]=d):d=m[11];let R=k?"caution":void 0;return m[12]!==r||m[13]!==f||m[14]!==C||m[15]!==A||m[16]!==k?(u=A&&(0,s.jsxs)(a.so,{align:"stretch",gap:1,justify:"space-between",paddingLeft:+!k,paddingRight:+!k,children:[(0,s.jsxs)(a.so,{align:"center",flex:1,gap:C?2:3,wrap:"wrap",paddingRight:3,children:[(0,s.jsxs)(a.so,{align:"center",children:[k?(0,s.jsx)(rC,{}):(0,s.jsx)(r_,{}),(0,s.jsx)(iM,{})]}),(0,s.jsx)(iY,{})]}),(0,s.jsxs)(a.so,{align:"flex-start",justify:"flex-end",ref:f,style:{flexShrink:0,marginLeft:"auto"},children:[(0,s.jsx)(iM,{}),r]})]}),m[12]=r,m[13]=f,m[14]=C,m[15]=A,m[16]=k,m[17]=u):u=m[17],m[18]!==P||m[19]!==R||m[20]!==u?(p=(0,s.jsx)(rI,{initial:l,animate:d,tone:R,radius:3,ref:z,sizing:"border",padding:2,children:u},P),m[18]=P,m[19]=R,m[20]=u,m[21]=p):p=m[21],p}let rz=(0,c.memo)(function(e){let t,n,i,r,l,a,d,c,u,p,m,f,x,g=(0,o.c)(26);g[0]!==e?({actionsBoxElement:t,activeIndex:n,as:p,children:i,id:r,onActionStart:l,onKeyDown:a,rootRef:c,states:u,...d}=e,g[0]=e,g[1]=t,g[2]=n,g[3]=i,g[4]=r,g[5]=l,g[6]=a,g[7]=d,g[8]=c,g[9]=u,g[10]=p):(t=g[1],n=g[2],i=g[3],r=g[4],l=g[5],a=g[6],d=g[7],c=g[8],u=g[9],p=g[10]);let b=void 0===p?"div":p,y=u[n];g[11]!==l||g[12]!==a||g[13]!==u?(m=e=>{let t=u.filter(t=>t.shortcut&&(0,eg.v_)(t.shortcut,e)),n=t[0];if(t.length>1&&console.warn(`Keyboard shortcut conflict: More than one document action matches the shortcut "${n.shortcut}"`),n&&!n.disabled&&n.onHandle){e.preventDefault(),n.onHandle(),l(u.indexOf(n));return}a&&a(e)},g[11]=l,g[12]=a,g[13]=u,g[14]=m):m=g[14];let j=m;return g[15]!==t||g[16]!==y?(f=y&&y.dialog&&(0,s.jsx)(h.wG1,{zOffset:"paneFooter",children:(0,s.jsx)(n9,{dialog:y.dialog,referenceElement:t})}),g[15]=t,g[16]=y,g[17]=f):f=g[17],g[18]!==b||g[19]!==i||g[20]!==j||g[21]!==r||g[22]!==d||g[23]!==c||g[24]!==f?(x=(0,s.jsxs)(b,{id:r,onKeyDown:j,tabIndex:-1,...d,ref:c,children:[i,f]}),g[18]=b,g[19]=i,g[20]=j,g[21]=r,g[22]=d,g[23]=c,g[24]=f,g[25]=x):x=g[25],x}),rT=(0,c.memo)(e=>{let t,n,i,r,l,a,d,u,p=(0,o.c)(20);p[0]!==e?({actionsBoxElement:t,as:r,children:n,...i}=e,p[0]=e,p[1]=t,p[2]=n,p[3]=i,p[4]=r):(t=p[1],n=p[2],i=p[3],r=p[4]);let m=void 0===r?"div":r,{actions:h,editState:f,isInitialValueLoading:x,revisionId:g}=tD(),[b,y]=(0,c.useState)(-1);p[5]===Symbol.for("react.memo_cache_sentinel")?(l=e=>{y(e)},p[5]=l):l=p[5];let j=l;p[6]!==f||p[7]!==x||p[8]!==g?(a=f&&{...f,onComplete:rA,revision:g||void 0,initialValueResolved:!x},p[6]=f,p[7]=x,p[8]=g,p[9]=a):a=p[9];let v=a;p[10]!==t||p[11]!==b||p[12]!==m||p[13]!==n||p[14]!==i?(d=e=>{let{states:r}=e;return(0,s.jsx)(rz,{...i,activeIndex:b,actionsBoxElement:t,as:m,onActionStart:j,states:r,children:n})},p[10]=t,p[11]=b,p[12]=m,p[13]=n,p[14]=i,p[15]=d):d=p[15];let _=d;return v&&h?(p[16]!==v||p[17]!==h||p[18]!==_?(u=(0,s.jsx)(lK,{actionProps:v,actions:h,children:_}),p[16]=v,p[17]=h,p[18]=_,p[19]=u):u=p[19],u):null});function rA(){}rT.displayName="Memo(DocumentActionShortcuts)";let rP=()=>{let e,t=(0,o.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)(p.Nrt,{style:{visibility:"hidden"}}),t[0]=e):e=t[0],e};function rR(e){let t,n,i,r,l,d,c,u=(0,o.c)(23),{documentType:p,value:m,currentMinWidth:f,paneKey:x,minWidth:g}=e,{t:b}=(0,h.Bdt)();return u[0]!==p?(t={documentType:p},u[0]=p,u[1]=t):t=u[1],u[2]!==b||u[3]!==t?(n=(0,s.jsx)(h.HTc,{t:b,i18nKey:"panes.document-pane.document-unknown-type.title",values:t}),u[2]=b,u[3]=t,u[4]=n):n=u[4],u[5]!==p||u[6]!==b?(i=p&&(0,s.jsx)(a.EY,{as:"p",children:(0,s.jsx)(h.HTc,{t:b,i18nKey:"panes.document-pane.document-unknown-type.text",values:{documentType:p}})}),u[5]=p,u[6]=b,u[7]=i):i=u[7],u[8]!==p||u[9]!==b?(r=!p&&(0,s.jsx)(a.EY,{as:"p",children:b("panes.document-pane.document-unknown-type.without-schema.text")}),u[8]=p,u[9]=b,u[10]=r):r=u[10],u[11]!==m?(l=h.Cu5&&m&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.EY,{as:"p",children:"Here is the JSON representation of the document:"}),(0,s.jsx)(a.Zp,{padding:3,overflow:"auto",radius:2,shadow:1,tone:"inherit",children:(0,s.jsx)(a.Cy,{language:"json",size:[1,1,2],children:JSON.stringify(m,null,2)})})]}),u[11]=m,u[12]=l):l=u[12],u[13]!==i||u[14]!==r||u[15]!==l?(d=(0,s.jsxs)(a.BJ,{space:4,children:[i,r,l]}),u[13]=i,u[14]=r,u[15]=l,u[16]=d):d=u[16],u[17]!==f||u[18]!==g||u[19]!==x||u[20]!==n||u[21]!==d?(c=(0,s.jsx)(tT,{currentMinWidth:f,flex:2.5,minWidth:g,paneKey:x,title:n,tone:"caution",children:d}),u[17]=f,u[18]=g,u[19]=x,u[20]=n,u[21]=d,u[22]=c):c=u[22],c}let rM=["fixed","fixed","absolute"];function rD(e){let t,n,i,r,c,u,p=(0,o.c)(16),{documentPanelPortalElement:m,setFooterElement:f,setActionsBoxElement:x}=e,g=(0,h.YKH)(),{value:b}=tD();p[0]!==m?(t={[n1]:m},p[0]=m,p[1]=t):t=p[1];let y=t;p[2]!==b?(n=(0,h.G_3)(b),p[2]=b,p[3]=n):n=p[3];let j=n;return p[4]!==j||p[5]!==x?(i=(0,s.jsx)(l.vE,{children:(0,s.jsx)(rE,{actionsBoxRef:x,createLinkMetadata:j})}),p[4]=j,p[5]=x,p[6]=i):i=p[6],p[7]!==f||p[8]!==i?(r=(0,s.jsx)(th,{ref:f,padding:1,children:i}),p[7]=f,p[8]=i,p[9]=r):r=p[9],p[10]!==r||p[11]!==g.portal?(c=(0,s.jsx)(d.Co,{position:rM,zOffset:g.portal,children:r}),p[10]=r,p[11]=g.portal,p[12]=c):c=p[12],p[13]!==y||p[14]!==c?(u=(0,s.jsx)(a.GD,{__unstable_elements:y,children:c}),p[13]=y,p[14]=c,p[15]=u):u=p[15],u}let r$=[],rB=["fixed","fixed","absolute"],rY=(0,g.I4)(h.olN)`
414  flex: 1;
415  display: flex;
416  flex-direction: column;
417  min-height: 0;
418  min-width: 0;
419`;
419function rL(){let{changesOpen:e,displayed:t,documentId:n,documentType:i,editState:l,fieldActions:o,focusPath:u,inspectOpen:m,inspector:f,inspectors:x,onFocus:g,onHistoryOpen:b,onMenuAction:y,onPathOpen:j,paneKey:v,schemaType:w,value:S,previewUrl:k}=tD(),{stickyParams:C}=(0,_.rd)(),{params:I}=ny(),{features:E}=tY(),{t:z}=(0,h.Bdt)(r.Z7),{collapsed:T}=e5(),A=(0,h.YKH)(),[P,R]=(0,c.useState)(null),[M,D]=(0,c.useState)(null),[$,B]=(0,c.useState)(null),[Y,L]=(0,c.useState)(null),[O,H]=(0,c.useState)(null);(0,h.ti5)({element:P,focusPath:u,value:S});let[V,N]=(0,c.useState)([]),[Z,F]=(0,c.useState)([]),K=(0,d.sQ)(M),W=(0,d.sQ)($),J=K?.height,U=W?.height,G=600+320*!!f,Q=320+320*!!f,q=(0,c.useMemo)(()=>x?.find(e=>e.name===f?.name),[x,f?.name]),X=(0,h.aSp)({displayed:t,documentId:n,editState:l}),ee=!!S,et=(0,c.useMemo)(()=>{var e;let t,n;return t=function({currentInspector:e,hasValue:t,inspectors:n,inspectorMenuItems:i}){return n.map((n,r)=>{let l=i[r];return!l||l.hidden?null:{action:`${tO}${n.name}`,group:l.showAsAction?void 0:"inspectors",icon:l.icon,disabled:!t,selected:e?.name===n.name,shortcut:l.hotkeys?.join("+"),showAsAction:l.showAsAction,title:l.title,tone:l.tone}}).filter(Boolean)}(e={currentInspector:q,features:E,hasValue:ee,inspectorMenuItems:V,inspectors:x,previewUrl:k,documentIdStack:X,t:z,displayInlineChanges:"true"===C.displayInlineChanges}),n=[function({previewUrl:e,t}){return e?{action:"production-preview",group:"links",title:t("production-preview.menu-item.title"),icon:p.Pe7,shortcut:"Ctrl+Alt+O"}:null}(e),function({documentIdStack:e,t}){let n=typeof e?.previousId>"u"&&{reason:t("compare-versions.menu-item.disabled-reason")};return{action:"compareVersions",group:"inspectors",title:t("compare-versions.menu-item.title"),icon:p.ppF,disabled:n}}(e),function({displayInlineChanges:e,t}){return{action:"toggleInlineChanges",group:"inspectors",title:t("toggle-inline-changes.menu-item.title"),icon:e?p.Nrt:rP}}(e)].filter(Boolean),[{action:"copy-document-url",showAsAction:!0,title:e.t("action.copy-document-url.label"),icon:p.qYV},...t,function({hasValue:e,t}){return{action:"inspect",group:"inspectors",title:t("document-inspector.menu-item.title"),icon:p.qzt,disabled:!e,shortcut:"Ctrl+Alt+I"}}(e),...n]},[q,X,E,ee,V,x,k,z,C.displayInlineChanges]),en=(0,c.useCallback)(e=>{for(let t of et)if(t.shortcut&&(0,eg.v_)(t.shortcut,e)){e.preventDefault(),e.stopPropagation(),y(t);return}},[y,et]),ei=(0,c.useCallback)(e=>{j(e),g(e)},[j,g]);return w?(0,s.jsxs)(h.niW,{value:S,children:[x.length>0&&(0,s.jsx)(tN,{documentId:n,documentType:i,inspectors:x,onMenuItems:N}),o.length>0&&w&&(0,s.jsx)(h.yW8,{actions:o,documentId:n,documentType:i,onActions:F,path:r$,sc
419hemaType:w}),(0,s.jsx)(h.tdH,{actions:Z,path:r$,children:(0,s.jsxs)(rT,{actionsBoxElement:Y,as:e9,currentMinWidth:G,"data-testid":"document-pane",flex:2.5,id:v,minWidth:Q,onKeyUp:en,rootRef:R,children:[(0,s.jsx)(iA,{ref:B,menuItems:et}),(0,s.jsx)(d.Co,{position:rB,zOffset:A.paneDialog,children:(0,s.jsx)(a.so,{direction:"column",flex:1,height:T?void 0:"fill",children:(0,s.jsx)(rY,{"data-testid":"change-connector-root",isReviewChangesOpen:e&&I?.changesInspectorTab==="review",onOpenReviewChanges:b,onSetFocus:ei,children:(0,s.jsx)(nJ,{footerHeight:J||null,headerHeight:U||null,isInspectOpen:m,rootElement:P,setDocumentPanelPortalElement:H,footer:(0,s.jsx)(rD,{documentPanelPortalElement:O,setFooterElement:D,setActionsBoxElement:L})})})})}),(0,s.jsx)(tK,{})]})})]}):(0,s.jsx)(rR,{currentMinWidth:G,documentType:i,minWidth:Q,paneKey:v,value:S})}let rO=(e,t)=>{let n,i,r,l,s=(0,o.c)(11),a=(0,h.FyK)(),[d,u]=(0,c.useState)(null),[p,m]=(0,c.useState)(!1);s[0]!==e||s[1]!==t?(n={documentId:e,documentType:t},s[0]=e,s[1]=t,s[2]=n):n=s[2];let f=(0,h.Az$)(n),x=(0,h.SfM)(f,rH);return s[3]!==e||s[4]!==a||s[5]!==x?(i=()=>{x&&e?(m(!0),a.getDocumentAtRevision(e,x).then(e=>{u(e||null),m(!1)}).catch(()=>{u(null),m(!1)})):(u(null),m(!1))},r=[e,x,a],s[3]=e,s[4]=a,s[5]=x,s[6]=i,s[7]=r):(i=s[6],r=s[7]),(0,c.useEffect)(i,r),s[8]!==d||s[9]!==p?(l={lastRevisionDocument:d,loading:p},s[8]=d,s[9]=p,s[10]=l):l=s[10],l};function rH(e){return e.lastNonDeletedRevId}let rV=(0,em.g_)({name:"DocumentURLCopied",version:1,description:"User copied document URL to clipboard"}),rN=(0,em.g_)({name:"InlineChangesSwitchedOn",version:1,description:"User switched on display of inline changes"}),rZ=(0,em.g_)({name:"InlineChangesSwitchedOff",version:1,description:"User switched off display of inline changes"});function rF(e){let t=(0,h.u4i)(e)&&"string"==typeof e.message?e.message:"Unknown error";throw Error(`An error was thrown while trying to get your preview url: ${t}`)}let rK=(0,c.memo)(e=>{let{children:t,index:n,pane:i,paneKey:l,onFocusPath:a,forcedVersion:p,historyStore:f}=e,{store:x,error:g,ready:b,revisionDocument:y,onOlderRevision:j,sinceDocument:w,isPristine:S,revisionId:k,lastNonDeletedRevId:C}=f,I=(0,h.I07)(),{setDocumentMeta:E}=(0,h.e8q)(),{document:{actions:T,badges:P,unstable_fieldActions:D,unstable_languageFilter:$,drafts:{enabled:B}}}=(0,h.For)(),Y=(0,ec.Jr)(),L=(0,_.rd)(),O=ny(),H=O.setParams,{push:V}=(0,d.dj)(),{options:N,menuItemGroups:F=tH,title:K=null,views:W=[]}=i,G=(0,h.$6H)(N),Q=G.id,q=(0,m.IM)(Q),X=N.type,ee=(0,h.$6H)(O.params)||tL,{buildStudioUrl:et}=(0,h.HuN)(),en=(0,h.QO2)(),{document:{drafts:{enabled:ei}},beta:er}=(0,h.hA9)(),el=(0,c.useMemo)(()=>er?.form?.enhancedObjectDialog?.enabled,[er]),{selectedReleaseId:eo,selectedPerspectiveName:ea}=(0,c.useMemo)(()=>p||{selectedPerspectiveName:en.selectedPerspectiveName,selectedReleaseId:en.selectedReleaseId},[p,en.selectedPerspectiveName,en.selectedReleaseId]),ed=eD(),eu=(e=>{var t;let n,i,r,l,s,a,d,c,u=(0,o.c)(13),{paneOptions:p,documentType:m,documentId:f,params:x}=e,g=(0,h.bgA)(),b=ny(),y=(0,h.$6H)(b.payload);u[0]!==m||u[1]!==p.template||u[2]!==p.templateParameters||u[3]!==y||u[4]!==x.template||u[5]!==g?(r=(t={documentType:m,templateName:p.template,templateParams:p.templateParameters,panePayload:y,urlTemplate:x.template}).panePayload||{},l=t.templateName,t.urlTemplate&&l&&l!==t.urlTemplate&&console.warn(`Conflicting templates: URL says "${t.urlTemplate}", structure node says "${l}". Using "${l}".`),s=l||t.urlTemplate,a=g.filter(e=>e.schemaType===t.documentType),d={...t.templateParams,..."object"==typeof r&&r||{}},c=s,s||1!==a.length||(c=a[0].id),n={templateName:c,templateParams:d},u[0]=m,u[1]=p.template,u[2]=p.templateParameters,u[3]=y,u[4]=x.template,u[5]=g,u[6]=n):n=u[6];let{templateName:j,templateParams:v}=n;u[7]!==f||u[8]!==m||u[9]!==x.version||u[10]!==j||u[11]!==v?(i={documentId:f,documentType:m,templateName:j,templateParams:v,version:x.version},u[7]=f,u[8]=m,u[9]=x.version,u[10]=j,u[11]=v,u[12]=i):i=u[12];let _=(0,h.nfZ)(i);return(0,h.$6H)(_)})({paneOptions:G,documentId:q,documentType:X,params:ee}),ep=eu.loading,{changesOpen:em,currentInspector:eh,inspectors:ef,closeInspector:ex,openInspector:eg,handleHistoryClose
419:eb,handleHistoryOpen:ey,handleInspectorAction:ej,inspectOpen:ev,handleLegacyInspectClose:e_}=function({documentId:e,documentType:t,params:n,setParams:i}){let{features:r}=tY(),l=(0,h.For)().document.inspectors,s=(0,c.useMemo)(()=>l({documentId:e,documentType:t}),[e,t,l]),[o,a]=(0,c.useState)(()=>n.inspect||null),d=(0,c.useRef)(n.inspect);(0,c.useEffect)(()=>{d.current!==n.inspect&&(d.current=n.inspect,a(n.inspect||null))},[n.inspect]);let u=(0,c.useMemo)(()=>s?.find(e=>e.name===o),[s,o]),p=(0,c.useMemo)(()=>s.find(e=>e.name===tV),[s]),m=u?.name===tV,f=(0,c.useCallback)(e=>{let t=e&&s.find(t=>t.name===e);if(e&&!t)return void console.warn(`No inspector named "${e}"`);if(u){if(t){let e=t.onClose?.({params:n})??{params:n};a(null),d.current=void 0,i({...e.params,inspect:void 0});return}if(u){let e=u.onClose?.({params:n})??{params:n};a(null),d.current=void 0,i({...e.params,inspect:void 0})}}},[u,s,n,i]),x=(0,c.useCallback)((e,t)=>{let r=s.find(t=>t.name===e);if(!r)return void console.warn(`No inspector named "${e}"`);if(u?.name===r.name)return void i({...n,...t,inspect:r.name});let l=n;u&&(l=(r.onClose?.({params:l})??{params:l}).params);let o=r.onOpen?.({params:l})??{params:l};a(r.name),d.current=r.name,i({...o.params,...t,inspect:r.name})},[u,s,n,i]),g=(0,c.useCallback)(()=>{p&&f(p.name)},[f,p]),b=(0,c.useCallback)(()=>{r.reviewChanges&&p&&x(p.name,{changesInspectorTab:"review"})},[r.reviewChanges,x,p]),y="on"===n.inspect,j=(0,c.useCallback)((e=!y)=>{i(e?{...n,inspect:"on"}:{...n,inspect:void 0})},[y,n,i]),v=(0,c.useCallback)(()=>j(!1),[j]),_=(0,c.useCallback)(e=>{if("inspect"===e.action)return j(!0),!0;if("string"!=typeof e.action)return!1;let t=e.action.slice(tO.length),n=s.find(e=>e.name===t);return!!n&&(n.name===o?f(n.name):x(n.name),!0)},[f,o,s,x,j]);return{changesOpen:m,currentInspector:u,inspectors:s,closeInspector:f,openInspector:x,handleHistoryClose:g,handleHistoryOpen:b,handleInspectorAction:_,handleLegacyInspectClose:v,inspectOpen:y}}({documentId:q,documentType:X,params:ee,setParams:H}),[ew,eS]=(0,c.useState)(!1),{lastRevisionDocument:ek}=rO(q,X),eC=(0,c.useCallback)(e=>!!b&&!e?.draft&&!e?.published&&!e?.version&&!S,[b,S]),eI=(0,c.useCallback)(e=>{let t=(0,h.spc)(e);return em?w||t:t||null},[em,w]),eE=I.get(X),ez=(0,c.useCallback)(e=>{let t=eC(e);return!!ee.rev||ew||t||!(0,h.CW3)({selectedPerspective:en.selectedPerspective,isDraftModelEnabled:ei,schemaType:eE}).result},[eC,ew,ei,ee.rev,en.selectedPerspective,eE]),eT=(0,c.useCallback)(e=>j?y||{_id:e._id,_type:e._type}:!e._createdAt&&!e._updatedAt&&C&&ek?ek:e,[j,y,C,ek]),{editState:eA,upstreamEditState:eP,hasUpstreamVersion:eR,connectionState:eM,focusPath:e$,onChange:eB,validation:eY,ready:eL,value:eO,formState:eH,permissions:eV,onPathOpen:eN,isPermissionsLoading:eZ,formStateRef:eF,onProgrammaticFocus:eK,collapsedFieldSets:eW,collapsedPaths:eJ,onBlur:eU,onFocus:eG,onSetActiveFieldGroup:eQ,onSetCollapsedPath:eq,onSetCollapsedFieldSet:eX,openPath:e0}=(0,h.Lay)({changesOpen:em,documentType:X,documentId:q,initialValue:eu,comparisonValue:eI,releaseId:eo,selectedPerspectiveName:ea,initialFocusPath:ee.path?(0,es.sH)(ee.path):h.Mlv,readOnly:ez,onFocusPath:a,getFormDocumentValue:eT,displayInlineChanges:"true"===L.stickyParams.displayInlineChanges}),{data:e1=[]}=(0,h.K0D)(),e2=(0,c.useCallback)(()=>{let e;switch(!0){case!!ee.rev:e="revision";break;case eo&&(0,m.A_)(eO._id):{let t=e1.find(e=>(0,h._hI)(e._id)===eo);e=t&&(0,h._9c)(t)?"scheduled-draft":"version";break}case"published"===ea:e="published";break;case B:e="draft";break;default:e="published"}return e},[ee.rev,eo,eO._id,ea,B,e1]),e3=(0,c.useMemo)(()=>e2(),[e2]),e4=(0,c.useMemo)(()=>({schemaType:X,documentId:q,versionType:e3,releaseId:eo}),[X,q,e3,eo]),e5=(0,c.useMemo)(()=>T(e4),[T,e4]),e6=(0,c.useCallback)(e=>{if(eN(e),el){let t=(0,h.ujC)(e);ee.path!==t&&H({...ee,path:t})}},[eN,ee,H,el]),e7=(0,c.useMemo)(()=>P({schemaType:X,documentId:q}),[P,q,X]),e8=(0,c.useMemo)(()=>$({schemaType:X,documentId:q}),[q,X,$]),e9=(0,h.$6H)(W),te=ee.view||e9[0]&&e9[0].id||null,tt=function(e){let t,n,i,r,l=(0,o.c)(6),{resolveProductionUrl:s}=(0,h.For)().document;l[0]===Symbol.for("react.memo_cache_sentinel")?(t=new J.t(void 0),l[0]=t):t=l[0];let a=t;return l[1]!==e?(n=()=>{a.next(e)},i=[a,e],l[1]=e,l[2]=n,l[3]=i):(n=l[2],i=l[3]),(0,c.useEffect)(n,i),l[4]!==s?(r=a.asObservable().pipe((0,R.F)(),(0,A.B)(500),(0,M.n)(e=>(0,h.u4i)(e)&&"string"==typeof e._id&&"string"==typeof e._type?(0,U.H)(s({document:e})):(0,Z.of)(void 0)),(0,R.F)(),(0,z.W)(rF)),l[4]=s,l[5]=r):r=l[5],(0,v.J)(r)}(eO),{t:tn}=(0,h.Bdt)(r.Z7),ti=(0,c.useMemo)(()=>eE?D({documentId:q,documentType:X,schemaType:eE}):[],[q,X,D,eE]),tr=eL&&(!ee.rev||b||!!g),tl=(0,c.useMemo)(()=>eT(eO),[eT,eO]),{previousId:ts}=(0,h.aSp)({strict:!0,displayed:tl,documentId:q,editState:eA}),to=(0,c.useCallback)((e,t)=>{H({...ee,since:e,rev:t||void 0})},[ee,H]),ta=(0,c.useCallback)(()=>O.closeCurrent(),[O]),td=(0,c.useCallback)(()=>O.duplicateCurrent(),[O]),tc=(0,c.useCallback)(()=>{let e="true"!==L.stickyParams.displayInlineChanges;Y.log(e?rN:rZ),L.navigate({stickyParams:{displayInlineChanges:String(e)}})},[L,Y]),tu=(0,c.useCallback)(async e=>{if("production-preview"===e.action&&tt)return window.open(tt),!0;if("copy-document-url"===e.action&&navigator){Y.log(rV);let e=et({coreUi:e=>`${e}/intent/edit/id=${q};type=${X}`});
419return await navigator.clipboard.writeText(e),V({id:"copy-document-url",status:"info",title:tn("panes.document-operation-results.operation-success_copy-url")}),!0}return"reviewChanges"===e.action?(ey(),!0):(("inspect"===e.action||"string"==typeof e.action&&e.action.startsWith(tO))&&ej(e),"compareVersions"===e.action&&"u">typeof ts?(ed.navigateDiffView({mode:"version",previousDocument:{type:X,id:ts},nextDocument:{type:X,id:eO._id}}),!0):"toggleInlineChanges"===e.action&&(tc(),!0))},[tt,ts,Y,et,V,tn,q,X,ey,ej,ed,eO._id,tc]);(0,c.useEffect)(()=>{E({documentId:q,documentType:X,schemaType:eE,onChange:eB})},[q,X,eE,eB,E]);let tp=(0,c.useMemo)(()=>eI(eP),[eP,eI]),tm=(0,c.useMemo)(()=>eC(eA),[eA,eC]),th=j&&!y,tf=(0,c.useMemo)(()=>eA.version&&(0,h.YW1)(eA.version)?eA.published:tl,[eA.version,eA.published,tl]),tx=(0,c.useMemo)(()=>({actions:e5,activeViewId:te,badges:e7,changesOpen:em,closeInspector:ex,collapsedFieldSets:eW,collapsedPaths:eJ,compareValue:tp,connectionState:eM,displayed:tf,documentId:q,documentIdRaw:Q,documentType:X,editState:eA,fieldActions:ti,focusPath:e$,inspector:eh||null,inspectors:ef,onBlur:eU,onChange:eB,onFocus:eG,onPathOpen:e6,onHistoryClose:eb,onHistoryOpen:ey,onInspectClose:e_,onMenuAction:tu,onPaneClose:ta,onPaneSplit:td,onSetActiveFieldGroup:eQ,onSetCollapsedPath:eq,onSetCollapsedFieldSet:eX,openInspector:eg,openPath:e0,index:n,inspectOpen:ev,validation:eY,menuItemGroups:F||[],paneKey:l,previewUrl:tt,ready:tr,schemaType:eE,hasUpstreamVersion:eR,isPermissionsLoading:eZ,isInitialValueLoading:ep,permissions:eV,setTimelineRange:to,setIsDeleting:eS,isDeleting:ew,isDeleted:tm,timelineError:g,timelineStore:x,title:K,value:eO,selectedReleaseId:eo,views:e9,formState:eH,unstable_languageFilter:e8,revisionId:k,revisionNotFound:th,lastNonDeletedRevId:C,lastRevisionDocument:ek}),[e5,te,e7,em,ex,eW,eJ,tp,eM,tf,q,Q,X,eA,ti,e$,eh,ef,eU,eB,eG,e6,eb,ey,e_,tu,ta,td,eQ,eq,eX,eg,e0,n,ev,eY,F,l,tt,tr,eE,eR,eZ,ep,eV,to,ew,tm,g,x,K,eO,eo,e9,eH,e8,k,th,C,ek]),tg=(0,c.useRef)(void 0);return(0,c.useEffect)(()=>{if(tr&&ee.path){let{path:e,...t}=ee;e!==tg.current&&eK((0,es.Y7)(eF.current?.value,(0,es.sH)(e))),el||O.setParams(t)}tg.current=ee.path},[eF,eK,O,ee,tr,el]),(0,s.jsx)(u.Fi.Provider,{value:tx,children:t})});rK.displayName="Memo(DocumentPaneProvider)";let rW=e=>{let t,n,i,r,l,a,d,c=(0,o.c)(37),{params:u}=ny(),p=void 0===u?tL:u,f=r8(e.pane.options,p),x=(0,h.I07)(),g=f.type,b=!!x.get(f.type)?.liveEdit,{selectedPerspectiveName:y,selectedReleaseId:j,selectedPerspective:v}=(0,h.QO2)(),{data:_}=(0,h.gJZ)();c[0]!==f.id?(t=(0,m.IM)(f.id),c[0]=f.id,c[1]=t):t=c[1];let w=(0,h.zX2)(t,g,"default",j),S=b&&"drafts"===v&&!w?.draft,{rev:k,since:C}=p,I=p.historyVersion;e:{if(S){let e;c[2]!==f.id?(e=(0,m.IM)(f.id),c[2]=f.id,c[3]=e):e=c[3],n=e;break e}if(I&&_.some(e=>(0,h._hI)(e._id)===I)){let e;c[4]!==I||c[5]!==f.id?(e=(0,m.ct)(f.id,I),c[4]=I,c[5]=f.id,c[6]=e):e=c[6],n=e;break e}if(typeof y>"u"){let e;c[7]!==f.id?(e=(0,m.T4)(f.id),c[7]=f.id,c[8]=e):e=c[8],n=e;break e}if("published"===y){let e;c[9]!==f.id?(e=(0,m.IM)(f.id),c[9]=f.id,c[10]=e):e=c[10],n=e;break e}if(j){let e;c[11]!==f.id||c[12]!==y?(e=(0,m.ct)(f.id,y),c[11]=f.id,c[12]=y,c[13]=e):e=c[13],n=e;break e}n=f.id}let E=n;c[14]!==E||c[15]!==f.type||c[16]!==k||c[17]!==C?(i={documentId:E,documentType:f.type,rev:k,since:C},c[14]=E,c[15]=f.type,c[16]=k,c[17]=C,c[18]=i):i=c[18];let z=(0,h.Sjd)(i),T=z.error,A=z.revision?.revisionId||null,P=!!(k&&!z.revision?.loading),R=z.revision?.document||null,M=z.sinceRevision?.document||null,D=!z.loading,$=0===z.events.length;c[19]!==z.events?(r=z.events.find(rJ)?.id||null,c[19]=z.events,c[20]=r):r=c[20],c[21]!==z.error||c[22]!==$||c[23]!==r||c[24]!==A||c[25]!==P||c[26]!==R||c[27]!==M||c[28]!==D?(l={error:T,revisionId:A,onOlderRevision:P,revisionDocument:R,sinceDocument:M,ready:D,isPristine:$,lastNonDeletedRevId:r},c[21]=z.error,c[22]=$,c[23]=r,c[24]=A,c[25]=P,c[26]=R,c[27]=M,c[28]=D,c[29]=l):l=c[29];let B=l;return c[30]!==B||c[31]!==I||c[32]!==e?(a=I?(0,s.jsx)(h.g19,{selectedPerspectiveName:I,excludedPerspectives:h.Mlv,children:(0,s.jsx)(rK,{...e,historyStore:B})}):(0,s.jsx)(rK,{...e,historyStore:B}),c[30]=B,c[31]=I,c[32]=e,c[33]=a):a=c[33],c[34]!==a||c[35]!==z?(d=(0,s.jsx)(h.tGd,{value:z,children:a}),c[34]=a,c[35]=z,c[36]=d):d=c[36],d};function rJ(e){return!(0,h.GDb)(e)&&!(0,h.zOx)(e)}let rU=e=>{let t,n,i,r,l=(0,o.c)(20),{pane:a}=e,d=ny(),u=r8(a.options,d.params),p=d.params||tL,[f,x]=(0,c.useState)(null);l[0]!==u.id?(t=(0,m.IM)(u.id),l[0]=u.id,l[1]=t):t=l[1],l[2]!==u.type||l[3]!==p.rev||l[4]!==p.since||l[5]!==t?(n={documentId:t,documentType:u.type,onError:x,rev:p.rev,since:p.since},l[2]=u.type,l[3]=p.rev,l[4]=p.since,l[5]=t,l[6]=n):n=l[6];let g=(0,h.Az$)(n),b=(0,h.SfM)(g,rG),y=(0,h.SfM)(g,rQ),j=(0,h.SfM)(g,rq),v=(0,h.SfM)(g,rX),_=(0,h.SfM)(g,r0),w=(0,h.SfM)(g,r1),S=(0,h.SfM)(g,r2),k=y?.id||null,C=!!w;l[7]!==S||l[8]!==b||l[9]!==g||l[10]!==k||l[11]!==v||l[12]!==j||l[13]!==C||l[14]!==f||l[15]!==_?
419(i={store:g,error:f,revisionId:k,onOlderRevision:b,revisionDocument:v,sinceDocument:j,ready:_,isPristine:C,lastNonDeletedRevId:S},l[7]=S,l[8]=b,l[9]=g,l[10]=k,l[11]=v,l[12]=j,l[13]=C,l[14]=f,l[15]=_,l[16]=i):i=l[16];let I=i;return l[17]!==I||l[18]!==e?(r=(0,s.jsx)(rK,{...e,historyStore:I}),l[17]=I,l[18]=e,l[19]=r):r=l[19],r};function rG(e){return e.onOlderRevision}function rQ(e){return e.revTime}function rq(e){return e.sinceAttributes}function rX(e){return e.timelineDisplayed}function r0(e){return e.timelineReady}function r1(e){return e.isPristine}function r2(e){return e.lastNonDeletedRevId}function r3(e){let t=(0,o.c)(4),{children:n}=e,i=ny(),{excludedPerspectives:r}=(0,h.QO2)(),{scheduledDraft:l}=i.params;if(l){let e;return t[0]!==n||t[1]!==r||t[2]!==l?(e=(0,s.jsx)(h.g19,{selectedPerspectiveName:l,excludedPerspectives:r,children:n}),t[0]=n,t[1]=r,t[2]=l,t[3]=e):e=t[3],e}return n}let r4=(0,c.memo)(e=>{let t,n,i,r=(0,o.c)(9),l=(0,h.For)(),{setParams:a,params:d}=ny();r[0]!==d||r[1]!==a?(t=e=>{a({...d,scheduledDraft:e},{perspective:""})},r[0]=d,r[1]=a,r[2]=t):t=r[2];let c=t;return r[3]!==e||r[4]!==l.beta?.eventsAPI?.documents?(n=l.beta?.eventsAPI?.documents?(0,s.jsx)(rW,{...e}):(0,s.jsx)(rU,{...e}),r[3]=e,r[4]=l.beta?.eventsAPI?.documents,r[5]=n):n=r[5],r[6]!==c||r[7]!==n?(i=(0,s.jsx)(r3,{children:(0,s.jsx)(h.BRe,{onSetScheduledDraftPerspective:c,children:n})}),r[6]=c,r[7]=n,r[8]=i):i=r[8],i});r4.displayName="Memo(DocumentPaneProviderWrapper)";let r5=(0,c.memo)(function(e){let t,n,i=(0,o.c)(5),{name:r}=(0,h.For)(),l=e.pane.source||r;return i[0]!==e?(t=(0,s.jsx)(h.K1$,{children:(0,s.jsx)(r6,{...e})}),i[0]=e,i[1]=t):t=i[1],i[2]!==l||i[3]!==t?(n=(0,s.jsx)(h.NeO,{name:l,children:t}),i[2]=l,i[3]=t,i[4]=n):n=i[4],n});function r6(e){var t,n,i;let l,d,u,p,m,f,x,g,b,y,j,v,_=(0,o.c)(57),{pane:w,paneKey:S}=e,{resolveNewDocumentOptions:k}=(0,h.For)().document,{selectedPerspectiveName:C}=(0,h.QO2)(),I=ny(),E=r8(w.options,I.params),{documentType:z,isLoaded:T}=(0,h.fRg)(E.id,E.type);!function(){let e,t,n,i,r,l=(0,o.c)(10),{params:s,setParams:a}=ny(),d=void 0===s?tL:s,{selectedPerspectiveName:u}=(0,h.QO2)(),p=(0,c.useRef)(!1);l[0]!==d||l[1]!==a?(e=e=>{["since","historyVersion","rev","preserveRev"].some(e=>d[e])&&a({...d,rev:"true"===d.preserveRev?d.rev:void 0,preserveRev:void 0,since:void 0,historyVersion:void 0})},l[0]=d,l[1]=a,l[2]=e):e=l[2];let m=(0,eS.J)(e);l[3]!==u||l[4]!==m?(t=()=>{p.current&&m(u)},l[3]=u,l[4]=m,l[5]=t):t=l[5],l[6]!==u?(n=[u],l[6]=u,l[7]=n):n=l[7],(0,c.useEffect)(t,n),l[8]===Symbol.for("react.memo_cache_sentinel")?(i=()=>(p.current=!0,()=>{p.current=!1}),r=[],l[8]=i,l[9]=r):(i=l[8],r=l[9]),(0,c.useEffect)(i,r)}();let A=((v=(0,o.c)(1))[0]===Symbol.for("react.memo_cache_sentinel")?(j={pick:eW,defaultComponent:rL},v[0]=j):j=v[0],(0,h.A1m)(j));_[0]!==E.id||_[1]!==E.type||_[2]!==k?(l=k({type:"document",documentId:E.id,schemaType:E.type}),_[0]=E.id,_[1]=E.type,_[2]=k,_[3]=l):l=_[3];let P=l;_[4]!==P?(d={templateItems:P},_[4]=P,_[5]=d):d=_[5];let[R,M]=(0,h.CzS)(d),D=T&&!M;_[6]!==z||_[7]!==D||_[8]!==E||_[9]!==e?(u=D&&z&&E.type!==z?(t=e,n=E,i=z,{...t,pane:{...t.pane,options:{...n,type:i}}}):e,_[6]=z,_[7]=D,_[8]=E,_[9]=e,_[10]=u):u=_[10];let $=u,{ReferenceChildLink:B,handleEditReference:Y,groupIndex:L,routerPanesState:O}=I;_[11]!==L||_[12]!==O?(p=O[L+1]?.[0].params||{},_[11]=L,_[12]=O,_[13]=p):p=_[13];let H=p,V=O.length,{parentRefPath:N}=H;_[14]!==L||_[15]!==N||_[16]!==V?(m=N?{path:(0,es.sH)(N),state:L>=V-1?"none":L>=V-2?"selected":"pressed"}:{path:[],state:"none"},_[14]=L,_[15]=N,_[16]=V,_[17]=m):m=_[17];let Z=m,{t:F}=(0,h.Bdt)(r.Z7);if("*"===E.type&&!D){let e,t;return _[18]!==F?(e=F("panes.document-pane.document-not-found.loading"),_[18]=F,_[19]=e):e=_[19],_[20]!==S||_[21]!==e?(t=(0,s.jsx)(tM,{flex:2.5,minWidth:320,paneKey:S,title:e}),_[20]=S,_[21]=e,_[22]=t):t=_[22],t}if(!z){let e,t,n,i,r;return _[23]!==F?(e=F("panes.document-pane.document-not-found.title"),_[23]=F,_[24]=e):e=_[24],_[25]!==E.id?(t={id:E.id},_[25]=E.id,_[26]=t):t=_[26],_[27]===Symbol.for("react.memo_cache_sentinel")?(n={Code:r7},_[27]=n):n=_[27],_[28]!==F||_[29]!==t?(i=(0,s.jsx)(a.BJ,{space:4,children:(0,s.jsx)(a.EY,{as:"p",children:(0,s.jsx)(h.HTc,{t:F,i18nKey:"panes.document-pane.document-not-found.text",values:t,components:n}
419)})}),_[28]=F,_[29]=t,_[30]=i):i=_[30],_[31]!==S||_[32]!==e||_[33]!==i?(r=(0,s.jsx)(tT,{flex:2.5,minWidth:320,paneKey:S,title:e,children:i}),_[31]=S,_[32]=e,_[33]=i,_[34]=r):r=_[34],r}let K=`${z}-${E.id}-${C||""}`;return _[35]!==A||_[36]!==E.id||_[37]!==E.type?(f=(0,s.jsx)(A,{documentId:E.id,documentType:E.type}),_[35]=A,_[36]=E.id,_[37]=E.type,_[38]=f):f=_[38],_[39]!==E.id||_[40]!==E.type||_[41]!==f?(x=(0,s.jsx)(t$,{documentId:E.id,documentType:E.type,children:f}),_[39]=E.id,_[40]=E.type,_[41]=f,_[42]=x):x=_[42],_[43]!==E.id||_[44]!==E.type||_[45]!==x?(g=(0,s.jsx)(e4,{documentId:E.id,documentType:E.type,children:x}),_[43]=E.id,_[44]=E.type,_[45]=x,_[46]=g):g=_[46],_[47]!==B||_[48]!==Z||_[49]!==Y||_[50]!==g||_[51]!==R?(b=(0,s.jsx)(h.NO5,{EditReferenceLinkComponent:B,onEditReference:Y,initialValueTemplateItems:R,activePath:Z,children:g}),_[47]=B,_[48]=Z,_[49]=Y,_[50]=g,_[51]=R,_[52]=b):b=_[52],_[53]!==$||_[54]!==K||_[55]!==b?(y=(0,s.jsx)(r4,{...$,children:b},K),_[53]=$,_[54]=K,_[55]=b,_[56]=y):y=_[56],y}function r7(e){let{children:t}=e;return(0,s.jsx)("code",{children:t})}function r8(e,t){let n,i,r=(0,o.c)(8);r[0]!==t?(n=void 0===t?{}:t,r[0]=t,r[1]=n):n=r[1];let l=n,s=(0,h.bgA)();e:{let t,n;if(e.type&&"*"!==e.type){i=e;break e}let o=e.template||l.template;r[2]!==o||r[3]!==s?(t=o?s.find(e=>e.id===o):void 0,r[2]=o,r[3]=s,r[4]=t):t=r[4];let a=t?.schemaType;if(!a){i=e;break e}r[5]!==a||r[6]!==e?(n={...e,type:a},r[5]=a,r[6]=e,r[7]=n):n=r[7],i=n}return i}let r9=(0,c.forwardRef)(function(e,t){let n,i,r,l=(0,o.c)(9),{routerPanesState:a,groupIndex:d}=(0,c.useContext)(u.l4);l[0]!==d||l[1]!==a?(n=a.slice(0,d),l[0]=d,l[1]=a,l[2]=n):n=l[2];let p=n;l[3]!==p?(i={panes:p},l[3]=p,l[4]=i):i=l[4];let m=i;return l[5]!==e||l[6]!==t||l[7]!==m?(r=(0,s.jsx)(_.s8,{...e,ref:t,state:m}),l[5]=e,l[6]=t,l[7]=m,l[8]=r):r=l[8],r}),le=(0,c.forwardRef)(function(e,t){let n,i,r,l,a,d,p=(0,o.c)(19);p[0]!==e?({childId:n,childPayload:r,childParameters:i,...l}=e,p[0]=e,p[1]=n,p[2]=i,p[3]=r,p[4]=l):(n=p[1],i=p[2],r=p[3],l=p[4]);let{routerPanesState:m,groupIndex:h}=(0,c.useContext)(u.l4);if(p[5]!==n||p[6]!==i||p[7]!==r||p[8]!==h||p[9]!==m){let e;p[11]!==n||p[12]!==i||p[13]!==r?(e=[{id:n,params:i,payload:r}],p[11]=n,p[12]=i,p[13]=r,p[14]=e):e=p[14],a={panes:[...m.slice(0,h+1),e]},p[5]=n,p[6]=i,p[7]=r,p[8]=h,p[9]=m,p[10]=a}else a=p[10];return p[15]!==t||p[16]!==l||p[17]!==a?(d=(0,s.jsx)(_.s8,{...l,ref:t,state:a}),p[15]=t,p[16]=l,p[17]=a,p[18]=d):d=p[18],d}),lt=(0,c.forwardRef)(function(e,t){let n,i,r,l,a,d,p,m=(0,o.c)(20),{routerPanesState:f,groupIndex:x,siblingIndex:g}=(0,c.useContext)(u.l4);m[0]!==e?({params:n,payload:i,...r}=e,m[0]=e,m[1]=n,m[2]=i,m[3]=r):(n=m[1],i=m[2],r=m[3]);let b=(0,h.$6H)(n),y=(0,h.$6H)(i),j=f[x],v=j[g],w=b??v.params,S=y??v.payload;m[4]!==v||m[5]!==w||m[6]!==S?(l={...v,params:w,payload:S},m[4]=v,m[5]=w,m[6]=S,m[7]=l):l=m[7];let k=l;m[8]!==j||m[9]!==k||m[10]!==g?(a=[...j.slice(0,g),k,...j.slice(g+1)],m[8]=j,m[9]=k,m[10]=g,m[11]=a):a=m[11];let C=a;m[12]!==f||m[13]!==x||m[14]!==C?(d={panes:[...f.slice(0,x),C,...f.slice(x+1)]},m[12]=f,m[13]=x,m[14]=C,m[15]=d):d=m[15];let I=d;return m[16]!==I||m[17]!==t||m[18]!==r?(p=(0,s.jsx)(_.s8,{ref:t,...r,state:I}),m[16]=I,m[17]=t,m[18]=r,m[19]=p):p=m[19],p}),ln=(0,c.forwardRef)(function(e,t){let n,i,r,l,a,d,c,u,p,m,h=(0,o.c)(22);h[0]!==e?({documentId:i,documentType:r,parentRefPath:l,children:n,template:d,...a}=e,h[0]=e,h[1]=n,h[2]=i,h[3]=r,h[4]=l,h[5]=a,h[6]=d):(n=h[1],i=h[2],r=h[3],l=h[4],a=h[5],d=h[6]);let f=d?.params;return h[7]!==l?(c=(0,es.dI)(l),h[7]=l,h[8]=c):c=h[8],h[9]!==d?(u=d&&{template:d?.id},h[9]=d,h[10]=u):u=h[10],h[11]!==r||h[12]!==c||h[13]!==u?(p={type:r,parentRefPath:c,...u},h[11]=r,h[12]=c,h[13]=u,h[14]=p):p=h[14],h[15]!==n||h[16]!==i||h[17]!==t||h[18]!==a||h[19]!==f||h[20]!==p?(m=(0,s.jsx)(le,{...a,ref:t,childId:i,childPayload:f,childParameters:p,children:n}),h[15]=n,h[16]=i,h[17]=t,h[18]=a,h[19]=f,h[20]=p,h[21]=m):m=h[21],m}),li=[];function lr(e){let t,n,i,r,l,a,d,c,p,m,h,f,x,g=(0,o.c)(60),{children:b,flatIndex:y,index:j,params:v,payload:S,siblingIndex:k}=e,{navigate:C,navigateIntent:I,resolvePathFromState:E}=(0,_.rd)(),z=(0,_.ks)(),{panes:T,expand:A}=e5(),P=z?.panes||li,R=T?.[T.length-2],M=j-1;g[0]!==M||g[1]!==P||g[2]!==z||g[3]!==k?(t=e=>{let t=P[M]||[],n=t[k],i=e(t,n),r=[...P.slice(0,M),i,...P.slice(M+1)];return{...z,panes:r}},g[0]=M,g[1]=P,g[2]=z,g[3]=k,g[4]=t):t=g[4];let D=t;g[5]!==D||g[6]!==C?(n=(e,t)=>{let n=D(e);return setTimeout(()=>C(n,t?{stickyParams:t}:void 0),0),n},g[5]=D,g[6]=C,g[7]=n):n=g[7];let $=n;g[8]!==D||g[9]!==E||g[10]!==k?(i=e=>E(D((t,n)=>[...t.slice(0,k),{...n,params:e},...t.slice(k+1)])),g[8]=D,g[9]=E,g[10]=k,g[11]=i):i=g[11];let B=i;g[12]!==$||g[13]!==k?(r=e=>
419{$((t,n)=>[...t.slice(0,k),{...n,payload:e},...t.slice(k+1)])},g[12]=$,g[13]=k,g[14]=r):r=g[14];let Y=r;g[15]!==$||g[16]!==k?(l=(e,t)=>{$((t,n)=>[...t.slice(0,k),{...n,params:e},...t.slice(k+1)],t)},g[15]=$,g[16]=k,g[17]=l):l=g[17];let L=l;g[18]!==M||g[19]!==C||g[20]!==P?(a=e=>{let{id:t,parentRefPath:n,type:i,template:r,version:l}=e;C({panes:[...P.slice(0,M+1),[{id:t,params:{template:r.id,parentRefPath:(0,es.dI)(n),type:i,version:l},payload:r.params}]]})},g[18]=M,g[19]=C,g[20]=P,g[21]=a):a=g[21];let O=a,H=!!P[M]&&P[M].length>1,V=P[M]?P[M].length:0,N=y?r9:void 0;g[22]!==$?(c=e=>{let t=void 0===e?{}:e;$(()=>[{id:t.id||"",payload:t.payload,params:t.params||{}}])},d=()=>{$(ll)},g[22]=$,g[23]=d,g[24]=c):(d=g[23],c=g[24]),g[25]!==A||g[26]!==M||g[27]!==R||g[28]!==C||g[29]!==P?(p=e=>{(void 0===e||e)&&R&&A(R.element),C({panes:P.slice(0,M)})},g[25]=A,g[26]=M,g[27]=R,g[28]=C,g[29]=P,g[30]=p):p=g[30],g[31]!==$||g[32]!==k?(m=e=>{$((t,n)=>{let i={...n,payload:e?.payload||n.payload,params:e?.params||n.params};return[...t.slice(0,k),i,...t.slice(k)]})},g[31]=$,g[32]=k,g[33]=m):m=g[33],g[34]!==v||g[35]!==L?(h=e=>{let t=w(v,"view");return L(e?{...t,view:e}:t)},g[34]=v,g[35]=L,g[36]=h):h=g[36],g[37]!==B||g[38]!==y||g[39]!==M||g[40]!==O||g[41]!==I||g[42]!==v||g[43]!==S||g[44]!==P||g[45]!==L||g[46]!==Y||g[47]!==k||g[48]!==d||g[49]!==p||g[50]!==m||g[51]!==h||g[52]!==H||g[53]!==V||g[54]!==N||g[55]!==c?(f={index:y,groupIndex:M,siblingIndex:k,payload:S,params:v,hasGroupSiblings:H,groupLength:V,routerPanesState:P,ChildLink:le,BackLink:N,ReferenceChildLink:ln,handleEditReference:O,ParameterizedLink:lt,replaceCurrent:c,closeCurrent:d,closeCurrentAndAfter:p,duplicateCurrent:m,setView:h,setParams:L,setPayload:Y,createPathWithParams:B,navigateIntent:I},g[37]=B,g[38]=y,g[39]=M,g[40]=O,g[41]=I,g[42]=v,g[43]=S,g[44]=P,g[45]=L,g[46]=Y,g[47]=k,g[48]=d,g[49]=p,g[50]=m,g[51]=h,g[52]=H,g[53]=V,g[54]=N,g[55]=c,g[56]=f):f=g[56];let Z=f;return g[57]!==b||g[58]!==Z?(x=(0,s.jsx)(u.l4.Provider,{value:Z,children:b}),g[57]=b,g[58]=Z,g[59]=x):x=g[59],x}function ll(e,t){return e.length>1?e.filter(e=>e!==t):e}function ls(e){let t,n,i,l,d,c=(0,o.c)(14),{isSelected:u,pane:p,paneKey:m}=e;c[0]!==p?(t=(0,h.u4i)(p)&&p.type||null,c[0]=p,c[1]=t):t=c[1];let f=t,{t:x}=(0,h.Bdt)(r.Z7);return c[2]!==x?(n=x("panes.unknown-pane-type.title"),c[2]=x,c[3]=n):n=c[3],c[4]!==n?(i=(0,s.jsx)(tj,{title:n}),c[4]=n,c[5]=i):i=c[5],c[6]!==x||c[7]!==f?(l=(0,s.jsx)(tn,{children:(0,s.jsx)(a.az,{padding:4,children:"string"==typeof f?(0,s.jsx)(a.EY,{as:"p",muted:!0,children:(0,s.jsx)(h.HTc,{t:x,i18nKey:"panes.unknown-pane-type.unknown-type.text",values:{type:f}})}):(0,s.jsx)(a.EY,{as:"p",muted:!0,children:(0,s.jsx)(h.HTc,{t:x,i18nKey:"panes.unknown-pane-type.missing-type.text"})})})}),c[6]=x,c[7]=f,c[8]=l):l=c[8],c[9]!==u||c[10]!==m||c[11]!==i||c[12]!==l?(d=(0,s.jsxs)(e9,{id:m,selected:u,children:[i,l]}),c[9]=u,c[10]=m,c[11]=i,c[12]=l,c[13]=d):d=c[13],d}let lo={component:(0,c.lazy)(()=>n.e(6348).then(n.bind(n,76348))),document:(0,c.lazy)(()=>Promise.resolve().then(function(){return o_})),documentList:(0,c.lazy)(()=>Promise.resolve().then(function(){return ow})),list:(0,c.lazy)(()=>n.e(76).then(n.bind(n,50076)))},la=(0,c.memo)(function(e){let t,n,i,r,l=(0,o.c)(23),{active:a,childItemId:d,groupIndex:u,index:p,itemId:m,pane:h,paneKey:f,params:x,payload:g,path:b,selected:y,siblingIndex:j}=e,v=lo[h.type]||ls;l[0]!==f||l[1]!==b||l[2]!==y?(t=(0,s.jsx)(tM,{paneKey:f,path:b,selected:y}),l[0]=f,l[1]=b,l[2]=y,l[3]=t):t=l[3];let _=d||"";return l[4]!==v||l[5]!==a||l[6]!==p||l[7]!==m||l[8]!==h||l[9]!==f||l[10]!==y||l[11]!==_?(n=(0,s.jsx)(v,{childItemId:_,index:p,itemId:m,isActive:a,isSelected:y,paneKey:f,pane:h}),l[4]=v,l[5]=a,l[6]=p,l[7]=m,l[8]=h,l[9]=f,l[10]=y,l[11]=_,l[12]=n):n=l[12],l[13]!==t||l[14]!==n?(i=(0,s.jsx)(c.Suspense,{fallback:t,children:n}),l[13]=t,l[14]=n,l[15]=i):i=l[15],l[16]!==u||l[17]!==p||l[18]!==x||l[19]!==g||l[20]!==j||l[21]!==i?(r=(0,s.jsx)(lr,{flatIndex:p,index:u,params:x,payload:g,siblingIndex:j,children:i}),l[16]=u,l[17]=p,l[18]=x,l[19]=g,l[20]=j,l[21]=i,l[22]=r):r=l[22],r},({params:e={},payload:t=null,...n},{params:i={},payload:r=null,...l})=>{if(!S(e,i)||!S(t,r))return!1;for(let e of new Set([...Object.keys(n),...Object.keys(l)]))if(n[e]!==l[e])return!1;return!0});function ld(e){let t,n,i=(0,o.c)(10),{document:l}=e,a=(0,h.I07)().get(l._type),{t:d}=(0,h.Bdt)(r.Z7),{title:c}=tZ();if(!a){let e,t;return i[0]!==l._type||i[1]!==d?(e=d("doc-title.unknown-schema-type.text",{schemaType:l._type}),i[0]=l._type,i[1]=d,i[2]=e):e=i[2],i[3]!==e?(t=(0,s.jsx)("code",{children:e}),i[3]=e,i[4]=t):t=i[4],t}return i[5]!==d||i[6]!==c?(t=c||(0,s.jsx)("span",{style:{color:"var(--card-muted-fg-color)"},children:d("doc-title.fallback.text")}),i[5]=d,i[6]=c,i[7]=t):t=i[7],i[8]!==t?(n=(0,s.jsx)(s.Fragment,{children:t}),i[8]=t,i[9]=n):n=i[9],n}let lc=(0,g.I4)(a.az)`
420  margin-left: auto;
421`,lu=g.I4.details`
422  flex: none;
423
424  &[open] ${lc} {
425    transform: rotate(180deg);
426  }
427`,lp=g.I4.summary`
428  list-style: none;
429
430  &::-webkit-details-marker {
431    display: none;
432  }
433`,lm=g.I4.table`
434  width: 100%;
435  text-align: left;
436  padding: 0 ${({theme:e})=>(0,a.D0)(e.sanity.space[2])};
437  border-collapse: collapse;
438
439  th {
440    padding: ${({theme:e})=>(0,a.D0)(e.sanity.space[1])};
441  }
442
443  td {
444    padding: 0 ${({theme:e})=>(0,a.D0)(e.sanity.space[1])};
445  }
446
447  tr > *:last-child {
448    text-align: right;
449  }
450`,lh=(0,g.I4)(a.so)`
451  min-height: 33px;
452`,lf=e=>{let t,n,i,d,c,u,m=(0,o.c)(13),{t:f}=(0,h.Bdt)(r.Z7),x=e.totalCount-e.references.length;return x?(m[0]!==x||m[1]!==f?(t=f("confirm-delete-dialog.other-reference-count.title",{count:x}),m[0]=x,m[1]=f,m[2]=t):t=m[2],m[3]!==t?(n=(0,s.jsx)(a.EY,{size:1,muted:!0,children:t}),m[3]=t,m[4]=n):n=m[4],m[5]!==f?(i=f("confirm-delete-dialog.other-reference-count.tooltip"),m[5]=f,m[6]=i):i=m[6],m[7]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsx)(a.EY,{size:1,muted:!0,children:(0,s.jsx)(p.YzR,{})}),m[7]=d):d=m[7],m[8]!==i?(c=(0,s.jsx)(l.m_,{portal:!0,placement:"top",content:i,
452children:d}),m[8]=i,m[9]=c):c=m[9],m[10]!==n||m[11]!==c?(u=(0,s.jsx)(a.az,{padding:2,children:(0,s.jsxs)(a.cV,{space:2,children:[n,c]})}),m[10]=n,m[11]=c,m[12]=u):u=m[12],u):null};function lx(e){let t,n,i,r,d,c,u=(0,o.c)(27),{icon:p,layout:m,presence:f,schemaType:x,value:g}=e,b=(0,h.r0j)(g._id),{perspectiveStack:y}=(0,h.QO2)();u[0]!==y||u[1]!==e.documentPreviewStore||u[2]!==x||u[3]!==g._id?(t=(0,h.TU6)(e.documentPreviewStore,x,g._id,y),u[0]=y,u[1]=e.documentPreviewStore,u[2]=x,u[3]=g._id,u[4]=t):t=u[4];let j=t;u[5]===Symbol.for("react.memo_cache_sentinel")?(n={snapshot:null,isLoading:!0,original:null},u[5]=n):n=u[5];let{snapshot:_,original:w,isLoading:S}=(0,v.J)(j,n);u[6]!==S||u[7]!==f||u[8]!==b.draft||u[9]!==b.published||u[10]!==b.versions?(i=S?null:(0,s.jsx)(l.vE,{children:(0,s.jsxs)(a.so,{align:"center",gap:3,children:[f&&f.length>0&&(0,s.jsx)(h.JEU,{presence:f}),(0,s.jsx)(h.ZDR,{draft:b.draft,published:b.published,versions:b.versions})]})}),u[6]=S,u[7]=f,u[8]=b.draft,u[9]=b.published,u[10]=b.versions,u[11]=i):i=u[11];let k=i;u[12]!==b.draft||u[13]!==b.published||u[14]!==b.versions?(r=(0,s.jsx)(h.Aii,{draft:b.draft,published:b.published,versions:b.ver
452sions}),u[12]=b.draft,u[13]=b.published,u[14]=b.versions,u[15]=r):r=u[15];let C=r;return u[16]!==w||u[17]!==_||u[18]!==g?(d=(0,h.ADU)({snapshot:_,original:w,fallback:g}),u[16]=w,u[17]=_,u[18]=g,u[19]=d):d=u[19],u[20]!==p||u[21]!==S||u[22]!==m||u[23]!==k||u[24]!==d||u[25]!==C?(c=(0,s.jsx)(h.m6P,{...d,isPlaceholder:S,icon:p,layout:m,status:k,tooltip:C}),u[20]=p,u[21]=S,u[22]=m,u[23]=k,u[24]=d,u[25]=C,u[26]=c):c=u[26],c}let lg=[];function lb(e){let t,n,i,r,l=(0,o.c)(16),{onClick:a,type:d,value:c}=e,u=c?._id;l[0]!==u?(t=(0,m.IM)(u),l[0]=u,l[1]=t):t=l[1];let p=(0,h.cVB)(t),f=(0,h.yKO)(),{ReferenceChildLink:x}=ny();l[2]!==x||l[3]!==d?.name||l[4]!==c?._id?(n=function(e){return(0,s.jsx)(x,{documentId:c?._id,documentType:d?.name,parentRefPath:lg,...e})},l[2]=x,l[3]=d?.name,l[4]=c?._id,l[5]=n):n=l[5];let g=n,b=d?.icon,y=p?.length>0?p:lg;return l[6]!==f||l[7]!==b||l[8]!==y||l[9]!==d||l[10]!==c?(i=(0,s.jsx)(lx,{documentPreviewStore:f,icon:b,layout:"compact",presence:y,schemaType:d,value:c}),l[6]=f,l[7]=b,l[8]=y,l[9]=d,l[10]=c,l[11]=i):i=l[11],l[12]!==a||l[13]!==g||l[14]!==i?(r=(0,s.jsx)(h.Ns2,{__unstable_focusRing:!0,as:g,"data-as":"a",onClick:a,radius:2,children:i}),l[12]=a,l[13]=g,l[14]=i,l[15]=r):r=l[15],r}function ly(e){let t,n,i,c,u,m,f,x,g,b,y,j,v,_,w,S,k=(0,o.c)(59),{crossDatasetReferences:C,internalReferences:I,documentTitle:E,totalCount:z,action:T,datasetNames:A,hasUnknownDatasetNames:P,onReferenceLinkClick:R}=e,M=(0,h.I07)(),D=(0,d.dj)(),{t:$}=(0,h.Bdt)(r.Z7);k[0]!==R||k[1]!==M||k[2]!==$?(t=e=>{let t=M.get(e._type);return t?(0,s.jsx)(lb,{type:t,value:e,onClick:R}):(0,s.jsx)(a.az,{padding:2,children:(0,s.jsx)(h.m6P,{icon:p.KSC,title:$("confirm-delete-dialog.preview-item.preview-unavailable.title"),subtitle:$("confirm-delete-dialog.preview-item.preview-unavailable.subtitle",{documentId:e._id}),layout:"default"})})},k[0]=R,k[1]=M,k[2]=$,k[3]=t):t=k[3];let B=t;if(I?.totalCount===0&&C?.totalCount===0){let e,t;return k[4]!==E?(e={DocumentTitle:()=>(0,s.jsx)("strong",{children:E})},k[4]=E,k[5]=e):e=k[5],k[6]!==T||k[7]!==$||k[8]!==e?(t=(0,s.jsx)(a.EY,{as:"p",size:1,children:(0,s.jsx)(h.HTc,{t:$,i18nKey:"confirm-delete-dialog.confirmation.text",context:T,components:e})}),k[6]=T,k[7]=$,k[8]=e,k[9]=t):t=k[9],t}k[10]!==P?(n=P?["unavailable"]:[],k[10]=P,k[11]=n):n=k[11],k[12]!==A||k[13]!==n?(i=[...A,...n],k[12]=A,k[13]=n,k[14]=i):i=k[14];let Y=i,L=Y.length,O=Y.join(", "),H=P&&Y.length?"unavailable":"";k[15]!==Y.length||k[16]!==$||k[17]!==O||k[18]!==H?(c=$("confirm-delete-dialog.cdr-summary.subtitle",{count:L,datasets:O,context:H}),k[15]=Y.length,k[16]=$,k[17]=O,k[18]=H,k[19]=c):c=k[19];let V=c;return k[20]===Symbol.for("react.memo_cache_sentinel")?(u=(0,s.jsx)(a.EY,{"aria-hidden":"true",size:1,children:(0,s.jsx)(p.sAQ,{})}),k[20]=u):u=k[20],k[21]!==E?(m={DocumentTitle:()=>E},k[21]=E,k[22]=m):m=k[22],k[23]!==z?(f={count:z},k[23]=z,k[24]=f):f=k[24],k[25]!==$||k[26]!==f||k[27]!==m?(x=(0,s.jsx)(a.Zp,{padding:3,radius:2,tone:"caution",flex:"none",children:(0,s.jsxs)(a.so,{children:[u,(0,s.jsx)(a.az,{flex:1,marginLeft:3,children:(0,s.jsx)(a.EY,{size:1,children:(0,s.jsx)(h.HTc,{i18nKey:"confirm-delete-dialog.referring-document-count.text",components:m,t:$,values:f})})})]})}),k[25]=$,k[26]=f,k[27]=m,k[28]=x):x=k[28],k[29]!==E?(g={DocumentTitle:()=>E},k[29]=E,k[30]=g):g=k[30],k[31]!==T||k[32]!==$||k[33]!==g?(b=(0,s.jsx)(a.az,{flex:"none",children:(0,s.jsx)(a.EY,{size:1,children:(0,s.jsx)(h.HTc,{i18nKey:"confirm-delete-dialog.referring-documents-descriptor.text",t:$,context:T,components:g})})}),k[31]=T,k[32]=$,k[33]=g,k[34]=b):b=k[34],k[35]!==I||k[36]!==B?(y=I.totalCount>0&&(0,s.jsxs)(a.BJ,{as:"ul",marginBottom:2,space:2,"data-testid":"internal-references",children:[I?.references.map(e=>(0,s.jsx)(a.az,{as:"li",children:B(e)},e._id)),I.totalCount>I.references.length&&(0,s.jsx)(a.az,{as:"li",padding:3,children:(0,s.jsx)(lf,{...I})})]}),k[35]=I,k[36]=B,k[37]=y):y=k[37],k[38]!==C||k[39]!==V||k[40]!==I.totalCount||k[41]!==Y.length||k[42]!==$||k[43]!==D?(j=C.totalCount>0&&(0,s.jsxs)(lu,{"data-testid":"cross-dataset-references",style:{borderTop:I.totalCount>0?"1px solid var(--card-shadow-outline-color)":void 0},children:[(0,s.jsx)(lp,{children:(0,s.jsx)(a.Zp,{as:"a",marginTop:2*(I.totalCount>0),radius:2,shadow:1,paddingY:1,children:(0,s.jsxs)(a.so,{align:"center",gap:3,paddingX:3,paddingY:1,children:[(0,s.jsx)(a.EY,{size:1,children:(0,s.jsx)(p.So9,{})}),(0,s.jsxs)(a.BJ,{space:2,children:[(0,s.jsx)(a.EY,{textOverflow:"ellipsis",size:1,children:$("confirm-delete-dialog.cdr-summary.title",{count:Y.length,documentCount:$("confirm-delete-dialog.cdr-summary.document-count",{count:C.totalCount})})}),(0,s.jsx)(a.EY,{title:V,textOverflow:"ellipsis",size:1,muted:!0,children:V})]}),(0,s.jsx)(lc,{children:(0,s.jsx)(a.EY,{muted:!0,size:1,children:(0,s.jsx)(p.D3D,{})})})]})})}),(0,s.jsxs)(a.az,{overflow:"auto",paddingTop:2,children:[(0,s.jsxs)(lm,{children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:(0,s.jsx)(a.EY,{muted:!0,size:1,style:{minWidth:"5rem"},weight:"medium",children:$("confirm-delete-dialog.cdr-table.project-id.label")})}),(0,s.jsx)("th",{children:(0,s.jsx)(a.EY,{muted:!0,size:1,weight:"medium",children:$("confirm-delete-dialog.cdr-table.dataset.label")})}),(0,s.jsx)("th",{children:(0,s.jsx)(a.EY,{muted:!0,size:1,weight:"medium",children:$("confirm-delete-dialog.cdr-table.document-id.label")})})]})}),(0,s.jsx)("tbody",{children:C.references.filter(lj).map((e,t)=>{let{projectId:n,datasetName:i,documentId:r}=e;return(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:(0,s.jsx)(a.EY,{size:1,children:n})}),(0,s.jsx)("td",{children:(0,s.jsx)(a.EY,{size:1,children:i||"unavailable"})}),(0,s.jsx)("td",{children:(0,s.jsxs)(lh,{align:"center",gap:2,justify:"flex-end",children:[(0,s.jsx)(a.EY,{textOverflow:"ellipsis",size:1,children:r||"unavailable"}),r&&(0,s.jsx)(l.$n,{mode:"bleed",icon:p.TdU,tooltipProps:{content:$("confirm-delete-dialog.cdr-table.copy-id-button.tooltip")},onClick:()=>
452{navigator.clipboard.writeText(r).catch(()=>{D.push({status:"error",title:$("confirm-delete-dialog.cdr-table.id-copied-toast.title-failed")})})}})]})})]},`${r}-${t}`)})})]}),(0,s.jsx)(lf,{...C})]})]}),k[38]=C,k[39]=V,k[40]=I.totalCount,k[41]=Y.length,k[42]=$,k[43]=D,k[44]=j):j=k[44],k[45]!==y||k[46]!==j?(v=(0,s.jsx)(a.Zp,{radius:2,shadow:1,flex:"auto",padding:2,children:(0,s.jsxs)(a.so,{direction:"column",children:[y,j]})}),k[45]=y,k[46]=j,k[47]=v):v=k[47],k[48]!==E?(_={DocumentTitle:()=>E},k[48]=E,k[49]=_):_=k[49],k[50]!==T||k[51]!==$||k[52]!==_?(w=(0,s.jsx)(a.az,{flex:"none",children:(0,s.jsx)(a.EY,{size:1,children:(0,s.jsx)(h.HTc,{i18nKey:"confirm-delete-dialog.referential-integrity-disclaimer.text",t:$,context:T,components:_})})}),k[50]=T,k[51]=$,k[52]=_,k[53]=w):w=k[53],k[54]!==x||k[55]!==b||k[56]!==v||k[57]!==w?(S=(0,s.jsxs)(a.so,{direction:"column",gap:4,children:[x,b,v,w]}),k[54]=x,k[55]=b,k[56]=v,k[57]=w,k[58]=S):S=k[58],S}function lj(e){return"projectId"in e}let lv=()=>(i||(i=(0,G.R)(document,"visibilitychange").pipe((0,T.Z)(null),(0,E.T)(()=>"visible"===document.visibilityState),(0,R.F)(),(0,M.n)(e=>e?(0,Q.O)(0,5e3):q.w),(0,D.t)({refCount:!0,bufferSize:1}))),i),l_=(0,h.R11)(([e,t])=>t.listenQuery({fetch:'{"references":*[references($documentId)][0...100]{_id,_type},"totalCount":count(*[references($documentId)])}',listen:"*[references($documentId)]"},{documentId:e},{tag:"use-referring-documents",transitions:["appear","disappear"],throttleTime:5e3})),lw=(0,h.R11)(([e,t])=>lv().pipe((0,M.n)(()=>(function(e,t){let{versionedClient:n}=t;return lv().pipe((0,M.n)(()=>(function(e,{versionedClient:t}){let n=(0,m.T4)(e),i=(0,m.IM)(e),r={uri:t.getDataUrl("doc",`${n},${i}`),json:!0,query:{excludeContent:"true"},tag:"use-referring-documents.document-existence"};return t.observable.request(r).pipe((0,E.T)(({omitted:e})=>{let t=e.filter(e=>"existence"===e.reason);if(2!==t.length)return 0===t.length||t.some(e=>e.id===n)?i:n}))})(e,t)),(0,M.n)(e=>{if(!e)return(0,Z.of)({totalCount:0,references:[]});let t=n.config().dataset;return n.observable.request({url:`/data/references/${t}/documents/${e}/to?excludeInternalReferences=true&excludePaths=true`,tag:"use-referring-documents.external"}).pipe((0,z.W)(e=>{if("object"==typeof e&&e&&"statusCode"in e&&"response"in e&&404===e.statusCode)return(0,Z.of)({totalCount:0,references:[]});throw e}))}))})(e,{versionedClient:t}))));function lS(e){return"string"!=typeof e.datasetName}function lk(e){return!!e&&""!==e}function lC(e){return e?.datasetName||""}function lI(e){return e.projectId}let lE=(0,g.I4)(a.az)`
453  box-sizing: border-box;
454`,lz=(0,g.I4)(a.so).attrs({align:"center",direction:"column",justify:"center"})`
455  height: 110px;
456`;function lT(e){let t,n,i,a,d,u,p,f,x,g=(0,o.c)(40),{id:b,type:y,action:j,onCancel:v,onConfirm:_}=e,w=void 0===j?"delete":j,{t:S}=(0,h.Bdt)(r.Z7),k=`deletion-confirmation-${(0,c.useId)()}`,{internalReferences:C,crossDatasetReferences:I,isLoading:E,totalCount:z,projectIds:T,datasetNames:A,hasUnknownDatasetNames:P}=function(e){let t,n,i,r,l,s,a,d,c=(0,o.c)(24),u=(0,h.tH7)(h.miu),p=(0,h.q3J)();c[0]!==e?(t=(0,m.IM)(e),c[0]=e,c[1]=t):t=c[1];let f=t;c[2]!==p||c[3]!==f?(n=[f,p],c[2]=p,c[3]=f,c[4]=n):n=c[4];let[x,g]=l_(n);c[5]!==f||c[6]!==u?(i=[f,u],c[5]=f,c[6]=u,c[7]=i):i=c[7];let[b,y]=lw(i);c[8]!==b?.references?(r=()=>Array.from(new Set(b?.references.map(lI).filter(Boolean))).sort(),c[8]=b?.references,c[9]=r):r=c[9],c[10]!==r?(l=r(),c[10]=r,c[11]=l):l=c[11];let j=l;c[12]!==b?.references?(s=Array.from(new Set(b?.references.map(lC).filter(lk))).sort(),c[12]=b?.references,c[13]=s):s=c[13];let v=s;c[14]!==b?.references?(a=()=>!!b?.references.some(lS),c[14]=b?.references,c[15]=a):a=c[15];let _=a(),w=(x?.totalCount||0)+(b?.totalCount||0),S=g||y;return c[16]!==b||c[17]!==v||c[18]!==_||c[19]!==x||c[20]!==j||c[21]!==w||c[22]!==S?(d={totalCount:w,projectIds:j,datasetNames:v,hasUnknownDatasetNames:_,internalReferences:x,crossDatasetReferences:b,isLoading:S},c[16]=b,c[17]=v,c[18]=_,c[19]=x,c[20]=j,c[21]=w,c[22]=S,c[23]=d):d=c[23],d}(b);g[0]!==b||g[1]!==y?(t={_id:b,_type:y},g[0]=b,g[1]=y,g[2]=t):t=g[2];let R=t;g[3]!==R?(n=(0,s.jsx)(ld,{document:R}),g[3]=R,g[4]=n):n=g[4];let M=n,D=!E;return g[5]!==w||g[6]!==S?(i=S("confirm-delete-dialog.header.text",{context:w}),g[5]=w,g[6]=S,g[7]=i):i=g[7],g[8]!==S?(a=S("confirm-delete-dialog.cancel-button.text"),g[8]=S,g[9]=a):a=g[9],g[10]!==v||g[11]!==a?(d={onClick:v,text:a},g[10]=v,g[11]=a,g[12]=d):d=g[12],g[13]!==w||g[14]!==_||g[15]!==D||g[16]!==S||g[17]!==z?(u=D?{text:S(z>0?"confirm-delete-dialog.confirm-anyway-button.text":"confirm-delete-dialog.confirm-button.text",{context:w}),onClick:_}:void 0,g[13]=w,g[14]=_,g[15]=D,g[16]=S,g[17]=z,g[18]=u):u=g[18],g[19]!==d||g[20]!==u?(p={cancelButton:d,confirmButton:u},g[19]=d,g[20]=u,g[21]=p):p=g[21],g[22]!==w||g[23]!==I||g[24]!==A||g[25]!==M||g[26]!==P||g[27]!==C||g[28]!==E||g[29]!==v||g[30]!==T||g[31]!==S||g[32]!==z?(f=(0,s.jsx)(lE,{children:I&&C&&!E?(0,s.jsx)(ly,{crossDatasetReferences:I,internalReferences:C,documentTitle:M,isLoading:E,totalCount:z,action:w,projectIds:T,datasetNames:A,hasUnknownDatasetN
456ames:P,onReferenceLinkClick:v}):(0,s.jsx)(lz,{"data-testid":"loading-container",children:(0,s.jsx)(h.gd4,{showText:!0,title:S("confirm-delete-dialog.loading.text")})})}),g[22]=w,g[23]=I,g[24]=A,g[25]=M,g[26]=P,g[27]=C,g[28]=E,g[29]=v,g[30]=T,g[31]=S,g[32]=z,g[33]=f):f=g[33],g[34]!==k||g[35]!==v||g[36]!==f||g[37]!==i||g[38]!==p?(x=(0,s.jsx)(l.lG,{width:1,id:k,header:i,footer:p,onClose:v,onClickOutside:v,children:f}),g[34]=k,g[35]=v,g[36]=f,g[37]=i,g[38]=p,g[39]=x):x=g[39],x}function lA(e){let t,n,i=(0,o.c)(6),{t:d}=(0,h.Bdt)(r.Z7),u=(0,c.useId)(),[p,m]=(0,c.useState)(null);i[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>m(null),i[0]=t):t=i[0];let f=t;return i[1]!==p||i[2]!==u||i[3]!==e||i[4]!==d?(n=p?(0,s.jsx)(l.lG,{id:`dialog-error-${u}`,"data-testid":"confirm-delete-error-dialog",header:d("confirm-delete-dialog.error.title.text"),footer:{confirmButton:{text:d("confirm-delete-dialog.error.retry-button.text"),onClick:f,tone:"default"}},onClose:e.onCancel,children:(0,s.jsx)(a.az,{padding:4,children:(0,s.jsx)(a.EY,{size:1,children:d("confirm-delete-dialog.error.message.text")})})}):(0,s.jsx)(l.tH,{onCatch:m,children:(0,s.jsx)(lT,{...e})}),i[1]=p,i[2]=u,i[3]=e,i[4]=d,i[5]=n):n=i[5],n}let lP=(0,c.forwardRef)(function(e,t){let n,i,r,a,d=(0,o.c)(10);d[0]!==e?({intent:n,...i}=e,d[0]=e,d[1]=n,d[2]=i):(n=d[1],i=d[2]),d[3]!==n?(r=(0,c.forwardRef)(function(e,t){return(0,s.jsx)(_.RZ,{...e,intent:n.type,params:n.params,ref:t,searchParams:n.searchParams})}),d[3]=n,d[4]=r):r=d[4];let u=r;return d[5]!==u||d[6]!==e.disabled||d[7]!==t||d[8]!==i?(a=e.disabled?(0,s.jsx)(l.$n,{...i,as:"a",role:"link","aria-disabled":"true"}):(0,s.jsx)(l.$n,{...i,as:u,"data-as":"a",ref:t}),d[5]=u,d[6]=e.disabled,d[7]=t,d[8]=i,d[9]=a):a=d[9],a});function lR(e){let t,n,i,a=(0,o.c)(12),{reveal:d,context:c,loading:u,children:p}=e,m=(0,h.iZK)(),{t:f}=(0,h.Bdt)(r.Z7);if(!d){let e;return a[0]!==p?(e=(0,s.jsx)(s.Fragment,{children:p}),a[0]=p,a[1]=e):e=a[1],e}return a[2]!==c||a[3]!==m||a[4]!==u||a[5]!==f?(t=u?f("insufficient-permissions-message-tooltip.loading-text"):(0,s.jsx)(h.TLO,{context:c,currentUser:m}),a[2]=c,a[3]=m,a[4]=u,a[5]=f,a[6]=t):t=a[6],a[7]!==p?(n=(0,s.jsx)("div",{children:p}),a[7]=p,a[8]=n):n=a[8],a[9]!==t||a[10]!==n?(i=(0,s.jsx)(l.m_,{content:t,portal:!0,children:n}),a[9]=t,a[10]=n,a[11]=i):i=a[11],i}let lM={constrainSize:!0,placement:"bottom",portal:!0},lD=(e,t,n)=>{let i=e.find(e=>e.id===t.templateId)?.schemaType;if(!i)return null;let r={template:t.templateId,type:i,version:n,id:t.initialDocumentId};return{type:"create",params:t.parameters?[r,t.parameters]:r,searchParams:n?[["perspective",n]]:void 0}};function l$(e){let t,n,i,d,u,m,f,x,g=(0,o.c)(60),{templateItems:b}=e,y=(0,h.bgA)(),{selectedReleaseId:j}=(0,h.QO2)(),{t:v}=(0,h.Bdt)(r.Z7);g[0]!==b||g[1]!==y?(t=[...b,...y],g[0]=b,g[1]=y,g[2]=t):t=g[2];let w=(0,h.Bvg)(t);g[3]!==b?(n={templateItems:b},g[3]=b,g[4]=n):n=g[4];let[S,k]=(0,h.CzS)(n),C=!k&&S?.length!==0&&S?.every(lY);e:{let e;if(!S){let e;g[5]===Symbol.for("react.memo_cache_sentinel")?(e={},g[5]=e):e=g[5],i=e;break e}g[6]!==S?(e=S.reduce(lB,{}),g[6]=S,g[7]=e):e=g[7],i=e}let I=i;if(0===b.length)return null;if(C){let e,t,n;return g[8]!==v?(e=v("pane-header.disabled-created-button.aria-label"),g[8]=v,g[9]=e):e=g[9],g[10]!==e?(t=(0,s.jsx)(l.$n,{"aria-label":e,icon:p.REV,"data-testid":"action-intent-button",disabled:!0,mode:"bleed",tooltipProps:null}),g[10]=e,g[11]=t):t=g[11],g[12]!==k||g[13]!==t?(n=(0,s.jsx)(lR,{context:"create-document-type",reveal:!0,loading:k,children:t}),g[12]=k,g[13]=t,g[14]=n):n=g[14],n}if(1===b.length){let e,t,n,i,r,l,o=b[0],a=!I[o.id]?.granted;g[15]!==o||g[16]!==j||g[17]!==y?(e=lD(y,o,j),g[15]=o,g[16]=j,g[17]=y,g[18]=e):e=g[18];let d=e;if(!d)return null;g[19]!==o||g[20]!==w?(t=w(o),g[19]=o,g[20]=w,g[21]=t):t=g[21];let c=t.title,u=o.icon||p.REV;return g[22]!==v?(n=v("pane-header.create-new-button.tooltip"),g[22]=v,g[23]=n):n=g[23],g[24]!==n?(i={content:n},g[24]=n,g[25]=i):i=g[25],g[26]!==a||g[27]!==d||g[28]!==t.title||g[29]!==u||g[30]!==i?(r=(0,s.jsx)(lP,{"aria-label":c,icon:u,intent:d,mode:"bleed",disabled:a,"data-testid":"action-intent-button",tooltipProps:i}),g[26]=a,g[27]=d,g[28]=t.title,g[29]=u,g[30]=i,g[31]=r):r=g[31],g[32]!==a||g[33]!==k||g[34]!==r?(l=(0,s.jsx)(lR,{reveal:a,loading:k,context:"create-document-type",children:r}),g[32]=a,g[33]=k,g[34]=r,g[35]=l):l=g[35],l}if(g[36]!==v?(d=v("pane-header.create-new-button.tooltip"),g[36]=v,g[37]=d):d=g[37],g[38]!==d?(u=(0,s.jsx)(l.$n,{icon:p.REV,mode:"bleed","data-testid":"multi-action-intent-button",tooltipProps:{content:d}}),g[38]=d,g[39]=u):u=g[39],g[40]!==w||g[41]!==k||g[42]!==I||g[43]!==j||g[44]!==v||g[45]!==b||g[46]!==y){let e;g[48]!==w||g[49]!==k||g[50]!==I||g[51]!==j||g[52]!==v||g[53]!==y?(e=(e,t)=>{let n=!I[e.id]?.granted,i=lD(y,e,j),r=y.find(t=>
456t.id===e.templateId);if(!r||!i)return null;let o=(0,c.forwardRef)((e,t)=>n?(0,s.jsx)("button",{type:"button",disabled:!0,...e,ref:t}):(0,s.jsx)(_.RZ,{...e,intent:i.type,params:i.params,searchParams:i.searchParams,ref:t}));o.displayName="Link";let{title:a}=w({...e,title:e.title||w(r).title});return(0,s.jsx)(lR,{context:"create-document-type",reveal:n,loading:k,children:(0,s.jsx)(l.Dr,{as:o,"data-as":n?"button":"a",text:a,"aria-label":n?v("pane-header.disabled-created-button.aria-label"):a,disabled:n,"data-testid":`action-intent-button-${t}`})},e.id)},g[48]=w,g[49]=k,g[50]=I,g[51]=j,g[52]=v,g[53]=y,g[54]=e):e=g[54],m=b.map(e),g[40]=w,g[41]=k,g[42]=I,g[43]=j,g[44]=v,g[45]=b,g[46]=y,g[47]=m}else m=g[47];return g[55]!==m?(f=(0,s.jsx)(a.W1,{children:m}),g[55]=m,g[56]=f):f=g[56],g[57]!==u||g[58]!==f?(x=(0,s.jsx)(l.IU,{button:u,id:"create-menu",menu:f,popover:lM}),g[57]=u,g[58]=f,g[59]=x):x=g[59],x}function lB(e,t){return e[t.id]=t,e}function lY(e){return!e.granted}function lL(e){return null!=e}let lO=(0,c.memo)(function(e){let{initialValueTemplateItems:t=h.Mlv,menuItems:n=h.Mlv,menuItemGroups:i=h.Mlv,actionHandlers:r=h.MlF}=e,l=(0,h.bgA)(),o=(0,c.useCallback)(e=>{if("string"==typeof e.action&&!(e.action in r))return console.warn("No handler for action:",e.action),!1;let t="function"==typeof e.action?e.action:"string"==typeof e.action?r[e.action]:null;return!!t&&(t(e.params),!0)},[r]),d=(0,c.useMemo)(()=>nQ({actionHandler:o,menuItemGroups:i,menuItems:n.filter(e=>e.intent?.type!=="create")}),[o,i,n]),u=(0,c.useMemo)(()=>d.filter(nU),[d]),p=(0,c.useMemo)(()=>d.filter(nG),[d]),m=(0,c.useMemo)(()=>n.map((e,t)=>{if(e.intent?.type!=="create")return null;let{params:n}=e.intent;if(!n)return null;let i=Array.isArray(n)?n[0]:n,r=Array.isArray(n)?n[1]:void 0,s=i.template||i.type;if(!s)return null;let o=l.find(e=>e.id===s);return o?{item:e,template:o,templateParams:r,menuItemIndex:t,initialDocumentId:i.id}:null}).filter(lL).map(({initialDocumentId:e,item:t,template:n,menuItemIndex:i,templateParams:r})=>({id:`menuItem${i}`,initialDocumentId:e,templateId:n.id,type:"initialValueTemplateItem",title:t.title||n.title,i18n:t.i18n||n.i18n,icon:t.icon,description:n.description,parameters:r,schemaType:n.schemaType})),[n,l]),f=(0,c.useMemo)(()=>eo([...m,...t],e=>{var t;let n;return t=[e.initialDocumentId,e.templateId,e.parameters],JSON.stringify((n=e=>"object"==typeof e&&e?Array.isArray(e)?e.map(n):Object.entries(e).sort(([e],[t])=>e.localeCompare(t,"en")):e)(JSON.parse(JSON.stringify(t))))}),[m,t]);return(0,s.jsxs)(a.so,{gap:1,children:[(0,s.jsx)(l$,{templateItems:f}),u.map(e=>(0,s.jsx)(t_,{node:e},e.key)),p.length>0&&(0,s.jsx)(tu,{nodes:p})]})});function lH(e){let t,n,i,l,a,d,c,u=(0,o.c)(16),{t:p}=(0,h.Bdt)(r.Z7),{layout:m,value:f}=e;return u[0]===Symbol.for("react.memo_cache_sentinel")?(t={Code:"code"},u[0]=t):t=u[0],u[1]!==f._type?(n={documentType:f._type},u[1]=f._type,u[2]=n):n=u[2],u[3]!==p||u[4]!==n?(i=(0,s.jsx)("em",{children:(0,s.jsx)(h.HTc,{t:p,i18nKey:"pane-item.missing-schema-type.title",components:t,values:n})}),u[3]=p,u[4]=n,u[5]=i):i=u[5],u[6]===Symbol.for("react.memo_cache_sentinel")?(l={Code:"code"},u[6]=l):l=u[6],u[7]!==f._id?(a={documentId:f._id},u[7]=f._id,u[8]=a):a=u[8],u[9]!==p||u[10]!==a?(d=(0,s.jsx)(h.HTc,{t:p,i18nKey:"pane-item.missing-schema-type.subtitle",components:l,values:a}),u[9]=p,u[10]=a,u[11]=d):d=u[11],u[12]!==m||u[13]!==i||u[14]!==d?(c=(0,s.jsx)(h.m6P,{title:i,subtitle:d,media:lV,layout:m}),u[12]=m,u[13]=i,u[14]=d,u[15]=c):c=u[15],c}function lV(){return(0,s.jsx)(p.sAQ,{})}function lN(e,t,n){return!1!==e&&(e||t&&t.icon||n||!1)}function lZ(e){let t,n,i,r,l,d,u,m,x=(0,o.c)(42),{icon:g,id:b,layout:y,pressed:j,schemaType:v,selected:_,title:w,value:S,margin:k,marginBottom:C,marginTop:I}=e,E=void 0===y?"default":y,z=(0,h.I07)(),T=(0,h.yKO)(),{ChildLink:A}=ny(),P=(0,h.cVB)(b),R=!!(v&&v.name&&z.get(v.name)),[M,D]=(0,c.useState)(!1);e:{let e,n,i,r;if(S&&(0,f.ME)(S)){let e,n;if(!v||!R){let e;x[0]!==S?(e=(0,s.jsx)(lH,{value:S}),x[0]=S,x[1]=e):e=x[1],t=e;break e}x[2]!==g||x[3]!==v?(e=lN(g,v,p.pyG),x[2]=g,x[3]=v,x[4]=e):e=x[4],x[5]!==P||x[6]!==T||x[7]!==E||x[8]!==v||x[9]!==e||x[10]!==S?(n=(0,s.jsx)(lx,{documentPreviewStore:T,icon:e,layout:E,schemaType:v,value:S,presence:P}),x[5]=P,x[6]=T,x[7]=E,x[8]=v,x[9]=e,x[10]=S,x[11]=n):n=x[11],t=n;break e}x[12]===Symbol.for("react.memo_cache_sentinel")?(e={opacity:.5},x[12]=e):e=x[12],x[13]===Symbol.for("react.memo_cache_sentinel")?(n=(0,s.jsx)(a.az,{style:e,children:(0,s.jsx)(a.EY,{muted:!0,size:1,children:(0,s.jsx)(p.vKP,{})})}),x[13]=n):n=x[13],x[14]!==g||x[15]!==v?(i=lN(g,v,p.sjq),x[14]=g,x[15]=v,x[16]=i):i=x[16],x[17]!==i||x[18]!==w?(r=(0,s.jsx)(h.m6P,{status:n,icon:i,layout:"compact",title:w}),x[17]=i,x[18]=w,x[19]=r):r=x[19],t=r}let $=t;x[20]===Symbol.for("react.memo_cache_sentinel")?(n=e=>{e.metaKey?D(!1):D(!0)},x[20]=n):n=x[20];let B=n;x[21]===Symbol.for("react.memo_cache_sentinel")?(i=()=>D(!1),x[21]=i):i=x[21],x[22]!==_?(r=[_],x[22]=_,x[23]=r):r=x[23],(0,c.useEffect)(i,r);
456let[Y,L]=(0,c.useState)(!1),O=(0,c.useRef)(null);x[24]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{O.current=setTimeout(()=>(0,c.startTransition)(()=>L(!0)),400)},x[24]=l):l=x[24];let H=l;x[25]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{O.current&&clearTimeout(O.current),(0,c.startTransition)(()=>L(!1))},x[25]=d):d=x[25];let V=d,N=`pane-item-${w}`,Z=_||M;return x[26]!==b||x[27]!==Y||x[28]!==v||x[29]!==S?(u=Y&&v?.name&&S&&(0,f.ME)(S)&&(0,s.jsx)(lF,{documentId:b,documentType:v.name}),x[26]=b,x[27]=Y,x[28]=v,x[29]=S,x[30]=u):u=x[30],x[31]!==b||x[32]!==k||x[33]!==C||x[34]!==I||x[35]!==j||x[36]!==$||x[37]!==u||x[38]!==N||x[39]!==A||x[40]!==Z?(m=(0,s.jsxs)(h.Ns2,{"data-testid":N,__unstable_focusRing:!0,as:A,childId:b,"data-as":"a",margin:k,marginBottom:C,marginTop:I,onClick:B,onMouseEnter:H,onMouseLeave:V,pressed:j,radius:2,selected:Z,sizing:"border",tabIndex:-1,tone:"inherit",children:[$,u]}),x[31]=b,x[32]=k,x[33]=C,x[34]=I,x[35]=j,x[36]=$,x[37]=u,x[38]=N,x[39]=A,x[40]=Z,x[41]=m):m=x[41],m}function lF(e){let t,n=(0,o.c)(2),{documentId:i,documentType:r}=e;return n[0]!==i?(t=(0,m.IM)(i),n[0]=i,n[1]=t):t=n[1],(0,h.zX2)(t,r),null}lF.displayName="PreloadDocumentPane";let lK=(0,c.memo)(e=>{let t,n,i=(0,o.c)(10),{actions:r,children:l,actionProps:a,onActionComplete:d,group:c}=e;return i[0]!==a.id||i[1]!==a.liveEditSchemaType||i[2]!==l?(t=e=>{let{states:t}=e;return(0,s.jsx)(lJ,{states:t,documentId:a.liveEditSchemaType?(0,m.IM)(a.id):(0,m.T4)(a.id),children:l})},i[0]=a.id,i[1]=a.liveEditSchemaType,i[2]=l,i[3]=t):t=i[3],i[4]!==a||i[5]!==r||i[6]!==c||i[7]!==d||i[8]!==t?(n=(0,s.jsx)(h.N6R,{onReset:d,hooks:r,args:a,group:c,children:t}),i[4]=a,i[5]=r,i[6]=c,i[7]=d,i[8]=t,i[9]=n):n=i[9],n});lK.displayName="Memo(RenderActionCollectionState)";let lW=["delete","duplicate","publish","unpublish","unlinkFromCanvas","editInCanvas","linkToCanvas","schedule"],lJ=e=>{let t,n=(0,o.c)(9),{states:i,children:l,documentId:s}=e,{t:a}=(0,h.Bdt)(r.Z7),{isLinked:d}=(0,h.G2c)(s);e:{let e;if(d){let e;if(n[0]!==l||n[1]!==i||n[2]!==a){let t;n[4]!==a?(t=e=>e.action&&lW.includes(e.action)?e:{...e,disabled:!0,title:a("action.disabled-by-canvas.tooltip")},n[4]=a,n[5]=t):t=n[5],e=l({states:i.map(t)}),n[0]=l,n[1]=i,n[2]=a,n[3]=e}else e=n[3];t=e;break e}n[6]!==l||n[7]!==i?(e=l({states:i}),n[6]=l,n[7]=i,n[8]=e):e=n[8],t=e}return t},lU=(0,c.memo)(e=>{let t,n=(0,o.c)(4),{badges:i,children:r,badgeProps:l}=e;return n[0]!==l||n[1]!==i||n[2]!==r?(t=(0,s.jsx)(h.N6R,{hooks:i,args:l,children:r}),n[0]=l,n[1]=i,n[2]=r,n[3]=t):t=n[3],t});lU.displayName="Memo(RenderBadgeCollectionState)";let lG={by:[{field:"_updatedAt",direction:"desc"}]},lQ={},lq=(0,g.I4)(a.az)`
457  position: relative;
458  opacity: ${e=>e.$opacity||1};
459  transition: opacity 0.4s;
460`,lX=(0,g.I4)(a.az)`
461  position: absolute;
462  left: 0;
463  right: 0;
464  top: 0;
465  bottom: 0;
466`,l0=[...Array(30).keys()];function l1(e){let t,n,i=(0,o.c)(4),{layout:r}=e;return i[0]!==r?(t=l0.map(e=>(0,s.jsx)(h.m6P,{isPlaceholder:!0,layout:r},e)),i[0]=r,i[1]=t):t=i[1],i[2]!==t?(n=(0,s.jsx)(a.BJ,{paddingX:3,paddingY:2,paddingTop:0,space:1,children:t}),i[2]=t,i[3]=n):n=i[3],n}function l2(e){let t,n,i,l,d,u,p,f=(0,o.c)(66),{childItemId:x,error:g,isRetrying:b,autoRetry:y,filterIsSimpleTypeConstraint:j,hasMaxItems:v,hasSearchQuery:_,isActive:w,isLazyLoading:S,muted:k,isLoading:C,isConnected:I,retryCount:E,canRetry:z,items:T,layout:A,loadingVariant:P,onEndReached:R,onRetry:M,paneTitle:D,searchInputElement:$,showIcons:B}=e,Y=(0,h.I07)(),{collapsed:L}=e5(),{collapsed:O,index:H}=tt(),[V,N]=(0,c.useState)(!O),{t:Z}=(0,h.Bdt)(r.Z7);f[0]!==R||f[1]!==V?(t=()=>{V&&R()},f[0]=R,f[1]=V,f[2]=t):t=f[2];let F=t;f[3]!==O?(n=()=>{if(O)return;let e=setTimeout(()=>{N(!0)},0);return()=>{clearTimeout(e)}},f[3]=O,f[4]=n):n=f[4],f[5]!==O||f[6]!==T?(i=[O,T],f[5]=O,f[6]=T,f[7]=i):i=f[7],(0,c.useEffect)(n,i),f[8]!==x||f[9]!==v||f[10]!==w||f[11]!==S||f[12]!==T.length||f[13]!==A||f[14]!==Y||f[15]!==B||f[16]!==Z?(l=(e,t)=>{let{activeIndex:n}=t,i=(0,m.IM)(e._id),r=x===i,l=!w&&r,o=w&&r,d=n===T.length-1,c=d&&S,u=d&&v;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(lZ,{icon:!1!==B&&void 0,id:i,layout:A,marginBottom:1,pressed:l,schemaType:Y.get(e._type),selected:o,value:e}),c&&(0,s.jsx)(h.gd4,{}),u&&(0,s.jsx)(a.az,{marginY:1,paddingX:3,paddingY:4,children:(0,s.jsx)(a.EY,{align:"center",muted:!0,size:1,children:Z("panes.document-list-pane.max-items.text",{limit:2e3})})})]})},f[8]=x,f[9]=v,f[10]=w,f[11]=S,f[12]=T.length,f[13]=A,f[14]=Y,f[15]=B,f[16]=Z,f[17]=l):l=f[17];let K=l;e:{let e,t;if(_){let e,t;f[18]!==Z?(e=Z("panes.document-list-pane.no-documents.text"),f[18]=Z,f[19]=e):e=f[19],f[20]!==e?(t=(0,s.jsx)(a.so,{align:"center",direction:"column",height:"fill",justify:"center",children:(0,s.jsx)(a.mc,{width:1,children:(0,s.jsx)(a.az,{paddingX:4,paddingY:5,children:(0,s.jsx)(a.EY,{align:"center",muted:!0,children:e})})})}),f[20]=e,f[21]=t):t=f[21],d=t;break e}f[22]!==j||f[23]!==Z?(e=Z(j?"panes.document-list-pane.no-documents-of-type.text":"panes.document-list-pane.no-matching-documents.text"),f[22]=j,f[23]=Z,f[24]=e):e=f[24],f[25]!==e?
466(t=(0,s.jsx)(a.so,{align:"center",direction:"column",height:"fill",justify:"center",children:(0,s.jsx)(a.mc,{width:1,children:(0,s.jsx)(a.az,{paddingX:4,paddingY:5,children:(0,s.jsx)(a.EY,{align:"center",muted:!0,children:e})})})}),f[25]=e,f[26]=t):t=f[26],d=t}let W=d;t:{let e,t;if(!V){u=null;break t}let n=window.navigator.onLine;if(g){let e,t,i,r,l,o,d;f[27]!==Z?(e=Z("panes.document-list-pane.error.title"),f[27]=Z,f[28]=e):e=f[28],f[29]!==e?(t=(0,s.jsx)(a.DZ,{as:"h3",children:e}),f[29]=e,f[30]=t):t=f[30],f[31]!==g||f[32]!==Z?(i=h.Cu5?(0,s.jsx)(h.HTc,{t:Z,i18nKey:"panes.document-list-pane.error.text.dev",values:{error:g.message},components:{Code:l3}}):Z(n?"panes.document-list-pane.error.text":"panes.document-list-pane.error.text.offline"),f[31]=g,f[32]=Z,f[33]=i):i=f[33],f[34]!==i?(r=(0,s.jsx)(a.EY,{as:"p",children:i}),f[34]=i,f[35]=r):r=f[35];let c=n&&z?M:void 0;f[36]!==g||f[37]!==b||f[38]!==c?(l=(0,s.jsx)(h.kbS,{error:g,eventId:null,onRetry:c,isRetrying:b}),f[36]=g,f[37]=b,f[38]=c,f[39]=l):l=f[39],f[40]!==y||f[41]!==z||f[42]!==b||f[43]!==E||f[44]!==Z?(o=z?(0,s.jsx)(a.EY,{as:"p",muted:!0,size:1,children:b?Z("panes.document-list-pane.error.retrying",{count:E}):y?Z("panes.document-list-pane.error.will-retry-automatically",{count:E}):Z("panes.document-list-pane.error.max-retries-attempted",{count:E})}):null,f[40]=y,f[41]=z,f[42]=b,f[43]=E,f[44]=Z,f[45]=o):o=f[45],f[46]!==l||f[47]!==o||f[48]!==t||f[49]!==r?(d=(0,s.jsx)(a.so,{align:"center",direction:"column",height:"fill",justify:"center",children:(0,s.jsx)(a.mc,{width:1,children:(0,s.jsxs)(a.BJ,{paddingX:4,paddingY:5,space:4,children:[t,r,l,o]})})}),f[46]=l,f[47]=o,f[48]=t,f[49]=r,f[50]=d):d=f[50],u=d;break t}if(I&&!C&&0===T.length){u=W;break t}if("initial"===P&&C){let e;f[51]!==A?(e=(0,s.jsx)(tA,{ms:300,children:(0,s.jsx)(l1,{layout:A})}),f[51]=A,f[52]=e):e=f[52],u=e;break t}if("spinner"===P&&C){u=null;break t}let i=`${H}-${O}`,r=k?.8:1;f[53]!==F||f[54]!==T||f[55]!==i||f[56]!==D||f[57]!==K||f[58]!==$?(e=(0,s.jsx)(lX,{children:(0,s.jsx)(h.oIj,{activeItemDataAttr:"data-hovered",ariaLabel:D,canReceiveFocus:!0,inputElement:$,itemHeight:51,items:T,onEndReached:F,onlyShowSelectionWhenActive:!0,overscan:10,paddingBottom:1,paddingX:3,renderItem:K,wrapAround:!1},i)}),f[53]=F,f[54]=T,f[55]=i,f[56]=D,f[57]=K,f[58]=$,f[59]=e):e=f[59],f[60]!==r||f[61]!==e?(t=(0,s.jsx)(lq,{overflow:"hidden",height:"fill",$opacity:r,children:e}),f[60]=r,f[61]=e,f[62]=t):t=f[62],u=t}let J=u,U=L||"initial"===P?"hidden":"auto";return f[63]!==J||f[64]!==U?(p=(0,s.jsx)(tn,{"data-testid":"document-list-pane",overflow:U,children:J}),f[63]=J,f[64]=U,f[65]=p):p=f[65],p}function l3(e){let{children:t}=e;return(0,s.jsx)("code",{children:t})}function l4(e,t={}){try{let n=function e(t){switch(t.type){case"OpCall":{let{left:e,right:n}=t;switch(t.op){case"==":return"AccessAttribute"!==e.type||"_type"!==e.name||e.base?"AccessAttribute"!==n.type||"_type"!==n.name||n.base||"Value"!==e.type||"string"!=typeof e.value?null:new Set([e.value]):"Value"!==n.type||"string"!=typeof n.value?null:new Set([n.value]);case"in":{if("AccessAttribute"!==e.type||"_type"!==e.name||e.base||"Array"!==n.type)return null;let t=new Set;for(let e of n.elements){if(e.isSplat||"Value"!==e.value.type||"string"!=typeof e.value.value)return null;t.add(e.value.value)}return t.size?t:null}default:return null}}case"Group":return e(t.base);case"Or":{let n=e(t.left);if(!n)return null;let i=e(t.right);return i?new Set([...n,...i]):null}case"And":{let n=e(t.left),i=e(t.right);return n||i?new Set([...n||[],...i||[]]):null}default:return null}}((0,eC.qg)(e,{params:t}));return n?Array.from(n).sort():null}catch{return null}}let l5=(0,h.pTS)({maxSize:100});function l6(e){let{client:t,schema:n,sort:i,perspective:l,limit:s,params:o,filter:a,searchQuery:d,staticTypeNames:c,maxFieldDepth:u,searchStrategy:p}=e,m=i.by,f=i?.extendedProjection,x=(0,X.v)(()=>t.listen(`*[${a}]`,o,{events:["welcome","mutation","reconnect"],includeAllVersions:!0,includeResult:!1,visibility:"query",tag:"listen-search-query"})).pipe((0,O.Z)((e,t)=>{let n=0===t;return n&&"reconnect"===e.type?(0,ee.$)(()=>Error("Failed to establish EventSource connection")):n&&"welcome"!==e.type?(0,ee.$)(()=>Error(`Received unexpected type of first event "${e.type}"`)):(0,Z.of)(e)}),(0,H.u)()),[g,b]=(0,et.j)(x,e=>"welcome"===e.type),y=JSON.stringify({fiilter:a,limit:s,params:o,searchQuery:d,perspective:l,sort:i,staticTypeNames:c});return(0,F.h)(g,b.pipe((0,en.c)(1e3,ei.E,{leading:!0,trailing:!0}
466))).pipe((0,ez.L)(e=>(c?(0,Z.of)(c):t.observable.fetch(`array::unique(*[${a}][]._type)`,o)).pipe((0,O.Z)(x=>{let g=(0,h._oG)(n,c||[]).filter(e=>!!x.includes(e.name)&&((0,r.Mq)(e,i.by,!0),!0)),b=(0,h.XZv)(g,t,{filter:a,params:o,strategy:p,maxDepth:u}),y=()=>b({query:d||"",types:g},{__unstable_extendedProjection:f,comments:[`findability-source: ${d?"list-query":"list"}`],limit:s,skipSortByScore:!0,sort:m,perspective:l}).pipe((0,E.T)(e=>e.hits.map(({hit:e})=>e)),(0,E.T)(e=>({type:"result",documents:e})));return"mutation"===e.type&&"query"!==e.visibility?(0,Q.O)(1200).pipe((0,O.Z)(y)):"reconnect"===e.type?(0,Z.of)(e):y()}))),(0,$.S)((e,t)=>({connected:"reconnect"!==t.type,documents:"result"===t.type?t.documents:e?.documents||[]}),null),(0,Y.p)(e=>null!==e),l5(y),(0,E.T)(({fromCache:e,value:t})=>({fromCache:e,...t})))}let l7={error:null,isRetrying:!1,retryCount:0,autoRetry:!1,canRetry:!1,isLoading:!0,isLoadingFullList:!1,fromCache:!1,items:[]},l8="[WARNING: This was thrown as a non-error. Only Error instances should be thrown]",l9=(0,g.i7)`
467  from {
468    transform: rotate(0deg);
469  }
470  to {
471    transform: rotate(360deg);
472  }
473`,se=(0,g.i7)`
474  0% {
475    opacity: 0;
476  }
477  50% {
478    opacity: 0.1;
479  }
480  100% {
481    opacity: 0.4;
482  }
483`,st=(0,g.I4)(p.Nl1)`
484  animation: ${l9} 500ms linear infinite;
485`,sn=(0,g.I4)(p.Nl1)`
486  animation: ${l9} 1500ms linear infinite;
487  opacity: 0.4;
488`,si=(0,g.I4)(p.Nl1)`
489  animation:
490    ${l9} 1500ms linear infinite,
491    ${se} 1000ms linear;
492  opacity: 0.4;
493`,sr=(0,c.memo)(function(e){var t;let n,{childItemId:i,isActive:l,pane:o,paneKey:d,sortOrder:u,layout:m}=e,x=(0,h.I07)(),g=(0,h.K0D)(),{perspectiveStack:b}=(0,h.QO2)(),{displayOptions:y,options:j}=o,{apiVersion:_,filter:w}=j,S=sP(j.params||lQ),k=(0,c.useMemo)(()=>{let e=l4(w,S);return e?.length===1?e[0]:null},[w,S]),C=y?.showIcons!==!1,{t:I}=(0,h.Bdt)(r.Z7),{title:z}=(0,h.FP1)(o),[T,A]=(0,c.useState)(""),[R,N]=(0,c.useState)(""),[W,J]=(0,c.useState)(null),U=k&&u?(t=x.get(k),(n=u.by.map(e=>{if(e.mapWith)return e;let n=function(e,t){let n=es.sH(t),i=e;for(let e of n){if(!i)return;if("string"==typeof e){i=function(e,t){if(!("fields"in e))return;let n=e.fields.find(e=>e.name===t);return n?n.type:void 0}(i,e);continue}if(!((0,f.tA)(e)||(0,f.wr)(e))||"array"!==i.jsonType)return;let[t,n]=i.of||[];if(n||!t)return;if(!(0,f.do)(t)){i=t;continue}let[r,l]=t.to||[];if(l||!r)return;i=r}return i}(t,e.field);return n?!function(e,t){let n=e.type;for(;n;){if(n.name===t||!n.type&&n.jsonType===t)return!0;n=n.type}return!1}(n,"datetime")?"string"===n.jsonType?{...e,mapWith:"lower"}:e:{...e,mapWith:"dateTime"}:e})).every((e,t)=>e===u.by[t])?u:{...u,by:n}):u,q=(0,h.$6H)(U),{error:X,isLoadingFullList:ee,isLoading:et,items:en,fromCache:ei,isRetrying:eo,autoRetry:ea,canRetry:ed,retryCount:ec,connected:eu,onLoadFullList:ep,onRetry:em}=function(e){let{filter:t,params:n,sortOrder:i,searchQuery:r,perspective:l,apiVersion:s}=e,o=(0,h.tH7)({...h.miu,apiVersion:s||h.miu.apiVersion}),{strategy:a}=(0,h.hA9)().search,d=(0,h.I07)(),u=(0,h.xx_)(),p=(0,c.useMemo)(()=>l4(t,n),[t,n]),[[m,f]]=(0,c.useState)(()=>(0,eE.t)()),[[x,g]]=(0,c.useState)(()=>(0,eE.t)()),b=(0,c.useMemo)(()=>{let e={client:o,filter:t,limit:100,params:n,schema:d,perspective:l,searchQuery:r||"",sort:i||lG,staticTypeNames:p,maxFieldDepth:u,searchStrategy:a},s=l6(e).pipe((0,D.t)({refCount:!0,bufferSize:1})),c=x.pipe((0,B.E)(s),(0,Y.p)(([,e])=>e?.documents.length===100),(0,L.s)(1),(0,O.Z)(()=>(0,K.x)((0,Z.of)({type:"loadFullList"}),l6({...e,limit:2e3}).pipe((0,E.T)(e=>({type:"result",result:e}))))),(0,H.u)());return(0,F.h)(s.pipe((0,E.T)(e=>({type:"result",result:e})),(0,V.Q)(c)),c).pipe((0,h.TMz)((e,t,n)=>{var i,r;let l=(r=e)instanceof Error?r:"object"==typeof r&&null!==r&&"message"in r&&"string"==typeof r.message?Error(`${r.message} ${l8}`):Error(`${String(r)} ${l8}`),s=window.navigator.onLine,o=s&&!((i=e)instanceof eI.Q6)&&(i instanceof eI.gP||!(i instanceof eI.MZ)||403===i.statusCode),a=t<10,d=(0,F.h)(s?m:(0,G.R)(window,"online"),s&&a?(0,Q.O)(1e3*t):er.t).pipe((0,L.s)(1),(0,M.n)(()=>(0,F.h)((0,Z.of)({type:"error",error:l,retrying:!0,autoRetry:a,canRetry:o,retryCount:t}
493),n)));return(0,K.x)((0,Z.of)({type:"error",error:l,retrying:!1,autoRetry:a,canRetry:o,retryCount:t}),d)}),(0,$.S)((e,t)=>{if("error"===t.type)return{...e,error:t.error,retryCount:t.retryCount,isRetrying:t.retrying,autoRetry:t.autoRetry,canRetry:t.canRetry};if("result"===t.type){var n;return{...e,error:null,isRetrying:!1,fromCache:t.result.fromCache,connected:t.result.connected,isLoading:!1,items:(n=t.result.documents,(0,h.Zck)(n).map(e=>{let t=e.draft||e.published||e.versions[0],n=!!e.draft;return{...t,hasPublished:!!e.published,hasDraft:n}})),isLoadingFullList:!1}}if("loadFullList"===t.type)return{...e,error:null,isLoadingFullList:!0};throw Error(`Unexpected event type: ${t.type}`)},l7))},[o,t,n,d,l,r,i,p,u,a,x,m]),{error:y,items:j,isLoading:_,fromCache:w,connected:S,canRetry:k,isLoadingFullList:C,isRetrying:I,autoRetry:z,retryCount:T}=(0,v.J)(b,l7);return{error:y,onRetry:f,isLoading:_,items:j,isRetrying:I,canRetry:k,retryCount:T,autoRetry:z,connected:S,fromCache:w,onLoadFullList:g,isLoadingFullList:C}}({apiVersion:_,filter:w,perspective:b,params:S,searchQuery:T?.trim(),sortOrder:q}
493),eh=et||g.loading,ef=(0,v.N)(e=>e.pipe((0,E.T)(e=>e.target.value),(0,P.M)(N),(0,el.s)(e=>""===e?(0,Z.of)(""):(0,Q.O)(300)),(0,P.M)(A))),ex=(0,c.useCallback)(()=>{A(""),N("")},[]),eg=(0,c.useCallback)(e=>{"Escape"===e.key&&ex()},[ex]),[eb,ey]=(0,c.useState)();(0,c.useEffect)(()=>{eb||eh||ey(d)},[eb,eh,d]),(0,c.useEffect)(()=>{ex(),ey()},[d,ex]);let ej=(0,c.useMemo)(()=>eu&&eh&&eb===d?"spinner":eu&&ei?"subtle":"initial",[eu,eb,ei,eh,d]),ev=(0,c.useMemo)(()=>"spinner"===ej?st:R&&"subtle"===ej?sn:p.WIv,[ej,R]);return(0,h.mnZ)(!eu),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.az,{paddingX:3,paddingBottom:3,children:(0,s.jsx)(a.ks,{"aria-label":I("panes.document-list-pane.search-input.aria-label"),autoComplete:"off",border:!1,clearButton:!!T,fontSize:[2,2,1],icon:ev,iconRight:eu&&("subtle"!==ej||R)?null:si,onChange:ef,onClear:ex,onKeyDown:eg,padding:2,placeholder:I("panes.document-list-pane.search-input.placeholder"),radius:2,ref:J,spellCheck:!1,value:R})}),(0,s.jsx)(l2,{childItemId:i,error:X,filterIsSimpleTypeConstraint:!!k,hasMaxItems:2e3===en.length,hasSearchQuery:!!T,isActive:l,isLazyLoading:ee,isLoading:eh,autoRetry:ea,canRetry:ed,retryCount:ec,isRetrying:eo,isConnected:eu,items:en,layout:m,muted:"subtle"===ej,loadingVariant:ej,onEndReached:ep,onRetry:em,paneTitle:z,searchInputElement:W,showIcons:C},d)]})}),sl=(0,c.memo)(e=>{let t,n,i,r,a,d,c,u,m,h=(0,o.c)(27),{contentAfter:f,index:x,initialValueTemplates:g,menuItemGroups:b,menuItems:y,setLayout:j,setSortOrder:v,title:_}=e;h[0]!==g?(t=void 0===g?[]:g,h[0]=g,h[1]=t):t=h[1];let w=t;h[2]!==b?(n=void 0===b?[]:b,h[2]=b,h[3]=n):n=h[3];let S=n;h[4]!==y?(i=void 0===y?[]:y,h[4]=y,h[5]=i):i=h[5];let k=i,{features:C}=tY(),{collapsed:I,isLast:E}=tt(),z=E&&!I?-1:0;h[6]!==j?(r=e=>{let{layout:t}=e;j(t)},h[6]=j,h[7]=r):r=h[7],h[8]!==v?(a=e=>{v(e)},h[8]=v,h[9]=a):a=h[9],h[10]!==r||h[11]!==a?(d={setLayout:r,setSortOrder:a},h[10]=r,h[11]=a,h[12]=d):d=h[12];let T=d;return h[13]!==T||h[14]!==w||h[15]!==S||h[16]!==k?(c=(0,s.jsx)(lO,{initialValueTemplateItems:w,actionHandlers:T,menuItemGroups:S,menuItems:k}),h[13]=T,h[14]=w,h[15]=S,h[16]=k,h[17]=c):c=h[17],h[18]!==C.backButton||h[19]!==x?(u=C.backButton&&x>0&&(0,s.jsx)(l.$n,{as:r9,"data-as":"a",icon:p.A60,mode:"bleed",tooltipProps:{content:"Back"}}),h[18]=C.backButton,h[19]=x,h[20]=u):u=h[20],h[21]!==f||h[22]!==c||h[23]!==u||h[24]!==z||h[25]!==_?(m=(0,s.jsx)(l.vE,{children:(0,s.jsx)(tj,{actions:c,backButton:u,contentAfter:f,tabIndex:z,title:_})}),h[21]=f,h[22]=c,h[23]=u,h[24]=z,h[25]=_,h[26]=m):m=h[26],m});function ss(e){let{row:t,table:n}=e,{selectedAnchor:i,setSelectedAnchor:r}=n.options.meta||{},l=(0,c.useCallback)(e=>{if(e.shiftKey&&null!=i){let e=t.index,r=e<i?e:i,l=e<i?i:e,s=n.getRowModel().flatRows.slice(r,l+1).map(({id:e})=>e),o=n.getSelectedRowModel().rows.map(({id:e})=>e);n.setRowSelection(()=>[...s,...o].reduce((e,t)=>({...e,[t]:!0}),{}))}else r&&(r(t.getIsSelected()?null:t.index),t.toggleSelected())},[i,t,r,n]);return(0,s.jsx)(a.Sc,{style:{paddingLeft:4},checked:e.row.getIsSelected(),disabled:!e.row.getCanSelect(),onChange:()=>null,onClick:l})}function so({children:e,table:t}){let[n,i]=(0,c.useState)(null),[r,l]=(0,c.useState)([]),o=(0,c.useCallback)((e=null)=>{n?.state==="focused"&&document.activeElement instanceof HTMLElement&&document.activeElement.blur(),i(e),l([])},[n]),a=(0,c.useCallback)(()=>o(),[o]),d=(0,c.useCallback)(e=>{if(!n)return;let i=t.getVisibleLeafColumns(),r=i.findIndex(e=>e.id===n.colId)+("left"===e?-1:1);r<0||r>=i.length||o({colId:i[r].id,rowIndex:n.rowIndex,state:"selected"})},[o,n,t]),p=(0,c.useCallback)(e=>{n&&l(t=>{let{rowIndex:i}=n,r=t=>t+("down"===e?1:-1);if(!t.length){let e=r(i);return e<0?[]:[e]}let l=r(t[t.length-1]);return l<0?t:l===i?[]:t.includes(l)?t.slice(0,-1):[...t,l]})},[n]),m=(0,c.useCallback)((e,t)=>{o({colId:e,rowIndex:t,state:"selected"})},[o]),h=(0,c.useCallback)(()=>{n&&(r.length?l([]):o("selected"===n.state?null:{...n,state:"selected"}))},[o,n,r.length]),f=(0,c.useCallback)((e,t)=>{if(!n)return;let i="ArrowDown"===t?"down":"up",r="down"===i?1:-1;if(e)p(i);else{let e=n.rowIndex+r;if(e<0)return;m(n.colId,e)}},[p,n,m]),x=(0,c.useCallback)(e=>{if(!n)return;let{key:t,shiftKey:i}=e;switch(t){case"Shift":break;case"Escape":h();break;case"ArrowDown":case"ArrowUp":e.preventDefault(),f(i,t);break;case"ArrowLeft":case"ArrowRight":"selected"===n.state&&(e.preventDefault(),d("ArrowLeft"===t?"left":"right"))}},[n,h,f,d]),g=(0,c.useCallback)(e=>{n&&(document.getElementById(`cell-${n.colId}-${n.rowIndex}`)?.contains(e.target)||a())},[a,n]);(0,c.useEffect)(()=>(n&&(document.addEventListener("keydown",x),document.addEventListener("click",g)),()=>{n&&(document.removeEventListener("keydown",x),document.removeEventListener("click",g))}),[g,x,n]);let b=(0,c.useCallback)(()=>i(e=>e?{...e,state:"focused"}:null),[]),y=(0,c.useCallback)((e,t)=>n?.colId!==e?null:n.rowIndex===t?"focused"===n.state?"focused":"selectedAnchor":r.includes(t)?"selectedRange":null,[n,r]),j=(0,c.useCallback)(()=>{n&&o({colId:n.colId,rowIndex:n.rowIndex+1,state:"selected"})},[o,n]),v=(0,c.useMemo)(()=>
493({focusAnchorCell:b,resetFocusSelection:a,setSelectedAnchorCell:m,getStateByCellId:y,submitFocusedCell:j}),[b,a,m,y,j]);return(0,s.jsx)(u.YW.Provider,{value:v,children:e})}sl.displayName="Memo(PaneHeader)";let sa=g.I4.td`
494  display: flex;
495  overflow: hidden;
496  box-sizing: border-box;
497  width: ${({width:e})=>e}px;
498  border-top: 1px solid var(--card-border-color);
499  background-color: var(--card-bg-color);
500`,sd=(0,g.I4)(sa)`
501  position: sticky;
502  z-index: 2;
503`;function sc(e){let{getValue:t,column:n,row:i,fieldType:r}=e,l=`cell-${n.id}-${i.index}`,[o,d]=(0,c.useState)(t()),[p,m]=(0,c.useState)(!1),h=(0,c.useRef)(null),{focusAnchorCell:f,resetFocusSelection:x,setSelectedAnchorCell:g,getStateByCellId:b,submitFocusedCell:y}=(()=>{let e=(0,c.useContext)(u.YW);if(void 0===e)throw Error("useDocumentSheetListContext must be used within an DocumentSheetListProvider");return e})(),j=b(n.id,i.index),v=(0,c.useCallback)(()=>{g(n.id,i.index),f()},[n.id,f,i.index,g]),{patchDocument:_}=e.table.options.meta||{},w=()=>{h.current?.focus(),h.current instanceof HTMLInputElement&&h.current.select()},S=(0,c.useCallback)(e=>{let{key:t}=e;"Enter"===t&&("selectedAnchor"===j&&w(),"focused"===j&&y())},[j,y]),k=(0,c.useCallback)(e=>{let t=e.clipboardData?.getData("Text");("string"==typeof t||"number"==typeof t)&&(d(t),_?.(i.id,n.id,t))},[n.id,_,i.id]),C=(0,c.useCallback)(()=>{navigator.clipboard.writeText(o.toString())},[o]);(0,c.useEffect)(()=>(("selectedAnchor"===j||"focused"===j)&&document.addEventListener("keydown",S),("selectedAnchor"===j||"selectedRange"===j)&&document.addEventListener("paste",k),"selectedAnchor"===j&&document.addEventListener("copy",C),()=>{("selectedAnchor"===j||"focused"===j)&&document.removeEventListener("keydown",S),("selectedAnchor"===j||"selectedRange"===j)&&document.removeEventListener("paste",k),"selectedAnchor"===j&&document.removeEventListener("copy",C)}),[l,j,n.id,b,C,S,k,i.index]);let I=()=>"focused"===j?"2px solid blue":"selectedRange"===j?"1px solid green":"selectedAnchor"===j?"1px solid blue":"1px solid transparent",E={onFocus:v,onBlur:()=>{p&&(_?.(i.id,n.id,o),m(!1)),x()},onMouseDown:e=>{2===e.detail?w():(e.preventDefault(),g(n.id,i.index))},"aria-selected":!!j,"data-testid":l,id:l,ref:e=>{h.current=e}};return"boolean"===r.name?(0,s.jsxs)(a.l6,{...E,onChange:()=>null,radius:0,style:{boxShadow:"none",border:I(),padding:0},value:JSON.stringify(o),children:[(0,s.jsx)("option",{value:"True",children:"True"}),(0,s.jsx)("option",{value:"False",children:"False"})]}):(0,s.jsx)(a.ks,{...E,size:0,radius:0,border:!1,style:{border:I(),padding:"22px 16px"},value:"string"==typeof o||"number"==typeof o?o:JSON.stringify(o),onChange:e=>{m(!0),d(e.target.value)}})}function su(e){let t=e.column.getIsPinned(),n=t&&e.column.getIsLastColumn("left")?2:1;return(0,s.jsx)(t?sd:sa,{style:{left:e.column.getStart("left")??void 0,borderRight:`${n}px solid var(--card-border-color)`},width:e.column.getSize(),children:(0,eT.Kv)(e.column.columnDef.cell,e.getContext?.())},e.row.original._id+e.id)}let sp=e=>{let{documentPreviewStore:t,row:n,schemaType:i}=e,r=(0,c.useMemo)(()=>(0,h.TU6)(t,i,n.original._id),[t,n.original._id,i]),l=(0,h.r0j)(n.original._id),{snapshot:o,isLoading:d}=(0,v.J)(r,{snapshot:null,isLoading:!0});if(d)return(0,s.jsx)(a.EY,{size:1,muted:!0,children:"Loading..."});let u=o?.title??"Untitled";return(0,s.jsxs)(a.so,{align:"center",gap:3,children:[(0,s.jsx)(h.ZDR,{draft:l.draft,published:l.published,versions:void 0}),(0,s.jsx)(a.EY,{size:1,children:u})]})},sm=(0,eA.FB)(),sh=["string","number","boolean"],sf=(e,t)=>e.fields.reduce((e,n)=>{let{type:i,name:r}=n;return sh.includes(i.name)?[...e,sm.accessor(t?`${t}.${n.name}`:n.name,{id:t?`${t}_${n.name}`:n.name,header:n.type.title,enableHiding:!0,cell:e=>(0,s.jsx)(sc,{...e,fieldType:i})})]:"object"===i.name&&(0,f.$d)(i)&&!t?[...e,sm.group({header:r,columns:sf(i,n.name)})]:e},[]),sx=e=>e.flatMap(e=>"accessorKey"in e?e:"columns"in e&&e.columns?sx(e.columns):[]);function sg({table:e}){let{t}=(0,h.Bdt)(),n=e.getVisibleLeafColumns().filter(e=>e.getCanHide()).length>=5,i=(0,c.useCallback)(()=>{e.resetColumnVisibility()},[e]);return(0,s.jsx)(l.IU,{button:(0,s.jsx)(l.$n,{mode:"bleed",text:t("sheet-list.edit-columns")}),id:"columns-control",menu:(0,s.jsx)(a.W1,{padding:3,paddingTop:4,style:{width:240},children:(0,s.jsxs)(a.so,{direction:"column",height:"fill",gap:3,children:[(0,s.jsx)(a.EY,{weight:"semibold",size:1,children:t("sheet-list.select-fields")}),(0,s.jsx)(a.so,{style:{flex:"1 1 auto",maxHeight:320,overflowY:"scroll"},children:(0,s.jsx)(a.BJ,{children:e.getAllLeafColumns().filter(e=>e.getCanHide()).map(t=>{let i,r;return(0,s.jsxs)(a.so,{marginY:2,align:"center",children:[(0,s.jsx)(a.Sc,{readOnly:(i=t.getIsVisible(),r=1===e.getVisibleLeafColumns().filter(e=>e.getCanHide()).length,n&&!i||r&&i),checked:t.getIsVisible(),onChange:()=>{t.toggleVisibility()},id:`col-visibility-${t.id}`,style:{display:"block"}}),(0,s.jsx)(a.az,{flex:1,paddingLeft:3,children:(0,s.jsx)(a.EY,{size:1,children:(0,s.jsx)("label",{htmlFor:`col-visibility-${t.id}`,children:t.columnDef.header?.toString()})})})]},t.id)})})}),(0,s.jsx)(l.$n,{width:"fill",mode:"ghost",text:t("sheet-list.reset-columns"),onClick:i})]})}),placement:"bottom",popover:{portal:!0}})}let sb=(0,g.I4)(a.so)`
504  flex-shrink: 0;
505`;function sy(){let e,t,n,i=(0,o.c)(5),{state:r}=(0,h.Z_W)(),{filtersVisible:l}=r;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)(h.w1_,{}),i[0]=e):e=i[0],i[1]!==l?(t=l&&(0,s.jsx)(h.CuW,{showTypeFilter:!1}),i[1]=l,i[2]=t):t=i[2],i[3]!==t?(n=(0,s.jsxs)(sb,{children:[e,t]}),i[3]=t,i[4]=n):n=i[4],n}let sj=g.I4.th`
506  margin: 16px;
507  z-index: 1;
508  padding: 22px 0px;
509  border-top: 1px solid var(--card-border-color);
510  background-color: var(--card-badge-default-bg-color);
511  box-sizing: border-box;
512  text-align: left;
513  width: ${({width:e})=>e}px;
514  max-width: ${({width:e})=>e}px;
515`,sv=(0,g.I4)(sj)`
516  position: sticky;
517  z-index: 2;
518`,s_=g.I4.div`
519  visibility: hidden;
520
521  ${sj}:hover & {
522    visibility: visible;
523  }
524`;function sw(e){let{header:t,headerGroup:n}=e,{t:i}=(0,h.Bdt)(),r=t.column.getIsPinned(),o=n.depth>0&&!t.column.parent?null:(0,s.jsx)(a.EY,{size:1,weight:"semibold",textOverflow:"ellipsis",children:(0,eT.Kv)(t.column.columnDef.header,t.getContext())}),d=t.column.getCanHide()&&(0===n.depth?!t.column.columns.length:t.column.parent),c=r&&t.column.getIsLastColumn("left")?2:1;return(0,s.jsx)(r?sv:sj,{style:{left:t.column.getStart("left")??void 0,borderRight:`${c}px solid var(--card-border-color)`},"data-testid":`header-${t.id}`,width:t.getSize(),children:(0,s.jsxs)(a.so,{justify:"space-between",marginX:2,align:"baseline",children:[(0,s.jsx)(l.m_,{delay:500,content:o,children:(0,s.jsx)(a.az,{style:{boxSizing:"border-box"},marginLeft:3,marginRight:3,children:o})}),d&&(0,s.jsx)(s_,{children:(0,s.jsx)(l.IU,{button:(0,s.jsx)(l.$n,{tooltipProps:{content:"Open field menu"},mode:"bleed",icon:p.riS,"data-testid":"field-menu-button"}),id:"field menu",popover:{placement:"bottom-end"},menu:(0,s.jsx)(a.W1,{children:(0,s.jsx)(l.Dr,{text:i("sheet-list.hide-field"),icon:p.USm,onClick:()=>t.column.toggleVisibility()})})})})]})},t.id)}function sS({table:e}){return(0,s.jsx)(l.vE,{children:(0,s.jsxs)(a.so,{gap:3,align:"center",children:[(0,s.jsx)(l.$n,{onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),icon:p.Zxx,tooltipProps:{content:"Go to first page"}}),(0,s.jsx)(l.$n,{onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),icon:p.YJP,tooltipProps:{content:"Go to previous page"}}),(0,s.jsxs)(a.EY,{style:{whiteSpace:"nowrap"},children:[e.getState().pagination.pageIndex+1," of ",e.getPageCount()]}),(0,s.jsx)(l.$n,{onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),icon:p.vKP,tooltipProps:{content:"Go to next page"}}),(0,s.jsx)(l.$n,{onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),icon:p.yBO,tooltipProps:{content:"Go to last page"}}),(0,s.jsx)("select",{value:e.getState().pagination.pageSize,onChange:t=>{e.setPageSize(Number(t.target.value))},children:[25,50,100].map(e=>(0,s.jsx)("option",{value:e,children:e},e))})]})})}function sk(e,t){switch(t.type){case"DOCUMENTS_SET":{let n=t.documents.reduce((e,t)=>
524({...e,[t._id]:t}),{});return{...e,documents:n}}case"DOCUMENT_RECEIVED":{let n=t.payload;return{...e,documents:{...e.documents,[n._id]:n}}}case"DOCUMENT_DELETED":{let{[t.id]:n,...i}=e.documents;return{...e,documents:i}}case"DOCUMENT_UPDATED":{let n=t.payload,i=n._id,r={...e.documents[i],...n};return{...e,documents:{...e.documents,[i]:r}}}default:return e}}let sC={events:["welcome","mutation","reconnect"],includeResult:!0,visibility:"query",includeAllVersions:!0,tag:"document-sheet-list-store"},sI=(0,g.I4)(a.so)`
525  height: 100%;
526`,sE=g.I4.div`
527  overflow: auto; //our scrollable table container
528  position: relative; //needed for sticky header
529`,sz=g.I4.table`
530  border-collapse: separate;
531  border-spacing: 0;
532  font-family: arial, sans-serif;
533  white-space: nowrap;
534  width: 100%;
535  border: 1px solid lightgray;
536
537  thead {
538    display: grid;
539    position: sticky;
540    top: 0;
541    z-index: 10;
542  }
543  tr {
544    padding: 0;
545  }
546  tr:last-child {
547    border-bottom: none;
548  }
549`;function sT({documentSchemaType:e}){let{dispatch:t,state:n}=(0,h.Z_W)(),{columns:i,initialColumnsVisibility:r}=function(e){let t=(0,h.yKO)(),n=(0,c.useMemo)(()=>e?[sm.display({id:"selected",enableHiding:!1,header:e=>(0,s.jsxs)(a.az,{children:[(0,s.jsx)(a.Sc,{style:{paddingLeft:4},indeterminate:e.table.getIsSomeRowsSelected(),onChange:e.table.getToggleAllPageRowsSelectedHandler()}),e.table.getSelectedRowModel().rows.length," selected"]}),cell:ss}),sm.accessor("Preview",{enableHiding:!1,id:"Preview",cell:n=>(0,s.jsx)(sp,{...n,documentPreviewStore:t,schemaType:e})}),...sf(e)]:[],[t,e]),[i]=(0,c.useMemo)(()=>sx(n).reduce(([e,t],n)=>{if(!n.id)throw Error("Column must have an id");let i=n.id;return n.enableHiding?5===t?[{...e,[i]:!1},t]:[{...e,[i]:!0},t+1]:[{...e,[i]:!0},t]},[{},0]),[n]);return{columns:n,initialColumnsVisibility:i}}(e),{data:l}=function(e){let t,n,i,r,l=(0,o.c)(12),{typeName:s}=e,{state:a}=(0,h.Z_W)();l[0]!==a.result.hits?(t=new Map,a.result.hits.forEach(e=>t.set((0,m.IM)(e.hit._id),e.hit)),l[0]=a.result.hits,l[1]=t):t=l[1];let d=t,u=`_type == "${s}"`;l[2]!==u?(n={filter:u},l[2]=u,l[3]=n):n=l[3];let{data:p,isLoading:f}=function(e){let t,n,i,r,l,s,a,d,u,p,f=(0,o.c)(27),{filter:x,params:g,apiVersion:b}=e,y=`*[${x}][0...2000]`,j=b||h.miu.apiVersion;f[0]!==j?(t={...h.miu,apiVersion:j},f[0]=j,f[1]=t):t=f[1];let v=(0,h.tH7)(t);f[2]===Symbol.for("react.memo_cache_sentinel")?(n={documents:{}},f[2]=n):n=f[2];let[_,w]=(0,c.useReducer)(sk,n),[S,k]=(0,c.useState)(null!==v),[C,I]=(0,c.useState)(null);f[3]!==y||f[4]!==v||f[5]!==g?(i=async()=>{if(!v)return void k(!1);try{let e=await v.fetch(y,g);w({type:"DOCUMENTS_SET",documents:e}),k(!1)}catch(e){I(e)}},f[3]=y,f[4]=v,f[5]=g,f[6]=i):i=f[6];let E=i;f[7]!==E?(r=async e=>{if("welcome"===e.type&&(k(!0),await E(),k(!1)),"reconnect"===e.type&&k(!0),"mutation"===e.type){if("appear"===e.transition){let t=e.result;t&&w({type:"DOCUMENT_RECEIVED",payload:t})}if("disappear"===e.transition&&w({type:"DOCUMENT_DELETED",id:e.documentId}),"update"===e.transition){let t=e.result;t&&w({type:"DOCUMENT_UPDATED",payload:t})}}},f[7]=E,f[8]=r):r=f[8];let T=r;e:{let e;if(!v){let e;f[9]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Z.of)(),f[9]=e):e=f[9],l=e;break e}if(f[10]!==y||f[11]!==v.observable||f[12]!==g){let t;f[14]===Symbol.for("react.memo_cache_sentinel")?(t=e=>(I(e),(0,Z.of)(e)),f[14]=t):t=f[14],e=v.observable.listen(y,g,sC).pipe((0,z.W)(t)),f[10]=y,f[11]=v.observable,f[12]=g,f[13]=e}else e=f[13];l=e}let A=l;f[15]!==T||f[16]!==A?(s=()=>{let e=A.subscribe(T);return()=>{e?.unsubscribe()}},a=[T,A],f[15]=T,f[16]=A,f[17]=s,f[18]=a):(s=f[17],a=f[18]),(0,c.useEffect)(s,a),f[19]!==_.documents?(d=Object.keys(_.documents).reduce((e,t)=>{let n=_.documents[t],i=n._id===(0,m.T4)(n._id),r=i?n._id:(0,m.T4)(n._id);return e[r]&&!i||(e[r]=n),e},{}),f[19]=_.documents,f[20]=d):d=f[20];let P=d;f[21]!==P?(u=Object.values(P),f[21]=P,f[22]=u):u=f[22];let R=u;return f[23]!==R||f[24]!==C||f[25]!==S?(p={data:R,isLoading:S,error:C},f[23]=R,f[24]=C,f[25]=S,f[26]=p):p=f[26],p}(n);if(l[4]!==p||l[5]!==d){let e;l[7]!==d?(e=e=>d.has((0,m.IM)(e._id)),l[7]=d,l[8]=e):e=l[8],i=p.filter(e),l[4]=p,l[5]=d,l[6]=i}else i=l[6];let x=i;return l[9]!==x||l[10]!==f?(r={data:x,isLoading:f},l[9]=x,l[10]=f,l[11]=r):r=l[11],r}({typeName:e.name}),[d,u]=(0,c.useState)(null),p=n.result.hits.length,f=(0,eT.N4)({data:l,columns:i,getCoreRowModel:(0,eA.HT)(),getFilteredRowModel:(0,eA.hM)(),getPaginationRowModel:(0,eA.kW)(),autoResetPageIndex:!1,initialState:{columnPinning:{left:["selected","Preview"]},pagination:{pageSize:25},columnVisibility:r},getRowId:e=>e._id,meta:{selectedAnchor:d,setSelectedAnchor:u,patchDocument:(e,t,n
549)=>null}}),{rows:x}=f.getRowModel();(0,c.useEffect)(()=>(t({type:"TERMS_TYPE_ADD",schemaType:e}),()=>{t({type:"TERMS_TYPE_REMOVE",schemaType:e})}),[e,t]);let g=(0,c.useCallback)(e=>(0,s.jsx)(a.az,{as:"tr",paddingY:2,style:{display:"flex",width:"100%"},children:e.getVisibleCells().map(t=>(0,s.jsx)(su,{...t},e.original._id+t.id))},e.original._id+e.id),[]),b=`Total: ${p} rows, showing ${x.length} rows`;return(0,s.jsxs)(sI,{direction:"column",paddingX:3,"data-testid":"document-sheet-list-pane",children:[(0,s.jsxs)(a.so,{direction:"row",align:"center",paddingY:3,paddingX:1,justify:"space-between",children:[(0,s.jsxs)(a.so,{direction:"row",align:"center",children:[(0,s.jsx)(sy,{}),(0,s.jsx)(a.EY,{size:0,muted:!0,children:b})]}),(0,s.jsx)(sg,{table:f})]}),(0,s.jsx)(sE,{children:(0,s.jsx)(so,{table:f,children:(0,s.jsxs)(sz,{children:[(0,s.jsx)("thead",{children:f.getHeaderGroups().map(e=>(0,s.jsx)(a.az,{as:"tr",children:e.headers.map(t=>(0,s.jsx)(sw,{header:t,headerGroup:e},t.id))},e.id))}),(0,s.jsx)("tbody",{children:f.getRowModel().rows.map(g)})]})})}),(0,s.jsx)(a.so,{justify:"flex-end",padding:3,gap:4,paddingY:5,children:(0,s.jsx)(sS,{table:f})})]})}function sA(e){let t=(0,h.I07)(),n=e.pane.schemaTypeName,i=t.get(n);if(!i||!(0,f.JR)(i))throw Error(`Schema type "${n}" not found or not a document schema`);return(0,s.jsx)(h.YLU,{children:(0,s.jsx)(sT,{...e,documentSchemaType:i})})}function sP(e){let[t,n]=(0,c.useState)(e);return k(t,e)?t:(n(e),e)}let sR=(0,c.memo)(function(e){let t,n,i,r,l,a,d,c,u,p=(0,o.c)(36),{index:m,isSelected:f,pane:x,paneKey:g}=e,{name:b}=(0,h.For)(),{defaultLayout:y,initialValueTemplates:j,menuItemGroups:v,menuItems:_,options:w}=x,k=void 0===j?h.Mlv:j,{defaultOrdering:C,filter:I}=w,E=void 0===C?h.Mlv:C,z=sP(w.params||lQ),T=x.source;e:{let e;p[0]!==I||p[1]!==z?(e=l4(I,z),p[0]=I,p[1]=z,p[2]=e):e=p[2];let n=e;if(n?.length===1){t=n[0];break e}t=null}let A=t,[P,R]=tG("layout",A??x.id,void 0===y?"default":y),{title:M}=(0,h.FP1)(x);p[3]!==E?(n=E?.length>0?{by:E}:lG,p[3]=E,p[4]=n):n=p[4];let D=n,[$,B]=tG("sort-order",A??x.id,D);p[5]!==P||p[6]!==_||p[7]!==$?(i=(e=>{let{menuItems:t,sortOrderRaw:n,layout:i}=e;return t?.map(e=>e.params?.layout?{...e,selected:i===e.params?.layout}:e?.params?.by?{...e,selected:S(n?.by,e?.params?.by||h.Mlv)}:{...e,selected:!1})})({menuItems:_,sortOrderRaw:$,layout:P}),p[5]=P,p[6]=_,p[7]=$,p[8]=i):i=p[8];let Y=i,L="sheetList"===P;p[9]!==L||p[10]!==P||p[11]!==e||p[12]!==$?(r=L?(0,s.jsx)(sA,{...e},e.pane.id):(0,s.jsx)(sr,{...e,sortOrder:$,layout:P}),p[9]=L,p[10]=P,p[11]=e,p[12]=$,p[13]=r):r=p[13];let O=r,H=T||b;return p[14]!==L?(l=L?{}:{currentMaxWidth:350,maxWidth:640},p[14]=L,p[15]=l):l=p[15],p[16]!==x.source?(a=nq,p[16]=x.source,p[17]=a):a=p[17],p[18]!==m||p[19]!==k||p[20]!==v||p[21]!==Y||p[22]!==R||p[23]!==B||p[24]!==M?(d=(0,s.jsx)(sl,{index:m,initialValueTemplates:k,menuItemGroups:v,menuItems:Y,setLayout:R,setSortOrder:B,title:M}),p[18]=m,p[19]=k,p[20]=v,p[21]=Y,p[22]=R,p[23]=B,p[24]=M,p[25]=d):d=p[25],p[26]!==f||p[27]!==g||p[28]!==O||p[29]!==d||p[30]!==l||p[31]!==a?(c=(0,s.jsxs)(e9,{"data-ui":"DocumentListPane",id:g,minWidth:320,...l,selected:f,children:[a,d,O]}),p[26]=f,p[27]=g,p[28]=O,p[29]=d,p[30]=l,p[31]=a,p[32]=c):c=p[32],p[33]!==c||p[34]!==H?(u=(0,s.jsx)(h.NeO,{name:H,children:c}),p[33]=c,p[34]=H,p[35]=u):u=p[35],u});sR.displayName="Memo(PaneContainer)";let sM=e=>{let{liveEditSchemaType:t,version:n}=e;return t&&!n?{label:"Live",color:"danger"}:null};sM.displayName="LiveEditBadge";let sD={activePanes:[]};function s$(e){sD.activePanes=e}function sB(e,t,n,i){let r=n?.panes||[],l=sD.activePanes||[],s=t.id||(0,x.A)();for(let n=l.length-1;n>=0;n--){let o=l[n];if("object"==typeof o&&(o.canHandleIntent?.(e,t,{pane:o,index:n})||"documentList"===o.type&&o.schemaTypeName===t.type&&"_type == $type"===o.options.filter)){let l=function(e,{template:t,version:n}){return"create"!==e?nX:t&&n?{template:t,version:n}:t?{template:t}:n?{version:n}:nX}(e,t);return{panes:r.slice(0,n).concat([[{id:s,params:l,payload:i}]])}}}return{intent:e,params:t,payload:i}}let sY=(0,g.I4)(h.PaW)`
550  height: 100%;
551  overflow: auto;
552  position: relative;
553  scroll-behavior: smooth;
554`,sL=(0,g.I4)(a.az)`
555  &:not([hidden]) {
556    display: grid;
557  }
558  grid-template-columns: 48px 1fr;
559  align-items: center;
560  gap: 0.25em;
561`;function sO(e){let t,n,i,l,d,u,p,m,f,x,g,b,y=(0,o.c)(39),{showChanges:j}=e,{documentId:v,schemaType:_,timelineError:w,timelineStore:S,value:k}=tD(),{selectedReleaseId:C}=(0,h.QO2)(),[I,E]=(0,c.useState)(null),z=(0,h.SfM)(S,sK),T=(0,h.SfM)(S,sF),A=(0,h.SfM)(S,sZ),P=(0,h.SfM)(S,sN),R=(0,h.SfM)(S,sV),M="loading"===P,D=!A,{t:$}=(0,h.Bdt)(r.Z7);y[0]!==T||y[1]!==v||y[2]!==D||y[3]!==_||y[4]!==k?(t={documentId:v,schemaType:_,FieldWrapper:sH,rootDiff:T,isComparingCurrent:D,value:k,showFromValue:!0},y[0]=T,y[1]=v,y[2]=D,y[3]=_,y[4]=k,y[5]=t):t=y[5];let B=t;if(C){let e;return y[6]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)(a.so,{"data-testid":"review-changes-pane",direction:"column",height:"fill",children:(0,s.jsx)(a.Zp,{flex:1,padding:2,paddingTop:0,children:(0,s.jsx)(i7,{versionError:!0})})}),y[6]=e):e=y[6],e}return y[7]!==$?(n=$("changes.from.label"),y[7]=$,y[8]=n):n=y[8],y[9]!==n?(i=(0,s.jsx)(a.EY,{size:1,muted:!0,children:n}),y[9]=n,y[10]=i):i=y[10],y[11]!==R?(l=(0,s.jsx)(re,{mode:"since",chunk:R,placement:"bottom-start"}),y[11]=R,y[12]=l):l=y[12],y[13]!==$?(d=$("changes.to.label"),y[13]=$,y[14]=d):d=y[14],y[15]!==d?(u=(0,s.jsx)(a.EY,{size:1,muted:!0,children:d}),y[15]=d,y[16]=u):u=y[16],y[17]!==z?(p=(0,s.jsx)(re,{chunk:z,mode:"rev",placement:"bottom-end"}),y[17]=z,y[18]=p):p=y[18],y[19]!==i||y[20]!==l||y[21]!==u||y[22]!==p?(m=(0,s.jsx)(a.az,{padding:3,children:(0,s.jsxs)(sL,{paddingX:2,paddingBottom:2,children:[i,l,u,p]})}),y[19]=i,y[20]=l,y[21]=u,y[22]=p,y[23]=m):m=y[23],y[24]!==T||y[25]!==B||y[26]!==M||y[27]!==_||y[28]!==j||y[29]!==w?(f=j&&(0,s.jsx)(sW,{diff:T,documentContext:B,error:w,loading:M,schemaType:_}),y[24]=T,y[25]=B,y[26]=M,y[27]=_,y[28]=j,y[29]=w,y[30]=f):f=y[30],y[31]!==f?(x=(0,s.jsx)(sY,{"data-ui":"Scroller",ref:E,children:(0,s.jsx)(a.az,{flex:1,paddingX:3,height:"fill",children:f})}),y[31]=f,y[32]=x):x=y[32],y[33]!==I||y[34]!==x?(g=(0,s.jsx)(a.Zp,{flex:1,paddingX:2,paddingY:2,children:(0,s.jsx)(a.EZ,{element:I,children:x})}),y[33]=I,y[34]=x,y[35]=g):g=y[35],y[36]!==g||y[37]!==m?(b=(0,s.jsxs)(a.so,{"data-testid":"review-changes-pane",direction:"column",height:"fill",overflow:"hidden",children:[m,g]}),y[36]=g,y[37]=m,y[38]=b):b=y[38],b}function sH(e){return(0,s.jsx)(h.uD1,{...e,hasRevertHover:!1})}function sV(e){return e.sinceTime}function sN(e){return e.selectionState}function sZ(e){return e.onOlderRevision}function sF(e){return e.diff}function sK(e){return e.revTime}function sW(e){let t,n,i=(0,o.c)(9),{error:r,diff:l,documentContext:a,loading:d,schemaType:c}=e;if(r){let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)(h.J7,{}),i[0]=e):e=i[0],e}if(d){let e;return i[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)(h.gd4,{showText:!0}),i[1]=e):e=i[1],e}if(!l){let e;return i[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)(h.J7,{}),i[2]=e):e=i[2],e}return i[3]!==l||i[4]!==c?(t=(0,s.jsx)(h.Vki,{diff:l,schemaType:c}),i[3]=l,i[4]=c,i[5]=t):t=i[5],i[6]!==a||i[7]!==t?(n=(0,s.jsx)(u.HU.Provider,{value:a,children:t}),i[6]=a,i[7]=t,i[8]=n):n=i[8],n}function sJ(e){let t,n,i,r,d,c,u,p,m=(0,o.c)(27),{event:f,isSelected:x,onSelect:g,optionsMenu:b}=e,{t:y}=(0,h.Bdt)("studio");m[0]!==f?(t=!(0,h.zOx)(f)&&!(0,h.GDb)(f)&&!(0,h.ayN)(f)&&!(0,h.Bkf)(f)&&!(0,h.azN)(f),m[0]=f,m[1]=t):t=m[1];let j=t;m[2]!==f||m[3]!==j||m[4]!==g?(n=e=>{e.preventDefault(),e.stopPropagation(),j&&g(f)},m[2]=f,m[3]=j,m[4]=g,m[5]=n):n=m[5];let v=n;m[6]!==j||m[7]!==y?(i=j?"":y("changes.not-selectable"),m[6]=j,m[7]=y,m[8]=i):i=m[8];let _=j?"button":"div",w=j?"pointer":"default";return m[9]!==w?(r={cursor:w,width:"100%"},m[9]=w,m[10]=r):r=m[10],m[11]!==f?(d=(0,s.jsx)(h.JhA,{event:f,showChangesBy:"tooltip"}),m[11]=f,m[12]=d):d=m[12],m[13]!==f.timestamp||m[14]!==v||m[15]!==x||m[16]!==_||m[17]!==r||m[18]!==d?(c=(0,s.jsx)(a.Zp,{as:_,onClick:v,padding:2,pressed:x,radius:2,"data-ui":"timelineItem","data-testid":"timeline-item-button","data-chunk-timestamp":f.timestamp,style:r,children:d}),m[13]=f.timestamp,m[14]=v,m[15]=x,m[16]=_,m[17]=r,m[18]=d,m[19]=c):c=m[19],m[20]!==j||m[21]!==i||m[22]!==c?(u=(0,s.jsx)(l.m_,{content:i,disabled:j,children:c}),m[20]=j,m[21]=i,m[22]=c,m[23]=u):u=m[23],m[24]!==b||m[25]!==u?(p=(0,s.jsxs)(a.so,{gap:1,children:[u,b]}),m[24]=b,m[25]=u,m[26]=p):p=m[26],p}function sU(e){let t,n,i,d,c,u,p,f,x,g,b,y=(0,o.c)(42),{event:j}=e,{t:v}=(0,h.Bdt)(r.Z7),{t:w}=(0,h.Bdt)(),S=(0,a.WP)(),{params:k,setParams:C}=ny(),I=(0,h._T7)(),{document:E}=(0,h.hA9)(),{drafts:z}=E,{enabled:T}=z;y[0]!==j.id||y[1]!==j.versionId||y[2]!==j.versionRevisionId||y[3]!==k||y[4]!==C?(t=()=>{C({...k,rev:j.versionRevisionId||"@lastPublished",since:void 0,historyEvent:j.id,historyVersion:(0,m._S)(j.versionId)})},y[0]=j.id,y[1]=j.versionId,y[2]=j.versionRevisionId,y[3]=k,y[4]=C,y[5]=t):t=y[5];let A=t;y[6]!==j.versionRevisionId||y[7]!==T||y[8]!==k||y[9]!==C||y[10]!==I?(n=()=>{C({...k,rev:j.versionRevisionId,preserveRev:"true",since:void 0}),setTimeout(()=>{I(T?"drafts":"published")},100)},y[6]=j.versionRevisionId,y[7]=T,y[8]=k,y[9]=C,y[10]=I,y[11]=n):n=y[11];let P=n;y[12]!==j.release?(i=e=>{let{children:t}=e;return(0,s.jsx)(h.RwK,{$tone:j.release?(0,h.Jrl)(j.release)?(0,h.Y73)(j.release):"default":void 0,children:t})},y[12]=j.release,y[13]=i):i=y[13];let R=i,M=j.release&&!(0,h.Jrl)(j.release),D=`timeline-item-menu-button-${j.versionId}`;
561y[14]!==v?(d=v("timeline-item.menu-button.aria-label"),y[14]=v,y[15]=d):d=y[15],y[16]!==j.release||y[17]!==M||y[18]!==v?(c=M?v("timeline-item.not-found-release.tooltip",{releaseId:j.release?._id?(0,h._hI)(j.release._id):void 0}):v("timeline-item.menu-button.tooltip"),y[16]=j.release,y[17]=M,y[18]=v,y[19]=c):c=y[19],y[20]!==c?(u={content:c},y[20]=c,y[21]=u):u=y[21],y[22]!==M||y[23]!==d||y[24]!==u?(p=(0,s.jsx)(h.VJU,{"aria-label":d,tooltipProps:u,disabled:M}),y[22]=M,y[23]=d,y[24]=u,y[25]=p):p=y[25],y[26]!==R||y[27]!==j.release||y[28]!==j.versionRevisionId||y[29]!==P||y[30]!==A||y[31]!==v||y[32]!==w?(f=(0,s.jsx)(a.W1,{padding:1,children:j.release?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(_.RZ,{intent:h.wwz,params:{id:(0,h._hI)(j.release._id)},style:{textDecoration:"none"},children:(0,s.jsx)(a.Dr,{padding:3,children:(0,s.jsx)(a.so,{align:"center",justify:"flex-start",children:(0,s.jsx)(a.EY,{size:1,style:{textDecoration:"none"},children:(0,s.jsx)(h.HTc,{components:{VersionBadge:e=>{let{children:t}=e;return(0,s.jsx)(R,{children:t})}},i18nKey:"events.open.release",values:{releaseTitle:j.release.metadata?.title||w("release.placeholder-untitled-release")},t:v})})})})}),(0,s.jsx)(a.Dr,{onClick:A,children:(0,s.jsx)(a.so,{align:"center",justify:"flex-start",children:(0,s.jsx)(a.EY,{size:1,children:(0,s.jsx)(h.HTc,{components:{VersionBadge:e=>{let{children:t}=e;return(0,s.jsx)(R,{children:t})}},i18nKey:"events.inspect.release",values:{releaseTitle:j.release.metadata?.title||w("release.placeholder-untitled-release")},t:v})})})})]}):(0,s.jsx)(a.Dr,{onClick:P,disabled:!j.versionRevisionId,children:(0,s.jsx)(a.so,{align:"center",children:(0,s.jsx)(a.EY,{size:1,children:(0,s.jsx)(h.HTc,{components:{VersionBadge:sG},i18nKey:"events.open.draft",t:v})})})})}),y[26]=R,y[27]=j.release,y[28]=j.versionRevisionId,y[29]=P,y[30]=A,y[31]=v,y[32]=w,y[33]=f):f=y[33];let $=!S.elements?.[i9]||i9;return y[34]===Symbol.for("react.memo_cache_sentinel")?(x=["bottom-end","bottom-start"],y[34]=x):x=y[34],y[35]!==$?(g={portal:$,placement:"bottom",fallbackPlacements:x},y[35]=$,y[36]=g):g=y[36],y[37]!==f||y[38]!==g||y[39]!==D||y[40]!==p?(b=(0,s.jsx)(l.IU,{id:D,button:p,menu:f,popover:g}),y[37]=f,y[38]=g,y[39]=D,y[40]=p,y[41]=b):b=y[41],b}function sG(e){let{children:t}=e;return(0,s.jsx)(h.RwK,{$tone:"caution",children:t})}let sQ=y.P.create(a.az),sq={initial:{opacity:0}
561,animate:{opacity:1},exit:{opacity:0}},sX=({events:e,hasMoreEvents:t,selectedEventId:n,onLoadMore:i,onSelect:r,listMaxHeight:l="calc(100vh - 280px)",fetchEventChildren:o})=>{let[d,u]=(0,c.useState)(!1),{t:p}=(0,h.Bdt)("studio"),[m,f]=(0,c.useState)(()=>{if(n){let t=e.find(e=>e.id===n);if(t&&"parentId"in t&&t.parentId)return new Set([t.parentId])}return new Set}),[x,g]=(0,c.useState)(new Set),b=(0,c.useMemo)(()=>e.filter(t=>(0,h.y4b)(t)&&t.parentId?e[e.length-1].id===t.id||m.has(t.parentId):!(0,h.WUV)(t)||!t.parentId||m.has(t.parentId)),[m,e]),y=(0,c.useCallback)(e=>async()=>{let t=e.id,n=!1;f(e=>{let i=new Set(e);return e.has(t)?i.delete(t):(n=!0,i.add(t)),i}),n&&(g(e=>{let n=new Set(e);return n.add(t),n}),await o(e),g(e=>{let n=new Set(e);return n.delete(t),n}))},[o,g]),j=(0,c.useCallback)(e=>{r(e)},[r]),v=(0,c.useCallback)(e=>{let t=(0,h.tfA)(e.documentId);return(0,h.BaK)(e)&&"published"===t?(0,s.jsx)(sU,{event:e}):(0,h.BaK)(e)&&"draft"===t&&e.creationEvent||(0,h.zOx)(e)&&e.creationEvent?(0,s.jsx)(iN,{isExpanded:m.has(e.id),onExpand:y(e)}):null},[m,y]),_=(0,c.useCallback)((e,{activeIndex:i})=>{let r=(0,h.y4b)(e)&&e.parentId&&x.has(e.parentId),l=i===b.length-1;return r?(0,s.jsx)(sQ,{animate:{opacity:1},initial:{opacity:0}
561,transition:{duration:.2,delay:.2},children:(0,s.jsx)(a.so,{align:"center",justify:"center",style:{height:57},children:(0,s.jsx)(a.y$,{})})}):(0,s.jsxs)(sQ,{paddingBottom:1,paddingRight:1,animate:"animate",exit:"exit",initial:"initial",variants:"parentId"in e?sq:void 0,paddingLeft:((0,h.WUV)(e)||(0,h.y4b)(e))&&e.parentId&&!l?4:1,children:[(0,s.jsx)(sJ,{event:e,isSelected:e.id===n,onSelect:j,optionsMenu:v(e)}),l&&t&&(0,s.jsx)(h.gd4,{})]},e.timestamp)},[x,n,j,v,b.length,t]);(0,c.useEffect)(()=>u(!0),[]);let w=b.findIndex(e=>e.id===n);return(0,s.jsx)(iK,{$visible:!w||d,"data-ui":"timeline",children:b.length>0?(0,s.jsx)(iF,{direction:"column",$maxHeight:l,id:"timeline-list-wrapper",children:(0,s.jsx)(h.oIj,{activeItemDataAttr:"data-hovered",ariaLabel:p("timeline.list.aria-label"),autoFocus:"list",initialIndex:w,initialScrollAlign:"center",itemHeight:57,items:b,onEndReached:i,onEndReachedIndexOffset:20,overscan:5,renderItem:_,wrapAround:!1})}):(0,s.jsxs)(a.BJ,{padding:3,space:3,children:[(0,s.jsx)(a.EY,{size:1,weight:"medium",children:p("timeline.error.no-document-history-title")}),(0,s.jsx)(a.EY,{muted:!0,size:1,children:p("timeline.error.no-document-history-description")})]})})};sX.displayName="EventsTimeline";let s0=(0,g.I4)(l.AM)`
562  overflow: hidden;
563  overflow: clip;
564`,s1={timestamp:{dateStyle:"medium",timeStyle:"short"}};function s2({event:e,events:t,mode:n,placement:i}){let{setTimelineRange:r}=tD(),[o,u]=(0,c.useState)(!1),[m,f]=(0,c.useState)(null),[x,g]=(0,c.useState)(null),b=(0,d.dj)(),{nextCursor:y,loading:j,error:v,findRangeForRevision:_,findRangeForSince:w,loadMoreEvents:S,expandEvent:k}=(0,h.LJN)(),{t:C}=(0,h.Bdt)("studio"),I=(0,c.useCallback)(()=>{u(!0)},[]),E=(0,c.useCallback)(()=>{u(!1)},[]),z=(0,c.useCallback)(e=>{o&&("Escape"===e.key||"Tab"===e.key)&&(E(),m?.focus())},[m,E,o]);(0,a.Pm)(z),(0,a.PR)(o&&E,()=>[m,x]);let T=(0,c.useCallback)(e=>{try{if((0,h.zOx)(e)||(0,h.GDb)(e)||(0,h.ayN)(e)||(0,h.Bkf)(e)||(0,h.azN)(e))return void console.error("Event is not selectable");let[t,n]=_(e?.id);r(t,n),E()}catch(e){b.push({closable:!0,description:e.message,status:"error",title:C("timeline.error.unable-to-load-revision")})}},[C,b,r,_,E]),A=(0,c.useCallback)(e=>{try{let[t,n]=w(e.id);r(t,n),E()}catch(e){b.push({closable:!0,description:e.message,status:"error",title:C("timeline.error.unable-to-load-revision")})}},[w,r,b,C,E]),P=(0,c.useCallback)(()=>{!j&&y&&S()},[j,S,y]),R=(0,c.useMemo)(()=>v?(0,s.jsx)(i7,{}):(0,s.jsx)(sX,{events:t,fetchEventChildren:k,hasMoreEvents:!!y,selectedEventId:e?.id,onLoadMore:P,onSelect:"rev"===n?T:A}),[v,n,k,t,y,e?.id,P,A,T]),M=e?C(h.uMx[e.documentVariantType][e.type],{context:"timestamp",timestamp:new Date(e.timestamp),formatParams:s1}):C("timeline.latest-revision"),D=e?C(h.uMx[e.documentVariantType][e.type],{context:"timestamp",timestamp:new Date(e.timestamp),formatParams:s1}):t.length>0?C("timeline.since-version-missing"):C("timeline.no-previous-events"),$="rev"===n?M:D,B=(0,c.useMemo)(()=>({"timeline-menu":x}),[x]);return(0,s.jsx)(a.GD,{__unstable_elements:B,children:(0,s.jsx)(s0,{"data-testid":"timeline-menu",constrainSize:!0,content:o&&R,"data-ui":"versionMenu",open:o,placement:i,matchReferenceWidth:!0,portal:!0,ref:g,children:(0,s.jsx)(a.so,{width:"fill",children:(0,s.jsx)(l.$n,{"data-testid":o?"timeline-menu-close-button":"timeline-menu-open-button",disabled:j||!t.length,mode:"ghost",onClick:o?E:I,ref:f,selected:o,width:"fill",tooltipProps:null,justify:"space-between",style:{maxWidth:"100%"},iconRight:p.D3D,text:j?C("timeline.loading-history"):$})})})})}let s3=(0,g.I4)(h.PaW)`
565  height: 100%;
566  overflow: auto;
567  position: relative;
568  scroll-behavior: smooth;
569`,s4=(0,g.I4)(a.az)`
570  &:not([hidden]) {
571    display: grid;
572  }
573  grid-template-columns: 48px 1fr;
574  align-items: center;
575  gap: 0.25em;
576`,s5=(0,g.I4)(a.so)`
577  width: 100%;
578  position: absolute;
579  bottom: -4px;
580`,s6={diff:null,loading:!0,error:null},s7=()=>{let e,t,n,i,l,d,c,p,m,f,x,g=(0,o.c)(31),{documentId:y,schemaType:j,editState:v,displayed:_}=tD(),{selectedPerspective:w,selectedPerspectiveName:S,selectedReleaseId:k}=(0,h.QO2)(),{t:C}=(0,h.Bdt)(r.Z7);g[0]!==_||g[1]!==v?.published?(e=(0,b.g)((0,b.L)(v?.published??{},{author:""}),(0,b.L)(_??{},{author:""})),g[0]=_,g[1]=v?.published,g[2]=e):e=g[2];let I=e;return(!k||v?.version)&&("drafts"!==w||v?.draft)&&"published"!==S&&_?._rev?(g[3]!==C?(t=C("events.compare-with-published.title"),g[3]=C,g[4]=t):t=g[4],g[5]!==t?(n=(0,s.jsx)(a.EY,{size:1,weight:"medium",children:t}),g[5]=t,g[6]=n):n=g[6],g[7]!==w?(i=(0,h.Jrl)(w)?w.metadata?.title:"draft",g[7]=w,g[8]=i):i=g[8],g[9]!==i?(l={version:i}
580,g[9]=i,g[10]=l):l=g[10],g[11]!==C||g[12]!==l?(d=(0,s.jsx)(a.EY,{size:1,muted:!0,children:(0,s.jsx)(h.HTc,{i18nKey:"events.compare-with-published.description",t:C,values:l})}),g[11]=C,g[12]=l,g[13]=d):d=g[13],g[14]!==n||g[15]!==d?(c=(0,s.jsx)(a.Zp,{borderBottom:!0,paddingBottom:3,children:(0,s.jsxs)(a.BJ,{space:3,paddingTop:1,children:[n,d]})}),g[14]=n,g[15]=d,g[16]=c):c=g[16],g[17]!==_||g[18]!==y||g[19]!==I||g[20]!==j?(p={documentId:y,schemaType:j,rootDiff:I,isComparingCurrent:!0,FieldWrapper:ot,value:_,showFromValue:!0},g[17]=_,g[18]=y,g[19]=I,g[20]=j,g[21]=p):p=g[21],g[22]!==I||g[23]!==j?(m=(0,s.jsx)(a.az,{paddingY:1,children:(0,s.jsx)(h.Vki,{diff:I,schemaType:j})}),g[22]=I,g[23]=j,g[24]=m):m=g[24],g[25]!==p||g[26]!==m?(f=(0,s.jsx)(u.HU.Provider,{value:p,children:m}),g[25]=p,g[26]=m,g[27]=f):f=g[27],g[28]!==c||g[29]!==f?(x=(0,s.jsxs)(a.BJ,{space:2,marginBottom:3,children:[c,f]}),g[28]=c,g[29]=f,g[30]=x):x=g[30],x):null};function s8({showChanges:e}){let{documentId:t,schemaType:n,timelineError:i,value:r,formState:l}=tD(),[o,d]=(0,c.useState)(null),{events:u,revision:p,sinceRevision:m,getChangesList:f}=(0,h.LJN)(),x=!p?.revisionId,g=(0,c.useMemo)(()=>f(),[f]),{diff:b,loading:j,error:_}=(0,v.J)(g,s6),{t:w}=(0,h.Bdt)("studio"),S=(0,c.useMemo)(()=>({documentId:t,schemaType:n,FieldWrapper:e=>e.path.length>0?(0,s.jsx)(h.uD1,{...e}):e.children,rootDiff:b,isComparingCurrent:x&&!l?.readOnly,value:r,showFromValue:!0}),[b,t,x,l?.readOnly,n,r]),[k,C]=(0,c.useMemo)(()=>u?[u.find(e=>e.id===m?.revisionId)||null,u.find(e=>e.id===p?.revisionId)||u[0]]:[null,null],[u,p?.revisionId,m?.revisionId]),I=(0,c.useMemo)(()=>C?u.slice(u.indexOf(C)+1).map(e=>"parentId"in C&&"parentId"in e&&e.parentId===C.parentId||"parentId"in e&&C.id===e.parentId?{...e,parentId:void 0}:e):u.slice(1),[u,C]);return u.length?(0,s.jsxs)(a.so,{"data-testid":"review-changes-pane",direction:"column",height:"fill",overflow:"hidden",children:[(0,s.jsxs)(a.az,{padding:3,style:{position:"relative"},children:[(0,s.jsxs)(s4,{paddingX:2,paddingBottom:2,children:[(0,s.jsx)(a.EY,{size:1,muted:!0,children:w("changes.inspector.from-label")}),(0,s.jsx)(s2,{event:k||null,events:I,mode:"since",placement:"bottom-start"}),(0,s.jsx)(a.EY,{size:1,muted:!0,children:w("changes.inspector.to-label")}),(0,s.jsx)(s2,{event:C||null,events:u,mode:"rev",placement:"bottom-end"})]}),j&&(0,s.jsx)(y.P.div,{animate:{opacity:1},initial:{opacity:0}
580,transition:{delay:.2,duration:.2},children:(0,s.jsxs)(s5,{justify:"center",align:"center",gap:2,children:[(0,s.jsx)(a.EY,{muted:!0,size:0,children:w("changes.loading-changes")}),(0,s.jsx)(a.y$,{size:0})]})})]}),(0,s.jsx)(a.Zp,{flex:1,paddingX:2,paddingY:2,children:(0,s.jsx)(a.EZ,{element:o,children:(0,s.jsx)(s3,{"data-ui":"Scroller",ref:d,children:(0,s.jsx)(a.az,{flex:1,paddingX:3,height:"fill",children:e&&(0,s.jsx)(s9,{documentContext:S,error:i||_,loading:p?.loading||m?.loading||!1,schemaType:n,sameRevisionSelected:k?.id===C?.id,sinceEvent:k})})})})})]}):(0,s.jsx)(a.az,{paddingX:2,children:(0,s.jsxs)(a.BJ,{padding:3,space:3,children:[(0,s.jsx)(a.EY,{size:1,weight:"medium",children:w("timeline.error.no-document-history-title")}),(0,s.jsx)(a.EY,{muted:!0,size:1,children:w("timeline.error.no-document-history-description")})]})})}function s9(e){let t,n,i=(0,o.c)(15),{error:r,documentContext:l,loading:d,schemaType:c,sameRevisionSelected:p,sinceEvent:m}=e;if(r){let e,t,n;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)(s7,{}),i[0]=e):e=i[0],i[1]!==r||i[2]!==m?.type?(t=m?.type!=="historyCleared"&&(0,s.jsx)(h.isY,{error:r}),i[1]=r,i[2]=m?.type,i[3]=t):t=i[3],i[4]!==t?(n=(0,s.jsxs)(s.Fragment,{children:[e,t]}),i[4]=t,i[5]=n):n=i[5],n}if(d){let e;return i[6]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)(h.gd4,{showText:!0}),i[6]=e):e=i[6],e}if(p){let e;return i[7]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)(oe,{}),i[7]=e):e=i[7],e}if(!l.rootDiff){let e;return i[8]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)(y.P.div,{animate:{opacity:1},initial:{opacity:0}
580,transition:{delay:.2,duration:.2},children:(0,s.jsx)(h.J7,{})}),i[8]=e):e=i[8],e}return i[9]!==l.rootDiff||i[10]!==c?(t=(0,s.jsx)(a.az,{paddingY:1,children:(0,s.jsx)(h.Vki,{diff:l.rootDiff,schemaType:c})}),i[9]=l.rootDiff,i[10]=c,i[11]=t):t=i[11],i[12]!==l||i[13]!==t?(n=(0,s.jsx)(u.HU.Provider,{value:l,children:t}),i[12]=l,i[13]=t,i[14]=n):n=i[14],n}function oe(){let e,t,n,i,r,l,d,c=(0,o.c)(12),{t:u}=(0,h.Bdt)("");return c[0]===Symbol.for("react.memo_cache_sentinel")?(e={opacity:1},t={opacity:0},n={delay:.2,duration:.2},c[0]=e,c[1]=t,c[2]=n):(e=c[0],t=c[1],n=c[2]),c[3]!==u?(i=u("changes.same-revision-selected-title"),c[3]=u,c[4]=i):i=c[4],c[5]!==i?(r=(0,s.jsx)(a.EY,{size:1,weight:"medium",as:"h3",children:i}),c[5]=i,c[6]=r):r=c[6],c[7]!==u?(l=(0,s.jsx)(a.EY,{as:"p",size:1,muted:!0,children:(0,s.jsx)(h.HTc,{i18nKey:"changes.same-revision-selected-description",t:u})}),c[7]=u,c[8]=l):l=c[8],c[9]!==r||c[10]!==l?(d=(0,s.jsx)(y.P.div,{animate:e,initial:t,transition:n,children:(0,s.jsxs)(a.BJ,{space:3,paddingTop:2,children:[r,l]})}),c[9]=r,c[10]=l,c[11]=d):d=c[11],d}function ot(e){return e.children}let on=(0,g.I4)(h.PaW)`
581  height: 100%;
582  overflow: auto;
583  position: relative;
584  scroll-behavior: smooth;
585`;function oi({showList:e}){let[t,n]=(0,c.useState)(null),[i,r]=(0,c.useState)(0),{setTimelineRange:l}=tD(),o=(0,c.useCallback)(e=>{!i&&e&&(r(e.clientHeight?e.clientHeight-1:0),n(e))},[i]),{events:u,nextCursor:p,loading:m,error:f,revision:x,loadMoreEvents:g,findRangeForRevision:b,expandEvent:y}=(0,h.LJN)(),{t:j}=(0,h.Bdt)("studio"),v=(0,d.dj)(),_=(0,c.useCallback)(e=>{try{if((0,h.zOx)(e)||(0,h.GDb)(e)||(0,h.ayN)(e)||(0,h.Bkf)(e)||(0,h.azN)(e))return void console.error("Event is not selectable");let[t,n]=b(e.id);l(t,n)}catch(e){v.push({closable:!0,description:e.message,status:"error",title:j("timeline.error.unable-to-load-revision")})}},[j,v,l,b]),w=m&&!u.length;return(0,s.jsx)(a.so,{"data-testid":"review-changes-pane",direction:"column",height:"fill",children:(0,s.jsx)(a.Zp,{flex:1,padding:2,paddingTop:0,children:f?(0,s.jsx)(i7,{}):(0,s.jsx)(a.EZ,{element:t,children:(0,s.jsxs)(on,{"data-ui":"Scroller",ref:o,children:[i&&e&&!w?(0,s.jsx)(sX,{events:u,fetchEventChildren:y,hasMoreEvents:!!p,selectedEventId:x?.revisionId||u[0]?.id,onLoadMore:g,onSelect:_,listMaxHeight:`${i}px`}):null,m&&(0,s.jsx)(h.gd4,{})]})})})})}let or=(0,g.I4)(h.PaW)`
586  height: 100%;
587  overflow: auto;
588  position: relative;
589  scroll-behavior: smooth;
590`;function ol({showList:e}){let{timelineError:t,setTimelineRange:n,timelineStore:i}=tD(),{selectedReleaseId:r}=(0,h.QO2)(),[l,o]=(0,c.useState)(null),[u,p]=(0,c.useState)(0),m=(0,c.useCallback)(e=>{e?.clientHeight&&(p(e.clientHeight-1),o(e))},[]),f=(0,h.SfM)(i,e=>e.chunks),x=(0,h.SfM)(i,e=>e.realRevChunk),g=(0,h.SfM)(i,e=>e.hasMoreChunks),b=(0,h.SfM)(i,e=>e.isLoading),{t:y}=(0,h.Bdt)("studio"),j=(0,d.dj)(),v=(0,c.useCallback)(e=>{try{let[t,r]=i?.findRangeForRev(e)||[null,null];n(t,r)}catch(e){j.push({closable:!0,description:e.message,status:"error",title:y("timeline.error.unable-to-load-revision")})}},[n,y,i,j]),_=(0,c.useCallback)(()=>{b||i?.loadMore()},[b,i]);return(0,s.jsx)(a.so,{"data-testid":"review-changes-pane",direction:"column",height:"fill",children:(0,s.jsx)(a.Zp,{flex:1,padding:2,paddingTop:0,children:t||r?(0,s.jsx)(i7,{versionError:!!r}):(0,s.jsx)(a.EZ,{element:l,children:(0,s.jsx)(or,{"data-ui":"Scroller",ref:m,children:u&&e?(0,s.jsx)(i6,{chunks:f,hasMoreChunks:g,lastChunk:x,onLoadMore:_,onSelect:v,listMaxHeight:`${u}px`}):null})})})})}let os=(0,g.I4)(a.so)`
591  opacity: 0;
592  transition: opacity 200ms;
593  &[data-ready] {
594    opacity: 1;
595  }
596`,oo=["history","review"],oa={error:p.YZv,warning:p.sAQ,info:p.YzR},od={error:"critical",warning:"caution",info:"primary"};function oc(e){let t,n,i,r,d=(0,o.c)(17),{marker:u,onOpen:p,schemaType:m,value:h}=e;d[0]!==u.path||d[1]!==p?(t=()=>p(u.path),d[0]=u.path,d[1]=p,d[2]=t):t=d[2];let f=t,[x,g]=(0,c.useState)(null),b=oa[u.level];return d[3]!==x?(n=x&&(0,s.jsx)(a.Zp,{padding:3,radius:2,tone:"critical",children:(0,s.jsx)(a.EY,{size:1,children:x.error.message})}),d[3]=x,d[4]=n):n=d[4],d[5]!==b||d[6]!==x||d[7]!==f||d[8]!==u.level||d[9]!==u.message||d[10]!==u.path||d[11]!==m||d[12]!==h?(i=!x&&(0,s.jsx)(a.Zp,{__unstable_focusRing:!0,as:"button",onClick:f,padding:3,radius:2,tone:od[u.level],children:(0,s.jsxs)(a.so,{align:"flex-start",ga
596p:3,children:[(0,s.jsx)(a.az,{flex:"none",children:(0,s.jsx)(a.EY,{size:1,children:(0,s.jsx)(b,{})})}),(0,s.jsxs)(a.BJ,{flex:1,space:2,children:[(0,s.jsx)(ou,{path:u.path,schemaType:m,value:h}),(0,s.jsx)(a.EY,{muted:!0,size:1,children:u.message})]})]})}),d[5]=b,d[6]=x,d[7]=f,d[8]=u.level,d[9]=u.message,d[10]=u.path,d[11]=m,d[12]=h,d[13]=i):i=d[13],d[14]!==n||d[15]!==i?(r=(0,s.jsxs)(l.tH,{onCatch:g,children:[n,i]}),d[14]=n,d[15]=i,d[16]=r):r=d[16],r}function ou(e){let{path:t,schemaType:n,value:i}=e,r=(0,c.useMemo)(()=>{try{return function(e){let{path:t,schemaType:n,value:i}=e,r=[],l=n,s=i;for(let e of t){if("string"==typeof e){if(!(0,h.u4i)(s)&&void 0!==s)throw Error(`Parent value is not an object, cannot get path segment: .${e}`);if("object"!==l.jsonType)throw Error(`Parent type is not an object schema type, cannot get path segment: .${e}`);s=s?.[e];let t=l.fields.find(t=>t.name===e);if(!t)return r.push({name:e}),r;l=t.type,r.push(l);continue}if("number"==typeof e){if(!(0,h.cyL)(s)&&void 0!==s)throw Error(`Parent value is not an array, cannot get path segment: [${e}]`);if("array"!==l.jsonType)throw Error(`Parent type is not an array schema type, cannot get path segment: [${e}]`);s=s?.[e];let t=l.of.find(e=>"string"==typeof s?"string"===e.jsonType:"number"==typeof s?"number"===e.jsonType:"boolean"==typeof s?"boolean"===e.jsonType:!!(0,h.u4i)(s)&&e.name===s?._type);if(!t)throw Error(`Item type not found: [${e}]`);l=t,r.push(l);continue}if((0,h.u4i)(e)&&e._key){if(typeof s>"u")return r;if(!(0,h.cyL)(s))throw Error(`Parent value is not an array, cannot get path segment: [_key == ${e}]`);if("array"!==l.jsonType)throw Error(`Parent type is not an array schema type, cannot get path segment: .${e}`);if(typeof(s=(s??[]).find(t=>(0,h.u4i)(t)&&t._key===e._key))>"u")return r;if(!(0,h.u4i)(s))throw Error(`Array item not found: [_key == ${e._key}]`);let t=l.of.find(e=>(0,h.u4i)(s)&&e.name===s?._type);if(!t)throw Error(`Array item type not found: .${s?._type}`);l=t,r.push(l);continue}throw Error(`Invalid path segment: ${JSON.stringify(e)}`)}return r}({path:t,schemaType:n,value:i})}catch(e){console.error(e)}return null},[t,n,i]);return r?.length?(0,s.jsx)(a.EY,{size:1,children:r.map((e,t)=>(0,s.jsxs)(c.Fragment,{children:[t>0&&(0,s.jsx)("span",{style:{color:"var(--card-muted-fg-color)",opacity:.5},children:" / "}),(0,s.jsx)("span",{style:{fontWeight:500},children:e.title||e.name})]},t))}):null}let op={},om=_.wE.create("/",[_.wE.intents("/intent"),_.wE.create("/edit/:type/:editDocumentId",[_.wE.create({path:"/:params",transform:{params:{toState:function(e){try{return JSON.parse(decodeURIComponent(e))}catch{return console.warn("Failed to parse JSON parameters"),{}}},toPath:function(e){return JSON.stringify(e)}}}})]),_.wE.create({path:"/:panes",children:[_.wE.create("/:action",_.wE.create("/:legacyEditDocumentId"))],transform:{panes:{toState:function(e){var t;return -1!==(t=decodeURIComponent(e)).indexOf(",{")?function(e){let t=[],n=e;for(;n.length;){let[e,i,r]=n.match(oh)||[];if(!e){n=n.slice(1);continue}let l=r&&function(e){try{return JSON.parse(e)}catch(e){console.warn(`Failed to parse parameters: ${e.message}`);return}}(r);t.push({id:i,payload:l}),n=n.slice(e.length)}return[t]}(t):t.split(";").map(e=>{let[t,...n]=e.split("|").map(e=>{let t,[n,...i]=e.split(",");return t={id:n,params:op,payload:void 0},i.reduce((e,t)=>{if(/^[a-z0-9]+=[^=]+/i.test(t)){let n=t.slice(0,t.indexOf("=")),i=t.slice(n.length+1);e.params={...e.params,[decodeURIComponent(n)]:decodeURIComponent(i)}}else/^[A-Za-z0-9\-_]+(?:={0,2})$/.test(t)?e.payload=function(e){try{return e?(0,_.fA)(e):void 0}catch(e){console.warn(`Failed to parse parameters: ${e.message}`);return}}(t):console.warn("Unknown pane segment: %s - skipping",t);return e},t)});return[t,...n.map(e=>({...t,...e,id:e.id||t.id,params:{...w(t.params,of),...e.params},payload:e.payload||t.payload}))]}).filter(e=>e.length>0)},toPath:function(e){return(e||[]).map(e=>e.map(og).join("|")).map(encodeURIComponent).join(";")}}}})]),oh=/^([.a-z0-9_-]+),?({.*?})?(?:(;|$))/i,of=["view","since","rev","inspect","comment"],ox=Boolean;function og(e,t,n){let{payload:i,params:r={},id:l}=e,[s]=n,o=e===s,a=0!==t&&l===s.id,d=typeof i>"u"?void 0:(0,_.nk)(i),c=Object.entries(r).filter(e=>{let[t,n]=e;return!!n&&(!!o||!(n===s.params?.[t]&&!of.includes(t)))}).map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`);return[a?"":l].concat([c.length>0&&c,d].filter(ox).flat()).join(",")||","}let ob=[ib,ij,ia,ic,is,iu],oy=[sM],oj=[{name:"sanity/structure/vali
596dation",component:function(e){let t,n,i,r,l,d,c,u=(0,o.c)(23),{onClose:p}=e,{onFocus:m,onPathOpen:f,schemaType:x,validation:g,value:b,editState:y}=tD(),{t:j}=(0,h.Bdt)("validation");u[0]!==m||u[1]!==f?(t=e=>{f(e),m(e)},u[0]=m,u[1]=f,u[2]=t):t=u[2];let v=t;u[3]!==y?(n=y&&y.version&&(0,h.YW1)(y.version),u[3]=y,u[4]=n):n=u[4];let _=n;return u[5]!==j?(i=j("panel.close-button-aria-label"),u[5]=j,u[6]=i):i=u[6],u[7]!==j?(r=j("panel.title"),u[7]=j,u[8]=r):r=u[8],u[9]!==p||u[10]!==i||u[11]!==r?(l=(0,s.jsx)(tJ,{as:"header",closeButtonLabel:i,flex:"none",onClose:p,title:r}),u[9]=p,u[10]=i,u[11]=r,u[12]=l):l=u[12],u[13]!==v||u[14]!==_||u[15]!==x||u[16]!==j||u[17]!==g||u[18]!==b?(d=(0,s.jsx)(a.Zp,{flex:1,overflow:"auto",padding:3,children:_?(0,s.jsx)(a.az,{padding:2,children:(0,s.jsx)(a.EY,{muted:!0,size:1,children:j("panel.unpublish-message")})}):(0,s.jsxs)(s.Fragment,{children:[0===g.length&&(0,s.jsx)(a.az,{padding:2,children:(0,s.jsx)(a.EY,{muted:!0,size:1,children:j("panel.no-errors-message")})}),g.length>0&&(0,s.jsx)(a.BJ,{space:2,children:g.map((e,t)=>(0,s.jsx)(oc,{marker:e,onOpen:v,schemaType:x,value:b},t))})]})}),u[13]=v,u[14]=_,u[15]=x,u[16]=j,u[17]=g,u[18]=b,u[19]=d):d=u[19],u[20]!==l||u[21]!==d?(c=(0,s.jsxs)(a.so,{direction:"column",height:"fill",overflow:"hidden",children:[l,d]}),u[20]=l,u[21]=d,u[22]=c):c=u[22],c},useMenuItem:function(e){let{documentId:t,documentType:n}=e,{t:i}=(0,h.Bdt)("validation"),{selectedReleaseId:r}=(0,h.QO2)(),{validation:l}=(0,h.dWw)(t,n,r),{value:s}=tD(),o=(0,c.useMemo)(()=>l.map(e=>({level:e.level,message:e.message,path:e.path})),[l]),a=o.some(f.Ah),d=o.some(f.ci),u=(0,h.YW1)(s),m=(0,c.useMemo)(()=>a?p.YZv:d?p.sAQ:p.Dee,[a,d]),x=(0,c.useMemo)(()=>a?"critical":d?"caution":"positive",[a,d]);return{hidden:0===o.length||u,icon:m,title:i("panel.title"),tone:x,showAsAction:!0}}},{name:tV,useMenuItem:()=>{let{features:e}=tY(),{t}=(0,h.Bdt)();return{hidden:!e.reviewChanges,icon:p.G2W,title:t("changes.title")}},component:function(e){let t,n,i,u,m,f,x,g,b,y,j,v,_,w,S,k,C,I,E,z,T,A,P,R,M,D,$,B=(0,o.c)(72),{params:Y,setParams:L}=ny(),O=(0,h.For)(),[H,V]=(0,c.useState)(null),{t:N}=(0,h.Bdt)(r.Z7),Z=Y?.inspect===tV,{selectedPerspective:F}=(0,h.QO2)();B[0]!==Y?(t=($=Y?.changesInspectorTab)&&oo.includes($)?Y.changesInspectorTab:oo[0],B[0]=Y,B[1]=t):t=B[1];let K=t;B[2]!==Y||B[3]!==L?(n=e=>L({...Y,changesInspectorTab:e,since:"history"===e?void 0:Y?.since}),B[2]=Y,B[3]=L,B[4]=n):n=B[4];let W=n;B[5]!==F||B[6]!==N?(i=(0,h.Jrl)(F)?F.metadata.title:N("drafts"===F?"compare-versions.status.draft":"compare-versions.status.published"),B[5]=F,B[6]=N,B[7]=i):i=B[7];let J=i,U=Z?"":void 0;B[8]!==N?(u=N("changes.tab.history"),B[8]=N,B[9]=u):u=B[9],B[10]!==W?(m=()=>W("history"),B[10]=W,B[11]=m):m=B[11];let G="history"===K;B[12]!==u||B[13]!==m||B[14]!==G?(f=(0,s.jsx)(l.oz,{"aria-controls":"history-panel",id:"history-tab",label:u,onClick:m,selected:G}),B[12]=u,B[13]=m,B[14]=G,B[15]=f):f=B[15],B[16]!==N?(x=N("changes.tab.review-changes"),B[16]=N,B[17]=x):x=B[17],B[18]!==W?(g=()=>W("review"),B[18]=W,B[19]=g):g=B[19];let Q="review"===K;B[20]!==Q||B[21]!==x||B[22]!==g?(b=(0,s.jsx)(l.oz,{"aria-controls":"review-changes-panel",id:"changes-tab",label:x,onClick:g,selected:Q}),B[20]=Q,B[21]=x,B[22]=g,B[23]=b):b=B[23],B[24]!==b||B[25]!==f?(y=(0,s.jsxs)(a.wb,{space:1,flex:1,children:[f,b]}),B[24]=b,B[25]=f,B[26]=y):y=B[26],B[27]!==N?(j=N("changes.action.close-label"),B[27]=N,B[28]=j):j=B[28];let q=e.onClose;B[29]!==N?(v=N("document-inspector.close-button.tooltip"),B[29]=N,B[30]=v):v=B[30],B[31]!==v?(_={content:v},B[31]=v,B[32]=_):_=B[32],B[33]!==e.onClose||B[34]!==j||B[35]!==_?(w=(0,s.jsx)(l.$n,{"aria-label":j,icon:p.USm,mode:"bleed",onClick:q,tooltipProps:_}),B[33]=e.onClose,B[34]=j,B[35]=_,B[36]=w):w=B[36],B[37]!==y||B[38]!==w?(S=(0,s.jsx)(a.Zp,{paddingBottom:1,children:(0,s.jsxs)(a.so,{align:"center",padding:3,gap:2,children:[y,w]})}),B[37]=y,B[38]=w,B[39]=S):S=B[39],B[40]!==N?(k=(0,s.jsx)(a.az,{flex:1,padding:1,children:(0,s.jsx)(a.EY,{size:1,children:(0,s.jsx)(h.HTc,{t:N,i18nKey:"changes.banner.tooltip"})})}),B[40]=N,B[41]=k):k=B[41],B[42]===Symbol.for("react.memo_cache_sentinel")?(C=(0,s.jsx)(a.EY,{size:0,muted:!0,children:(0,s.jsx)(p.YzR,{fontSize:1})}),B[42]=C):C=B[42],B[43]!==H||B[44]!==k?(I=(0,s.jsx)(l.m_,{portal:!0,placement:"bottom-end",boundaryElement:H,content:k,children:C}),B[43]=H,B[44]=k,B[45]=I):I=B[45],B[46]!==J?(E={perspective:J},B[46]=J,B[47]=E):E=B[47],B[48]!==N||B[49]!==E?(z=(0,s.jsx)(a.EY,{size:0,muted:!0,children:(0,s.jsx)(h.HTc,{t:N,values:E,i18nKey:"changes.banner.description"})}),B[48]=N,B[49]=E,B[50]=z):z=B[50],B[51]!==I||B[52]!==z?(T=(0,s.jsx)(a.Zp,{padding:2,marginBottom:3,marginX:3,tone
596:"neutral",border:!0,radius:3,children:(0,s.jsxs)(a.so,{gap:2,align:"flex-start",children:[I,z]})}),B[51]=I,B[52]=z,B[53]=T):T=B[53];let X="history"!==K;B[54]!==K||B[55]!==O.beta?.eventsAPI?.documents?(A=O.beta?.eventsAPI?.documents?(0,s.jsx)(oi,{showList:"history"===K}):(0,s.jsx)(ol,{showList:"history"===K}),B[54]=K,B[55]=O.beta?.eventsAPI?.documents,B[56]=A):A=B[56],B[57]!==X||B[58]!==A?(P=(0,s.jsx)(d.Kp,{"aria-labelledby":"history-tab",height:"fill",hidden:X,id:"history-panel",children:A}),B[57]=X,B[58]=A,B[59]=P):P=B[59];let ee="review"!==K;return B[60]!==K||B[61]!==O.beta?.eventsAPI?.documents?(R=O.beta?.eventsAPI?.documents?(0,s.jsx)(s.Fragment,{children:"review"===K?(0,s.jsx)(s8,{showChanges:"review"===K}):null}):(0,s.jsx)(sO,{showChanges:"review"===K}),B[60]=K,B[61]=O.beta?.eventsAPI?.documents,B[62]=R):R=B[62],B[63]!==ee||B[64]!==R?(M=(0,s.jsx)(d.Kp,{"aria-labelledby":"review-tab",hidden:ee,id:"review-panel",height:"fill",children:R}),B[63]=ee,B[64]=R,B[65]=M):M=B[65],B[66]!==S||B[67]!==T||B[68]!==P||B[69]!==U||B[70]!==M?(D=(0,s.jsxs)(os,{direction:"column",padding:0,height:"fill","data-ready":U,ref:V,children:[S,T,P,M]}),B[66]=S,B[67]=T,B[68]=P,B[69]=U,B[70]=M,B[71]=D):D=B[71],D},onClose:({params:e})=>({params:{...e,since:void 0,rev:void 0,changesInspectorTab:void 0,historyVersion:void 0}}),onOpen:({params:e})=>({params:{...e,since:"@lastPublished"}})}],ov=(0,h.bzQ)(e=>{let t=e?.icon||p.tN2;return{name:"sanity/structure",document:{actions:e=>Array.from(new Set([...e,...ob])),badges:e=>Array.from(new Set([...e,...oy])),inspectors:e=>Array.from(new Set([...e,...oj]))},tools:[{name:e?.name||"structure",title:e?.title||"Structure",icon:t,component:(0,c.lazy)(()=>n.e(6943).then(n.bind(n,86943))),canHandleIntent:(e,t)=>{var n,i;return"create"===e?"type"in(n=t)&&(!("template"in n)||{template:!0}):"edit"===e&&"id"in(i=t)&&(!("mode"in i)||{mode:"structure"===i.mode})},getIntentState:sB,controlsDocumentTitle:!0,options:e,router:om,__internalApplicationType:"sanity/structure"}],i18n:{bundles:[r.uQ]}}});var o_=Object.freeze({__proto__:null,default:r5}),ow=Object.freeze({__proto__:null,default:sR})}}]);

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.