PageSourceSearch

https://nancys-place-2023.vercel.app/_next/static/chunks/898a8d2a.39da71e767a8bd52.js

js nancys-place-2023.vercel.app collected 2026-10-03 07:22:34 UTC 78,283 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[715],{2102:function(e,n,t){t.r(n),t.d(n,{D:function(){return tF},a:function(){return nf},b:function(){return eN},c:function(){return nT},i:function(){return tH},u:function(){return e1}});var i,l,r,o,a,s,d,c,u,p,h,f,m,x,g,j,v,b,y,w,k,C,_,S,P,z,M,E=t(85893),I=t(67294),O=t(11636),L=t(34527),T=t(57557),R=t.n(T),D=t(31762),W=t(3018),N=t(96381),F=t(25971),B=t(55709),A=t(43485),Z=t(27554),U=t(22807),K=t(41931),V=t(5602),$=t(81030),H=t(3283),X=t(40486),q=t(13068),Y=t(53416),J=t(55760),G=t(18170),Q=t(60429),ee=t(83720),en=t(39846),et=t(14370),ei=t(32932),el=t(38063),er=t(18446),eo=t.n(er),ea=t(933),es=t(25934),ed=t(14141),ec=t(40168);t(68929),t(44908),t(21804),t(35937),t(13311),t(73955);var eu=t(5560);t(18029);var ep=t(18156),eh=t(66996),ef=t(42930);t(81763),t(47037);var em=t(28440),ex=t(30222),eg=t(11700),ej=t.n(eg),ev=t(34391),eb=t.n(ev),ey=t(70248),ew=t.n(ey),ek=t(94885),eC=t.n(ek),e_=t(99009);let eS=["badges","children","badgeProps"],eP=["children","minWidth","onCollapse","onExpand"],ez=["id","type"],eM=["params","payload"],eE=["params","payload"],eI=["collapsed","status","lastUpdated"],eO=["actionsBoxElement","activeIndex","children","id","onActionStart","onKeyDown","rootRef","states"],eL=["actionsBoxElement","children"];function eT(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}function eR(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function eD(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?eR(Object(t),!0).forEach(function(n){var i,l;i=e,l=t[n],n in i?Object.defineProperty(i,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[n]=l}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):eR(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function eW(e,n){if(null==e)return{};var t,i,l=function(e,n){if(null==e)return{};var t,i,l={},r=Object.keys(e);for(i=0;i<r.length;i++)t=r[i],n.indexOf(t)>=0||(l[t]=e[t]);return l}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)t=r[i],!(n.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(l[t]=e[t])}return l}function eN(e){let{children:n,ms:t=0}=e,[i,l]=(0,I.useState)(t<=0);return((0,I.useEffect)(()=>{if(t<=0)return;let e=setTimeout(()=>l(!0),t);return()=>{clearTimeout(e)}},[t]),i&&n)?"function"==typeof n?n():n:(0,E.jsx)(E.Fragment,{})}let eF=e=>{let{actions:n,children:t,actionProps:i,onActionComplete:l}=e;return(0,E.jsx)(ei.duV,{onReset:l,hooks:n,args:i,children:t})},eB=e=>{let{badges:n,children:t,badgeProps:i}=e,l=eW(e,eS);return(0,E.jsx)(ei.duV,eD(eD({},l),{},{hooks:n,args:i,children:t}))},eA=[];function eZ(e){let{children:n,flatIndex:t,index:i,params:l,payload:r,siblingIndex:o}=e,{navigate:a,navigateIntent:s}=(0,ea.tv)(),d=(0,ea.z)(),c=(0,I.useMemo)(()=>(null==d?void 0:d.panes)||eA,[null==d?void 0:d.panes]),u=i-1,p=(0,I.useCallback)(e=>{let n=c[u]||[],t=n[o],i=e(n,t),l=[...c.slice(0,u),i,...c.slice(u+1)],r=eD(eD({},d||{}),{},{panes:l});return setTimeout(()=>a(r),0),r},[u,a,c,d,o]),h=(0,I.useCallback)(e=>{p((n,t)=>[...n.slice(0,o),eD(eD({},t),{},{payload:e}),...n.slice(o+1)])},[p,o]),f=(0,I.useCallback)(e=>{p((n,t)=>[...n.slice(0,o),eD(eD({},t),{},{params:e}),...n.slice(o+1)])},[p,o]),m=(0,I.useCallback)(e=>{let{id:n,parentRefPath:t,type:i,template:l}=e;a({panes:[...c.slice(0,u+1),[{id:n,params:{template:l.id,parentRefPath:(0,eh.BB)(t),type:i},payload:l.params}]]})},[u,a,c]),x=(0,I.useMemo)(()=>({index:t,groupIndex:u,siblingIndex:o,payload:r,params:l,hasGroupSiblings:!!c[u]&&c[u].length>1,groupLength:c[u]?c[u].length:0,routerPanesState:c,ChildLink:L.C,BackLink:L.B,ReferenceChildLink:L.R,handleEditReference:m,ParameterizedLink:L.P,replaceCurrent:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};p(()=>[{id:e.id||"",payload:e.payload,params:e.params||{}}])},closeCurrent:()=>{p((e,n)=>e.length>1?e.filter(e=>e!==n):e)},duplicateCurrent:e=>{p((n,t)=>{let i=eD(eD({},t),{},{payload:(null==e?void 0:e.payload)||t.payload,params:(null==e?void 0:e.params)||t.params});return[...n.slice(0,o),i,...n.slice(o)]})}
1,setView:e=>{let n=R()(l,"view");return f(e?eD(eD({},n),{},{view:e}):n)},setParams:f,setPayload:h,navigateIntent:s}),[t,u,m,p,s,l,r,c,f,h,o]);return(0,E.jsx)(L.a.Provider,{value:x,children:n})}let eU=[];class eK extends Error{constructor(e){let{message:n,context:t,helpId:i,cause:l}=e;super(n),this.context=t,this.helpId=i,this.cause=l}}let eV=new WeakMap;function e$(e){let n=eV.get(e);if(n)return n;let t=(0,Y.x0)();return eV.set(e,t),t}let eH=new WeakMap;function eX(e,n){let t=eH.get(e)||new Map;if(t){let i=t.get(n);if(i)return i}let l=e[n];if("function"!=typeof l)throw Error("Expected property `".concat(n,"` to be a function but got ").concat(typeof l," instead."));let r=l.bind(e);return t.set(n,r),eH.set(e,t),r}let eq=e=>!!(0,ei.Uy$)(e)&&("function"==typeof e.subscribe||"function"==typeof e.then),eY=e=>!!(0,ei.Uy$)(e)&&"function"==typeof e.serialize,eJ=e=>(n,t,i)=>{try{return e(n,t,i)}catch(l){if(l instanceof eK)throw l;throw new eK({message:"string"==typeof(null==l?void 0:l.message)?l.message:"",context:t,cause:l})}},eG=e=>function(){return e(...arguments).pipe((0,D._)(1),(0,W.x)())};function eQ(e){let n=eJ(eG(e((e,t,i)=>{if(!e)throw new eK({message:"Pane returned no child",context:t,helpId:"structure-item-returned-no-child"});return eq(e)?(0,J.D)(e).pipe((0,N.w)(e=>n(e,t,i))):eY(e)?n(e.serialize(t),t,i):"function"==typeof e?n(e(t.id,t),t,i):(0,G.of)(e)})));return n}async function e0(e){let n=new Map,t=e=>(t,i,l)=>{let r=t&&"".concat(e$(t),"-").concat(i.path.join("__")),o=r&&n.get(r);if(o)return o;let a=e(t,i,l);return r&&n.set(r,a),a},i=eQ(t),l=[[{id:"__edit__".concat(e.params.id),params:eD(eD({},R()(e.params,["id"])),{},{type:e.params.type}),payload:e.payload}]];async function r(e){var n;let{currentId:t,flatIndex:l,intent:o,params:a,parent:s,path:d,payload:c,unresolvedPane:u,levelIndex:p,structureContext:h}=e;if(!u)return[];let{id:f,type:m}=a,x=eW(a,ez),g=await i(u,{id:t,splitIndex:0,parent:s,path:d,index:l,params:{},payload:void 0,structureContext:h},l).pipe((0,F.P)()).toPromise();return"document"===g.type&&g.id===f?[{panes:[...d.slice(0,d.length-1).map(e=>[{id:e}]),[{id:f,params:x,payload:c}]],depthIndex:d.length,levelIndex:p}]:(null==(n=g.canHandleIntent)?void 0:n.call(g,o,a,{pane:g,index:l}))||"documentList"===g.type&&g.schemaTypeName===m&&"_type == $type"===g.options.filter?[{panes:[...d.map(e=>[{id:e}]),[{id:a.id,params:x,payload:c}]],depthIndex:d.length,levelIndex:p}]:"list"===g.type&&g.child&&g.items?(await Promise.all(g.items.map((e,n)=>"divider"===e.type?Promise.resolve([]):r({currentId:e._id||e.id,flatIndex:l+1,intent:o,params:a,parent:g,path:[...d,e.id],payload:c,unresolvedPane:"function"==typeof g.child?eX(g,"child"):g.child,levelIndex:n,structureContext:h})))).flat():[]}let o=await r({currentId:"root",flatIndex:0,levelIndex:0,intent:e.intent,params:e.params,parent:null,path:[],payload:e.payload,unresolvedPane:e.rootPaneNode,structureContext:e.structureContext}),a=o.sort((e,n)=>e.depthIndex===n.depthIndex?e.levelIndex-n.levelIndex:e.depthIndex-n.depthIndex)[0];return a?a.panes:l}function e1(){let e=(0,I.useContext)(L.D);if(!e)throw Error("DeskTool: missing context value");return e}let e2=(e,n)=>{let t=e.replace(/^__edit__/,""),{params:i,payload:l,structureContext:{resolveDocumentNode:r}}=n,{type:o,template:a}=i;if(!o)throw Error("Document type for document with ID ".concat(t," was not provided in the router params."));let s=r({schemaType:o,documentId:t});return s=s.id("editor").title("Editor"),a&&(s=s.initialValueTemplate(a,l)),s.serialize()},e3=e=>{let n={type:e.type,id:e.routerPaneSibling.id,params:e.routerPaneSibling.params||{},payload:e.routerPaneSibling.payload||null,flatIndex:e.flatIndex,groupIndex:e.groupIndex,siblingIndex:e.siblingIndex,path:e.path,paneNode:"resolvedMeta"===e.type?e$(e.paneNode):null};return"metaHash(".concat(JSON.stringify(n),")")};function e4(e){let{panes:n}=e,{navigate:t}=(0,ea.tv)();return(0,I.useEffect)(()=>{t({panes:n},{replace:!0})},[t,n]),(0,E.jsx)(O.Zb,{height:"fill",children:(0,E.jsx)(eN,{ms:300,children:(0,E.jsxs)(O.kC,{align:"center",direction:"column",height:"fill",justify:"center",children:[(0,E.jsx)(O.$j,{muted:!0}
1),(0,E.jsx)(O.xu,{marginTop:3,children:(0,E.jsx)(O.xv,{muted:!0,size:1,children:"Redirecting…"})})]})})})}async function e5(e,n,t){if(n&&t)return{id:n,type:t};if(!n&&t)return{id:(0,es.Z)(),type:t};if(n&&!t){let i=await e.resolveTypeForDocument(n).pipe((0,F.P)()).toPromise();return{id:n,type:i}}throw new eK({message:"Neither document `id` or `type` was provided when trying to resolve intent."})}function e8(e){let{intent:n,params:t={},payload:i}=e,{rootPaneNode:l,structureContext:r}=e1(),o=(0,ei.H__)(),a=(0,ei.BoV)(t),s=(0,ei.BoV)(i),[d,c]=(0,I.useState)(null),[u,p]=(0,I.useState)(null),h="string"==typeof a.id?a.id:void 0,f="string"==typeof a.type?a.type:void 0;if((0,I.useEffect)(()=>{let e={current:!1};return(async function(){let{id:e,type:t}=await e5(o,h,f);return e0({intent:n,params:eD(eD({},a),{},{id:e,type:t}),payload:s,rootPaneNode:l,structureContext:r})})().then(n=>{e.current||c(n)}).catch(p),()=>{e.current=!0}},[o,h,n,a,s,l,r,f]),u)throw u;return d?(0,E.jsx)(e4,{panes:d}):(0,E.jsx)(O.Zb,{height:"fill",children:(0,E.jsx)(eN,{ms:300,children:(0,E.jsxs)(O.kC,{align:"center",direction:"column",height:"fill",justify:"center",children:[(0,E.jsx)(O.$j,{muted:!0}),(0,E.jsx)(O.xu,{marginTop:3,children:(0,E.jsx)(O.xv,{align:"center",muted:!0,size:1,children:"Loading…"})})]})})})}let e9=ed.ZP.span(i||(i=eT(["\n  &:not(:last-child)::after {\n    content: ' ➝ ';\n    opacity: 0.5;\n  }\n"])));function e6(e){let{error:n}=e;if(!(n instanceof eK))throw n;let{cause:t}=n,i=(null==t?void 0:t.stack)||n.stack,l=i&&!(t instanceof L.S)&&!n.message.includes("Module build failed:"),r=t instanceof L.S?t.path:[],o=t instanceof L.S&&t.helpId||n.helpId,a=(0,I.useCallback)(()=>{window.location.reload()},[]);return(0,E.jsx)(O.Zb,{height:"fill",overflow:"auto",padding:4,sizing:"border",tone:"critical",children:(0,E.jsxs)(O.W2,{children:[(0,E.jsx)(O.X6,{as:"h2",children:"Encountered an error while reading structure"}),(0,E.jsxs)(O.Zb,{marginTop:4,padding:4,radius:2,overflow:"auto",shadow:1,tone:"inherit",children:[r.length>0&&(0,E.jsxs)(O.Kq,{space:2,children:[(0,E.jsx)(O.__,{children:"Structure path"}),(0,E.jsx)(O.EK,{children:r.slice(1).map((e,n)=>(0,E.jsx)(e9,{children:e},"".concat(e,"-").concat(n)))})]}),(0,E.jsxs)(O.Kq,{marginTop:4,space:2,children:[(0,E.jsx)(O.__,{children:"Error"}),(0,E.jsx)(O.EK,{children:l?i.replace(/\(\.\.\.\)\./g,"(...)\n  .").replace(/__WEBPACK_IMPORTED_MODULE_\d+_+/g,"").replace(/___default\./g,".").replace(RegExp(" \\(https?:\\/\\/".concat(window.location.host),"g")," ("):n.message})]}),o&&(0,E.jsx)(O.xu,{marginTop:4,children:(0,E.jsx)(O.xv,{children:(0,E.jsx)("a",{href:(0,el.h)(o),rel:"noopener noreferrer",target:"_blank",children:"View documentation"})})}),(0,E.jsx)(O.xu,{marginTop:4,children:(0,E.jsx)(O.zx,{text:"Reload",icon:ec.bnu,tone:"primary",onClick:a})})]})]})})}function e7(e){let{isSelected:n,pane:t,paneKey:i}=e,l=(0,ei.Uy$)(t)&&t.type||null;return(0,E.jsxs)(L.f,{id:i,selected:n,children:[(0,E.jsx)(L.g,{title:"Unknown pane type"}),(0,E.jsx)(L.h,{children:(0,E.jsx)(O.xu,{padding:4,children:"string"==typeof l?(0,E.jsxs)(O.xv,{as:"p",muted:!0,children:["Structure item of type ",(0,E.jsx)("code",{children:l})," is not a known entity."]}):(0,E.jsxs)(O.xv,{as:"p",muted:!0,children:["Structure item is missing required ",(0,E.jsx)("code",{children:"type"})," property."]})})})]})}function ne(e){let n=[{ms:300,message:"Loading…"},{ms:5e3,message:"Still loading…"}];if(ei.r8Q){let t=["Check console for errors?","Is your observable/promise resolving?",e.length>0?"Structure path: ".concat(e.join(" ➝ ")):""];n.push({ms:1e4,message:t.join("\n")})}let i=(0,G.of)(null);return(0,et.T)(...n.map(e=>{let{ms:n,message:t}=e;return i.pipe((0,V.h)(t),(0,$.g)(n))}))}let nn=(0,ed.ZP)(O.kC)(l||(l=eT(["\n  opacity: 0;\n  transition: opacity 200ms;\n\n  &[data-mounted] {\n    opacity: 1;\n  }\n"]))),nt=(0,I.memo)(e=>{let{delay:n=300,flex:t,message:i=ne,minWidth:l,paneKey:r,path:o,selected:a,title:s,tone:d}=e,c=(0,I.useMemo)(()=>"function"==typeof i?i(o?o.split(";"):[]):i,[i,o]),[u,p]=(0,I.useState)(()=>"string"==typeof c?c:"Loading…");(0,I.useEffect)(()=>
1{if("object"!=typeof c||"function"==typeof c.subscribe)return;let e=c.subscribe(p);return()=>e.unsubscribe()},[c]);let[h,f]=(0,I.useState)(null),[m,x]=(0,I.useState)(!1);(0,I.useEffect)(()=>{if(h)return(0,O.RE)(()=>x(!0))},[h]);let g=(0,E.jsxs)(nn,{align:"center","data-mounted":m?"":void 0,direction:"column",height:"fill",justify:"center",ref:f,children:[(0,E.jsx)(O.$j,{muted:!0}),(s||u)&&(0,E.jsx)(O.xu,{marginTop:3,children:(0,E.jsx)(O.xv,{align:"center",muted:!0,size:1,children:s||u})})]});return(0,E.jsx)(L.f,{flex:t,id:r,minWidth:l,selected:a,tone:d,children:(0,E.jsx)(L.h,{children:g})})});nt.displayName="LoadingPane";let ni={component:(0,I.lazy)(()=>t.e(995).then(t.bind(t,34995))),document:(0,I.lazy)(()=>t.e(711).then(t.bind(t,28711))),documentList:(0,I.lazy)(()=>t.e(541).then(t.bind(t,31541))),list:(0,I.lazy)(()=>t.e(123).then(t.bind(t,9123)))},nl=(0,I.memo)(function(e){let{active:n,childItemId:t,groupIndex:i,index:l,itemId:r,pane:o,paneKey:a,params:s,payload:d,selected:c,siblingIndex:u}=e,p=ni[o.type]||e7;return(0,E.jsx)(eZ,{flatIndex:l,index:i,params:s,payload:d,siblingIndex:u,children:(0,E.jsx)(I.Suspense,{fallback:(0,E.jsx)(nt,{paneKey:a}),children:(0,E.jsx)(p,{childItemId:t||"",index:l,itemId:r,isActive:n,isSelected:c,paneKey:a,pane:o})})})},(e,n)=>{let{params:t={},payload:i=null}=n,l=eW(n,eM),{params:r={},payload:o=null}=e,a=eW(e,eE);if(!eo()(r,t)||!eo()(o,i))return!1;let s=new Set([...Object.keys(a),...Object.keys(l)]);for(let d of s)if(a[d]!==l[d])return!1;return!0});function nr(e){let{children:n,flex:t,minWidth:i,paneKey:l,title:r="Error",tone:o="critical"}=e;return(0,E.jsxs)(L.f,{flex:t,id:l,minWidth:i,tone:o,children:[(0,E.jsx)(L.g,{title:r}),(0,E.jsx)(L.h,{overflow:"auto",children:(0,E.jsx)(O.xu,{paddingX:4,paddingY:5,children:n})})]})}let no=["patch","commit"],na=(0,I.memo)(function(){let{push:e}=(0,O.pm)(),{documentId:n,documentType:t}=(0,L.u)(),i=(0,ei.E6V)(n,t),l=(0,I.useRef)(i);return(0,I.useEffect)(()=>{if(i&&i!==l.current){var n,t;"error"===i.type&&e({closable:!0,duration:3e4,status:"error",title:"delete"===(n=i.op)?"An error occurred while attempting to delete this document.\n      This usually means that there are other documents that refers to it.":"unpublish"===n?"An error occurred while attempting to unpublish this document.\n      This usually means that there are other documents that refers to it.":"An error occurred during ".concat(n),description:(0,E.jsxs)("details",{children:[(0,E.jsx)("summary",{children:"Details"}),i.error.message]})}),"success"!==i.type||no.includes(i.op)||e({closable:!0,status:"success",title:"publish"===(t=i.op)?"The document was published":"unpublish"===t?"The document was unpublished. A draft has been created from the latest published version.":"discardChanges"===t?"All changes since last publish has now been discarded. The discarded draft can still be recovered from history":"delete"===t?"This document was deleted. It can still be recovered from history and if you continue editing it will be recreated.":"Successfully performed ".concat(t," on document")}),l.current=i}},[i,e]),null}),ns=e=>{let{features:n,hasValue:t,changesOpen:i}=e;return n.reviewChanges?{action:"reviewChanges",title:"Review changes",icon:ec.vaD,isDisabled:i||!t}:null},nd=e=>{let{hasValue:n}=e;return{action:"inspect",title:"Inspect",icon:ec.bg6,isDisabled:!n,shortcut:"Ctrl+Alt+I"}},nc=e=>{let{previewUrl:n}=e;return n?{action:"production-preview",title:"Open preview",icon:ec.YE8,shortcut:"Ctrl+Alt+O"}:null},nu=e=>{let n=[nc,ns,nd].filter(Boolean).map(n=>n(e));return n.filter(e=>null!==e)},np=e=>(0,ei.Uy$)(e)&&"string"==typeof e._id&&"string"==typeof e._type,nh={},nf=(0,I.memo)(e=>{let{children:n,index:t,pane:i,paneKey:l}=e,r=(0,ei.m85)(ei.Dr7),o=(0,ei.I_y)(),a=(0,ei.zEW)(),{actions:s,badges:d,unstable_languageFilter:c}=(0,ei.Lky)().document,u=(0,ei.zaX)(),p=(0,ei.ap5)(),h=(0,L.i)(),{features:f}=e1(),{push:m}=(0,O.pm)(),{options:x,menuItemGroups:g,title:j=null,views:v=[]}=i,b=(0,ei.BoV)(x),y=b.id,w=(0,ei.vsM)(y),k=x.type,C=(0,ei.BoV)(h.params),_=(0,ei.BoV)(h.payload),{templateName:S,templateParams:P}=(0,I.useMemo)(()=>(function(e,n){let t=n.panePayload||{},i=n.templateName;n.urlTemplate&&i&&i!==n.urlTemplate&&console.warn('Conflicting templates: URL says "'.concat(n.urlTemplate,'", structure node says "').concat(i,'". Using "').concat(i,'".'));let l=i||n.urlTemplate,r=e.filter(e=>e.schemaType===n.documentType),o=eD(eD({},n.templateParams),"object"==typeof t&&t||{}),a=l;return l||1!==r.length||(a=r[0].id),{templateName:a,templateParams:o}})(a,{documentType:k,templateName:b.template,templateParams:b.templateParameters,panePayload:_,urlTemplate:null==C?void 0:C.template}),[k,b,C,_,a]),z=(0,ei.t2O)({documentId:w,documentType:k,templateName:S,templateParams:P}),M=(0,ei.BoV)(z),{patch:T}
1=(0,ei.d9t)(w,k),D=(0,ei.iav)(w,k),{validation:W}=(0,ei.a3k)(w,k),F=(0,ei.z1O)(w,k),B=o.get(k),A=(null==D?void 0:D.draft)||(null==D?void 0:D.published)||M.value,Z=(0,I.useMemo)(()=>s({schemaType:k,documentId:w}),[s,w,k]),U=(0,I.useMemo)(()=>d({schemaType:k,documentId:w}),[d,w,k]),K=(0,I.useMemo)(()=>c({schemaType:k,documentId:w}),[w,k,c]),V=(0,ei.BoV)(W),$=(0,ei.BoV)(v),q=h.params||nh,[Y,Q]=(0,I.useState)(()=>q.path?(0,eh.mL)(q.path):[]),ee=q.view||$[0]&&$[0].id||null,en=(0,I.useMemo)(()=>u.getTimeline({publishedId:w,enableTrace:ei.r8Q}),[w,u]),[et,el]=(0,I.useState)("closed"),{historyController:er}=(0,em.m2)(()=>u.getTimelineController({client:r,documentId:w,documentType:k,timeline:en}),[r,w,k,en]);er.setRange(q.since||null,q.rev||null);let eo=er.changesPanelActive(),ea=function(e){let[n,t]=(0,I.useState)(void 0),[i,l]=(0,I.useState)(null),{resolveProductionUrl:r}=(0,ei.Lky)().document,o=(0,em.l)(e);if(i)throw i;return(0,I.useEffect)(()=>{o.pipe((0,H.b)(500),(0,N.w)(e=>np(e)?(0,J.D)(r({document:e})):(0,G.of)(void 0)),(0,X.K)(e=>{let n=(0,ei.Uy$)(e)&&"string"==typeof e.message?e.message:"Unknown error";throw Error("An error was thrown while trying to get your preview url: ".concat(n))})).subscribe({next:t,error:l})},[r,o]),n}(A),[es,ed]=(0,I.useState)([]);(0,I.useEffect)(()=>{let e=p.documentPresence(w).subscribe(e=>{ed(e)});return()=>{e.unsubscribe()}},[w,p]);let ec=Boolean(A),eu=(0,I.useMemo)(()=>nu({features:f,hasValue:ec,changesOpen:eo,previewUrl:ea}),[f,ec,eo,ea]),ef="on"===q.inspect,eg=eo?er.sinceAttributes():(null==D?void 0:D.published)||null,ej="connected"===F&&D.ready,ev=er.onOlderRevision(),eb=(0,I.useMemo)(()=>ev?er.displayed()||{_id:A._id,_type:A._type}:A,[er,q.rev,q.since,A,ev]),ey=(0,I.useCallback)((e,n)=>{h.setParams(eD(eD({},h.params),{},{since:e,rev:n||void 0}))},[h]),ew=(0,I.useCallback)(e=>{Q(e),p.setLocation([{type:"document",documentId:w,path:e,lastActiveAt:new Date().toISOString()}])},[w,p,Q]),ek=(0,I.useCallback)(e=>{Q([])},[Q]),eC=(0,I.useRef)(()=>{throw Error("Nope")});eC.current=e=>{T.execute((0,ei.GWp)(e.patches),M.value)};let e_=(0,I.useCallback)(e=>eC.current(e),[]),eS=(0,I.useCallback)(()=>{h.setParams(eD(eD({},q),{},{since:void 0}))},[h,q]),eP=(0,I.useCallback)(()=>{h.setParams(eD(eD({},q),{},{since:"@lastPublished"}))},[h,q]),ez=(0,I.useCallback)(()=>h.closeCurrent(),[h]),eM=(0,I.useCallback)(()=>h.duplicateCurrent(),[h]),eE=(0,I.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:!ef;e?h.setParams(eD(eD({},q),{},{inspect:"on"})):h.setParams(R()(q,"inspect"))},[ef,h,q]),eI=(0,I.useCallback)(e=>"production-preview"===e.action&&ea?(window.open(ea),!0):"inspect"===e.action?(eE(!0),!0):"reviewChanges"===e.action&&(eP(),!0),[eP,ea,eE]),eO=(0,I.useCallback)(e=>{for(let n of eu)if(n.shortcut&&(0,ep.ZP)(n.shortcut,e)){e.preventDefault(),e.stopPropagation(),eI(n);return}},[eI,eu]),eL=(0,I.useCallback)(()=>eE(!1),[eE]),[eT,eR]=(0,I.useState)([]),[eW,eN]=(0,I.useState)(),[eF,eB]=(0,I.useState)(),[eA,eZ]=(0,I.useState)(),eU=(0,I.useCallback)((e,n)=>{eB(t=>(0,ei.pt$)(t,e,n))},[]),eK=(0,I.useCallback)((e,n)=>{eZ(t=>(0,ei.pt$)(t,e,n))},[]),eV=(0,I.useCallback)((e,n)=>eN(t=>(0,ei.pt$)(t,e,n)),[]),e$=A._createdAt?"update":"create",eH=(0,I.useMemo)(()=>Boolean(null==B?void 0:B.liveEdit),[k,o]),eX=A._id?A._id:"dummy-id",eq=(0,I.useMemo)(()=>eD(eD({},A),{},{_id:eH?(0,ei.vsM)(eX):(0,ei.qyu)(eX)}),[eH,A,eX]),[eY,eJ]=(0,ei.vSY)({document:eq,permission:e$}),{revTime:eG}=er,eQ=!(null==A?void 0:A._id),e0=(0,I.useMemo)(()=>!ej||null!==eG||!eJ&&!(null==eY?void 0:eY.granted)||!(0,ex.jA)(B,"update")||eQ&&!(0,ex.jA)(B,"create"),[eQ,eJ,null==eY?void 0:eY.granted,ej,eG,B]),e2=(0,ei.clL)(B,{value:eb,readOnly:e0,comparisonValue:eg,focusPath:Y,openPath:eT,collapsedPaths:eF,presence:es,validation:V,collapsedFieldSets:eA,fieldGroupState:eW,changesOpen:eo}),e3=(0,I.useRef)(e2);e3.current=e2;let e4=(0,I.useCallback)(e=>{let n=(0,ei.C8M)(e3.current,e);n.forEach(e=>{"expandPath"===e.type&&eB(n=>(0,ei.pt$)(n,e.path,!1)),"expandFieldSet"===e.type&&eZ(n=>(0,ei.pt$)(n,e.path,!1)),"setSelectedGroup"===e.type&&eN(n=>
1(0,ei.pt$)(n,e.path,e.groupName))}),eR(e)},[e3]);return(0,I.useEffect)(()=>{"reconnecting"===F&&m({id:"sanity/desk/reconnecting",status:"warning",title:(0,E.jsx)(E.Fragment,{children:"Connection lost. Reconnecting…"})})},[F,m]),(0,I.useEffect)(()=>{Q(q.path?(0,eh.mL)(q.path):[])},[w,q.path]),(0,E.jsx)(L.j.Provider,{value:{actions:Z,activeViewId:ee,badges:U,changesOpen:eo,collapsedFieldSets:eA,collapsedPaths:eF,compareValue:eg,connectionState:F,displayed:eb,documentId:w,documentIdRaw:y,documentType:k,editState:D,focusPath:Y,menuItems:eu,onBlur:ek,onChange:e_,onFocus:ew,onPathOpen:e4,onHistoryClose:eS,onHistoryOpen:eP,onInspectClose:eL,onKeyUp:eO,onMenuAction:eI,onPaneClose:ez,onPaneSplit:eM,onSetActiveFieldGroup:eV,onSetCollapsedPath:eU,onSetCollapsedFieldSet:eK,historyController:er,index:t,inspectOpen:ef,validation:V,menuItemGroups:g||[],paneKey:l,previewUrl:ea,ready:ej,schemaType:B,isPermissionsLoading:eJ,permissions:eY,setTimelineMode:el,setTimelineRange:ey,timeline:en,timelineMode:et,title:j,value:A,views:$,formState:e2,unstable_languageFilter:K},children:n})});nf.displayName="DocumentPaneProvider";let nm={create:"created",delete:"deleted",discardDraft:"discarded draft",initial:"created",editDraft:"edited",editLive:"live edited",publish:"published",unpublish:"unpublished"},nx={create:ec.agZ,delete:ec.XHJ,discardDraft:ec.Two,initial:ec.agZ,editDraft:ec.dY8,editLive:ec.dY8,publish:ec.EI4,unpublish:ec.xEY};function ng(e){let{maxLength:n,userIds:t}=e;return(0,E.jsx)(O.Jh,{maxLength:n,children:t.map(e=>(0,E.jsx)(ei.YtX,{user:e,withTooltip:!0},e))})}let nj=(0,ed.ZP)(O.kC)(e=>{var n;let{theme:t}=e,i=null==(n=t.sanity.color.base.skeleton)?void 0:n.from;return(0,ed.iv)(r||(r=eT(["\n    --timeline-hairline-width: 1px;\n    position: relative;\n    z-index: 2;\n    margin: 0;\n    padding: 0;\n\n    &::before {\n      position: absolute;\n      content: '';\n      height: 100%;\n      width: var(--timeline-hairline-width);\n      background: ",";\n      top: 0;\n      left: calc((100% - var(--timeline-hairline-width)) / 2);\n      z-index: 1;\n    }\n  "])),i)}),nv=(0,ed.ZP)(O.sN)(e=>{let{state:n="enabled",isHovered:t,theme:i}=e,{color:l}=i.sanity,r=l.button.default.primary.enabled;return(0,ed.iv)(o||(o=eT(["\n    position: relative;\n    min-width: 244px;\n\n    ","\n\n    ","\n\n      ","\n\n    // line styling \uD83D\uDC47\n      &:first-child ","::before {\n      height: 50%;\n      top: unset;\n      bottom: 0;\n    }\n\n    &:last-child ","::before {\n      height: 50%;\n    }\n\n    ","\n\n    // Remove timeline lines when using the keyboard to navigate timeline items\n    &:focus ","::before {\n      background: transparent;\n    }\n  "])),"selected"===n&&(0,ed.iv)(a||(a=eT(["\n      --card-bg-color: ",";\n      --card-fg-color: ",";\n      --card-muted-fg-color: ",";\n      --card-border-color: ",";\n      &:not([data-selection-bottom='true']) {\n        border-top-left-radius: 0;\n        border-top-right-radius: 0;\n      }\n    "])),r.bg,r.fg,r.muted,r.bg),"withinSelection"===n&&(0,ed.iv)(s||(s=eT(["\n      border-bottom-left-radius: 0;\n      border-bottom-right-radius: 0;\n      box-shadow: 0px 3px 0px 0px var(--card-bg-color);\n      &:not([data-selection-top='true']) {\n        border-radius: 0;\n      }\n\n      "," {\n        &::before {\n          background: var(--card-hairline-soft-color);\n        }\n      }\n    "])),nj),"disabled"===n&&(0,ed.iv)(d||(d=eT(["\n      [data-ui='Avatar'] {\n        opacity: 0.2;\n      }\n    "]))),nj,nj,(t||"selected"===n)&&(0,ed.iv)(c||(c=eT(["\n      ","::before {\n        background: transparent;\n      }\n    "])),nj),nj)}),nb=(0,ed.ZP)(O.xu)(u||(u=eT(["\n  background: var(--card-bg-color);\n  border-radius: 50px;\n  position: relative;\n  z-index: 2;\n"]))),ny=(0,ed.ZP)(O.xv)(p||(p=eT(["\n  text-transform: capitalize;\n"]))),nw={initial:"primary",create:"primary",publish:"positive",editLive:"caution",editDraft:"caution",unpublish:"critical",discardDraft:"critical",delete:"critical",withinSelection:"primary"};function nk(e){let{isSelectionBottom:n,isSelectionTop:t,state:i,onSelect:l,timestamp:r,chunk:o,type:a}=e,s=nx[a],d=Array.from(o.authors),c=(0,ei.INm)(r,{minimal:!0}),u="selected"===i,p="withinSelection"===i,[h,f]=(0,I.useState)(!1),m=(0,I.useCallback)(e=>
1{e.preventDefault(),e.stopPropagation(),l(o)},[l,o]);return(0,E.jsx)(nv,{"data-ui":"timelineItem",radius:2,"data-chunk-id":o.id,paddingY:0,paddingX:2,tone:h||u||p?"default":nw[a],pressed:p,state:i,selected:u,isHovered:h,disabled:"disabled"===i,"data-selection-bottom":n,"data-selection-top":t,onClick:m,children:(0,E.jsx)("div",{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),children:(0,E.jsxs)(O.kC,{align:"stretch",children:[(0,E.jsx)(nj,{align:"center",children:(0,E.jsx)(nb,{padding:2,children:(0,E.jsx)(O.xv,{size:2,children:s&&(0,I.createElement)(s)})})}),(0,E.jsxs)(O.Kq,{space:2,margin:2,children:[(0,E.jsx)(O.xu,{children:(0,E.jsx)(ny,{size:1,weight:"medium",children:nm[a]||(0,E.jsx)("code",{children:a})})}),(0,E.jsx)(O.xv,{size:0,muted:!0,children:c})]}),(0,E.jsx)(O.kC,{flex:1,justify:"flex-end",align:"center",children:(0,E.jsx)(ng,{maxLength:3,userIds:d})})]})})})}let nC=(0,ed.ZP)(O.xu)(h||(h=eT(["\n  overflow: auto;\n  -webkit-overflow-scrolling: touch;\n"]))),n_=(0,ed.ZP)(O.Kq)(f||(f=eT(["\n  max-width: 200px;\n"]))),nS=(0,ed.ZP)(O.v2)(m||(m=eT(["\n  overflow: auto;\n  box-sizing: border-box;\n  max-height: calc(100vh - 198px);\n"]))),nP=e=>{let{timeline:n,disabledBeforeSelection:t,topSelection:i,bottomSelection:l,onSelect:r,onLoadMore:o}=e,a=(0,I.useRef)(null),s=(0,I.useRef)(null),[d,c]=(0,I.useState)(null),u=t?"disabled":"enabled",p=(0,I.useCallback)(()=>{let e=a.current;if(d&&e){let{offsetHeight:n,scrollTop:t}=e,i=d.offsetTop<n+t+20;i&&requestAnimationFrame(()=>o(i))}},[o,d]);return(0,I.useEffect)(p,[p]),(0,E.jsxs)(nC,{ref:a,onScroll:p,"data-ui":"timeline",children:[0===n.chunkCount&&(0,E.jsxs)(n_,{padding:3,space:3,children:[(0,E.jsx)(O.xv,{size:1,weight:"semibold",children:"No document history"}),(0,E.jsx)(O.xv,{muted:!0,size:1,children:"When changing the content of the document, the document versions will appear in this menu."})]}),n.chunkCount>0&&(0,E.jsx)(nS,{ref:s,padding:1,space:0,children:n.mapChunks(e=>{let n=i===e,t=l===e;n&&(u="withinSelection"),t&&(u="selected");let o=(0,E.jsx)(nk,{chunk:e,isSelectionBottom:t,isSelectionTop:n,state:u,onSelect:r,type:e.type,timestamp:e.endTimestamp},e.id);return"selected"===u&&(u="enabled"),o})}),!n.reachedEarliestEntry&&(0,E.jsx)(O.kC,{align:"center",justify:"center",padding:4,ref:c,children:(0,E.jsx)(O.$j,{muted:!0})})]})};nP.displayName="Timeline";let nz=(0,ed.ZP)(O.J2)(x||(x=eT(["\n  & > div {\n    display: flex;\n    flex-direction: column;\n\n    & > [data-ui='Card'] {\n      flex: 1;\n      min-height: 0;\n      display: flex;\n      flex-direction: column;\n\n      /* This is the scrollable container rendered by <Timeline /> */\n      & > div {\n        flex: 1;\n        min-height: 0;\n      }\n    }\n  }\n"])));function nM(e){var n,t;let{chunk:i,mode:l,placement:r}=e,{historyController:o,setTimelineRange:a,setTimelineMode:s,timeline:d,ready:c}=(0,L.u)(),[u,p]=(0,I.useState)(!1),[h,f]=(0,I.useState)(null),[m,x]=(0,I.useState)(null),g=(0,I.useCallback)(()=>{s(l),p(!0)},[l,s]),j=(0,I.useCallback)(()=>{s("closed"),p(!1)},[s]),v=(0,I.useCallback)(()=>{j()},[j]);(0,O.O8)(v,[m,h]);let b=(0,I.useCallback)(e=>{let[n,t]=o.findRangeForNewRev(e);s("closed"),p(!1),a(n,t)},[o,s,a]),y=(0,I.useCallback)(e=>{let[n,t]=o.findRangeForNewSince(e);s("closed"),p(!1),a(n,t)},[o,s,a]),w=(0,I.useCallback)(e=>{o.setLoadMore(e)},[o]),k=u&&(0,E.jsx)("div",{ref:x,children:"rev"===l?(0,E.jsx)(nP,eD({onSelect:b,onLoadMore:w,timeline:d},{topSelection:n=o.realRevChunk,bottomSelection:n})):(0,E.jsx)(nP,eD({onSelect:y,onLoadMore:w,timeline:d},(t=o.sinceTime,{topSelection:o.realRevChunk,bottomSelection:t,disabledBeforeSelection:!0}
1)))}),C=(0,ei.INm)((null==i?void 0:i.endTimestamp)||"",{agoSuffix:!0}),_=i?"".concat(ej()(nm[i.type])," ").concat(C):"Current version",S=i?"Since ".concat(nm[i.type]," ").concat(C):"Since unknown version";return(0,E.jsx)(nz,{constrainSize:!0,content:k,"data-ui":"versionMenu",open:u,placement:r,portal:!0,children:(0,E.jsx)(O.zx,{disabled:!c,mode:"bleed",fontSize:1,padding:2,iconRight:ec.GVG,onClick:u?j:g,ref:f,selected:u,text:u?"rev"===l?"Select version":"Review changes since":"rev"===l?_:S})})}function nE(){return(0,E.jsxs)(O.kC,{align:"center",justify:"center",children:[(0,E.jsx)(O.$j,{muted:!0}),(0,E.jsx)(O.xu,{marginTop:3,children:(0,E.jsx)(O.xv,{align:"center",children:"Loading changes…"})})]})}let nI=(0,ed.ZP)(ei.l$t)(g||(g=eT(["\n  height: 100%;\n  overflow: auto;\n  position: relative;\n  scroll-behavior: smooth;\n"])));function nO(){let{documentId:e,onHistoryClose:n,historyController:t,schemaType:i,value:l}=(0,L.u)(),{collapsed:r}=(0,L.k)(),o=(0,I.useRef)(null),a=t.selectionState,s=t.sinceTime,d=t.currentObjectDiff(),c=!t.onOlderRevision(),u=I.useMemo(()=>({documentId:e,schemaType:i,FieldWrapper:ei.MUX,rootDiff:d,isComparingCurrent:c,value:l}),[e,d,c,i,l]),p=I.useMemo(()=>d?function(e){let n=new Map;return(0,ei.Z7x)(e,e=>{if("unchanged"===e.action||!("annotation"in e)||!e.annotation)return!0;let{author:t,timestamp:i}=e.annotation,l=n.get(t);return(!l||l.timestamp<i)&&n.set(t,e.annotation),!0}),Array.from(n.values()).sort((e,n)=>e.timestamp<n.timestamp?1:-1)}(d):[],[d]);return r?null:(0,E.jsxs)(O.kC,{direction:"column",flex:1,style:{borderLeft:"1px dashed var(--card-border-color)",overflow:"hidden",minWidth:320},"data-testid":"review-changes-pane",children:[(0,E.jsx)(L.g,{actions:(0,E.jsx)(O.zx,{icon:ec.Two,mode:"bleed",onClick:n,padding:3,title:"Hide changes panel"}),subActions:p.length>0&&(0,E.jsx)(O.xu,{paddingRight:1,children:(0,E.jsx)(ei.IIC,{annotations:p,description:"Changes by",placement:"bottom-end",children:(0,E.jsx)(O.Jh,{maxLength:4,children:p.map(e=>{let{author:n}=e;return(0,E.jsx)(ei.YtX,{user:n},n)})})})}),tabs:(0,E.jsx)(nM,{mode:"since",chunk:s,placement:"bottom-start"}),title:"Changes"}),(0,E.jsx)(L.h,{children:(0,E.jsx)(O.NM,{element:o.current,children:(0,E.jsx)(nI,{"data-ui":"Scroller",ref:o,children:(0,E.jsx)(O.xu,{flex:1,padding:4,children:(0,E.jsx)(nL,{diff:d,documentContext:u,loading:"loading"===a})})})})})]})}function nL(e){let{diff:n,documentContext:t,loading:i}=e,{schemaType:l}=(0,L.u)();return i?(0,E.jsx)(nE,{}):n?(0,E.jsx)(ei.H7Z.Provider,{value:t,children:(0,E.jsx)(ei.EyJ,{diff:n,schemaType:l})}):(0,E.jsx)(ei.kwM,{})}function nT(e,n,t){let i=(0,ei.F2f)(),[l,r]=(0,I.useState)(t),o=(0,I.useMemo)(()=>i.forNamespace("desk-tool"),[i]),a=(0,I.useMemo)(()=>e?o.forNamespace(e).forKey(n):o.forKey(n),[o,e,n]);(0,I.useEffect)(()=>{let e=a.listen(t).subscribe({next:r});return()=>null==e?void 0:e.unsubscribe()},[t,n,e,a]);let s=(0,I.useCallback)(e=>{r(e),a.set(e)},[a]);return(0,I.useMemo)(()=>[l,s],[s,l])}let nR={id:"parsed",title:"Parsed"},nD={id:"raw",title:"Raw JSON"},nW=[nR,nD],nN=ew()(1e3);function nF(e){let{path:n}=e,t=nN.get(n);void 0!==t&&nN.set(n,!t)}function nB(e){let n=window.getSelection();if(n){let t=document.createRange();n.removeAllRanges(),t.selectNodeContents(e),n.addRange(t)}}function nA(e){nB(e.currentTarget)}function nZ(e){let n=65===e.keyCode&&(e.metaKey||e.ctrlKey);n&&(e.preventDefault(),nB(e.currentTarget))}let nU=ed.ZP.div(e=>{let{theme:n}=e,{color:t,fonts:i,space:l}=n.sanity;return(0,ed.iv)(j||(j=eT(["\n    & .json-inspector,\n    & .json-inspector .json-inspector__selection {\n      font-family: ",";\n      font-size: ","px;\n      line-height: ","px;\n      color: var(--card-code-fg-color);\n    }\n\n    & .json-inspector .json-inspector__leaf {\n      padding-left: ",";\n    }\n\n    & .json-inspector .json-inspector__leaf.json-inspector__leaf_root {\n      padding-top: ",";\n      padding-left: 0;\n    }\n\n    & .json-inspector > .json-inspector__leaf_root > .json-inspector__line > .json-inspector__key {\n      display: none;\n    }\n\n    & .json-inspector .json-inspector__line {\n      display: block;\n      position: relative;\n      cursor: default;\n    }\n\n    & .json-inspector .json-inspector__line::after {\n      content: '';\n      position: absolute;\n      top: 0;\n      left: -200px;\n      right: -50px;\n      bottom: 0;\n      z-index: -1;\n      pointer-events: none;\n    }\n\n    & .json-inspector .json-inspector__line:hover::after {\n      background: var(--card-code-bg-color);\n    }\n\n    & .json-inspector .json-inspector__leaf_composite > .json-inspector__line {\n      cursor: pointer;\n    }\n\n    & .json-inspector .json-inspector__leaf_composite > .json-inspector__line::before {\n      content: '▸ ';\n      margin-left: calc(0 - "," + 3px);\n      font-size: ","px;\n      line-height: ","px;\n    }\n\n    &\n      .json-inspector\n      .json-inspector__leaf_expanded.json-inspector__leaf_composite\n      > .json-inspector__line::before {\n      content: '▾ ';\n      font-size: ","px;\n      line-height: ","px;\n    }\n\n    & .json-inspector .json-inspector__radio,\n    & .json-inspector .json-inspector__flatpath {\n      display: none;\n    }\n\n    & .json-inspector .json-inspector__value {\n      margin-left: ",";\n    }\n\n    &\n      .json-inspector\n      > .json-inspector__leaf_root\n      > .json-inspector__line\n      > .json-inspector__key\n      + .json-inspector__value {\n      margin: 0;\n    }\n\n    & .json-inspector .json-inspector__key {\n      color: ",";\n    }\n\n    & .json-inspector .json-inspector__value_helper,\n    & .json-inspector .json-inspector__value_null {\n      color: ",";\n    }\n\n    & .json-inspector .json-inspector__not-found {\n      padding-top: ",";\n    }\n\n    & .json-inspector .json-inspector__value_string {\n      color: ",";\n    }\n\n    & .json-inspector .json-inspector__value_boolean {\n      color: ",";\n    }\n\n    & .json-inspector .json-inspector__value_number {\n      color: ",";\n    }\n\n    & .json-inspector .json-inspector__show-original {\n      display: inline-block;\n      padding: 0 6px;\n      cursor: pointer;\n    }\n\n    & .json-inspector .json-inspector__show-original:hover {\n      color: inherit;\n    }\n\n    & .json-inspector .json-inspector__show-original::before {\n      content: '↔';\n    }\n\n    & .json-inspector .json-inspector__show-original:hover::after {\n      content: ' expand';\n    }\n  "])),i.code.family,i.code.sizes[2].fontSize,i.code.sizes[2].lineHeight,(0,O.hO)(l[4]),(0,O.hO)(l[3]),(0,O.hO)(l[4]),i.code.sizes[2].fontSize,i.code.sizes[2].lineHeight,i.code.sizes[2].fontSize,i.code.sizes[2].lineHeight,(0,O.hO)(l[4]/2),t.syntax.property,t.syntax.constant,(0,O.hO)(l[3]),t.syntax.string,t.syntax.boolean,t.syntax.number)});function nK(e){let{onChange:n,query:t}=e,i=(0,I.useCallback)(e=>n(e.target.value),[n]);return(0,E.jsx)(O.oi,{icon:ec.W1M,onChange:i,placeholder:"Search",radius:2,value:t||""})}function nV(e){let{value:n}=e,{onInspectClose:t,paneKey:i}=(0,L.u)(),l="".concat(i,"_inspect_"),[r,o]=nT("desk-tool","inspect-view-preferred-view-mode-".concat(i),"parsed"),a=nW.find(e=>e.id===r),s=(0,I.useCallback)(()=>{o(nR.id)},[o]),d=(0,I.useCallback)(()=>{o(nD.id)},[o]);return(0,E.jsx)(O.Vq,{id:"".concat(l,"dialog"),header:(0,ei.Uy$)(n)&&(0,ei.HD0)(n._id)&&(0,ei.HD0)(n._type)?(0,E.jsxs)(E.Fragment,{children:["Inspecting"," ",(0,E.jsx)("em",{children:(0,E.jsx)(L.l,{document:n})})]}):(0,E.jsx)("em",{children:"No value"}),onClose:t,width:3,children:(0,E.jsxs)(O.kC,{direction:"column",height:"fill",children:[(0,E.jsx)(O.Zb,{padding:3,shadow:1,style:{position:"sticky",bottom:0,zIndex:3},children:(0,E.jsxs)(O.td,{space:1,children:[(0,E.jsx)(O.OK,{"aria-controls":"".concat(l,"tabpanel"),fontSize:1,id:"".concat(l,"tab-").concat(nR.id),label:nR.title,onClick:s,selected:a===nR}),(0,E.jsx)(O.OK,{"aria-controls":"".concat(l,"tabpanel"),fontSize:1,id:"".concat(l,"tab-").concat(nD.id),label:nD.title,onClick:d,selected:a===nD})]})}),(0,E.jsxs)(O.x4,{"aria-labelledby":"".concat(l,"tab-").concat(r),flex:1,id:"".concat(l,"tabpanel"),overflow:"auto",padding:4,style:{outline:"none"},children:[a===nR&&(0,E.jsx)(nU,{children:(0,E.jsx)(eb(),{data:n,isExpanded:function e(n,t){let i=nN.get(n);return void 0===i?(nN.set(n,Array.isArray(t)||(0,ei.Uy$)(t)),e(n,t)):i},onClick:nF,search:nK})}),a===nD&&(0,E.jsx)(O.EK,{language:"json",tabIndex:0,onKeyDown:nZ,onDoubleClick:nA,onFocus:nA,children:JSON.stringify(n,null,2)})]})]})})}let n$=(0,ed.ZP)(O.Zb)(v||(v=eT(["\n  position: relative;\n  z-index: 50;
1\n"]))),nH=(0,ed.ZP)(O.xv)(b||(b=eT(["\n  & > * {\n    overflow: hidden;\n    white-space: nowrap;\n    text-overflow: ellipsis;\n  }\n"]))),nX=(0,I.memo)(()=>{var e,n,t,i,l,r;let o=(0,ei.rq_)(),{params:a,groupIndex:s,routerPanesState:d,replaceCurrent:c,BackLink:u}=(0,L.i)(),p=null==(e=d[s])?void 0:e[0].id,h=d[s-1],f=null==h?void 0:h[0],m=null==f?void 0:f.id,x=Boolean(null==(n=null==f?void 0:f.params)?void 0:n.rev),g=(0,I.useMemo)(()=>(null==a?void 0:a.parentRefPath)&&(0,eh.mL)(a.parentRefPath)||null,[null==a?void 0:a.parentRefPath]),j=(0,em.m2)(()=>{let e=null==g?void 0:g[0];if(!m||!e||!g)return(0,G.of)({loading:!1});let n=(0,ei.vsM)(m),t=(0,eh.mL)(e),i=t.findIndex(e=>"object"==typeof e&&"_key"in e);return(0,Q.z)((0,G.of)({loading:!0}),o.unstable_observePathsDocumentPair(n,-1===i?t:t.slice(0,i)).pipe((0,H.b)(750),(0,B.U)(e=>{var n;let{draft:t,published:i}=e;return{loading:!1,result:{availability:{draft:t.availability,published:i.availability},refValue:null==(n=(0,eh.U2)(t.snapshot||i.snapshot,g))?void 0:n._ref}}})))},[m,g],{loading:!0}),v=(0,I.useCallback)(()=>{var e;!j.loading&&(null==(e=j.result)?void 0:e.refValue)&&c({id:j.result.refValue,params:a})},[j.loading,j.result,c,a]),b=!m||!g||x||j.loading||!(null==(t=j.result)?void 0:t.availability.draft.available)&&!(null==(i=j.result)?void 0:i.availability.published.available)||(null==(l=j.result)?void 0:l.refValue)===p;return b?null:(0,E.jsx)(n$,{shadow:1,tone:"caution","data-testid":"reference-changed-banner",children:(0,E.jsx)(O.W2,{paddingX:4,paddingY:2,sizing:"border",width:1,children:(0,E.jsxs)(O.kC,{align:"center",children:[(0,E.jsx)(O.xv,{size:1,children:(0,E.jsx)(ec.foC,{})}),(null==(r=j.result)?void 0:r.refValue)?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(O.xu,{flex:1,marginLeft:3,children:(0,E.jsx)(nH,{title:"This reference has changed since you opened it.",size:1,children:"This reference has changed since you opened it."})}),(0,E.jsx)(O.xu,{marginLeft:3,children:(0,E.jsx)(O.zx,{onClick:v,icon:ec.bnu,fontSize:1,mode:"ghost",padding:2,space:2,text:"Reload reference"})})]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(O.xu,{flex:1,marginLeft:3,children:(0,E.jsx)(nH,{title:"This reference has been removed since you opened it.",size:1,children:"This reference has been removed since you opened it."})}),(0,E.jsx)(O.xu,{marginLeft:3,children:(0,E.jsx)(O.zx,{as:u,icon:ec.Two,fontSize:1,mode:"ghost",padding:2,space:2,text:"Close reference"})})]})]})})})});nX.displayName="ReferenceChangedBanner";let nq=(0,ed.ZP)(O.Zb)(y||(y=eT(["\n  position: relative;\n  z-index: 50;\n"])));function nY(e){var n,t;let{granted:i,requiredPermission:l}=e,r=(0,ei.xJ)(),o=(null==(n=null==r?void 0:r.roles)?void 0:n.length)!==1,a=((null==(t=null==r?void 0:r.roles)?void 0:t.map(e=>(0,E.jsx)("code",{children:e.title},e.name)))||[]).reduce((e,n)=>null===e?[n]:e.concat([", ",n]),null);return i?null:(0,E.jsx)(nq,{"data-testid":"permission-check-banner",shadow:1,tone:"transparent",children:(0,E.jsx)(O.W2,{paddingX:4,paddingY:3,sizing:"border",width:1,children:(0,E.jsxs)(O.kC,{align:"flex-start",children:[(0,E.jsx)(O.xv,{size:1,children:(0,E.jsx)(ec.CPA,{})}),(0,E.jsx)(O.xu,{flex:1,marginLeft:3,children:(0,E.jsxs)(O.xv,{size:1,children:["Your role",o&&"s"," ",a," ",o?"do":"does"," not have permissions to"," ",l," this document."]})})]})})})}let nJ=e=>e.preventDefault();function nG(e){var n;let{hidden:t,margins:i}=e,{collapsedFieldSets:l,collapsedPaths:r,displayed:o,editState:a,documentId:s,documentType:d,onChange:c,validation:u,ready:p,formState:h,onFocus:f,onBlur:m,onSetCollapsedPath:x,onPathOpen:g,onSetCollapsedFieldSet:j,onSetActiveFieldGroup:v}=(0,L.u)(),b=(0,ei.H__)(),y=(0,ei.Dqo)(s),w=(0,I.useMemo)(()=>(0,ei.fm0)(),[]),k=null==(n=null==a?void 0:a.transactionSyncLock)?void 0:n.enabled;!function(e){let n=(0,O.pm)(),t=function(e){let n=(0,I.useRef)();return(0,I.useEffect)(()=>{n.current=e},[e]),n.current}(e.enabled);(0,I.useEffect)(()=>{!t&&e.enabled&&n.push(eD(eD({},e),{},{duration:20736e5})),t&&!e.enabled&&n.push(eD(eD({},e),{},{duration:.01}))},[e,n,t])}({id:"sync-lock-".concat(s),status:"warning",enabled:k,title:"Syncing document…",description:"Please hold tight while the document is synced. This usually happens right after the document has been published, and it shouldn't take more than a few seconds"}),(0,I.useEffect)(()=>{let e=b.pair.documentEvents(s,d).pipe((0,q.b)(e=>{"mutation"===e.type&&w.publish(function(e){let n=e.mutations.map(e=>
1e.patch).filter(Boolean);return{type:"mutation",snapshot:e.document,patches:(0,ei.Sis)(e.origin,n)}}(e)),"rebase"===e.type&&w.publish(function(e){let n=e.remoteMutations.map(e=>e.patch).filter(Boolean),t=e.localMutations.map(e=>e.patch).filter(Boolean);return{type:"rebase",snapshot:e.document,patches:(0,ei.Sis)("remote",n).concat((0,ei.Sis)("local",t))}}(e))})).subscribe();return()=>{e.unsubscribe()}},[s,b,d,w]);let C=Boolean(null==o?void 0:o._rev);return(0,I.useEffect)(()=>{C&&w.publish({type:"mutation",patches:[],snapshot:o})},[C]),(0,E.jsx)(O.W2,{hidden:t,paddingX:4,paddingTop:5,paddingBottom:9,sizing:"border",width:1,children:(0,E.jsx)(ei.$rW,{margins:i,children:(0,E.jsx)(O.xu,{as:"form",onSubmit:nJ,children:p?null===h?(0,E.jsx)(O.xu,{padding:2,children:(0,E.jsx)(O.xv,{children:"This form is hidden"})}):(0,E.jsx)(ei.quP,{__internal_patchChannel:w,collapsedFieldSets:l,collapsedPaths:r,focusPath:h.focusPath,changed:h.changed,focused:h.focused,groups:h.groups,id:"root",members:h.members,onChange:c,onFieldGroupSelect:v,onPathBlur:m,onPathFocus:f,onPathOpen:g,onSetFieldSetCollapsed:j,onSetPathCollapsed:x,presence:y,readOnly:h.readOnly,schemaType:h.schemaType,validation:u,value:h.value}):(0,E.jsx)(eN,{ms:300,children:(0,E.jsxs)(O.kC,{align:"center",direction:"column",height:"fill",justify:"center",children:[(0,E.jsx)(O.$j,{muted:!0}),(0,E.jsx)(O.xu,{marginTop:3,children:(0,E.jsx)(O.xv,{align:"center",muted:!0,size:1,children:"Loading document"})})]})})})})})}function nQ(){let{activeViewId:e,paneKey:n,views:t}=(0,L.u)(),i="".concat(n,"tabpanel");return(0,E.jsx)(O.td,{space:1,children:t.map((t,l)=>{var r;return(0,E.jsx)(n0,{icon:t.icon,id:"".concat(n,"tab-").concat(t.id),isActive:e===t.id,label:(0,E.jsx)(E.Fragment,{children:t.title}),tabPanelId:i,viewId:0===l?null:null!=(r=t.id)?r:null},t.id)})})}function n0(e){let{icon:n,id:t,isActive:i,label:l,tabPanelId:r,viewId:o}=e,{ready:a}=(0,L.u)(),{setView:s}=(0,L.i)(),d=(0,I.useCallback)(()=>s(o),[s,o]);return(0,E.jsx)(O.OK,{"aria-controls":r,disabled:!a,fontSize:1,icon:n,id:t,selected:i,label:l,onClick:d})}let n1={error:{tone:"critical",icon:ec.uIy},warning:{tone:"caution",icon:ec.foC},info:{tone:"primary",icon:ec.hQ6}};function n2(e){let{boundaryElement:n,isOpen:t,setOpen:i}=e,{onFocus:l,onPathOpen:r,schemaType:o,validation:a}=(0,L.u)(),s=(0,I.useId)(),d=a.length>0,c=a.some(ef.YN),u=a.some(ef.WQ),p=a.some(ef.Ny),h=(0,I.useMemo)(()=>c?n1.error:u?n1.warning:p?n1.info:void 0,[c,p,u]),f=(0,I.useCallback)(()=>i(!1),[i]);return d?(0,E.jsx)(O.j2,{id:s||"",button:(0,E.jsx)(O.zx,eD(eD({},h),{},{title:"Show validation issues",mode:"bleed","data-testid":"validation-list-button"})),menu:(0,E.jsx)(O.v2,{open:t,children:(0,E.jsx)(ei.$L,{documentType:o,validation:a,onClose:f,onFocus:r})}),popover:{portal:!0,boundaryElement:n,constrainSize:!0,preventOverflow:!0,width:0},placement:"bottom"}):null}function n3(){let{connectionState:e,schemaType:n,title:t,value:i}=(0,L.u)(),l=Boolean(i)&&"connected"===e,{error:r,value:o}=(0,ei._2T)({enabled:l,schemaType:n,value:i});return"connected"!==e?(0,E.jsx)(E.Fragment,{}):i?l?r?(0,E.jsxs)(E.Fragment,{children:["Error: ",r.message]}):(0,E.jsx)(E.Fragment,{children:(null==o?void 0:o.title)||(0,E.jsx)("span",{style:{color:"var(--card-muted-fg-color)"},children:"Untitled"})}):(0,E.jsx)(E.Fragment,{children:t}):(0,E.jsxs)(E.Fragment,{children:["New ",(null==n?void 0:n.title)||(null==n?void 0:n.name)]})}let n4=e=>Boolean(e.showAsAction),n5=eC()(n4),n8=(0,I.memo)((0,I.forwardRef)((e,n)=>{let{rootElement:t}=e,{onMenuAction:i,onPaneClose:l,onPaneSplit:r,historyController:o,validation:a,menuItems:s,menuItemGroups:d,schemaType:c,ready:u,views:p,unstable_languageFilter:h}=(0,L.u)(),{revTime:f}=o,{features:m}=e1(),{index:x,BackLink:g,hasGroupSiblings:j}=(0,L.i)(),v=(0,I.useMemo)(()=>s.filter(n5),[s]),[b,y]=I.useState(!1),w=p.length>1,k=m.reviewChanges,C=m.splitViews&&r&&p.length>1,_=C&&j,S=!_&&!m.backButton;return(0,E.jsx)(L.g,{ref:n,loading:!u,title:(0,E.jsx)(n3,{}),tabs:w&&(0,E.jsx)(nQ,{}),backButton:m.backButton&&x>0&&(0,E.jsx)(O.zx,{as:g,"data-as":"a",icon:ec.Y4O,mode:"bleed"}),subActions:k&&(0,E.jsx)(nM,{chunk:f,mode:"rev",placement:"bottom-end"}),actions:(0,E.jsxs)(O.gF,{space:1,children:[h.length>0&&(0,E.jsx)(E.Fragment,{children:h.map((e,n)=>(0,I.createElement)(e,{key:"language-filter-".concat(n),schemaType:c}))}),a.length>0&&(0,E.jsx)(n2,{boundaryElement:t,isOpen:b,setOpen:y},"validation-menu"),(0,E.jsx)(L.m,{itemGroups:d,items:v,onAction:i},"context-menu"),C&&(0,E.jsx)(O.zx,{icon:ec.iro,mode:"bleed",onClick:r,title:"Split pane right"},"split-pane-button"),_&&(0,E.jsx)(O.zx,{icon:ec.Two,mode:"bleed",onClick:l,title:"Close split pane"},"close-view-button"),S&&(0,E.jsx)(O.zx,{icon:ec.Two,mode:"bleed",title:"Close pane group",as:g},"close-view-button")]})})}));n8.displayName="DocumentPanelHeader";let n9=(0,ed.ZP)(ei.l$t)(e=>{let{$disabled:n}=e;return n?{height:"100%"}:(0,ed.iv)(w||(w=eT(["\n    height: 100%;\n    overflow: auto;\n    position: relative;\n    scroll-behavior: smooth;\n    outline: none;\n  "])))}),n6=function(e){let{footerHeight:n,isInspectOpen:t,rootElement:i,setDocumentPanelPortalElement:l}=e,{activeViewId:r,displayed:o,documentId:a,editState:s,value:d,views:c,ready:u,schemaType:p,permissions:h,isPermissionsLoading:f}=(0,L.u)(),{collapsed:m}=(0,L.n)(),x=(0,O.vI)(),{features:g}=e1(),[j,v]=(0,I.useState)(null),b=(0,O.XL)(j),y=(0,I.useRef)(null),[w,k]=(0,I.useState)(null),C=d._createdAt?"update":"create",_=(0,I.useMemo)(()=>c.find(e=>e.id===r)||c[0]||{type:"form"},[r,c]),S=g.splitPanes&&y.current||x.element,P=(0,I.useMemo)(()=>m?[(null==b?void 0:b.height)||0,0,n?n+2:2,0]:[0,0,2,0],[m,n,b]),z="form"!==_.type,M=(0,I.useMemo)(()=>"component"===_.type&&_.component&&(0,I.createElement)(_.component,{document:{draft:(null==s?void 0:s.draft)||null,displayed:o||d,historical:o,published:(null==s?void 0:s.published)||null},documentId:a,options:_.options,schemaType:p}),[_,o,a,null==s?void 0:s.draft,null==s?void 0:s.published,p,d]);(0,I.useEffect)(()=>{(null==w?void 0:w.scrollTo)&&w.scrollTo(0,0)},[a,w]),(0,I.useEffect)(()=>{S&&l(S)},[S,l]);let T=(0,I.useMemo)(()=>t?(0,E.jsx)(nV,{value:o||d}):null,[t,o,d]);return(0,E.jsxs)(O.kC,{direction:"column",flex:2,overflow:m?void 0:"hidden",children:[(0,E.jsx)(n8,{rootElement:i,ref:v}),(0,E.jsx)(L.h,{children:(0,E.jsx)(O.Xp,{element:S,__unstable_elements:{documentScrollElement:w},children:(0,E.jsxs)(O.NM,{element:w,children:["form"===_.type&&!f&&u&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(nY,{granted:Boolean(null==h?void 0:h.granted),requiredPermission:C}),(0,E.jsx)(nX,{})]}),(0,E.jsxs)(n9,{$disabled:m||!1,"data-testid":"document-panel-scroller",ref:k,children:[(0,E.jsx)(nG,{hidden:z,margins:P}
1,a+(u?"_ready":"_pending")),M]}),T,(0,E.jsx)("div",{"data-testid":"document-panel-portal",ref:y})]})})})]})},n7=["left","bottom"],te={small:0,medium:1,large:2,full:"auto"};function tn(e){let{dialog:n,referenceElement:t}=e;return(0,E.jsx)(O.J2,{content:(0,E.jsx)(tt,{dialog:n}),fallbackPlacements:n7,open:!0,placement:"top",portal:!0,preventOverflow:!0,referenceElement:t})}function tt(e){let{dialog:n}=e,{cancelButtonIcon:t,cancelButtonText:i,confirmButtonIcon:l,confirmButtonText:r,message:o,onCancel:a,onConfirm:s,tone:d}=n,{isTopLayer:c}=(0,O.sJ)(),[u,p]=(0,I.useState)(null),h=(0,I.useCallback)(()=>{c&&a()},[c,a]),f=(0,I.useCallback)(e=>{"Escape"===e.key&&c&&a()},[c,a]);return(0,O.O8)(h,[u]),(0,O.qh)(f),(0,E.jsxs)(O.kC,{direction:"column",ref:p,style:{minWidth:304,maxWidth:400},children:[(0,E.jsx)(O.xu,{flex:1,overflow:"auto",padding:4,children:(0,E.jsx)(O.xv,{children:o})}),(0,E.jsx)(O.xu,{paddingX:4,paddingY:3,style:{borderTop:"1px solid var(--card-border-color)"},children:(0,E.jsxs)(O.rj,{columns:2,gap:2,children:[(0,E.jsx)(O.zx,{icon:t,onClick:a,mode:"ghost",text:i||"Cancel"}),(0,E.jsx)(O.zx,{icon:l,onClick:s,text:r||"Confirm",tone:d})]})})]})}function ti(e){let{dialog:n}=e,t=(0,I.useId)(),i=n.footer&&(0,E.jsx)(O.xu,{paddingX:4,paddingY:3,children:n.footer});return(0,E.jsx)(ei.jr5,{zOffset:"fullscreen",children:(0,E.jsx)(O.Vq,{__unstable_hideCloseButton:!1===n.showCloseButton,footer:i,header:n.header,id:t,onClose:n.onClose,onClickOutside:n.onClose,width:void 0===n.width?1:te[n.width],portal:"documentPanelPortalElement",children:(0,E.jsx)(O.xu,{padding:4,children:n.content})})})}function tl(e){let{dialog:n,referenceElement:t}=e;return(0,E.jsx)(O.J2,{content:(0,E.jsx)(tr,{dialog:n}),fallbackPlacements:n7,open:!0,placement:"top",portal:!0,preventOverflow:!0,referenceElement:t})}function tr(e){let{dialog:n}=e,{content:t,onClose:i}=n,{isTopLayer:l}=(0,O.sJ)(),[r,o]=(0,I.useState)(null),a=(0,I.useCallback)(()=>{l&&i()},[l,i]),s=(0,I.useCallback)(e=>{"Escape"===e.key&&l&&i()},[l,i]);return(0,O.O8)(a,[r]),(0,O.qh)(s),(0,E.jsx)("div",{ref:o,children:t})}function to(e){let{dialog:n,referenceElement:t=null}=e,i=(0,I.useId)();return"confirm"===n.type?(0,E.jsx)(tn,{dialog:n,referenceElement:t}):"popover"===n.type?(0,E.jsx)(tl,{dialog:n,referenceElement:t}):"dialog"!==n.type&&n.type?(console.warn("Unsupported modal type ".concat(n.type)),(0,E.jsx)(O.Vq,{id:i,onClose:n.onClose,onClickOutside:n.onClose,width:2,children:(0,E.jsx)(O.xu,{padding:4,children:n.content||(0,E.jsxs)(E.Fragment,{children:["Unexpected modal type (",(0,E.jsx)("code",{children:n.type}),")"]})})})):(0,E.jsx)(ti,{dialog:n})}function ta(e){let{actionStates:n,disabled:t}=e,i=(0,I.useId)(),l=(0,I.useRef)(null),[r,o]=(0,I.useState)(-1),[a,s]=(0,I.useState)(null),d=(0,I.useCallback)(e=>{o(e)},[]),c=(0,I.useMemo)(()=>({placement:"top-end",portal:!0,preventOverflow:!0}),[]),u=n[r];return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(O.j2,{id:"".concat(i,"-action-menu"),button:(0,E.jsx)(O.zx,{"data-testid":"action-menu-button","aria-label":"Open document actions",disabled:t,icon:ec.v4q,mode:"ghost",ref:l}),menu:(0,E.jsx)(O.v2,{padding:1,children:n.map((e,n)=>(0,E.jsx)(ts,{actionState:e,disabled:t,index:n,onAction:d},n))}),popover:c,ref:s}),u&&u.dialog&&(0,E.jsx)(ei.jr5,{zOffset:"paneFooter",children:(0,E.jsx)(to,{dialog:u.dialog,referenceElement:a})})]})}function ts(e){let{actionState:n,disabled:t,index:i,onAction:l}=e,{onHandle:r}=n,o=(0,I.useCallback)(()=>{l(i),r&&r()},[i,l,r]),a=n.title&&(0,E.jsx)(O.xu,{padding:2,children:(0,E.jsx)(O.xv,{size:1,children:n.title})});return(0,E.jsx)(O.sN,{"data-testid":"action-".concat(n.label.replace(" ","")),disabled:t||Boolean(n.disabled),onClick:o,padding:0,tone:n.tone,children:(0,E.jsx)(O.u,{content:a,disabled:!a,fallbackPlacements:["left","bottom"],placement:"top",portal:!0,children:(0,E.jsxs)(O.kC,{align:"center",paddingX:3,children:[(0,E.jsxs)(O.kC,{flex:1,paddingY:3,children:[n.icon&&(0,E.jsx)(O.xu,{marginRight:3,children:(0,E.jsxs)(O.xv,{children:[(0,I.isValidElement)(n.icon)&&n.icon,(0,eu.isValidElementType)(n.icon)&&(0,I.createElement)(n.icon)]})}),(0,E.jsx)(O.xv,{children:n.label})]}),n.shortcut&&(0,E.jsx)(O.xu,{marginLeft:3,children:(0,E.jsx)(O.p8,{keys:String(n.shortcut).split("+").map(e=>e.slice(0,1).toUpperCase()+e.slice(1))})})]})})})}function td(e){let{disabled:n,showMenu:t,states:i}=e,[l,...r]=i,[o,a]=(0,I.useState)(null),s=(0,I.useMemo)(()=>l&&(l.title||l.shortcut)?(0,E.jsxs)(O.kC,{padding:2,style:{maxWidth:300},align:"center",children:[(0,E.jsx)(O.xv,{size:1,children:l.title}),l.shortcut&&(0,E.jsx)(O.xu,{marginLeft:l.title?2:0,children:(0,E.jsx)(O.p8,{keys:String(l.shortcut).split("+").map(e=>e.slice(0,1).toUpperCase()+e.slice(1).toLowerCase())})})]}):null,[l]);return(0,E.jsxs)(O.kC,{children:[l&&(0,E.jsx)(O.li,{zOffset:200,children:(0,E.jsx)(O.u,{disabled:!s,content:s,portal:!0,placement:"top",children:(0,E.jsx)(O.Kq,{flex:1,children:(0,E.jsx)(O.zx,{"data-testid":"action-".concat(l.label),disabled:n||Boolean(l.disabled),icon:l.icon,onClick:l.onHandle,ref:a,text:l.label,tone:l.tone||"primary"})})})}),t&&r.length>0&&(0,E.jsx)(O.xu,{marginLeft:1,children:(0,E.jsx)(ta,{actionStates:r,disabled:n})}),l&&l.dialog&&(0,E.jsx)(to,{dialog:l.dialog,referenceElement:o})]})}let tc=(0,I.memo)(function(){let{actions:e,connectionState:n,editState:t}=(0,L.u)();return e&&t?(0,E.jsx)(eF,{actions:e,actionProps:t,children:t=>{let{states:i}=t;return(0,E.jsx)(td,{disabled:"connected"!==n,showMenu:e.length>1,states:i})}}):null}),tu=(0,I.memo)(function(){var e;let{connectionState:n,editState:t,historyController:i}=(0,L.u)(),l=(null==(e=i.revTime)?void 0:e.id)||"",r=((null==t?void 0:t.draft)||(null==t?void 0:t.published)||{})._rev===l,o=(0,I.useMemo)(()=>eD(eD({},t||{}),{},{revision:l}),[t,l]),a=(0,I.useMemo)(()=>[L.H],[]);return(0,E.jsx)(eF,{actions:a,actionProps:o,children:e=>{let{states:t}=e;return(0,E.jsx)(td,{disabled:"connected"!==n||Boolean(r),showMenu:!1,states:t})}})}),tp={primary:"primary",success:"positive",warning:"caution",danger:"critical"};function th(e){let{states:n}=e;return(0,E.jsx)(O.gF,{space:1,children:n.map((e,n)=>(0,E.jsx)(O.u,{content:e.title&&(0,E.jsx)(O.xu,{padding:2,children:(0,E.jsx)(O.xv,{size:1,children:e.title})}),disabled:!e.title,placement:"top",portal:!0,children:(0,E.jsx)(O.Ct,{fontSize:1,mode:"outline",paddingX:2,paddingY:1,radius:4,tone:e.color?tp[e.color]:void 0,style:{whiteSpace:"nowrap"},children:e.label})},String(n)))})}function tf(){let{badges:e,editState:n}=(0,L.u)();return n&&e?(0,E.jsx)(eB,{badges:e,badgeProps:n,children:e=>{let{states:n}=e;return(0,E.jsx)(th,{states:n})}}):null}let tm=(0,ed.ZP)(O.kC)(k||(k=eT(["\n  cursor: default;
1\n"])));function tx(e){let{collapsed:n,disabled:t,lastPublished:i,lastUpdated:l,liveEdit:r}=e,o=(0,ei.INm)(i||"",{minimal:!0,agoSuffix:!0}),a=(0,ei.INm)(i||"",{minimal:!0}),s=(0,ei.INm)(l||"",{minimal:!0,agoSuffix:!0}),d=(0,ei.INm)(l||"",{minimal:!0});return(0,E.jsx)(tm,{align:"center","data-ui":"SessionLayout",sizing:"border",children:(0,E.jsx)(O.u,{placement:"top",portal:!0,content:(0,E.jsx)(O.Kq,{padding:3,space:3,children:(0,E.jsx)(O.xv,{size:1,muted:!0,children:r?(0,E.jsxs)(E.Fragment,{children:["Last updated ",l?s:o]}):(0,E.jsxs)(E.Fragment,{children:["Last published ",o]})})}),children:(0,E.jsx)(O.zx,{mode:"bleed",tone:r?"critical":"positive",tabIndex:-1,disabled:t,children:(0,E.jsxs)(O.kC,{align:"center",children:[(0,E.jsx)(O.xu,{marginRight:n?0:3,children:(0,E.jsx)(O.xv,{size:2,children:r?(0,E.jsx)(ec.o1U,{}):(0,E.jsx)(ec.EI4,{})})}),!n&&(0,E.jsx)(O.xv,{size:1,weight:"medium",children:r?(0,E.jsx)(E.Fragment,{children:l?d:a}):a})]})})})})}let tg=(0,ed.ZP)(e_.E.path)(C||(C=eT(["\n  transform-origin: center;\n"]))),tj=e=>(0,E.jsx)(e_.E.circle,eD({fill:"none",r:"8",cx:"12.5",cy:"12.5",strokeWidth:"1.2"},e)),tv=e=>(0,E.jsx)(tg,eD({fill:"none",d:"M14 17.5619L11.5 20.5L14.5 23.0619M11 7.43811L13.5 4.50001L10.5 1.93811"},e)),tb=e=>(0,E.jsx)(e_.E.path,eD({d:"M9.5 12.1316L11.7414 14.5L16 10"},e)),ty=e=>(0,E.jsx)(e_.E.path,eD({d:"M15 7L18 10M6 19L7 15L17 5L20 8L10 18L6 19Z"},e)),tw=(0,ed.F4)(_||(_=eT(["\n  0% {\n    transform: rotate(0);\n  }\n  100% {\n    transform: rotate(360deg);\n  }\n"]))),tk=ed.ZP.g(S||(S=eT(["\n  transform-origin: center;\n\n  &[data-rotate] {\n    animation: "," 1s ease-in-out infinite;\n  }\n"])),tw),tC={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}}},t_={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}}},tS={syncing:{opacity:1,transition:{duration:0}},saved:{opacity:0,transition:{duration:.2}},changes:{opacity:0}},tP={syncing:{pathLength:0,transition:{duration:0}},saved:{pathLength:1,transition:{delay:.4,duration:.3}},changes:{pathLength:0,transition:{duration:.2}}},tz={syncing:{pathLength:0,transition:{duration:0}},saved:{pathLength:0,transition:{duration:0}},changes:{pathLength:1,transition:{duration:.4,delay:.5}}};function tM(e){let{status:n}=e;return n?(0,E.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",stroke:"currentColor",strokeWidth:"1.2","data-sanity-icon":"",children:(0,E.jsxs)(e_.E.g,{variants:tC,initial:n,animate:n,children:[(0,E.jsxs)(tk,{"data-rotate":"changes"===n?void 0:"",children:[(0,E.jsx)(tv,{variants:tS,initial:n,animate:n}),(0,E.jsx)(tj,{variants:t_,initial:n,animate:n})]}),(0,E.jsx)(tb,{variants:tP,initial:n,animate:n}),(0,E.jsx)(ty,{variants:tz,initial:n,animate:n})]})}):null}let tE=I.forwardRef(function(e,n){let{collapsed:t,status:i,lastUpdated:l}=e,r=eW(e,eI),o=(0,ei.INm)(l||"",{minimal:!0}),a=(0,ei.INm)(l||"",{minimal:!0,agoSuffix:!0}),s=(0,I.useMemo)(()=>"syncing"===i?{text:"Saving...",tone:void 0}:"changes"===i?{text:o,tone:"caution"}:"saved"===i?{text:"Saved!",tone:"positive"}:{},[i,o]);return i?(0,E.jsx)(O.u,{placement:"top",portal:!0,disabled:"changes"!==i,content:(0,E.jsxs)(O.Kq,{padding:3,space:3,children:[(0,E.jsx)(O.xv,{size:1,weight:"semibold",children:"Review changes"}),(0,E.jsxs)(O.xv,{size:1,muted:!0,children:["Changes saved ",a]})]}),children:(0,E.jsx)(O.zx,eD(eD({mode:"bleed",justify:"flex-start",tone:null==s?void 0:s.tone},r),{},{"data-testid":"review-changes-button",ref:n,children:(0,E.jsxs)(O.kC,{align:"center",children:[(0,E.jsx)(O.xu,{marginRight:t?0:3,children:(0,E.jsx)(O.xv,{children:(0,E.jsx)(tM,{status:i})})}),!t&&(0,E.jsx)(O.xv,{size:1,weight:"medium",children:null==s?void 0:s.text})]})}))}):null}),tI=I.memo(tE),tO=(0,I.memo)(function(){var e;let{changesOpen:n,documentId:t,documentType:i,editState:l,onHistoryClose
1:r,onHistoryOpen:o,historyController:a,value:s}=(0,L.u)(),d=(0,ei.nuD)(t,i),c=null==s?void 0:s._updatedAt,u=null==(e=null==l?void 0:l.published)?void 0:e._updatedAt,p=a.onOlderRevision(),h=Boolean(null==l?void 0:l.liveEdit),f=Boolean(null==l?void 0:l.published),m=Boolean(null==l?void 0:l.draft),[x,g]=(0,I.useState)(null),j=(0,O.XL)(x),v=!j||(null==j?void 0:j.width)<300,[b,y]=(0,I.useState)(null);(0,I.useEffect)(()=>{if("syncing"===b){let e=setTimeout(()=>y("saved"),1e3);return()=>clearTimeout(e)}if("saved"===b){let n=setTimeout(()=>y(null),3e3);return()=>clearTimeout(n)}},[b,c]),(0,I.useLayoutEffect)(()=>{y(null)},[t]),(0,I.useLayoutEffect)(()=>{d.isSyncing&&y("syncing")},[d.isSyncing,c]);let w=(0,I.useMemo)(()=>(0,E.jsx)(tI,{lastUpdated:c,status:b||(m?"changes":void 0),onClick:n?r:o,disabled:p,selected:n,collapsed:v}),[m,n,r,o,c,p,b,v]),k=(0,I.useMemo)(()=>(h||f)&&(0,E.jsx)(O.xu,{marginRight:1,children:(0,E.jsx)(tx,{disabled:p,lastPublished:u,lastUpdated:c,liveEdit:h,collapsed:v})}),[v,u,c,h,f,p]);return(0,E.jsxs)(O.kC,{align:"center","data-ui":"DocumentSparkline",ref:g,children:[k,(0,E.jsxs)(O.kC,{align:"center",flex:1,children:[w,!v&&(0,E.jsx)(O.xu,{marginLeft:3,children:(0,E.jsx)(tf,{})})]})]})}),tL=(0,ed.ZP)(O.xu)(P||(P=eT(["\n  min-width: 10em;\n  max-width: 16em;\n"])));function tT(e){let{actionsBoxRef:n}=e,{badges:t,historyController:i}=(0,L.u)(),l=i.onOlderRevision();return(0,I.useMemo)(()=>(0,E.jsx)(O.xu,{paddingLeft:2,paddingRight:[2,3],paddingY:2,children:(0,E.jsxs)(O.kC,{align:"center",children:[(0,E.jsx)(O.xu,{flex:[1,2],children:t&&(0,E.jsx)(tO,{})}),(0,E.jsx)(tL,{flex:1,marginLeft:[1,3],ref:n,children:l?(0,E.jsx)(tu,{}):(0,E.jsx)(tc,{})})]})}),[n,t,l])}function tR(e){let{actionsBoxElement:n,activeIndex:t,children:i,id:l,onActionStart:r,onKeyDown:o,rootRef:a,states:s}=e,d=eW(e,eO),c=s[t],u=(0,I.useCallback)(e=>{let n=s.filter(n=>n.shortcut&&(0,ep.ZP)(n.shortcut,e)),t=n[0];if(n.length>1&&console.warn('Keyboard shortcut conflict: More than one document action matches the shortcut "'.concat(t.shortcut,'"')),t&&!t.disabled&&t.onHandle){e.preventDefault(),t.onHandle(),r(s.indexOf(t));return}o&&o(e)},[r,o,s]);return(0,E.jsxs)(L.f,eD(eD({id:l,onKeyDown:u,tabIndex:-1},d),{},{ref:a,children:[i,c&&c.dialog&&(0,E.jsx)(ei.jr5,{zOffset:"paneFooter",children:(0,E.jsx)(to,{dialog:c.dialog,referenceElement:n})})]}))}let tD=I.memo(e=>{let{actionsBoxElement:n,children:t}=e,i=eW(e,eL),{actions:l,editState:r}=(0,L.u)(),[o,a]=(0,I.useState)(-1),s=(0,I.useCallback)(e=>{a(e)},[]),d=(0,I.useMemo)(()=>r&&eD(eD({},r),{},{onComplete:()=>void 0,revision:void 0}),[r]);return d&&l?(0,E.jsx)(eF,{actionProps:d,actions:l,children:e=>{let{states:l}=e;return(0,E.jsx)(tR,eD(eD({},i),{},{activeIndex:o,actionsBoxElement:n,onActionStart:s,states:l,children:t}))}}):null});tD.displayName="DocumentActionShortcuts";let tW=["fixed","absolute"],tN=(0,ed.ZP)(ei.jbM)(z||(z=eT(["\n  flex: 1;\n  display: flex;\n  min-height: 0;\n  min-width: 0;\n"]))),tF=(0,I.memo)(function(e){let{name:n}=(0,ei.Lky)();return(0,E.jsx)(ei.cWh,{name:e.pane.source||n,children:(0,E.jsx)(tB,eD({},e))})});function tB(e){var n;let{pane:t,paneKey:i}=e,{resolveNewDocumentOptions:l}=(0,ei.Lky)().document,r=(0,L.i)(),o=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=(0,ei.zEW)();return(0,I.useMemo)(()=>{if(e.type&&"*"!==e.type)return e;let i=e.template||n.template,l=i?t.find(e=>e.id===i):void 0,r=null==l?void 0:l.schemaType;return r?eD(eD({},e),{},{type:r}):e},[e,n.template,t])}(t.options,r.params),{documentType:a,isLoaded:s}=(0,ei.Hdz)(o.id,o.type),d=(0,I.useMemo)(()=>l({type:"global"}),[l]),[c,u]=(0,ei.UMU)({templateItems:d}),p=s&&!u,h=(0,I.useMemo)(()=>p&&a&&o.type!==a?eD(eD({},e),{},{pane:eD(eD({},e.pane),{},{options:eD(eD({},o),{},{type:a})})}):e,[e,a,p,o]),{ReferenceChildLink:f,handleEditReference:m,groupIndex:x,routerPanesState:g}=r,j=(null==(n=g[x+1])?void 0:n[0].params)||{},v=g.length,{parentRefPath:b}=j,y=(0,I.useMemo)(()=>b?{path:(0,eh.mL)(b),state:x>=v-1?"none":x>=v-2?"selected":"pressed"}:{path:[],state:"none"},[b,x,v]);return"*"!==o.type||p?a?(0,E.jsx)(nf,eD(eD({},h),{},{children:(0,E.jsx)(ei.euX,{EditReferenceLinkComponent:f,onEditReference:m,initialValueTemplateItems:c,activePath:y,children:(0,E.jsx)(tA,{})})})):(0,E.jsx)(nr,{flex:2.5,minWidth:320,paneKey:i,title:(0,E.jsx)(E.Fragment,{children:"The document was not found"}),children:(0,E.jsx)(O.Kq,{space:4,children:(0,E.jsxs)(O.xv,{as:"p",children:["The document type is not defined, and a document with the ",(0,E.jsx)("code",{children:o.id})," ","identifier could not be found."]})})}):(0,E.jsx)(nt,{flex:2.5,minWidth:320,paneKey:i,title:"Loading document…"})}function tA(){let{changesOpen:e,documentType:n,onFocus:t,onPathOpen:i,onHistoryOpen:l,onKeyUp:r,inspectOpen:o,paneKey:a,schemaType:s,value:d}=(0,L.u)(),{features:c}=e1(),{collapsed:u}
1=(0,L.n)(),p=(0,ei.Cnp)(),[h,f]=(0,I.useState)(null),[m,x]=(0,I.useState)(null),[g,j]=(0,I.useState)(null),[v,b]=(0,I.useState)(null),y=(0,O.XL)(m),w=null==y?void 0:y.height,k=(0,I.useMemo)(()=>(0,E.jsx)(n6,{footerHeight:w||null,isInspectOpen:o,rootElement:h,setDocumentPanelPortalElement:b}),[w,h,o]),C=(0,I.useMemo)(()=>(0,E.jsx)(O.Xp,{__unstable_elements:{documentPanelPortalElement:v},children:(0,E.jsx)(O.Tu,{position:tW,zOffset:p.portal,children:(0,E.jsx)(L.o,{ref:x,children:(0,E.jsx)(tT,{actionsBoxRef:j})})})}),[v,p.portal]),_=(0,I.useMemo)(()=>c.reviewChanges&&e?(0,E.jsx)(O.NM,{element:h,children:(0,E.jsx)(nO,{})}):null,[e,c.reviewChanges,h]),S=(0,I.useCallback)(e=>{i(e),t(e)},[i,t]),P=(0,I.useMemo)(()=>s?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(O.Tu,{position:tW,zOffset:p.portal,children:(0,E.jsx)(O.kC,{direction:"column",flex:1,height:u?void 0:"fill",children:(0,E.jsxs)(tN,{"data-testid":"change-connector-root",isReviewChangesOpen:e,onOpenReviewChanges:l,onSetFocus:S,children:[k,_]})})}),C,(0,E.jsx)(na,{})]}):(0,E.jsx)(nr,{flex:2.5,minWidth:320,paneKey:a,title:(0,E.jsxs)(E.Fragment,{children:["Unknown document type: ",(0,E.jsx)("code",{children:n})]}),tone:"caution",children:(0,E.jsxs)(O.Kq,{space:4,children:[n&&(0,E.jsxs)(O.xv,{as:"p",children:["This document has the schema type ",(0,E.jsx)("code",{children:n}),", which is not defined as a type in the local content studio schema."]}),!n&&(0,E.jsx)(O.xv,{as:"p",children:"This document does not exist, and no schema type was specified for it."}),ei.r8Q&&d&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(O.xv,{as:"p",children:"Here is the JSON representation of the document:"}),(0,E.jsx)(O.Zb,{padding:3,overflow:"auto",radius:2,shadow:1,tone:"inherit",children:(0,E.jsx)(O.EK,{language:"json",size:[1,1,2],children:JSON.stringify(d,null,2)})})]})]})}),[s,p.portal,u,e,l,S,k,_,C,a,n,d]);return(0,E.jsx)(tD,{actionsBoxElement:g,currentMinWidth:e?920:600,"data-testid":"document-pane",flex:2.5,id:a,minWidth:e?640:320,onKeyUp:r,rootRef:f,children:P})}function tZ(){return(0,E.jsx)(O.Zb,{height:"fill",children:(0,E.jsx)(O.kC,{align:"center",height:"fill",justify:"center",padding:4,sizing:"border",children:(0,E.jsx)(O.W2,{width:0,children:(0,E.jsx)(O.Zb,{padding:4,radius:2,shadow:1,tone:"caution",children:(0,E.jsxs)(O.kC,{children:[(0,E.jsx)(O.xu,{children:(0,E.jsx)(O.xv,{size:1,children:(0,E.jsx)(ec.foC,{})})}),(0,E.jsxs)(O.Kq,{flex:1,marginLeft:3,space:3,children:[(0,E.jsx)(O.xv,{as:"h1",size:1,weight:"bold",children:"No document types"}),(0,E.jsx)(O.xv,{as:"p",muted:!0,size:1,children:"Please define at least one document type in your schema."}),(0,E.jsx)(O.xv,{as:"p",muted:!0,size:1,children:(0,E.jsx)("a",{href:"https://beta.sanity.io/docs/platform/studio/config",target:"_blank",rel:"noreferrer",children:"Learn how to add a document type →"})})]})]})})})})})}let tU=(0,ed.ZP)(function(e){let{children:n,minWidth:t,onCollapse:i,onExpand:l}=e,r=eW(e,eP),o=(0,I.useMemo)(()=>(function(){let e=[],n=[],t=new WeakMap,i=new Set,l={},r=null,o=0,a=null,s=new Map,d=!1;function c(e){i.delete(e),a=e,u()}return{collapse:function(e){i.add(e),a===e&&(a=null),u()},expand:c,mount:function(e,i){return t.set(e,eD(eD({},i),{},{original:i})),n.push(e),r&&function(e,n){let t=new WeakMap;for(let i of n)t.set(i,function(e,n){let t=[],i=n;for(;i!==e;){let l=i.parentElement;if(!l)break;let r=Array.from(l.childNodes),o=r.indexOf(i);if(t.unshift(o),l===e)break;i=l}return t}(e,i));let l=(e,n)=>{let i=t.get(e)||eU,l=t.get(n)||eU,r=Math.max(i.length,l.length);for(let o=0;o<r;o+=1){let a=i[o]||-1,s=l[o]||-1;if(a!==s)return a-s}return 0};n.sort(l)}(r,n),c(e),()=>{let i=n.indexOf(e);i>-1&&n.splice(i,1),t.delete(e),u()}},resize:function(e,i,r){var o,a,c,p;let h=n.indexOf(i),f=t.get(i);if(!f)return;let m=n[h+1],x=t.get(m);if(x){if("start"===e&&(d=!0,l.left={element:i,flex:f.flex||1,width:i.offsetWidth},l.right={element:m,flex:x.flex||1,width:m.offsetWidth},u()),"move"===e&&l.left&&l.right){s=new Map;let{leftW:g,rightW:j,leftFlex:v,rightFlex:b}=function(e,n,t,i){var l,r;let o={flex:e.left.flex+e.right.flex,width:e.left.width+e.right.width},a=null!=(l=n.minWidth)?l:L.b,s=null!=(r=t.minWidth)?r:L.b,d=Math.min(n.maxWidth||1/0,o.width-s),c=Math.min(t.maxWidth||1/0,o.width-a),u=a-e.left.width,p=e.right.width-c;u<p&&(u=p);let h=e.right.width-s,f=d-e.left.width;h>f&&(h=f);let m=Math.min(Math.max(i,u),h),x=e.left.width+m,g=e.right.width-m,j=x/o.width*o.flex,v=g/o.width*o.flex;return{leftFlex:j,leftW:x,rightFlex:v,rightW:g}}(l,f,x,r);s.set(i,{flex:v,width:g}),s.set(m,{flex:b,width:j}),u()}if("end"===e){d=!1;let y=s.get(i),w=s.get(m);t.set(i,eD(eD({},f),{},{currentMinWidth:0,currentMaxWidth:null!=(o=f.maxWidth)?o:1/0,flex:null!=(a=null==y?void 0:y.flex)?a:f.flex})),t.set(m,eD(eD({},x),{},{currentMinWidth:0,currentMaxWidth:null!=(c=f.maxWidth)?c:1/0,flex:null!=(p=null==w?void 0:w.flex)?p:x.flex})),s=new Map,delete l.left,delete l.right,u()}}},setRootElement:function(e){r=e},setRootWidth:function(e){o=e,u()},subscribe:function(n){return e.push(n),()=>{let t=e.push(n);t>-1&&e.splice(t,1)}}};function u(){var l,r,c,u;if(!o)return;let p=[];for(let h of n)h!==a&&p.unshift(h);a&&p.unshift(a);let f=new WeakMap,m=p.length,x=p[0],g=(m-1)*L.c,j=o-g;for(let v of p){let b=t.get(v);if(!b)continue;let y=b.currentMinWidth||b.minWidth||L.b,w=v===x,k=i.has(v),C=y>j,_=!w&&(k||C),S=s.get(v);f.set(v,{element:v,collapsed:_,currentMinWidth:null!=(l=null==S?void 0:S.width)?l:b.currentMinWidth,currentMaxWidth:null!=(r=null==S?void 0:S.width)?r:b.currentMaxWidth,flex:null!=(u=null!=(c=null==S?void 0:S.flex)?c:b.flex)?u:1}),_?j-=L.c:j-=y-L.c}let P=[];for(let z of n){let M=f.get(z);
1M&&P.push(M)}for(let E of e)E({expandedElement:a||n[n.length-1]||null,panes:P,resizing:d})}})(),[]),[a,s]=(0,I.useState)(null),d=(0,O.XL)(a),c=(null==d?void 0:d.width)||0,u=void 0!==c&&t?c<t:void 0,[p,h]=(0,I.useState)({expandedElement:null,panes:[],resizing:!1});(0,I.useEffect)(()=>o.setRootElement(a),[o,a]),(0,I.useEffect)(()=>o.setRootWidth(c),[o,c]),(0,I.useEffect)(()=>o.subscribe(h),[o]),(0,I.useEffect)(()=>{void 0!==u&&(u&&i&&i(),!u&&l&&l())},[u,i,l]);let f=(0,I.useMemo)(()=>({collapse:o.collapse,collapsed:u,expand:o.expand,expandedElement:p.expandedElement,mount:o.mount,panes:p.panes,resize:o.resize,resizing:p.resizing}),[u,o,p.expandedElement,p.panes,p.resizing]);return(0,E.jsx)(L.d.Provider,{value:f,children:(0,E.jsx)(L.e,eD(eD({"data-ui":"PaneLayout"},r),{},{"data-collapsed":u?"":void 0,"data-resizing":p.resizing?"":void 0,"data-mounted":c?"":void 0,ref:s,children:n}))})})(M||(M=eT(["\n  min-height: 100%;\n  min-width: 320px;\n"]))),tK=(0,ep.ZP)("mod+s"),tV=(0,I.memo)(function(e){var n;let{onPaneChange:t}=e,{navigate:i}=(0,ea.tv)(),{push:l}=(0,O.pm)(),r=(0,ei.I_y)(),o=(0,O.d2)(),{layoutCollapsed:a,setLayoutCollapsed:s}=e1(),{paneDataItems:d,resolvedPanes:c,routerPanes:u}=function(){let[e,n]=(0,I.useState)();if(e)throw e;let{structureContext:t,rootPaneNode:i}
1=e1(),[l,r]=(0,I.useState)({paneDataItems:[],resolvedPanes:[],routerPanes:[]}),o=function(){let e=(0,I.useMemo)(()=>new en.t(1),[]),n=(0,I.useMemo)(()=>e.asObservable().pipe((0,B.U)(e=>(null==e?void 0:e.panes)||[])),[e]),{state:t}=(0,ea.tv)();return(0,I.useEffect)(()=>{e.next(t)},[t,e]),n}();return(0,I.useEffect)(()=>{let e=(function(e){let{routerPanesStream:n,rootPaneNode:t,initialCacheState:i={cacheKeysByFlatIndex:[],flattenedRouterPanes:[],resolvedPaneCache:new Map,resolvePane:()=>ee.C},structureContext:l}=e,r=n.pipe((0,B.U)(e=>[[{id:"root"}],...e]),(0,B.U)(e=>{let n=e.flatMap((e,n)=>e.map((e,t)=>({routerPaneSibling:e,groupIndex:n,siblingIndex:t}))).map((e,n)=>eD(eD({},e),{},{flatIndex:n}));return n}),(0,A.O)([]),(0,Z.G)(),(0,B.U)(e=>{let[n,t]=e;for(let i=0;i<t.length;i++){let l=n[i],r=t[i];if(!eo()(l,r))return{flattenedRouterPanes:t,diffIndex:i}}return{flattenedRouterPanes:t,diffIndex:t.length}}),(0,U.R)((e,n)=>{let{cacheKeysByFlatIndex:t,resolvedPaneCache:i}=e,{flattenedRouterPanes:l,diffIndex:r}=n,o=t.slice(0,r+1),a=t.slice(r+1),s=new Set(o.flatMap(e=>Array.from(e))),d=a.flatMap(e=>Array.from(e)).filter(e=>!s.has(e));for(let c of d)i.delete(c);let u=e=>(n,l,r)=>{var o,a;let s=n&&"".concat(e$(n),"-").concat("contextHash(".concat(JSON.stringify({id:l.id,parentId:parent&&e$(parent),path:l.path,index:l.index,splitIndex:l.splitIndex,serializeOptionsIndex:null==(o=l.serializeOptions)?void 0:o.index,serializeOptionsPath:null==(a=l.serializeOptions)?void 0:a.path}),")")),d=s&&i.get(s);if(d)return d;let c=e(n,l,r);if(!s)return c;let u=t[r]||new Set;return u.add(s),t[r]=u,i.set(s,c),c};return{flattenedRouterPanes:l,cacheKeysByFlatIndex:t,resolvedPaneCache:i,resolvePane:eQ(u)}},i),(0,N.w)(e=>{let{flattenedRouterPanes:n,resolvePane:i}=e;return function e(n){let{unresolvedPane:t,flattenedRouterPanes:i,parent:l,path:r,resolvePane:o,structureContext:a}=n,[s,...d]=i,c=d[0],u={id:s.routerPaneSibling.id,splitIndex:s.siblingIndex,parent:l,path:[...r,s.routerPaneSibling.id],index:s.flatIndex,params:s.routerPaneSibling.params||{},payload:s.routerPaneSibling.payload,structureContext:a};try{return o(t,u,s.flatIndex).pipe((0,N.w)(n=>{let i;let p=eD(eD({type:"resolvedMeta"},s),{},{paneNode:n,path:u.path}),h=d.map((e,n)=>{let t=[...u.path,...d.slice(n).map((n,t)=>"[".concat(e.flatIndex+t,"]"))],i=eD({type:"loading",path:t,paneNode:null},e);return i});return d.length?(i=(null==c?void 0:c.routerPaneSibling.id.startsWith("__edit__"))?e({unresolvedPane:e2,flattenedRouterPanes:d,parent:l,path:u.path,resolvePane:o,structureContext:a}):s.groupIndex===(null==c?void 0:c.groupIndex)?e({unresolvedPane:t,flattenedRouterPanes:d,parent:l,path:r,resolvePane:o,structureContext:a}):e({unresolvedPane:"function"==typeof n.child?eX(n,"child"):n.child,flattenedRouterPanes:d,parent:n,path:u.path,resolvePane:o,structureContext:a}),(0,Q.z)((0,G.of)([p,...h]),i.pipe((0,B.U)(e=>[p,...e])))):(0,G.of)([p])}))}catch(p){if(p instanceof eK&&(p.context&&console.warn("Pane resolution error at index ".concat(p.context.index).concat(p.context.splitIndex>0?" for split pane index ".concat(p.context.splitIndex):"",": ").concat(p.message).concat(p.helpId?" - see ".concat((0,el.h)(p.helpId)):""),p),"structure-item-returned-no-child"===p.helpId))return(0,G.of)([]);throw p}}({unresolvedPane:t,flattenedRouterPanes:n,parent:null,path:[],resolvePane:i,structureContext:l})}));return r.pipe((0,U.R)((e,n)=>n.map((n,t)=>{let i=e[t];return i&&"loading"===n.type&&i.routerPaneSibling.id===n.routerPaneSibling.id?i:n}),[]),(0,K.x)((e,n)=>{if(e.length!==n.length)return!1;for(let t=0;t<n.length;t++){let i=e[t],l=n[t];if(e3(i)!==e3(l))return!1}return!0}))})({rootPaneNode:i,routerPanesStream:o,structureContext:t}).pipe((0,B.U)(e=>{let n=e.reduce((e,n)=>{let t=e[n.groupIndex]||[];return t[n.siblingIndex]=n.routerPaneSibling,e[n.groupIndex]=t,e},[]),t=n.length,i=e.map(i=>{var l;let{groupIndex:r,flatIndex:o,siblingIndex:a,routerPaneSibling:s,path:d}=i,c=s.id,u=n[r+1],p={active:r===t-2,childItemId:null!=(l=null==u?void 0:u[0].id)?l:null,index:o,itemId:s.id,groupIndex:r,key:"".concat("loading"===i.type?"unknown":i.paneNode.id,"-").concat(c,"-").concat(a),pane:"loading"===i.type?L.L:i.paneNode,params:s.params||{},path:d.join(";"),payload:s.payload,selected:o===e.length-1,siblingIndex:a};return p});return{paneDataItems:i,routerPanes:n,resolvedPanes:i.map(e=>e.pane)}})),l=e.subscribe({next:e=>r(e),error:e=>n(e)});return()=>l.unsubscribe()},[i,o,t]),l}(),[p,h]=(0,I.useState)(null),f=(0,I.useCallback)(()=>s(!0),[s]),m=(0,I.useCallback)(()=>s(!1),[s]);(0,I.useEffect)(()=>{c.length&&t(c)},[t,c]),(0,I.useEffect)(()=>
1{if(o>1||!a)return;let e=u.some(e=>e.length>1);if(!e)return;let n=u.map(e=>[e[0]]);i({panes:n},{replace:!0})},[o,i,a,u]),(0,I.useEffect)(()=>{let e=e=>{tK(e)&&(e.preventDefault(),l({closable:!0,id:"auto-save-message",status:"info",title:"Your work is automatically saved!",duration:4e3}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[l]);let x=null==(n=r._original)?void 0:n.types.some(ei.mPO);return x?(0,E.jsxs)(O.Xp,{element:p||null,children:[(0,E.jsx)(tU,{flex:1,height:a?void 0:"fill",minWidth:512,onCollapse:f,onExpand:m,children:d.map(e=>{let{active:n,childItemId:t,groupIndex:i,itemId:l,key:r,pane:o,index:a,params:s,path:d,payload:c,siblingIndex:u,selected:p}=e;return(0,E.jsx)(I.Fragment,{children:o===L.L?(0,E.jsx)(nt,{paneKey:r,path:d,selected:p}):(0,E.jsx)(nl,{active:n,groupIndex:i,index:a,pane:o,childItemId:t,itemId:l,paneKey:r,params:s,payload:c,selected:p,siblingIndex:u})},"".concat(o===L.L?"loading":o.type,"-").concat(a))})}),(0,E.jsx)("div",{"data-portal":"",ref:h})]}):(0,E.jsx)(tZ,{})}),t$={};var tH=Object.freeze({__proto__:null,default:function(e){let{tool:{options:n}}=e,{unstable_sources:t}=(0,ei.cFj)(),[i]=t,{source:l,defaultDocumentNode:r,structure:o}=n||{},{state:a}=(0,ea.tv)(),s=(0,I.useMemo)(()=>{let e="string"==typeof a.intent?a.intent:void 0,n=(0,ei.Uy$)(a.params)?a.params:t$,t=a.payload;return e?{intent:e,params:n,payload:t}:void 0},[a]);(0,I.useEffect)(()=>((0,L.s)([]),()=>(0,L.s)([])),[]);let[{error:d},c]=(0,I.useState)({error:null});return d?(0,E.jsx)(e6,{error:d}):(0,E.jsx)(O.SV,{onCatch:c,children:(0,E.jsx)(ei.cWh,{name:l||i.name,children:(0,E.jsx)(L.p,{defaultDocumentNode:r,structure:o,children:s?(0,E.jsx)(e8,eD({},s)):(0,E.jsx)(tV,{onPaneChange:L.s})})})})}})}}]);

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.