1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d406817f-d2ec-4833-a84c-b9359b0a8cd1",e._sentryDebugIdIdentifier="sentry-dbid-d406817f-d2ec-4833-a84c-b9359b0a8cd1")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[212],{11929:(e,t,n)=>{n.d(t,{A:()=>l});let r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};for(var i,a=new Uint8Array(16),o=[],s=0;s<256;++s)o.push((s+256).toString(16).slice(1));let l=function(e,t,n){if(r.randomUUID&&!t&&!e)return r.randomUUID();var s=(e=e||{}).random||(e.rng||function(){if(!i&&!(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(a)})();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t){n=n||0;for(var l=0;l<16;++l)t[n+l]=s[l];return t}return function(e,t=0){return(o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]).toLowerCase()}(s)}},53013:e=>{e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(a=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;0!=i--;){var r,i,a,o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!=t&&n!=n}},60212:(e,t,n)=>{n.r(t),n.d(t,{PresentationToolGrantsCheck:()=>tU,createCompatibilityActors:()=>Q,getQueryCacheKey:()=>ee});var r=n(22342),i=n(11748);let a="sanity.previewUrlSecret",o="sanity-preview-url-secret.share-access",s="sanity.previewUrlShareAccess",l="2023-11-09",c="sanity-preview-secret",d="sanity-preview-pathname",u="sanity-preview-perspective",p=`*[_id == "${o}" && _type == "${s}"][0].secret`,f=`*[_type == "${a}" && dateTime(_updatedAt) <= dateTime(now()) - 3600]`,h="sanity.preview-url-secret";var m=n(59452),g=n(74578),y=n(33670),x=n(39160),v=n(24522),b=n(64531),w=n(93261),j=n(46521),_=n(20031),S=n(68358),k=n(69975),E=n(7331),C=n(63872),R=n(12820),T=n(81152),O=n(34220),$=n(15374);(0,y.forwardRef)(function(e,t){return(0,r.jsxs)("svg",{"data-sanity-icon":"groq-logo",height:"1em",viewBox:"0 0 304 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:[(0,r.jsx)("path",{d:"M32 0L0 32H32V0Z",fill:$.OZ.magenta[400].hex}),(0,r.jsx)("path",{d:"M32 32H0L32 64V32Z",fill:$.OZ.green[300].hex}),(0,r.jsx)("path",{d:"M64 32H32V64L64 32Z",fill:$.OZ.purple[300].hex}),(0,r.jsx)("path",{d:"M112 0L80 32H112V0Z",fill:$.OZ.green[300].hex}),(0,r.jsx)("path",{d:"M112 0H80V32L112 0Z",fill:$.OZ.purple[300].hex}),(0,r.jsx)("path",{d:"M112 32H80L112 64V32Z",fill:$.OZ.yellow[200].hex}),(0,r.jsx)("path",{d:"M144 64L112 32V64H144Z",fill:$.OZ.blue[300].hex}),(0,r.jsx)("path",{d:"M80 32V64H112L80 32Z",fill:$.OZ.orange[400].hex}),(0,r.jsx)("path",{d:"M112 0V32H144L112 0Z",fill:$.OZ.magenta[400].hex}),(0,r.jsx)("path",{d:"M192 0L160 32H192V0Z",fill:$.OZ.yellow[200].hex}),(0,r.jsx)("path",{d:"M192 32H160L192 64V32Z",fill:$.OZ.orange[400].hex}),(0,r.jsx)("path",{d:"M224 32H192V64L224 32Z",fill:$.OZ.green[300].hex}),(0,r.jsx)("path",{d:"M192 0V32H224L192 0Z",fill:$.OZ.blue[300].hex}),(0,r.jsx)("path",{d:"M272 0L240 32H272V0Z",fill:$.OZ.purple[300].hex}),(0,r.jsx)("path",{d:"M304 32L272 64H304V32Z",fill:$.OZ.magenta[400].hex}),(0,r.jsx)("path",{d:"M272 32H240L272 64V32Z",fill:$.OZ.blue[300].hex}),(0,r.jsx)("path",{d:"M304 32H272V64L304 32Z",fill:$.OZ.yellow[200].hex}),(0,r.jsx)("path",{d:"M272 0V32H304L272 0Z",fill:$.OZ.green[300].hex})]})}).displayName="ForwardRef(GroqLogo)",(0,y.forwardRef)(function(e,t){return(0,r.jsxs)("svg",{"data-sanity-icon":"groq-monogram",width:"1em",height:"1em",viewBox:"0 0 128 128",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:[(0,r.jsx)("rect",{width:"128",height:"128",rx:"8",fill:$.OZ.green[950].hex}),(0,r.jsx)("rect",{y:"32",width:"64",height:"64",fill:$.OZ.green[800].hex}),(0,r.jsx)("path",{d:"M64 32L32 64H64V32Z",fill:$.OZ.magenta[400].hex}),(0,r.jsx)("path",{d:"M64 64H32L64 96V64Z",fill:$.OZ.green[300].hex}),(0,r.jsx)("path",{d:"M96 64H64V96L96 64Z",fill:$.OZ.purple[300].hex})]})}).displayName="ForwardRef(GroqMonogram)";let I={light:[$.OZ.red[200].hex,$.OZ.red[300].hex,$.OZ.red[500].hex],dark:[$.OZ.gray[500].hex,$.OZ.gray[300].hex,$.ON.hex]};(0,y.forwardRef)(function(e,t){let{dark:n,...i}=e,a=I[n?"dark":"light"];return(0,r.jsxs)("svg",{"data-sanity-icon":"sanity-logo",height:"1em",viewBox:"0 0 352 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i,ref:t,children:[(0,r.jsx)("path",{d:"M311.14 57.234V80.0016H298.499V57.234",fill:a[1]}),(0,r.jsx)("path",{d:"M298.499 57.2341L319.889 20.0017H333.316L311.14 57.2341H298.499Z",fill:a[2]}),(0,r.jsx)("path",{d:"M298.499 57.2341L276.515 20.0017H290.345L305.239 45.5161L298.499 57.2341Z",fill:a[1]}
1),(0,r.jsx)("path",{d:"M253.839 40.9625V80.0017H241.007V47.6275L253.839 40.9625Z",fill:a[1]}),(0,r.jsx)("path",{d:"M241.007 47.5944L273.538 30.9469L268.042 21.6519L241.007 34.8633V47.5944Z",fill:a[0]}),(0,r.jsx)("path",{d:"M241.007 30.9469H221.404V20.0017H267.064L273.538 30.9469H253.839H241.007Z",fill:a[2]}),(0,r.jsx)("path",{d:"M214.047 20.0017H201.311V80.0121H214.047V20.0017Z",fill:a[2]}),(0,r.jsx)("path",{d:"M149.39 37.8712V80.0017H137.153V20.0017L149.39 37.8712Z",fill:a[1]}),(0,r.jsx)("path",{d:"M151.282 20.0017L178.231 60.9939V80.0017L137.153 20.0017H151.282Z",fill:a[2]}),(0,r.jsx)("path",{d:"M178.231 57.9129V20.0017H190.467V80.0017H178.231V57.9129Z",fill:a[1]}),(0,r.jsx)("path",{d:"M82.1168 80.9834L112.102 65.3053L108.405 55.7303L88.6644 64.9362L82.1168 80.9834Z",fill:a[0]}),(0,r.jsx)("path",{d:"M100.657 35.5422L82.1167 80.9834L72.5807 72.7745L94.6719 20.0017L100.657 35.5422Z",fill:a[1]}),(0,r.jsx)("path",{d:"M94.672 20.0017H107.312L130.69 80.0017H117.752L94.672 20.0017Z",fill:a[2]}),(0,r.jsx)("path",{d:"M25.1347 26.926C25.1347 35.2811 30.3864 40.2524 40.9004 42.8738L52.0417 45.4117C61.9923 47.6571 68.0519 53.2341 68.0519 62.3203C68.1293 66.2787 66.8194 70.1429 64.3417 73.2654C64.3417 64.2002 59.5684 59.302 48.0551 56.3568L37.1158 53.913C28.3559 51.9495 21.5946 47.3647 21.5946 37.4952C21.5485 33.6839 22.7939 29.9658 25.1347 26.926",fill:a[2]}),(0,r.jsx)("path",{d:"M57.4954 60.0957C62.2475 63.0827 64.3311 67.2602 64.3311 73.255C60.3977 78.2054 53.4875 80.9834 45.3655 80.9834C31.6941 80.9834 22.1262 74.3725 20 62.8842H33.1292C34.8196 68.1584 39.2952 70.6022 45.2698 70.6022C52.5626 70.6022 57.4104 66.7798 57.506 60.0748",fill:a[1]}),(0,r.jsx)("path",{d:"M31.9598 39.3124C29.7898 38.0455 28.0095 36.225 26.8079 34.0442C25.6062 31.8634 25.028 29.4036 25.1347 26.926C28.93 22.0174 35.5318 19.02 43.5794 19.02C57.506 19.02 65.5643 26.2472 67.5523 36.4195H54.9227C53.53 32.409 50.0431 29.2863 43.6858 29.2863C36.8926 29.2863 32.2575 33.1715 31.9917 39.3124",fill:a[1]})]})}).displayName="ForwardRef(SanityLogo)";let P={bg1:$.OZ.red[500].hex,bg2:$.OZ.red[200].hex,fg:$.ON.hex},M=(0,y.forwardRef)(function(e,t){let{color:n=P,...i}=e;return(0,r.jsxs)("svg",{"data-sanity-icon":"sanity-monogram",width:"1em",height:"1em",viewBox:"0 0 128 128",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i,ref:t,children:[(0,r.jsx)("rect",{width:"128",height:"128",rx:"8",fill:n.bg1}),(0,r.jsx)("path",{d:"M39.423 33.163C39.423 44.1615 46.3363 50.7056 60.1768 54.1564L74.843 57.4972C87.9418 60.453 95.9186 67.7945 95.9186 79.7554C96.0205 84.9662 94.2961 90.0531 91.0345 94.1635C91.0345 82.2301 84.751 75.7822 69.595 71.9052L55.1948 68.6882C43.6633 66.1035 34.7629 60.0681 34.7629 47.0761C34.7022 42.0589 36.3416 37.1644 39.423 33.163",fill:n.fg}),(0,r.jsx)("path",{d:"M82.0221 76.827C88.2776 80.759 91.0206 86.2582 91.0206 94.1497C85.8426 100.666 76.7462 104.323 66.0545 104.323C48.0576 104.323 35.4626 95.6207 32.6637 80.4977H49.9468C52.172 87.4406 58.0636 90.6576 65.9285 90.6576C75.5287 90.6576 81.9102 85.6258 82.0361 76.7995",fill:n.bg2}),(0,r.jsx)("path",{d:"M48.4075 49.4682C45.551 47.8004 43.2074 45.404 41.6256 42.5332C40.0437 39.6624 39.2826 36.4244 39.4231 33.1629C44.4191 26.7013 53.1096 22.7556 63.7034 22.7556C82.0362 22.7556 92.6439 32.2693 95.2609 45.66H78.6355C76.8022 40.3807 72.2121 36.27 63.8434 36.27C54.9009 36.27 48.7993 41.3843 48.4495 49.4682",fill:n.bg2})]})});function z(){if("u">typeof crypto){let e=new Uint8Array(16);crypto.getRandomValues(e);let t="";for(let n=0;n<e.length;n++)t+=e[n].toString(16).padStart(2,"0");return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/[=]+$/,"")}return Math.random().toString(36).slice(2)}async function L(e,t,n,r){let i=e.withConfig({apiVersion:l}),a=z(),c=i.patch(o).set({secret:a,studioUrl:n,userId:r});return await i.transaction().createIfNotExists({_id:o,_type:s,source:t,studioUrl:n,userId:r}).patch(c).commit({tag:h}),{secret:a}}async function A(e,t,n,r){let i=e.withConfig({apiVersion:l}),a=i.patch(o).set({secret:null,studioUrl:n,userId:r});await i.transaction().createIfNotExists({_id:o,_type:s,source:t,studioUrl:n,userId:r}).patch(a).commit({tag:h})}M.displayName="ForwardRef(SanityMonogram)";var Z=n(88106),U=n(53013);function D(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function H(e){return e&&e.sensitive?"":"i"}async function q(e,t,n,r,i=(0,g.A)()){let o=e.withConfig({apiVersion:l});try{let e=new Date(Date.now()+36e5),s=`drafts.${i}`,l=z(),c=o.patch(s).set({secret:l,source:t,studioUrl:n,userId:r});return await o.transaction().createOrReplace({_id:s,_type:a}).patch(c).commit({tag:h}),{secret:l,expiresAt:e}}finally{try{await o.delete({query:f})}catch(e){console.error("Failed to delete expired secrets",e)}}}var V=n(23689);let N=/^([\w-]+):(0|[1-9][0-9]*)$/,Y=/^([\w-]+):([0-9]+),([0-9]+)$/,B=/^([\w-]+):([\w-]+)$/,W=(0,v.Fs)((0,v.Yj)(),(0,v.Bp)(1)),F=(0,v.lq)(W);(0,v.Ik)({baseUrl:W,dataset:F,id:W,path:W,projectId:F,tool:F,type:F,workspace:F,isDraft:(0,v.lq)((0,v.Yj)())}),(0,v.Ik)({origin:W,href:W,data:(0,v.lq)((0,v.g1)((0,v.Yj)(),(0,v.L5)()))});let J={"handshake/syn":b.Tx,"handshake/syn-ack":b.Rr,"handshake/ack":b.IM,"channel/response":b._K,"channel/heartbeat":b.vd,"channel/disconnect":b.FS,"overlay/focus":"visual-editing/focus","overlay/navigate":"visual-editing/navigate","overlay/toggle":"visual-editing/toggle","presentation/toggleOverlay":"presentation/toggle-overlay"},K={[b.Tx]:"handshake/syn",[b.Rr]:"handshake/syn-ack",[b.IM]:"handshake/ack",[b._K]:"channel/response",[b.vd]:"channel/heartbeat",[b.FS]:"channel/disconnect","visual-editing/focus":"overlay/focus","visual-editing/navigate":"overlay/navigate","visual-editing/toggle":"overlay/toggle","presentation/toggle-overlay":"presentation/toggleOverlay"},G=e=>{let{data:t}=e;return t&&"object"==typeof t&&"domain"in t&&"type"in t&&"from"in t&&"to"in t&&("sanity/channels"===t.domain&&(t.domain=b.V2),"overlays"===t.to&&(t.to="visual-editing"),"overlays"===t.from&&(t.from="visual-editing"),t.type=J[t.type]??t.type),e},X=({context:e},t)=>{let{sources:n,targetOrigin:r}=e,i=(e=>(e.domain===b.V2&&(e.domain="sanity/channels"),"visual-editing"===e.to&&(e.to="overlays"),"visual-editing"===e.from&&(e.from="overlays"),e.type=K[e.type]??e.type,"channel/response"===e.type&&e.responseTo&&!e.data&&(e.data={responseTo:e.responseTo}),("handshake/syn"===e.type||"handshake/syn-ack"===e.type||"handshake/ack"===e.type)&&(e.data={id:e.connectionId}),e))(t.message);
1n.forEach(e=>{e.postMessage(i,{targetOrigin:r})})},Q=()=>({listen:(0,b.CC)(G),requestMachine:(0,b.tP)().provide({actions:{"send message":X}})});function ee(e,t){return`${e}-${"string"==typeof t?t:JSON.stringify(t)}`}let et={alt:"altKey",ctrl:"ctrlKey",mod:"u">typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform)?"metaKey":"ctrlKey",shift:"shiftKey"};function en(e){return"Alt"===e.key}function er(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>{e.apply(e,r)},t)}}let ei=function(e){let t,n,a,o,s,l,c,d,u=(0,i.c)(14),{comlink:p,children:f}=e;u[0]===Symbol.for("react.memo_cache_sentinel")?(t={},u[0]=t):t=u[0];let h=(0,y.useRef)(t);u[1]!==p?(n=()=>p?.on("visual-editing/shared-state",()=>({state:h.current})),a=[p],u[1]=p,u[2]=n,u[3]=a):(n=u[2],a=u[3]),(0,y.useEffect)(n,a),u[4]!==p?(o=(e,t)=>{h.current[e]=t,p?.post({type:"presentation/shared-state",data:{key:e,value:t}})},u[4]=p,u[5]=o):o=u[5];let m=o;u[6]!==p?(s=e=>{p?.post({type:"presentation/shared-state",data:{key:e}}),delete h.current[e]},u[6]=p,u[7]=s):s=u[7];let g=s;return u[8]!==g||u[9]!==m?(c={removeValue:g,setValue:m},u[8]=g,u[9]=m,u[10]=c):c=u[10],l=c,u[11]!==f||u[12]!==l?(d=(0,r.jsx)(v.UB.Provider,{value:l,children:f}),u[11]=f,u[12]=l,u[13]=d):d=u[13],d},ea=(0,y.createContext)(null);ea.displayName="PanelsContext";let eo=_.I4.div` 2 overflow: hidden; 3 flex-basis: 0; 4 flex-shrink: 1; 5`,es=function(e){let t,n,a,o,s=(0,i.c)(15),{children:l,defaultSize:c,id:d,minWidth:u,maxWidth:p,order:f}=e,h=void 0===c?null:c,m=void 0===f?0:f,g=(0,y.useContext)(ea);if(null===g)throw Error("Panel components must be rendered within a PanelGroup container");let{getPanelStyle:x,registerElement:v,unregisterElement:b}=g;s[0]!==x||s[1]!==d?(t=x(d),s[0]=x,s[1]=d,s[2]=t):t=s[2];let w=t;return s[3]!==h||s[4]!==d||s[5]!==p||s[6]!==u||s[7]!==m||s[8]!==v||s[9]!==b?(n=()=>(v(d,{id:d,type:"panel",defaultSize:h,maxWidth:p??null,minWidth:u??0,order:m}),()=>{b(d)}),a=[d,h,m,p,u,v,b],s[3]=h,s[4]=d,s[5]=p,s[6]=u,s[7]=m,s[8]=v,s[9]=b,s[10]=n,s[11]=a):(n=s[10],a=s[11]),(0,y.useLayoutEffect)(n,a),s[12]!==l||s[13]!==w?(o=(0,r.jsx)(eo,{style:w,children:l}),s[12]=l,s[13]=w,s[14]=o):o=s[14],o},el="presentation/panels",ec=()=>JSON.parse(localStorage.getItem(el)||"{}"),ed=e=>e.map(e=>[e.id,e.order].join(":")).join(",");function eu(e,t){var n;let r=ec(),i=ed(e);n={...r,[i]:t},localStorage.setItem(el,JSON.stringify(n))}function ep(e){let t=ec(),n=ed(e);return Array.isArray(t[n])&&t[n].some(ef)?void 0:t[n]}function ef(e){return null===e}function eh(e,t,n){let{maxWidth:r,minWidth:i}=e;return Math.min(null==r?100:r/n*100,Math.max(i/n*100,t))}function em(e,t,n=0,r=null){return e.clientX-(r||t.getBoundingClientRect()).left-n}function eg(e){return"panel"===e.type}function ey(e){return"resizer"===e.type}function ex(e){return Array.from(e.values()).sort(({order:e},{order:t})=>null==e&&null==t?0:null==e?-1:null==t?1:e-t)}function ev(e,t,n){let r=t.reduce((e,t)=>e+t,0),i=[...t].map(e=>e/r*100),a=0;for(let t=0;t<e.length;t++){let r=e[t],o=i[t],s=eh(r,o,n);o!=s&&(a+=o-s,i[t]=s)}if("0.000"!==a.toFixed(3))for(let t=0;t<e.length;t++){let{maxWidth:r,minWidth:o}=e[t];o=o/n*100,null!=r&&(r=r/n*100);let s=Math.min(r??100,Math.max(o,i[t]+a));if(s!==i[t]&&(a-=s-i[t],i[t]=s,"0.000"===Math.abs(a).toFixed(3)))break}return i}let eb=_.I4.div` 6 display: flex; 7 flex-direction: row; 8 height: 100%; 9 overflow: hidden; 10 width: 100%; 11`,ew=function(e){let t,n,a,o,s,l,c,d,u,p,f,h,m,g,x,v,b,w,j,_,S,k,E,C,R=(0,i.c)(46),{children:T}=e,O=(0,y.useRef)(null);R[0]===Symbol.for("react.memo_cache_sentinel")?(t=new Map,R[0]=t):t=R[0];let[$,I]=(0,y.useState)(t);R[1]!==$?(a=ex($).filter(eg),R[1]=$,R[2]=a):a=R[2],n=a,R[3]===Symbol.for("react.memo_cache_sentinel")?(o=[],R[3]=o):o=R[3];let[P,M]=(0,y.useState)(o),[z,L]=(0,y.useState)(null);R[4]!==$||R[5]!==n||R[6]!==P?(s={elements:$,panels:n,widths:P},R[4]=$,R[5]=n,R[6]=P,R[7]=s):s=R[7];let A=(0,y.useRef)(s);R[8]!==z||R[9]!==n||R[10]!==P?(l=e=>({flexGrow:function(e,t,n){if(1===e.length)return"100";let r=n[e.findIndex(e=>e.id===t)];return null==r?"0":r.toPrecision(10)}(n,e,P),pointerEvents:null===z?void 0:"none"}),R[8]=z,R[9]=n,R[10]=P,R[11]=l):l=R[11];let Z=l;R[12]===Symbol.for("react.memo_cache_sentinel")?(c=(e,t)=>{I(n=>{if(n.has(e))return n;let r=new Map(n);return r.set(e,t),r})},R[12]=c):c=R[12];let U=c;R[13]===Symbol.for("react.memo_cache_sentinel")?(d=e=>{I(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},R[13]=d):d=R[13];let D=d;R[14]===Symbol.for("react.memo_cache_sentinel")?(u={containerWidth:window.innerWidth,dragOffset:0,panelAfter:null,panelBefore:null,resizerIndex:-1,resizerRect:null,startX:0,widths:[]},R[14]=u):u=R[14];let H=(0,y.useRef)(u);R[15]!==$?(p=(e,t)=>{let n=ex($),r=n.findIndex(t=>t.id===e),i=$.get(e);if(!i||!ey(i))return;let a=i.el.current;
11a&&(H.current={resizerIndex:r,panelBefore:n.reduce((e,t,n)=>eg(t)&&n<r?t:e,null),panelAfter:n.reduce((e,t,n)=>null===e&&eg(t)&&n>r?t:e,null),containerWidth:window.innerWidth,startX:t.pageX,dragOffset:em(t,a),resizerRect:a.getBoundingClientRect(),widths:A.current.widths},L(e))},R[15]=$,R[16]=p):p=R[16];let q=p;R[17]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{L(null)},R[17]=f):f=R[17];let V=f;R[18]!==$?(h=(e,t)=>{t.preventDefault(),t.stopPropagation();let{containerWidth:n,dragOffset:r,panelBefore:i,panelAfter:a,resizerRect:o}=H.current;if(null==i||null==a)return;let s=$.get(e);if(!s||!ey(s))return;let l=s.el.current;if(!l)return;let c=em(t,l,r,o);if(0===c)return;let{widths:d}=A.current,u=function(e,t,n,r,i,a){let{panels:o,widths:s}=i,{widths:l}=a,c=l||s,d=[...c];{let i=e<0?r:n,a=c[o.findIndex(e=>e.id===i.id)],s=eh(i,a+Math.abs(e),t);if(a===s)return c;e=e<0?a-s:s-a}let u=0,p=e<0?n:r,f=o.findIndex(e=>e.id===p.id);for(;;){let n=o[f],r=c[f],i=eh(n,r-(Math.abs(e)-Math.abs(u)),t);if(r!==i&&(u+=r-i,d[f]=i,u.toPrecision(10).localeCompare(Math.abs(e).toPrecision(10),void 0,{numeric:!0})>=0))break;if(e<0){if(--f<0)break}else if(++f>=o.length)break}return 0===u?c:(p=e<0?r:n,d[f=o.findIndex(e=>e.id===p.id)]=c[f]+u,d)}(c/O.current.getBoundingClientRect().width*100,n,i,a,A.current,H.current);d.some((e,t)=>e!==u[t])&&M(u)},R[18]=$,R[19]=h):h=R[19];let N=h;R[20]!==$||R[21]!==n||R[22]!==P?(m=()=>{A.current.elements=$,A.current.panels=n,A.current.widths=P},g=[$,n,P],R[20]=$,R[21]=n,R[22]=P,R[23]=m,R[24]=g):(m=R[23],g=R[24]),(0,y.useLayoutEffect)(m,g);let Y=function(){let e,t=(0,i.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e={get:ep,set:eu,setDebounced:er(eu,100)},t[0]=e):e=t[0],e}();return R[25]!==n||R[26]!==Y?(x=()=>{let{widths:e}=A.current;if(e.length===n.length)return;let t=Y.get(n);if(t)return void M(ev(n,t,window.innerWidth));M(function(e){let t=e.length,n=100,r=e.map(e=>e.defaultSize?(n-=e.defaultSize,t-=1,e.defaultSize):null),i=n/t;return r.map(e=>null===e?i:e)}(n))},v=[Y,n],R[25]=n,R[26]=Y,R[27]=x,R[28]=v):(x=R[27],v=R[28]),(0,y.useLayoutEffect)(x,v),R[29]!==n||R[30]!==Y||R[31]!==P?(b=()=>{P.length&&Y.setDebounced(n,P)},w=[Y,n,P],R[29]=n,R[30]=Y,R[31]=P,R[32]=b,R[33]=w):(b=R[32],w=R[33]),(0,y.useEffect)(b,w),R[34]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{let e=new ResizeObserver(()=>{let{panels:e,widths:t}=A.current,n=ev(e,t,window.innerWidth);t.some((e,t)=>e!==n[t])&&M(n)});return e.observe(O.current),()=>{e.disconnect()}},_=[],R[34]=j,R[35]=_):(j=R[34],_=R[35]),(0,y.useLayoutEffect)(j,_),R[36]!==z||R[37]!==N||R[38]!==Z||R[39]!==q?(k={activeResizer:z,drag:N,getPanelStyle:Z,registerElement:U,startDragging:q,stopDragging:V,unregisterElement:D},R[36]=z,R[37]=N,R[38]=Z,R[39]=q,R[40]=k):k=R[40],S=k,R[41]!==T?(E=(0,r.jsx)(eb,{ref:O,children:T}),R[41]=T,R[42]=E):E=R[42],R[43]!==S||R[44]!==E?(C=(0,r.jsx)(ea.Provider,{value:S,children:E}),R[43]=S,R[44]=E,R[45]=C):C=R[45],C};function ej(e){let t,n,a,o,s,l,c,d,u,p,f,h,g,y,b,w,j=(0,i.c)(37);j[0]!==e?({children:t,message:n,onRetry:o,onContinueAnyway:a,...s}=e,j[0]=e,j[1]=t,j[2]=n,j[3]=a,j[4]=o,j[5]=s):(t=j[1],n=j[2],a=j[3],o=j[4],s=j[5]);let{t:_}=(0,x.Bdt)(v.Yi);j[6]!==_?(l=_("error-card.retry-button.text"),j[6]=_,j[7]=l):l=j[7],j[8]!==o||j[9]!==l?(c=(0,r.jsx)(m.$n,{fontSize:1,mode:"ghost",onClick:o,text:l}),j[8]=o,j[9]=l,j[10]=c):c=j[10];let S=c;j[11]!==_?(d=_("error-card.continue-button.text"),j[11]=_,j[12]=d):d=j[12],j[13]!==a||j[14]!==d?(u=(0,r.jsx)(m.$n,{fontSize:1,mode:"ghost",tone:"critical",onClick:a,text:d}),j[13]=a,j[14]=d,j[15]=u):u=j[15];let k=u;return j[16]!==_?(p=_("error-card.title"),j[16]=_,j[17]=p):p=j[17],j[18]!==p?(f=(0,r.jsx)(m.EY,{size:1,weight:"semibold",children:p}),j[18]=p,j[19]=f):f=j[19],j[20]!==n?(h=(0,r.jsx)(m.EY,{muted:!0,size:1,children:n}),j[20]=n,j[21]=h):h=j[21],j[22]!==f||j[23]!==h?(g=(0,r.jsxs)(m.BJ,{space:3,children:[f,h]}),j[22]=f,j[23]=h,j[24]=g):g=j[24],j[25]!==k||j[26]!==a||j[27]!==o||j[28]!==S?(y=o&&a?(0,r.jsxs)(m.cV,{space:2,children:[S,k]}):o?(0,r.jsx)(m.az,{children:S}):a?(0,r.jsx)(m.az,{children:k}):null,j[25]=k,j[26]=a,j[27]=o,j[28]=S,j[29]=y):y=j[29],j[30]!==t||j[31]!==g||j[32]!==y?(b=(0,r.jsx)(m.so,{align:"center",height:"fill",justify:"center",children:(0,r.jsx)(m.mc,{padding:4,sizing:"border",width:0,children:(0,r.jsxs)(m.BJ,{space:4,children:[g,t,y]})})}),j[30]=t,j[31]=g,j[32]=y,j[33]=b):b=j[33],j[34]!==s||j[35]!==b?(w=(0,r.jsx)(m.Zp,{height:"fill",...s,children:b}),j[34]=s,j[35]=b,j[36]=w):w=j[36],w}let e_=(0,y.forwardRef)(function(e,t){let n,a,o,s,l,c=(0,i.c)(11);return c[0]!==e?({searchParams:a,...n}=e,c[0]=e,c[1]=n,c[2]=a):(n=c[1],a=c[2]),c[3]!==a?(o=Object.entries(a),c[3]=a,c[4]=o):o=c[4],c[5]!==o?(s={type:void 0,_searchParams:o},c[5]=o,c[6]=s):s=c[6],c[7]!==t||c[8]!==n||c[9]!==s?(l=(0,r.jsx)(j.s8,{...n,ref:t,state:s,title:void 0}),c[7]=t,c[8]=n,c[9]=s,c[10]=l):l=c[10],l}),eS=(0,y.forwardRef)(function(e,t){let n,a,o,s,l,c,d,u=(0,i.c)(15);if(u[0]!==e){let{documentId:t,documentType:r,parentRefPath:i,template:l,searchParams:c,...d}=e;n=t,a=r,s=c,o=d,u[0]=e,u[1]=n,u[2]=a,u[3]=o,u[4]=s}else n=u[1],a=u[2],o=u[3],s=u[4];return u[5]!==s?(l=Object.entries(s),u[5]=s,u[6]=l):l=u[6],u[7]!==n||u[8]!==a||u[9]!==l?(c={id:n,type:a,_searchParams:l},u[7]=n,u[8]=a,u[9]=l,u[10]=c):c=u[10],u[11]!==t||u[12]!==o||u[13]!==c?(d=(0,r.jsx)(j.s8,{...o,ref:t,state:c,title:void 0}),u[11]=t,u[12]=o,u[13]=c,u[14]=d):d=u[14],d});function ek(e){let t,n,a,o,s,l,c,d,u,p,f,h=(0,i.c)(26),{children:m,onStructureParam
11s:g,structureParams:y,searchParams:v,refs:b}=e,{state:w,resolvePathFromState:_}=(0,j.rd)();h[0]!==w._searchParams?(t=Object.fromEntries(w._searchParams||[]),h[0]=w._searchParams,h[1]=t):t=h[1];let S=(0,x.$6H)(t);h[2]!==_||h[3]!==S||h[4]!==w?(n=e=>{let t=_(w),n=function(e){let t=["comment","inspect","instruction","pathKey","rev","since","template","view"];return function(e={}){let t=Object.entries(e).map(([e,t])=>`${e}=${t}`).join("&");return t.length?`?${t}`:""}(Object.entries(e).filter(([e])=>t.includes(e)).reduce((e,[t,n])=>null==n?e:{...e,[t]:n},{}))}({...S,...e});return`${t}${n}`},h[2]=_,h[3]=S,h[4]=w,h[5]=n):n=h[5];let E=n;return h[6]===Symbol.for("react.memo_cache_sentinel")?(o={},h[6]=o):o=h[6],h[7]===Symbol.for("react.memo_cache_sentinel")?(s=[],h[7]=s):s=h[7],h[8]!==b||h[9]!==v?(l=e=>{let{childId:t,...n}=e,i=b?.find(e=>e._id===t||(0,x.IMx)(e._id)===t);return i?(0,r.jsx)(j.s8,{...n,state:{id:t,type:i._type,_searchParams:Object.entries(v)}}):(0,r.jsx)("div",{...n})},h[8]=b,h[9]=v,h[10]=l):l=h[10],h[11]!==v?(c=e=>(0,r.jsx)(e_,{...e,searchParams:v}),d=e=>(0,r.jsx)(eS,{...e,searchParams:v}),h[11]=v,h[12]=c,h[13]=d):(c=h[12],d=h[13]),h[14]!==g?(u=e=>{g({...e,inspect:e.inspect??void 0})},h[14]=g,h[15]=u):u=h[15],h[16]!==E||h[17]!==y||h[18]!==l||h[19]!==c||h[20]!==d||h[21]!==u?(p={index:0,groupIndex:0,siblingIndex:0,payload:o,params:y,hasGroupSiblings:!1,groupLength:1,routerPanesState:s,ChildLink:l,BackLink:c,ReferenceChildLink:d,ParameterizedLink:eM,closeCurrentAndAfter:eP,handleEditReference:eI,replaceCurrent:e$,closeCurrent:eO,duplicateCurrent:eT,setView:eR,setParams:u,setPayload:eC,navigateIntent:eE,createPathWithParams:E},h[16]=E,h[17]=y,h[18]=l,h[19]=c,h[20]=d,h[21]=u,h[22]=p):p=h[22],a=p,h[23]!==m||h[24]!==a?(f=(0,r.jsx)(k.l4.Provider,{value:a,children:m}),h[23]=m,h[24]=a,h[25]=f):f=h[25],f}function eE(e,t,n){console.warn("navigateIntent",e,t,n)}function eC(e){console.warn("setPayload",e)}function eR(e){console.warn("setView",e)}function eT(e){console.warn("duplicateCurrent",e)}function eO(){console.warn("closeCurrent")}function e$(e){console.warn("replaceCurrent",e)}function eI(e){console.warn("handleEditReference",e)}function eP(){console.warn("closeCurrentAndAfter")}function eM(){return(0,r.jsx)(r.Fragment,{children:"ParameterizedLink"})}let ez=(0,_.I4)(E.PaneLayout)` 12 height: 100%; 13`,eL=(0,_.I4)(m.so)` 14 & > div { 15 min-width: none !important; 16 max-width: none !important; 17 } 18`,eA=(0,_.I4)(m.Cy)` 19 white-space: pre-wrap; 20`;function eZ(e){let t,n,a,o,s,l,c,d,u,p,f,h=(0,i.c)(33),{mainDocumentState:g,onStructureParams:b,searchParams:w,refs:j}=e,{t:_}=(0,x.Bdt)(v.Yi),{devMode:S}=(0,v.Qe)();if(h[0]!==g?.document?._id||h[1]!==j){let e;h[3]!==g?.document?._id?(e=e=>(0,x.IMx)(e._id)!==g?.document?._id,h[3]=g?.document?._id,h[4]=e):e=h[4],n=j.filter(e).map(eD),h[0]=g?.document?._id,h[1]=j,h[2]=n}else n=h[2];t=n,h[5]!==t?(o={filter:"_id in $ids",params:{ids:t}},h[5]=t,h[6]=o):o=h[6],h[7]!==_?(s=_("document-list-pane.document-list.title"),h[7]=_,h[8]=s):s=h[8],h[9]!==o||h[10]!==s?(l={id:"$root",options:o,schemaTypeName:"",title:s,type:"documentList"},h[9]=o,h[10]=s,h[11]=l):l=h[11],a=l;let[k,C]=(0,y.useState)(null);h[12]===Symbol.for("react.memo_cache_sentinel")?(c=()=>C(null),h[12]=c):c=h[12];let R=c,[T]=(0,y.useState)(eU);if(h[13]===Symbol.for("react.memo_cache_sentinel")?(d=()=>C(null),h[13]=d):d=h[13],h[14]!==j?(u=[j],h[14]=j,h[15]=u):u=h[15],(0,y.useEffect)(d,u),k){let e,t,n;return h[16]!==_?(e=_("document-list-pane.error.text"),h[16]=_,h[17]=e):e=h[17],h[18]!==S||h[19]!==k||h[20]!==_?(t=S&&(0,r.jsx)(m.Zp,{overflow:"auto",padding:3,radius:2,tone:"critical",children:(0,r.jsxs)(m.BJ,{space:3,children:[(0,r.jsx)(m.JU,{muted:!0,size:0,children:_("presentation-error.label")}),(0,r.jsx)(eA,{size:1,children:k.error.message})]})}),h[18]=S,h[19]=k,h[20]=_,h[21]=t):t=h[21],h[22]!==t||h[23]!==e?(n=(0,r.jsx)(ej,{flex:1,message:e,onRetry:R,children:t}),h[22]=t,h[23]=e,h[24]=n):n=h[24],n}return h[25]!==a?(p=(0,r.jsx)(eL,{direction:"column",flex:1,children:(0,r.jsx)(E.PaneContainer,{index:0,itemId:"$root",pane:a,paneKey:"$root"})}),h[25]=a,h[26]=p):p=h[26],h[27]!==b||h[28]!==j||h[29]!==w||h[30]!==T||h[31]!==p?(f=(0,r.jsx)(m.tH,{onCatch:C,children:(0,r.jsx)(ez,{children:(0,r.jsx)(E.StructureToolProvider,{children:(0,r.jsx)(ek,{onStructureParam
20s:b,structureParams:T,searchParams:w,refs:j,children:p})})})}),h[27]=b,h[28]=j,h[29]=w,h[30]=T,h[31]=p,h[32]=f):f=h[32],f}function eU(){return{}}function eD(e){return e._id}let eH=(0,_.I4)(m.Cy)` 21 white-space: pre-wrap; 22`;function eq(e){let t,n,a,o,s,l,c,d,u,p,f,h=(0,i.c)(35),{documentId:g,documentType:b,onFocusPath:w,onStructureParams:_,searchParams:S,structureParams:k}=e,{template:C,templateParams:R}=k,{t:T}=(0,x.Bdt)(v.Yi),{devMode:O}=(0,v.Qe)();h[0]!==R?(n=(0,j.fA)(R),h[0]=R,h[1]=n):n=h[1],h[2]!==g||h[3]!==b||h[4]!==n||h[5]!==C?(a={id:g,type:b,template:C,templateParameters:n},h[2]=g,h[3]=b,h[4]=n,h[5]=C,h[6]=a):a=h[6],h[7]!==g||h[8]!==a?(o={id:g,options:a,title:"",type:"document"},h[7]=g,h[8]=a,h[9]=o):o=h[9],t=o;let[$,I]=(0,y.useState)(null);h[10]===Symbol.for("react.memo_cache_sentinel")?(s=()=>I(null),h[10]=s):s=h[10];let P=s;if(h[11]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{I(null)},h[11]=l):l=h[11],h[12]!==g||h[13]!==b||h[14]!==k?(c=[g,b,k],h[12]=g,h[13]=b,h[14]=k,h[15]=c):c=h[15],(0,y.useEffect)(l,c),$){let e,t,n;return h[16]!==T?(e=T("document-pane.error.text"),h[16]=T,h[17]=e):e=h[17],h[18]!==O||h[19]!==$||h[20]!==T?(t=O&&(0,r.jsx)(m.Zp,{overflow:"auto",padding:3,radius:2,tone:"critical",children:(0,r.jsxs)(m.BJ,{space:3,children:[(0,r.jsx)(m.JU,{muted:!0,size:0,children:T("presentation-error.label")}),(0,r.jsx)(eH,{size:1,children:$.error.message})]})}),h[18]=O,h[19]=$,h[20]=T,h[21]=t):t=h[21],h[22]!==e||h[23]!==t?(n=(0,r.jsx)(ej,{flex:1,message:e,onRetry:P,children:t}),h[22]=e,h[23]=t,h[24]=n):n=h[24],n}return h[25]===Symbol.for("react.memo_cache_sentinel")?(d={height:"100%"},h[25]=d):d=h[25],h[26]===Symbol.for("react.memo_cache_sentinel")?(u=(0,r.jsx)(v.gu,{}),h[26]=u):u=h[26],h[27]!==w||h[28]!==t?(p=(0,r.jsx)(y.Suspense,{fallback:u,children:(0,r.jsx)(E.DocumentPane,{paneKey:"document",index:1,itemId:"document",pane:t,onFocusPath:w})}),h[27]=w,h[28]=t,h[29]=p):p=h[29],h[30]!==_||h[31]!==S||h[32]!==k||h[33]!==p?(f=(0,r.jsx)(m.tH,{onCatch:I,children:(0,r.jsx)(E.PaneLayout,{style:d,children:(0,r.jsx)(ek,{searchParams:S,onStructureParams:_,structureParams:k,children:p})})}),h[30]=_,h[31]=S,h[32]=k,h[33]=p,h[34]=f):f=h[34],f}function eV(e){let t,n=(0,i.c)(7),{documentId:a,documentType:o,onFocusPath:s,onStructureParams:l,searchParams:c,structureParams:d}=e;return n[0]!==a||n[1]!==o||n[2]!==s||n[3]!==l||n[4]!==c||n[5]!==d?(t=(0,r.jsx)(E.StructureToolProvider,{children:(0,r.jsx)(eq,{documentId:a,documentType:o,onFocusPath:s,onStructureParams:l,searchParams:c,structureParams:d})}),n[0]=a,n[1]=o,n[2]=s,n[3]=l,n[4]=c,n[5]=d,n[6]=t):t=n[6],t}function eN(e){let t,n,a,o,s,l,c,d=(0,i.c)(39),{documentId:u,documentType:p,mainDocumentState:f,onFocusPath:h,onStructureParams:g,refs:b,searchParams:w,structureParams:_}=e,{t:k}=(0,x.Bdt)(v.Yi),E=(0,x.pDY)();d[0]!==f?.document?._id||d[1]!==f?.document?._type||d[2]!==w?(t=e=>(0,r.jsx)(j.s8,{...e,state:{id:f?.document?._id,type:f?.document?._type,_searchParams:Object.entries(w)}}),d[0]=f?.document?._id,d[1]=f?.document?._type,d[2]=w,d[3]=t):t=d[3];let C=t;d[4]!==f?.document?._type||d[5]!==E?(a=E.get(f?.document?._type||"shoe"),d[4]=f?.document?._type,d[5]=E,d[6]=a):a=d[6],n=a;let R=function(e,t){let n,r,a,o=(0,i.c)(6),s=(0,x.yKO)();o[0]===Symbol.for("react.memo_cache_sentinel")?(n={},o[0]=n):n=o[0];let[l,c]=(0,y.useState)(n);return o[1]!==e||o[2]!==s||o[3]!==t?(r=()=>{if(!t)return;let n=(0,x.TU6)(s,t,e,"").subscribe(e=>{c(e)});return()=>{n?.unsubscribe()}},a=[s,t,e],o[1]=e,o[2]=s,o[3]=t,o[4]=r,o[5]=a):(r=o[4],a=o[5]),(0,y.useEffect)(r,a),l}(f?.document?._id||"",n);e:{let e,t,i,a;if(!f?.document){o=null;break e}let s=f.document;d[7]!==R.draft||d[8]!==R.published||d[9]!==s?(e=(0,x.ADU)({value:s,published:R.published,draft:R.draft}),d[7]=R.draft,d[8]=R.published,d[9]=s,d[10]=e):e=d[10],d[11]!==k?(t=k("main-document.label"),d[11]=k,d[12]=t):t=d[12],d[13]!==t?(i=(0,r.jsx)(m.Zp,{padding:1,radius:2,shadow:1,children:(0,r.jsx)(m.EY,{muted:!0,size:0,weight:"medium",children:t})}),d[13]=t,d[14]=i):i=d[14],d[15]!==n||d[16]!==e||d[17]!==i?(a=(0,r.jsx)(x.m6P,{...e,schemaType:n,status:i}),d[15]=n,d[16]=e,d[17]=i,d[18]=a):a=d[18],o=a}let T=o;if(u&&p){let e;return d[19]!==u||d[20]!==p||d[21]!==h||d[22]!==g||d[23]!==w||d[24]!==_?(e=(0,r.jsx)(eV,{documentId:u,documentType:p,onFocusPath:h,onStructureParam
22s:g,searchParams:w,structureParams:_}),d[19]=u,d[20]=p,d[21]=h,d[22]=g,d[23]=w,d[24]=_,d[25]=e):e=d[25],e}return d[26]!==C||d[27]!==f||d[28]!==T||d[29]!==k?(s=f&&(0,r.jsx)(m.Zp,{padding:3,tone:f.document?"inherit":"caution",children:f.document?(0,r.jsx)(x.Ns2,{__unstable_focusRing:!0,as:C,"data-as":"a",radius:2,sizing:"border",tone:"inherit",children:T}):(0,r.jsx)(m.Zp,{padding:2,radius:2,tone:"inherit",children:(0,r.jsxs)(m.so,{gap:3,children:[(0,r.jsx)(m.az,{flex:"none",children:(0,r.jsx)(m.EY,{size:1,children:(0,r.jsx)(S.sAQ,{})})}),(0,r.jsx)(m.az,{flex:1,children:(0,r.jsx)(m.EY,{size:1,children:(0,r.jsx)(x.HTc,{t:k,i18nKey:"main-document.missing.text",components:{Code:"code"},values:{path:f.path}})})})]})})}),d[26]=C,d[27]=f,d[28]=T,d[29]=k,d[30]=s):s=d[30],d[31]!==f||d[32]!==g||d[33]!==b||d[34]!==w?(l=(0,r.jsx)(eZ,{mainDocumentState:f,onStructureParams:g,searchParams:w,refs:b}),d[31]=f,d[32]=g,d[33]=b,d[34]=w,d[35]=l):l=d[35],d[36]!==s||d[37]!==l?(c=(0,r.jsxs)(m.so,{direction:"column",flex:1,height:"fill",children:[s,l]}),d[36]=s,d[37]=l,d[38]=c):c=d[38],c}for(var eY=[],eB=0;eB<256;++eB)eY.push((eB+256).toString(16).slice(1));var eW,eF=new Uint8Array(16),eJ={randomUUID:"u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let eK=_.I4.div` 23 position: relative; 24`,eG=_.I4.div` 25 position: absolute; 26 top: 0; 27 bottom: 0; 28 left: -5px; 29 width: 9px; 30 z-index: 10; 31 cursor: ${({$disabled:e})=>e?"auto":"ew-resize"}; 32 33 /* Border */ 34 & > span:nth-child(1) { 35 display: block; 36 border-left: 1px solid var(--card-border-color); 37 position: absolute; 38 top: 0; 39 left: 4px; 40 bottom: 0; 41 transition: opacity 200ms; 42 } 43 44 ${({$disabled:e})=>!e&&` 45 /* Hover effect */ 46 & > span:nth-child(2) { 47 display: block; 48 position: absolute; 49 top: 0; 50 left: 0; 51 width: 9px; 52 bottom: 0; 53 background-color: var(--card-border-color); 54 opacity: 0; 55 transition: opacity 150ms; 56 } 57 58 @media (hover: hover) { 59 &:hover > span:nth-child(2) { 60 opacity: 0.2; 61 } 62 } 63 `} 64`,eX=function(e){let t,n,a,o,s,l,c,d,u,p,f,h=(0,i.c)(27),{id:m,order:g,disabled:x}=e,v=void 0!==x&&x,b=(0,y.useRef)(null),w=(0,y.useContext)(ea);if(null===w)throw Error("Panel components must be rendered within a PanelGroup container");let j=function(e){let t,n=(0,i.c)(2);n[0]!==e?(t=()=>e||function(e,t,n){if(eJ.randomUUID&&!e)return eJ.randomUUID();var r=(e=e||{}).random||(e.rng||function(){if(!eW&&!(eW="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return eW(eF)})();return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return(eY[e[t+0]]+eY[e[t+1]]+eY[e[t+2]]+eY[e[t+3]]+"-"+eY[e[t+4]]+eY[e[t+5]]+"-"+eY[e[t+6]]+eY[e[t+7]]+"-"+eY[e[t+8]]+eY[e[t+9]]+"-"+eY[e[t+10]]+eY[e[t+11]]+eY[e[t+12]]+eY[e[t+13]]+eY[e[t+14]]+eY[e[t+15]]).toLowerCase()}(r)}(),n[0]=e,n[1]=t):t=n[1];let[r]=(0,y.useState)(t);return r}(m),{activeResizer:_,drag:S,startDragging:k,stopDragging:E,registerElement:C,unregisterElement:R}=w,T=_===j;if(null===w)throw Error("Panel components must be rendered within a PanelGroup container");h[0]!==j||h[1]!==k?(t=e=>{k(j,e.nativeEvent)},h[0]=j,h[1]=k,h[2]=t):t=h[2];let O=t;h[3]!==S||h[4]!==j?(n=e=>{S(j,e)},h[3]=S,h[4]=j,h[5]=n):n=h[5];let $=n;h[6]!==E?(a=()=>{b.current.blur(),E()},h[6]=E,h[7]=a):a=h[7];let I=a;return h[8]!==v||h[9]!==T||h[10]!==$||h[11]!==I?(o=()=>{if(!T||v)return;let e=function(){let e=document.body.style,t=document.documentElement.style,{cursor:n}=t,{userSelect:r}=e;return t.cursor="ew-resize",e.userSelect="none",()=>{n?t.cursor=n:t.removeProperty("cursor"),r?e.userSelect=r:e.removeProperty("user-select")}}();return window.addEventListener("mousemove",$),window.addEventListener("mouseup",I),window.addEventListener("contextmenu",I),()=>{e(),window.removeEventListener("mousemove",$),window.removeEventListener("mouseup",I),window.removeEventListener("contextmenu",I)}},s=[v,T,$,I],h[8]=v,h[9]=T,h[10]=$,h[11]=I,h[12]=o,h[13]=s):(o=h[12],s=h[13]),(0,y.useEffect)(o,s),h[14]!==j||h[15]!==g||h[16]!==C||h[17]!==R?(l=()=>(C(j,{id:j,order:g,type:"resizer",el:b}),()=>{R(j)}),c=[j,g,C,R],h[14]=j,h[15]=g,h[16]=C,h[17]=R,h[18]=l,h[19]=c):(l=h[18],c=h[19]),(0,y.useLayoutEffect)(l,c),h[20]===Symbol.for("react.memo_cache_sentinel")?(u=(0,r.jsx)("span",{}),d=(0,r.jsx)("span",{}),h[20]=d,h[21]=u):(d=h[20],u=h[21]),h[22]!==v?(p=(0,r.jsxs)(eG,{$disabled:v,children:[u,d]}),h[22]=v,h[23]=p):p=h[23],h[24]!==O||h[25]!==p?(f=(0,r.jsx)(eK,{onMouseDown:O,ref:b,children:p}),h[24]=O,h[25]=p,h[26]=f):f=h[26],f},eQ=e=>{let t,n,a,o=(0,i.c)(8),{documentId:s,setDisplayedDocument:l,getCommentIntent:c}=e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,r.jsx)(eX,{order:4}),o[0]=t):t=o[0],o[1]!==c||o[2]!==e.children?(n=(0,r.jsx)(x.S4U,{getIntent:c,children:e.children}),o[1]=c,o[2]=e.children,o[3]=n):n=o[3],o[4]!==s||o[5]!==l||o[6]!==n?(a=(0,r.jsxs)(r.Fragment,{children:[t,(0,r.jsx)(es,{id:"content",minWidth:325,order:5,children:(0,r.jsx)(C.C,{documentId:s,setDisplayedDocument:l,children:n})})]}),o[4]=s,o[5]=l,o[6]=n,o[7]=a):a=o[7],a},e0=e=>{let t,n,a=(0,i.c)(14),{documentId:o,documentsOnPage:s,documentType:l,getCommentIntent:c,mainDocumentState:d,onFocusPath:u,onStructureParam
64s:p,searchParams:f,setDisplayedDocument:h,structureParams:m}=e;return a[0]!==o||a[1]!==l||a[2]!==s||a[3]!==d||a[4]!==u||a[5]!==p||a[6]!==f||a[7]!==m?(t=(0,r.jsx)(eN,{documentId:o,documentType:l,mainDocumentState:d,onFocusPath:u,onStructureParams:p,refs:s,searchParams:f,structureParams:m}),a[0]=o,a[1]=l,a[2]=s,a[3]=d,a[4]=u,a[5]=p,a[6]=f,a[7]=m,a[8]=t):t=a[8],a[9]!==o||a[10]!==c||a[11]!==h||a[12]!==t?(n=(0,r.jsx)(eQ,{documentId:o,getCommentIntent:c,setDisplayedDocument:h,children:t}),a[9]=o,a[10]=c,a[11]=h,a[12]=t,a[13]=n):n=a[13],n},e1=function(e){let t,n,a=(0,i.c)(5),{children:o,navigate:s}=e;a[0]!==s?(t=(e,t)=>{s((void 0===t?void 0:t)||{},e?{preview:e}:{})},a[0]=s,a[1]=t):t=a[1];let l=t;return a[2]!==o||a[3]!==l?(n=(0,r.jsx)(v.RA.Provider,{value:l,children:o}),a[2]=o,a[3]=l,a[4]=n):n=a[4],n};function e2(e){return!e}let e3=(0,y.memo)(function(e){let t,n,a,o,s=(0,i.c)(11),{minWidth:l,maxWidth:c,component:d}=e,u=null!=l&&null!=c&&l===c;return s[0]!==d?(t=(0,r.jsx)(d,{}),s[0]=d,s[1]=t):t=s[1],s[2]!==c||s[3]!==l||s[4]!==t?(n=(0,r.jsx)(es,{id:"navigator",minWidth:l,maxWidth:c,order:1,children:t}),s[2]=c,s[3]=l,s[4]=t,s[5]=n):n=s[5],s[6]!==u?(a=(0,r.jsx)(eX,{order:2,disabled:u}),s[6]=u,s[7]=a):a=s[7],s[8]!==n||s[9]!==a?(o=(0,r.jsxs)(r.Fragment,{children:[n,a]}),s[8]=n,s[9]=a,s[10]=o):o=s[10],o}),e4=function(e){let t,n=(0,i.c)(3),{children:a,params:o}=e;return n[0]!==a||n[1]!==o?(t=(0,r.jsx)(v.ix.Provider,{value:o,children:a}),n[0]=a,n[1]=o,n[2]=t):t=n[2],t},e6=function(e){let t,n,a,o=(0,i.c)(10),{children:s,devMode:l,name:c,navigate:d,params:u,searchParams:p,structureParams:f}=e;return o[0]!==l||o[1]!==c||o[2]!==d||o[3]!==u||o[4]!==p||o[5]!==f?(n={devMode:l,name:c,navigate:d,params:u,searchParams:p,structureParams:f},o[0]=l,o[1]=c,o[2]=d,o[3]=u,o[4]=p,o[5]=f,o[6]=n):n=o[6],t=n,o[7]!==s||o[8]!==t?(a=(0,r.jsx)(v.SM.Provider,{value:t,children:s}),o[7]=s,o[8]=t,o[9]=a):a=o[9],a},e5=(0,R.P)(_.I4.iframe` 65 box-shadow: 0 0 0 1px var(--card-border-color); 66 border-top: 1px solid transparent; 67 border-bottom: 0; 68 border-right: 0; 69 border-left: 0; 70 max-height: 100%; 71 width: 100%; 72`),e9=(0,_.I4)(m.az)` 73 position: absolute; 74 inset: 0; 75 background: transparent; 76`,e7=(0,y.forwardRef)(function(e,t){let n,a,o,s=(0,i.c)(12),{animate:l,initial:c,onLoad:d,preventClick:u,src:p,variants:f}=e;return s[0]!==l||s[1]!==c||s[2]!==d||s[3]!==t||s[4]!==p||s[5]!==f?(n=(0,r.jsx)(e5,{animate:l,initial:c,onLoad:d,ref:t,src:p,variants:f}),s[0]=l,s[1]=c,s[2]=d,s[3]=t,s[4]=p,s[5]=f,s[6]=n):n=s[6],s[7]!==u?(a=u&&(0,r.jsx)(e9,{}),s[7]=u,s[8]=a):a=s[8],s[9]!==n||s[10]!==a?(o=(0,r.jsxs)(r.Fragment,{children:[n,a]}),s[9]=n,s[10]=a,s[11]=o):o=s[11],o});function e8(e){let t,n,a,o,s,l,c,d=(0,i.c)(16),{openPopup:u,previewLocationOrigin:p,previewLocationRoute:f}=e,{t:h}=(0,x.Bdt)(v.Yi);d[0]!==u?(t=e=>{e.preventDefault(),u(e.currentTarget.href)},d[0]=u,d[1]=t):t=d[1];let g=t;d[2]!==h?(n=h("share-url.menu-item.open.text"),d[2]=h,d[3]=n):n=d[3],d[4]!==n?(a=(0,r.jsx)(m.EY,{size:1,children:n}),d[4]=n,d[5]=a):a=d[5],d[6]===Symbol.for("react.memo_cache_sentinel")?(o=["bottom-start"],d[6]=o):o=d[6],d[7]!==h?(s=h("share-url.menu-item.open.text"),d[7]=h,d[8]=s):s=d[8];let y=`${p}${f}`;return d[9]!==g||d[10]!==s||d[11]!==y?(l=(0,r.jsx)(m.$n,{as:"a","aria-label":s,fontSize:1,icon:S.ZPM,mode:"bleed",padding:2,href:y,onClick:g,rel:"opener",target:"_blank"}),d[9]=g,d[10]=s,d[11]=y,d[12]=l):l=d[12],d[13]!==a||d[14]!==l?(c=(0,r.jsx)(m.m_,{animate:!0,content:a,fallbackPlacements:o,padding:2,placement:"bottom",portal:!0,children:l}),d[13]=a,d[14]=l,d[15]=c):c=d[15],c}let te=function(e){let t,n,a,o,s,l,c,d,u,p,f=(0,i.c)(27),{fontSize:h,onChange:g,origin:b,padding:w,prefix:j,suffix:_,value:k}=e,E=void 0===h?1:h,C=void 0===w?3:w,{t:R}=(0,x.Bdt)(v.Yi),{basePath:T}=(0,x.VrO)()?.activeWorkspace||{},O=void 0===T?"/":T,$=(0,y.useRef)(null),[I,P]=(0,y.useState)(void 0),[M,z]=(0,y.useState)(void 0);f[0]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{P(e.currentTarget.value)},f[0]=t):t=f[0];let L=t;f[1]!==O||f[2]!==g||f[3]!==b||f[4]!==I||f[5]!==R?(n=e=>{if("Enter"===e.key){if(void 0===I)return;let e=I.startsWith("/")||""===I?`${b}${I}`:I;if(!e.startsWith(b+"/")&&e!==b)return void z(R("preview-location-input.error",{origin:b,context:"missing-origin"}));if(!b&&(e.startsWith(`${O}/`)||e===O))return void z(R("preview-location-input.error",{basePath:O,context:"same-base-path"}));let t=e===b?b+"/":e;z(void 0),P(void 0),g(t.slice(b.length)),$.current?.blur()}"Escape"===e.key&&(z(void 0),P(void 0))},f[1]=O,f[2]=g,f[3]=b,f[4]=I,f[5]=R,f[6]=n):n=f[6];let A=n;f[7]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{z(void 0),P(void 0)},f[7]=a):a=f[7];let Z=a;f[8]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{z(void 0),P(void 0)},f[8]=o):o=f[8],f[9]!==b||f[10]!==k?(s=[b,k],f[9]=b,f[10]=k,f[11]=s):s=f[11],(0,y.useEffect)(o,s),f[12]===Symbol.for("react.memo_cache_sentinel")?(c={icon:S.NAP},f[12]=c):c=f[12],l=c;let U=M?l:void 0;f[13]!==b||f[14]!==k?(d=()=>{z(void 0),P(b+k)},f[13]=b,f[14]=k,f[15]=d):d=f[15],f[16]===Symbol.for("react.memo_cache_sentinel")?(u={zIndex:1},f[16]=u):u=f[16];let D=void 0===I?`${b}${k}`:I;return f[17]!==M||f[18]!==E||f[19]!==A||f[20]!==C||f[21]!==j||f[22]!==_||f[23]!==U||f[24]!==d||f[25]!==D?(p=(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(m.ks,{clearButton:U,customValidity:M,fontSize:E,onBlur:Z,onClear:d,onChange:L,onKeyDownCapture:A,padding:C,prefix:j,style:u,radius:2,ref:$,space:C,suffix:_,value:D})}),f[17]=M,f[18]=E,f[19]=A,f[20]=C,f[21]=j,f[22]=_,f[23]=U,f[24]=d,f[25]=D,f[26]=p):p=f[26],p},tt=(0,y.lazy)(()=>n.e(38).then(n.bind(n,60038))),tn=(0,_.I4)(M)` 77 position: absolute; 78 top: 50%; 79 left: 50%; 80 transform: translate(-50%, -50%); 81 height: ${24}px; 82 width: ${24}px; 83`,tr=(0,R.P)(m.y$),ti=(0,R.P)(m.EY),ta=(0,R.P)(tn),to=(0,y.memo)(function(e){let{canToggleSharePreviewAccess:t,canUseSharedPreviewAccess:n,initialUrl:i,previewLocationRoute:a,perspective:o}=e,{t:s}=(0,x.Bdt)(v.Yi),{push:l}=(0,m.dj)(),f=(0,x.tH7)({apiVersion:v.mG}),h=(0,x.iZK)(),[g,b]=(0,y.useState)(!0),[w,j]=(0,y.useState)(!1),[_,k]=(0,y.useState)(!1),[E,C]=(0,y.useState)(null),R=w||_||g,O=(0,y.useMemo)(()=>E?function(e,t,n,r){let i=new URL(e),{searchParams:a}=i;return a.set(c,t),a.set(d,n),a.set(u,r),i}
83(i,E,a,o):null,[i,o,a,E]),[$,I]=(0,y.useState)(null);if($)throw $;let P=(0,y.useCallback)(()=>{l({closable:!0,status:"warning",title:s("share-preview-menu.error_toggle-sharing",{context:"toggle-sharing"})})},[l,s]),M=(0,y.useCallback)(async()=>{try{k(!0),await A(f,"@sanity/presentation",typeof window>"u"?"":location.href,h?.id),C(null)}catch(e){I(e)}finally{k(!1)}},[f,h?.id]),z=(0,y.useCallback)(async()=>{try{j(!0);let e=await L(f,"@sanity/presentation",typeof window>"u"?"":location.href,h?.id);C(e.secret)}catch(e){I(e)}finally{j(!1)}},[f,h?.id]),Z=(0,y.useCallback)(()=>{try{if(!O)throw Error("No URL to copy");navigator.clipboard.writeText(O.toString()),l({closable:!0,status:"success",title:s("share-url.clipboard.status",{context:"success"})})}catch(e){I(e)}},[l,s,O]);return(0,y.useEffect)(()=>{let e=new AbortController,t=[];async function n(e,n){let{result:r,syncTags:i}=await f.fetch(p,{},{filterResponse:!1,lastLiveEventId:e,tag:"presentation.fetch-shared-access-secret"});Array.isArray(i)&&(t=i),n.aborted||C(r)}let r=f.live.events().subscribe({next:r=>{"message"===r.type&&(e.abort(),e=new AbortController,r.tags.some(e=>t.includes(e))&&n(r.id,e.signal))},error:I});return n(null,e.signal).finally(()=>b(!1)),()=>{r.unsubscribe(),e.abort()}},[f]),(0,r.jsx)(m.IU,{button:(0,r.jsx)(m.$n,{"aria-label":s("preview-frame.share-button.aria-label"),fontSize:1,icon:S.liv,mode:"bleed",padding:2}),id:"share-menu",menu:(0,r.jsx)(m.W1,{style:{maxWidth:248},padding:n?void 0:0,children:n?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("label",{style:{cursor:"pointer"},children:(0,r.jsxs)(m.xA,{columns:2,rows:2,gapX:3,gapY:1,style:{justifyContent:"center",alignItems:"center",gridTemplateColumns:"min-content 1fr",gridTemplateRows:"min-content"},paddingTop:3,paddingX:3,children:[(0,r.jsx)(m.m_,{animate:!0,content:(0,r.jsx)(m.EY,{size:1,children:s("share-preview-menu.toggle-button.tooltip",{context:O?"disable":"enable"})}),fallbackPlacements:["bottom-start"],padding:1,placement:"bottom",portal:!0,children:(0,r.jsx)(m.dO,{checked:w||null!==O&&!_,readOnly:w||_,indeterminate:g,onChange:t?O?M:z:P})}),(0,r.jsx)(m.EY,{size:1,weight:"medium",children:s("share-preview-menu.toggle-button.label",{context:"first-line"})}),(0,r.jsx)("span",{}),(0,r.jsx)(m.EY,{muted:!0,size:1,children:s("share-preview-menu.toggle-button.label",{context:"second-line"})})]})}),(0,r.jsx)(m.az,{padding:3,paddingTop:2,children:(0,r.jsxs)(m.BJ,{space:3,children:[(0,r.jsx)(m.Zp,{tone:R||!O?"transparent":void 0,style:{position:"relative",aspectRatio:"1 / 1",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,r.jsx)(T.N,{children:R?(0,r.jsx)(tr,{muted:!0,initial:{opacity:0}
83,animate:{opacity:1},exit:{opacity:0}}):O?(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(y.Suspense,{fallback:(0,r.jsx)(m.y$,{}),children:[(0,r.jsx)(tt,{title:s("share-preview-menu.qr-code.title",{url:O.toString()}),value:O.toString(),size:224,color:"var(--card-fg-color)",logoSize:40}),(0,r.jsx)(ta,{initial:{opacity:-.5},animate:{opacity:1.5},exit:{opacity:0}})]})}):(0,r.jsx)(ti,{muted:!0,size:1,style:{maxWidth:"100px",textWrap:"pretty",textAlign:"center"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:s("share-preview-menu.qr-code.placeholder")})})}),(0,r.jsx)(m.EY,{muted:!0,size:1,children:s("share-preview-menu.qr-code.instructions")})]})}),(0,r.jsx)(m.Nj,{}),(0,r.jsx)(m.Dr,{disabled:!O||_,icon:S.TdU,onClick:Z,fontSize:1,padding:3,text:s("share-preview-menu.copy-url.text")})]}):(0,r.jsx)(m.Zp,{padding:2,tone:"caution",radius:3,children:(0,r.jsx)(m.EY,{style:{textWrap:"pretty"},children:s("share-preview-menu.error",{context:"missing-grants"})})})}),popover:{animate:!0,constrainSize:!0,placement:"bottom",portal:!0}})});to.displayName="Memo(SharePreviewMenu)";let ts={previewDrafts:"preview-frame.perspective.previewDrafts.title",published:"preview-frame.perspective.published.title"},tl={previewDrafts:"caution",published:"positive"},tc={previewDrafts:S.qUP,published:S.VQ$},td=e=>{let t,n,a,o,s,l,p,f,h,g,b,w,j,_,k,E,C,R,T,O,$,I,P,M,z,L,A,Z,U,D,H,q,V,N,Y,B,W,F,J,K,G,X,Q,ee,et,en,er,ei,ea,eo,es,el,ec,ed,eu,ep,ef,eh,em,eg,ey,ex,ev,eb,ew,ej=(0,i.c)(164),{canSharePreviewAccess:e_,canToggleSharePreviewAccess:eS,canUseSharedPreviewAccess:ek,dispatch:eE,iframe:eC,iframeRef:eR,initialUrl:eT,loadersConnection:eO,navigatorEnabled:e$,onPathChange:eI,onRefresh:eP,openPopup:eM,overlaysConnection:ez,perspective:eL,previewUrl:eA,setPerspective:eZ,setViewport:eU,targetOrigin:eD,toggleNavigator:eH,toggleOverlay:eq,viewport:eV,visualEditing:eN}=e,{overlaysEnabled:eY}=eN,{t:eB}=(0,x.Bdt)(v.Yi);ej[0]!==eU||ej[1]!==eV?(t=()=>eU("desktop"===eV?"mobile":"desktop"),ej[0]=eU,ej[1]=eV,ej[2]=t):t=ej[2];let eW=t;n=eD===location.origin?"":eD,ej[3]!==eE||ej[4]!==eR.current||ej[5]!==eP||ej[6]!==eA||ej[7]!==eD?(a=()=>{eP(()=>{eR.current&&(eE({type:v.my}),Object.assign(eR.current,{src:`${eD}${eA||"/"}`}))})},ej[3]=eE,ej[4]=eR.current,ej[5]=eP,ej[6]=eA,ej[7]=eD,ej[8]=a):a=ej[8];let eF=a,{pathname:eJ,search:eK}=function(e){let t=new URL(e),{searchParams:n}=t;return n.delete(d),n.delete(c),n.delete(u),t}(new URL(eA||"/",eD));o=`${eJ}${eK}`,ej[9]!==e$||ej[10]!==eB||ej[11]!==eH?(s=eH&&(0,r.jsx)(m.az,{flex:"none",marginRight:1,padding:1,children:(0,r.jsx)(m.m_,{animate:!0,content:(0,r.jsx)(m.EY,{size:1,children:eB("preview-frame.navigator.toggle-button.tooltip")}),fallbackPlacements:["bottom-start"],padding:2,placement:"bottom",portal:!0,children:(0,r.jsx)(m.$n,{"aria-label":eB("preview-frame.navigator.toggle-button.aria-label"),fontSize:1,icon:S.lC2,mode:"bleed",onClick:eH,padding:2,selected:e$})})}),ej[9]=e$,ej[10]=eB,ej[11]=eH,ej[12]=s):s=ej[12],ej[13]===Symbol.for("react.memo_cache_sentinel")?(l={whiteSpace:"nowrap"},ej[13]=l):l=ej[13];let eG=eY?"disable":"enable";ej[14]!==eB||ej[15]!==eG?(p=eB("preview-frame.overlay.toggle-button.tooltip",{context:eG}),ej[14]=eB,ej[15]=eG,ej[16]=p):p=ej[16],ej[17]!==p?(f=(0,r.jsx)(m.az,{padding:1,children:(0,r.jsx)(m.EY,{size:1,children:p})}),ej[17]=p,ej[18]=f):f=ej[18],ej[19]===Symbol.for("react.memo_cache_sentinel")?(h=(0,r.jsx)(m.az,{paddingY:1,children:(0,r.jsx)(m.qW,{keys:["Alt"],style:{marginTop:-4,marginBottom:-4}})}),ej[19]=h):h=ej[19],ej[20]!==f?(g=(0,r.jsxs)(m.so,{align:"center",style:l,children:[f,h]}),ej[20]=f,ej[21]=g):g=ej[21],ej[22]===Symbol.for("react.memo_cache_sentinel")?(b=["bottom-start"],ej[22]=b):b=ej[22],ej[23]===Symbol.for("react.memo_cache_sentinel")?(w={lineHeight:0,borderRadius:999,userSelect:"none"},ej[23]=w):w=ej[23];let eX=eY?"transparent":void 0;ej[24]===Symbol.for("react.memo_cache_sentinel")?(j={margin:-4},ej[24]=j):j=ej[24];let eQ="loading"===eC.status||"connected"!==ez;ej[25]!==eY||ej[26]!==eQ||ej[27]!==eq?(_=(0,r.jsx)("div",{style:j,children:(0,r.jsx)(m.dO,{checked:eY,onChange:eq,disabled:eQ})}),ej[25]=eY,ej[26]=eQ,ej[27]=eq,ej[28]=_):_=ej[28];let e0=!eY;ej[29]!==eB?(k=eB("preview-frame.overlay.toggle-button.text"),ej[29]=eB,ej[30]=k):k=ej[30],ej[31]!==e0||ej[32]!==k?(E=(0,r.jsx)(m.az,{children:(0,r.jsx)(m.EY,{muted:e0,size:1,weight:"medium",children:k})}),ej[31]=e0,ej[32]=k,ej[33]=E):E=ej[33],ej[34]!==_||ej[35]!==E?(C=(0,r.jsxs)(m.so,{align:"center",gap:3,children:[_,E]}),ej[34]=_,ej[35]=E,ej[36]=C):C=ej[36],ej[37]!==eX||ej[38]!==C?(R=(0,r.jsx)(m.Zp,{as:"label",flex:"none",marginRight:1,padding:3,style:w,tone:eX,children:C}),ej[37]=eX,ej[38]=C,ej[39]=R):R=ej[39],ej[40]!==g||ej[41]!==R?(T=(0,r.jsx)(m.m_,{animate:!0,content:g,fallbackPlacements:b,padding:1,placement:"bottom",portal:!0,children:R}),ej[40]=g,ej[41]=R,ej[42]=T):T=ej[42],ej[43]!==eC.status||ej[44]!==eB?(O="loaded"===eC.status?eB("preview-frame.refresh-button.tooltip"):eB("preview-frame.status",{context:eC.status}),ej[43]=eC.status,ej[44]=eB,ej[45]=O):O=ej[45],ej[46]!==O?($=(0,r.jsx)(m.EY,{size:1,children:O}),ej[46]=O,ej[47]=$):$=ej[47],ej[48]===Symbol.for("react.memo_cache_sentinel")?(I=["bottom-end"],ej[48]=I):I=ej[48],ej[49]!==eB?(P=eB("preview-frame.refresh-button.aria-label"),ej[49]=eB,ej[50]=P):P=ej[50];let e1="reloading"===eC.status||"refreshing"===eC.status;ej[51]!==eF||ej[52]!==P||ej[53]!==e1?(M=(0,r.jsx)(m.$n,{"aria-label":P,fontSize:1,icon:S.fNY,mode:"bleed",loading:e1,onClick:eF,padding:2}),ej[51]=eF,ej[52]=P,ej[53]=e1,ej[54]=M):M=ej[54],ej[55]!==$||ej[56]!==M?(z=(0,r.jsx)(m.az,{padding:1,children:(0,r.jsx)(m.m_,{animate:!0,content:$,fallbackPlacements:I,padding:2,placement:"bottom",portal:!0,children:M})}),ej[55]=$,ej[56]=M,ej[57]=z):z=ej[57],ej[58]!==eM||ej[59]!==n||ej[60]!==o?(L=(0,r.jsx)(m.az,{padding:1,children:(0,r.jsx)(e8,{openPopup:eM,previewLocationOrigin:n,previewLocationRoute:o})}
83),ej[58]=eM,ej[59]=n,ej[60]=o,ej[61]=L):L=ej[61],ej[62]!==eI||ej[63]!==n||ej[64]!==o||ej[65]!==z||ej[66]!==L?(A=(0,r.jsx)(m.az,{flex:1,marginX:1,children:(0,r.jsx)(te,{prefix:z,onChange:eI,origin:n,suffix:L,value:o})}),ej[62]=eI,ej[63]=n,ej[64]=o,ej[65]=z,ej[66]=L,ej[67]=A):A=ej[67];let e2=ts["connected"===eO?eL:"previewDrafts"];ej[68]!==eB||ej[69]!==e2?(Z=eB(e2),ej[68]=eB,ej[69]=e2,ej[70]=Z):Z=ej[70];let e3="reconnecting"===eO&&"loaded"!==eC.status,e4="connected"!==eO;ej[71]!==Z||ej[72]!==e3||ej[73]!==e4?(U=(0,r.jsx)(m.$n,{fontSize:1,iconRight:S.D3D,mode:"bleed",padding:2,space:2,text:Z,loading:e3,disabled:e4}),ej[71]=Z,ej[72]=e3,ej[73]=e4,ej[74]=U):U=ej[74],ej[75]===Symbol.for("react.memo_cache_sentinel")?(D={maxWidth:240},ej[75]=D):D=ej[75],ej[76]!==eZ?(H=()=>eZ("previewDrafts"),ej[76]=eZ,ej[77]=H):H=ej[77];let e6="previewDrafts"===eL;ej[78]===Symbol.for("react.memo_cache_sentinel")?(q=(0,r.jsx)(m.az,{flex:"none",children:(0,r.jsx)(m.EY,{size:1,children:(0,y.createElement)(tc.previewDrafts)})}),ej[78]=q):q=ej[78],ej[79]!==eB?(V=eB(ts.previewDrafts),ej[79]=eB,ej[80]=V):V=ej[80],ej[81]!==V?(N=(0,r.jsx)(m.EY,{size:1,weight:"medium",children:V}),ej[81]=V,ej[82]=N):N=ej[82],ej[83]!==eB?(Y=eB("preview-frame.perspective.previewDrafts.text"),ej[83]=eB,ej[84]=Y):Y=ej[84],ej[85]!==Y?(B=(0,r.jsx)(m.EY,{muted:!0,size:1,children:Y}),ej[85]=Y,ej[86]=B):B=ej[86],ej[87]!==N||ej[88]!==B?(W=(0,r.jsxs)(m.BJ,{flex:1,space:2,children:[N,B]}),ej[87]=N,ej[88]=B,ej[89]=W):W=ej[89];let e5=+("previewDrafts"===eL);ej[90]!==e5?(F={opacity:e5},ej[90]=e5,ej[91]=F):F=ej[91],ej[92]===Symbol.for("react.memo_cache_sentinel")?(J=(0,r.jsx)(S.Nrt,{}),ej[92]=J):J=ej[92],ej[93]!==F?(K=(0,r.jsx)(m.az,{flex:"none",children:(0,r.jsx)(m.EY,{muted:!0,size:1,style:F,children:J})}),ej[93]=F,ej[94]=K):K=ej[94],ej[95]!==W||ej[96]!==K?(G=(0,r.jsxs)(m.so,{align:"flex-start",gap:3,children:[q,W,K]}),ej[95]=W,ej[96]=K,ej[97]=G):G=ej[97],ej[98]!==H||ej[99]!==e6||ej[100]!==G?(X=(0,r.jsx)(m.Dr,{fontSize:1,onClick:H,padding:3,pressed:e6,tone:tl.previewDrafts,children:G}),ej[98]=H,ej[99]=e6,ej[100]=G,ej[101]=X):X=ej[101],ej[102]!==eZ?(Q=()=>eZ("published"),ej[102]=eZ,ej[103]=Q):Q=ej[103];let e9="published"===eL;ej[104]===Symbol.for("react.memo_cache_sentinel")?(ee=(0,r.jsx)(m.az,{flex:"none",children:(0,r.jsx)(m.EY,{size:1,children:(0,y.createElement)(tc.published)})}),ej[104]=ee):ee=ej[104],ej[105]!==eB?(et=eB(ts.published),ej[105]=eB,ej[106]=et):et=ej[106],ej[107]!==et?(en=(0,r.jsx)(m.EY,{size:1,weight:"medium",children:et}),ej[107]=et,ej[108]=en):en=ej[108],ej[109]!==eB?(er=eB("preview-frame.perspective.published.text"),ej[109]=eB,ej[110]=er):er=ej[110],ej[111]!==er?(ei=(0,r.jsx)(m.EY,{muted:!0,size:1,children:er}),ej[111]=er,ej[112]=ei):ei=ej[112],ej[113]!==en||ej[114]!==ei?(ea=(0,r.jsxs)(m.BJ,{flex:1,space:2,children:[en,ei]}),ej[113]=en,ej[114]=ei,ej[115]=ea):ea=ej[115];let e7=+("published"===eL);ej[116]!==e7?(eo={opacity:e7},ej[116]=e7,ej[117]=eo):eo=ej[117],ej[118]===Symbol.for("react.memo_cache_sentinel")?(es=(0,r.jsx)(S.Nrt,{}),ej[118]=es):es=ej[118],ej[119]!==eo?(el=(0,r.jsx)(m.az,{flex:"none",children:(0,r.jsx)(m.EY,{muted:!0,size:1,style:eo,children:es})}),ej[119]=eo,ej[120]=el):el=ej[120],ej[121]!==ea||ej[122]!==el?(ec=(0,r.jsxs)(m.so,{align:"flex-start",gap:3,children:[ee,ea,el]}),ej[121]=ea,ej[122]=el,ej[123]=ec):ec=ej[123],ej[124]!==Q||ej[125]!==e9||ej[126]!==ec?(ed=(0,r.jsx)(m.Dr,{fontSize:1,onClick:Q,padding:3,pressed:e9,tone:tl.published,children:ec}),ej[124]=Q,ej[125]=e9,ej[126]=ec,ej[127]=ed):ed=ej[127],ej[128]!==X||ej[129]!==ed?(eu=(0,r.jsxs)(m.W1,{style:D,children:[X,ed]}),ej[128]=X,ej[129]=ed,ej[130]=eu):eu=ej[130],ej[131]===Symbol.for("react.memo_cache_sentinel")?(ep={animate:!0,constrainSize:!0,placement:"bottom",portal:!0},ej[131]=ep):ep=ej[131],ej[132]!==U||ej[133]!==eu?(ef=(0,r.jsx)(m.so,{align:"center",flex:"none",gap:1,padding:1,children:(0,r.jsx)(m.IU,{button:U,id:"perspective-menu",menu:eu,popover:ep})}),ej[132]=U,ej[133]=eu,ej[134]=ef):ef=ej[134];let tt="desktop"===eV?"narrow":"full";ej[135]!==eB||ej[136]!==tt?(eh=eB("preview-frame.viewport-button.tooltip",{context:tt}),ej[135]=eB,ej[136]=tt,ej[137]=eh):eh=ej[137],ej[138]!==eh?(em=(0,r.jsx)(m.EY,{size:1,children:eh}),ej[138]=eh,ej[139]=em):em=ej[139],ej[140]===Symbol.for("react.memo_cache_sentinel")?(eg=["bottom-start"],ej[140]=eg):eg=ej[140],ej[141]!==eB?(e
83y=eB("preview-frame.viewport-button.aria-label"),ej[141]=eB,ej[142]=ey):ey=ej[142];let tn="desktop"===eV?S.Ck_:S.eZO;return ej[143]!==ey||ej[144]!==tn||ej[145]!==eW?(ex=(0,r.jsx)(m.$n,{"aria-label":ey,fontSize:1,icon:tn,mode:"bleed",onClick:eW,padding:2}),ej[143]=ey,ej[144]=tn,ej[145]=eW,ej[146]=ex):ex=ej[146],ej[147]!==em||ej[148]!==ex?(ev=(0,r.jsx)(m.so,{align:"center",flex:"none",gap:1,children:(0,r.jsx)(m.m_,{animate:!0,content:em,fallbackPlacements:eg,padding:2,placement:"bottom",portal:!0,children:ex})}),ej[147]=em,ej[148]=ex,ej[149]=ev):ev=ej[149],ej[150]!==e_||ej[151]!==eS||ej[152]!==ek||ej[153]!==eT||ej[154]!==eL||ej[155]!==o?(eb=e_&&(0,r.jsx)(m.so,{align:"center",flex:"none",gap:1,paddingX:1,children:(0,r.jsx)(to,{canToggleSharePreviewAccess:eS,canUseSharedPreviewAccess:ek,previewLocationRoute:o,initialUrl:eT,perspective:eL})}),ej[150]=e_,ej[151]=eS,ej[152]=ek,ej[153]=eT,ej[154]=eL,ej[155]=o,ej[156]=eb):eb=ej[156],ej[157]!==T||ej[158]!==A||ej[159]!==s||ej[160]!==ef||ej[161]!==ev||ej[162]!==eb?(ew=(0,r.jsxs)(r.Fragment,{children:[s,T,A,ef,ev,eb]}),ej[157]=T,ej[158]=A,ej[159]=s,ej[160]=ef,ej[161]=ev,ej[162]=eb,ej[163]=ew):ew=ej[163],ew},tu=e=>{let t,n,a,o,s=(0,i.c)(6),l=tp;s[0]!==e?(t=e.options?.component?(0,y.createElement)(e.options.component,{...e,renderDefault:l}):l(e),s[0]=e,s[1]=t):t=s[1];let c=t;return s[2]===Symbol.for("react.memo_cache_sentinel")?(n={position:"relative"},s[2]=n):n=s[2],s[3]===Symbol.for("react.memo_cache_sentinel")?(a={minHeight:0},s[3]=a):a=s[3],s[4]!==c?(o=(0,r.jsx)(m.Zp,{flex:"none",padding:2,shadow:1,style:n,children:(0,r.jsx)(m.so,{align:"center",style:a,children:c})}),s[4]=c,s[5]=o):o=s[5],o};function tp(e){return(0,y.createElement)(td,e)}let tf=(0,R.P)(m.so),th=(0,y.memo)((0,y.forwardRef)(function(e,t){let{dispatch:n,iframe:a,header:o,initialUrl:s,loadersConnection:l,overlaysConnection:c,viewport:d}=e,{t:u}=(0,x.Bdt)(v.Yi),{devMode:p}=(0,v.Qe)(),f=(0,m.jt)(),h=(0,y.useRef)(null),g=function(e){let t,n=(0,i.c)(2);return n[0]!==e?(t=()=>(0,r.jsx)(tu,{...e}),n[0]=e,n[1]=t):t=n[1],t}({...e,iframeRef:h,options:o});(0,y.useImperativeHandle)(t,()=>h.current);let b="loading"===a.status||"reloading"===a.status,[w,j]=(0,y.useState)(!1),_="refreshing"===a.status,[S,k]=(0,y.useState)(!1),E=b||_||"connecting"===c,C=(0,y.useCallback)(()=>{h.current&&(h.current.src=s.toString(),n({type:v.my}))},[n,s]),R=(0,y.useCallback)(()=>{I(!0)},[]),[$,I]=(0,y.useState)(!1),[P,M]=(0,y.useState)(!1);(0,y.useEffect)(()=>{if(!(b||_)&&("connecting"===c||"reconnecting"===c)){let e=setTimeout(()=>{M(!0)},5e3);return()=>clearTimeout(e)}},[c,b,_]),(0,y.useEffect)(()=>{if(!(b||_||!P)){if("connected"===c&&(k(!1),M(!1),j(!1),I(!1)),"connecting"===c){let e=setTimeout(()=>{j(!0),console.error("Unable to connect to visual editing. Make sure you've setup '@sanity/visual-editing' correctly")},v.Cw);return()=>clearTimeout(e)}if("reconnecting"===c){let e=setTimeout(()=>{j(!0),k(!0)},v.Cw);return()=>clearTimeout(e)}"disconnected"===c&&k(!0)}},[b,c,_,P]);let z=(0,y.useCallback)(()=>{n({type:v.cr})},[n]);(0,y.useEffect)(()=>{if(!h.current)return;let e=h.current;function t(){e===document.activeElement&&e.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0,cancelable:!0}))}return window.addEventListener("blur",t),()=>{window.removeEventListener("blur",t)}},[]);let L=(0,y.useMemo)(()=>(b||"connecting"===c&&"refreshing"!==a.status)&&!$,[$,a.status,b,c]),A=(0,y.useMemo)(()=>[L?"background":"active",b?"reloading":"idle",d,P&&!$?"timedOut":""],[$,b,L,P,d]);return(0,r.jsx)(O.x,{transition:f?{duration:0}:void 0,children:(0,r.jsxs)(m.vE,{delay:1e3,children:[(0,r.jsx)(g,{}),(0,r.jsx)(m.Zp,{flex:1,tone:"transparent",children:(0,r.jsxs)(m.so,{align:"center",height:"fill",justify:"center",padding:2*("desktop"!==d),sizing:"border",style:{position:"relative",cursor:E?"wait":void 0},children:[(0,r.jsx)(T.N,{children:S||b||_||!P||$?(b||"connecting"===c&&"refreshing"!==a.status)&&!$?(0,r.jsx)(tf,{initial:"initial",animate:"animate",exit:"exit",variants:tg,justify:"center",align:"center",style:{inset:"0",position:"absolute"},children:(0,r.jsxs)(m.so,{style:{...tm[d]},justify:"center",align:"center",direction:"column",gap:4,children:[(0,r.jsx)(m.y$,{muted:!0}
83),(0,r.jsx)(m.EY,{muted:!0,size:1,children:u("preview-frame.status",{context:"loading"})})]})}):S&&!$?(0,r.jsx)(tf,{initial:"initial",animate:"animate",exit:"exit",variants:ty,justify:"center",align:"center",style:{background:"var(--card-bg-color)",inset:"0",position:"absolute",borderTop:"1px solid transparent",boxShadow:"0 0 0 1px var(--card-border-color)"},children:(0,r.jsx)(ej,{flex:1,message:u("preview-frame.connection.error.text"),onRetry:C,onContinueAnyway:R,children:p&&(0,r.jsxs)(r.Fragment,{children:["connected"!==c&&(0,r.jsx)(m.Zp,{padding:3,radius:2,tone:"critical",children:(0,r.jsxs)(m.BJ,{space:3,children:[(0,r.jsx)(m.JU,{muted:!0,size:0,children:u("preview-frame.overlay.connection-status.label")}),(0,r.jsx)(m.Cy,{size:1,children:u("channel.status",{context:c})})]})}),"connected"!==l&&(0,r.jsx)(m.Zp,{padding:3,radius:2,tone:"critical",children:(0,r.jsxs)(m.BJ,{space:3,children:[(0,r.jsx)(m.JU,{muted:!0,size:0,children:u("preview-frame.loader.connection-status.label")}),(0,r.jsx)(m.Cy,{size:1,children:u("channel.status",{context:l})})]})})]})})}):null:(0,r.jsx)(tf,{initial:"initial",animate:"animate",exit:"exit",variants:tg,justify:"center",align:"center",style:{inset:"0",position:"absolute",backdropFilter:w?"blur(16px) saturate(0.5) grayscale(0.5)":"blur(2px)",transition:"backdrop-filter 0.2s ease-in-out",WebkitBackdropFilter:w?"blur(16px) saturate(0.5) grayscale(0.5)":"blur(2px)",WebkitTransition:"-webkit-backdrop-filter 0.2s ease-in-out",zIndex:1},children:(0,r.jsxs)(m.so,{style:{...tm[d]},justify:"center",align:"center",direction:"column",gap:4,children:[w&&(0,r.jsx)(m.$n,{disabled:!0,fontSize:1,mode:"ghost",text:u("preview-frame.continue-button.text"),style:{opacity:0}}),(0,r.jsx)(m.Zp,{radius:2,tone:w?"caution":"inherit",padding:4,shadow:1,children:(0,r.jsxs)(m.so,{justify:"center",align:"center",direction:"column",gap:4,children:[(0,r.jsx)(m.y$,{muted:!0}),(0,r.jsx)(m.EY,{muted:!0,size:1,children:u("preview-frame.status",w?{context:"timeout"}:{context:"connecting"})})]})}),w&&(0,r.jsx)(m.$n,{fontSize:1,tone:"critical",onClick:R,text:u("preview-frame.continue-button.text")})]})})}),(0,r.jsx)(e7,{animate:A,initial:["background"],onLoad:z,preventClick:L,ref:h,src:s.toString(),variants:tx})]})})]})})}));th.displayName="Memo(ForwardRef(Preview))";let tm={desktop:{width:"100%",height:"100%"},mobile:{width:375,height:650}},tg={initial:{opacity:1},animate:{opacity:[0,0,1]},exit:{opacity:[1,0,0]}},ty={initial:{opacity:1},animate:{opacity:[0,0,1]},exit:{opacity:[1,0,0]}},tx={desktop:{...tm.desktop,boxShadow:"0 0 0 0px var(--card-border-color)"},mobile:{...tm.mobile,boxShadow:"0 0 0 1px var(--card-border-color)"},background:{opacity:0,scale:1},idle:{scale:1},reloading:{scale:[1,1,1,.98]},active:{opacity:[0,0,1],scale:1},timedOut:{opacity:[0,0,1]}},tv=function(e){let t,n=(0,i.c)(4),{documentId:r,documentType:a,navigate:o,perspective:s,documentRevision:l}=e,c=(0,x.zX2)(r,a);return n[0]!==l||n[1]!==c||n[2]!==o?(t=e=>{let t;if("published"===e&&c.published){let{_updatedAt:e,_rev:n}=c.published;t=`${e}/${n}`}l!==t&&o({},{rev:t},!0)},n[0]=l,n[1]=c,n[2]=o,n[3]=t):t=n[3],function(e,t,n,r){let a,o,s=(0,i.c)(5),l=(0,y.useRef)(void 0),c=(0,Z.J)(t);s[0]!==c||void 0!==s[1]||s[2]!==e?(a=()=>{let t=l.current;if(l.current=e,e!==t)return c(e,t)},o=[c,void 0,e],s[0]=c,s[1]=r,s[2]=e,s[3]=a,s[4]=o):(a=s[3],o=s[4]),(0,y.useEffect)(a,o)}(s,t),null},tb=function(){let e=!1;return(...t)=>{e||(console.warn(...t),e=!0)}}();function tw(e,t){return e instanceof Function?e(t):e}function tj(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e&&""!==e&&null!==e))}function t_(){return new Set}function tS(e){return e()}let tk=Symbol();function tE(){let e,t,n,r,a=(0,i.c)(4);a[0]===Symbol.for("react.memo_cache_sentinel")?(e=new Map,a[0]=e):e=a[0];let[o,s]=(0,y.useState)(e);e:{let e=Array.from(o.values());if(e.find(tT)){t="connected";break e}let n=e.filter(tR);if(n.length){t=n.some(tC)?"connecting":"reconnecting";break e}t="idle"}let l=t;a[1]===Symbol.for("react.memo_cache_sentinel")?(n=e=>{s(t=>{let n=new Map(t);if("disconnected"===e.status)n.delete(e.channel);else{let t=n.get(e.channel)?.hasConnected||"connected"===e.status;n.set(e.channel,{status:e.status,hasConnected:t})}return n})},a[1]=n):n=a[1];let c=n;return a[2]!==l?(r=[l,c],a[2]=l,a[3]=r):r=a[3],r}function tC(e){let{hasConnected:t}=e;return!t}function tR(e){let{status:t}=e;return"handshaking"===t}function tT(e){let{status:t}=e;return"connected"===t}let tO=(0,y.lazy)(()=>n.e(9935).then(n.bind(n,69935)));(0,y.lazy)(()=>n.e(2232).then(n.bind(n,62232)));let t$=(0,y.lazy)(()=>n.e(7635).then(n.bind(n,97635))),tI=(0,y.lazy)(()=>n.e(3440).then(n.bind(n,53440))),tP=(0,y.lazy)(()=>n.e(1850).then(n.bind(n,91850))),tM=(0,y.lazy)(()=>n.e(6467).then(n.bind(n,56467))),tz=(0,y.lazy)(()=>n.e(2172).then(n.bind(n,12172))),tL=(0,y.lazy)(()=>n.e(4188).then(n.bind(n,84188))),tA=(0,_.I4)(m.so)` 84 overflow-x: auto; 85`;function tZ(e){let{canCreateUrlPreviewSecrets:t,canToggleSharePreviewAccess:n,canUseSharedPreviewAccess:a,tool:o}=e,s=o.options?.components,l=o.options?.previewUrl,p=o.name||v.P5,{unstable_navigator:f,unstable_header:h}=s||{},{navigate:g,state:_}=(0,j.rd)(),S=(0,x.$6H)(Object.fromEntries(_._searchParams||[])),k=function(e,t,n,r,a){let o=(0,x.tH7)({apiVersion:v.mG}),s=(0,x.VrO)(),l=s?.activeWorkspace?.basePath||"/",p=function(e,t,n,r){let a,o,s,l,c=(0,i.c)(12);c[0]!==r?(a=()=>r||"",c[0]=r,c[1]=a):a=c[1];let[d,u]=(0,y.useState)(a),p=(0,y.useRef)(0);c[2]!==d||c[3]!==r?(o=()=>
85{if(d&&r)return window.clearTimeout(p.current),()=>{p.current=window.setTimeout(()=>{u("")},100)}},s=[d,r],c[2]=d,c[3]=r,c[4]=o,c[5]=s):(o=c[4],s=c[5]),(0,y.useEffect)(o,s);let f=(0,x.iZK)(),h=f?.id;return c[6]!==t||c[7]!==d||c[8]!==h||c[9]!==e||c[10]!==n?(l=["@sanity/presentation",t,n,e,h,tk,d],c[6]=t,c[7]=d,c[8]=h,c[9]=e,c[10]=n,c[11]=l):l=c[11],l}(t,l,s?.activeWorkspace?.name||"default",r),f=function(e,t){let n,r,a,o,s=(0,i.c)(10);s[0]===Symbol.for("react.memo_cache_sentinel")?(n={apiVersion:v.mG},s[0]=n):n=s[0];let l=(0,x.tH7)(n),c=(0,x.iZK)(),[d,u]=(0,y.useState)("");s[1]!==l||s[2]!==c?.id||s[3]!==t||s[4]!==e||s[5]!==d?(r=e?(0,V.DY)(async()=>await q(l,"@sanity/presentation",typeof window>"u"?"":location.href,c?.id),[...t,d]):null,s[1]=l,s[2]=c?.id,s[3]=t,s[4]=e,s[5]=d,s[6]=r):r=s[6];let p=r;return s[7]!==p?(a=()=>{if(!p)return;let e=setTimeout(()=>{(0,y.startTransition)(()=>u(p.expiresAt.toString()))},p.expiresAt.getTime()-Date.now());return()=>clearTimeout(e)},o=[p],s[7]=p,s[8]=a,s[9]=o):(a=s[8],o=s[9]),(0,y.useEffect)(a,o),p?.secret||null}(a&&"object"==typeof e||"function"==typeof e,p);return(0,V.DY)(async()=>{if("string"==typeof e){let t=new URL(e,location.origin),n=t;try{if(r){let e=new URL(r,t);e.origin===t.origin&&(n=e)}}catch{}return location.origin===n.origin&&(n.pathname.startsWith(`${l}/`)||n.pathname===l)?t:n}let t=await ("object"==typeof e?function(e){let{draftMode:t,previewMode:n,origin:r=typeof location>"u"?"https://localhost":location.origin}=e,i=n?.enable||t?.enable,{preview:a="/"}=e,o=new URL(a,r),s=i?new URL(i,r):void 0;return async t=>{try{if(t.previewSearchParam){let e=new URL(t.previewSearchParam,o);e.origin===o.origin&&(a=`${e.pathname}${e.search}`)}}catch{}"u">typeof location&&location.origin===o.origin&&t.studioBasePath&&(a.startsWith(`${t.studioBasePath}/`)||a===t.studioBasePath)&&(a=e.preview||"/");let n=new URL(a,o);if(s){let e=new URL(s),{searchParams:r}=e;return r.set(c,t.previewUrlSecret),r.set(u,t.studioPreviewPerspective),n.pathname!==e.pathname&&r.set(d,`${n.pathname}${n.search}`),e.toString()}return n.toString()}}(e):e)({client:o,previewUrlSecret:f,studioPreviewPerspective:n,previewSearchParam:r,studioBasePath:l});return new URL(t,location.origin)},[...p,f])}(l||"/",p,"published"===S.perspective?"published":"previewDrafts",S.preview||null,t),E=(0,y.useMemo)(()=>l&&"object"==typeof l&&"draftMode"in l&&l.draftMode?(console.warn("previewUrl.draftMode is deprecated, use previewUrl.previewMode instead"),!1!==l.draftMode.shareAccess):!!l&&"object"==typeof l&&"previewMode"in l&&!!l.previewMode&&!1!==l.previewMode.shareAccess,[l]),[C]=(0,y.useState)(()=>{let e=o.options?.devMode;return"function"==typeof e?e():"boolean"==typeof e?e:"u">typeof window&&"localhost"===window.location.hostname}),R=(0,y.useMemo)(()=>k.origin,[k.origin]),T=(0,y.useRef)(null),[O,$]=(0,y.useState)(),[I,P]=(0,y.useState)(null),M=(0,y.useRef)({title:void 0,url:void 0}),{navigate:z,navigationHistory:L,params:A,searchParams:Z,structureParams:W}=function({initialPreviewUrl:e,routerNavigate:t,routerState:n,routerSearchParams:r,frameStateRef:i}){let a=(0,y.useMemo)(()=>{let{id:t,path:i,type:a}={id:function(e){if(void 0===e)return;let t=decodeURIComponent(e)?.split(".");return"drafts"===t[0]&&t.shift(),t.join(".")}(n.id),path:function(e){if(void 0!==e)return w.C.toString(function(e){let t=[];for(let n of e.split(".")){let e=N.exec(n);if(e){t.push(e[1],Number(e[2]));continue}let r=Y.exec(n);if(r){t.push(r[1],[Number(r[2]),Number(r[3])]);continue}let i=B.exec(n);if(i){t.push(i[1],{_key:i[2]});continue}t.push(n)}return t}(decodeURIComponent(e)))}(n.path),type:n.type};return{id:t,type:a,path:i,preview:r.preview||`${e.pathname}${e.search}`,perspective:r.perspective,viewport:r.viewport,inspect:r.inspect,rev:r.rev,since:r.since,template:r.template,templateParams:r.templateParams,view:r.view,pathKey:r.pathKey,instruction:r.instruction,comment:r.comment,changesInspectorTab:r.changesInspectorTab}},[n,r,e]),o=(0,y.useMemo)(()=>tj({inspect:a.inspect,path:a.path,rev:a.rev,since:a.since,template:a.template,templateParams:a.templateParams,view:a.view,pathKey:a.pathKey,instruction:a.instruction,comment:a.comment,changesInspectorTab:a.changesInspectorTab}),[a.changesInspectorTab,a.comment,a.inspect,a.instruction,a.path,a.pathKey,a.rev,a.since,a.template,a.templateParams,a.view]),s=(0,y.useMemo)(()=>
85tj({perspective:a.perspective,preview:a.preview,viewport:a.viewport}),[a.perspective,a.preview,a.viewport]),l=(0,y.useRef)(n);(0,y.useEffect)(()=>{l.current=n},[n]);let[c,d]=(0,y.useState)([n]);return{navigate:(0,y.useCallback)((e,n={},r)=>{e.id&&(e.id=(0,x.IMx)(e.id));let{_searchParams:a,...o}=l.current,s=(a||[]).reduce((e,[t,n])=>(e[t]=n,e),{}),c=tj({...o,...e}),u=tj({...s,...n});o.id!==c.id&&(delete u.template,delete u.templateParams),c._searchParams=Object.entries(u).reduce((e,[t,n])=>[...e,[t,n]],[]);let p=r??u.preview===i.current.url;d(e=>[...e,c]),t(c,{replace:p})},[t,i]),navigationHistory:c,params:a,searchParams:s,structureParams:o}}({initialPreviewUrl:k,routerNavigate:g,routerState:_,routerSearchParams:S,frameStateRef:M}),F=(0,y.useMemo)(()=>er(z,50),[z]),[J,K]=(0,y.useReducer)(v.dL,{},v.xe),G=(0,y.useMemo)(()=>A.perspective?"published":"previewDrafts",[A.perspective]),X=(0,y.useMemo)(()=>A.viewport?"mobile":"desktop",[A.viewport]),[ee,ea]=function(e,t){if("published"!==e&&"previewDrafts"!==e)throw Error(`Invalid perspective: ${e}`);let[n,r]=(0,y.useState)({}),[i,a]=(0,y.useState)({}),o=(0,y.useRef)(""),s=(0,y.useCallback)((e,n,i=[])=>{let s=i.filter(e=>"_projectId"in e&&e._projectId?(tb("Cross dataset references are not supported yet, ignoring source document",e),!1):e);("published"===n?r:a)(n=>{let r={};for(let e of s)r[e._id]=e;return o.current!==t.current.url?(o.current=t.current.url,{[e]:r}):U(n[e],r)?n:{...n,[e]:r}})},[t]);return[(0,y.useMemo)(()=>Object.values(Object.values("published"===e?n:i).reduce((e,t)=>(Object.values(t).forEach(t=>{e[t._id]=t}),e),{})),[e,i,n]),s]}(G,M),eo=(0,x.M91)(),el=(0,x.EL1)(),ec=function(e){let{navigate:t,navigationHistory:n,path:r,previewUrl:i,resolvers:a=[]}=e,{state:o}=(0,j.rd)(),s=(0,x.tH7)({apiVersion:v.mG}),[l,c]=(0,y.useState)(void 0),d=(0,y.useRef)(void 0),u=(0,y.useMemo)(()=>new URL(r||o._searchParams?.find(([e])=>"preview"===e)?.[1]||"","string"==typeof i?i:"object"==typeof i&&i?.origin||location.origin),[r,i,o._searchParams]),p=(0,y.useCallback)(()=>{c(void 0),d.current=void 0},[]);return(0,y.useEffect)(()=>{if(a.length&&u){let i;for(let e of a){let t=function(e,t){for(e of Array.isArray(e)?e:[e]){let n,r=e;if("string"==typeof e)try{let t=new URL(e);n=t.origin,r=t.pathname}catch{}if(!(n&&t.origin!==n))try{let e=(function(e,t){var n=[];return function(e,t,n){void 0===n&&(n={});var r=n.decode,i=void 0===r?function(e){return e}:r;return function(n){var r=e.exec(n);if(!r)return!1;for(var a=r[0],o=r.index,s=Object.create(null),l=1;l<r.length;l++)!function(e){if(void 0!==r[e]){var n=t[e-1];"*"===n.modifier||"+"===n.modifier?s[n.name]=r[e].split(n.prefix+n.suffix).map(function(e){return i(e,n)}):s[n.name]=i(r[e],n)}}(l);return{path:a,index:o,params:s}}}(function e(t,n,r){if(t instanceof RegExp){var i;if(!n)return t;for(var a=/\((?:\?<(.*?)>)?(?!\?)/g,o=0,s=a.exec(t.source);s;)n.push({name:s[1]||o++,prefix:"",suffix:"",modifier:"",pattern:""}),s=a.exec(t.source);return t}return Array.isArray(t)?(i=t.map(function(t){return e(t,n,r).source}),new RegExp("(?:".concat(i.join("|"),")"),H(r))):function(e,t,n){void 0===n&&(n={});for(var r=n.strict,i=void 0!==r&&r,a=n.start,o=n.end,s=n.encode,l=void 0===s?function(e){return e}:s,c=n.delimiter,d=n.endsWith,u="[".concat(D(void 0===d?"":d),"]|$"),p="[".concat(D(void 0===c?"/#?":c),"]"),f=void 0===a||a?"^":"",h=0;h<e.length;h++){var m=e[h];if("string"==typeof m)f+=D(l(m));else{var g=D(l(m.prefix)),y=D(l(m.suffix));if(m.pattern)if(t&&t.push(m),g||y)if("+"===m.modifier||"*"===m.modifier){var x="*"===m.modifier?"?":"";f+="(?:".concat(g,"((?:").concat(m.pattern,")(?:").concat(y).concat(g,"(?:").concat(m.pattern,"))*)").concat(y,")").concat(x)}else f+="(?:".concat(g,"(").concat(m.pattern,")").concat(y,")").concat(m.modifier);else{if("+"===m.modifier||"*"===m.modifier)throw TypeError('Can not repeat "'.concat(m.name,'" without a prefix and suffix'));f+="(".concat(m.pattern,")").concat(m.modifier)}else f+="(?:".concat(g).concat(y,")").concat(m.modifier)}}if(void 0===o||o)i||(f+="".concat(p,"?")),f+=n.endsWith?"(?=".concat(u,")"):"$";else{var v=e[e.length-1],b="string"==typeof v?p.indexOf(v[v.length-1])>-1:void 0===v;i||(f+="(?:".concat(p,"(?=").concat(u,"))?")),b||(f+="(?=".concat(p,"|").concat(u,")"))}return new RegExp(f,H(n))}(function(e,t){void 0===t&&(t={});for(var n=function(e){for(var t=[],n=0;n<e.length;){var r=e[n];if("*"===r||"+"===r||"?"===r){t.push({type:"MODIFIER",index:n,value:e[n++]});continue}if("\\"===r){t.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});continue}if("{"===r){t.push({type:"OPEN",index:n,value:e[n++]});continue}if("}"===r){t.push({type:"CLOSE",index:n,value:e[n++]});continue}if(":"===r){for(var i="",a=n+1;a<e.length;){var o=e.charCodeAt(a);if(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122||95===o){i+=e[a++];continue}break}if(!i)throw TypeError("Missing parameter name at ".concat(n));t.push({type:"NAME",index:n,value:i}),n=a;continue}if("("===r){var s=1,l="",a=n+1;if("?"===e[a])throw TypeError('Pattern cannot start with "?" at '.concat(a));for(;a<e.length;){if("\\"===e[a]){l+=e[a++]+e[a++];continue}if(")"===e[a]){if(0==--s){a++;break}}else if("("===e[a]&&(s++,"?"!==e[a+1]))throw TypeError("Capturing groups are not allowed at ".concat(a));l+=e[a++]}if(s)throw TypeError("Unbalanced pattern at ".concat(n));if(!l)throw TypeError("Missing pattern at ".concat(n));t.push({type:"PATTERN",index:n,value:l}),n=a;continue}t.push({type:"CHAR",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),t}(e),r=t.prefixes,i=void 0===r?"./":r,a=t.delimiter,o=void 0===a?"/#?":a,s=[],l=0,c=0,d="",u=function(e){if(c<n.length&&n[c].type===e)return n[c++].value},p=function(e){var t=u(e);if(void 0!==t)return t;var r=n[c],i=r.type,a=r.index;throw TypeError("Unexpected ".concat(i," at ").concat(a,", expected ").concat(e))},f=function(){for(var e,t="";e=u("CHAR")||u("ESCAPED_CHAR");)t+=e;return t},h=function(e){for(var t=0;t<o.length;t++){var n=o[t];if(e.indexOf(n)>-1)return!0}return!1},m=function(e){var t=s[s.length-1],n=e||(t&&"string"==typeof t?t:"");
85if(t&&!n)throw TypeError('Must have text between two parameters, missing text after "'.concat(t.name,'"'));return!n||h(n)?"[^".concat(D(o),"]+?"):"(?:(?!".concat(D(n),")[^").concat(D(o),"])+?")};c<n.length;){var g=u("CHAR"),y=u("NAME"),x=u("PATTERN");if(y||x){var v=g||"";-1===i.indexOf(v)&&(d+=v,v=""),d&&(s.push(d),d=""),s.push({name:y||l++,prefix:v,suffix:"",pattern:x||m(v),modifier:u("MODIFIER")||""});continue}var b=g||u("ESCAPED_CHAR");if(b){d+=b;continue}if(d&&(s.push(d),d=""),u("OPEN")){var v=f(),w=u("NAME")||"",j=u("PATTERN")||"",_=f();p("CLOSE"),s.push({name:w||(j?l++:""),pattern:w&&!j?m(v):j,prefix:v,suffix:_,modifier:u("MODIFIER")||""});continue}p("END")}return s}(t,r),n,r)}(e,n,t),n,t)})(r,{decode:decodeURIComponent})(t.pathname);if(e){let{params:t,path:r}=e;return{origin:n,params:t,path:r}}}catch{throw Error(`"${e}" is not a valid route pattern`)}}}(e.route,u);if(t){i={context:t,resolver:e};break}}if(i){var e,r;let a=function(e,t){if(e.resolve){let n=e.resolve(t)?.filter;return n?`*[${n}][0]{_id, _type}`:void 0}return"type"in e?`*[_type == "${e.type}"][0]{_id, _type}`:`*[${tw(e.filter,t)}][0]{_id, _type}`}(i.resolver,i.context),o=(e=i.resolver,r=i.context,e.resolve?e.resolve(r)?.params??r.params:"type"in e?{}:tw(e.params,r)??r.params);if(a){let e=new AbortController,r={perspective:"previewDrafts",signal:e.signal};return s.fetch(a,o,r).then(e=>{e&&d.current===e._id||(c({document:e,path:u.pathname}),d.current=e?._id,n.at(-1)?.id===n.at(-2)?.id&&t?.({id:e?._id,type:e?._type}))}).catch(e=>{e instanceof Error&&"AbortError"===e.name||(c({document:void 0,path:u.pathname}),d.current=void 0)}),()=>{e.abort()}}}}p()},[s,p,t,n,a,u]),l}({navigate:z,navigationHistory:L,path:A.preview,previewUrl:o.options?.previewUrl,resolvers:o.options?.resolve?.mainDocuments}),[ed,eu]=tE(),[ep,ef]=tE(),[eh,em]=tE(),{open:eg}=(e=>{let t,n,r,a,o,s,l=(0,i.c)(10),[c,d]=(0,y.useState)(t_);l[0]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{let t=window.open(e,"_blank");t&&d(e=>new Set(e).add(t))},l[0]=t):t=l[0];let u=t;return l[1]!==e||l[2]!==c?(n=()=>{let t=[];if(c.size&&e)for(let n of c)n&&"closed"in n&&!n.closed&&t.push(e.addTarget(n));return()=>{t.forEach(tS)}},r=[e,c],l[1]=e,l[2]=c,l[3]=n,l[4]=r):(n=l[3],r=l[4]),(0,y.useEffect)(n,r),l[5]!==c?(a=()=>{if(c.size){let e=setInterval(()=>{let e=new Set;for(let t of c)t&&"closed"in t&&t.closed&&e.add(t);e.size&&d(t=>{let n=new Set(t);for(let t of e)n.delete(t);return n})},v.M);return()=>{clearInterval(e)}}},o=[c],l[5]=c,l[6]=a,l[7]=o):(a=l[6],o=l[7]),(0,y.useEffect)(a,o),l[8]!==c?(s={popups:c,open:u},l[8]=c,l[9]=s):s=l[9],s})(O),ey="loading"===J.iframe.status;(0,y.useEffect)(()=>{let e=T.current?.contentWindow;if(!e||ey)return;let t=(0,b.dK)({targetOrigin:R});return t.addTarget(e),$(t),()=>{t.destroy(),$(void 0)}},[R,ey]),(0,y.useEffect)(()=>{if(!O)return;let e=O.createConnection({name:"presentation",heartbeat:!0,connectTo:"visual-editing"},(0,b.TH)().provide({actors:Q()}));e.on("visual-editing/focus",e=>{"id"in e&&F({type:e.type,id:e.id,path:e.path})}),e.on("visual-editing/navigate",e=>{let{title:t,url:n}=e;M.current.url!==n&&F({},{preview:n}),M.current={title:t,url:n}}),e.on("visual-editing/meta",e=>{M.current.title=e.title}),e.on("visual-editing/toggle",e=>{K({type:v.u5,enabled:e.enabled})}),e.on("visual-editing/documents",e=>{ea("visual-editing",e.perspective,e.documents)}),e.on("visual-editing/refreshing",e=>{"manual"===e.source?clearTimeout(e$.current):"mutation"===e.source&&K({type:v.iY})}),e.on("visual-editing/refreshed",()=>{K({type:v.cr})}),e.onStatus(eu);let t=e.start();return P(e),()=>{t(),P(null)}},[O,F,ea,eu,R]),(0,y.useEffect)(()=>{if(!O)return;let e=O.createConnection({name:"presentation",connectTo:"preview-kit",heartbeat:!0},(0,b.TH)().provide({actors:Q()}));return e.onStatus(em),e.on("preview-kit/documents",e=>{e.projectId===eo&&e.dataset===el&&ea("preview-kit",e.perspective,e.documents)}),e.start()},[O,el,eo,ea,em,R]);let ex=(0,y.useCallback)(e=>{F({path:w.C.toString(e)},{},!0)},[F]),ev=(0,y.useCallback)(e=>{let t=new URL(e,k.origin),n=t.pathname+t.search;t.origin===k.origin&&n!==A.preview&&F({},{preview:n})},[k,A,F]),eb=(0,y.useCallback)(e=>{F({},e)},[F]);(0,y.useEffect)(()=>{A.id&&A.path?I?.post({type:"presentation/focus",data:{id:A.id,path:A.path}}):I?.post({type:"presentation/blur",data:void 0})}
85,[A.id,A.path,I]),(0,y.useEffect)(()=>{M.current.url&&A.preview&&M.current.url!==A.preview&&(M.current.url=A.preview,"connected"!==ed&&T.current?T.current.src=`${R}${A.preview}`:I?.post({type:"presentation/navigate",data:{url:A.preview,type:"replace"}}))},[ed,R,A.preview,I]);let ej=(0,y.useCallback)(()=>I?.post({type:"presentation/toggle-overlay",data:void 0}),[I]),[e_,eS]=(0,y.useState)(null);(0,y.useEffect)(()=>{let e=e=>{en(e)&&ej()},t=e=>{en(e)&&ej(),["mod","\\"].every(t=>et[t]?e[et[t]]:e.key===t.toUpperCase())&&ej()};return window.addEventListener("keydown",t),window.addEventListener("keyup",e),()=>{window.removeEventListener("keydown",t),window.removeEventListener("keyup",e)}},[ej]);let[ek,eE]=(0,y.useState)(null),[{navigatorEnabled:eC,toggleNavigator:eR},eT]=function(e){let t,n,a,o,s=(0,i.c)(11),{unstable_navigator:l}=e,c=!!l?.component,[d,u]=function(e,t){let n,r,a,o,s=(0,i.c)(9);s[0]!==t||s[1]!==e?(n=()=>JSON.parse(localStorage.getItem(e)??JSON.stringify(t)),s[0]=t,s[1]=e,s[2]=n):n=s[2];let[l,c]=(0,y.useState)(n);return s[3]!==e||s[4]!==l?(r=()=>{localStorage.setItem(e,JSON.stringify(l))},a=[e,l],s[3]=e,s[4]=l,s[5]=r,s[6]=a):(r=s[5],a=s[6]),(0,y.useEffect)(r,a),s[7]!==l?(o=[l,c],s[7]=l,s[8]=o):o=s[8],o}("presentation/navigator",c),p=!!c&&d;e:{let e;if(!c){t=void 0;break e}s[0]!==u?(e=()=>u(e2),s[0]=u,s[1]=e):e=s[1],t=e}let f=t;s[2]!==p||s[3]!==l?(n=function(){return(0,r.jsx)(r.Fragment,{children:p&&(0,r.jsx)(e3,{...l})})},s[2]=p,s[3]=l,s[4]=n):n=s[4];let h=n;return s[5]!==p||s[6]!==f?(a={navigatorEnabled:p,toggleNavigator:f},s[5]=p,s[6]=f,s[7]=a):a=s[7],s[8]!==h||s[9]!==a?(o=[a,h],s[8]=h,s[9]=a,s[10]=o):o=s[10],o}({unstable_navigator:f}),eO=(0,y.useRef)(A.id);(0,y.useEffect)(()=>{A.rev&&eO.current&&A.id!==eO.current&&F({},{rev:void 0}),eO.current=A.id});let e$=(0,y.useRef)(),eI=(0,y.useCallback)(e=>{if(K({type:v.iY}),I){e$.current=window.setTimeout(e,300),I.post({type:"presentation/refresh",data:{source:"manual",livePreviewEnabled:"connected"===eh||"connected"===ep}});return}e()},[ep,eh,I]),eP=(0,x.hA9)(),eM=(0,y.useCallback)(({id:e,type:t,path:n})=>{if(M.current.url)return{title:M.current.title||M.current.url,name:"edit",params:{id:e,path:n,type:t,inspect:v.nH,workspace:eP.name,mode:v.cc,preview:A.preview}}},[A.preview,eP.name]),ez=(0,y.useCallback)(e=>{F({},{viewport:"desktop"===e?void 0:"mobile"},!0)},[F]),eL=(0,y.useCallback)(e=>{F({},{perspective:"previewDrafts"===e?void 0:e})},[F]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(e6,{devMode:C,name:p,navigate:F,params:A,searchParams:Z,structureParams:W,children:(0,r.jsx)(e1,{navigate:F,children:(0,r.jsx)(e4,{params:A,children:(0,r.jsx)(ei,{comlink:I,children:(0,r.jsx)(tA,{height:"fill",children:(0,r.jsxs)(ew,{children:[(0,r.jsx)(eT,{}),(0,r.jsx)(es,{id:"preview",minWidth:325,defaultSize:eC?50:75,order:3,children:(0,r.jsx)(m.so,{direction:"column",flex:1,height:"fill",ref:eE,children:(0,r.jsx)(m.EZ,{element:ek,children:(0,r.jsx)(th,{canSharePreviewAccess:E,canToggleSharePreviewAccess:n,canUseSharedPreviewAccess:a,dispatch:K,header:h,iframe:J.iframe,initialUrl:k,loadersConnection:ep,navigatorEnabled:eC,onPathChange:ev,onRefresh:eI,openPopup:eg,overlaysConnection:ed,previewUrl:A.preview,perspective:G,ref:T,setPerspective:eL,setViewport:ez,targetOrigin:R,toggleNavigator:eR,toggleOverlay:ej,viewport:X,visualEditing:J.visualEditing})})})}),(0,r.jsx)(e0,{documentId:A.id,documentsOnPage:ee,documentType:A.type,getCommentIntent:eM,mainDocumentState:ec,onFocusPath:ex,onStructureParams:eb,searchParams:Z,setDisplayedDocument:eS,structureParams:W})]})})})})})}),O&&(0,r.jsx)(y.Suspense,{children:(0,r.jsx)(tO,{controller:O,perspective:G,liveDocument:e_,onDocumentsOnPage:ea,onLoadersConnection:ef,documentsOnPage:ee})}),I&&A.id&&A.type&&(0,r.jsx)(y.Suspense,{children:(0,r.jsx)(tP,{comlink:I,id:A.id,type:A.type,loadersConnection:ep,previewKitConnection:eh})}),I&&(0,r.jsx)(y.Suspense,{children:(0,r.jsx)(tL,{comlink:I,perspective:G})}),I&&ee.length>0&&(0,r.jsx)(y.Suspense,{children:(0,r.jsx)(tz,{comlink:I,perspective:G,refs:ee})}),I&&(0,r.jsx)(y.Suspense,{children:(0,r.jsx)(t$,{comlink:I})}),I&&(0,r.jsx)(y.Suspense,{children:(0,r.jsx)(tI,{comlink:I})}),I&&(0,r.jsx)(y.Suspense,{children:(0,r.jsx)(tM,{comlink:I,perspective:G})}),A.id&&A.type&&(0,r.jsx)(tv,{documentId:A.id,documentRevision:A.rev,documentType:A.type,navigate:F,perspective:G})]})}var tU=Object.freeze({__proto__:null,default:function(e){let t,n,l,c,d,u=(0,i.c)(16),{t:p}=(0,x.Bdt)(v.Yi),{previewUrl:f}=e.tool.options??{},{push:h}=(0,m.dj)(),b="object"==typeof f||"function"==typeof f,w=(0,x.E9)(),[j,_]=(0,y.useState)(null),[S,k]=(0,y.useState)(null),[E,C]=(0,y.useState)(null),[R,T]=(0,y.useState)(null);u[0]!==w||u[1]!==b?(t=()=>{if(!b)return;let e=w.checkDocumentPermission("create",{_id:o,_type:s}).subscribe(_),t=w.checkDocumentPermission("update",{_id:o,_type:s}).subscribe(k),n=w.checkDocumentPermission("read",{_id:o,_type:s}).subscribe(C),r=w.checkDocumentPermission("create",{_id:`drafts.${(0,g.A)()}
85`,_type:a}).subscribe(T);return()=>{e.unsubscribe(),t.unsubscribe(),n.unsubscribe(),r.unsubscribe()}},n=[w,b],u[0]=w,u[1]=b,u[2]=t,u[3]=n):(t=u[2],n=u[3]),(0,y.useEffect)(t,n);let O=R?.granted;if(u[4]!==O||u[5]!==h||u[6]!==p||u[7]!==b?(l=()=>{if(!b||!1!==O)return;let e=requestAnimationFrame(()=>h({closable:!0,status:"error",duration:3e4,title:p("preview-url-secret.missing-grants")}));return()=>cancelAnimationFrame(e)},c=[O,h,p,b],u[4]=O,u[5]=h,u[6]=p,u[7]=b,u[8]=l,u[9]=c):(l=u[8],c=u[9]),(0,y.useEffect)(l,c),b&&(!j||typeof j.granted>"u"||!S||typeof S.granted>"u"||!R||!E||typeof E.granted>"u"||typeof R.granted>"u")){let e;return u[10]===Symbol.for("react.memo_cache_sentinel")?(e=(0,r.jsx)(v.gu,{}),u[10]=e):e=u[10],e}let $=!0===O,I=j?.granted===!0&&S?.granted===!0,P=E?.granted===!0;return u[11]!==e||u[12]!==$||u[13]!==I||u[14]!==P?(d=(0,r.jsx)(tZ,{...e,canCreateUrlPreviewSecrets:$,canToggleSharePreviewAccess:I,canUseSharedPreviewAccess:P}),u[11]=e,u[12]=$,u[13]=I,u[14]=P,u[15]=d):d=u[15],d}})},63872:(e,t,n)=>{n.d(t,{C:()=>l,w:()=>c});var r=n(22342),i=n(11748),a=n(53013),o=n(33670);let s=(0,o.createContext)(null);function l(e){let t,n,l,c,d=(0,i.c)(9),{children:u,setDisplayedDocument:p,documentId:f}=e;d[0]!==p?(t=e=>p(t=>a(t,e)?t:e),d[0]=p,d[1]=t):t=d[1];let h=t;return d[2]!==f||d[3]!==p?(n=()=>{if(f)return;let e=setTimeout(()=>p(null));return()=>clearTimeout(e)},l=[f,p],d[2]=f,d[3]=p,d[4]=n,d[5]=l):(n=d[4],l=d[5]),(0,o.useEffect)(n,l),d[6]!==u||d[7]!==h?(c=(0,r.jsx)(s.Provider,{value:h,children:u}),d[6]=u,d[7]=h,d[8]=c):c=d[8],c}function c(){return(0,o.useContext)(s)}},64531:(e,t,n)=>{n.d(t,{CC:()=>b,FS:()=>S,IM:()=>C,Rr:()=>E,TH:()=>O,Tx:()=>k,V2:()=>w,_K:()=>j,dK:()=>M,tP:()=>R,vd:()=>_});var r=n(11929),i=n(40609),a=n(86091),o=n(22233),s=n(40246),l=n(78242),c=n(34438),d=n(63704),u=n(89577),p=n(42764),f=n(82323),h=n(54560),m=n(16433),g=n(47211),y=n(43279);let x=e=>({context:t})=>{let{count:n,include:r,exclude:i,responseType:a="message.received"}=e;return{count:n,domain:t.domain,from:t.connectTo,include:r?Array.isArray(r)?r:[r]:[],exclude:i?Array.isArray(i)?i:[i]:[],responseType:a,target:t.target,to:t.name}},v=(0,l.v)(()=>(0,c.R)(window,"message")),b=e=>(0,i.OX)(({input:t})=>{let n;return v.pipe(e?(0,d.T)(e):(0,u.F)(),(0,p.p)((e=>t=>{let{data:n}=t;return(!e.include.length||e.include.includes(n.type))&&(!e.exclude.length||!e.exclude.includes(n.type))&&n.domain===e.domain&&n.from===e.from&&n.to===e.to&&(!e.target||t.source===e.target)})(t)),(0,d.T)((n=t.responseType,e=>({type:n,message:e}))),t.count?(0,u.F)((0,f.S)(t.count),(0,h.H)(e=>e),(0,m.s)(t.count)):(0,u.F)())}),w="sanity/comlink",j="comlink/response",_="comlink/heartbeat",S="comlink/disconnect",k="comlink/handshake/syn",E="comlink/handshake/syn-ack",C="comlink/handshake/ack",R=()=>(0,a.mj)({types:{},actors:{listen:(0,i.OX)(({input:e})=>{let t,n=e.signal?(0,c.R)(e.signal,"abort").pipe((t=`Request ${e.requestId} aborted`,e=>e.pipe((0,m.s)(1),(0,d.T)(()=>{throw Error(t)})))):g.w;return(0,c.R)(window,"message").pipe((0,p.p)(t=>t.data?.type===j&&t.data?.responseTo===e.requestId&&!!t.source&&e.sources.has(t.source)),(0,m.s)(e.sources.size),(0,y.Q)(n))})},actions:{"send message":({context:e},t)=>{let{sources:n,targetOrigin:r}=e,{message:i}=t;n.forEach(e=>{e.postMessage(i,{targetOrigin:r})})},"on success":(0,o.c)(({context:e})=>e.parentRef,({context:e,self:t})=>(e.response&&e.resolvable?.resolve(e.response),{type:"request.success",requestId:t.id,response:e.response,responseTo:e.responseTo})),"on fail":(0,o.c)(({context:e})=>e.parentRef,({context:e,self:t})=>(e.suppressWarnings||console.warn(`[@sanity/comlink] Received no response to message '${e.type}' on client '${e.from}' (ID: '${e.id}').`),e.resolvable?.reject(Error("No response received")),{type:"request.failed",requestId:t.id})),"on abort":(0,o.c)(({context:e})=>e.parentRef,({context:e,self:t})=>(e.resolvable?.reject(Error("Request aborted")),{type:"request.aborted",requestId:t.id}))},guards:{expectsResponse:({context:e})=>e.expectResponse},delays:{initialTimeout:0,responseTimeout:({context:e})=>e.responseTimeout??3e3}}).createMachine({context:({input:e})=>({connectionId:e.connectionId,data:e.data,domain:e.domain,expectResponse:e.expectResponse??!1,from:e.from,id:`msg-${(0,r.A)()}`,parentRef:e.parentRef,resolvable:e.resolvable,response:null,responseTimeout:e.responseTimeout,responseTo:e.responseTo,signal:e.signal,sources:e.sources instanceof Set?e.sources:new Set([e.sources]),suppressWarnings:e.suppressWarnings,targetOrigin:e.targetOrigin,to:e.to,type:e.type}),initial:"idle",on:{abort:".aborted"},states:{idle:{after:{initialTimeout:[{target:"sending"}]}},sending:{entry:{type:"send message",params:({context:e})=>{let{connectionId:t,data:n,domain:r,from:i,id:a,responseTo:o,to:s,type:l}=e;return{message:{connectionId:t,data:n,domain:r,from:i,id:a,to:s,type:l,responseTo:o}}}},always:[{guard:"expectsResponse",target:"awaiting"},"success"]},awaiting:{invoke:{id:"listen for response",src:"listen",input:({context:e})=>({requestId:e.id,sources:e.sources,signal:e.signal}),onError:"aborted"},after:{responseTimeout:"failed"},on:{message:{actions:(0,o.a)({response:({event:e})=>e.data.data,responseTo:({event:e})=>e.data.responseTo}),target:"success"}}},failed:{type:"final",entry:"on fail"},success:{type:"final",entry:"on success"},aborted:{type:"final",entry:"on abort"}},output:({context:e,self:t})=>({requestId:t.id,response:e.response,responseTo:e.responseTo})}),T=(0,i.SP)(({sendBack:e,input:t})=>{let n=()=>{e(t.event)};t.immediate&&n();let r=setInterval(n,t.interval);return()=>{clearInterval(r)}}),O=()=>(0,a.mj)({types:{},actors:{requestMachine:R(),listen:b(),sendBackAtInterval:T},actions:{"buffer message":(0,o.b)(({enqueue:e})=>{e.assign({buffer:({event:e,context:t})=>((0,a.DT)(e,"post"),[...t.buffer,e.data])}),e.emit(({event:e})=>((0,a.DT)(e,"post"),{type:"_buffer.added",message:e.data}))}),"create request":(0,o.a)({requests:({context:e,event:t,self:n,spawn:i})=>{(0,a.DT)(t,"request");let o=(Array.isArray(t.data)?t.data:[t.data]).map(t=>i("requestMachine",{id:`req-${(0,r.A)()}`,input:{connectionId:e.connectionId,data:t.data,domain:e.domain,expectResponse:t.expectResponse,from:e.name,parentRef:n,responseTo:t.responseTo,sources:e.target,targetOrigin:e.targetOrigin,to:e.connectTo,type:t.type}}));return[...e.requests,...o]}}),"emit received message":(0,o.b)(({enqueue:e})=>{e.emit(({event:e})=>((0,a.DT)(e,"message.received"),{type:"_message",message:e.message.data})),e.emit(({event:e})=>((0,a.DT)(e,"message.received"),{type:e.message.data.type,message:e.message.data}))}),"flush buffer":(0,o.b)(({enqueue:e})=>{e.raise(({context:e})=>({type:"request",data:e.buffer.map(({data:e,type:t})=>({data:e,type:t}))})),e.emit(({context:e})=>({type:"_buffer.flushed",messages:e.buffer})),e.assign({buffer:[]})}),post:(0,s.O)(({event:e})=>((0,a.DT)(e,"post"),{type:"request",data:{data:e.data.data,expectResponse:!0,type:e.data.type}})),"remove request":(0,o.b)(({context:e,enqueue:t,event:n})=>{(0,a.DT)(n,["request.success","request.failed","request.aborted"]),(0,s.R)(n.requestId),t.assign({requests:e.requests.filter(({id:e})=>e!==n.requestId)})}),respond:(0,s.O)(({event:e})=>((0,a.DT)(e,"response"),{type:"request",data:{data:e.data,type:j,responseTo:e.respondTo}})),"send handshake ack":(0,s.O)({type:"request",data:{type:C}}),"send disconnect":(0,s.O)(()=>({type:"request",data:{type:S}})),"send handshake syn":(0,s.O)({type:"request",data:{type:k}}),"set target":(0,o.a)({target:({event:e})=>((0,a.DT)(e,"target.set"),e.target)})},guards:{"has target":({context:e})=>!!e.target,"should send heartbeats":({context:e})=>e.heartbeat}}).createMachine({id:"channel",context:({input:e})=>({id:e.id||`${e.name}-${(0,r.A)()}`,buffer:[],connectionId:`cnx-${(0,r.A)()}`,connectTo:e.connectTo,domain:e.domain??w,heartbeat:e.heartbeat??!1,name:e.name,requests:[],target:e.target,targetOrigin:e.targetOrigin}),on:{"target.set":{actions:"set target"},"request.success":{actions:"remove request"},"request.failed":{actions:"remove request"}},initial:"idle",states:{idle:{on:{connect:{target:"handshaking",guard:"has target"},post:{actions:"buffer message"}}},handshaking:{id:"handshaking",invoke:[{id:"send syn",src:"sendBackAtInterval",input:()=>({event:{type:"syn"},interval:500,immediate:!0})},{id:"listen for handshake",src:"listen",input:e=>x({include:E,count:1})(e)}],on:{syn:{actions:"send handshake syn"},request:{actions:"create request"},post:{actions:"buffer message"},"message.received":{target:"connected"},disconnect:{target:"disconnected"}},exit:"send handshake ack"},connected:{entry:"flush buffer",invoke:{id:"listen for messages",src:"listen",input:x({exclude:[j,_]})},on:{post:{actions:"post"},request:{actions:"create request"},response:{actions:"respond"},"message.received":{actions:"emit received message"},disconnect:{target:"disconnected"}},initial:"heartbeat",states:{heartbeat:{initial:"checking",states:{checking:{always:{guard:"should send heartbeats",target:"sending"}},sending:{on:{"request.failed":{target:"#handshaking"}},invoke:{id:"send heartbeat",src:"sendBackAtInterval",input:()=>({event:{type:"post",data:{type:_,data:void 0}},interval:2e3,immediate:!1})}}}}}},disconnected:{id:"disconnected",entry:"send disconnect",on:{request:{actions:"create request"},post:{actions:"buffer message"},connect:{target:"handshaking",guard:"has target"}}}}}),$=(e,t=O())=>{let n=e.id||`${e.name}-${(0,r.A)()}`,i=(0,s.A)(t,{input:{...e,id:n}}),a=()=>{i.stop()};return{actor:i,connect:()=>{i.send({type:"connect"})},disconnect:()=>{i.send({type:"disconnect"})},id:n,name:e.name,machine:t,on:(e,t)=>{let{unsubscribe:n}=i.on(e,async e=>{let n=await t(e.message.data);n&&i.send({type:"response",respondTo:e.message.id,data:n})});return n},onStatus:e=>{let t=i.getSnapshot(),n="string"==typeof t.value?t.value:Object.keys(t.value)[0],{unsubscribe:r}=i.subscribe(t=>{let r="string"==typeof t.value?t.value:Object.keys(t.value)[0];n!==r&&(n=r,e(r))});return r},post:e=>{i.send({type:"post",data:e})},setTarget:e=>{i.send({type:"target.set",target:e})},start:()=>(i.start(),a),stop:a,get target(){return i.getSnapshot().context.target}}},I=e=>{e.disconnect(),setTimeout(()=>{e.stop()},0)},P=()=>{},M=e=>{let{targetOrigin:t}=e,n=new Set,r=new Set;return{addTarget:e=>{if(n.has(e))return P;if(!n.size||!r.size)return n.add(e),r.forEach(t=>
85{t.channels.forEach(t=>{t.setTarget(e),t.connect()})}),()=>{n.delete(e),r.forEach(t=>{t.channels.forEach(t=>{t.target===e&&t.disconnect()})})};n.add(e);let i=new Set;return r.forEach(n=>{let r=$({...n.input,target:e,targetOrigin:t},n.machine);i.add(r),n.channels.add(r),n.subscribers.forEach(({type:e,handler:t,unsubscribers:n})=>{n.push(r.on(e,t))}),n.internalEventSubscribers.forEach(({type:e,handler:t,unsubscribers:n})=>{n.push(r.actor.on(e,t).unsubscribe)}),n.statusSubscribers.forEach(({handler:e,unsubscribers:t})=>{t.push(r.onStatus(t=>e({channel:r.id,status:t})))}),r.start(),r.connect()}),()=>{n.delete(e),i.forEach(e=>{I(e),r.forEach(t=>{t.channels.delete(e)})})}},createConnection:(e,i=O())=>{let a={channels:new Set,input:e,internalEventSubscribers:new Set,machine:i,statusSubscribers:new Set,subscribers:new Set};r.add(a);let{channels:o,internalEventSubscribers:s,statusSubscribers:l,subscribers:c}=a;if(n.size)n.forEach(n=>{let r=$({...e,target:n,targetOrigin:t},i);o.add(r)});else{let n=$({...e,targetOrigin:t},i);o.add(n)}let d=()=>{let e=a.channels;e.forEach(I),e.clear(),r.delete(a)};return{on:(e,t)=>{let n=[];o.forEach(r=>{n.push(r.on(e,t))});let r={type:e,handler:t,unsubscribers:n};return c.add(r),()=>{n.forEach(e=>e()),c.delete(r)}},onInternalEvent:(e,t)=>{let n=[];o.forEach(r=>{n.push(r.actor.on(e,t).unsubscribe)});let r={type:e,handler:t,unsubscribers:n};return s.add(r),()=>{n.forEach(e=>e()),s.delete(r)}},onStatus:e=>{let t=[];o.forEach(n=>{t.push(n.onStatus(t=>e({channel:n.id,status:t})))});let n={handler:e,unsubscribers:t};return l.add(n),()=>{t.forEach(e=>e()),l.delete(n)}},post:e=>{o.forEach(t=>{t.post(e)})},start:()=>(o.forEach(e=>{e.start(),e.connect()}),d),stop:d}},destroy:()=>{r.forEach(({channels:e})=>{e.forEach(I),e.clear()}),r.clear(),n.clear()}}}},82323:(e,t,n)=>{n.d(t,{S:()=>s});var r=n(71450),i=n(96948),a=n(28400),o=n(12668);function s(e,t){return void 0===t&&(t=null),t=null!=t?t:e,(0,i.N)(function(n,i){var s=[],l=0;n.subscribe((0,a._)(i,function(n){var a,c,d,u,p=null;l++%t==0&&s.push([]);try{for(var f=(0,r.Ju)(s),h=f.next();!h.done;h=f.next()){var m=h.value;m.push(n),e<=m.length&&(p=null!=p?p:[]).push(m)}}catch(e){a={error:e}}finally{try{h&&!h.done&&(c=f.return)&&c.call(f)}finally{if(a)throw a.error}}if(p)try{for(var g=(0,r.Ju)(p),y=g.next();!y.done;y=g.next()){var m=y.value;(0,o.o)(s,m),i.next(m)}}catch(e){d={error:e}}finally{try{y&&!y.done&&(u=g.return)&&u.call(g)}finally{if(d)throw d.error}}},function(){var e,t;try{for(var n=(0,r.Ju)(s),a=n.next();!a.done;a=n.next()){var o=a.value;i.next(o)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}i.complete()},void 0,function(){s=null}))})}},93261:(e,t,n)=>{n.d(t,{C:()=>f,EH:()=>b,Hf:()=>x,IM:()=>m,Jt:()=>c,KT:()=>function e(t,n,r=[]){if(null!==t&&Array.isArray(t))return t.map((t,i)=>{if(j(t)){let a=t._key;if("string"==typeof a)return e(t,n,r.concat({_key:a,_index:i}))}return e(t,n,r.concat(i))});if(j(t)){if("block"===t._type||"span"===t._type){let i={...t};return"block"===t._type?i.children=e(t.children,n,r.concat("children")):"span"===t._type&&(i.text=e(t.text,n,r.concat("text"))),i}return Object.fromEntries(Object.entries(t).map(([t,i])=>[t,e(i,n,r.concat(t))]))}return n(t,r)},Nx:()=>S,YQ:()=>h,_y:()=>v,dI:()=>d,fO:()=>w,iz:()=>_});let r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/_key\s*==\s*['"](.*)['"]/,a=/^\d*:\d*$/;function o(e){return"number"==typeof e||"string"==typeof e&&/^\[\d+\]$/.test(e)}function s(e){return"string"==typeof e?i.test(e.trim()):"object"==typeof e&&"_key"in e}function l(e){if("string"==typeof e&&a.test(e))return!0;if(!Array.isArray(e)||2!==e.length)return!1;let[t,n]=e;return("number"==typeof t||""===t)&&("number"==typeof n||""===n)}function c(e,t,n){let r="string"==typeof t?u(t):t;if(!Array.isArray(r))throw Error("Path must be an array or a string");let i=e;for(let e=0;e<r.length;e++){let t=r[e];if(o(t)){if(!Array.isArray(i))return n;i=i[t]}if(s(t)){if(!Array.isArray(i))return n;i=i.find(e=>e._key===t._key)}if("string"==typeof t&&(i="object"==typeof i&&null!==i?i[t]:void 0),typeof i>"u")return n}return i}function d(e){if(!Array.isArray(e))throw Error("Path is not an array");
85return e.reduce((e,t,n)=>{let r=typeof t;if("number"===r)return`${e}[${t}]`;if("string"===r)return`${e}${0===n?"":"."}${t}`;if(s(t)&&t._key)return`${e}[_key=="${t._key}"]`;if(Array.isArray(t)){let[n,r]=t;return`${e}[${n}:${r}]`}throw Error(`Unsupported path segment \`${JSON.stringify(t)}\``)},"")}function u(e){if("string"!=typeof e)throw Error("Path is not a string");let t=e.match(r);if(!t)throw Error("Invalid path string");return t.map(p)}function p(e){return o(e)?Number(e.replace(/[^\d]/g,"")):s(e)?{_key:e.match(i)[1]}:l(e)?function(e){let[t,n]=e.split(":").map(e=>""===e?e:Number(e));return[t,n]}(e):e}var f=Object.freeze({__proto__:null,fromString:u,get:c,isIndexSegment:o,isIndexTuple:l,isKeySegment:s,reKeySegment:i,toString:d});let h="drafts.";function m(e){return e.startsWith(h)?e.slice(h.length):e}let g={"\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","'":"\\'","\\":"\\\\"},y={"\\f":"\f","\\n":` 86`,"\\r":"\r","\\t":" ","\\'":"'","\\\\":"\\"};function x(e){let t,n=[],r=/\['(.*?)'\]|\[(\d+)\]|\[\?\(@\._key=='(.*?)'\)\]/g;for(;null!==(t=r.exec(e));){if(void 0!==t[1]){let e=t[1].replace(/\\(\\|f|n|r|t|')/g,e=>y[e]);n.push(e);continue}if(void 0!==t[2]){n.push(parseInt(t[2],10));continue}if(void 0!==t[3]){let e=t[3].replace(/\\(\\')/g,e=>y[e]);n.push({_key:e,_index:-1});continue}}return n}function v(e){return e.map(e=>{if("string"==typeof e||"number"==typeof e)return e;if(""!==e._key)return{_key:e._key};if(-1!==e._index)return e._index;throw Error(`invalid segment:${JSON.stringify(e)}`)})}function b(e){return("string"==typeof e?u(e):e).map(e=>{var t;if("string"==typeof e||"number"==typeof e)return e;if(Array.isArray(e))throw Error(`IndexTuple segments aren't supported:${JSON.stringify(e)}`);if("object"==typeof(t=e)&&"_key"in t&&"_index"in t)return e;if(e._key)return{_key:e._key,_index:-1};throw Error(`invalid segment:${JSON.stringify(e)}`)})}function w(e,t){var n;if(!t?.mappings)return;let r=(n=e.map(e=>{if("string"==typeof e||"number"==typeof e)return e;if(-1!==e._index)return e._index;throw Error(`invalid segment:${JSON.stringify(e)}`)}),`$${n.map(e=>"string"==typeof e?`['${e.replace(/[\f\n\r\t'\\]/g,e=>g[e])}']`:"number"==typeof e?`[${e}]`:""!==e._key?`[?(@._key=='${e._key.replace(/['\\]/g,e=>g[e])}')]`:`[${e._index}]`).join("")}`);if(void 0!==t.mappings[r])return{mapping:t.mappings[r],matchedPath:r,pathSuffix:""};let i=Object.entries(t.mappings).filter(([e])=>r.startsWith(e)).sort(([e],[t])=>t.length-e.length);if(0==i.length)return;let[a,o]=i[0],s=r.substring(a.length);return{mapping:o,matchedPath:a,pathSuffix:s}}function j(e){return"object"==typeof e&&null!==e}function _(e){let{baseUrl:t,workspace:n="default",tool:r="default",id:i,type:a,path:o,projectId:s,dataset:l}=e;if(!t)throw Error("baseUrl is required");if(!o)throw Error("path is required");if(!i)throw Error("id is required");if("/"!==t&&t.endsWith("/"))throw Error("baseUrl must not end with a slash");let c="default"===n?void 0:n,u="default"===r?void 0:r,p=m(i),f=Array.isArray(o)?d(v(o)):o,g=new URLSearchParams({baseUrl:t,id:p,type:a,path:f});c&&g.set("workspace",c),u&&g.set("tool",u),s&&g.set("projectId",s),l&&g.set("dataset",l),i.startsWith(h)&&g.set("isDraft","");let y=["/"===t?"":t];c&&y.push(c);let x=["mode=presentation",`id=${p}`,`type=${a}`,`path=${encodeURIComponent(f)}`];return u&&x.push(`tool=${u}`),y.push("intent","edit",`${x.join(";")}?${g}`),y.join("/")}function S(e){let{resultSourceMap:t,resultPath:n}=e,{mapping:r,pathSuffix:i}=w(n,t)||{};if(!r||"literal"===r.source.type||"unknown"===r.source.type)return;let a=t.documents[r.source.document],o=t.paths[r.source.path];if(a&&o){var s;let t,{baseUrl:n,workspace:r,tool:l}=("/"!==(t="string"==typeof(s="function"==typeof e.studioUrl?e.studioUrl(a):e.studioUrl)?s:s.baseUrl)&&(t=t.replace(/\/$/,"")),"string"==typeof s?{baseUrl:t}:{...s,baseUrl:t});if(!n)return;let{_id:c,_type:d,_projectId:u,_dataset:p}=a;return{baseUrl:n,workspace:r,tool:l,id:c,type:d,path:x(o+i),projectId:u,dataset:p}}}}}]);
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.