PageSourceSearch

https://www.linkrush.co.uk/_next/static/chunks/62.4ef38e80bcc0deab.js

js linkrush.co.uk collected 2026-10-05 07:56:49 UTC 116,872 bytes, 214 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[62],{20062:function(e,t,n){let r,i;n.r(t),n.d(t,{default:function(){return iR}});var o,a,s,l=n(99614),u=n(4713),c=n(99971);let d={"handshake/syn":c.bK,"handshake/syn-ack":c.Ol,"handshake/ack":c.ei,"channel/response":c.Ag,"channel/heartbeat":c.UE,"channel/disconnect":c.Hq,"overlay/focus":"visual-editing/focus","overlay/navigate":"visual-editing/navigate","overlay/toggle":"visual-editing/toggle","presentation/toggleOverlay":"presentation/toggle-overlay"},p={[c.bK]:"handshake/syn",[c.Ol]:"handshake/syn-ack",[c.ei]:"handshake/ack",[c.Ag]:"channel/response",[c.UE]:"channel/heartbeat",[c.Hq]:"channel/disconnect","visual-editing/focus":"overlay/focus","visual-editing/navigate":"overlay/navigate","visual-editing/toggle":"overlay/toggle","presentation/toggle-overlay":"presentation/toggleOverlay"},f=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=c.yK),"overlays"===t.to&&(t.to="visual-editing"),"overlays"===t.from&&(t.from="visual-editing"),t.channelId=t.connectionId,delete t.connectionId,t.type=d[t.type]??t.type),e},m=e=>{let{channelId:t,...n}=e,r={...n,connectionId:t};return r.domain===c.yK&&(r.domain="sanity/channels"),"visual-editing"===r.to&&(r.to="overlays"),"visual-editing"===r.from&&(r.from="overlays"),r.type=p[r.type]??r.type,"channel/response"===r.type&&r.responseTo&&!r.data&&(r.data={responseTo:r.responseTo}),("handshake/syn"===r.type||"handshake/syn-ack"===r.type||"handshake/ack"===r.type)&&(r.data={id:r.connectionId}),r},y=({context:e},t)=>{let{sources:n,targetOrigin:r}=e,i=m(t.message);n.forEach(e=>{e.postMessage(i,{targetOrigin:r})})},h=()=>({listen:(0,c.F8)(f),requestMachine:(0,c.lB)().provide({actions:{"send message":y}})});function g(){return window.self!==window.top}function v(){return!!window.opener}var b=n(14610),w=n(92125);let x=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,E=/_key\s*==\s*['"](.*)['"]/,k=/^\d*:\d*$/;function j(e){return"number"==typeof e||"string"==typeof e&&/^\[\d+\]$/.test(e)}function _(e){return"string"==typeof e?E.test(e.trim()):"object"==typeof e&&"_key"in e}function I(e){if("string"==typeof e&&k.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 S(e){if(!Array.isArray(e))throw Error("Path is not an array");return e.reduce((e,t,n)=>{let r=typeof t;if("number"===r)return`${e}[${t}]`;if("string"===r)return`${e}${0===n?"":"."}${t}`;if(_(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 M(e){if("string"!=typeof e)throw Error("Path is not a string");let t=e.match(x);if(!t)throw Error("Invalid path string");return t.map(C)}function C(e){return j(e)?Number(e.replace(/[^\d]/g,"")):_(e)?{_key:e.match(E)[1]}:I(e)?function(e){let[t,n]=e.split(":").map(e=>""===e?e:Number(e));return[t,n]}(e):e}var $=Object.freeze({__proto__:null,fromString:M,get:function(e,t,n){let r="string"==typeof t?M(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(j(t)){if(!Array.isArray(i))return n;i=i[t]}if(_(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},isIndexSegment:j,isIndexTuple:I,isKeySegment:_,reKeySegment:E,toString:S});let A="drafts.";function O(e){return e.startsWith(A)}function T(e){return e.startsWith("versions.")}function R(e){return T(e)?A+P(e):O(e)?e:A+e}function P(e){return T(e)?e.split(".").slice(2).join("."):O(e)?e.slice(A.length):e}var L=n(84587),N=n(49113);function z(e){return e.split(/[[.\]]/g).filter(Boolean).map(e=>e.includes("==")?function(e){let[t,n]=e.split("==");if("_key"!==t)throw Error(`Currently only "_key" is supported as path segment. Found ${t}`);if(typeof n>"u")throw Error('Invalid path segment, expected `key=="value"`');return{_key:n.replace(/^['"]/,"").replace(/['"]$/,"")}}(e):D.test(e)?Number(e):e)}let D=/^-?\d+$/,Z=/^[a-z_$]+/;function U(e){return e.map((e,t)=>{var n;return n=0===t,Array.isArray(e)?`[${e[0]}:${e[1]||""}]`:"number"==typeof e?`[${e}
1]`:"object"==typeof e&&"_key"in e&&"string"==typeof e._key?`[_key==${JSON.stringify(e._key)}]`:"string"==typeof e&&Z.test(e)?n?e:`.${e}`:`['${e}']`}).join("")}function V(e){if("createIfNotExists"in e)return{type:"createIfNotExists",document:e.createIfNotExists};if("createOrReplace"in e)return{type:"createOrReplace",document:e.createOrReplace};if("create"in e)return{type:"create",document:e.create};if("delete"in e)return{id:e.delete.id,type:"delete"};if("patch"in e){var t,n;return{type:"patch",id:e.patch.id,patches:[..."set"in(n=t=e.patch)?Object.keys(n.set).map(e=>({path:z(e),op:{type:"set",value:n.set[e]}})):[],..."setIfMissing"in t?Object.keys(t.setIfMissing).map(e=>({path:z(e),op:{type:"setIfMissing",value:t.setIfMissing[e]}})):[],..."unset"in t?t.unset.map(e=>({path:z(e),op:{type:"unset"}})):[],..."inc"in t?Object.keys(t.inc).map(e=>({path:z(e),op:{type:"inc",amount:t.inc[e]}})):[],..."inc"in t?Object.keys(t.dec).map(e=>({path:z(e),op:{type:"dec",amount:t.dec[e]}})):[],...function(e){if(!("insert"in e))return[];let t=function(e){let t=F.filter(t=>t in e);if(t.length>1)throw Error(`Insert patch is ambiguous. Should only contain one of: ${F.join(", ")}, instead found ${t.join(", ")}`);return t[0]}(e.insert);if(!t)throw Error("Insert patch missing position");let n=z(e.insert[t]),r=n.pop();return[{path:n,op:{type:"insert",position:t,referenceItem:r,items:e.insert.items}}]}(t)]}}throw Error(`Unknown mutation: ${JSON.stringify(e)}`)}let F=["before","replace","after"];function W(e){return q(e)}function Y(e){return e.flatMap(W)}function q(e){if("create"===e.type||"createIfNotExists"===e.type||"createOrReplace"===e.type)return{[e.type]:e.document};if("delete"===e.type)return{delete:{id:e.id}};let t=e.options?.ifRevision;return e.patches.map(n=>({patch:{id:e.id,...t&&{ifRevisionID:t},...function(e){let{path:t,op:n}=e;if("unset"===n.type)return{unset:[U(t)]};if("insert"===n.type)return{insert:{[n.position]:U([...t,n.referenceItem]),items:n.items}};if("diffMatchPatch"===n.type)return{diffMatchPatch:{[U(t)]:n.value}};if("inc"===n.type)return{inc:{[U(t)]:n.amount}};if("dec"===n.type)return{dec:{[U(t)]:n.amount}};if("set"===n.type||"setIfMissing"===n.type)return{[n.type]:{[U(t)]:n.value}};if("truncate"===n.type){let e=[n.startIndex,"number"==typeof n.endIndex?n.endIndex:""].join(":");return{unset:[`${U(t)}[${e}]`]}}if("upsert"===n.type)return{unset:n.items.map(e=>U([...t,{_key:e._key}])),insert:{[n.position]:U([...t,n.referenceItem]),items:n.items}};if("assign"===n.type)return{set:Object.fromEntries(Object.keys(n.value).map(e=>[U(t.concat(e)),n.value[e]]))};if("unassign"===n.type)return{unset:n.keys.map(e=>U(t.concat(e)))};if("replace"===n.type)return{insert:{replace:U(t.concat(n.referenceItem)),items:n.items}};if("remove"===n.type)return{unset:[U(t.concat(n.referenceItem))]};throw Error(`Unknown operation type ${n.type}`)}(n)}}))}function G(e){return Array.isArray(e)?e:[e]}var B=Object.freeze({__proto__:null,decode:function(e){return V(e)},decodeAll:function(e){return e.map(V)},encode:W,encodeAll:Y,encodeMutation:q,encodeTransaction:function(e){return{transactionId:e.id,mutations:Y(e.mutations)}}});function H(e,t,n){return{type:"insert",referenceItem:n,position:t,items:G(e)}}function K(e,t){return{type:"truncate",startIndex:e,endIndex:t}}function J(e){return{type:"remove",referenceItem:e}}function X(e,t){return{path:"string"==typeof e?z(e):e,op:t}}var Q=n(98442);let ee=(0,Q.ah)(),et=ee,en=new Set;var er=n(62928);let ei=/_key\s*==\s*['"](.*)['"]/,eo=/^\d*:\d*$/;function ea(e){return"number"==typeof e||"string"==typeof e&&/^\[\d+\]$/.test(e)}function es(e){return"string"==typeof e?ei.test(e.trim()):"object"==typeof e&&"_key"in e}let el=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,eu=/_key\s*==\s*['"](.*)['"]/;function ec(e,t,n){let r="string"==typeof t?function(e){if("string"!=typeof e)throw Error("Path is not a string");let t=e.match(el);if(!t)throw Error("Invalid path string");return t.map(ed)}(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(ea(t)){if(!Array.isArray(i))return n;i=i[t]}if(es(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 ed(e){return ea(e)?Number(e.replace(/[^\d]/g,"")):es(e)?{_key:e.match(eu)[1]}:!function(e){if("string"==typeof e&&eo.test(e))return!0;
1if(!Array.isArray(e)||2!==e.length)return!1;let[t,n]=e;return("number"==typeof t||""===t)&&("number"==typeof n||""===n)}(e)?e:function(e){let[t,n]=e.split(":").map(e=>""===e?e:Number(e));return[t,n]}(e)}function ep(){return(0,b.useSyncExternalStore)(ey,em,ef)}function ef(){return ee}function em(){return et}function ey(e){return en.add(e),()=>en.delete(e)}function eh(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>{e.apply(e,r)},t)}}function eg(e,t){let n=g(),r=v();if(t===ee||!n&&!r)throw Error("The `useDocuments` hook cannot be used in this context");let i=R(e),o=P(e),a=t.getSnapshot().context?.documents,s=a?.[i],l=a?.[o],u=s||l;if(!u)throw Error(`Document "${e}" not found`);let c=s.getSnapshot().context?.local||l.getSnapshot().context?.local,d=new Promise(e=>{if(c)e(c);else{let t=u.on("ready",n=>{let{snapshot:r}=n;e(r||null),t.unsubscribe()})}});return{draftDoc:s,draftId:i,getSnapshot:()=>d,publishedDoc:l,publishedId:o,get snapshot(){if(!c)throw Error(`Snapshot for document "${e}" not found`);return c}}}function ev(){let e,t,n;let r=(0,u.c)(7),i=ep();r[0]!==i?(e=e=>({id:e,commit:()=>{let{draftDoc:t}=eg(e,i);t.send({type:"submit"})},get:t=>{let{snapshot:n}=eg(e,i);return t?ec(n,t):n},getSnapshot:function(e,t){let{getSnapshot:n}=eg(e,t);return n}(e,i),patch:async(t,n)=>{let r=eg(e,i),{draftDoc:o,draftId:a,getSnapshot:s,publishedId:l}=r,{commit:u=!0}=n||{},c=await ("function"==typeof t?t({draftId:a,publishedId:l,get snapshot(){return r.snapshot},getSnapshot:s}):t),d=await s();if(!d)throw Error(`Snapshot for document "${e}" not found`);o.send({type:"mutate",mutations:[{type:"createIfNotExists",document:{...d,_id:a}},{type:"patch",id:a,patches:G(c)}]}),u&&("object"==typeof u&&"debounce"in u?eh(()=>o.send({type:"submit"}),u.debounce)():o.send({type:"submit"}))}}),r[0]=i,r[1]=e):e=r[1];let o=e;r[2]!==i?(t=(e,t,n)=>{let{draftDoc:r}=eg(e,i),{commit:o}=n||{},a=void 0===o||o;r.send({type:"mutate",mutations:t}),a&&("object"==typeof a&&"debounce"in a?eh(()=>r.send({type:"submit"}),a.debounce)():r.send({type:"submit"}))},r[2]=i,r[3]=t):t=r[3];let a=t;return r[4]!==o||r[5]!==a?(n={getDocument:o,mutateDocument:a},r[4]=o,r[5]=a,r[6]=n):n=r[6],n}let eb=()=>{if(i)return i;i=[];for(let e=0;e<256;++e)i[e]=(e+256).toString(16).slice(1);return i};function ew(e){let t=eb();return(function(e=16){let t=new Uint8Array(e);return(0,er.Z)(t),t})(e).reduce((e,n)=>e+t[n],"").slice(0,e)}function ex(e){let t,n;let r="string"==typeof e?e:e.path,i=r.lastIndexOf("."),o=r.substring(i+1,r.length);if(!o.indexOf("["))throw Error("Invalid path: not an array");let a=r.lastIndexOf("["),s=r.substring(0,a);if(o.includes("_key")){let e=o.indexOf('"')+1,r=o.indexOf('"',e);t=o.substring(e,r),n=!0}else{let e=o.indexOf("[")+1,r=o.indexOf("]",e);t=o.substring(e,r),n=!1}if(!s||!t)throw Error("Invalid path");return{path:s,key:t,hasExplicitKey:n}}async function eE(e,t,n){if(!e.type)throw Error("Node type is missing");let{path:r,key:i}=ex(e),o=await t.getSnapshot(),a=ec(o,r),s=ec(o,e.path),l=a.findIndex(e=>e._key===i),u=-1,c="before";if("first"===n){if(0===l)return[];u=0,c="before"}else if("last"===n){if(l===a.length-1)return[];u=-1,c="after"}else if("next"===n){if(l===a.length-1)return[];u=l,c="after"}else if("previous"===n){if(0===l)return[];u=l-1,c="before"}return[X(r,K(l,l+1)),X(r,H(s,c,u))]}var ek=n(26176);let ej=(0,ek.zGw)((0,ek.Z_8)(),(0,ek.EiV)(1)),e_=(0,ek.jtO)(ej),eI=(0,ek.Ryn)({baseUrl:ej,dataset:e_,id:ej,path:ej,projectId:e_,tool:e_,type:e_,workspace:e_,perspective:(0,ek.tvc)((0,ek.Z_8)(),"drafts")}),eS=/^([\w-]+):(0|[1-9][0-9]*)$/,eM=/^([\w-]+):([0-9]+),([0-9]+)$/,eC=/^([\w-]+):([\w-]+)$/,e$=(0,ek.zGw)((0,ek.Z_8)(),(0,ek.EiV)(1)),eA=(0,ek.Ryn)({origin:e$,href:e$,data:(0,ek.jtO)((0,ek.IMB)((0,ek.Z_8)(),(0,ek._4T)()))});function eO(e){let t=(0,ek.AsG)(eI,e);if(t.success)return t.output;let n=(0,ek.AsG)(eA,e);if(n.success)try{let e=new URL(n.output.href,typeof document>"u"?"https://example.com":location.origin);return e.searchParams.size>0?(0,ek.Qc3)(eI,Object.fromEntries(e.searchParams.entries())):n.output}catch(e){return console.error("Failed to parse sanity node",e),n.output}}var eT={0:8203,1:8204,2:8205,3:8290,4:8291,5:8288,6:65279,7:8289,8:119155,9:119156,a:119157,b:119158,c:119159,d:119160,e:119161,f:119162},eR={0:8203,1:8204,2:8205,3:65279},eP=[,,,,].fill(String.fromCodePoint(eR[0])).join(""),eL=Object.fromEntries(Object.entries(eR).map(e=>e.reverse())),eN=Object.fromEntries(Object.entries(eT).map(e=>e.reverse())),ez=`${Object.values(eT).map(e=>`\\u{${e.toString(16)}}`).join("")}`,eD=RegExp(`[${ez}]{4,}`,"gu");let eZ=[];for(let e=0;e<256;++e)eZ.push((e+256).toString(16).slice(1));let eU=new Uint8Array(16);var eV={randomUUID:"u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function eF(e,t,n){if(eV.randomUUID&&!e)return eV.randomUUID();let i=(e=e||{}).random??e.rng?.()??function(){if(!r){if(typeof crypto>"u"||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");r=crypto.getRandomValues.bind(crypto)}return r(eU)}();if(i.length<16)throw Error("Random bytes length must be >= 16");return i[6]=15&i[6]|64,i[8]=63&i[8]|128,function(e,t=0){return(eZ[e[t+0]]+eZ[e[t+1]]+eZ[e[t+2]]+eZ[e[t+3]]+"-"+eZ[e[t+4]]+eZ[e[t+5]]+"-"+eZ[e[t+6]]+eZ[e[t+7]]+"-"+eZ[e[t+8]]+eZ[e[t+9]]+"-"+eZ[e[t+10]]+eZ[e[t+11]]+eZ[e[t+12]]+eZ[e[t+13]]+eZ[e[t+14]]+eZ[e[t+15]]).toLowerCase()}(i)}function eW(e){let t=e.getBoundingClientRect();return{x:t.x+scrollX,y:t.y+scrollY,w:t.width,h:t.height}}function eY(e,t,n){return"x"===n?{x:e.x+t,y:e.y,w:e.w-2*t,h:e.h}:{x:e.x,y:e.y+t,w:e.w,h:e.h-2*t}}function eq(e,t){return e.x===t.x&&e.y===t.y&&e.w===t.w&&e.h===t.h}function eG(e,t){let n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)}function eB(e,t,n){let r,i;let o={x:e.x1,y:e.y1};if(t.some(e=>(function(e,t){let n=e.x>=t.x&&e.x<=t.x+t.w,r=e.y>=t.y&&e.y<=t.y+t.h;return n&&r})(o,eY(e,Math.min(e.w,e.h)/10,"horizontal"===n?"x":"y"))))return null;for(let a of t){let t=function(e,t){let n=[{x1:t.x,y1:t.y,x2:t.x+t.w,y2:t.y},{x1:t.x+t.w,y1:t.y,x2:t.x+t.w,y2:t.y+t.h},{x1:t.x+t.w,y1:t.y+t.h,x2:t.x,y2:t.y+t.h},{x1:t.x,y1:t.y+t.h,x2:t.x,y2:t.y}],r=[];for(let t=0;t<n.length;t++){let i=function(e,t){let{x1:n,y1:r,x2:i,y2:o}=e,{x1:a,y1:s,x2:l,y2:u}=t;if(n===i&&r===o||a===l&&s===u)return!1;let c=(u-s)*(i-n)-(l-a)*(o-r);if(0===c)return!1;let d=((l-a)*(r-s)-(u-s)*(n-a))/c,p=((i-n)*(r-s)-(o-r)*(n-a))/c;return!(d<0)&&!(d>1)&&!(p<0)&&!(p>1)&&{x:n+d*(i-n),y:r+d*(o-r)}}(e,n[t]);if(i){let e=!1;for(let t=0;t<r.length;t++)r[t].x===i.x&&r[t].y===i.y&&(e=!0);e||r.push(i)}}return 0!==r.length&&r.sort((t,n)=>eG(t,{x:e.x1,y:e.y1})-eG(n,{x:e.x1,y:e.y1}))}(e,eY(a,Math.min(a.w,a.h)/10,"horizontal"===n?"x":"y"));if(t){let e=t[0];r?eG(o,e)<eG(o,r)&&(r=e,i=a):(r=e,i=a)}}return i||null}function eH(e,t,n){let{x:r,y:i,w:o,h:a}=e,{x:s,y:l}=n;return{x:s+(r-s)*t,y:l+(i-l)*t,w:o*t,h:a*t}}function eK(e){let t=Math.max(0,Math.min(...e.map(e=>e.y))),n=Math.min(document.body.scrollHeight,Math.max(...e.map(e=>e.y+e.h)));return{min:t,max:n,height:n-t}}function eJ(e,t){return t.find(t=>eq(eW(t.elements.element),e))?.sanity}function eX(e,t,n){return Object.values(t).every(e=>null===e)?null:"horizontal"===n?{left:t.left?{rect:t.left,sanity:eJ(t.left,e)}:null,right:t.right?{rect:t.right,sanity:eJ(t.right,e)}:null}:{top:t.top?{rect:t.top,sanity:eJ(t.top,e)}:null,bottom:t.bottom?{rect:t.bottom,sanity:eJ(t.bottom,e)}:null}}function eQ(e){let t=document.body.getBoundingClientRect();return{x:Math.max(t.x,Math.min(e.clientX,t.x+t.width)),y:e.clientY+window.scrollY}}function e0(e,t,n){let r=eW(t),i=[...t.querySelectorAll(":where(h1, h2, h3, h4, p, a, img, span, button):not(:has(*))")];e.x<=r.x&&(e.x=r.x),e.x>=r.x+r.w&&(e.x=r.x+r.w),e.y>=r.y+r.h&&(e.y=r.y+r.h),e.y<=r.y&&(e.y=r.y);let o=i.map(e=>{let t=eH(eW(e),n,{x:r.x,y:r.y});return{x:t.x-r.x,y:t.y-r.y,w:t.w,h:t.h,tagName:e.tagName}});return{offsetX:(r.x-e.x)*n,offsetY:(r.y-e.y)*n,w:r.w*n,h:r.h*n,maxWidth:r.w*n*.75,childRects:o}}async function e1(e,t,n,r,i){return new Promise(o=>{e.addEventListener("transitionend",()=>{setTimeout(()=>{r({type:"overlay/dragEndMinimapTransition"})},2*i),o()},{once:!0}),r({type:"overlay/dragStartMinimapTransition"}),r({type:"overlay/dragToggleMinimap",display:!0}),document.body.style.overflow="hidden",document.body.style.height="100%",document.documentElement.style.overflow="initial",document.documentElement.style.height="100%",setTimeout(()=>{e.style.transformOrigin="50% 0px",e.style.transition="transform 150ms ease",e.style.transform=`translate3d(0px, ${-n+scrollY}px, 0px) scale(${t})`},25)})}function e2(e){let t=function(e){let t=Math.max(0,Math.min(...e.map(e=>e.x))),n=Math.min(document.body.offsetWidth,Math.max(...e.map(e=>e.x+e.w)));return{min:t,max:n,width:n-t}}(e),n=eK(e),r=t.min>8&&t.min+t.width<=window.innerWidth-8,i=n.min>8&&n.min+n.height<=document.body.scrollHeight-8,o=r&&i;return{x:o?t.min-8:t.min,y:o?n.min-8:n.min,w:o?t.width+16:t.width,h:o?n.height+16:n.height}}async function e3(e,t,n,r,i,o){return new Promise(a=>{if(1===new DOMMatrix(window.getComputedStyle(t).transform).a)return;let s=n-window.innerHeight,l=scrollY;(e-=window.innerHeight/2)<0&&(e=0),t.addEventListener("transitionend",()=>{t.style.transition="none",t.style.transform="none",scrollTo({top:e,behavior:"instant"}),setTimeout(()=>{r({type:"overlay/dragEndMinimapTransition"}),r({type:"overlay/dragToggleMinimap",display:!1})},2*i),a()},{once:!0}),r({type:"overlay/dragStartMinimapTransition"}),t.style.transform=`translateY(${Math.max(l-e,-s+l)}px) scale(1)`,o&&(document.body.style.overflow=o.body.overflow,document.body.style.height=o.body.height,document.documentElement.style.overflow=o.documentElement.overflow,document.documentElement.style.height=o.documentElement.height)})}let e4=!1,e5={y:0},e6={x:0,y:0},e9=typeof document>"u"?0:document.documentElement.scrollHeight,e8=null,e7=e=>e instanceof HTMLElement||e instanceof SVGElement,te=e=>e&&e7(e)?e.dataset?.sanityOverlayElement?e:te(e.parentElement):null;function tt(e){return eD.lastIndex=0,eD.test(e)}function tn(e,t=!1){return tt(e)?function(e,t=!1){try{let n=function(e){let t=e.match(eD);if(t)return function(e,t=!1){let n=Array.from(e);if(n.length%2==0){if(n.length%4||!e.startsWith(eP))return function(e,t){var n;let r=[];for(let t=.5*e.length;t--;){let n=`${eN[e[2*t].codePointAt(0)]}${eN[e[2*t+1].codePointAt(0)]}`;r.unshift(String.fromCharCode(parseInt(n,16)))}let i=[],o=[r.join("")],a=10;for(;o.length;){let e=o.shift();try{if(i.push(JSON.parse(e)),t)break}catch(r){if(!a--)throw r;let t=+(null==(n=r.message.match(/\sposition\s(\d+)$/))?void 0:n[1]);if(!t)throw r;o.unshift(e.substring(0,t),e.substring(t))}}return i}(n,t)}
1else throw Error("Encoded data has invalid length");let r=[];for(let e=.25*n.length;e--;){let t=n.slice(4*e,4*e+4).map(e=>eL[e.codePointAt(0)]).join("");r.unshift(String.fromCharCode(parseInt(t,4)))}if(t){r.shift();let e=r.indexOf("\0");return -1===e&&(e=r.length),[JSON.parse(r.slice(0,e).join(""))]}return r.join("").split("\0").filter(Boolean).map(e=>JSON.parse(e))}(t[0],!0)[0]}(e);return n&&"sanity.io"===n.origin?(t&&(n.href=n.href?.replace(".alt","")),n):null}catch(t){return console.error("Failed to decode stega for string: ",e,"with the original error: ",t),null}}(e,t):null}let tr=e=>e.nodeType===Node.ELEMENT_NODE,ti=e=>"IMG"===e.tagName,to=e=>"TIME"===e.tagName,ta=e=>"SVG"===e.tagName.toUpperCase();function ts(e){return"path"in e}function tl(e){if(!e.length||!e.map(e=>ts(e)).every((e,t,n)=>e===n[0]))return;if(!ts(e[0]))return e[0];let t=e.filter(ts),n=e[0],r=["projectId","dataset","id","baseUrl","workspace","tool"];for(let e=1;e<t.length;e++){let i=t[e];if(r.some(e=>i[e]!==n?.[e])){n=void 0;break}n={...n,path:function(e,t){let n=e.split("."),r=t.split("."),i=Math.min(n.length,r.length);return n=n.slice(0,i).reverse(),r=r.slice(0,i).reverse(),n.reduce((e,t,n)=>t===r[n]?[...e,t]:[],[]).reverse().join(".")}(n.path,i.path)}}return n}function tu(e){let t=e.lastIndexOf(".");return e.substring(t,e.length).includes("[")}function tc(e){if(!tu(e))return null;let t=e.split(".");return t[t.length-1]=t[t.length-1].replace(/\[.*?\]/g,"[]"),t.join(".")}function td(e,t){return!!(tu(e.path)&&tu(t.path))&&tc(e.path)===tc(t.path)}function tp(e,t,n,r){if(!e.getAttribute("data-sanity")||e.getAttribute("data-sanity-drag-disable")||!t||!ts(t)||!tu(t.path))return null;let i=e.getAttribute("data-sanity-drag-group"),o=[...n].reduce((e,n)=>{let o=r.get(n),a=n.getAttribute("data-sanity-drag-disable"),s=n.getAttribute("data-sanity-drag-group"),l=null!==n.getAttribute("data-sanity");return o?.sanity&&!a&&ts(o.sanity)&&td(t,o.sanity)&&(null===i||i===s)&&l&&e.push(o),e},[]);return o.length<=1?null:o}let tf=(0,b.createContext)(null);var tm=n(96687),ty=n(11021);function th(e){if(!e)return(0,l.jsx)(ty.FMB,{});if("string"===e.type)return(0,l.jsx)(ty.Rhe,{});if("number"===e.type)return(0,l.jsx)(ty.yEv,{});let{value:t}=e;if("icon"in e&&e.icon)return(0,l.jsx)("div",{dangerouslySetInnerHTML:{__html:e.icon}});let{type:n}=t;if("string"===n)return(0,l.jsx)(ty.Rhe,{});if("boolean"===n)return(0,l.jsx)(ty.nSX,{});if("number"===n)return(0,l.jsx)(ty.yEv,{});if("array"===n||"union"===n)return(Array.isArray(t.of)?t.of:[t.of]).some(e=>"name"in e&&"block"===e.name)?(0,l.jsx)(ty.aI,{}):(0,l.jsx)(ty.DZP,{});if("object"===n){if("image"===e.name)return(0,l.jsx)(ty.XBm,{});if("block"===e.name)return(0,l.jsx)(ty.Rhe,{})}return(0,l.jsx)(ty.FMB,{})}let tg=(0,N.iv)`
2  overflow-y: scroll;
3  overscroll-behavior: contain;
4  -ms-overflow-style: none;
5  scrollbar-width: none;
6
7  &:before {
8    content: '';
9    display: block;
10    height: calc(100% + 1px);
11    position: absolute;
12    top: 0;
13    width: 100%;
14    z-index: -1;
15  }
16`,tv=N.zo.div`
17  height: 100%;
18  inset: 0;
19  pointer-events: all;
20  position: fixed;
21  width: 100%;
22  display: flex;
23  justify-content: center;
24  align-items: center;
25
26  ${e=>e.$blockScroll&&tg}
27`,tb=N.zo.div`
28  background: transparent;
29  height: 100%;
30  inset: 0;
31  position: absolute;
32  width: 100%;
33`,tw=e=>{let t;let n=(0,u.c)(2);return n[0]!==e?(t=(0,l.jsx)(L.h_,{children:(0,l.jsx)(tx,{...e})}),n[0]=e,n[1]=t):t=n[1],t},tx=e=>{let t,n;let r=(0,u.c)(7),{children:i,onDismiss:o,setBoundaryElement:a,blockScroll:s}=e,c=void 0===s||s;return r[0]!==o?(t=(0,l.jsx)(tb,{onMouseDownCapture:()=>{o?.()}}),r[0]=o,r[1]=t):t=r[1],r[2]!==c||r[3]!==i||r[4]!==a||r[5]!==t?(n=(0,l.jsxs)(tv,{"data-sanity-overlay-element":!0,ref:a,onClick:tE,$blockScroll:c,children:[t,i]}),r[2]=c,r[3]=i,r[4]=a,r[5]=t,r[6]=n):n=r[6],n};function tE(e){e.stopPropagation()}function tk(e){return{type:"log",name:e.name,version:e.version,description:e.description,maxSampleRate:e.maxSampleRate,schema:void 0}}let tj={"Visual Editing Drag Sequence Completed":tk({name:"Visual Editing Drag Sequence Completed",description:"An array is successfully reordered using drag and drop.",version:1}),"Visual Editing Drag Minimap Enabled":tk({name:"Visual Editing Drag Minimap Enabled",description:"The zoomed-out minimap view is enabled during a drag sequence.",version:1}),"Visual Editing Context Menu Item Removed":tk({name:"Visual Editing Context Menu Item Removed",description:"An item is removed using the Context Menu.",version:1}),"Visual Editing Context Menu Item Duplicated":tk({name:"Visual Editing Context Menu Item Duplicated",description:"An item is duplicated using the Context Menu.",version:1}),"Visual Editing Context Menu Item Moved":tk({name:"Visual Editing Context Menu Item Moved",description:"An item is moved using the Context Menu.",version:1}),"Visual Editing Context Menu Item Inserted":tk({name:"Visual Editing Context Menu Item Inserted",description:"An item is inserted using the Context Menu.",version:1}),"Visual Editing Insert Menu Item Inserted":tk({name:"Visual Editing Insert Menu Item Inserted",description:"An item is inserted using the Insert Menu.",version:1}),"Visual Editing Overlay Clicked":tk({name:"Visual Editing Overlay Clicked",description:"An Overlay is clicked.",version:1})},t_=(0,b.createContext)(void 0);function tI(){let e=(0,b.useContext)(t_);if(!e)throw Error("Telemetry context is missing");return e}let tS={"insert-menu.filter.all-items":"All","insert-menu.search.no-results":"No results","insert-menu.search.placeholder":"Filter types…","insert-menu.toggle-grid-view.tooltip":"Toggle grid view","insert-menu.toggle-list-view.tooltip":"Toggle list view"}
33,tM=e=>{let t,n,r,i;let o=(0,u.c)(11),{node:a,onSelect:s}=e;o[0]!==a.options?.insertMenu?(t=a.options?.insertMenu||{},o[0]=a.options?.insertMenu,o[1]=t):t=o[1];let c=t;o[2]!==c.views?(n=c.views?.map(tC),o[2]=c.views,o[3]=n):n=o[3];let d=n;return o[4]!==a.of?(r=a.of.map(t$),o[4]=a.of,o[5]=r):r=o[5],o[6]!==c||o[7]!==s||o[8]!==r||o[9]!==d?(i=(0,l.jsx)(tm.z,{...c,labels:tS,schemaTypes:r,onSelect:s,views:d}),o[6]=c,o[7]=s,o[8]=r,o[9]=d,o[10]=i):i=o[10],i};function tC(e){return"grid"===e.name?{...e,previewImageUrl:t=>e.previewImageUrls?.[t]}:e}function t$(e){return{...e,icon:th(e)}}let tA=e=>{let t,n,r,i,o;let a=(0,u.c)(10);return a[0]!==e?({children:t,style:r,...n}=e,a[0]=e,a[1]=t,a[2]=n,a[3]=r):(t=a[1],n=a[2],r=a[3]),a[4]!==r?(i={...r,pointerEvents:"all"},a[4]=r,a[5]=i):i=a[5],a[6]!==t||a[7]!==n||a[8]!==i?(o=(0,l.jsx)("div",{style:i,"data-sanity-overlay-element":!0,...n,children:t}),a[6]=t,a[7]=n,a[8]=i,a[9]=o):o=a[9],o};var tO=n(23669),tT=n(39346),tR=n(37814),tP=n(80196),tL=n(45029),tN=n(26102),tz=n(30448),tD=n(44195),tZ=function(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r},tU=function(e,t,n){for(var r=-1,i=Object(e),o=n(e),a=o.length;a--;){var s=o[++r];if(!1===t(i[s],s,i))break}return e},tV=n(55748),tF=n(95061),tW=(o=function(e,t){return e&&tU(e,t,tV.Z)},function(e,t){if(null==e)return e;if(!(0,tF.Z)(e))return o(e,t);for(var n=e.length,r=-1,i=Object(e);(a?r--:++r<n)&&!1!==t(i[r],r,i););return e}),tY=n(60690),tq=n(29355);function tG(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new tq.Z;++t<n;)this.add(e[t])}tG.prototype.add=tG.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},tG.prototype.has=function(e){return this.__data__.has(e)};var tB=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},tH=function(e,t,n,r,i,o){var a=1&n,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var u=o.get(e),c=o.get(t);if(u&&c)return u==t&&c==e;var d=-1,p=!0,f=2&n?new tG:void 0;for(o.set(e,t),o.set(t,e);++d<s;){var m=e[d],y=t[d];if(r)var h=a?r(y,m,d,t,e,o):r(m,y,d,e,t,o);if(void 0!==h){if(h)continue;p=!1;break}if(f){if(!tB(t,function(e,t){if(!f.has(t)&&(m===e||i(m,e,n,r,o)))return f.push(t)})){p=!1;break}}else if(!(m===y||i(m,y,n,r,o))){p=!1;break}}return o.delete(e),o.delete(t),p},tK=n(19522),tJ=n(79304),tX=n(90386),tQ=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n},t0=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}
33,t1=tK.Z?tK.Z.prototype:void 0,t2=t1?t1.valueOf:void 0,t3=function(e,t,n,r,i,o,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!o(new tJ.Z(e),new tJ.Z(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return(0,tX.Z)(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=tQ;case"[object Set]":var l=1&r;if(s||(s=t0),e.size!=t.size&&!l)break;var u=a.get(e);if(u)return u==t;r|=2,a.set(e,t);var c=tH(s(e),s(t),r,i,o,a);return a.delete(e),c;case"[object Symbol]":if(t2)return t2.call(e)==t2.call(t)}return!1},t4=n(79047),t5=Object.prototype.hasOwnProperty,t6=function(e,t,n,r,i,o){var a=1&n,s=(0,t4.Z)(e),l=s.length;if(l!=(0,t4.Z)(t).length&&!a)return!1;for(var u=l;u--;){var c=s[u];if(!(a?c in t:t5.call(t,c)))return!1}var d=o.get(e),p=o.get(t);if(d&&p)return d==t&&p==e;var f=!0;o.set(e,t),o.set(t,e);for(var m=a;++u<l;){var y=e[c=s[u]],h=t[c];if(r)var g=a?r(h,y,c,t,e,o):r(y,h,c,e,t,o);if(!(void 0===g?y===h||i(y,h,n,r,o):g)){f=!1;break}m||(m="constructor"==c)}if(f&&!m){var v=e.constructor,b=t.constructor;v!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof v&&v instanceof v&&"function"==typeof b&&b instanceof b)&&(f=!1)}return o.delete(e),o.delete(t),f},t9=n(65349),t8=n(26632),t7=n(11292),ne=n(33250),nt="[object Arguments]",nn="[object Array]",nr="[object Object]",ni=Object.prototype.hasOwnProperty,no=function(e,t,n,r,i,o){var a=(0,t8.Z)(e),s=(0,t8.Z)(t),l=a?nn:(0,t9.Z)(e),u=s?nn:(0,t9.Z)(t);l=l==nt?nr:l,u=u==nt?nr:u;var c=l==nr,d=u==nr,p=l==u;if(p&&(0,t7.Z)(e)){if(!(0,t7.Z)(t))return!1;a=!0,c=!1}if(p&&!c)return o||(o=new tY.Z),a||(0,ne.Z)(e)?tH(e,t,n,r,i,o):t3(e,t,l,n,r,i,o);if(!(1&n)){var f=c&&ni.call(e,"__wrapped__"),m=d&&ni.call(t,"__wrapped__");
33if(f||m){var y=f?e.value():e,h=m?t.value():t;return o||(o=new tY.Z),i(y,h,n,r,o)}}return!!p&&(o||(o=new tY.Z),t6(e,t,n,r,i,o))},na=n(29813),ns=function e(t,n,r,i,o){return t===n||(null!=t&&null!=n&&((0,na.Z)(t)||(0,na.Z)(n))?no(t,n,r,i,e,o):t!=t&&n!=n)},nl=function(e,t,n,r){var i=n.length,o=i,a=!r;if(null==e)return!o;for(e=Object(e);i--;){var s=n[i];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){var l=(s=n[i])[0],u=e[l],c=s[1];if(a&&s[2]){if(void 0===u&&!(l in e))return!1}else{var d=new tY.Z;if(r)var p=r(u,c,l,e,t,d);if(!(void 0===p?ns(c,u,3,r,d):p))return!1}}return!0},nu=n(12202),nc=function(e){return e==e&&!(0,nu.Z)(e)},nd=function(e){for(var t=(0,tV.Z)(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,nc(i)]}return t},np=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}},nf=function(e){var t=nd(e);return 1==t.length&&t[0][2]?np(t[0][0],t[0][1]):function(n){return n===e||nl(n,e,t)}},nm=n(81418),ny=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nh=/^\w*$/,ng=function(e,t){if((0,t8.Z)(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||(0,nm.Z)(e))||nh.test(e)||!ny.test(e)||null!=t&&e in Object(t)},nv=n(51712),nb=n(8885),nw=function(e,t){return(0,t8.Z)(e)?e:ng(e,t)?[e]:(0,nv.Z)((0,nb.Z)(e))},nx=n(10948),nE=function(e,t){t=nw(t,e);for(var n=0,r=t.length;null!=e&&n<r;)e=e[(0,nx.Z)(t[n++])];return n&&n==r?e:void 0},nk=function(e,t,n){var r=null==e?void 0:nE(e,t);return void 0===r?n:r},nj=function(e,t){return null!=e&&t in Object(e)},n_=n(92014),nI=n(88622),nS=n(25819),nM=function(e,t,n){t=nw(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var a=(0,nx.Z)(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&(0,nS.Z)(i)&&(0,nI.Z)(a,i)&&((0,t8.Z)(e)||(0,n_.Z)(e))},nC=function(e){return e},n$=function(e){var t;return ng(e)?(t=(0,nx.Z)(e),function(e){return null==e?void 0:e[t]}):function(t){return nE(t,e)}},nA=function(e){if("function"==typeof e)return e;if(null==e)return nC;if("object"==typeof e){var t,n;return(0,t8.Z)(e)?(t=e[0],n=e[1],ng(t)&&nc(n)?np((0,nx.Z)(t),n):function(e){var r=nk(e,t);return void 0===r&&r===n?null!=e&&nM(e,t,nj):ns(n,r,3)}):nf(e)}return n$(e)},nO=Object.prototype.hasOwnProperty,nT=(s=function(e,t,n){nO.call(e,n)?e[n].push(t):(0,tD.Z)(e,n,[t])},function(e,t){return((0,t8.Z)(e)?tZ:function(e,t,n,r){return tW(e,function(e,i,o){t(r,e,n(e),o)}),r})(e,s,nA(t,2),{})}),nR=n(35608),nP=n(74695),nL=n(38926),nN=n(10810),nz=n(11),nD=n(17896),nZ=n(31258),nU=n(63848),nV=n(41999),nF=n(750);function nW(e){if("patch"===e.type)return e.id;if("create"===e.type)return e.document._id;if("delete"===e.type)return e.id;if("createIfNotExists"===e.type||"createOrReplace"===e.type)return e.document._id;throw Error("Invalid mutation type")}let nY=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};function nq(e){return"string"==typeof e?._key}function nG(e){return"object"==typeof e&&"_key"in e&&"string"==typeof e._key}function nB(e){return"number"==typeof e||nG(e)}function nH(e,t){if(0===e.length)return t;let n=t;for(let t of e){if(nB(t)){if(!Array.isArray(n))return;if(nG(t)){n=n.find(e=>e._key===t._key);continue}n=n[t];continue}n=n[t]}return n}let nK=/^[a-z_$]+/;function nJ(e){return e.map((e,t)=>{var n;return n=0===t,Array.isArray(e)?`[${e[0]}:${e[1]||""}]`:"number"==typeof e?`[${e}]`:nG(e)?`[_key==${JSON.stringify(e._key)}]`:"string"==typeof e&&nK.test(e)?n?e:`.${e}`:`['${e}']`}).join("")}function nX(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function nQ(e,t){if("number"==typeof t)return function(e,t){if(0===e&&(-1===t||0===t))return 0;let n=t<0?e+t:t;return n>=e||n<0?null:n}(e.length,t);if(nG(t)){let n=e.findIndex(e=>(null!==e&&"object"==typeof e&&"string"==typeof e._key&&e._key||null)===t._key);return -1===n?null:n}throw Error(`Expected path segment to be addressing a single array item either by numeric index or by '_key'. Instead saw ${JSON.stringify(t)}`)}function n0(e,t,n,r){let i=e.slice();return i.splice(t,n,...r||[]),i}function n1(e,t){if(!Array.isArray(t))throw TypeError('Cannot apply "insert()" on non-array value');let n=nQ(t,e.referenceItem);if(null===n)throw Error(`Found no matching array element to insert ${e.position}`);return 0===t.length?e.items:n0(t,"before"===e.position?n:n+1,0,e.items)}let n2=Object.prototype.hasOwnProperty.call.bind(Object.prototype.hasOwnProperty);var n3=Object.freeze({__proto__:null,assign:function(e,t){if(!nX(t))throw TypeError('Cannot apply "assign()" on non-object value');return!function(e){for(let t in e)if(n2(e,t))return!1;return!0}(e.value)?{...t,...e.value}:t},dec:function(e,t){if("number"!=typeof t)throw TypeError('Cannot apply "dec()" on non-numeric value');return t-e.amount},diffMatchPatch:function(e,t){if("string"!=typeof t)throw TypeError('Cannot apply "diffMatchPatch()" on non-string value');return(0,tz.QE)((0,tz.G8)(e.value),t)[0]},inc:function(e,t){if("number"!=typeof t)throw TypeError('Cannot apply "inc()" on non-numeric value');return t+e.amount},insert:n1,remove:function(e,t){if(!Array.isArray(t))throw TypeError('Cannot apply "remove()" on non-array value');let n=nQ(t,e.referenceItem);if(null===n)throw Error("Found no matching array element to replace");return n0(t,n,1,[])},replace:function(e,t){if(!Array.isArray(t))throw TypeError('Cannot apply "replace()" on non-array value');let n=nQ(t,e.referenceItem);if(null===n)throw Error("Found no matching array element to replace");return n0(t,n,e.items.length,e.items)},set:function(e,t){return e.value},setIfMissing:function(e,t){return t??e.value},truncate:function(e,t){if(!Array.isArray(t))throw TypeError('Cannot apply "truncate()" on non-array value');return"number"==typeof e.endIndex?t.slice(0,e.startIndex).concat(t.slice(e.endIndex)):t.slice(0,e.startIndex)},unassign:function(e,t){if(!nX(t))throw TypeError('Cannot apply "unassign()" on non-object value');return 0===e.keys.length?t:function(e,t){let n={...e};for(let e of t)delete n[e];return n}(t,e.keys)},unset:function(e){},upsert:function(e,t){if(!Array.isArray(t))throw TypeError('Cannot apply "upsert()" on non-array value');
33if(0===e.items.length)return t;let n=[],r=[];if(e.items.forEach((e,i)=>{let o=t.findIndex(t=>t?._key===e._key);o>=0?n[o]=i:r.push(e)}),0===n.length&&0==r.length)return t;let i=[...t];for(let t of n)i[t]=e.items[n[t]];return n1({type:"insert",items:r,referenceItem:e.referenceItem,position:e.position},i)}});function n4(e,t){return e.reduce((e,t)=>n5(t,e),t)}function n5(e,t){return function e(t,n,r){if(!(t.length>0))return function(e,t){if(!(e.type in n3))throw Error(`Invalid operation type: "${e.type}"`);return n3[e.type](e,t)}(n,r);let[i,...o]=t;if(nB(i)&&Array.isArray(r))return function(t,n,r,i){let o=nQ(i,t);if(null===o||-1===o)return i;let a=i[o],s=e(n,r,a);return s===a?i:n0(i,o,1,[s])}(i,o,n,r);if("string"==typeof i&&nX(r))return function(t,n,r,i){let o=i[t];if(void 0===o&&n.length>0)return i;let a=e(n,r,o);return a===o?i:{...i,[t]:a}}(i,o,n,r);throw Error(`Cannot apply operation of type "${n.type}" to path ${nJ(t)} on ${typeof r} value`)}(e.path,e.op,t)}function n6(e){return"_id"in e}function n9(e,t){return t.reduce((e,t)=>{let n=n8(e,t);if("error"===n.status)throw Error(n.message);return"noop"===n.status?e:n.after},e)}function n8(e,t){if("create"===t.type)return function(e,t){var n;if(e)return{status:"error",message:"Document already exist"};let r=n6(n=t.document)?n:{...n,_id:nY()};return{status:"created",id:r._id,after:r}}(e,t);if("createIfNotExists"===t.type)return n6(t.document)?e?{status:"noop"}:{status:"created",id:t.document._id,after:t.document}:{status:"error",message:"Cannot createIfNotExists on document without _id"};if("delete"===t.type)return e?t.id!==e._id?{status:"error",message:"Delete mutation targeted wrong document"}:{status:"deleted",id:t.id,before:e,after:void 0}:{status:"noop"};if("createOrReplace"===t.type)return n6(t.document)?e?{status:"updated",id:t.document._id,before:e,after:t.document}:{status:"created",id:t.document._id,after:t.document}:{status:"error",message:"Cannot createIfNotExists on document without _id"};if("patch"===t.type)return function(e,t){if(!e)return{status:"error",message:"Cannot apply patch on nonexistent document"};let n=function(e,t){if(e.options?.ifRevision&&t._rev!==e.options.ifRevision)throw Error("Revision mismatch");if(e.id!==t._id)throw Error(`Document id mismatch. Refusing to apply mutation for document with id="${e.id}" on the given document with id="${t._id}"`);return n4(e.patches,t)}(t,e);return e===n?{status:"noop"}:{status:"updated",id:t.id,before:e,after:n}}(e,t);throw Error(`Invalid mutation type: ${t.type}`)}
33function n7(e,t,n){let r=[];for(let n of e.slice().reverse()){if(t(n))return r;r.push(n)}return r.reverse()}function re(e,t){return nJ(e)===nJ(t)}function rt(e,t){let n=e;return t.reduce((e,t)=>{let r=n;if(n=n5(t,n),"set"===t.op.type&&"string"==typeof t.op.value){let n=nH(t.path,r);if("string"==typeof n){let r={...t,op:{type:"diffMatchPatch",value:(0,tz.M5)((0,tz.oY)(n,t.op.value))}};return e.flatMap(e=>re(e.path,t.path)&&"diffMatchPatch"===e.op.type?[]:e).concat(r)}}return e.push(t),e},[])}function rn(e,t,n,r){let i=t,o=r.map(t=>{let n=t.mutations.flatMap(t=>{if(nW(t)!==e)return[];let n=i;return i=n9(i,[t]),n&&"patch"===t.type?{type:"dmpified",mutation:{...t,dmpPatches:rt(n,t.patches),original:t.patches}}:t});return{...t,mutations:n}}),a=n;return o.map(t=>{let n=[];return t.mutations.forEach(t=>{if("dmpified"===t.type)try{a=n4(t.mutation.dmpPatches,a),n.push(t)}catch{console.warn("Failed to apply dmp patch, falling back to original");try{a=n4(t.mutation.original,a),n.push(t)}catch(t){throw Error(`Failed to apply patch for document "${e}": ${t.message}`)}}else a=n9(a,[t])})}),[r.map(t=>({...t,mutations:t.mutations.map(t=>"patch"!==t.type||nW(t)!==e?t:{...t,patches:t.patches.map(e=>"set"!==e.op.type?e:{...e,op:{...e.op,value:nH(e.path,a)}})})})),a]}function rr(e){return function(e){if("create"===e.type||"createIfNotExists"===e.type||"createOrReplace"===e.type)return{[e.type]:e.document};if("delete"===e.type)return{delete:{id:e.id}};let t=e.options?.ifRevision;return e.patches.map(n=>({patch:{id:e.id,...t&&{ifRevisionID:t},...function(e){let{path:t,op:n}=e;if("unset"===n.type)return{unset:[nJ(t)]};if("insert"===n.type)return{insert:{[n.position]:nJ([...t,n.referenceItem]),items:n.items}};if("diffMatchPatch"===n.type)return{diffMatchPatch:{[nJ(t)]:n.value}};if("inc"===n.type)return{inc:{[nJ(t)]:n.amount}};if("dec"===n.type)return{dec:{[nJ(t)]:n.amount}};if("set"===n.type||"setIfMissing"===n.type)return{[n.type]:{[nJ(t)]:n.value}};if("truncate"===n.type){let e=[n.startIndex,"number"==typeof n.endIndex?n.endIndex:""].join(":");return{unset:[`${nJ(t)}[${e}]`]}}if("upsert"===n.type)return{unset:n.items.map(e=>nJ([...t,{_key:e._key}])),insert:{[n.position]:nJ([...t,n.referenceItem]),items:n.items}};if("assign"===n.type)return{set:Object.fromEntries(Object.keys(n.value).map(e=>[nJ(t.concat(e)),n.value[e]]))};if("unassign"===n.type)return{unset:n.keys.map(e=>nJ(t.concat(e)))};if("replace"===n.type)return{insert:{replace:nJ(t.concat(n.referenceItem)),items:n.items}};if("remove"===n.type)return{unset:[nJ(t.concat(n.referenceItem))]};throw Error(`Unknown operation type ${n.type}`)}(n)}}))}(e)}function ri(e){let t=e.listen('*[!(_id in path("_.**"))]',{},{events:["welcome","mutation","reconnect"],includeResult:!1,includePreviousRevision:!1,visibility:"transaction",effectFormat:"mendoza",includeMutations:!1}).pipe((0,nP.B)({resetOnRefCountZero:!0})),n=t.pipe((0,nL.h)(e=>"reconnect"===e.type)),r=t.pipe((0,nL.h)(e=>"welcome"===e.type)),i=t.pipe((0,nL.h)(e=>"mutation"===e.type)),o=(0,tN.T)(r,n).pipe((0,nN.d)({bufferSize:1,refCount:!0})).pipe((0,nL.h)(e=>"welcome"===e.type));return(0,tN.T)(o,i,n)}let ro=(0,nU.cY)({types:{},actions:{"assign error to context":(0,nV.a)({error:({event:e})=>e}),"clear error from context":(0,nV.a)({error:void 0}),"connect to server-sent events":(0,tR.r)({type:"connect"}),"listen to server-sent events":(0,tR.b)("server-sent events",{id:"listener",input:({context:e})=>({listener:e.sharedListener||ri(e.client),id:e.id})}),"stop listening to server-sent events":(0,tR.s)("listener"),"buffer remote mutation events":(0,nV.a)({mutationEvents:({event:e,context:t})=>((0,nU.ZD)(e,"mutation"),[...t.mutationEvents,e])}),"restore stashed changes":(0,nV.a)({stagedChanges:({event:e,context:t})=>((0,nU.ZD)(e,"xstate.done.actor.submitTransactions"),t.stashedChanges),stashedChanges:[]}),"rebase fetched remote snapshot":(0,nF.e)(({enqueue:e})=>{e.assign(({event:e,context:t})=>{(0,nU.ZD)(e,"xstate.done.actor.getDocument");let n=t.remote,r=e.output,i=!1;for(let e of t.mutationEvents)e.effects?.apply&&(e.previousRev||"appear"===e.transition)&&(i||e.previousRev!==r?._rev||(i=!0),i&&(r=ra(r,e.effects.apply,e.resultRev)));t.cache&&(!t.cache.has(t.id)||t.cache.get(t.id)._rev!==r?._rev)&&t.cache.set(t.i
33d,r);let[o,a]=rn(t.id,null===n?void 0:n,null===r?void 0:r,t.stagedChanges);return{remote:r,local:a,stagedChanges:o,mutationEvents:[]}}),e.sendParent(({context:e})=>({type:"rebased.remote",id:e.id,document:e.remote}))}),"apply mendoza patch":(0,nV.a)(({event:e,context:t})=>{(0,nU.ZD)(e,"mutation");let n=t.remote;if(e.transactionId===n?._rev)return{};let r=ra(n,e.effects.apply,e.resultRev);t.cache&&(!t.cache.has(t.id)||t.cache.get(t.id)._rev!==r?._rev)&&t.cache.set(t.id,r);let[i,o]=rn(t.id,null===n?void 0:n,null===r?void 0:r,t.stagedChanges);return{remote:r,local:o,stagedChanges:i}}),"increment fetch attempts":(0,nV.a)({fetchRemoteSnapshotAttempts:({context:e})=>e.fetchRemoteSnapshotAttempts+1}),"reset fetch attempts":(0,nV.a)({fetchRemoteSnapshotAttempts:0}),"increment submit attempts":(0,nV.a)({submitTransactionsAttempts:({context:e})=>e.submitTransactionsAttempts+1}),"reset submit attempts":(0,nV.a)({submitTransactionsAttempts:0}),"stage mutation":(0,nV.a)({stagedChanges:({event:e,context:t})=>((0,nU.ZD)(e,"mutate"),[...t.stagedChanges,{transaction:!1,mutations:e.mutations}])}),"stash mutation":(0,nV.a)({stashedChanges:({event:e,context:t})=>((0,nU.ZD)(e,"mutate"),[...t.stashedChanges,{transaction:!1,mutations:e.mutations}])}),"rebase local snapshot":(0,nF.e)(({enqueue:e})=>{e.assign({local:({event:e,context:t})=>{(0,nU.ZD)(e,"mutate");let n=new Map;return t.local&&n.set(t.id,t.local),function(e,t){e.forEach(e=>{("created"===e.status||"updated"===e.status)&&t.set(e.id,e.after),"deleted"===e.status&&t.delete(e.id)})}(function(e,t){let n=Object.create(null);for(let r of e){let e=nW(r);if(!e)throw Error("Unable to get document id from mutation");let i=n[e]?.after||t.get(e),o=n8(i,r);if("error"===o.status)throw Error(o.message);"noop"!==o.status&&("updated"===o.status||"created"===o.status||"deleted"===o.status)&&(e in n||(n[e]={before:i,after:void 0,muts:[]}),n[e].after=o.after)}return Object.entries(n).map(([e,{before:t,after:n,muts:r}])=>({id:e,status:n?t?"updated":"created":"deleted",mutations:r,before:t,after:n}))}(e.mutations,n),n),n.get(t.id)}}),e.sendParent(({context:e})=>({type:"rebased.local",id:e.id,document:e.local}))}),"send pristine event to parent":(0,nF.b)(({context:e})=>({type:"pristine",id:e.id})),"send sync event to parent":(0,nF.b)(({context:e})=>({type:"sync",id:e.id,document:e.remote})),"send mutation event to parent":(0,nF.b)(({context:e,event:t})=>((0,nU.ZD)(t,"mutation"),{type:"mutation",id:e.id,previousRev:t.previousRev,resultRev:t.resultRev,effects:t.effects}))},actors:{"server-sent events":(0,Q.Y$)(({input:e})=>{let{listener:t,id:n}=e;return(0,nz.P)(()=>t).pipe((0,nL.h)(e=>"welcome"===e.type||"reconnect"===e.type||"mutation"===e.type&&e.documentId===n),(0,nD.Q)(nZ.E))}),"fetch remote snapshot":(0,Q.p4)(async({input:e,signal:t})=>{let{client:n,id:r}=e;return await n.getDocument(r,{signal:t}).catch(e=>{if(!(e instanceof Error&&"AbortError"===e.name))throw e})}),"submit mutations as transactions":(0,Q.p4)(async({input:e,signal:t})=>{let{client:n,transactions:r}=e;for(let e of r){if(t.aborted)return;await n.dataRequest("mutate",{transactionId:e.id,mutations:e.mutations.flatMap(rr)},{visibility:"async",returnDocuments:!1,signal:t}).catch(e=>{if(!(e instanceof Error&&"AbortError"===e.name))throw e})}})},delays:{fetchRemoteSnapshotTimeout:({context:e})=>1e3*Math.pow(2,e.fetchRemoteSnapshotAttempts),submitTransactionsTimeout:({context:e})=>1e3*Math.pow(2,e.submitTransactionsAttempts)}}).createMachine({id:"document-mutator",context:({input:e})=>({client:e.client.withConfig({allowReconfigure:!1}),sharedListener:e.sharedListener,id:e.id,remote:void 0,local:void 0,mutationEvents:[],stagedChanges:[],stashedChanges:[],error:void 0,fetchRemoteSnapshotAttempts:0,submitTransactionsAttempts:0,cache:e.cache}),entry:["connect to server-sent events"],on:{mutate:{actions:["rebase local snapshot","stage mutation"]}},initial:"disconnected",states:{disconnected:{on:{connect:{target:"connecting",actions:["listen to server-sent events"]}}},connecting:{on:{welcome:"connected",reconnect:"reconnecting",error:"connectFailure"},tags:["busy"]},connectFailure:{on:{connect:{target:"connecting",actions:["listen to server-sent events"]}},entry:["stop listening to server-sent events","assign error to context"],exit:["clear error from context"],tags:["error"]},reconnecting:{on:{welcome:{target:"connected"},error:{target:"connectFailure"}},tags:["busy","error"]},connected:{on:{mutation:{actions:["buffer remote mutation events"]},reconnect:"reconnecting"},entry:["clear error from context"],initial:"loading",states:{loading:{invoke:{src:"fetch remote snapshot",id:"getDocument",input:({context:e})=>({client:e.client,id:e.id}),onError:{target:"loadFailure"},onDone:{target:"loaded",actions:["rebase fetched remote snapshot","reset fetch attempts"]}},tags:["busy"]},loaded:{entry:["send sync event to parent"],on:{mutation:{actions:["apply mendoza patch","send mutation event to parent"]}},initial:"pristine",states:{pristine:{on:{mutate:{actions:["rebase local snapshot","stage mutation"],target:"dirty"}},tags:["ready"]},dirty:{on:{submit:"submitting"},tags:["ready"]},submitting:{on:{mutate:{actions:["rebase local snapshot","stash mutation"]}},invoke:{src:"submit mutations as transactions",id:"submitTransactions",input:({context:e})=>{let t=new Map;return t.set(e.id,e.remote),{client:e.client,transactions:(function(e,t){let n=[],r=[];
33return e.forEach(e=>{t(e)?r.push(e):(r.length>0&&n.push(r),r=[],n.push([e]))}),r.length>0&&n.push(r),n})(e.stagedChanges,e=>!e.transaction).flatMap(e=>({...e[0],mutations:e.flatMap(e=>e.mutations)})).map(e=>({...e,mutations:Object.values(nT(e.mutations,nW)).flatMap(e=>{var t;return(0===(t=0===e.length?e:e.reduce((e,t)=>"delete"===t.type?[t]:(e.push(t),e),[])).length?t:t.reduce((e,t)=>("createIfNotExists"!==t.type?e.push(t):n7(e,e=>"delete"===e.type).find(e=>"createIfNotExists"===e.type)||e.push(t),e),[])).flat().reduce((e,t)=>{let n=e[e.length-1];return n&&"patch"!==n.type||"patch"!==t.type?e.concat(t):e.slice(0,-1).concat({...t,patches:(n?.patches||[]).concat(t.patches)})},[])})})).map(e=>({...e,mutations:e.mutations.map(e=>"patch"!==e.type?e:{...e,patches:e.patches.reduce((e,t)=>{if("unset"!==t.op.type)return e.push(t),e;let n=e.filter(e=>{var n,r;return n=t.path,r=e.path,!(n.length<=r.length&&n.every((e,t)=>{var n;return n=function(e,t){if(t<0||t>=e.length)throw Error("Index out of bounds");return e[t]}(r,t),nq(e)&&nq(n)?e._key===n._key:"number"==typeof e?Number(e)===Number(n):e===n}))});return n.push(t),n},[]).reduceRight((e,t)=>(e.find(e=>{var n,r;return n=e.op,("set"===(r=t.op).type||"unset"===r.type)&&("set"===n.type||"unset"===n.type)&&re(e.path,t.path)})||e.unshift(t),e),[]).reduce((e,t)=>("setIfMissing"!==t.op.type?e.push(t):n7(e,e=>"unset"===e.op.type).find(e=>"setIfMissing"===e.op.type&&re(e.path,t.path))||e.push(t),e),[])})})).map(e=>({...e,mutations:e.mutations.map((e,n)=>{var r;return"patch"===e.type&&(r=t.get(e.id))?{...e,patches:rt(r,e.patches)}:e})})).map(e=>e.transaction&&void 0!==e.id?{id:e.id,mutations:e.mutations}:{mutations:e.mutations})}},onError:{target:"submitFailure"},onDone:{target:"pristine",actions:["restore stashed changes","reset submit attempts","send pristine event to parent"]}},tags:["busy","ready"]},submitFailure:{exit:["clear error from context"],after:{submitTransactionsTimeout:{actions:["increment submit attempts"],target:"submitting"}},on:{retry:"submitting"},tags:["error","ready"]}}},loadFailure:{exit:["clear error from context"],after:{fetchRemoteSnapshotTimeout:{actions:["increment fetch attempts"],target:"loading"}},on:{retry:"loading"},tags:["error"]}}}}});function ra(e,t,n){let r=(0,nR.a)(function(e){if(!e)return null;let{_rev:t,...n}=e;return n}(e),t);return r?Object.assign(r,{_rev:n}):null}let rs=e=>{let t=(0,Q.p4)(async({input:t,signal:n})=>{let{id:r}=t,{snapshot:i}=await e.fetch("visual-editing/fetch-snapshot",{documentId:r},{signal:n});return i}),n=(0,Q.p4)(async({input:t})=>{let{transactions:n}=t;for(let t of n){let n=B.encodeTransaction(t);return e.post("visual-editing/mutate",n)}});return ro.provide({actions:{"send sync event to parent":(0,nF.e)(({enqueue:e})=>{e.sendParent(({context:e})=>({type:"sync",id:e.id,document:e.remote})),e.emit(({context:e})=>({type:"ready",snapshot:e.local}))})},actors:{"fetch remote snapshot":t,"submit mutations as transactions":n}})},rl=(0,nU.cY)({types:{},actions:{"emit sync event":(0,nF.a)(({event:e})=>((0,nU.ZD)(e,"sync"),e)),"emit mutation event":(0,nF.a)(({event:e})=>((0,nU.ZD)(e,"mutation"),e)),"emit rebased event":(0,nF.a)(({event:e})=>((0,nU.ZD)(e,["rebased.local","rebased.remote"]),e)),"emit pristine event":(0,nF.a)(({event:e})=>((0,nU.ZD)(e,["pristine"]),e)),"add document actor":(0,nV.a)({documents:({context:e,event:t,spawn:n})=>{(0,nU.ZD)(t,"observe");let r=t.documentId;return e.documents[r]?e.documents:{...e.documents,[r]:n("documentMutatorMachine",{input
33:{id:r,client:e.client,sharedListener:e.sharedListener||ri(e.client)},id:r})}}}),"stop remote snapshot":(0,tR.s)(({context:e,event:t})=>((0,nU.ZD)(t,"unobserve"),e.documents[t.documentId])),"remove remote snapshot from context":(0,nV.a)({documents:({context:e,event:t})=>{if((0,nU.ZD)(t,"unobserve"),!e.documents[t.documentId])return e.documents;let{[t.documentId]:n,...r}=e.documents;return r}})},actors:{documentMutatorMachine:ro}}).createMachine({id:"dataset-mutator",context:({input:e})=>({documents:{},client:e.client,sharedListener:e.sharedListener}),on:{sync:{actions:["emit sync event"]},mutation:{actions:["emit mutation event"]},"rebased.*":{actions:["emit rebased event"]},pristine:{actions:["emit pristine event"]},observe:{actions:["add document actor"]},unobserve:{actions:["stop remote snapshot","remove remote snapshot from context"]}},initial:"pristine",states:{pristine:{}}}),ru=e=>rl.provide({actors:{documentMutatorMachine:rs(e)}}),rc=e=>{let t,n,r,i;let o=(0,u.c)(8),{comlink:a,history:s}=e;return o[0]!==a||o[1]!==s?(t=()=>a?.on("presentation/navigate",e=>{s?.update(e)}),n=[a,s],o[0]=a,o[1]=s,o[2]=t,o[3]=n):(t=o[2],n=o[3]),(0,b.useEffect)(t,n),o[4]!==a||o[5]!==s?(r=()=>{if(s)return s.subscribe(e=>{e.title=e.title||document.title,a?.post("visual-editing/navigate",e)})},i=[a,s],o[4]=a,o[5]=s,o[6]=r,o[7]=i):(r=o[6],i=o[7]),(0,b.useEffect)(r,i),null},rd=e=>{let t,n;let r=(0,u.c)(3),{comlink:i}=e;return r[0]!==i?(t=()=>{let e=()=>{i.post("visual-editing/meta",{title:document.title})},t=new MutationObserver(t=>{let[n]=t;"TITLE"===n.target.nodeName&&e()});return t.observe(document.head,{subtree:!0,characterData:!0,childList:!0}),e(),()=>t.disconnect()},n=[i],r[0]=i,r[1]=t,r[2]=n):(t=r[1],n=r[2]),(0,b.useEffect)(t,n),null};function rp(e){let t=new CustomEvent("sanity/dragEnd",{detail:e,cancelable:!0});window.dispatchEvent(t)}let rf=(0,b.createContext)(null);function rm(){let e=(0,b.useContext)(rf);if(!e)throw Error("Schema context is missing");return e}function ry(e,t,n,r){if(!e.type)throw Error("Node type is missing");return()=>t.patch(()=>(function(e,t,n){let{path:r,key:i}=ex(e);return[X(r,H([{_type:t,_key:ew()}],n,{_key:i}))]})(e,n,r))}function rh(e){let{node:t,doc:n}=e;return n?[{type:"action",label:"Duplicate",icon:ty.TIy,action:function(e,t){if(!e.type)throw Error("Node type is missing");return()=>t.patch(async({getSnapshot:t})=>(function(e,t,n="after"){let{path:r,key:i}=ex(e);return[X(r,H({...ec(t,e.path),_key:ew()},n,{_key:i}))]})(e,await t()))}(t,n),telemetryEvent:"Visual Editing Context Menu Item Duplicated"}]:[]}function rg(e){let{node:t,doc:n}=e;return n?[{type:"action",label:"Remove",icon:ty.HFL,action:function(e,t){if(!e.type)throw Error("Node type is missing");return()=>t.patch(async({getSnapshot:t})=>(function(e,t){let{path:n,key:r}=ex(e),i=ec(t,n).findIndex(e=>e._key===r);return[X(n,K(i,i+1))]})(e,await t()))}(t,n),telemetryEvent:"Visual Editing Context Menu Item Removed"}]:[]}async function rv(e,t=!0){let{node:n,doc:r}=e;if(!r)return[];let i=[],o=[],[a,s,l,u]=await Promise.all([eE(n,r,"previous"),eE(n,r,"next"),eE(n,r,"first"),eE(n,r,"last")]);return l.length&&o.push({type:"action",label:"To top",icon:ty.EI4,action:()=>r.patch(l),telemetryEvent:"Visual Editing Context Menu Item Moved"}),a.length&&o.push({type:"action",label:"Up",icon:ty.Hf3,action:()=>r.patch(a),telemetryEvent:"Visual Editing Context Menu Item Moved"}),s.length&&o.push({type:"action",label:"Down",icon:ty.veu,action:()=>r.patch(s),telemetryEvent:"Visual Editing Context Menu Item Moved"}),u.length&&o.push({type:"action",label:"To bottom",icon:ty.xEY,action:()=>r.patch(u),telemetryEvent:"Visual Editing Context Menu Item Moved"}),o.length&&(i.push({type:"group",label:"Move",icon:ty.fzI,items:o}),t&&i.push({type:"divider"})),i}async function rb(e){let{node:t,field:n,doc:r}=e,i=[];return i.push(...rh(e)),i.push(...rg(e)),i.push(...await rv(e)),i.push({type:"action",label:"Insert before",icon:ty.ySV,action:ry(t,r,n.name,"before"),telemetryEvent:"Visual Editing Context Menu Item Inserted"}),i.push({type:"action",label:"Insert after",icon:ty.oty,action:ry(t,r,n.name,"after"),telemetryEvent:"Visual Editing Context Menu Item Inserted"}),i}let rw=e=>{let t,n,r,i,o;let a=(0,u.c)(12),{label:s,parent:c,width:d,onSelect:p,boundaryElement:f}=e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=["left-start","right","left","right-end","left-end","bottom","top"],a[0]=t):t=a[0],a[1]===Symbol.for("react.memo_cache_sentinel")?(n=[4,4,4,4],a[1]=n):n=a[1],a[2]!==f||a[3]!==d?(r={arrow:!1,constrainSize:!0,floatingBoundary:f,padding:0,placement:"right-start",fallbackPlacements:t,preventOverflow:!0,width:d,__unstable_margins:n},a[2]=f,a[3]=d,a[4]=r):r=a[4],a[5]!==p||a[6]!==c?(i=(0,l.jsx)(tM,{node:c,onSelect:p}),a[5]=p,a[6]=c,a[7]=i):i=a[7],a[8]!==s||a[9]!==r||a[10]!==i?(o=(0,l.jsx)(L.kS,{fontSize:1,icon:ty.oty,padding:2,popover:r,space
33:2,text:s,children:i}),a[8]=s,a[9]=r,a[10]=i,a[11]=o):o=a[11],o};async function rx(e){let{doc:t,node:n,parent:r}=e,i=[];if(i.push(...rh(e)),i.push(...rg(e)),i.push(...await rv(e)),r.options?.insertMenu){let e=(r.options.insertMenu||{}).views?.some(e=>"grid"===e.name)?0:void 0;i.push({type:"custom",component:({boundaryElement:i,sendTelemetry:o})=>(0,l.jsx)(rw,{label:"Insert before",onSelect:e=>{ry(n,t,e.name,"before")(),o("Visual Editing Context Menu Item Inserted",null)},parent:r,width:e,boundaryElement:i})}),i.push({type:"custom",component:({boundaryElement:i,sendTelemetry:o})=>(0,l.jsx)(rw,{label:"Insert after",onSelect:e=>{ry(n,t,e.name,"after")(),o("Visual Editing Context Menu Item Inserted",null)},parent:r,width:e,boundaryElement:i})})}else i.push({type:"group",label:"Insert before",icon:ty.ySV,items:r.of.filter(e=>"unionOption"===e.type).map(e=>({type:"action",icon:th(e),label:"block"===e.name?"Paragraph":e.title||e.name,action:ry(n,t,e.name,"before"),telemetryEvent:"Visual Editing Context Menu Item Inserted"}))}),i.push({type:"group",label:"Insert after",icon:ty.oty,items:r.of.filter(e=>"unionOption"===e.type).map(e=>({type:"action",label:"block"===e.name?"Paragraph":e.title||e.name,icon:th(e),action:ry(n,t,e.name,"after"),telemetryEvent:"Visual Editing Context Menu Item Inserted"}))});return i}let rE=[-4,4,-4,4];function rk(e){let t;let n=(0,u.c)(27),{node:r,onDismiss:i,boundaryElement:o}=e,a=tI();n[0]!==r||n[1]!==i||n[2]!==a?(t=()=>{"action"===r.type&&(r.action?.(),i?.(),r.telemetryEvent&&a(r.telemetryEvent,null))},n[0]=r,n[1]=i,n[2]=a,n[3]=t):t=n[3];let s=t;if("divider"===r.type){let e;return n[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsx)(L.R,{}),n[4]=e):e=n[4],e}if("action"===r.type){let e;let t=!r.action;return n[5]!==r.hotkeys||n[6]!==r.icon||n[7]!==r.label||n[8]!==s||n[9]!==t?(e=(0,l.jsx)(L.sN,{fontSize:1,hotkeys:r.hotkeys,icon:r.icon,padding:2,space:2,text:r.label,disabled:t,onClick:s}),n[5]=r.hotkeys,n[6]=r.icon,n[7]=r.label,n[8]=s,n[9]=t,n[10]=e):e=n[10],e}if("group"===r.type){let e,t,a;let s=r.icon;n[11]===Symbol.for("react.memo_cache_sentinel")?(e={arrow:!1,constrainSize:!0,placement:"right-start",fallbackPlacements:["left-start","right","left","right-end","left-end","bottom","top"],preventOverflow:!0,__unstable_margins:rE},n[11]=e):e=n[11];let u=r.label;if(n[12]!==o||n[13]!==r.items||n[14]!==i){let e;n[16]!==o||n[17]!==i?(e=(e,t)=>(0,l.jsx)(rk,{node:e,onDismiss:i,boundaryElement:o},t),n[16]=o,n[17]=i,n[18]=e):e=n[18],t=r.items.map(e),n[12]=o,n[13]=r.items,n[14]=i,n[15]=t}else t=n[15];return n[19]!==r.icon||n[20]!==r.label||n[21]!==t?(a=(0,l.jsx)(L.kS,{fontSize:1,icon:s,padding:2,popover:e,space:2,text:u,children:t}),n[19]=r.icon,n[20]=r.label,n[21]=t,n[22]=a):a=n[22],a}if("custom"===r.type){let e;let{component:t}=r;return n[23]!==t||n[24]!==o||n[25]!==a?(e=(0,l.jsx)(t,{boundaryElement:o,sendTelemetry:a}),n[23]=t,n[24]=o,n[25]=a,n[26]=e):e=n[26],e}return null}let rj=e=>{let t,n,r,i,o,a,s,c,d,p,f,m,y,h,g,v,w,x;let E=(0,u.c)(43),{node:k,onDismiss:j,position:_}=e,{x:I,y:S}=_,[M,C]=(0,b.useState)(null),{getField:$}=rm(),{getDocument:A}=ev();E[0]!==$||E[1]!==k?(t=$(k),E[0]=$,E[1]=k,E[2]=t):t=E[2];let{field:O,parent:T}=t;n=O?.title||O?.name||"Unknown type";let[R,P]=(0,b.useState)(void 0);E[3]!==O||E[4]!==A||E[5]!==k||E[6]!==T?(r=()=>{(async()=>{let e=A(k.id);e&&P(await function(e){let{node:t,field:n,parent:r,doc:i}=e;return n?.type==="arrayItem"?rb({node:t,field:n,doc:i}):r?.type==="union"?rx({node:t,parent:r,doc:i}):Promise.resolve([])}({node:k,field:O,parent:T,doc:e}))})()},i=[O,k,T,A],E[3]=O,E[4]=A,E[5]=k,E[6]=T,E[7]=r,E[8]=i):(r=E[7],i=E[8]),(0,b.useEffect)(r,i),E[9]!==I||E[10]!==S?(a={getBoundingClientRect:()=>({bottom:S,left:I,right:I,top:S,width:0,height:0})},E[9]=I,E[10]=S,E[11]=a):a=E[11],o=a,E[12]!==O?(c=th(O),E[12]=O,E[13]=c):c=E[13],s=c,E[14]===Symbol.for("react.memo_cache_sentinel")?(d={minWidth:120,maxWidth:160},E[14]=d):d=E[14],E[15]!==s||E[16]!==R?(p=(0,l.jsx)(L.xu,{flex:"none",children:R?(0,l.jsx)(L.xv,{size:1,children:s}):(0,l.jsx)(L.$j,{size:1})}),E[15]=s,E[16]=R,E[17]=p):p=E[17];let N=R?n:"Loading...";E[18]!==N?(f=(0,l.jsx)(L.Kq,{flex:1,space:2,children:(0,l.jsx)(L.xv,{size:1,weight:"semibold",children:N})}),E[18]=N,E[19]=f):f=E[19],E[20]!==p||E[21]!==f?(m=(0,l.jsxs)(L.kC,{gap:2,padding:2,children:[p,f]}),E[20]=p,E[21]=f,E[22]=m):m=E[22],E[23]!==M||E[24]!==R||E[25]!==j?(y=R&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(L.R,{}),R.map((e,t)=>(0,l.jsx)(rk,{node:e,onDismiss:j,boundaryElement:M},t))]}),E[23]=M,E[24]=R,E[25]=j,E[26]=y):y=E[26],E[27]!==m||E[28]!==y?(h=(0,l.jsxs)(L.v2,{style:d,children:[m,y]}),E[27]=m,E[28]=y,E[29]=h):h=E[29];let z=`${I}-${S}`;return E[30]!==I||E[31]!==S?(g={position:"absolute",left:I,top:S},E[30]=I,E[31]=S,E[32]=g):g=E[32],E[33]!==z||E[34]!==g?(v=(0,l.jsx)("div",{style:g},z),E[33]=z,E[34]=g,E[35]=v):v=E[35],E[36]!==o||E[37]!==h||E[38]!==v?
33(w=(0,l.jsx)(L.J2,{__unstable_margins:rE,arrow:!1,open:!0,placement:"right-start",referenceElement:o,content:h,children:v}),E[36]=o,E[37]=h,E[38]=v,E[39]=w):w=E[39],E[40]!==j||E[41]!==w?(x=(0,l.jsx)(tw,{setBoundaryElement:C,onDismiss:j,children:w}),E[40]=j,E[41]=w,E[42]=x):x=E[42],x},r_=(0,b.createContext)(null),rI=e=>(0,b.isValidElement)(e),rS=(0,N.zo)(L.Zb)`
34  background-color: var(--overlay-bg);
35  border-radius: 3px;
36  pointer-events: none;
37  position: absolute;
38  will-change: transform;
39  box-shadow: var(--overlay-box-shadow);
40  transition: none;
41
42  --overlay-bg: transparent;
43  --overlay-box-shadow: inset 0 0 0 1px transparent;
44
45  [data-overlays] & {
46    --overlay-bg: color-mix(in srgb, transparent 95%, var(--card-focus-ring-color));
47    --overlay-box-shadow: inset 0 0 0 2px
48      color-mix(in srgb, transparent 50%, var(--card-focus-ring-color));
49  }
50
51  [data-fading-out] & {
52    transition:
53      box-shadow 1550ms,
54      background-color 1550ms;
55
56    --overlay-bg: rgba(0, 0, 255, 0);
57    --overlay-box-shadow: inset 0 0 0 1px transparent;
58  }
59
60  &[data-focused] {
61    --overlay-box-shadow: inset 0 0 0 1px var(--card-focus-ring-color);
62  }
63
64  &[data-hovered]:not([data-focused]) {
65    transition: none;
66    --overlay-box-shadow: inset 0 0 0 2px var(--card-focus-ring-color);
67  }
68
69  /* [data-unmounted] & {
70    --overlay-box-shadow: inset 0 0 0 1px var(--card-focus-ring-color);
71  } */
72
73  :link {
74    text-decoration: none;
75  }
76`,rM=(0,N.zo)(L.kC)`
77  bottom: 100%;
78  cursor: pointer;
79  pointer-events: none;
80  position: absolute;
81  right: 0;
82
83  [data-hovered]:not([data-menu-open]) & {
84    pointer-events: all;
85  }
86
87  [data-flipped] & {
88    bottom: auto;
89    top: 100%;
90  }
91`,rC=(0,N.zo)(L.kC)`
92  top: 100%;
93  cursor: pointer;
94  pointer-events: none;
95  position: absolute;
96  left: 0;
97
98  gap: 4px;
99  padding: 4px 0;
100  flex-wrap: wrap;
101
102  [data-hovered]:not([data-menu-open]) & {
103    pointer-events: all;
104  }
105
106  [data-flipped] & {
107    top: calc(100% + 2rem);
108  }
109`,r$=(0,N.zo)(L.kC)`
110  margin: -0.5rem;
111
112  [data-hovered]:not([data-menu-open]) & {
113    pointer-events: all;
114  }
115`,rA=(0,N.zo)(L.kC)`
116  bottom: 100%;
117  cursor: pointer;
118  pointer-events: none;
119  position: absolute;
120  left: 0;
121
122  [data-hovered]:not([data-menu-open]) & {
123    pointer-events: all;
124  }
125
126  [data-flipped] & {
127    bottom: auto;
128    top: 100%;
129  }
130`,rO=(0,N.zo)(L.Zb)`
131  cursor: pointer;
132  background-color: var(--card-focus-ring-color);
133  right: 0;
134  border-radius: 3px;
135
136  & [data-ui='Text'] {
137    color: #fff;
138    white-space: nowrap;
139  }
140`,rT=(0,N.zo)(L.kC)`
141  display: flex;
142  align-items: center;
143  background-color: var(--card-focus-ring-color);
144  right: 0;
145  border-radius: 3px;
146  & [data-ui='Text'],
147  & [data-sanity-icon] {
148    color: #fff;
149    white-space: nowrap;
150  }
151`,rR=N.zo.div`
152  position: absolute;
153  inset: 0;
154  pointer-events: all;
155`,rP=e=>{let t,n,r,i,o,a,s,c,d,p,f,m,y,h,g,v,w,x;let E=(0,u.c)(59),{id:k,element:j,focused:_,componentResolver:I,node:M,showActions:C,draggable:A,targets:R,elementType:N,comlink:z,onActivateExclusivePlugin:D,onMenuOpenChange:Z}=e,{getField:U,getType:V}=rm();E[0]!==V||E[1]!==M?(t=V(M),E[0]=V,E[1]=M,E[2]=t):t=E[2];let F=t;E[3]!==M?(n="path"in M?function(e){let{id:t,type:n,path:r,baseUrl:i,tool:o,workspace:a}=e;return function(e){let{baseUrl:t,workspace:n="default",tool:r="default",id:i,type:o,path:a,projectId:s,dataset:l}=e;if(!t)throw Error("baseUrl is required");if(!a)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 u="default"===n?void 0:n,c="default"===r?void 0:r,d=P(i),p=Array.isArray(a)?S(a.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)}`)})):a,f=new URLSearchParams({baseUrl:t,id:d,type:o,path:p});if(u&&f.set("workspace",u),c&&f.set("tool",c),s&&f.set("projectId",s),l&&f.set("dataset",l),O(i)||T(i)){if(T(i)){let e=function(e){if(!T(e))return;let[t,n,...r]=e.split(".");return n}(i);f.set("perspective",e)}}else f.set("perspective","published");let m=["/"===t?"":t];u&&m.push(u);let y=["mode=presentation",`id=${d}`,`type=${o}`,`path=${encodeURIComponent(p)}`];return c&&y.push(`tool=${c}`),m.push("intent","edit",`${y.join(";")}?${f}`),m.join("/")}({baseUrl:i,workspace:a,tool:o,type:n,id:t,path:r?function(e){let t="";for(let n of e){if("string"==typeof n){t&&(t+="."),t+=n;continue}if("number"==typeof n){t&&(t+=":"),t+=`${n}`;continue}if(null!==n&&Array.isArray(n)){t&&(t+=":"),t+=`${n.join(",")}}`;continue}if(n._key){t&&(t+=":"),t+=`${n._key}`;continue}}return t}($.fromString(r)):[]})}(M):M.href,E[3]=M,E[4]=n):n=E[4];let W=n,Y=function(){let e=(0,b.useContext)(r_);if(!e)throw Error("Preview Snapshots context is missing");return e}();e:{let e;if(!("path"in M)){r=void 0;break e}E[5]!==M||E[6]!==Y?(e=Y.find(e=>
155e._id===M.id)?.title,E[5]=M,E[6]=Y,E[7]=e):e=E[7],r=e}let q=r;E[8]!==j||E[9]!==_||E[10]!==U||E[11]!==V?(o=function(e,t){let n=V(e),{field:r,parent:i}=U(e);if(!("id"in e)||!r||!n)return;let o=r.value.type;return{document:n,element:j,targetElement:t||j,field:r,focused:!!_,node:e,parent:i,type:o}},E[8]=j,E[9]=_,E[10]=U,E[11]=V,E[12]=o):o=E[12];let G=o;if(E[13]!==N||E[14]!==G||E[15]!==M?(a="element"===N?G(M):void 0,E[13]=N,E[14]=G,E[15]=M,E[16]=a):a=E[16],E[17]!==G||E[18]!==R){let e;E[20]!==G?(e=e=>G(e.sanity,e.element),E[20]=G,E[21]=e):e=E[21],s=R.map(e).filter(rD),E[17]=G,E[18]=R,E[19]=s}else s=E[19];E[22]!==a||E[23]!==s?(c={legacyComponentContext:a,pluginContexts:s},E[22]=a,E[23]=s,E[24]=c):c=E[24];let B=function(e,t){let n;let r=(0,u.c)(4);e:{let i;if(!e){n=void 0;break e}if(r[0]!==e||r[1]!==t){let o=t?.(e);if(!o){n=void 0;break e}if(rI(o)){n=o;break e}i=(Array.isArray(o)?o:[o]).map(rN),r[0]=e,r[1]=t,r[2]=i,r[3]=n}else i=r[2],n=r[3];n=i}return n}((i=c).legacyComponentContext,I),H=function(e,t){let n;let r=(0,u.c)(5);if(r[0]!==e||r[1]!==t){let i;r[3]!==t?(i=e=>{let n={id:eF(),context:e,hud:[],exclusive:[]};return t?.forEach(t=>{t.guard?.(e)&&("hud"===t.type&&n.hud.push(t),"exclusive"===t.type&&n.exclusive.push(t))}),n},r[3]=t,r[4]=i):i=r[4],n=e.map(i),r[0]=e,r[1]=t,r[2]=n}else n=r[2];return n}(i.pluginContexts,e.plugins);E[25]!==F?(d=F?.icon?(0,l.jsx)("div",{dangerouslySetInnerHTML:{__html:F.icon}}):(0,l.jsx)(ty.$lS,{}),E[25]=F,E[26]=d):d=E[26];let K=d,J=(0,b.useId)();E[27]!==H?(p=H?.some(rZ),E[27]=H,E[28]=p):p=E[28];let X=p||H?.length>1;E[29]!==k?(f=()=>{window.dispatchEvent(new CustomEvent("sanity-overlay/label-click",{detail:{id:k}}))},E[29]=k,E[30]=f):f=E[30];let Q=f;return E[31]!==W||E[32]!==C?(m=C?(0,l.jsx)(rM,{gap:1,paddingY:1,children:(0,l.jsx)(rz,{href:W})}):null,E[31]=W,E[32]=C,E[33]=m):m=E[33],E[34]!==z||E[35]!==A||E[36]!==Q||E[37]!==K||E[38]!==J||E[39]!==H||E[40]!==D||E[41]!==Z||E[42]!==X||E[43]!==q?(y=(q||X)&&(0,l.jsx)(rA,{gap:1,paddingY:1,onClick:Q,children:(0,l.jsxs)(rT,{gap:2,padding:2,children:[A&&(0,l.jsx)(L.xu,{marginRight:1,children:(0,l.jsx)(L.xv,{className:"drag-handle",size:0,children:(0,l.jsx)(ty.VVU,{})})}),(0,l.jsx)(L.xv,{size:0,children:K}),q&&(0,l.jsx)(L.xv,{size:1,weight:"medium",children:q}),X&&(0,l.jsx)(L.xu,{paddingLeft:2,onClick:rU,children:(0,l.jsx)(r$,{children:(0,l.jsx)(tO.j2,{id:J,popover:{animate:!0,placement:"bottom-start",constrainSize:!0,tone:"default"},onOpen:()=>{Z?.(!0)},onClose:()=>{Z?.(!1)},button:(0,l.jsx)(L.zx,{icon:ty.zGg,tone:"primary",padding:2}),menu:(0,l.jsx)(L.v2,{paddingY:0,children:(0,l.jsx)(tA,{children:H?.map((e,t)=>l.jsxs(b.Fragment,{children:[l.jsxs(L.Kq,{role:"group",paddingY:1,space:0,children:[l.jsx(L.sN,{paddingY:2,text:l.jsx(L.xu,{paddingY:2,children:l.jsx(L.xv,{muted:!0,size:1,style:{textTransform:"capitalize"},children:`${e.context.document.name}: ${e.context.field?.name}`})}),onClick:()=>{e.context.node&&z?.post("visual-editing/focus",e.context.node)}}),e.exclusive.map(t=>t.component?l.jsx(L.sN,{paddingY:2,icon:t.icon||l.jsx(ty.BWR,{}),text:l.jsx(L.xu,{paddingY:2,children:l.jsx(L.xv,{size:1,children:t.title||t.name})}),onClick:()=>D?.(t,e.context)},t.name):null)]}),t<H.length-1&&l.jsx(L.R,{})]},e.id))})})})})})]})}),E[34]=z,E[35]=A,E[36]=Q,E[37]=K,E[38]=J,E[39]=H,E[40]=D,E[41]=Z,E[42]=X,E[43]=q,E[44]=y):y=E[44],E[45]!==H?(h=H?.map(rV),E[45]=H,E[46]=h):h=E[46],E[47]!==h?(g=(0,l.jsx)(rC,{children:h}),E[47]=h,E[48]=g):g=E[48],E[49]!==m||E[50]!==y||E[51]!==g?(v=(0,l.jsxs)(tA,{children:[m,y,g]}),E[49]=m,E[50]=y,E[51]=g,E[52]=v):v=E[52],E[53]!==B||E[54]!==i.legacyComponentContext?(w=Array.isArray(B)?B.map((e,t)=>{let{component:n,props:r}=e;return(0,l.jsx)(n,{PointerEvents:tA,...i.legacyComponentContext,...r},t)}):B,E[53]=B,E[54]=i.legacyComponentContext,E[55]=w):w=E[55],E[56]!==v||E[57]!==w?(x=(0,l.jsxs)(l.Fragment,{children:[v,w]}),E[56]=v,E[57]=w,E[58]=x):x=E[58],x},rL=(0,b.memo)(function(e){let t,n,r,i,o,a,s,c,d,p,f,m,y,h;let g=(0,u.c)(38),{draggable:v,focused:w,hovered:x,rect:E,wasMaybeCollapsed:k,enableScrollIntoView:j}=e,_=(0,b.useRef)(null),I=(0,b.useRef)(!1),S=`${E.w}px`,M=`${E.h}px`,C=`translate(${E.x}px, ${E.y}px)`;g[0]!==S||g[1]!==M||g[2]!==C?(n={width:S,height:M,transform:C},g[0]=S,g[1]=M,g[2]=C,g[3]=n):n=g[3],t=n,g[4]!==j||g[5]!==w||g[6]!==k?(r=()=>{if(!I.current&&!k&&!0===w&&_.current&&j){let e=_.current;(0,tT.Z)(_.current,{behavior:t=>{0!==t.length&&e.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})},scrollMode:"if-needed",block:"center",inline:"nearest"})}I.current=!0===w},i=[w,k,j],g[4]=j,g[5]=w,g[6]=k,g[7]=r,g[8]=i):(r=g[7],i=g[8]),(0,b.useEffect)(r,i);let[$,A]=(0,b.useState)(!1);g[9]!==x?(o=()=>
155{if(!_.current||!x)return;let e=new IntersectionObserver(e=>{let[t]=e;A(t.boundingClientRect.top<0)},{threshold:1});return e.observe(_.current),()=>e.disconnect()},g[9]=x,g[10]=o):o=g[10],g[11]!==x||g[12]!==$?(a=[x,$],g[11]=x,g[12]=$,g[13]=a):a=g[13],(0,b.useEffect)(o,a);let[O,T]=(0,b.useState)(null);g[14]===Symbol.for("react.memo_cache_sentinel")?(s=()=>{T(null),window.dispatchEvent(new CustomEvent("sanity-overlay/exclusive-plugin-closed"))},g[14]=s):s=g[14];let R=s;g[15]===Symbol.for("react.memo_cache_sentinel")?(c=(e,t)=>{T({plugin:e,context:t})},g[15]=c):c=g[15];let P=c,L=O?.plugin.component,[N,z]=(0,b.useState)(!1);g[16]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{z(!1)},g[16]=d):d=g[16],g[17]!==x?(p=[x],g[17]=x,g[18]=p):p=g[18],(0,b.useEffect)(d,p),g[19]!==L||g[20]!==N?(f=N||L?(0,l.jsx)(tx,{onDismiss:R,blockScroll:N}):null,g[19]=L,g[20]=N,g[21]=f):f=g[21];let D=w?"":void 0,Z=x?"":void 0,U=$?"":void 0,V=v?"":void 0,F=N?"":void 0;return g[22]!==L||g[23]!==O||g[24]!==x||g[25]!==e?(m=L?(0,l.jsx)(rR,{"data-sanity-overlay-element":!0,onClick:rF,children:(0,l.jsx)(L,{...O.context,closeExclusiveView:R})}):x?(0,l.jsx)(rP,{...e,onActivateExclusivePlugin:P,onMenuOpenChange:z}):null,g[22]=L,g[23]=O,g[24]=x,g[25]=e,g[26]=m):m=g[26],g[27]!==t||g[28]!==D||g[29]!==Z||g[30]!==U||g[31]!==V||g[32]!==F||g[33]!==m?(y=(0,l.jsx)(rS,{"data-focused":D,"data-hovered":Z,"data-flipped":U,"data-draggable":V,"data-menu-open":F,ref:_,style:t,children:m}),g[27]=t,g[28]=D,g[29]=Z,g[30]=U,g[31]=V,g[32]=F,g[33]=m,g[34]=y):y=g[34],g[35]!==f||g[36]!==y?(h=(0,l.jsxs)(l.Fragment,{children:[f,y]}),g[35]=f,g[36]=y,g[37]=h):h=g[37],h});function rN(e){return"object"==typeof e&&"component"in e?e:{component:e,props:{}}}let rz=(0,b.memo)(function(e){let t,n,r,i;let o=(0,u.c)(6),a=(0,b.useSyncExternalStore)(rW,rY);return o[0]!==e.href||o[1]!==a?(n=function e(t,n){try{let r=new URL(t,typeof location>"u"?void 0:location.origin);if(r.hash){let t=new URL(e(r.hash.slice(1),n));return`${r.origin}${r.pathname}${r.search}#${t.pathname}${t.search}`}return r.searchParams.set("preview",n),r.toString()}catch{return t}}(e.href,a),o[0]=e.href,o[1]=a,o[2]=n):n=o[2],t=n,o[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,l.jsx)(rO,{padding:2,children:(0,l.jsx)(L.xv,{size:1,weight:"medium",children:"Open in Studio"})}),o[3]=r):r=o[3],o[4]!==t?(i=(0,l.jsx)(L.xu,{as:"a",href:t,target:"_blank",rel:"noopener noreferrer",children:r}),o[4]=t,o[5]=i):i=o[5],i});function rD(e){return void 0!==e}function rZ(e){return e.exclusive.length>0}function rU(e){e.stopPropagation()}function rV(e){return(0,l.jsx)(b.Fragment,{children:e.hud.map(t=>{let n=t.component;return n?(0,l.jsx)(n,{...e.context},t.name):null})},e.id)}function rF(e){e.stopPropagation()}function rW(e){let t=()=>e();return window.addEventListener("popstate",t),()=>window.removeEventListener("popstate",t)}function rY(){return window.location.href}let rq=e=>{let t;let n=(0,u.c)(5),{dragGroupRect:r}=e,i=`${r.y}px`,o=`${r.x}px`,a=`${r.w-1}px`,s=`${r.h-1}px`;return n[0]!==i||n[1]!==o||n[2]!==a||n[3]!==s?(t=(0,l.jsx)("div",{style:{position:"absolute",top:i,left:o,width:a,height:s,border:"1px dashed #f0709b",pointerEvents:"none"}}),n[0]=i,n[1]=o,n[2]=a,n[3]=s,n[4]=t):t=n[4],t},rG=e=>{let t;let n=(0,u.c)(4),{dragInsertPosition:r}=e;if(null===r)return;let i=r?.left||r?.right?"horizontal":"vertical",o=0,a=0,s=0,c=0;if("horizontal"===i){let{left:e,right:t}=r;if(s=6,t&&e){let n=e.rect.x+e.rect.w,r=t.rect.x,i=.0125*Math.min(t.rect.h,e.rect.h);o=.5*n+.5*r-3,a=e.rect.y+i,c=Math.min(t.rect.h,e.rect.h)-2*i}else if(t&&!e){let e=.0125*t.rect.h;o=t.rect.x-3,a=t.rect.y+e,c=t.rect.h-2*e}else if(e&&!t){let t=.0125*e.rect.h;o=e.rect.x+e.rect.w-3,a=e.rect.y+t,c=e.rect.h-2*t}}else{let{bottom:e,top:t}=r;if(e&&t){let n=Math.min(t.rect.x,e.rect.x),r=t.rect.y+t.rect.h,i=e.rect.y,l=.0125*Math.min(e.rect.w,t.rect.w);c=6,o=n+l,a=.5*r+.5*i-3,s=Math.max(e.rect.w,t.rect.w)-2*l}else if(e&&!t){let t=.0125*e.rect.w;o=e.rect.x+t,a=e.rect.y-3,s=e.rect.w-2*t,c=6}else if(t&&!e){let e=.0125*t.rect.w;o=t.rect.x+e,a=t.rect.y+t.rect.h-3,s=t.rect.w-2*e,c=6}}let d=`${s}px`,p=`${c}px`,f=`translate(${o}px, ${a}px)`;return n[0]!==d||n[1]!==p||n[2]!==f?(t=(0,l.jsx)("div",{style:{position:"absolute",width:d,height:p,transform:f,background:"#556bfc",border:"2px s
155olid white",borderRadius:"999px",zIndex:"999999"}}),n[0]=d,n[1]=p,n[2]=f,n[3]=t):t=n[3],t},rB=N.zo.div`
156  --drag-preview-opacity: 0.98;
157  --drag-preview-skeleton-stroke: #ffffff;
158
159  @media (prefers-color-scheme: dark) {
160    --drag-preview-skeleton-stroke: #383d51;
161  }
162
163  position: fixed;
164  display: grid;
165  transform: ${({$scaleFactor:e,$width:t,$height:n})=>`translate(calc(var(--drag-preview-x) - ${t/2}px), calc(var(--drag-preview-y) - ${n/2}px)) scale(${e})`};
166  width: ${({$width:e})=>`${e}px`};
167  height: ${({$height:e})=>`${e}px`};
168  z-index: 9999999;
169  opacity: var(--drag-preview-opacity);
170  cursor: move;
171
172  .drag-preview-content-wrapper {
173    position: relative;
174    width: 100%;
175    height: 100%;
176    container-type: inline-size;
177  }
178
179  [data-ui='card'] {
180    position: relative;
181    width: 100%;
182    height: 100%;
183  }
184
185  .drag-preview-skeleton {
186    position: absolute;
187    inset: 0;
188
189    rect {
190      stroke: var(--drag-preview-skeleton-stroke);
191    }
192  }
193
194  .drag-preview-handle {
195    position: absolute;
196    top: 4cqmin;
197    left: 4cqmin;
198    width: 6cqmin;
199    fill: var(--drag-preview-handle-fill);
200  }
201`,rH=e=>{var t,n;let r,i,o,a,s,c,d,p,f,m,y,h,g,v,b,w,x,E,k,j,_;let I=(0,u.c)(50),{skeleton:S}=e,M=Math.min(S.maxWidth,window.innerWidth/2),C=S.w>M?M/S.w:1,$=S.offsetX*C,A=S.offsetY*C,O=(0,L.Bj)(),T=(0,L.g9)(),R=T.radius[~~((n=(S.w-0)*((t=T.radius.length-2)-1)/1920+1)<1?1:n>t?t:n)];if(I[0]!==$||I[1]!==A||I[2]!==O||I[3]!==R||I[4]!==C||I[5]!==S.childRects||I[6]!==S.h||I[7]!==S.w){let e=S.childRects.filter(rK),t=S.childRects.filter(rJ);i=rB,a=S.w,s=S.h,c=$,d=A,p=C,r=L.Zb,h=R,g=4,v="hidden",b="transparent",w=O?"dark":"light",y="drag-preview-content-wrapper",f="drag-preview-skeleton",m=`0 0 ${S.w} ${S.h}`,o=[...e,...t],I[0]=$,I[1]=A,I[2]=O,I[3]=R,I[4]=C,I[5]=S.childRects,I[6]=S.h,I[7]=S.w,I[8]=r,I[9]=i,I[10]=o,I[11]=a,I[12]=s,I[13]=c,I[14]=d,I[15]=p,I[16]=f,I[17]=m,I[18]=y,I[19]=h,I[20]=g,I[21]=v,I[22]=b,I[23]=w}else r=I[8],i=I[9],o=I[10],a=I[11],s=I[12],c=I[13],d=I[14],p=I[15],f=I[16],m=I[17],y=I[18],h=I[19],g=I[20],v=I[21],b=I[22],w=I[23];return I[24]!==o||I[25]!==T.color?(x=o.map((e,t)=>(0,l.jsx)("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:T.color.skeleton.from},t)),I[24]=o,I[25]=T.color,I[26]=x):x=I[26],I[27]!==x||I[28]!==f||I[29]!==m?(E=(0,l.jsx)("svg",{className:f,viewBox:m,children:x}),I[27]=x,I[28]=f,I[29]=m,I[30]=E):E=I[30],I[31]!==E||I[32]!==y?(k=(0,l.jsx)("div",{className:y,children:E}),I[31]=E,I[32]=y,I[33]=k):k=I[33],I[34]!==r||I[35]!==k||I[36]!==h||I[37]!==g||I[38]!==v||I[39]!==b||I[40]!==w?(j=(0,l.jsx)(r,{radius:h,shadow:g,overflow:v,tone:b,scheme:w,children:k}),I[34]=r,I[35]=k,I[36]=h,I[37]=g,I[38]=v,I[39]=b,I[40]=w,I[41]=j):j=I[41],I[42]!==i||I[43]!==a||I[44]!==s||I[45]!==c||I[46]!==d||I[47]!==p||I[48]!==j?(_=(0,l.jsx)(i,{$width:a,$height:s,$offsetX:c,$offsetY:d,$scaleFactor:p,children:j}),I[42]=i,I[43]=a,I[44]=s,I[45]=c,I[46]=d,I[47]=p,I[48]=j,I[49]=_):_=I[49],_};function rK(e){return"IMG"===e.tagName}function rJ(e){return"IMG"!==e.tagName}let rX=(0,N.zo)(L.Zb)`
202  position: fixed;
203  bottom: 2rem;
204  left: 2rem;
205`,rQ=()=>{let e,t;let n=(0,u.c)(2);return n[0]===Symbol.for("react.memo_cache_sentinel")?(e={zIndex:"999999"},n[0]=e):e=n[0],n[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,l.jsx)(rX,{padding:2,shadow:2,radius:2,style:e,children:(0,l.jsxs)(L.kC,{align:"center",gap:2,children:[(0,l.jsx)(L.SV,{keys:["Shift"]}),(0,l.jsx)(L.xv,{size:1,children:"Zoom Out"}),(0,l.jsx)(ty.Qq,{})]})}),n[1]=t):t=n[1],t},r0=(e,t)=>{let{type:n}=t;switch(n){case"element/register":return e.find(e=>e.id===t.id)?e:[...e,{id:t.id,activated:!1,element:t.element,focused:!1,hovered:!1,rect:t.rect,sanity:t.sanity,dragDisabled:t.dragDisabled,targets:t.targets,elementType:t.elementType}];case"element/activate":return e.map(e=>e.id===t.id?{...e,activated:!0}:e);case"element/update":return e.map(e=>e.id===t.id?{...e,sanity:t.sanity,rect:t.rect,targets:t.targets,elementType:t.elementType}:e);case"element/unregister":return e.filter(e=>e.id!==t.id);case"element/deactivate":return e.map(e=>e.id===t.id?{...e,activated:!1,hovered:!1}:e);case"element/mouseenter":return e.map(e=>e.id===t.id?{...e,rect:t.rect,hovered:!0}:{...e,hovered:!1});case"element/mouseleave":return e.map(e=>e.id===t.id?{...e,hovered:!1}:e);case"element/updateRect":return e.map(e=>e.id===t.id?{...e,rect:t.rect}:e);case"element/click":return e.map(e=>({...e,focused:e.id===t.id&&"clicked"}));case"overlay/reset-mouse-state":return e.map(e=>({...e,focused:!1,hovered:!1}));case"overlay/blur":return e.map(e=>({...e,focused:!1}));case"presentation/blur":return e.map(e=>({...e,focused:!1}));case"presentation/focus":{let n=e.find(e=>"clicked"===e.focused);return e.map(e=>
205{let r="path"in e.sanity&&e.sanity.id===t.data.id&&e.sanity.path===t.data.path;return n&&e===n&&r?e:{...e,focused:r&&n?"duplicate":r}})}default:return e}};function r1(e,t){let{type:n}=t,{contextMenu:r,focusPath:i,perspective:o,isDragging:a,dragInsertPosition:s,dragShowMinimap:l,dragShowMinimapPrompt:u,dragSkeleton:c,dragMinimapTransition:d,dragGroupRect:p}=e,f=!1;if("presentation/focus"===n){let n=e.focusPath;n!==(i=t.data.path)&&(f=n.slice(i.length).startsWith("["))}return"presentation/perspective"===n&&(o=t.data.perspective),"element/contextmenu"===n&&(r="sanity"in t?{node:t.sanity,position:t.position}:null),("element/click"===n||"element/mouseleave"===n||"overlay/blur"===n||"presentation/blur"===n||"presentation/focus"===n)&&(r=null),"overlay/dragUpdateInsertPosition"===n&&(s=t.insertPosition),"overlay/dragStart"===n&&(a=!0),"overlay/dragUpdateSkeleton"===t.type&&(c=t.skeleton),"overlay/dragEnd"===n&&(a=!1),"overlay/dragToggleMinimapPrompt"===t.type&&(u=t.display),"overlay/dragStartMinimapTransition"===n&&(d=!0),"overlay/dragEndMinimapTransition"===n&&(d=!1),"overlay/dragUpdateGroupRect"===n&&(p=t.groupRect),"overlay/dragToggleMinimap"===n&&(l=t.display),{...e,contextMenu:r,elements:r0(e.elements,t),dragInsertPosition:s,dragSkeleton:c,dragGroupRect:p,isDragging:a,focusPath:i,perspective:o,wasMaybeCollapsed:f,dragShowMinimap:l,dragShowMinimapPrompt:u,dragMinimapTransition:d}}let r2=function(e){let t,n,r,i,o,a,s;let c=(0,u.c)(13),{comlink:d,children:p}=e;c[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],c[0]=t):t=c[0];let[f,m]=(0,b.useState)(t);c[1]!==d?(n=async e=>{if(d)try{let t=await d.fetch("visual-editing/preview-snapshots",void 0,{signal:e,suppressWarnings:!0});m(t.snapshots)}catch{}},c[1]=d,c[2]=n):n=c[2];let y=n;return c[3]!==d||c[4]!==y?(r=()=>{if(!d)return;let e=new AbortController,t=d.onStatus(()=>{y(e.signal)},"connected");return()=>{e.abort(),t()}},i=[d,y],c[3]=d,c[4]=y,c[5]=r,c[6]=i):(r=c[5],i=c[6]),(0,b.useEffect)(r,i),c[7]!==d?(o=()=>d?.on("presentation/preview-snapshots",e=>{m(e.snapshots)}),a=[d],c[7]=d,c[8]=o,c[9]=a):(o=c[8],a=c[9]),(0,b.useEffect)(o,a),c[10]!==p||c[11]!==f?(s=(0,l.jsx)(r_.Provider,{value:f,children:p}),c[10]=p,c[11]=f,c[12]=s):s=c[12],s};function r3(e){return"document"===e.type}function r4(e){return"type"===e.type}let r5=function(e){let t,n,r,i,o,a,s,c,d,p,f,m;let y=(0,u.c)(22),{comlink:h,children:g,elements:v}=e;y[0]===Symbol.for("react.memo_cache_sentinel")?(t=new Map,y[0]=t):t=y[0];let[w,x]=(0,b.useState)(t),[E,k]=(0,b.useState)(null);y[1]!==h?(n=()=>{if(!h)return;let e=async function(e){if(h)try{let t=await h.fetch("visual-editing/schema",void 0,{signal:e,suppressWarnings:!0});k(t.schema)}catch{}},t=new AbortController,n=h.onStatus(()=>{e(t.signal)},"connected");return()=>{t.abort(),n()}},r=[h],y[1]=h,y[2]=n,y[3]=r):(n=y[2],r=y[3]),(0,b.useEffect)(n,r),y[4]===Symbol.for("react.memo_cache_sentinel")?(i=[],y[4]=i):i=y[4];let j=(0,b.useRef)(i),_=(0,b.useDeferredValue)(v);y[5]!==_?(o=_.reduce((e,t)=>{let{sanity:n}=t;if(!("id"in n)||!n.path.includes("[_key=="))return e;let r=n.path.split(".").toReversed().reduce((e,t)=>e.length?[t,...e]:t.includes("[_key==")?[t]:[],[]).join(".");return e.find(e=>e.id===n.id&&e.path===r)||e.push({id:n.id,path:r}),e},[]),y[5]=_,y[6]=o):o=y[6];let I=o,S=(0,b.useRef)(null);y[7]!==h||y[8]!==I?(a=()=>{if(!I.length||!h)return;let e=async(e,t)=>{let n=j.current;try{j.current=e;let n=await h.fetch("visual-editing/schema-union-types",{paths:e},{signal:t,suppressWarnings:!0});if(t.aborted)return;x(n.types),S.current=null}catch{}t.aborted&&(j.current=n)};I.some(e=>!j.current.find(t=>{let{id:n,path:r}=t;return n===e.id&&r===e.path}))&&(S.current?.abort(),S.current=new AbortController,e(I,S.current.signal))},s=[h,I],y[7]=h,y[8]=I,y[9]=a,y[10]=s):(a=y[9],s=y[10]),(0,b.useEffect)(a,s),y[11]!==E?(c=(e,t)=>{if(!E||"string"!=typeof e&&(!("path"in e)||!Array.isArray(E)))return;let n="string"==typeof e?e:e.type;return E.filter("document"===(t||"document")?r3:r4).find(e=>e.name===n)},y[11]=E,y[12]=c):c=y[12];let M=c;y[13]!==M||y[14]!==w?(d=e=>{if(!("path"in e))return{field:void 0,parent:void 0};let t=M(e);if(!t)return{field:void 0,parent:void 0};let n=e.path.split(".").flatMap(r6);try{return function t(n,r,i,o){let a=void 0===o?[]:o;if(!n)return{field:void 0,parent:void 0};let[s,...l]=r;if("fields"in n){let e=n.fields[s];if(!e&&"rest"in n)return t(n.rest,r,n,a);if(!l.length)return{field:e,parent:i};if(!e)throw Error(`[@sanity/visual-editing] No field could be resolved at path: "${[...a,...r].join(".")}"`);return t(e.value,l,n,[...a,s])}if("array"===n.type)return t(n.of,r,n,a);if("arrayItem"===n.type)return l.length?t(n.value,l,n,[...a,s]):{field:n,parent:i};if("union"===n.type){let r=s.startsWith("[_key==")?w?.get(e.id)?.get([a.join("."),s].filter(
205Boolean).join("")):s;return t(n.of.find(e=>"unionOption"===e.type?e.name===r:e),l,n,[...a,s])}if("unionOption"===n.type)return s?t(n.value,r,n,a):{field:n,parent:i};if("inline"===n.type)return t(M(n.name,"type").value,r,n,a);throw Error(`[@sanity/visual-editing] No field could be resolved at path: "${[...a,...r].join(".")}"`)}(t,n,void 0)}catch(e){return e instanceof Error&&console.warn(e.message),{field:void 0,parent:void 0}}},y[13]=M,y[14]=w,y[15]=d):d=y[15];let C=d;return y[16]!==C||y[17]!==M?(f={getField:C,getType:M},y[16]=C,y[17]=M,y[18]=f):f=y[18],p=f,y[19]!==g||y[20]!==p?(m=(0,l.jsx)(rf.Provider,{value:p,children:g}),y[19]=g,y[20]=p,y[21]=m):m=y[21],m};function r6(e){return e.includes("[")?e.split(/(\[.+\])/,2):[e]}let r9=(e=>{let t=e,n=new Set;return{getState:()=>t,setState:e=>{t=e(t),n.forEach(e=>e())},subscribe:e=>(n.add(e),()=>n.delete(e))}})({}),r8=e=>{let t,n,r,i,o,a,s;let c=(0,u.c)(11),{comlink:d,children:p}=e;return c[0]!==d?(t=()=>d?.on("presentation/shared-state",r7),n=[d],c[0]=d,c[1]=t,c[2]=n):(t=c[1],n=c[2]),(0,b.useEffect)(t,n),c[3]!==d?(r=()=>{(async function(){let e=await d?.fetch("visual-editing/shared-state",void 0,{suppressWarnings:!0});e&&r9.setState(()=>e.state)})().catch(ie)},i=[d],c[3]=d,c[4]=r,c[5]=i):(r=c[4],i=c[5]),(0,b.useEffect)(r,i),c[6]!==d?(a={comlink:d,store:r9},c[6]=d,c[7]=a):a=c[7],o=a,c[8]!==p||c[9]!==o?(s=(0,l.jsx)(tf.Provider,{value:o,children:p}),c[8]=p,c[9]=o,c[10]=s):s=c[10],s};function r7(e){"value"in e?r9.setState(t=>({...t,[e.key]:e.value})):r9.setState(t=>Object.fromEntries(Object.entries(t).filter(t=>{let[n]=t;return n!==e.key})))}function ie(e){console.debug(e),console.warn("[@sanity/visual-editing]: Failed to fetch shared state. Check your version of `sanity` is up-to-date")}let it=e=>{let t,n;let r=(0,u.c)(5),{children:i,comlink:o}=e;r[0]!==o?(t=(e,t)=>{if(!o)return;let n=tj[e];if(n)o.post("visual-editing/telemetry-log",{event:n,data:t});else throw Error(`Telemetry event: ${e} does not exist`)},r[0]=o,r[1]=t):t=r[1];let a=t;return r[2]!==i||r[3]!==a?(n=(0,l.jsx)(t_.Provider,{value:a,children:i}),r[2]=i,r[3]=a,r[4]=n):n=r[4],n};function ir(){}function ii(e){return e.id}function io(e){return!!e}function ia(e){let{sanity:t}=e;return t&&"id"in t?t:null}let is=N.zo.div`
206  background-color: transparent;
207  direction: ltr;
208  inset: 0;
209  pointer-events: none;
210  position: absolute;
211  width: 100%;
212  height: 100%;
213  z-index: ${({$zIndex:e})=>e??"9999999"};
214`;function il(e){let t,n;return t=requestAnimationFrame(()=>{n=requestAnimationFrame(e)}),()=>{void 0!==t&&cancelAnimationFrame(t),void 0!==n&&cancelAnimationFrame(n)}}let iu=e=>{let t,n,r,i,o;let a=(0,u.c)(8),{documentIds:s}=e;a[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],a[0]=t):t=a[0];let[l,c]=(0,b.useState)(t);a[1]!==s?(n=()=>{c(e=>{let t=Array.from(new Set(s));return e.length===t.length&&e.reduce(iy,t)?.length===0?e:t})},r=[s],a[1]=s,a[2]=n,a[3]=r):(n=a[2],r=a[3]),(0,b.useEffect)(n,r);let d=ep();return a[4]!==d||a[5]!==l?(i=()=>{for(let e of l)d.send({type:"observe",documentId:R(e)}),d.send({type:"observe",documentId:P(e)});return()=>{for(let e of l)d.send({type:"unobserve",documentId:R(e)}),d.send({type:"unobserve",documentId:P(e)})}},o=[d,l],a[4]=d,a[5]=l,a[6]=i,a[7]=o):(i=a[6],o=a[7]),(0,b.useEffect)(i,o),null},ic=e=>{let t,n,r;let i=(0,u.c)(12),{comlink:o,dispatch:a,inFrame:s,inPopUp:l,onDrag:c,overlayEnabled:d,rootElement:p}=e,{dispatchDragEndEvent:f}=function(){let e,t,n;let r=(0,u.c)(4),{getDocument:i}=ev();return r[0]!==i?(e=()=>{let e=e=>{let{insertPosition:t,target:n,preventInsertDefault:r}=e.detail;if(r)return;let o=function(e){if(e){let{top:t,right:n,bottom:r,left:i}=e;if(i||t)return{node:(i??t).sanity,position:"after"};if(n||r)return{node:(n??r).sanity,position:"before"}}}(t);if(o){let e=i(n.id),{node:t,position:r}=o,{key:a,hasExplicitKey:s}=ex(n),{path:l,key:u}=ex(t);l&&u&&u!==a&&e.patch(async e=>{let{getSnapshot:t}=e,i=ec(await t(),n.path);return s?[X(l,J({_key:a})),X(l,H(i,r,{_key:u}))]:[X(l,J(~~a)),X(l,H(i,r,u>a?~~u-1:~~u))]})}};return window.addEventListener("sanity/dragEnd",e),()=>{window.removeEventListener("sanity/dragEnd",e)}},t=[i],r[0]=i,r[1]=e,r[2]=t):(e=r[1],t=r[2]),(0,b.useEffect)(e,t),r[3]===Symbol.for("react.memo_cache_sentinel")?(n={dispatchDragEndEvent:rp},r[3]=n):n=r[3],n}(),m=tI();i[0]!==o||i[1]!==a||i[2]!==f||i[3]!==c||i[4]!==m?(t=e=>{if("element/click"===e.type){let{sanity:t}=e;o?.post("visual-editing/focus",t),m("Visual Editing Overlay Clicked",null)}else if("overlay/activate"===e.type)o?.post("visual-editing/toggle",{enabled:!0});else if("overlay/deactivate"===e.type)o?.post("visual-editing/toggle",{enabled:!1});else if("overlay/dragEnd"===e.type){let{insertPosition:t,target:n,dragGroup:r,flow:i,preventInsertDefault:o}=e;f({insertPosition:t,target:n,dragGroup:r,flow:i,preventInsertDefault:o}),t&&m("Visual Editing Drag Sequence Completed",null)}else if("overlay/dragUpdateCursorPosition"===e.type){c(e.x,e.y);return}else if("overlay/dragToggleMinimap"===e.type&&!0===e.display)m("Visual Editing Drag Minimap Enabled",null);else if("overlay/setCursor"===e.type){let{element:t,cursor:n}=e;n?t.style.cursor=n:t.style.removeProperty("cursor")}a(e)},i[0]=o,i[1]=a,i[2]=f,i[3]=c,i[4]=m,i[5]=t):t=i[5];let y=function(e,t,n,r){let i,o;let a=(0,u.c)(7),s=(0,b.useRef)(void 0),l=ep()!==ee;return a[0]!==e||a[1]!==t||a[2]!==n||a[3]!==r||a[4]!==l?(i=()=>
214{if(e)return s.current=function({handler:e,overlayElement:t,inFrame:n,inPopUp:r,optimisticActorReady:i}){let o=!1,a=new Map,s=new WeakMap,l=new Set,u=new WeakMap,c=new WeakMap,d,p,f,m=!1,y=[],h=()=>y[y.length-1];function g(e,t){e.removeEventListener("click",t.click,{capture:!0}),e.removeEventListener("contextmenu",t.contextmenu,{capture:!0}),e.removeEventListener("mousemove",t.mousemove,{capture:!0}),e.removeEventListener("mousedown",t.mousedown,{capture:!0}),e.removeEventListener("mouseenter",t.mouseenter),e.removeEventListener("mouseleave",t.mouseleave)}function v({id:t,elements:n,handlers:r}){let{element:i,measureElement:o}=n;i.addEventListener("click",r.click,{capture:!0}),i.addEventListener("contextmenu",r.contextmenu,{capture:!0}),i.addEventListener("mousemove",r.mousemove,{once:!0,capture:!0}),i.addEventListener("mousedown",r.mousedown,{capture:!0}),d.observe(o),e({type:"element/activate",id:t})}function b({id:t,elements:n,handlers:r}){let{element:i,measureElement:o}=n;g(i,r),d.unobserve(o),y=y.filter(e=>e!==i),e({type:"element/deactivate",id:t})}function w(t){if(!(!n&&!r||!i))for(let n of y){if(t===n){let n=s.get(t)?.sanity;if(!n||!ts(n))return;if(tp(t,n,l,s)){let n=t.style.cursor;n&&c.set(t,n),e({type:"overlay/setCursor",element:t,cursor:"move"});continue}}x(n)}}function x(t){let n=c.get(t);e({type:"overlay/setCursor",element:t,cursor:n})}function E(c){for(let d of function e(t){let n=[];function r(e,t,n,r){let i=function(e){if("object"==typeof e&&null!==e)return eO(e);try{let t=JSON.parse(e);return eO(t)}catch{return function(e){let t=e.split(";").reduce((e,t)=>{let[n,r]=t.split("=");if(!n||t.includes("=")&&!r)return e;switch(n){case"id":e.id=r;break;case"type":e.type=r;break;case"path":e.path=$.toString(function(e){let t=[];for(let n of e.split(".")){let e=eS.exec(n);if(e){t.push(e[1],Number(e[2]));continue}let r=eM.exec(n);if(r){t.push(r[1],[Number(r[2]),Number(r[3])]);continue}let i=eC.exec(n);if(i){t.push(i[1],{_key:i[2]});continue}t.push(n)}return t}(r));break;case"base":e.baseUrl=decodeURIComponent(r);break;case"perspective":e.perspective=r;break;case"tool":e.tool=r;break;case"workspace":e.workspace=r;break;case"projectId":e.projectId=r;break;case"dataset":e.dataset=r}return e},{});if((0,ek.is)(eI,t))return t}(e)}}(t);if(!i)return;let o=function e(t){let{display:n}=window.getComputedStyle(t);if("inline"!==n)return t;let r=t.parentElement;return r?e(r):null}(e);if(o)return{elements:{element:e,measureElement:o},sanity:i,reason:n,preventGrouping:r}}if(t)for(let i of t.childNodes)!function t(i,o){let a=function(t){let{nodeType:n,parentElement:i,textContent:o}=t;if(tr(t)&&t.dataset?.sanityEditTarget!==void 0){let n=tl(e(t).map(e=>"element"===e.type?e.commonSanity:void 0).filter(e=>void 0!==e));if(n)return{reason:"edit-target",elements:{element:t,measureElement:t},sanity:n}}else if(n===Node.TEXT_NODE&&i&&o){let e=tn(o);return e?r(i,e,"stega-text",!0):void 0}else if(tr(t)){if("SCRIPT"===t.tagName||"SANITY-VISUAL-EDITING"===t.tagName)return;if(t.dataset?.sanity)return r(t,t.dataset.sanity,"data-attribute",!!(t.textContent&&tt(t.textContent)));if(t.dataset?.sanityEditInfo)return r(t,t.dataset.sanityEditInfo,"data-attribute",!!(t.textContent&&tt(t.textContent)));if(ti(t)){let e=tn(t.alt,!0);return e?r(t,e,"stega-attribute"):void 0}if(to(t)){let e=tn(t.dateTime,!0);return e?r(t,e,"stega-attribute"):void 0}if(ta(t)){if(!t.ariaLabel)return;let e=tn(t.ariaLabel,!0);return e?r(t,e,"stega-attribute"):void 0}}}(i),s=o;if(tr(i)&&i.dataset?.sanityEditGroup!==void 0&&(s={type:"group",elements:{element:i,measureElement:i},targets:[]},n.push(s)),a){let e={elements:a.elements,sanity:a.sanity,reason:a.reason};s&&!a.preventGrouping?s.targets.push(e):n.push({elements:a.elements,type:"element",targets:[e]})}if(tr(i)&&!ti(i)&&!("SCRIPT"===i.tagName||"SANITY-VISUAL-EDITING"===i.tagName))for(let e of i.childNodes)t(e,s)}(i,void 0);return n.map(e=>{if(0===e.targets.length&&"group"===e.type)return{...e,commonSanity:void 0};let t=1===e.targets.length?e.targets[0].sanity:tl(e.targets.map(({sanity:e})=>e).filter(e=>void 0!==e))||e.targets[0].sanity;return t?{...e,commonSanity:t}:null}).filter(e=>null!==e)}(c)){if("group"===d.type){for(let e of d.targets){let t=s.get(e.elements.element);t&&"element"===t.type&&k(e.elements.element)}0===d.targets.length&&k(d.elements.element)}if(!d.commonSanity)continue;let{element:c}=d.elements;s.has(c)?function(t){let{element:n}=t.elements,r=s.get(n);r&&(s.set(n,{...r,sanity:t.commonSanity}),e({type:"element/update",elementType:r.type,id:r.id,rect:eW(n),sanity:t.commonSanity,targets:t.targets.map(e=>({sanity:e.sanity,element:e.elements.element}))}))}(d):function({type:c,elements:d,commonSanity:f,targets:g}){let{element:b,measureElement:E}=d,k={click(t){let r=t.target;if(b===h()&&b.contains(r)){n&&(t.preventDefault(),t.stopPropagation());let r=s.get(b)?.sanity;r&&!m&&e({type:"element/click",id:j,sanity:r})}},contextmenu(t){if(!("path"in f)||!n&&!r||!i||!f.path.split(".").pop()?.includes("[_key=="))return;let o=t.target;b===h()&&b.contains(o)&&((n||r)&&(t.preventDefault(),t.stopPropagation()),e({type:"element/contextmenu",id:j,position:{x:t.clientX,y:t.clientY},sanity:f}))},mousedown(t){if(t.preventDefault(),t.currentTarget!==y.at(-1)||b.getAttribute("data-sanity-drag-disable")||!n&&!r||!i)return;let o=s.get(b)?.sanity;if(!o||!ts(o)||!tu(o.path))return;let a=tp(b,f,l,s);a&&function(e){var t;let{mouseEvent:n,element:r,overlayGroup:i,handler:o,target:a,onSequenceStart:s,onSequenceEnd:l}=e;if(0!==n.button)return;window.focus();let u=i.map(e=>eW(e.elements.element)),c=r.getAttribute("data-sanity-drag-flow")||((t=u).some(e=>t.filter(t=>!eq(e,t)).some(t=>e.y===t.y))?"horizontal":"vertical"),d=r.getAttribute("data-sanity-drag-group"),p=!!r.getAttribute("data-sanity-drag-minima
214p-disable"),f=!!r.getAttribute("data-sanity-drag-prevent-default"),m=r.getAttribute("data-unstable_sanity-drag-document-height"),y=r.getAttribute("data-unstable_sanity-drag-group-height"),h=null,g=eQ(n),v=document.body,{minYScaled:b,scaleFactor:w}=function(e,t){let n=t||eK(e).height,r=(n+=200)>window.innerHeight?window.innerHeight/n:1,{min:i}=eK(e.map(e=>eH(e,r,{x:window.innerWidth/2,y:0})));return{scaleFactor:r,minYScaled:i-100*r}}(u,y?~~y:null),x=!1,E=!1,k=!0;e4||(e8={body:{overflow:window.getComputedStyle(document.body).overflow,height:window.getComputedStyle(document.body).height},documentElement:{overflow:window.getComputedStyle(document.documentElement).overflow,height:window.getComputedStyle(document.documentElement).height}},e9=m?~~m:document.documentElement.scrollHeight);let j=setInterval(()=>{u=i.map(e=>eW(e.elements.element))},150),_=()=>{w>=1||(o({type:"overlay/dragUpdateSkeleton",skeleton:e0(e6,r,w)}),o({type:"overlay/dragToggleMinimapPrompt",display:!1}),e1(v,w,b,o,150).then(()=>{setTimeout(()=>{o({type:"overlay/dragUpdateGroupRect",groupRect:e2(u)})},300)}))},I=e=>{Math.abs(e.deltaY)>=10&&w<1&&!e4&&!E&&!p&&k&&(o({type:"overlay/dragToggleMinimapPrompt",display:!0}),E=!0),!e.shiftKey||e4||p||(window.dispatchEvent(new CustomEvent("unstable_sanity/dragApplyMinimap")),e4=!0,setTimeout(()=>{_()},50))},S=e=>{if(e.preventDefault(),e5=function(e){let t=document.body,n=window.getComputedStyle(t).transform;if("none"===n)return{x:e.x,y:e.y};let r=new DOMMatrix(n).inverse(),i=new DOMPoint(e.x,e.y).matrixTransform(r);return{x:i.x,y:i.y}}(e6=eQ(e)),4>Math.abs(eG(e6,g)))return;if(!x){let e=e2(u),t=e0(e6,r,1);o({type:"overlay/dragStart",flow:c}),o({type:"overlay/dragUpdateSkeleton",skeleton:t}),o({type:"overlay/dragUpdateGroupRect",groupRect:e}),x=!0,s()}o({type:"overlay/dragUpdateCursorPosition",x:e6.x,y:e6.y}),!e.shiftKey||e4||p||(window.dispatchEvent(new CustomEvent("unstable_sanity/dragApplyMinimap")),e4=!0,setTimeout(()=>{_()},50));let t=function(e,t,n){if("horizontal"===n){let r={x1:e.x,y1:e.y,x2:e.x-1e8,y2:e.y},i={x1:e.x,y1:e.y,x2:e.x+1e8,y2:e.y};return{left:eB(r,t,n),right:eB(i,t,n)}}{let r={x1:e.x,y1:e.y,x2:e.x,y2:e.y-1e8},i={x1:e.x,y1:e.y,x2:e.x,y2:e.y+1e8};return{top:eB(r,t,n),bottom:eB(i,t,n)}}}(e6,u,c);JSON.stringify(h)!==JSON.stringify(t)&&o({type:"overlay/dragUpdateInsertPosition",insertPosition:eX(i,h=t,c)})},M=()=>{k=!1,o({type:"overlay/dragEnd",target:a,insertPosition:h?eX(i,h,c):null,dragGroup:d,flow:c,preventInsertDefault:f}),E&&o({type:"overlay/dragToggleMinimapPrompt",display:!1}
214),e4||(clearInterval(j),l(),T(),O()),A()},C=e=>{"Shift"===e.key&&e4&&(e4=!1,o({type:"overlay/dragUpdateSkeleton",skeleton:e0(e6,r,1/w)}),window.dispatchEvent(new CustomEvent("unstable_sanity/dragResetMinimap")),setTimeout(()=>{e3(e5.y,v,e9,o,150,e8)},50),o({type:"overlay/dragUpdateGroupRect",groupRect:null}),k||(clearInterval(j),A(),T(),O(),l()))},$=()=>{o({type:"overlay/dragUpdateGroupRect",groupRect:null}),window.dispatchEvent(new CustomEvent("unstable_sanity/dragResetMinimap")),setTimeout(()=>{e3(e5.y,v,e9,o,150,e8).then(()=>{e4=!1})},50),clearInterval(j),A(),T(),O(),l()},A=()=>{window.removeEventListener("mousemove",S),window.removeEventListener("wheel",I),window.removeEventListener("mouseup",M)},O=()=>{window.removeEventListener("keyup",C)},T=()=>{window.removeEventListener("blur",$)};window.addEventListener("blur",$),window.addEventListener("keyup",C),window.addEventListener("wheel",I),window.addEventListener("mousemove",S),window.addEventListener("mouseup",M)}({element:b,handler:e,mouseEvent:t,overlayGroup:a,target:o,onSequenceStart:()=>{m=!0},onSequenceEnd:()=>{setTimeout(()=>{m=!1},250)}})},mousemove(e){k.mouseenter(e);let t=e.currentTarget;t&&(t.addEventListener("mouseenter",k.mouseenter),t.addEventListener("mouseleave",k.mouseleave))},mouseenter(){document.querySelector("vercel-live-feedback")&&b.closest("[data-vercel-edit-info]")||b.closest("[data-vercel-edit-target]")||(y.push(b),e({type:"element/mouseenter",id:j,rect:eW(b)}),w(b))},mouseleave(n){function r(){y.pop();let t=h();if(e({type:"element/mouseleave",id:j}),t){w(t);let n=s.get(t);n&&e({type:"element/mouseenter",id:n.id,rect:eW(t)})}x(b)}let{relatedTarget:i}=n,o=te(i),a=t.contains(o);if(e7(o)&&a)return function e(t){let n=i=>{let{relatedTarget:o}=i;te(o)?o&&e7(o)&&(t.removeEventListener("mouseleave",n),e(o)):(t.removeEventListener("mouseleave",n),r())};t.addEventListener("mouseleave",n)}(o);r()}},j=eF(),_={type:c,id:j,elements:d,sanity:f,handlers:k};l.add(b),u.set(E,b),a.set(j,b),s.set(b,_),p?.observe(b),e({type:"element/register",elementType:c,id:j,element:b,rect:eW(b),sanity:f,dragDisabled:!!b.getAttribute("data-sanity-drag-disable"),targets:g.map(e=>({sanity:e.sanity,element:e.elements.element}))}),o&&v(_)}(d)}}function k(t){let n=s.get(t);if(n){let{id:r,handlers:i}=n;g(t,i),d.unobserve(t),s.delete(t),l.delete(t),a.delete(r),e({type:"element/unregister",id:r})}}function j(t){let n=s.get(t);n&&e({type:"element/updateRect",id:n.id,rect:eW(t)})}function _(e){if(o)for(let t of e){let{target:e}=t,n=e7(e)&&s.get(e);n&&(t.isIntersecting?v(n):b(n))}}function I(t){let n=te(t.target);if(n){"capture"===n.dataset.sanityOverlayElement&&(t.preventDefault(),t.stopPropagation());return}y=[],e({type:"overlay/blur"})}function S(){y=[],e({type:"overlay/reset-mouse-state"})}function M(){for(let e of l)j(e)}function C(t){"Escape"===t.key&&(y=[],e({type:"overlay/blur"}))}function A(e){let{target:t}=e;if(!(t===window.document||!e7(t)))for(let e of l)t.contains(e)&&j(e)}function O(){o||(p=new IntersectionObserver(_,{threshold:.3}),l.forEach(e=>p.observe(e)),e({type:"overlay/activate"}),o=!0)}function T(){o&&(p?.disconnect(),l.forEach(e=>{let t=s.get(e);t&&b(t)}),e({type:"overlay/deactivate"}),o=!1)}function R(t){let{id:n}=t.detail,r=a.get(n);if(!r)return;let i=s.get(r)?.sanity;i&&e({type:"element/click",id:n,sanity:i})}return window.document.fonts.ready.then(()=>{for(let e of l)j(e)}),window.addEventListener("click",I),window.addEventListener("contextmenu",I),window.addEventListener("sanity-overlay/exclusive-plugin-closed",S),window.addEventListener("sanity-overlay/label-click",R),window.addEventListener("keydown",C),window.addEventListener("resize",M),window.addEventListener("scroll",A,{capture:!0,passive:!0}),d=new ResizeObserver(function(e){for(let t of e){let e=t.target;if(e7(e)){let t=u.get(e);if(!t)return;j(t)}}}),(f=new MutationObserver(function(e){let n=!1;for(let r of e){let{target:e,type:i}=r,o="characterData"===i?e.parentElement:e;if(!(o===t||t.contains(o))&&(n=!0,e7(o))){let e=o.parentElement?.closest("[data-sanity-edit-group]")||null;E({childNodes:[e7(e)?e:o]})}}if(n)for(let e of l)e.isConnected||k(e),s.get(e)?.type!=="group"||e.hasAttribute("data-sanity-edit-group")||k(e)})).observe(document.body,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),E(document.body),O(),{activate:O,deactivate:T,destroy:function(){window.removeEventListener("click",I),window.removeEventListener("contextmenu",I),window.removeEventListener("sanity-overlay/exclusive-plugin-closed",S),window.removeEventListener("sanity-overlay/label-click",R),window.removeEventListener("keydown",C),window.removeEventListener("resize",M),window.removeEventListener("scroll",A),f.disconnect(),d.disconnect(),l.forEach(e
214=>{k(e)}),a.clear(),l.clear(),y=[],T()}}}({handler:t,overlayElement:e,inFrame:n,inPopUp:r,optimisticActorReady:l}),()=>{s.current?.destroy(),s.current=void 0}},o=[e,t,n,r,l],a[0]=e,a[1]=t,a[2]=n,a[3]=r,a[4]=l,a[5]=i,a[6]=o):(i=a[5],o=a[6]),(0,b.useEffect)(i,o),s}(p,t,s,l);return i[6]!==y.current||i[7]!==d?(n=()=>{d?y.current?.activate():y.current?.deactivate()},i[6]=y.current,i[7]=d,i[8]=n):n=i[8],i[9]!==y||i[10]!==d?(r=[y,d],i[9]=y,i[10]=d,i[11]=r):r=i[11],(0,b.useEffect)(n,r),null},id=e=>{let t,n,r,i,o,a,s,c,d,p,f,m,y,h,g,v,w,x,E,k,j,_,I,S,M;let C=(0,u.c)(76),{comlink:$,comlinkStatus:A,componentResolver:O,inFrame:T,inPopUp:R,zIndex:P}=e,N=(0,L.Bj)();C[0]===Symbol.for("react.memo_cache_sentinel")?(t={contextMenu:null,dragInsertPosition:null,dragShowMinimap:!1,dragShowMinimapPrompt:!1,dragSkeleton:null,elements:[],focusPath:"",isDragging:!1,perspective:"published",wasMaybeCollapsed:!1,dragMinimapTransition:!1,dragGroupRect:null},C[0]=t):t=C[0];let[z,D]=(0,b.useReducer)(r1,t),{contextMenu:Z,dragInsertPosition:U,dragShowMinimap:V,dragShowMinimapPrompt:F,dragSkeleton:W,elements:Y,isDragging:q,perspective:G,wasMaybeCollapsed:B,dragMinimapTransition:H,dragGroupRect:K}=z,[J,X]=(0,b.useState)(null),[Q,et]=(0,b.useState)(!0);C[1]!==$?(n=()=>{let e=[$?.on("presentation/focus",e=>{D({type:"presentation/focus",data:e})}),$?.on("presentation/blur",e=>{D({type:"presentation/blur",data:e})}),$?.on("presentation/toggle-overlay",()=>{et(ih)})].filter(Boolean);return()=>e.forEach(ig)},r=[$],C[1]=$,C[2]=n,C[3]=r):(n=C[2],r=C[3]),(0,b.useEffect)(n,r),function(e,t){let n,r;let i=(0,u.c)(4);i[0]!==e||i[1]!==t?(n=()=>{let n=new AbortController;e?.fetch("visual-editing/fetch-perspective",void 0,{signal:n.signal,suppressWarnings:!0}).then(e=>{t({type:"presentation/perspective",data:e})}).catch(ir);let r=e?.on("presentation/perspective",e=>{t({type:"presentation/perspective",data:e})});return()=>{r?.(),n.abort()}},r=[e,t],i[0]=e,i[1]=t,i[2]=n,i[3]=r):(n=i[2],r=i[3]),(0,b.useEffect)(n,r)}($,D),function(e,t,n){let r,i,o;let a=(0,u.c)(7),s=(0,b.useRef)(void 0);a[0]!==e?(r=(t,n)=>{e?.post("visual-editing/documents",{documents:t,perspective:n})},a[0]=e,a[1]=r):r=a[1];let l=r;a[2]!==t||a[3]!==n||a[4]!==l?(i=()=>{let e=t.map(ia).filter(io),r=new Set(e.map(ii));if(!s.current||!function(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}(r,s.current.nodeIds)||n!==s.current.perspective){let t=Array.from(r).map(t=>{let{type:n,projectId:r,dataset:i}=e.find(e=>e.id===t);return r&&i?{_id:t,_type:n,_projectId:r,_dataset:i}:{_id:t,_type:n}});s.current={nodeIds:r,perspective:n},l(t,n)}},o=[t,n,l],a[2]=t,a[3]=n,a[4]=l,a[5]=i,a[6]=o):(i=a[5],o=a[6]),(0,b.useEffect)(i,o)}($,Y,G),C[4]!==J?(i=(e,t)=>{J&&(J.style.setProperty("--drag-preview-x",`${e}px`),J.style.setProperty("--drag-preview-y",`${t-window.scrollY}px`))},C[4]=J,C[5]=i):i=C[5];let en=i;C[6]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{let e=e=>{im(e)&&et(ib)},t=e=>{im(e)&&et(iw),["mod","\\"].every(t=>ip[t]?e[ip[t]]:e.key===t.toUpperCase())&&et(ix)};return window.addEventListener("click",iv),window.addEventListener("keydown",t),window.addEventListener("keyup",e),()=>{window.removeEventListener("click",iv),window.removeEventListener("keydown",t),window.removeEventListener("keyup",e)}},a=[et],C[6]=o,C[7]=a):(o=C[6],a=C[7]),(0,b.useEffect)(o,a);let[er,ei]=(0,b.useState)(!1),[eo,ea]=(0,b.useState)(!1),es=(0,b.useRef)(void 0);C[8]!==Q?(s=()=>{if(Q)return il(()=>{ei(!0),il(()=>{ea(!0),es.current=setTimeout(()=>{ea(!1),ei(!1)},1500)})});es.current&&(clearTimeout(es.current),ei(!1),ea(!1))},c=[Q],C[8]=Q,C[9]=s,C[10]=c):(s=C[9],c=C[10]),(0,b.useEffect)(s,c),C[11]!==Y?(p=Y.flatMap(iE),C[11]=Y,C[12]=p):p=C[12],d=p,C[13]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{D({type:"overlay/blur"})},C[13]=f):f=C[13];let el=f,eu=ep()!==ee;m=eu?O:void 0;e:{let t;if((T||R)&&"connected"!==A||q){let e;C[14]===Symbol.for("react.memo_cache_sentinel")?(e=[],C[14]=e):e=C[14],y=e;break e}C[15]!==$||C[16]!==m||C[17]!==H||C[18]!==V||C[19]!==Y||C[20]!==T||C[21]!==q||C[22]!==eu||C[23]!==e.plugins||C[24]!==B?(t=Y.filter(ik).map(t=>{let{id:n,element:r,focused:i,hovered:o,rect:a,sanity:s,dragDisabled:u,targets:c,elementType:d}=t,p=!u&&!!r.getAttribute("data-sanity")&&eu&&Y.some(e=>"id"in e.sanity&&"id"in s&&td(e.sanity,s)&&e.sanity.path!==s.path);return(0,l.jsx)(rL,{comlink:$,componentResolver:m,plugins:e.plugins,element:r,enableScrollIntoView:!q&&!H&&!V,id:n,focused:i,hovered:o,node:s,rect:a,showActions:!T,draggable:p,isDragging:q||H,wasMaybeCollapsed:i&&B,targets:c,elementType:d},n)}),C[15]=$,C[16]=m,C[17]=H,C[18]=V,C[19]=Y,C[20]=T,C[21]=q,C[22]=eu,C[23]=e.plugins,C[24]=B,C[25]=t):t=C[25],y=t}let ec=y,ed=N?"dark":"light",ef=eo?"":void 0,em=er?"":void 0;return C[26]!==d||C[27]!==G?(h=(0,l.jsx)(iu,{documentIds:d,perspective:G}),C[26]=d,C[27]=G,C[28]=h):h=C[28],C[29]!==$||C[30]!==T||C[31]!==R||C[32]!==Q||C[33]!==J||C[34]!==en?(g=(0,l.jsx)(ic,{comlink:$,dispatch:D,inFrame:T,inPopUp:R,onDrag:en,overlayEnabled:Q,rootElement:J}),C[29]=$,C[30]=T,C[31]=R,C[32]=Q,C[33]=J,C[34]=en,C[35]=g):g=C[35],C[36]!==Z?(v=Z&&(0,l.jsx)(rj,{...Z,onDismiss:el}),C[36]=Z,C[37]=v):v=C[37],C[38]!==K||C[39]!==U||C[40]!==H||C[41]!==F||C[42]!==q?(w=q&&!H&&(0,l.jsxs)(l.Fragment,{children:[U&&(0,l.jsx)(rG,{dragInsertPosition:U}),F&&(0,l.jsx)(rQ,{}),K&&(0,l.jsx)(rq,{dragGroupRect:K})]}),C[38]=K,C[39]=U,C[40]=H,C[41]=F,C[42]=q,C[43]=w):w=C[43],C[44]!==W||C[45]!==q?(x=q&&W&&(0,l.jsx)(rH,{skeleton:W}),C[44]=W,C[45]=q,C[46]=x):x=C[46],C[47]!==ec||C[48]!==ef||C[49]!==em||C[50]!==h||C[51]!==g||C[52]!==v||C[53]!==w||C[54]!==x||C[55]!==P?(E=(0,l.jsxs)(is,{"data-fading-out":ef,"data-overlays":em,ref:X,$zIndex:P,children:[h,g,v,ec,w,x]}),C[47]=ec,C[48]=ef,C[49]=em,C[50]=h,C[51]=g,C[52]=v,C[53]=w,C[54]=x,C[55]=P,C[56]=E):E=C[56],C[57]!==$||C[58]!==E?(k=(0,l.jsx)(r8,{comlink:$,children:E}),C[57]=$,C[58]=E,C[59]=k):k=C[59],C[60]!==$||C[61]!==k?(j=(0,l.jsx)(r2,{comlink:$,children:k}
214),C[60]=$,C[61]=k,C[62]=j):j=C[62],C[63]!==$||C[64]!==Y||C[65]!==j?(_=(0,l.jsx)(r5,{comlink:$,elements:Y,children:j}),C[63]=$,C[64]=Y,C[65]=j,C[66]=_):_=C[66],C[67]!==J||C[68]!==_?(I=(0,l.jsx)(L.li,{children:(0,l.jsx)(L.Xp,{element:J,children:_})}),C[67]=J,C[68]=_,C[69]=I):I=C[69],C[70]!==ed||C[71]!==I?(S=(0,l.jsx)(L.f6,{scheme:ed,theme:L.Lg,tone:"transparent",children:I}),C[70]=ed,C[71]=I,C[72]=S):S=C[72],C[73]!==$||C[74]!==S?(M=(0,l.jsx)(it,{comlink:$,children:S}),C[73]=$,C[74]=S,C[75]=M):M=C[75],M},ip={alt:"altKey",ctrl:"ctrlKey",mod:"u">typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform)?"metaKey":"ctrlKey",shift:"shiftKey"};function im(e){return"Alt"===e.key}function iy(e,t){return e.filter(e=>e!==t)}function ih(e){return!e}function ig(e){return e()}function iv(e){let t=e.target;if(((0,L.bg)(t)||(0,L.Re)(t)&&t.closest("a"))&&e.altKey){e.preventDefault(),e.stopPropagation();let t=new MouseEvent(e.type,{...e,altKey:!1,bubbles:!0,cancelable:!0});e.target?.dispatchEvent(t)}}function ib(e){return!e}function iw(e){return!e}function ix(e){return!e}function iE(e){return"id"in e.sanity?[e.sanity.id]:[]}function ik(e){return e.activated||e.focused}let ij=e=>{let t,n;let r=(0,u.c)(4),{comlink:i,refresh:o}=e,a=(0,b.useRef)(0),s=(0,b.useRef)(0);return r[0]!==i||r[1]!==o?(t=()=>i.on("presentation/refresh",e=>{if("manual"===e.source){clearTimeout(a.current);let t=o(e);if(!1===t)return;i.post("visual-editing/refreshing",e);let n=!1;a.current=window.setTimeout(()=>{i.post("visual-editing/refreshed",e),n=!0},3e3),t?.finally?.(()=>{n||(clearTimeout(a.current),i.post("visual-editing/refreshed",e))})}else if("mutation"===e.source){clearTimeout(s.current);let t=o(e);if(!1===t)return;i.post("visual-editing/refreshing",e),s.current=window.setTimeout(()=>{let t=o(e);!1!==t&&(i.post("visual-editing/refreshing",e),t?.finally?.(()=>{i.post("visual-editing/refreshed",e)})||i.post("visual-editing/refreshed",e))},1e3),t?.finally?.(()=>{i.post("visual-editing/refreshed",e)})||i.post("visual-editing/refreshed",e)}}),n=[i,o],r[0]=i,r[1]=o,r[2]=t,r[3]=n):(t=r[2],n=r[3]),(0,b.useEffect)(t,n),null};function i_(e){let{data:t,origin:n}=e;t&&"object"==typeof t&&"domain"in t&&"sanity/channels"===t.domain&&"from"in t&&"presentation"===t.from&&"type"in t&&"presentation/status"===t.type&&window.parent.postMessage({domain:"sanity/channels",type:"visual-editing/status",data:{origin:location.origin}},n)}function iI(){console.warn("[@sanity/visual-editing] Package version mismatch detected: Please update your Sanity studio to prevent potential compatibility issues.")}function iS(){}let iM=e=>{let t,n,r,i,o,a,s,d;let p=(0,u.c)(23),{components:f,plugins:m,history:y,portal:x,refresh:E,zIndex:k}=e,j=void 0===x||x,[_,I]=(0,b.useState)(null),[S,M]=(0,b.useState)(null);p[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{I(g()),M(v())},n=[],p[0]=t,p[1]=n):(t=p[0],n=p[1]),(0,b.useEffect)(t,n);let[C,$]=(0,b.useState)(null);p[2]!==j?(r=()=>{if(!1===j)return;let e=document.createElement("sanity-visual-editing");return document.documentElement.appendChild(e),$(e),()=>{$(null),document.documentElement.contains(e)&&document.documentElement.removeChild(e)}},i=[j],p[2]=j,p[3]=r,p[4]=i):(r=p[3],i=p[4]),(0,b.useEffect)(r,i);let[A,O]=function(e){let t,n,r,i,o;let a=(0,u.c)(9),s=void 0===e||e,[l,d]=(0,b.useState)(),[p,f]=(0,b.useState)("idle");return a[0]!==s?(t=()=>{if(!s)return;let e=(0,c.dS)({name:"visual-editing",connectTo:"presentation"},(0,c.zB)().provide({actors:h()})),t=e.onStatus(()=>f("connected"),"connected");d(e);let n=e.start();return()=>{t(),n(),d(void 0)}},n=[s],a[0]=s,a[1]=t,a[2]=n):(t=a[1],n=a[2]),(0,b.useEffect)(t,n),a[3]!==p?(r=()=>{if("connected"===p)return;let e=new AbortController;return window.addEventListener("message",i_,{signal:e.signal}),()=>{e.abort()}},i=[p],a[3]=p,a[4]=r,a[5]=i):(r=a[4],i=a[5]),(0,b.useEffect)(r,i),a[6]!==l||a[7]!==p?(o=[l,p],a[6]=l,a[7]=p,a[8]=o):o=a[8],o}(!0===_||!0===S);!function(e){let t,n;let r=(0,u.c)(3);r[0]!==e?(t=()=>{if(!e)return;let t=function(e){let t=new tP.t(1),n=new tL.x;return e.fetch("visual-editing/snapshot-welcome",void 0,{suppressWarnings:!0}).then(e=>{t.next(e.event)}).catch(()=>{}
214),e.on("presentation/snapshot-event",e=>{"reconnect"===e.event.type&&t.next(e.event),"mutation"===e.event.type&&n.next(e.event)}),(0,tN.T)(t,n)}(e),n=ru(e),r=(0,tR.c)(n,{input:{client:{withConfig:iS},sharedListener:t}});r.start();let i=new AbortController;return e.fetch("visual-editing/features",void 0,{signal:i.signal,suppressWarnings:!0}).then(e=>{e.features.optimistic&&function(e){for(let t of(et=e,en))t()}(r)}).catch(iI),()=>{r.stop(),i.abort()}},n=[e],r[0]=e,r[1]=t,r[2]=n):(t=r[1],n=r[2]),(0,b.useEffect)(t,n)}("connected"===O?A:void 0),p[5]!==A||p[6]!==O||p[7]!==f||p[8]!==_||p[9]!==S||p[10]!==m||p[11]!==k?(o=null!==_&&null!==S&&(0,l.jsx)(id,{comlink:A,comlinkStatus:O,componentResolver:f,plugins:m,inFrame:_,inPopUp:S,zIndex:k}),p[5]=A,p[6]=O,p[7]=f,p[8]=_,p[9]=S,p[10]=m,p[11]=k,p[12]=o):o=p[12],p[13]!==A||p[14]!==y||p[15]!==E?(a=A&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(rc,{comlink:A,history:y}),(0,l.jsx)(rd,{comlink:A}),E&&(0,l.jsx)(ij,{comlink:A,refresh:E})]}),p[13]=A,p[14]=y,p[15]=E,p[16]=a):a=p[16],p[17]!==o||p[18]!==a?(s=(0,l.jsxs)(l.Fragment,{children:[o,a]}),p[17]=o,p[18]=a,p[19]=s):s=p[19];let T=s;return!1!==j&&C?(p[20]!==T||p[21]!==C?(d=(0,w.createPortal)(T,C),p[20]=T,p[21]=C,p[22]=d):d=p[22],d):T};iM.displayName="VisualEditing";var iC=n(60759);n(2931);var i$=(0,n(72557).$)("fb0dbf6ab2fce5ca9a80efa41dfffd65a687625f");function iA(e){let t=e.indexOf("#"),n=e.indexOf("?"),r=n>-1&&(t<0||n<t);return r||t>-1?{pathname:e.substring(0,r?n:t),query:r?e.substring(n,t>-1?t:void 0):"",hash:t>-1?e.slice(t):""}:{pathname:e,query:"",hash:""}}function iO(e,t){if(!function(e,t){if("string"!=typeof e)return!1;let{pathname:n}=iA(e);return n===t||n.startsWith(`${t}/`)}(e,t))return e;let n=e.slice(t.length);return n.startsWith("/")?n:`/${n}`}let iT=(e,t)=>{let{pathname:n,query:r,hash:i}=iA(e);return t?n.endsWith("/")?`${n}${r}${i}`:`${n}/${r}${i}`:`${n.replace(/\/$/,"")||"/"}${r}${i}`};function iR(e){let{basePath:t="",plugins:n,components:r,refresh:i,trailingSlash:o=!1,zIndex:a}=e,s=(0,iC.useRouter)(),u=(0,b.useRef)(s),[c,d]=(0,b.useState)();(0,b.useEffect)(()=>{u.current=s},[s]);let p=(0,b.useMemo)(()=>({subscribe:e=>(d(()=>e),()=>d(void 0)),update:e=>{switch(e.type){case"push":return u.current.push(iO(e.url,t));case"pop":return u.current.back();case"replace":return u.current.replace(iO(e.url,t));default:throw Error(`Unknown update type: ${e.type}`)}}}),[t]),f=(0,iC.usePathname)(),m=(0,iC.useSearchParams)();(0,b.useEffect)(()=>{c&&c({type:"push",url:iT(function(e,t){if(!e.startsWith("/")||!t)return e;if("/"===e&&t)return t;let{pathname:n,query:r,hash:i}=iA(e);return`${t}${n}${r}${i}`}(`${f}${m?.size?`?${m}`:""}`,t),o)})},[t,c,f,m,o]);let y=(0,b.useCallback)(e=>{if(i)return i(e);switch(e.source){case"manual":return e.livePreviewEnabled?(console.debug("Live preview is setup, calling router.refresh() to refresh the server components without refetching cached data"),u.current.refresh(),Promise.resolve()):(console.debug("No loaders in live mode detected, or preview kit setup, revalidating root layout"),i$());case"mutation":return e.livePreviewEnabled?(console.debug("Live preview is setup, mutation is skipped assuming its handled by the live preview"),!1):(console.debug("No loaders in live mode detected, or preview kit setup, revalidating root layout"),i$());default:throw Error("Unknown refresh source",{cause:e})}},[i]);return(0,l.jsx)(iM,{plugins:n,components:r,history:p,portal:!0,refresh:y,zIndex:a})}}}]);

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.