PageSourceSearch

https://www.saltarchitecture.nz/_next/static/chunks/9415.4f4d204129026a8d.js

js saltarchitecture.nz collected 2026-10-06 13:35:37 UTC 167,764 bytes, 61 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9415],{72367:function(e,t,i){i.d(t,{BB:function(){return c},F5:function(){return y},Mx:function(){return x},U2:function(){return u},eT:function(){return p},jR:function(){return f},lV:function(){return function e(t,i,n=[]){return null!==t&&Array.isArray(t)?t.map((t,r)=>{if(b(t)){let s=t._key;if("string"==typeof s)return e(t,i,n.concat({_key:s,_index:r}))}return e(t,i,n.concat(r))}):b(t)?Object.fromEntries(Object.entries(t).map(([t,r])=>[t,e(r,i,n.concat(t))])):i(t,n)}},tZ:function(){return w},vs:function(){return m}});let n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/_key\s*==\s*['"](.*)['"]/,s=/^\d*:\d*$/;function a(e){return"number"==typeof e||"string"==typeof e&&/^\[\d+\]$/.test(e)}function o(e){return"string"==typeof e?r.test(e.trim()):"object"==typeof e&&"_key"in e}function l(e){if("string"==typeof e&&s.test(e))return!0;if(!Array.isArray(e)||2!==e.length)return!1;let[t,i]=e;return("number"==typeof t||""===t)&&("number"==typeof i||""===i)}function u(e,t,i){let n="string"==typeof t?d(t):t;if(!Array.isArray(n))throw Error("Path must be an array or a string");let r=e;for(let e=0;e<n.length;e++){let t=n[e];if(a(t)){if(!Array.isArray(r))return i;r=r[t]}if(o(t)){if(!Array.isArray(r))return i;r=r.find(e=>e._key===t._key)}if("string"==typeof t&&(r="object"==typeof r&&null!==r?r[t]:void 0),typeof r>"u")return i}return r}function c(e){if(!Array.isArray(e))throw Error("Path is not an array");return e.reduce((e,t,i)=>{let n=typeof t;if("number"===n)return`${e}[${t}]`;if("string"===n)return`${e}${0===i?"":"."}${t}`;if(o(t)&&t._key)return`${e}[_key=="${t._key}"]`;if(Array.isArray(t)){let[i,n]=t;return`${e}[${i}:${n}]`}throw Error(`Unsupported path segment \`${JSON.stringify(t)}\``)},"")}function d(e){if("string"!=typeof e)throw Error("Path is not a string");let t=e.match(n);if(!t)throw Error("Invalid path string");return t.map(h)}function h(e){return a(e)?Number(e.replace(/[^\d]/g,"")):o(e)?{_key:e.match(r)[1]}:l(e)?function(e){let[t,i]=e.split(":").map(e=>""===e?e:Number(e));return[t,i]}(e):e}var p=Object.freeze({__proto__:null,fromString:d,get:u,isIndexSegment:a,isIndexTuple:l,isKeySegment:o,reKeySegment:r,toString:c});let f="drafts.";function m(e){return e.startsWith(f)?e.slice(f.length):e}let v={"\f":"\\f","\n":"\\n","\r":"\\r","	":"\\t","'":"\\'","\\":"\\\\"},g={"\\f":"\f","\\n":`
2`,"\\r":"\r","\\t":"	","\\'":"'","\\\\":"\\"};function y(e){let t;let i=[],n=/\['(.*?)'\]|\[(\d+)\]|\[\?\(@\._key=='(.*?)'\)\]/g;for(;null!==(t=n.exec(e));){if(void 0!==t[1]){let e=t[1].replace(/\\(\\|f|n|r|t|')/g,e=>g[e]);i.push(e);continue}if(void 0!==t[2]){i.push(parseInt(t[2],10));continue}if(void 0!==t[3]){let e=t[3].replace(/\\(\\')/g,e=>g[e]);i.push({_key:e,_index:-1});continue}}return i}function x(e,t){var i;if(!(null!=t&&t.mappings))return;let n=(i=e.map(e=>{if("string"==typeof e||"number"==typeof e)return e;if(-1!==e._index)return e._index;throw Error(`invalid segment:${JSON.stringify(e)}`)}),`$${i.map(e=>"string"==typeof e?`['${e.replace(/[\f\n\r\t'\\]/g,e=>v[e])}']`:"number"==typeof e?`[${e}]`:""!==e._key?`[?(@._key=='${e._key.replace(/['\\]/g,e=>v[e])}')]`:`[${e._index}]`).join("")}`);if(void 0!==t.mappings[n])return{mapping:t.mappings[n],matchedPath:n,pathSuffix:""};let r=Object.entries(t.mappings).filter(([e])=>n.startsWith(e)).sort(([e],[t])=>t.length-e.length);if(0==r.length)return;let[s,a]=r[0],o=n.substring(s.length);return{mapping:a,matchedPath:s,pathSuffix:o}}function b(e){return"object"==typeof e&&null!==e}function w(e){let{baseUrl:t,workspace:i="default",tool:n="default",id:r,type:s,path:a,projectId:o,dataset:l}=e;if(!t)throw Error("baseUrl is required");if(!a)throw Error("path is required");if(!r)throw Error("id is required");if("/"!==t&&t.endsWith("/"))throw Error("baseUrl must not end with a slash");let u="default"===i?void 0:i,d="default"===n?void 0:n,h=m(r),p=Array.isArray(a)?c(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,v=new URLSearchParams({baseUrl:t,id:h,type:s,path:p});u&&v.set("workspace",u),d&&v.set("tool",d),o&&v.set("projectId",o),l&&v.set("dataset",l),r.startsWith(f)&&v.set("isDraft","");let g=["/"===t?"":t];
2u&&g.push(u);let y=["mode=presentation",`id=${h}`,`type=${s}`,`path=${encodeURIComponent(p)}`];return d&&y.push(`tool=${d}`),g.push("intent","edit",`${y.join(";")}?${v}`),g.join("/")}},4983:function(e,t,i){i.d(t,{D:function(){return o},u:function(){return l}});var n=i(26705),r=i(76508),s=i(20955);let a=(0,s.createContext)(null);function o(e){let{children:t,setDisplayedDocument:i,documentId:o}=e,l=(0,s.useCallback)(e=>i(t=>r(t,e)?t:e),[i]);return(0,s.useEffect)(()=>{if(o)return;let e=setTimeout(()=>i(null));return()=>clearTimeout(e)},[o,i]),(0,n.jsx)(a.Provider,{value:l,children:t})}function l(){return(0,s.useContext)(a)}},39415:function(e,t,i){let n,r,s;i.r(t),i.d(t,{default:function(){return aQ}});var a,o,l,u,c,d,h=i(26705),p=i(72367),f=i(74487),m=i(20955),v=i(74819),g=i(48634),y=i(66736),x=i(60506),b=i(71033),w=i(18923),P=i(7347),E=i(4983);let j="sanity.previewUrlSecret",S="sanity-preview-secret",k="sanity-preview-pathname",A=`*[_type == "${j}" && dateTime(_updatedAt) <= dateTime(now()) - 3600]`,C=(0,m.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),T=(0,m.createContext)({}),M=(0,m.createContext)(null),R="undefined"!=typeof document,V=R?m.useLayoutEffect:m.useEffect,D=(0,m.createContext)({strict:!1}),L=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),I="data-"+L("framerAppearId"),$={skipAnimations:!1,useManualTiming:!1};class O{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){let t=this.order.indexOf(e);-1!==t&&(this.order.splice(t,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}let F=["prepare","read","update","preRender","render","postRender"];function U(e,t){let i=!1,n=!0,r={delta:0,timestamp:0,isProcessing:!1},s=F.reduce((e,t)=>(e[t]=function(e){let t=new O,i=new O,n=0,r=!1,s=!1,a=new WeakSet,o={schedule:(e,s=!1,o=!1)=>{let l=o&&r,u=l?t:i;return s&&a.add(e),u.add(e)&&l&&r&&(n=t.order.length),e},cancel:e=>{i.remove(e),a.delete(e)},process:l=>{if(r){s=!0;return}if(r=!0,[t,i]=[i,t],i.clear(),n=t.order.length)for(let i=0;i<n;i++){let n=t.order[i];a.has(n)&&(o.schedule(n),e()),n(l)}r=!1,s&&(s=!1,o.process(l))}};return o}(()=>i=!0),e),{}),a=e=>{s[e].process(r)},o=()=>{let s=$.useManualTiming?r.timestamp:performance.now();i=!1,r.delta=n?1e3/60:Math.max(Math.min(s-r.timestamp,40),1),r.timestamp=s,r.isProcessing=!0,F.forEach(a),r.isProcessing=!1,i&&t&&(n=!1,e(o))},l=()=>{i=!0,n=!0,r.isProcessing||e(o)};return{schedule:F.reduce((e,t)=>{let n=s[t];return e[t]=(e,t=!1,r=!1)=>(i||l(),n.schedule(e,t,r)),e},{}),cancel:e=>F.forEach(t=>s[t].cancel(e)),state:r,steps:s}}let{schedule:z,cancel:B}=U(queueMicrotask,!1);function _(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function N(e){return"string"==typeof e||Array.isArray(e)}function W(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}let H=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],q=["initial",...H];function G(e){return W(e.animate)||q.some(t=>N(e[t]))}function K(e){return!!(G(e)||e.variants)}function Z(e){return Array.isArray(e)?e.join(" "):e}let X={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Y={};for(let e in X)Y[e]={isEnabled:t=>X[e].some(e=>!!t[e])};let J=(0,m.createContext)({}),Q=(0,m.createContext)({}),ee=Symbol.for("motionComponentSymbol"),et=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ei(e){if("string"!=typeof e||e.includes("-"));else if(et.indexOf(e)>-1||/[A-Z]/.test(e))return!0;return!1}let en={},er=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],es=new Set(er);function ea(e,{layout:t,layoutId:i}){return es.has(e)||e.startsWith("origin")||(t||void 0!==i)&&(!!en[e]||"opacity"===e)}let eo=e=>!!(e&&e.getVelocity),el={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},eu=er.length,ec=e=>t=>"string"==typeof t&&t.startsWith(e),ed=ec("--"),eh=ec("var(--"),ep=e=>!!eh(e)&&ef.test(e.split("/*")[0].trim()),ef=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?
2:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)$/i,em=(e,t)=>t&&"number"==typeof e?t.transform(e):e,ev=(e,t,i)=>i>t?t:i<e?e:i,eg={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},ey={...eg,transform:e=>ev(0,1,e)},ex={...eg,default:1},eb=e=>Math.round(1e5*e)/1e5,ew=/(-)?([\d]*\.?[\d])+/g,eP=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,eE=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function ej(e){return"string"==typeof e}let eS=e=>({test:t=>ej(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),ek=eS("deg"),eA=eS("%"),eC=eS("px"),eT=eS("vh"),eM=eS("vw"),eR={...eA,parse:e=>eA.parse(e)/100,transform:e=>eA.transform(100*e)},eV={...eg,transform:Math.round},eD={borderWidth:eC,borderTopWidth:eC,borderRightWidth:eC,borderBottomWidth:eC,borderLeftWidth:eC,borderRadius:eC,radius:eC,borderTopLeftRadius:eC,borderTopRightRadius:eC,borderBottomRightRadius:eC,borderBottomLeftRadius:eC,width:eC,maxWidth:eC,height:eC,maxHeight:eC,size:eC,top:eC,right:eC,bottom:eC,left:eC,padding:eC,paddingTop:eC,paddingRight:eC,paddingBottom:eC,paddingLeft:eC,margin:eC,marginTop:eC,marginRight:eC,marginBottom:eC,marginLeft:eC,rotate:ek,rotateX:ek,rotateY:ek,rotateZ:ek,scale:ex,scaleX:ex,scaleY:ex,scaleZ:ex,skew:ek,skewX:ek,skewY:ek,distance:eC,translateX:eC,translateY:eC,translateZ:eC,x:eC,y:eC,z:eC,perspective:eC,transformPerspective:eC,opacity:ey,originX:eR,originY:eR,originZ:eC,zIndex:eV,fillOpacity:ey,strokeOpacity:ey,numOctaves:eV};function eL(e,t,i,n){let{style:r,vars:s,transform:a,transformOrigin:o}=e,l=!1,u=!1,c=!0;for(let e in t){let i=t[e];if(ed(e)){s[e]=i;continue}let n=eD[e],d=em(i,n);if(es.has(e)){if(l=!0,a[e]=d,!c)continue;i!==(n.default||0)&&(c=!1)}else e.startsWith("origin")?(u=!0,o[e]=d):r[e]=d}if(!t.transform&&(l||n?r.transform=function(e,{enableHardwareAcceleration:t=!0,allowTransformNone:i=!0},n,r){let s="";for(let t=0;t<eu;t++){let i=er[t];if(void 0!==e[i]){let t=el[i]||i;s+=`${t}(${e[i]}) `}}return t&&!e.z&&(s+="translateZ(0)"),s=s.trim(),r?s=r(e,n?"":s):i&&n&&(s="none"),s}(e.transform,i,c,n):r.transform&&(r.transform="none")),u){let{originX:e="50%",originY:t="50%",originZ:i=0}=o;r.transformOrigin=`${e} ${t} ${i}`}}let eI=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function e$(e,t,i){for(let n in t)eo(t[n])||ea(n,i)||(e[n]=t[n])}let eO=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function eF(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||eO.has(e)}let eU=e=>!eF(e);function ez(e){e&&(eU=t=>t.startsWith("on")?!eF(t):e(t))}try{ez(require("@emotion/is-prop-valid").default)}catch(e){}function eB(e,t,i){return"string"==typeof e?e:eC.transform(t+i*e)}let e_={offset:"stroke-dashoffset",array:"stroke-dasharray"},eN={offset:"strokeDashoffset",array:"strokeDasharray"};function eW(e,{attrX:t,attrY:i,attrScale:n,originX:r,originY:s,pathLength:a,pathSpacing:o=1,pathOffset:l=0,...u},c,d,h){if(eL(e,u,c,h),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:p,style:f,dimensions:m}=e;p.transform&&(m&&(f.transform=p.transform),delete p.transform),m&&(void 0!==r||void 0!==s||f.transform)&&(f.transformOrigin=function(e,t,i){let n=eB(t,e.x,e.width),r=eB(i,e.y,e.height);return`${n} ${r}`}(m,void 0!==r?r:.5,void 0!==s?s:.5)),void 0!==t&&(p.x=t),void 0!==i&&(p.y=i),void 0!==n&&(p.scale=n),void 0!==a&&function(e,t,i=1,n=0,r=!0){e.pathLength=1;let s=r?e_:eN;e[s.offset]=eC.transform(-n);let a=eC.transform(t),o=eC.transform(i);e[s.array]=`${a} ${o}`}(p,a,o,l,!1)}let eH=()=>({...eI(),attrs:{}}),eq=e=>"string"==typeof e&&"svg"===e.toLowerCase();function eG(e,{style:t,vars:i},n,r){for(let s in Object.assign(e.style,t,r&&r.getProjectionStyles(n)),i)e.style.setProperty(s,i[s])}let eK=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function eZ(e,t,i,n){for(let i in eG(e,t,void 0,n),t.attrs)e.setAttribute(eK.has(i)?i:L(i),t.attrs[i])}function eX(e,t){let{style:i}=e,n={};for(let r in i)(eo(i[r])||t.style&&eo(t.style[r])||ea(r,e))&&(n[r]=i[r]);return n}function eY(e,t){let i=eX(e,t);for(let n in e)(eo(e[n])||eo(t[n]))&&(i[-1!==er.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return i}function eJ(e,t,i,n={},r={}){return"function"==typeof t&&(t=t(void 0!==i?i:e.custom,n,r)),"string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t&&(t=t(void 0!==i?i:e.custom,n,r)),t}function eQ(e){let t=(0,m.useRef)(null);return null===t.current&&(t.current=e()),t.current}let e0=e=>Array.isArray(e),e1=e=>!!(e&&"object"==typeof e&&e.mix&&e.toValue),e2=e=>e0(e)?e[e.length-1]||0:e;function e5(e){let t=eo(e)?e.get():e;return e1(t)?t.toValue():t}let e3=e=>(t,i)=>{let n=(0,m.useContext)(T),r=(0,m.useContext)(M),s=()=>(function({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:i},n,r,s){let a={latestValues:function(e,t,i,n){let r={},s=n(e,{});for(let e in s)r[e]=e5(s[e]);let{initial:a,animate:o}=e,l=G(e),u=K(e);t&&u&&!l&&!1!==e.inherit&&(void 0===a&&(a=t.initial),void 0===o&&(o=t.animate));let c=!!i&&!1===i.initial,d=(c=c||!1===a)?o:a;return d&&"boolean"!=typeof d&&!W(d)&&(Array.isArray(d)?d:[d]).forEac
2h(t=>{let i=eJ(e,t);if(!i)return;let{transitionEnd:n,transition:s,...a}=i;for(let e in a){let t=a[e];if(Array.isArray(t)){let e=c?t.length-1:0;t=t[e]}null!==t&&(r[e]=t)}for(let e in n)r[e]=n[e]}),r}(n,r,s,e),renderState:t()};return i&&(a.mount=e=>i(n,e,a)),a})(e,t,n,r);return i?s():eQ(s)},e9=e=>e,{schedule:e4,cancel:e6,state:e7,steps:e8}=U("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e9,!0),te={useVisualState:e3({scrapeMotionValuesFromProps:eY,createRenderState:eH,onMount:(e,t,{renderState:i,latestValues:n})=>{e4.read(()=>{try{i.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){i.dimensions={x:0,y:0,width:0,height:0}}}),e4.render(()=>{eW(i,n,{enableHardwareAcceleration:!1},eq(t.tagName),e.transformTemplate),eZ(t,i)})}})},tt={useVisualState:e3({scrapeMotionValuesFromProps:eX,createRenderState:eI})};function ti(e,t,i,n={passive:!0}){return e.addEventListener(t,i,n),()=>e.removeEventListener(t,i)}let tn=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function tr(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}let ts=e=>t=>tn(t)&&e(t,tr(t));function ta(e,t,i,n){return ti(e,t,ts(i),n)}let to=(e,t)=>i=>t(e(i)),tl=(...e)=>e.reduce(to);function tu(e){let t=null;return()=>null===t&&(t=e,()=>{t=null})}let tc=tu("dragHorizontal"),td=tu("dragVertical");function th(e){let t=!1;if("y"===e)t=td();else if("x"===e)t=tc();else{let e=tc(),i=td();e&&i?t=()=>{e(),i()}:(e&&e(),i&&i())}return t}function tp(){let e=th(!0);return!e||(e(),!1)}class tf{constructor(e){this.isMounted=!1,this.node=e}update(){}}function tm(e,t){let i="onHover"+(t?"Start":"End");return ta(e.current,"pointer"+(t?"enter":"leave"),(n,r)=>{if("touch"===n.pointerType||tp())return;let s=e.getProps();e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",t),s[i]&&e4.update(()=>s[i](n,r))},{passive:!e.getProps()[i]})}class tv extends tf{mount(){this.unmount=tl(tm(this.node,!0),tm(this.node,!1))}unmount(){}}class tg extends tf{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=tl(ti(this.node.current,"focus",()=>this.onFocus()),ti(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}let ty=(e,t)=>!!t&&(e===t||ty(e,t.parentElement));function tx(e,t){if(!t)return;let i=new PointerEvent("pointer"+e);t(i,tr(i))}class tb extends tf{constructor(){super(...arguments),this.removeStartListeners=e9,this.removeEndListeners=e9,this.removeAccessibleListeners=e9,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();let i=this.node.getProps(),n=ta(window,"pointerup",(e,t)=>{if(!this.checkPressEnd())return;let{onTap:i,onTapCancel:n,globalTapTarget:r}=this.node.getProps();e4.update(()=>{r||ty(this.node.current,e.target)?i&&i(e,t):n&&n(e,t)})},{passive:!(i.onTap||i.onPointerUp)}),r=ta(window,"pointercancel",(e,t)=>this.cancelPress(e,t),{passive:!(i.onTapCancel||i.onPointerCancel)});this.removeEndListeners=tl(n,r),this.startPress(e,t)},this.startAccessiblePress=()=>{let e=ti(this.node.current,"keydown",e=>{"Enter"!==e.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=ti(this.node.current,"keyup",e=>{"Enter"===e.key&&this.checkPressEnd()&&tx("up",(e,t)=>{let{onTap:i}=this.node.getProps();i&&e4.update(()=>i(e,t))})}),tx("down",(e,t)=>{this.startPress(e,t)}))}),t=ti(this.node.current,"blur",()=>{this.isPressing&&tx("cancel",(e,t)=>this.cancelPress(e,t))});this.removeAccessibleListeners=tl(e,t)}}startPress(e,t){this.isPressing=!0;let{onTapStart:i,whileTap:n}=this.node.getProps();n&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),i&&e4.update(()=>i(e,t))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!tp()}cancelPress(e,t){if(!this.checkPressEnd())return;let{onTapCancel:i}=this.node.getProps();i&&e4.update(()=>i(e,t))}mount(){let e=this.node.getProps(),t=ta(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),i=ti(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=tl(t,i)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}let tw=new WeakMap,tP=new WeakMap,tE=e=>{let t=tw.get(e.target);t&&t(e)},tj=e=>{e.forEach(tE)},tS={some:0,all:1};class tk extends tf{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:t,margin:i,amount:n="some",once:r}=e,s={root:t?t.current:void 0,rootMargin:i,threshold:"number"==typeof n?n:tS[n]};return function(e,t,i){let n=function({root:e,...t}){let i=e||document;tP.has(i)||tP.set(i,{});
2let n=tP.get(i),r=JSON.stringify(t);return n[r]||(n[r]=new IntersectionObserver(tj,{root:e,...t})),n[r]}(t);return tw.set(e,i),n.observe(e),()=>{tw.delete(e),n.unobserve(e)}}(this.node.current,s,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,r&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);let{onViewportEnter:i,onViewportLeave:n}=this.node.getProps(),s=t?i:n;s&&s(e)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;let{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return i=>e[i]!==t[i]}(e,t))&&this.startObserver()}unmount(){}}function tA(e,t){if(!Array.isArray(t))return!1;let i=t.length;if(i!==e.length)return!1;for(let n=0;n<i;n++)if(t[n]!==e[n])return!1;return!0}function tC(e,t,i){let n=e.getProps();return eJ(n,t,void 0!==i?i:n.custom,function(e){let t={};return e.values.forEach((e,i)=>t[i]=e.get()),t}(e),function(e){let t={};return e.values.forEach((e,i)=>t[i]=e.getVelocity()),t}(e))}let tT=e=>1e3*e,tM=e=>e/1e3,tR={current:!1},tV=e=>Array.isArray(e)&&"number"==typeof e[0],tD=([e,t,i,n])=>`cubic-bezier(${e}, ${t}, ${i}, ${n})`,tL={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:tD([0,.65,.55,1]),circOut:tD([.55,0,1,.45]),backIn:tD([.31,.01,.66,-.59]),backOut:tD([.33,1.53,.69,.99])},tI=(e,t,i)=>(((1-3*i+3*t)*e+(3*i-6*t))*e+3*t)*e;function t$(e,t,i,n){if(e===t&&i===n)return e9;let r=t=>(function(e,t,i,n,r){let s,a;let o=0;do(s=tI(a=t+(i-t)/2,n,r)-e)>0?i=a:t=a;while(Math.abs(s)>1e-7&&++o<12);return a})(t,0,1,e,i);return e=>0===e||1===e?e:tI(r(e),t,n)}let tO=t$(.42,0,1,1),tF=t$(0,0,.58,1),tU=t$(.42,0,.58,1),tz=e=>Array.isArray(e)&&"number"!=typeof e[0],tB=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,t_=e=>t=>1-e(1-t),tN=e=>1-Math.sin(Math.acos(e)),tW=t_(tN),tH=tB(tN),tq=t$(.33,1.53,.69,.99),tG=t_(tq),tK=tB(tG),tZ={linear:e9,easeIn:tO,easeInOut:tU,easeOut:tF,circIn:tN,circInOut:tH,circOut:tW,backIn:tG,backInOut:tK,backOut:tq,anticipate:e=>(e*=2)<1?.5*tG(e):.5*(2-Math.pow(2,-10*(e-1)))},tX=e=>{if(Array.isArray(e)){e9(4===e.length,"Cubic bezier arrays must contain four numerical values.");let[t,i,n,r]=e;return t$(t,i,n,r)}return"string"==typeof e?(e9(void 0!==tZ[e],`Invalid easing type '${e}'`),tZ[e]):e},tY=(e,t,i)=>{let n=t-e;return 0===n?1:(i-e)/n},tJ=(e,t,i)=>e+(t-e)*i;function tQ(e,t,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?e+(t-e)*6*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}let t0=(e,t)=>i=>!!(ej(i)&&eE.test(i)&&i.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(i,t)),t1=(e,t,i)=>n=>{if(!ej(n))return n;let[r,s,a,o]=n.match(ew);return{[e]:parseFloat(r),[t]:parseFloat(s),[i]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},t2=e=>ev(0,255,e),t5={...eg,transform:e=>Math.round(t2(e))},t3={test:t0("rgb","red"),parse:t1("red","green","blue"),transform:({red:e,green:t,blue:i,alpha:n=1})=>"rgba("+t5.transform(e)+", "+t5.transform(t)+", "+t5.transform(i)+", "+eb(ey.transform(n))+")"},t9={test:t0("#"),parse:function(e){let t="",i="",n="",r="";return e.length>5?(t=e.substring(1,3),i=e.substring(3,5),n=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),i=e.substring(2,3),n=e.substring(3,4),r=e.substring(4,5),t+=t,i+=i,n+=n,r+=r),{red:parseInt(t,16),green:parseInt(i,16),blue:parseInt(n,16),alpha:r?parseInt(r,16)/255:1}},transform:t3.transform},t4={test:t0("hsl","hue"),parse:t1("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:i,alpha:n=1})=>"hsla("+Math.round(e)+", "+eA.transform(eb(t))+", "+eA.transform(eb(i))+", "+eb(ey.transform(n))+")"},t6=(e,t,i)=>{let n=e*e,r=i*(t*t-n)+n;return r<0?0:Math.sqrt(r)},t7=[t9,t3,t4],t8=e=>t7.find(t=>t.test(e));function ie(e){let t=t8(e);e9(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`);let i=t.parse(e);return t===t4&&(i=function({hue:e,saturation:t,lightness:i,alpha:n}){e/=360,i/=100;let r=0,s=0,a=0;if(t/=100){let n=i<.5?i*(1+t):i+t-i*t,o=2*i-n;r=tQ(o,n,e+1/3),s=tQ(o,n,e),a=tQ(o,n,e-1/3)}else r=s=a=i;return{red:Math.round(255*r),green:Math.round(255*s),blue:Math.round(255*a),alpha:n}}(i)),i}let it=(e,t)=>
2{let i=ie(e),n=ie(t),r={...i};return e=>(r.red=t6(i.red,n.red,e),r.green=t6(i.green,n.green,e),r.blue=t6(i.blue,n.blue,e),r.alpha=tJ(i.alpha,n.alpha,e),t3.transform(r))},ii={test:e=>t3.test(e)||t9.test(e)||t4.test(e),parse:e=>t3.test(e)?t3.parse(e):t4.test(e)?t4.parse(e):t9.parse(e),transform:e=>ej(e)?e:e.hasOwnProperty("red")?t3.transform(e):t4.transform(e)},ir="number",is="color",ia=/(var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\))|(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))|((-)?([\d]*\.?[\d])+)/gi;function io(e){let t=e.toString(),i=t.match(ia)||[],n=[],r={color:[],number:[],var:[]},s=[];for(let e=0;e<i.length;e++){let t=i[e];ii.test(t)?(r.color.push(e),s.push(is),n.push(ii.parse(t))):t.startsWith("var(")?(r.var.push(e),s.push("var"),n.push(t)):(r.number.push(e),s.push(ir),n.push(parseFloat(t)))}return{values:n,split:t.replace(ia,"${}").split("${}"),indexes:r,types:s}}function il(e){return io(e).values}function iu(e){let{split:t,types:i}=io(e),n=t.length;return e=>{let r="";for(let s=0;s<n;s++)if(r+=t[s],void 0!==e[s]){let t=i[s];t===ir?r+=eb(e[s]):t===is?r+=ii.transform(e[s]):r+=e[s]}return r}}let ic=e=>"number"==typeof e?0:e,id={test:function(e){var t,i;return isNaN(e)&&ej(e)&&((null===(t=e.match(ew))||void 0===t?void 0:t.length)||0)+((null===(i=e.match(eP))||void 0===i?void 0:i.length)||0)>0},parse:il,createTransformer:iu,getAnimatableNone:function(e){let t=il(e);return iu(e)(t.map(ic))}};function ih(e,t){return i=>i>0?t:e}function ip(e,t){return i=>tJ(e,t,i)}function im(e){return"number"==typeof e?ip:"string"==typeof e?ep(e)?ih:ii.test(e)?it:iy:Array.isArray(e)?iv:"object"==typeof e?ii.test(e)?it:ig:ih}function iv(e,t){let i=[...e],n=i.length,r=e.map((e,i)=>im(e)(e,t[i]));return e=>{for(let t=0;t<n;t++)i[t]=r[t](e);return i}}function ig(e,t){let i={...e,...t},n={};for(let r in i)void 0!==e[r]&&void 0!==t[r]&&(n[r]=im(e[r])(e[r],t[r]));return e=>{for(let t in n)i[t]=n[t](e);return i}}let iy=(e,t)=>{let i=id.createTransformer(t),n=io(e),r=io(t);return n.indexes.var.length===r.indexes.var.length&&n.indexes.color.length===r.indexes.color.length&&n.indexes.number.length>=r.indexes.number.length?tl(iv(function(e,t){var i;let n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){let a=t.types[s],o=e.indexes[a][r[a]],l=null!==(i=e.values[o])&&void 0!==i?i:0;n[s]=l,r[a]++}return n}(n,r),r.values),i):(e9(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),ih(e,t))};function ix(e,t,i){return"number"==typeof e&&"number"==typeof t&&"number"==typeof i?tJ(e,t,i):im(e)(e,t)}function ib({duration:e=300,keyframes:t,times:i,ease:n="easeInOut"}){let r=tz(n)?n.map(tX):tX(n),s={done:!1,value:t[0]},a=function(e,t,{clamp:i=!0,ease:n,mixer:r}={}){let s=e.length;if(e9(s===t.length,"Both input and output ranges must be the same length"),1===s)return()=>t[0];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());let a=function(e,t,i){let n=[],r=i||ix,s=e.length-1;for(let i=0;i<s;i++){let s=r(e[i],e[i+1]);t&&(s=tl(Array.isArray(t)?t[i]||e9:t,s)),n.push(s)}return n}(t,n,r),o=a.length,l=t=>{let i=0;if(o>1)for(;i<e.length-2&&!(t<e[i+1]);i++);let n=tY(e[i],e[i+1],t);return a[i](n)};return i?t=>l(ev(e[0],e[s-1],t)):l}((i&&i.length===t.length?i:function(e){let t=[0];return function(e,t){let i=e[e.length-1];for(let n=1;n<=t;n++){let r=tY(0,t,n);e.push(tJ(i,1,r))}}(t,e.length-1),t}(t)).map(t=>t*e),t,{ease:Array.isArray(r)?r:t.map(()=>r||tU).splice(0,t.length-1)});return{calculatedDuration:e,next:t=>(s.value=a(t),s.done=t>=e,s)}}function iw(e,t,i){var n,r;let s=Math.max(t-5,0);return n=i-e(s),(r=t-s)?1e3/r*n:0}function iP(e,t){return e*Math.sqrt(1-t*t)}let iE=["duration","bounce"],ij=["stiffness","damping","mass"];function iS(e,t){return t.some(t=>void 0!==e[t])}function ik({keyframes:e,restDelta:t,restSpeed:i,...n}){let r;let s=e[0],a=e[e.length-1],o={done:!1,value:s},{stiffness:l,damping:u,mass:c,duration:d,velocity:h,isResolvedFromDuration:p}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!iS(e,ij)&&iS(e,iE)){let i=function({duration:e=800,bounce:t=.25,velocity:i=0,mass:n=1}){let r,s;e9(e<=tT(10),"Spring duration must be 10 seconds or less");let a=1-t;a=ev(.05,1,a),e=ev(.01,10,tM(e)),a<1?(r=t=>{let n=t*a,r=n*e;return .001-(n-i)/iP(t,a)*Math.exp(-r)},s=t=>{let n=t*a*e,s=Math.pow(a,2)*Math.pow(t,2)*e,o=iP(Math.pow(t,2),a);return(n*i+i-s)*Math.exp(-n)*(-r(t)+.001>0?-1:1)/o}):(r=t=>-.001+Math.exp(-t*e)*((t-i)*e+1),s=t=>e*e*(i-t)*Math.exp(-t*e));let o=function(e,t,i){let n=i;for(let i=1;i<12;i++)n-=e(n)/t(n);return n}(r,s,5/e);if(e=tT(e),isNaN(o))return{stiffness:100,damping:10,duration:e};{let t=Math.pow(o,2)*n;
2return{stiffness:t,damping:2*a*Math.sqrt(n*t),duration:e}}}(e);(t={...t,...i,mass:1}).isResolvedFromDuration=!0}return t}({...n,velocity:-tM(n.velocity||0)}),f=h||0,m=u/(2*Math.sqrt(l*c)),v=a-s,g=tM(Math.sqrt(l/c)),y=5>Math.abs(v);if(i||(i=y?.01:2),t||(t=y?.005:.5),m<1){let e=iP(g,m);r=t=>a-Math.exp(-m*g*t)*((f+m*g*v)/e*Math.sin(e*t)+v*Math.cos(e*t))}else if(1===m)r=e=>a-Math.exp(-g*e)*(v+(f+g*v)*e);else{let e=g*Math.sqrt(m*m-1);r=t=>{let i=Math.exp(-m*g*t),n=Math.min(e*t,300);return a-i*((f+m*g*v)*Math.sinh(n)+e*v*Math.cosh(n))/e}}return{calculatedDuration:p&&d||null,next:e=>{let n=r(e);if(p)o.done=e>=d;else{let s=f;0!==e&&(s=m<1?iw(r,e,n):0);let l=Math.abs(s)<=i,u=Math.abs(a-n)<=t;o.done=l&&u}return o.value=o.done?a:n,o}}}function iA({keyframes:e,velocity:t=0,power:i=.8,timeConstant:n=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:a,min:o,max:l,restDelta:u=.5,restSpeed:c}){let d,h;let p=e[0],f={done:!1,value:p},m=e=>void 0!==o&&e<o||void 0!==l&&e>l,v=e=>void 0===o?l:void 0===l?o:Math.abs(o-e)<Math.abs(l-e)?o:l,g=i*t,y=p+g,x=void 0===a?y:a(y);x!==y&&(g=x-p);let b=e=>-g*Math.exp(-e/n),w=e=>x+b(e),P=e=>{let t=b(e),i=w(e);f.done=Math.abs(t)<=u,f.value=f.done?x:i},E=e=>{m(f.value)&&(d=e,h=ik({keyframes:[f.value,v(f.value)],velocity:iw(w,e,f.value),damping:r,stiffness:s,restDelta:u,restSpeed:c}))};return E(0),{calculatedDuration:null,next:e=>{let t=!1;return(h||void 0!==d||(t=!0,P(e),E(e)),void 0!==d&&e>d)?h.next(e-d):(t||P(e),f)}}}function iC(){n=void 0}let iT={now:()=>(void 0===n&&iT.set(e7.isProcessing||$.useManualTiming?e7.timestamp:performance.now()),n),set:e=>{n=e,queueMicrotask(iC)}},iM=e=>{let t=({timestamp:t})=>e(t);return{start:()=>e4.update(t,!0),stop:()=>e6(t),now:()=>e7.isProcessing?e7.timestamp:iT.now()}};function iR(e){let t=0,i=e.next(t);for(;!i.done&&t<2e4;)t+=50,i=e.next(t);return t>=2e4?1/0:t}let iV={decay:iA,inertia:iA,tween:ib,keyframes:ib,spring:ik},iD=e=>e/100;function iL({autoplay:e=!0,delay:t=0,driver:i=iM,keyframes:n,type:r="keyframes",repeat:s=0,repeatDelay:a=0,repeatType:o="loop",onPlay:l,onStop:u,onComplete:c,onUpdate:d,...h}){let p,f,m,v,g,y=1,x=!1,b=()=>{f=new Promise(e=>{p=e})};b();let w=iV[r]||ib;w!==ib&&"number"!=typeof n[0]&&(v=tl(iD,ix(n[0],n[1])),n=[0,100]);let P=w({...h,keyframes:n});"mirror"===o&&(g=w({...h,keyframes:[...n].reverse(),velocity:-(h.velocity||0)}));let E="idle",j=null,S=null,k=null;null===P.calculatedDuration&&s&&(P.calculatedDuration=iR(P));let{calculatedDuration:A}=P,C=1/0,T=1/0;null!==A&&(T=(C=A+a)*(s+1)-a);let M=0,R=e=>{if(null===S)return;y>0&&(S=Math.min(S,e)),y<0&&(S=Math.min(e-T/y,S));let i=(M=null!==j?j:Math.round(e-S)*y)-t*(y>=0?1:-1),r=y>=0?i<0:i>T;M=Math.max(i,0),"finished"===E&&null===j&&(M=T);let l=M,u=P;if(s){let e=Math.min(M,T)/C,t=Math.floor(e),i=e%1;!i&&e>=1&&(i=1),1===i&&t--,(t=Math.min(t,s+1))%2&&("reverse"===o?(i=1-i,a&&(i-=a/C)):"mirror"===o&&(u=g)),l=ev(0,1,i)*C}let c=r?{done:!1,value:n[0]}:u.next(l);v&&(c.value=v(c.value));let{done:h}=c;r||null===A||(h=y>=0?M>=T:M<=0);let p=null===j&&("finished"===E||"running"===E&&h);return d&&d(c.value),p&&L(),c},V=()=>{m&&m.stop(),m=void 0},D=()=>{E="idle",V(),p(),b(),S=k=null},L=()=>{E="finished",c&&c(),V(),p()},I=()=>{if(x)return;m||(m=i(R));let e=m.now();l&&l(),null!==j?S=e-j:S&&"finished"!==E||(S=e),"finished"===E&&b(),k=S,j=null,E="running",m.start()};e&&I();let $={then:(e,t)=>f.then(e,t),get time(){return tM(M)},set time(newTime){M=newTime=tT(newTime),null===j&&m&&0!==y?S=m.now()-newTime/y:j=newTime},get duration(){return tM(null===P.calculatedDuration?iR(P):P.calculatedDuration)},get speed(){return y},set speed(newSpeed){if(newSpeed===y||!m)return;y=newSpeed,$.time=tM(M)},get state(){return E},play:I,pause:()=>{E="paused",j=M},stop:()=>{x=!0,"idle"!==E&&(E="idle",u&&u(),D())},cancel:()=>{null!==k&&R(k),D()},complete:()=>{E="finished"},sample:e=>(S=0,R(e))};return $}let iI=(a=()=>Object.hasOwnProperty.call(Element.prototype,"animate"),()=>(void 0===s&&(s=a()),s)),i$=new Set(["opacity","clipPath","filter","transform"]),iO=(e,t)=>"spring"===t.type||"backgroundColor"===e||!function e(t){return!!(!t||"string"==typeof t&&tL[t]||tV(t)||Array.isArray(t)&&t.every(e))}(t.ease),iF={type:"spring",stiffness:500,damping:25,restSpeed:10},iU=e=>({type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restSpeed:10}),iz={type:"keyframes",duration:.8},iB={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},i_=(e,{keyframes:t})=>t.length>2?iz:es.has(e)?e.startsWith("scale")?iU(t[1]):iF:iB,iN=(e,t)=>"zIndex"!==e&&!!("number"==typeof t||Array.isArray(t)||"string"==typeof t&&(id.test(t)||"0"===t)&&!t.startsWith("url(")),iW=new Set(["brightness","contrast","saturate","opacity"]);function iH(e){let[t,i]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;let[n]=i.match(ew)||[];if(!n)return e;let r=i.replace(n,""),s=iW.has(t)?1:0;return n!==i&&(s*=100),t+"("+s+r+")"}let iq=/([a-z-]*)\(.*?\)/g,iG={...id,getAnimatableNone:e=>{let t=e.match(iq);return t?t.map(iH).join(" "):e}},iK={...eD,color:ii,backgroundColor:ii,outlineColor:ii,fill:ii,stroke:ii,borderColor:ii,borderTopColor:ii,borderRightColor:ii,borderBottomColor:ii,borderLeftColor:ii,filter:iG,WebkitFilter:iG},iZ=e=>iK[e];function iX(e,t){let i=iZ(e);return i!==iG&&(i=id),i.getAnimatableNone?i.getAnimatableNone(t):void 0}let iY=e=>/^0[^.\s]+$/.test(e);function iJ(e,t){return e[t]||e.default||e}let iQ=(e,t,i,n={})=>r=>{let s=iJ(n,e)||{},a=s.delay||n.delay||0,{elapsed:o=0}=n;o-=tT(a);let l=function(e,t,i,n){let r,s;let a=iN(t,i);r=Array.isArray(i)?[...i]:[null,i];let o=void 0!==n.from?n.from:e.get(),l=[];for(let e=0;e<r.length;e++){var u;null===r[e]&&(r[e]=0===e?o:r[e-1]),("number"==typeof(u=r[e])?0===u:null!==u?"none"===u||"0"===u||iY(u):void 0)&&l.push(e),"string"==typeof r[e]&&"none"!==r[e]&&"0"!==r[e]&&(s=r[e])}if(a&&l.length&&s)for(let e=0;e<l.length;e++)r[l[e]]=iX(t,s);return r}
2(t,e,i,s),u=l[0],c=l[l.length-1],d=iN(e,u),h=iN(e,c);e9(d===h,`You are trying to animate ${e} from "${u}" to "${c}". ${u} is not an animatable value - to enable this animation set ${u} to a value animatable to ${c} via the \`style\` property.`);let p={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...s,delay:-o,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{r(),s.onComplete&&s.onComplete()}};if(!function({when:e,delay:t,delayChildren:i,staggerChildren:n,staggerDirection:r,repeat:s,repeatType:a,repeatDelay:o,from:l,elapsed:u,...c}){return!!Object.keys(c).length}(s)&&(p={...p,...i_(e,p)}),p.duration&&(p.duration=tT(p.duration)),p.repeatDelay&&(p.repeatDelay=tT(p.repeatDelay)),!d||!h||tR.current||!1===s.type||$.skipAnimations)return function({keyframes:e,delay:t,onUpdate:i,onComplete:n}){let r=()=>(i&&i(e[e.length-1]),n&&n(),{time:0,speed:1,duration:0,play:e9,pause:e9,stop:e9,then:e=>(e(),Promise.resolve()),cancel:e9,complete:e9});return t?iL({keyframes:[0,1],duration:0,delay:t,onComplete:r}):r()}(tR.current?{...p,delay:0}:p);if(!n.isHandoff&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){let i=function(e,t,{onUpdate:i,onComplete:n,...r}){let s,a;if(!(iI()&&i$.has(t)&&!r.repeatDelay&&"mirror"!==r.repeatType&&0!==r.damping&&"inertia"!==r.type))return!1;let o=!1,l=!1,u=()=>{a=new Promise(e=>{s=e})};u();let{keyframes:c,duration:d=300,ease:h,times:p}=r;if(iO(t,r)){let e=iL({...r,repeat:0,delay:0}),t={done:!1,value:c[0]},i=[],n=0;for(;!t.done&&n<2e4;)t=e.sample(n),i.push(t.value),n+=10;p=void 0,c=i,d=n-10,h="linear"}let f=function(e,t,i,{delay:n=0,duration:r,repeat:s=0,repeatType:a="loop",ease:o,times:l}={}){let u={[t]:i};l&&(u.offset=l);let c=function e(t){if(t)return tV(t)?tD(t):Array.isArray(t)?t.map(e):tL[t]}(o);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:n,duration:r,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:s+1,direction:"reverse"===a?"alternate":"normal"})}(e.owner.current,t,c,{...r,duration:d,ease:h,times:p}),m=()=>{l=!1,f.cancel()},v=()=>{l=!0,e4.update(m),s(),u()};return f.onfinish=()=>{l||(e.set(function(e,{repeat:t,repeatType:i="loop"}){let n=t&&"loop"!==i&&t%2==1?0:e.length-1;return e[n]}(c,r)),n&&n(),v())},{then:(e,t)=>a.then(e,t),attachTimeline:e=>(f.timeline=e,f.onfinish=null,e9),get time(){return tM(f.currentTime||0)},set time(newTime){f.currentTime=tT(newTime)},get speed(){return f.playbackRate},set speed(newSpeed){f.playbackRate=newSpeed},get duration(){return tM(d)},play:()=>{o||(f.play(),e6(m))},pause:()=>f.pause(),stop:()=>{if(o=!0,"idle"===f.playState)return;let{currentTime:t}=f;if(t){let i=iL({...r,autoplay:!1});e.setWithVelocity(i.sample(t-10).value,i.sample(t).value,10)}v()},complete:()=>{l||f.finish()},cancel:v}}(t,e,p);if(i)return i}return iL(p)};function i0(e){return!!(eo(e)&&e.add)}let i1=e=>/^\-?\d*\.?\d+$/.test(e);function i2(e,t){-1===e.indexOf(t)&&e.push(t)}function i5(e,t){let i=e.indexOf(t);i>-1&&e.splice(i,1)}class i3{constructor(){this.subscriptions=[]}add(e){return i2(this.subscriptions,e),()=>i5(this.subscriptions,e)}notify(e,t,i){let n=this.subscriptions.length;if(n){if(1===n)this.subscriptions[0](e,t,i);else for(let r=0;r<n;r++){let n=this.subscriptions[r];n&&n(e,t,i)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}let i9=e=>!isNaN(parseFloat(e)),i4={current:void 0};class i6{constructor(e,t={}){this.version="11.0.8",this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(e,t=!0)=>{let i=iT.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.canTrackVelocity=i9(this.current),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=iT.now()}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new i3);let i=this.events[e].add(t);return"change"===e?()=>{i(),e4.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,i){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return i4.current&&i4.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){var e;let t=iT.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;let i=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e=parseFloat(this.current)-parseFloat(this.prevFrameValue),i?1e3/i*e:0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function i7(e,t){return new i6(e,t)}let i8=e=>t=>t.test(e),ne=[eg,eC,eA,ek,eM,eT,{test:e=>"auto"===e,parse:e=>e}],nt=e=>ne.find(i8(e)),ni=[...ne,ii,id],nn=e=>ni.find(i8(e));function nr(e,t,{delay:i=0,transitionOverride:n,type:r}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:a,...o}=e.makeTargetAnimatable(t),l=e.getValue("willChange");n&&(s=n);let u=[],c=r&&e.animationState&&e.animationState.getState()[r];for(let t in o){let n=e.getValue(t),r=o[t];if(!n||void 0===r||c&&function({protectedKeys:e,needsAnimating:t},i){let n=e.hasOwnProperty(i)&&!0!==t[i];return t[i]=!1,n}(c,t))continue;let a={delay:i,elapsed:0,...iJ(s||{},t)};if(window.HandoffAppearAnimations){let i=e.getProps()[I];if(i){let e=window.HandoffAppearAnimations(i,t,n,e4);null!==e&&(a.elapsed=e,a.isHandoff=!0)}}let d=!a.isHandoff&&!function(e,t){let i=e.get();if(!Array.isArray(t))return i!==t;for(let e=0;e<t.length;e++)if(t[e]!==i)return!0}(n,r);if("spring"===a.type&&(n.getVelocity()||a.velocity)&&(d=!1),n.animation&&(d=!1),d)continue;n.start(iQ(t,n,r,e.shouldReduceMotion&&es.has(t)?{type:!1}:a));let h=n.animation;i0(l)&&(l.add(t),h.then(()=>l.remove(t))),u.push(h)}return a&&Promise.all(u).then(()=>{a&&function(e,t){let i=tC(e,t),{transitionEnd:n={},transition:r={},...s}=i?e.makeTargetAnimatable(i,!1):{};for(let t in s={...s,...n}){let i=e2(s[t]);e.hasValue(t)?e.getValue(t).set(i):e.addValue(t,i7(i))}}(e,a)}),u}function ns(e,t,i={}){let n=tC(e,t,i.custom),{transition:r=e.getDefaultTransition()||{}}=n||{};i.transitionOverride&&(r=i.transitionOverride);let s=n?()=>Promise.all(nr(e,n,i)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(n=0)=>{let{delayChildren:s=0,staggerChildren:a,staggerDirection:o}=r;return function(e,t,i=0,n=0,r=1,s){let a=[],o=(e.variantChildren.size-1)*n,l=1===r?(e=0)=>e*n:(e=0)=>o-e*n;
2return Array.from(e.variantChildren).sort(na).forEach((e,n)=>{e.notify("AnimationStart",t),a.push(ns(e,t,{...s,delay:i+l(n)}).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(a)}(e,t,s+n,a,o,i)}:()=>Promise.resolve(),{when:o}=r;if(!o)return Promise.all([s(),a(i.delay)]);{let[e,t]="beforeChildren"===o?[s,a]:[a,s];return e().then(()=>t())}}function na(e,t){return e.sortNodePosition(t)}let no=[...H].reverse(),nl=H.length;function nu(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}class nc extends tf{constructor(e){super(e),e.animationState||(e.animationState=function(e){let t=t=>Promise.all(t.map(({animation:t,options:i})=>(function(e,t,i={}){let n;if(e.notify("AnimationStart",t),Array.isArray(t))n=Promise.all(t.map(t=>ns(e,t,i)));else if("string"==typeof t)n=ns(e,t,i);else{let r="function"==typeof t?tC(e,t,i.custom):t;n=Promise.all(nr(e,r,i))}return n.then(()=>e.notify("AnimationComplete",t))})(e,t,i))),i={animate:nu(!0),whileInView:nu(),whileHover:nu(),whileTap:nu(),whileDrag:nu(),whileFocus:nu(),exit:nu()},n=!0,r=(t,i)=>{let n=tC(e,i);if(n){let{transition:e,transitionEnd:i,...r}=n;t={...t,...r,...i}}return t};function s(s,a){let o=e.getProps(),l=e.getVariantContext(!0)||{},u=[],c=new Set,d={},h=1/0;for(let t=0;t<nl;t++){var p;let f=no[t],m=i[f],v=void 0!==o[f]?o[f]:l[f],g=N(v),y=f===a?m.isActive:null;!1===y&&(h=t);let x=v===l[f]&&v!==o[f]&&g;if(x&&n&&e.manuallyAnimateOnMount&&(x=!1),m.protectedKeys={...d},!m.isActive&&null===y||!v&&!m.prevProp||W(v)||"boolean"==typeof v)continue;let b=(p=m.prevProp,("string"==typeof v?v!==p:!!Array.isArray(v)&&!tA(v,p))||f===a&&m.isActive&&!x&&g||t>h&&g),w=!1,P=Array.isArray(v)?v:[v],E=P.reduce(r,{});!1===y&&(E={});let{prevResolvedValues:j={}}=m,S={...j,...E},k=e=>{b=!0,c.has(e)&&(w=!0,c.delete(e)),m.needsAnimating[e]=!0};for(let e in S){let t=E[e],i=j[e];if(!d.hasOwnProperty(e))(e0(t)&&e0(i)?tA(t,i):t===i)?void 0!==t&&c.has(e)?k(e):m.protectedKeys[e]=!0:void 0!==t?k(e):c.add(e)}m.prevProp=v,m.prevResolvedValues=E,m.isActive&&(d={...d,...E}),n&&e.blockInitialAnimation&&(b=!1),b&&(!x||w)&&u.push(...P.map(e=>({animation:e,options:{type:f,...s}})))}if(c.size){let t={};
2c.forEach(i=>{let n=e.getBaseTarget(i);void 0!==n&&(t[i]=n)}),u.push({animation:t})}let f=!!u.length;return n&&(!1===o.initial||o.initial===o.animate)&&!e.manuallyAnimateOnMount&&(f=!1),n=!1,f?t(u):Promise.resolve()}return{animateChanges:s,setActive:function(t,n,r){var a;if(i[t].isActive===n)return Promise.resolve();null===(a=e.variantChildren)||void 0===a||a.forEach(e=>{var i;return null===(i=e.animationState)||void 0===i?void 0:i.setActive(t,n)}),i[t].isActive=n;let o=s(r,t);for(let e in i)i[e].protectedKeys={};return o},setAnimateFunction:function(i){t=i(e)},getState:()=>i}}(e))}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();this.unmount(),W(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){}}let nd=0;class nh extends tf{constructor(){super(...arguments),this.id=nd++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t,custom:i}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;let r=this.node.animationState.setActive("exit",!e,{custom:null!=i?i:this.node.getProps().custom});t&&!e&&r.then(()=>t(this.id))}mount(){let{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}let np=(e,t)=>Math.abs(e-t);class nf{constructor(e,t,{transformPagePoint:i,contextWindow:n,dragSnapToOrigin:r=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{var e,t;if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let i=ng(this.lastMoveEventInfo,this.history),n=null!==this.startEvent,r=(e=i.offset,t={x:0,y:0},Math.sqrt(np(e.x,t.x)**2+np(e.y,t.y)**2)>=3);if(!n&&!r)return;let{point:s}=i,{timestamp:a}=e7;this.history.push({...s,timestamp:a});let{onStart:o,onMove:l}=this.handlers;n||(o&&o(this.lastMoveEvent,i),this.startEvent=this.lastMoveEvent),l&&l(this.lastMoveEvent,i)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=nm(t,this.transformPagePoint),e4.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:i,onSessionEnd:n,resumeAnimation:r}=this.handlers;if(this.dragSnapToOrigin&&r&&r(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let s=ng("pointercancel"===e.type?this.lastMoveEventInfo:nm(t,this.transformPagePoint),this.history);this.startEvent&&i&&i(e,s),n&&n(e,s)},!tn(e))return;this.dragSnapToOrigin=r,this.handlers=t,this.transformPagePoint=i,this.contextWindow=n||window;let s=nm(tr(e),this.transformPagePoint),{point:a}=s,{timestamp:o}=e7;this.history=[{...a,timestamp:o}];let{onSessionStart:l}=t;l&&l(e,ng(s,this.history)),this.removeListeners=tl(ta(this.contextWindow,"pointermove",this.handlePointerMove),ta(this.contextWindow,"pointerup",this.handlePointerUp),ta(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),e6(this.updatePoint)}}function nm(e,t){return t?{point:t(e.point)}:e}function nv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ng({point:e},t){return{point:e,delta:nv(e,ny(t)),offset:nv(e,t[0]),velocity:function(e,t){if(e.length<2)return{x:0,y:0};let i=e.length-1,n=null,r=ny(e);for(;i>=0&&(n=e[i],!(r.timestamp-n.timestamp>tT(.1)));)i--;if(!n)return{x:0,y:0};let s=tM(r.timestamp-n.timestamp);if(0===s)return{x:0,y:0};let a={x:(r.x-n.x)/s,y:(r.y-n.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}(t,0)}}function ny(e){return e[e.length-1]}function nx(e){return e.max-e.min}function nb(e,t=0,i=.01){return Math.abs(e-t)<=i}function nw(e,t,i,n=.5){e.origin=n,e.originPoint=tJ(t.min,t.max,e.origin),e.scale=nx(i)/nx(t),(nb(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=tJ(i.min,i.max,e.origin)-e.originPoint,(nb(e.translate)||isNaN(e.translate))&&(e.translate=0)}function nP(e,t,i,n){nw(e.x,t.x,i.x,n?n.originX:void 0),nw(e.y,t.y,i.y,n?n.originY:void 0)}function nE(e,t,i){e.min=i.min+t.min,e.max=e.min+nx(t)}function nj(e,t,i){e.min=t.min-i.min,e.max=e.min+nx(t)}function nS(e,t,i){nj(e.x,t.x,i.x),nj(e.y,t.y,i.y)}function nk(e,t,i){return{min:void 0!==t?e.min+t:void 0,max:void 0!==i?e.max+i-(e.max-e.min):void 0}}function nA(e,t){let i=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([i,n]=[n,i]),{min:i,max:n}}function nC(e,t,i){return{min:nT(e,t),max:nT(e,i)}}function nT(e,t){return"number"==typeof e?e:e[t]||0}let nM=()=>({translate:0,scale:1,origin:0,originPoint:0}),nR=()=>({x:nM(),y:nM()}),nV=()=>({min:0,max:0}),nD=()=>({x:nV(),y:nV()});function nL(e){return[e("x"),e("y")]}function nI({top:e,left:t,right:i,bottom:n}){return{x:{min:t,max:i},y:{min:e,max:n}}}function n$(e){return void 0===e||1===e}function nO({scale:e,scaleX:t,scaleY:i}){return!n$(e)||!n$(t)||!n$(i)}function nF(e){return nO(e)||nU(e)||e.z||e.rotate||e.rotateX||e.rotateY}function nU(e){var t,i;return(t=e.x)&&"0%"!==t||(i=e.y)&&"0%"!==i}function nz(e,t,i,n,r){return void 0!==r&&(e=n+r*(e-n)),n+i*(e-n)+t}function nB(e,t=0,i=1,n,r){e.min=nz(e.min,t,i,n,r),e.max=nz(e.max,t,i,n,r)}function n_(e,{x:t,y:i}){nB(e.x,t.translate,t.scale,t.originPoint),nB(e.y,i.translate,i.scale,i.originPoint)}function nN(e){return Number.isInteger(e)?e:e>1.0000000000001||e<.999999999999?e:1}function nW(e,t){e.min=e.min+t,e.max=e.max+t}function nH(e,t,[i,n,r]){let s=void 0!==t[r]?t[r]:.5,a=tJ(e.min,e.max,s);nB(e,t[i],t[n],a,t.scale)}let nq=["x","scaleX","originX"],nG=["y","scaleY","originY"];function nK(e,t){nH(e.x,t,nq),nH(e.y,t,nG)}function nZ(e,t){return nI(function(e,t){if(!t)return e;let i=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:i.y,left:i.x,bottom:n.y,right:n.x}}(e.getBoundingClientRect(),t))}let nX=({current:e})=>e?e.ownerDocument.defaultView:null,nY=new WeakMap;
2class nJ{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=nD(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){let{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;let{dragSnapToOrigin:n}=this.getProps();this.panSession=new nf(e,{onSessionStart:e=>{let{dragSnapToOrigin:i}=this.getProps();i?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(tr(e,"page").point)},onStart:(e,t)=>{let{drag:i,dragPropagation:n,onDragStart:r}=this.getProps();if(i&&!n&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=th(i),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),nL(e=>{let t=this.getAxisMotionValue(e).get()||0;if(eA.test(t)){let{projection:i}=this.visualElement;if(i&&i.layout){let n=i.layout.layoutBox[e];if(n){let e=nx(n);t=parseFloat(t)/100*e}}}this.originPoint[e]=t}),r&&e4.update(()=>r(e,t),!1,!0);let{animationState:s}=this.visualElement;s&&s.setActive("whileDrag",!0)},onMove:(e,t)=>{let{dragPropagation:i,dragDirectionLock:n,onDirectionLock:r,onDrag:s}=this.getProps();if(!i&&!this.openGlobalLock)return;let{offset:a}=t;if(n&&null===this.currentDirection){this.currentDirection=function(e,t=10){let i=null;return Math.abs(e.y)>t?i="y":Math.abs(e.x)>t&&(i="x"),i}(a),null!==this.currentDirection&&r&&r(this.currentDirection);return}this.updateAxis("x",t.point,a),this.updateAxis("y",t.point,a),this.visualElement.render(),s&&s(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>nL(e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:n,contextWindow:nX(this.visualElement)})}stop(e,t){let i=this.isDragging;if(this.cancel(),!i)return;let{velocity:n}=t;this.startAnimation(n);let{onDragEnd:r}=this.getProps();r&&e4.update(()=>r(e,t))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,i){let{drag:n}=this.getProps();if(!i||!nQ(e,n,this.currentDirection))return;let r=this.getAxisMotionValue(e),s=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(s=function(e,{min:t,max:i},n){return void 0!==t&&e<t?e=n?tJ(t,e,n.min):Math.max(e,t):void 0!==i&&e>i&&(e=n?tJ(i,e,n.max):Math.min(e,i)),e}(s,this.constraints[e],this.elastic[e])),r.set(s)}resolveConstraints(){var e;let{dragConstraints:t,dragElastic:i}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,r=this.constraints;t&&_(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=function(e,{top:t,left:i,bottom:n,right:r}){return{x:nk(e.x,i,r),y:nk(e.y,t,n)}}(n.layoutBox,t):this.constraints=!1,this.elastic=function(e=.35){return!1===e?e=0:!0===e&&(e=.35),{x:nC(e,"left","right"),y:nC(e,"top","bottom")}}(i),r!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&nL(e=>{this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){let i={};return void 0!==t.min&&(i.min=t.min-e.min),void 0!==t.max&&(i.max=t.max-e.min),i}(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){var e;let{dragConstraints:t,onMeasureDragConstraints:i}=this.getProps();if(!t||!_(t))return!1;let n=t.current;e9(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let s=function(e,t,i){let n=nZ(e,i),{scroll:r}=t;return r&&(nW(n.x,r.offset.x),nW(n.y,r.offset.y)),n}(n,r.root,this.visualElement.getTransformPagePoint()),a={x:nA((e=r.layout.layoutBox).x,s.x),y:nA(e.y,s.y)};if(i){let e=i(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(a));this.hasMutatedConstraints=!!e,e&&(a=nI(e))}return a}startAnimation(e){let{drag:t,dragMomentum:i,dragElastic:n,dragTransition:r,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),o=this.constraints||{};return Promise.all(nL(a=>
2{if(!nQ(a,t,this.currentDirection))return;let l=o&&o[a]||{};s&&(l={min:0,max:0});let u={type:"inertia",velocity:i?e[a]:0,bounceStiffness:n?200:1e6,bounceDamping:n?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...r,...l};return this.startAxisValueAnimation(a,u)})).then(a)}startAxisValueAnimation(e,t){let i=this.getAxisMotionValue(e);return i.start(iQ(e,i,0,t))}stopAnimation(){nL(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){nL(e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()})}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){let t="_drag"+e.toUpperCase(),i=this.visualElement.getProps();return i[t]||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){nL(t=>{let{drag:i}=this.getProps();if(!nQ(t,i,this.currentDirection))return;let{projection:n}=this.visualElement,r=this.getAxisMotionValue(t);if(n&&n.layout){let{min:i,max:s}=n.layout.layoutBox[t];r.set(e[t]-tJ(i,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:i}=this.visualElement;if(!_(t)||!i||!this.constraints)return;this.stopAnimation();let n={x:0,y:0};nL(e=>{let t=this.getAxisMotionValue(e);if(t){let i=t.get();n[e]=function(e,t){let i=.5,n=nx(e),r=nx(t);return r>n?i=tY(t.min,t.max-n,e.min):n>r&&(i=tY(e.min,e.max-r,t.min)),ev(0,1,i)}({min:i,max:i},this.constraints[e])}});let{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),nL(t=>{if(!nQ(t,e,null))return;let i=this.getAxisMotionValue(t),{min:r,max:s}=this.constraints[t];i.set(tJ(r,s,n[t]))})}addListeners(){if(!this.visualElement.current)return;nY.set(this.visualElement,this);let e=ta(this.visualElement.current,"pointerdown",e=>{let{drag:t,dragListener:i=!0}=this.getProps();t&&i&&this.start(e)}),t=()=>{let{dragConstraints:e}=this.getProps();_(e)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,n=i.addEventListener("measure",t);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),t();let r=ti(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(nL(t=>{let i=this.getAxisMotionValue(t);i&&(this.originPoint[t]+=e[t].translate,i.set(i.get()+e[t].translate))}),this.visualElement.render())});return()=>{r(),e(),n(),s&&s()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:i=!1,dragPropagation:n=!1,dragConstraints:r=!1,dragElastic:s=.35,dragMomentum:a=!0}=e;return{...e,drag:t,dragDirectionLock:i,dragPropagation:n,dragConstraints:r,dragElastic:s,dragMomentum:a}}}function nQ(e,t,i){return(!0===t||t===e)&&(null===i||i===e)}class n0 extends tf{constructor(e){super(e),this.removeGroupControls=e9,this.removeListeners=e9,this.controls=new nJ(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||e9}unmount(){this.removeGroupControls(),this.removeListeners()}}let n1=e=>(t,i)=>{e&&e4.update(()=>e(t,i))};class n2 extends tf{constructor(){super(...arguments),this.removePointerDownListener=e9}onPointerDown(e){this.session=new nf(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:nX(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:i,onPanEnd:n}=this.node.getProps();return{onSessionStart:n1(e),onStart:n1(t),onMove:i,onEnd:(e,t)=>{delete this.session,n&&e4.update(()=>n(e,t))}}}mount(){this.removePointerDownListener=ta(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let n5={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function n3(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}let n9={correct:(e,t)=>
2{if(!t.target)return e;if("string"==typeof e){if(!eC.test(e))return e;e=parseFloat(e)}let i=n3(e,t.target.x),n=n3(e,t.target.y);return`${i}% ${n}%`}};class n4 extends m.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:i,layoutId:n}=this.props,{projection:r}=e;Object.assign(en,n7),r&&(t.group&&t.group.add(r),i&&i.register&&n&&i.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),n5.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:i,drag:n,isPresent:r}=this.props,s=i.projection;return s&&(s.isPresent=r,n||e.layoutDependency!==t||void 0===t?s.willUpdate():this.safeToRemove(),e.isPresent===r||(r?s.promote():s.relegate()||e4.postRender(()=>{let e=s.getStack();e&&e.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),z.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:i}=this.props,{projection:n}=e;n&&(n.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(n),i&&i.deregister&&i.deregister(n))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}}function n6(e){let[t,i]=function(){let e=(0,m.useContext)(M);if(null===e)return[!0,null];let{isPresent:t,onExitComplete:i,register:n}=e,r=(0,m.useId)();return(0,m.useEffect)(()=>n(r),[]),!t&&i?[!1,()=>i&&i(r)]:[!0]}(),n=(0,m.useContext)(J);return m.createElement(n4,{...e,layoutGroup:n,switchLayoutGroup:(0,m.useContext)(Q),isPresent:t,safeToRemove:i})}let n7={borderRadius:{...n9,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:n9,borderTopRightRadius:n9,borderBottomLeftRadius:n9,borderBottomRightRadius:n9,boxShadow:{correct:(e,{treeScale:t,projectionDelta:i})=>{let n=id.parse(e);if(n.length>5)return e;let r=id.createTransformer(e),s="number"!=typeof n[0]?1:0,a=i.x.scale*t.x,o=i.y.scale*t.y;n[0+s]/=a,n[1+s]/=o;let l=tJ(a,o,.5);return"number"==typeof n[2+s]&&(n[2+s]/=l),"number"==typeof n[3+s]&&(n[3+s]/=l),r(n)}}},n8=["TopLeft","TopRight","BottomLeft","BottomRight"],re=n8.length,rt=e=>"string"==typeof e?parseFloat(e):e,ri=e=>"number"==typeof e||eC.test(e);function rn(e,t){return void 0!==e[t]?e[t]:e.borderRadius}let rr=ra(0,.5,tW),rs=ra(.5,.95,e9);function ra(e,t,i){return n=>n<e?0:n>t?1:i(tY(e,t,n))}function ro(e,t){e.min=t.min,e.max=t.max}function rl(e,t){ro(e.x,t.x),ro(e.y,t.y)}function ru(e,t,i,n,r){return e-=t,e=n+1/i*(e-n),void 0!==r&&(e=n+1/r*(e-n)),e}function rc(e,t,[i,n,r],s,a){!function(e,t=0,i=1,n=.5,r,s=e,a=e){if(eA.test(t)&&(t=parseFloat(t),t=tJ(a.min,a.max,t/100)-a.min),"number"!=typeof t)return;let o=tJ(s.min,s.max,n);e===s&&(o-=t),e.min=ru(e.min,t,i,o,r),e.max=ru(e.max,t,i,o,r)}(e,t[i],t[n],t[r],t.scale,s,a)}let rd=["x","scaleX","originX"],rh=["y","scaleY","originY"];function rp(e,t,i,n){rc(e.x,t,rd,i?i.x:void 0,n?n.x:void 0),rc(e.y,t,rh,i?i.y:void 0,n?n.y:void 0)}function rf(e){return 0===e.translate&&1===e.scale}function rm(e){return rf(e.x)&&rf(e.y)}function rv(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function rg(e){return nx(e.x)/nx(e.y)}class ry{constructor(){this.members=[]}add(e){i2(this.members,e),e.scheduleRender()}remove(e){if(i5(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t;let i=this.members.findIndex(t=>e===t);if(0===i)return!1;for(let e=i;e>=0;e--){let i=this.members[e];if(!1!==i.isPresent){t=i;break}}return!!t&&(this.promote(t),!0)}promote(e,t){let i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,t&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);let{crossfade:n}=e.options;!1===n&&i.hide()}}
2exitAnimationComplete(){this.members.forEach(e=>{let{options:t,resumingFrom:i}=e;t.onExitComplete&&t.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function rx(e,t,i){let n="",r=e.x.translate/t.x,s=e.y.translate/t.y;if((r||s)&&(n=`translate3d(${r}px, ${s}px, 0) `),(1!==t.x||1!==t.y)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),i){let{rotate:e,rotateX:t,rotateY:r}=i;e&&(n+=`rotate(${e}deg) `),t&&(n+=`rotateX(${t}deg) `),r&&(n+=`rotateY(${r}deg) `)}let a=e.x.scale*t.x,o=e.y.scale*t.y;return(1!==a||1!==o)&&(n+=`scale(${a}, ${o})`),n||"none"}let rb=(e,t)=>e.depth-t.depth;class rw{constructor(){this.children=[],this.isDirty=!1}add(e){i2(this.children,e),this.isDirty=!0}remove(e){i5(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(rb),this.isDirty=!1,this.children.forEach(e)}}let rP=["","X","Y","Z"],rE={visibility:"hidden"},rj=0,rS={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function rk({attachResizeListener:e,defaultParent:t,measureScroll:i,checkIsScrollRoot:n,resetTransform:r}){return class{constructor(e={},i=null==t?void 0:t()){this.id=rj++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,rS.totalNodes=rS.resolvedTargetDeltas=rS.recalculatedProjection=0,this.nodes.forEach(rT),this.nodes.forEach(r$),this.nodes.forEach(rO),this.nodes.forEach(rM),window.MotionDebug&&window.MotionDebug.record(rS)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new rw)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new i3),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let i=this.eventHandlers.get(e);i&&i.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t,i=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=t instanceof SVGElement&&"svg"!==t.tagName,this.instance=t;let{layoutId:n,layout:r,visualElement:s}=this.options;if(s&&!s.current&&s.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),i&&(r||n)&&(this.isLayoutDirty=!0),e){let i;let n=()=>this.root.updateBlockedByResize=!1;e(t,()=>{this.root.updateBlockedByResize=!0,i&&i(),i=function(e,t){let i=iT.now(),n=({timestamp:t})=>{let r=t-i;r>=250&&(e6(n),e(r-250))};return e4.read(n,!0),()=>e6(n)}(n,0),n5.hasAnimatedSinceResize&&(n5.hasAnimatedSinceResize=!1,this.nodes.forEach(rI))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&s&&(n||r)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:i,layout:n})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let r=this.options.transition||s.getDefaultTransition()||rN,{onLayoutAnimationStart:a,onLayoutAnimationComplete:o}=s.getProps(),l=!this.targetLayout||!rv(this.targetLayout,n)||i,u=!t&&i;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||u||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,u);let t={...iJ(r,"layout"),onPlay:a,onComplete:o};(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||rI(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=n})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,e6(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){!this.isUpdateBlocked()&&(this.isUpdating=!0,this.nodes&&this.nodes.forEac
vendor: 5,025 bytes, line 2
2h(rF),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:i}=this.options;if(void 0===t&&!i)return;let n=this.getTransformTemplate();this.prevTransformTemplateValue=n?n(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(rV);return}this.isUpdating||this.nodes.forEach(rD),this.isUpdating=!1,window.HandoffCancelAllAnimations&&window.HandoffCancelAllAnimations(),this.nodes.forEach(rL),this.nodes.forEach(rA),this.nodes.forEach(rC),this.clearAllSnapshots();let e=iT.now();e7.delta=ev(0,1e3/60,e-e7.timestamp),e7.timestamp=e,e7.isProcessing=!0,e8.update.process(e7),e8.preRender.process(e7),e8.render.process(e7),e7.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,z.read(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(rR),this.sharedNodes.forEach(rU)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,e4.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){e4.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected=nD(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&(this.scroll={animationId:this.root.animationId,phase:e,isRoot:n(this.instance),offset:i(this.instance)})}resetTransform(){if(!r)return;let e=this.isLayoutDirty||this.shouldResetTransform,t=this.projectionDelta&&!rm(this.projectionDelta),i=this.getTransformTemplate(),n=i?i(this.latestValues,""):void 0,s=n!==this.prevTransformTemplateValue;e&&(t||nF(this.latestValues)||s)&&(r(this.instance,n),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){var t;let i=this.measurePageBox(),n=this.removeElementScroll(i);return e&&(n=this.removeTransform(n)),rq((t=n).x),rq(t.y),{animationId:this.root.animationId,measuredBox:i,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return nD();let t=e.measureViewportBox(),{scroll:i}=this.root;return i&&(nW(t.x,i.offset.x),nW(t.y,i.offset.y)),t}removeElementScroll(e){let t=nD();rl(t,e);for(let i=0;i<this.path.length;i++){let n=this.path[i],{scroll:r,options:s}=n;if(n!==this.root&&r&&s.layoutScroll){if(r.isRoot){rl(t,e);let{scroll:i}=this.root;i&&(nW(t.x,-i.offset.x),nW(t.y,-i.offset.y))}nW(t.x,r.offset.x),nW(t.y,r.offset.y)}}return t}applyTransform(e,t=!1){let i=nD();rl(i,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&nK(i,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),nF(n.latestValues)&&nK(i,n.latestValues)}return nF(this.latestValues)&&nK(i,this.latestValues),i}removeTransform(e){let t=nD();rl(t,e);for(let e=0;e<this.path.length;e++){let i=this.path[e];if(!i.instance||!nF(i.latestValues))continue;nO(i.latestValues)&&i.updateSnapshot();let n=nD();rl(n,i.measurePageBox()),rp(t,i.latestValues,i.snapshot?i.snapshot.layoutBox:void 0,n)}return nF(this.latestValues)&&rp(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==e7.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){var t,i,n,r;let s=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=s.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=s.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=s.isS
2haredProjectionDirty);let a=!!this.resumingFrom||this!==s;if(!(e||a&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty)||this.attemptToResolveRelativeTarget))return;let{layout:o,layoutId:l}=this.options;if(this.layout&&(o||l)){if(this.resolvedRelativeTargetAt=e7.timestamp,!this.targetDelta&&!this.relativeTarget){let e=this.getClosestProjectingParent();e&&e.layout&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=nD(),this.relativeTargetOrigin=nD(),nS(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),rl(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){if((this.target||(this.target=nD(),this.targetWithTransforms=nD()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target)?(this.forceRelativeParentToResolveTarget(),i=this.target,n=this.relativeTarget,r=this.relativeParent.target,nE(i.x,n.x,r.x),nE(i.y,n.y,r.y)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):rl(this.target,this.layout.layoutBox),n_(this.target,this.targetDelta)):rl(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let e=this.getClosestProjectingParent();e&&!!e.resumingFrom==!!this.resumingFrom&&!e.options.layoutScroll&&e.target&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=nD(),this.relativeTargetOrigin=nD(),nS(this.relativeTargetOrigin,this.target,e.target),rl(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}rS.resolvedTargetDeltas++}}}getClosestProjectingParent(){return!this.parent||nO(this.parent.latestValues)||nU(this.parent.latestValues)?void 0:this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var e;let t=this.getLead(),i=!!this.resumingFrom||this!==t,n=!0;if((this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty))&&(n=!1),i&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===e7.timestamp&&(n=!1),n)return;let{layout:r,layoutId:s}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||s))return;rl(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;!function(e,t,i,n=!1){let r,s;let a=i.length;if(a){t.x=t.y=1;for(let o=0;o<a;o++){s=(r=i[o]).projectionDelta;let a=r.instance;(!a||!a.style||"contents"!==a.style.display)&&(n&&r.options.layoutScroll&&r.scroll&&r!==r.root&&nK(e,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,n_(e,s)),n&&nF(r.latestValues)&&nK(e,r.latestValues))}t.x=nN(t.x),t.y=nN(t.y)}}(this.layoutCorrected,this.treeScale,this.path,i),t.layout&&!t.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(t.target=t.layout.layoutBox,t.targetWithTransforms=nD());let{target:l}=t;if(!l){this.projectionTransform&&(this.projectionDelta=nR(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=nR(),this.projectionDeltaWithTransform=nR());let u=this.projectionTransform;nP(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.projectionTransform=rx(this.projectionDelta,this.treeScale),(this.projectionTransform!==u||this.treeScale.x!==a||this.treeScale.y!==o)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),rS.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(e,t=!1){let i;let n=this.snapshot,r=n?n.latestValues:{},s={...this.latestValues},a=nR();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=nD(),l=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),u=this.getStack(),c=!u||u.members.length<=1,d=!!(l&&!c&&!0===this.options.crossfade&&!this.path.some(r_));this.animationProgress=0,this.mixTargetDelta=t=>{let n=t/1e3;if(rz(a.x,e.x,n),rz(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var u,h,p,f;nS(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,f=this.relativeTargetOrigin,rB(p.x,f.x,o.x,n),rB(p.y,f.y,o.y,n),i&&(u=this.relativeTarget,h=i,u.x.min===h.x.min&&u.x.max===h.x.max&&u.y.min===
2h.y.min&&u.y.max===h.y.max)&&(this.isProjectionDirty=!1),i||(i=nD()),rl(i,this.relativeTarget)}l&&(this.animationValues=s,function(e,t,i,n,r,s){r?(e.opacity=tJ(0,void 0!==i.opacity?i.opacity:1,rr(n)),e.opacityExit=tJ(void 0!==t.opacity?t.opacity:1,0,rs(n))):s&&(e.opacity=tJ(void 0!==t.opacity?t.opacity:1,void 0!==i.opacity?i.opacity:1,n));for(let r=0;r<re;r++){let s=`border${n8[r]}Radius`,a=rn(t,s),o=rn(i,s);(void 0!==a||void 0!==o)&&(a||(a=0),o||(o=0),0===a||0===o||ri(a)===ri(o)?(e[s]=Math.max(tJ(rt(a),rt(o),n),0),(eA.test(o)||eA.test(a))&&(e[s]+="%")):e[s]=o)}(t.rotate||i.rotate)&&(e.rotate=tJ(t.rotate||0,i.rotate||0,n))}(s,r,this.latestValues,n,d,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(e6(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=e4.update(()=>{n5.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,i){let n=eo(0)?0:i7(0);return n.start(iQ("",n,1e3,i)),n.animation}(0,0,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:i,layout:n,latestValues:r}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&rG(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||nD();let t=nx(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=nx(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}rl(t,i),nK(t,r),nP(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new ry),this.sharedNodes.get(e).add(t);let i=t.options.initialPromotionConfig;t.promote({transition:i?i.transition:void 0,preserveFollowOpacity:i&&i.shouldPreserveFollowOpacity?i.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){var e;let{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;let{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:i}={}){let n=this.getStack();n&&n.promote(this,i),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return!!e&&e.relegate(this)}resetRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:i}=e;if((i.rotate||i.rotateX||i.rotateY||i.rotateZ)&&(t=!0),!t)return;let n={};for(let t=0;t<rP.length;t++){let r="rotate"+rP[t];i[r]&&(n[r]=i[r],e.setStaticValue(r,0))}for(let t in e.render(),n)e.setStaticValue(t,n[t]);e.scheduleRender()}getProjectionStyles(e){var t,i;if(!this.instance||this.isSVG)return;if(!this.isVisible)return rE;let n={visibility:""},r=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,n.opacity="",n.pointerEvents=e5(null==e?void 0:e.pointerEvents)||"",n.transform=r?r(this.latestValues,""):"none",n;let s=this.getLead();if(!this.projectionDelta||!this.layout||!s.target){let t={};return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=e5(null==e?void 0:e.pointerEvents)||""),this.hasProjected&&!n
2F(this.latestValues)&&(t.transform=r?r({},""):"none",this.hasProjected=!1),t}let a=s.animationValues||s.latestValues;this.applyTransformsToTarget(),n.transform=rx(this.projectionDeltaWithTransform,this.treeScale,a),r&&(n.transform=r(a,n.transform));let{x:o,y:l}=this.projectionDelta;for(let e in n.transformOrigin=`${100*o.origin}% ${100*l.origin}% 0`,s.animationValues?n.opacity=s===this?null!==(i=null!==(t=a.opacity)&&void 0!==t?t:this.latestValues.opacity)&&void 0!==i?i:1:this.preserveOpacity?this.latestValues.opacity:a.opacityExit:n.opacity=s===this?void 0!==a.opacity?a.opacity:"":void 0!==a.opacityExit?a.opacityExit:0,en){if(void 0===a[e])continue;let{correct:t,applyTo:i}=en[e],r="none"===n.transform?a[e]:t(a[e],s);if(i){let e=i.length;for(let t=0;t<e;t++)n[i[t]]=r}else n[e]=r}return this.options.layoutId&&(n.pointerEvents=s===this?e5(null==e?void 0:e.pointerEvents)||"":"none"),n}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()}),this.root.nodes.forEach(rV),this.root.sharedNodes.clear()}}}function rA(e){e.updateLayout()}function rC(e){var t;let i=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&i&&e.hasListeners("didUpdate")){let{layoutBox:t,measuredBox:n}=e.layout,{animationType:r}=e.options,s=i.source!==e.layout.source;"size"===r?nL(e=>{let n=s?i.measuredBox[e]:i.layoutBox[e],r=nx(n);n.min=t[e].min,n.max=n.min+r}):rG(r,i.layoutBox,t)&&nL(n=>{let r=s?i.measuredBox[n]:i.layoutBox[n],a=nx(t[n]);r.max=r.min+a,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[n].max=e.relativeTarget[n].min+a)});let a=nR();nP(a,t,i.layoutBox);let o=nR();s?nP(o,e.applyTransform(n,!0),i.measuredBox):nP(o,t,i.layoutBox);let l=!rm(a),u=!1;if(!e.resumeFrom){let n=e.getClosestProjectingParent();if(n&&!n.resumeFrom){let{snapshot:r,layout:s}=n;if(r&&s){let a=nD();nS(a,i.layoutBox,r.layoutBox);let o=nD();nS(o,t,s.layoutBox),rv(a,o)||(u=!0),n.options.layoutRoot&&(e.relativeTarget=o,e.relativeTargetOrigin=a,e.relativeParent=n)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:i,delta:o,layoutDelta:a,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function rT(e){rS.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function rM(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function rR(e){e.clearSnapshot()}function rV(e){e.clearMeasurements()}function rD(e){e.isLayoutDirty=!1}function rL(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function rI(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function r$(e){e.resolveTargetDelta()}function rO(e){e.calcProjection()}function rF(e){e.resetRotation()}function rU(e){e.removeLeadSnapshot()}function rz(e,t,i){e.translate=tJ(t.translate,0,i),e.scale=tJ(t.scale,1,i),e.origin=t.origin,e.originPoint=t.originPoint}function rB(e,t,i,n){e.min=tJ(t.min,i.min,n),e.max=tJ(t.max,i.max,n)}function r_(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}let rN={duration:.45,ease:[.4,0,.1,1]},rW=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),rH=rW("applewebkit/")&&!rW("chrome/")?Math.round:e9;function rq(e){e.min=rH(e.min),e.max=rH(e.max)}function rG(e,t,i){return"position"===e||"preserve-aspect"===e&&!nb(rg(t),rg(i),.2)}let rK=rk({attachResizeListener:(e,t)=>ti(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),rZ={current:void 0},rX=rk({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!rZ.current){let e=new rK({});e.mount(window),e.setOptions({layoutScroll:!0}),rZ.current=e}return rZ.current},resetTransform:(e,t)=>
2{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>"fixed"===window.getComputedStyle(e).position}),rY=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function rJ(e,t,i=1){e9(i<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);let[n,r]=function(e){let t=rY.exec(e);if(!t)return[,];let[,i,n]=t;return[i,n]}(e);if(!n)return;let s=window.getComputedStyle(t).getPropertyValue(n);if(s){let e=s.trim();return i1(e)?parseFloat(e):e}return ep(r)?rJ(r,t,i+1):r}let rQ=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),r0=e=>rQ.has(e),r1=e=>Object.keys(e).some(r0),r2=e=>e===eg||e===eC,r5=(e,t)=>parseFloat(e.split(", ")[t]),r3=(e,t)=>(i,{transform:n})=>{if("none"===n||!n)return 0;let r=n.match(/^matrix3d\((.+)\)$/);if(r)return r5(r[1],t);{let t=n.match(/^matrix\((.+)\)$/);return t?r5(t[1],e):0}},r9=new Set(["x","y","z"]),r4=er.filter(e=>!r9.has(e)),r6={width:({x:e},{paddingLeft:t="0",paddingRight:i="0"})=>e.max-e.min-parseFloat(t)-parseFloat(i),height:({y:e},{paddingTop:t="0",paddingBottom:i="0"})=>e.max-e.min-parseFloat(t)-parseFloat(i),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:r3(4,13),y:r3(5,14)};r6.translateX=r6.x,r6.translateY=r6.y;let r7=(e,t,i)=>{let n=t.measureViewportBox(),r=getComputedStyle(t.current),{display:s}=r,a={};"none"===s&&t.setStaticValue("display",e.display||"block"),i.forEach(e=>{a[e]=r6[e](n,r)}),t.render();let o=t.measureViewportBox();return i.forEach(i=>{let n=t.getValue(i);n&&n.jump(a[i]),e[i]=r6[i](o,r)}),e},r8=(e,t,i={},n={})=>{t={...t},n={...n};let r=Object.keys(t).filter(r0),s=[],a=!1,o=[];if(r.forEach(r=>{let l;let u=e.getValue(r);if(!e.hasValue(r))return;let c=i[r],d=nt(c),h=t[r];if(e0(h)){let e=h.length,t=null===h[0]?1:0;d=nt(c=h[t]);for(let i=t;i<e&&null!==h[i];i++)l?e9(nt(h[i])===l,"All keyframes must be of the same type"):e9((l=nt(h[i]))===d||r2(d)&&r2(l),"Keyframes must be of the same dimension as the current value")}else l=nt(h);if(d!==l){if(r2(d)&&r2(l)){let e=u.get();"string"==typeof e&&u.set(parseFloat(e)),"string"==typeof h?t[r]=parseFloat(h):Array.isArray(h)&&l===eC&&(t[r]=h.map(parseFloat))}else(null==d?void 0:d.transform)&&(null==l?void 0:l.transform)&&(0===c||0===h)?0===c?u.set(l.transform(c)):t[r]=d.transform(h):(a||(s=function(e){let t=[];return r4.forEach(i=>{let n=e.getValue(i);void 0!==n&&(t.push([i,n.get()]),n.set(i.startsWith("scale")?1:0))}),t.length&&e.render(),t}(e),a=!0),o.push(r),n[r]=void 0!==n[r]?n[r]:t[r],u.jump(h))}}),!o.length)return{target:t,transitionEnd:n};{let i=o.indexOf("height")>=0?window.pageYOffset:null,r=r7(t,e,o);return s.length&&s.forEach(([t,i])=>{e.getValue(t).set(i)}),e.render(),R&&null!==i&&window.scrollTo({top:i}),{target:r,transitionEnd:n}}},se=(e,t,i,n)=>{var r,s;let a=function(e,{...t},i){let n=e.current;if(!(n instanceof Element))return{target:t,transitionEnd:i};for(let r in i&&(i={...i}),e.values.forEach(e=>{let t=e.get();if(!ep(t))return;let i=rJ(t,n);i&&e.set(i)}),t){let e=t[r];if(!ep(e))continue;let s=rJ(e,n);s&&(t[r]=s,i||(i={}),void 0===i[r]&&(i[r]=e))}return{target:t,transitionEnd:i}}(e,t,n);return t=a.target,n=a.transitionEnd,r=t,s=n,r1(r)?r8(e,r,i,s):{target:r,transitionEnd:s}},st={current:null},si={current:!1},sn=new WeakMap,sr=Object.keys(Y),ss=sr.length,sa=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],so=q.length;class sl{constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:n,visualState:r},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>e4.render(this.render,!1,!0);let{latestValues:a,renderState:o}=r;this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=o,this.parent=e,this.props=t,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.options=s,this.isControllingVariants=G(t),this.isVariantNode=K(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:l,...u}=this.scrapeMotionValuesFromProps(t,{});for(let e in u){let t=u[e];void 0!==a[e]&&eo(t)&&(t.set(a[e],!1),i0(l)&&l.add(e))}}scrapeMotionValuesFromProps(e,t){return{}}mount(e){this.current=e,sn.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEac
2h((e,t)=>this.bindToMotionValue(t,e)),si.current||function(){if(si.current=!0,R){if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>st.current=e.matches;e.addListener(t),t()}else st.current=!1}}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||st.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){for(let e in sn.delete(this.current),this.projection&&this.projection.unmount(),e6(this.notifyUpdate),e6(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this),this.events)this.events[e].clear();for(let e in this.features)this.features[e].unmount();this.current=null}bindToMotionValue(e,t){let i=es.has(e),n=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&e4.update(this.notifyUpdate,!1,!0),i&&this.projection&&(this.projection.isTransformDirty=!0)}),r=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{n(),r()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}loadFeatures({children:e,...t},i,n,r){let s,a;for(let e=0;e<ss;e++){let i=sr[e],{isEnabled:n,Feature:r,ProjectionNode:o,MeasureLayout:l}=Y[i];o&&(s=o),n(t)&&(!this.features[i]&&r&&(this.features[i]=new r(this)),l&&(a=l))}if(("html"===this.type||"svg"===this.type)&&!this.projection&&s){this.projection=new s(this.latestValues,this.parent&&this.parent.projection);let{layoutId:e,layout:i,drag:n,dragConstraints:a,layoutScroll:o,layoutRoot:l}=t;this.projection.setOptions({layoutId:e,layout:i,alwaysMeasureLayout:!!n||a&&_(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof i?i:"both",initialPromotionConfig:r,layoutScroll:o,layoutRoot:l})}return a}updateFeatures(){for(let e in this.features){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):nD()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}makeTargetAnimatable(e,t=!0){return this.makeTargetAnimatableFromInstance(e,t)}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<sa.length;t++){let i=sa[t];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);let n=e["on"+i];n&&(this.propEventSubscriptions[i]=this.on(i,n))}this.prevMotionValues=function(e,t,i){let{willChange:n}=t;for(let r in t){let s=t[r],a=i[r];if(eo(s))e.addValue(r,s),i0(n)&&n.add(r);else if(eo(a))e.addValue(r,i7(s,{owner:e})),i0(n)&&n.remove(r);else if(a!==s){if(e.hasValue(r)){let t=e.getValue(r);t.hasAnimated||t.set(s)}else{let t=e.getStaticValue(r);e.addValue(r,i7(void 0!==t?t:s,{owner:e}))}}}for(let n in i)void 0===t[n]&&e.removeValue(n);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(e=!1){if(e)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){let e=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(e.initial=this.props.initial),e}let t={};for(let e=0;e<so;e++){let i=q[e],n=this.props[i];(N(n)||!1===n)&&(t[i]=n)}return t}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){t!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,t)),this.values.set(e,t),this.latestValues[e]=t.get()}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return void 0===i&&void 0!==t&&(i=i7(t,{owner:this}),this.addValue(e,i)),i}readValue(e){var t;return void 0===this.latestValues[e]&&this.current?null!==(t=this.getBaseTargetFromProps(this.props,e))&&void 0!==t?t:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e]}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;let{initial:i}=this.props,n="string"==typeof i||"object"==typeof i?null===(t=eJ(this.props,i))||void 0===t?void 0:t[e]:void 0;if(i&&void 0!==n)return n;let r=this.getBaseTargetFromProps(this.props,e);return void 0===r||eo(r)?void 0!==this.initialValues[e]&&void 0===n?void 0:this.baseTarget[e]:r}on(e,t){return this.events[e]||(this.events[e]=new i3),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class su extends sl{sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:i}){delete t[e],delete i[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:t,...i},n){let r=function(e,t,i){let n={};for(let r in e){let e=function(e,t){if(t)return(t[e]||t.default||t).from}(r,t);if(void 0!==e)n[r]=e;else{let e=i.getValue(r);e&&(n[r]=e.get())}}return n}(i,e||{},this);if(n){!function(e,t,i){var n,r;let s=Object.keys(t).filter(t=>!e.hasValue(t)),a=s.length;if(a)for(let o=0;o<a;o++){let a=s[o],l=t[a],u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(r=null!==(n=i[a])&&void 0!==n?n:e.readValue(a))&&void 0!==r?r:t[a]),null!=u&&("string"==typeof u&&(i1(u)||iY(u))?u=parseFloat(u):!nn(u)&&id.test(l)&&(u=iX(a,l)),e.addValue(a,i7(u,{owner:e})),void 0===i[a]&&(i[a]=u),null!==u&&e.setBaseTarget(a,u))}}(this,i,r);let e=se(this,i,r,t);t=e.transitionEnd,i=e.target}return{transition:e,transitionEnd:t,...i}}}class sc extends su{constructor(){super(...arguments),this.type="html"}readValueFromInstance(e,t){if(es.has(t)){let e=iZ(t);return e&&e.default||0}{let i=window.getComputedStyle(e),n=(ed(t)?i.getPropertyValue(t):i[t])||0;return"string"==typeof n?n.trim():n}}measureInstanceViewportBox(e,{transformPagePoint:t}){return nZ(e,t)}build(e,t,i,n){eL(e,t,i,n.transformTemplate)}scrapeMotionValuesFromProps(e,t){return eX(e,t)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;eo(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}renderInstance(e,t,i,n){eG(e,t,i,n)}}class sd extends su{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(es.has(t)){let e=iZ(t);return e&&e.default||0}return t=eK.has(t)?t:L(t),e.getAttribute(t)}measureInstanceViewportBox(){return nD()}scrapeMotionValuesFromProps(e,t){return eY(e,t)}
2build(e,t,i,n){eW(e,t,i,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,i,n){eZ(e,t,i,n)}mount(e){this.isSVGTag=eq(e.tagName),super.mount(e)}}let sh=(e,t)=>ei(e)?new sd(t,{enableHardwareAcceleration:!1}):new sc(t,{enableHardwareAcceleration:!0}),sp={animation:{Feature:nc},exit:{Feature:nh},inView:{Feature:tk},tap:{Feature:tb},focus:{Feature:tg},hover:{Feature:tv},pan:{Feature:n2},drag:{Feature:n0,ProjectionNode:rX,MeasureLayout:n6},layout:{ProjectionNode:rX,MeasureLayout:n6}},sf=function(e){function t(t,i={}){return function({preloadedFeatures:e,createVisualElement:t,useRender:i,useVisualState:n,Component:r}){e&&function(e){for(let t in e)Y[t]={...Y[t],...e[t]}}(e);let s=(0,m.forwardRef)(function(s,a){var o;let l;let u={...(0,m.useContext)(C),...s,layoutId:function({layoutId:e}){let t=(0,m.useContext)(J).id;return t&&void 0!==e?t+"-"+e:e}(s)},{isStatic:c}=u,d=function(e){let{initial:t,animate:i}=function(e,t){if(G(e)){let{initial:t,animate:i}=e;return{initial:!1===t||N(t)?t:void 0,animate:N(i)?i:void 0}}return!1!==e.inherit?t:{}}(e,(0,m.useContext)(T));return(0,m.useMemo)(()=>({initial:t,animate:i}),[Z(t),Z(i)])}(s),h=n(s,c);if(!c&&R){d.visualElement=function(e,t,i,n){let{visualElement:r}=(0,m.useContext)(T),s=(0,m.useContext)(D),a=(0,m.useContext)(M),o=(0,m.useContext)(C).reducedMotion,l=(0,m.useRef)();n=n||s.renderer,!l.current&&n&&(l.current=n(e,{visualState:t,parent:r,props:i,presenceContext:a,blockInitialAnimation:!!a&&!1===a.initial,reducedMotionConfig:o}));let u=l.current;(0,m.useInsertionEffect)(()=>{u&&u.update(i,a)});let c=(0,m.useRef)(!!(i[I]&&!window.HandoffComplete));return V(()=>{u&&(z.postRender(u.render),c.current&&u.animationState&&u.animationState.animateChanges())}),(0,m.useEffect)(()=>{u&&(u.updateFeatures(),!c.current&&u.animationState&&u.animationState.animateChanges(),c.current&&(c.current=!1,window.HandoffComplete=!0))}),u}(r,h,u,t);let i=(0,m.useContext)(Q),n=(0,m.useContext)(D).strict;d.visualElement&&(l=d.visualElement.loadFeatures(u,n,e,i))}return m.createElement(T.Provider,{value:d},l&&d.visualElement?m.createElement(l,{visualElement:d.visualElement,...u}):null,i(r,s,(o=d.visualElement,(0,m.useCallback)(e=>{e&&h.mount&&h.mount(e),o&&(e?o.mount(e):o.unmount()),a&&("function"==typeof a?a(e):_(a)&&(a.current=e))},[o])),h,c,d.visualElement))});return s[ee]=r,s}(e(t,i))}if("undefined"==typeof Proxy)return t;let i=new Map;return new Proxy(t,{get:(e,n)=>(i.has(n)||i.set(n,t(n)),i.get(n))})}((e,t)=>(function(e,{forwardMotionProps:t=!1},i,n){return{...ei(e)?te:tt,preloadedFeatures:i,useRender:function(e=!1){return(t,i,n,{latestValues:r},s)=>{let a=(ei(t)?function(e,t,i,n){let r=(0,m.useMemo)(()=>{let i=eH();return eW(i,t,{enableHardwareAcceleration:!1},eq(n),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){let t={};e$(t,e.style,e),r.style={...t,...r.style}}return r}:function(e,t,i){let n={},r=function(e,t,i){let n=e.style||{},r={};return e$(r,n,e),Object.assign(r,function({transformTemplate:e},t,i){return(0,m.useMemo)(()=>{let n=eI();return eL(n,t,{enableHardwareAcceleration:!i},e),Object.assign({},n.vars,n.style)},[t])}(e,t,i)),r}(e,t,i);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":`pan-${"x"===e.drag?"y":"x"}`),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n})(i,r,s,t),o=function(e,t,i){let n={};for(let r in e)("values"!==r||"object"!=typeof e.values)&&(eU(r)||!0===i&&eF(r)||!t&&!eF(r)||e.draggable&&r.startsWith("onDrag"))&&(n[r]=e[r]);return n}(i,"string"==typeof t,e),l=t!==m.Fragment?{...o,...a,ref:n}:{},{children:u}=i,c=(0,m.useMemo)(()=>eo(u)?u.get():u,[u]);return(0,m.createElement)(t,{...l,children:c})}}(t),createVisualElement:n,Component:e}})(e,t,sp,sh));function sm({children:e,isValidProp:t,...i}){t&&ez(t),(i={...(0,m.useContext)(C),...i}).isStatic=eQ(()=>i.isStatic);let n=(0,m.useMemo)(()=>i,[JSON.stringify(i.transition),i.transformPagePoint,i.reducedMotion]);return m.createElement(C.Provider,{value:n},e)}function sv(){let e=(0,m.useRef)(!1);return V(()=>(e.current=!0,()=>{e.current=!1}),[]),e}class sg extends m.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){let e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function sy({children:e,isPresent:t}){let i=(0,m.useId)(),n=(0,m.useRef)(null),r=(0,m.useRef)({width:0,height:0,top:0,left:0});return(0,m.useInsertionEffect)(()=>{let{width:e,height:s,top:a,left:o}=r.current;if(t||!n.current||!e||!s)return;n.current.dataset.motionPopId=i;
2let l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`
3          [data-motion-pop-id="${i}"] {
4            position: absolute !important;
5            width: ${e}px !important;
6            height: ${s}px !important;
7            top: ${a}px !important;
8            left: ${o}px !important;
9          }
10        `),()=>{document.head.removeChild(l)}},[t]),m.createElement(sg,{isPresent:t,childRef:n,sizeRef:r},m.cloneElement(e,{ref:n}))}let sx=({children:e,initial:t,isPresent:i,onExitComplete:n,custom:r,presenceAffectsLayout:s,mode:a})=>{let o=eQ(sb),l=(0,m.useId)(),u=(0,m.useMemo)(()=>({id:l,initial:t,isPresent:i,custom:r,onExitComplete:e=>{for(let t of(o.set(e,!0),o.values()))if(!t)return;n&&n()},register:e=>(o.set(e,!1),()=>o.delete(e))}),s?void 0:[i]);return(0,m.useMemo)(()=>{o.forEach((e,t)=>o.set(t,!1))},[i]),m.useEffect(()=>{i||o.size||!n||n()},[i]),"popLayout"===a&&(e=m.createElement(sy,{isPresent:i},e)),m.createElement(M.Provider,{value:u},e)};function sb(){return new Map}let sw=e=>e.key||"",sP=({children:e,custom:t,initial:i=!0,onExitComplete:n,exitBeforeEnter:r,presenceAffectsLayout:s=!0,mode:a="sync"})=>{var o;e9(!r,"Replace exitBeforeEnter with mode='wait'");let l=(0,m.useContext)(J).forceRender||function(){let e=sv(),[t,i]=(0,m.useState)(0),n=(0,m.useCallback)(()=>{e.current&&i(t+1)},[t]);return[(0,m.useCallback)(()=>e4.postRender(n),[n]),t]}()[0],u=sv(),c=function(e){let t=[];return m.Children.forEach(e,e=>{(0,m.isValidElement)(e)&&t.push(e)}),t}(e),d=c,h=(0,m.useRef)(new Map).current,p=(0,m.useRef)(d),f=(0,m.useRef)(new Map).current,v=(0,m.useRef)(!0);if(V(()=>{v.current=!1,function(e,t){e.forEach(e=>{let i=sw(e);t.set(i,e)})}(c,f),p.current=d}),o=()=>{v.current=!0,f.clear(),h.clear()},(0,m.useEffect)(()=>()=>o(),[]),v.current)return m.createElement(m.Fragment,null,d.map(e=>m.createElement(sx,{key:sw(e),isPresent:!0,initial:!!i&&void 0,presenceAffectsLayout:s,mode:a},e)));d=[...d];let g=p.current.map(sw),y=c.map(sw),x=g.length;for(let e=0;e<x;e++){let t=g[e];-1!==y.indexOf(t)||h.has(t)||h.set(t,void 0)}return"wait"===a&&h.size&&(d=[]),h.forEach((e,i)=>{if(-1!==y.indexOf(i))return;let r=f.get(i);if(!r)return;let o=g.indexOf(i),v=e;v||(v=m.createElement(sx,{key:sw(r),isPresent:!1,onExitComplete:()=>{h.delete(i);let e=Array.from(f.keys()).filter(e=>!y.includes(e));if(e.forEach(e=>f.delete(e)),p.current=c.filter(t=>{let n=sw(t);return n===i||e.includes(n)}),!h.size){if(!1===u.current)return;l(),n&&n()}},custom:t,presenceAffectsLayout:s,mode:a},r),h.set(i,v)),d.splice(o,0,v)}),d=d.map(e=>{let t=e.key;return h.has(t)?e:m.createElement(sx,{key:sw(e),isPresent:!0,presenceAffectsLayout:s,mode:a},e)}),m.createElement(m.Fragment,null,h.size?d:d.map(e=>(0,m.cloneElement)(e)))};var sE=i(9315);async function sj(e,t,i,n,r=(0,sE.Z)()){let s=e.withConfig({apiVersion:"2023-11-09"});try{let e=new Date(Date.now()+36e5),a=`sanity-preview-url-secret.${r}`,o=function(){if("u">typeof crypto){let e=new Uint8Array(16);crypto.getRandomValues(e);let t="";for(let i=0;i<e.length;i++)t+=e[i].toString(16).padStart(2,"0");return t=btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/[=]+$/,"")}return Math.random().toString(36).slice(2)}(),l=s.patch(a).set({secret:o,source:t,studioUrl:i,userId:n});return await s.transaction().createOrReplace({_id:a,_type:j}).patch(l).commit({tag:"sanity.preview-url-secret"}),{secret:o,expiresAt:e}}finally{await s.delete({query:A})}}var sS=i(76508);function sk(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function sA(e){return e&&e.sensitive?"":"i"}var sC=i(11257),sT=Object.defineProperty,sM=(e,t,i)=>{let n;return(n="symbol"!=typeof t?t+"":t)in e?sT(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i};let sR=new Uint8Array(16),sV=[];for(let e=0;e<256;++e)sV.push((e+256).toString(16).slice(1));var sD={randomUUID:"u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function sL(e,t,i){if(sD.randomUUID&&!t&&!e)return sD.randomUUID();let n=(e=e||{}).random||(e.rng||function(){if(!r&&!(r="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(sR)})();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(e,t=0){return sV[e[t+0]]+sV[e[t+1]]+sV[e[t+2]]+sV[e[t+3]]+"-"+sV[e[t+4]]+sV[e[t+5]]+"-"+sV[e[t+6]]+sV[e[t+7]]+"-"+sV[e[t+8]]+sV[e[t+9]]+"-"+sV[e[t+10]]+sV[e[t+11]]+sV[e[t+12]]+sV[e[t+13]]+sV[e[t+14]]+sV[e[t+15]]}(n)}let sI=["handshake/syn","handshake/syn-ack","handshake/ack"],s$=e=>sI.some(t=>t===e),sO=({data:e={}})=>"object"==typeof e&&null!==e&&!Array.isArray(e)&&!("domain"in e)&&["id","type","from","to"].every(t=>t in e)&&e.type.startsWith("handshake/");function sF(e){let t=e.target,i=e.connectTo.map(e=>({buffer:[],config:e,id:"",handler:r,status:"connecting",interval:void 0,heartbeat:void 0}));function n(e){window.clearInterval(e.interval)}function r(e){let{data:t}=e;if(s$(t.type)){let e=i.find(e=>e.config.id===t.from);e&&"handshake/syn-ack"===t.type&&(l(e,"connected"),u(e,"handshake/ack",{id:e.id}))}}let s=t=>{var n,r,s;let a=t.data;if(!s$(a.type)&&i.find(e=>e.id===a.connectionId)){let t=i.find(e=>e.config.id===a.from);if(t){let i=[a.type,a.data];null==(r=(n=t.config).onEvent)||r.call(n,...i),null==(s=e.onEvent)||s.call(e,...i),c(t,"channel/response",{responseTo:a.id},!1)}}};function a(t){var n;if(sO(t))console.error("Visual editing package mismatch detected! Please ensure you are using the latest version of Sanity Studio and any packages listed here:\nhttps://github.com/sanity-io/visual-editing");else if(function(t){let{data:n,origin:r}=t;return"sanity/channels"===n.domain&&n.to==e.id&&i.map(e=>e.config.id).includes(n.from)&&"channel/response"!==n.type&&r===e.targetOrigin}(t)){let{data:e}=t;null==(n=i.find(t=>t.config.id===e.from))||n.handler(t)}}function o(e){e.heartbeat&&window.clearInterval(e.heartbeat)}function l(t,i){var a,l,d;t.status=i,null==(l=(a=t.config).onStatusUpdate)||l.call(a,i,t.config.id),null==(d=e.onStatusUpdate)||d.call(e,i,t.config.id),"connecting"===i||"reconnecting"===i?(t.handler=r,o(t),t.id=sL(),t.interval=window.setInterval(()=>{u(t,"handshake/syn",{id:t.id})},500)):"connected"===i?(t.handler=s,n(t),function(e){if(o(e),e.config.heartbeat){let t="number"==typeof e.config.heartbeat?e.config.heartbeat:1e3;e.heartbeat=window.setInterval(()=>{c(e,"channel/heartbeat")},t)}}(t),function(e){let t=[...e.buffer];e.buffer.splice(0,e.buffer.length),t.forEach(({type:t,data:i})=>{c(e,t,i)})}(t)):"disconnected"===i&&(t.id=null,t.handler=r,n(t),o(t))}function u(i,n,r){if(!i.id)throw Error("No channel ID set");let s={connectionId:i.id,data:r,domain:"sanity/channels",from:e.id,id:sL(),to:i.config.id,type:n};try{null==t||t.postMessage(s,{targetOrigin:"*"})}catch{throw Error(`Failed to postMessage '${s.id}' on '${e.id}'`)}}function c(i,n,r,s=!0){let a=sL();if("connecting"===i.status||"reconnecting"===i.status||"disconnected"===i.status)return void i.buffer.push({type:n,data:r});if(!i.id)throw Error("No channel ID set");let o={connectionId:i.id,data:r,domain:"sanity/channels",from:e.id,id:a,to:i.config.id,type:n};if(s){let t=setTimeout(()=>{o.connectionId===i.id&&(window.removeEventListener("message",s,!1),"channel/heartbeat"!==n&&i.buffer.push({type:n,data:r}),l(i,"reconnecting"),console.warn(`Received no response to message '${o.type}' on client '${e.id}' (ID: '${o.id}').`))},1e3),s=e=>{var i;let{data:n}=e;"channel/response"===n.type&&null!=(i=n.data)&&i.responseTo&&n.data.responseTo===o.id&&(window.removeEventListener("message",s,!1),clearTimeout(t))};window.addEventListener("message",s,!1)}try{null==t||t.postMessage(o,{targetOrigin:e.targetOrigin})}catch{throw Error(`Failed to postMessage '${o.id}' on client '${e.id}'`)}}
10return window.addEventListener("message",a,!1),i.forEach(e=>{l(e,"connecting")}),{destroy:function(){i.forEach(e=>{["disconnected"].includes(e.status)||(c(e,"channel/disconnect",{id:e.id},!1),l(e,"disconnected"))}),window.removeEventListener("message",a,!1),i.forEach(e=>{o(e),n(e)})},send:function(e,t,n){(e?Array.isArray(e)?[...e]:[e]:i).forEach(e=>{let r=i.find(t=>t.config.id===e);if(!r)throw Error("Invalid channel ID");c(r,t,n)})}}}function sU(e){var t,i,n;let r=typeof e;return"object"===r&&(r=null!=(n=e&&(null==(i=null==(t=Object.getPrototypeOf(e))?void 0:t.constructor)?void 0:i.name))?n:"null"),"string"===r?`"${e}"`:"number"===r||"bigint"===r||"boolean"===r?`${e}`:r}function sz(e,t,i,n,r){var s,a,o,d,h,p,f,m,v,g,y;let x=r&&"input"in r?r.input:i.value,b=null!=(s=null==r?void 0:r.expected)?s:e.expects,w=null!=(a=null==r?void 0:r.received)?a:sU(x),P={kind:e.kind,type:e.type,input:x,expected:b,received:w,message:`Invalid ${t}: ${b?`Expected ${b} but r`:"R"}eceived ${w}`,requirement:e.requirement,path:null==r?void 0:r.path,issues:null==r?void 0:r.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly,skipPipe:n.skipPipe},E="schema"===e.kind,j=null!=(p=null!=(h=null!=(d=null!=(o=e.message)?o:(m=e.reference,v=P.lang,null==(g=null==c?void 0:c.get(m))?void 0:g.get(v)))?d:E?(f=P.lang,null==u?void 0:u.get(f)):null)?h:n.message)?p:(y=P.lang,null==l?void 0:l.get(y));j&&(P.message="function"==typeof j?j(P):j),E&&(i.typed=!1),i.issues?i.issues.push(P):i.issues=[P]}var sB=class extends Error{constructor(e){super(e[0].message),sM(this,"issues"),this.name="ValiError",this.issues=e}};function s_(e){return{kind:"schema",type:"boolean",reference:s_,expects:"boolean",async:!1,message:e,_run(e,t){return"boolean"==typeof e.value?e.typed=!0:sz(this,"type",e,t),e}}}function sN(e,t){return{kind:"schema",type:"object",reference:sN,expects:"Object",async:!1,entries:e,message:t,_run(e,t){var i;let n=e.value;if(n&&"object"==typeof n)for(let r in e.typed=!0,e.value={},this.entries){let s=n[r],a=this.entries[r]._run({typed:!1,value:s},t);if(a.issues){let o={type:"object",origin:"value",input:n,key:r,value:s};for(let t of a.issues)t.path?t.path.unshift(o):t.path=[o],null==(i=e.issues)||i.push(t);if(e.issues||(e.issues=a.issues),t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),(void 0!==a.value||r in n)&&(e.value[r]=a.value)}else sz(this,"type",e,t);return e}}}function sW(e,...t){let i={kind:"schema",type:"optional",reference:sW,expects:`${e.expects} | undefined`,async:!1,wrapped:e,_run(e,t){return void 0===e.value&&("default"in this&&(e.value="function"==typeof this.default?this.default(e,t):this.default),void 0===e.value)?(e.typed=!0,e):this.wrapped._run(e,t)}};return 0 in t&&(i.default=t[0]),i}function sH(e){return{kind:"schema",type:"string",reference:sH,expects:"string",async:!1,message:e,_run(e,t){return"string"==typeof e.value?e.typed=!0:sz(this,"type",e,t),e}}}let sq=/^([A-Za-z]+):([0-9]+)$/,sG=/^([A-Za-z]+):([0-9]+),([0-9]+)$/,sK=/^([A-Za-z]+):([a-z0-9]+)$/,sZ=function(...e){return{...e[0],pipe:e,_run(t,i){for(let n=0;n<e.length;n++){t=e[n]._run(t,i);let r=e[n+1];if(i.skipPipe||t.issues&&(i.abortEarly||i.abortPipeEarly||"schema"===(null==r?void 0:r.kind)||"transformation"===(null==r?void 0:r.kind))){t.typed=!1;break}}return t}}}(sH(),function e(t,i){return{kind:"validation",type:"min_length",reference:e,async:!1,expects:`>=${t}`,requirement:t,message:i,_run(e,t){return e.typed&&e.value.length<this.requirement&&sz(this,"length",e,t,{received:`${e.value.length}`}),e}}}(1)),sX=sW(sZ);sN({baseUrl:sZ,dataset:sX,id:sZ,path:sZ,projectId:sX,tool:sX,type:sX,workspace:sX,isDraft:sW(sH())}),sN({origin:sZ,href:sZ,data:sW(function e(t,i,n){return{kind:"schema",type:"record",reference:e,expects:"Object",async:!1,key:t,value:i,message:n,_run(e,t){var i,n;let r=e.value;if(r&&"object"==typeof r){for(let s in e.typed=!0,e.value={},r)if("__proto__"!==s&&"prototype"!==s&&"constructor"!==s){let a=r[s],o=this.key._run({typed:!1,value:s},t);if(o.issues){let n={type:"record",origin:"key",input:r,key:s,value:a};for(let t of o.issues)t.path=[n],null==(i=e.issues)||i.push(t);
10if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}let l=this.value._run({typed:!1,value:a},t);if(l.issues){let i={type:"record",origin:"value",input:r,key:s,value:a};for(let t of l.issues)t.path?t.path.unshift(i):t.path=[i],null==(n=e.issues)||n.push(t);if(e.issues||(e.issues=l.issues),t.abortEarly){e.typed=!1;break}}o.typed&&l.typed||(e.typed=!1),o.typed&&(e.value[o.value]=l.value)}}else sz(this,"type",e,t);return e}}}(sH(),function e(){return{kind:"schema",type:"unknown",reference:e,expects:"unknown",async:!1,_run:e=>(e.typed=!0,e)}}()))});let sY={alt:"altKey",ctrl:"ctrlKey",mod:"u">typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform)?"metaKey":"ctrlKey",shift:"shiftKey"};function sJ(e){return"Alt"===e.key}function sQ(e,t){let i;return(...n)=>{clearTimeout(i),i=setTimeout(()=>{e.apply(e,n)},t)}}let s0=(0,m.createContext)(null);s0.displayName="PanelsContext";let s1=y.zo.div`
11  overflow: hidden;
12  flex-basis: 0;
13  flex-shrink: 1;
14`,s2=function({children:e,defaultSize:t=null,id:i,minWidth:n,maxWidth:r,order:s=0}){let a=(0,m.useContext)(s0);if(null===a)throw Error("Panel components must be rendered within a PanelGroup container");let{getPanelStyle:o,registerElement:l,unregisterElement:u}=a,c=o(i);return(0,m.useLayoutEffect)(()=>(l(i,{id:i,type:"panel",defaultSize:t,maxWidth:null!=r?r:null,minWidth:null!=n?n:0,order:s}),()=>{u(i)}),[i,t,s,r,n,l,u]),(0,h.jsx)(s1,{style:c,children:e})},s5="presentation/panels",s3=()=>JSON.parse(localStorage.getItem(s5)||"{}"),s9=e=>e.map(e=>[e.id,e.order].join(":")).join(",");function s4(e,t,i){let{maxWidth:n,minWidth:r}=e;return Math.min(null==n?100:n/i*100,Math.max(r/i*100,t))}function s6(e,t,i=0,n=null){return e.clientX-(n||t.getBoundingClientRect()).left-i}function s7(e){return"panel"===e.type}function s8(e){return"resizer"===e.type}function ae(e){return Array.from(e.values()).sort(({order:e},{order:t})=>null==e&&null==t?0:null==e?-1:null==t?1:e-t)}function at(e,t,i){let n=t.reduce((e,t)=>e+t,0),r=[...t].map(e=>e/n*100),s=0;for(let t=0;t<e.length;t++){let n=e[t],a=r[t],o=s4(n,a,i);a!=o&&(s+=a-o,r[t]=o)}if("0.000"!==s.toFixed(3))for(let t=0;t<e.length;t++){let{maxWidth:n,minWidth:a}=e[t];a=a/i*100,null!=n&&(n=n/i*100);let o=Math.min(null!=n?n:100,Math.max(a,r[t]+s));if(o!==r[t]&&(s-=o-r[t],r[t]=o,"0.000"===Math.abs(s).toFixed(3)))break}return r}let ai=y.zo.div`
15  display: flex;
16  flex-direction: row;
17  height: 100%;
18  overflow: hidden;
19  width: 100%;
20`,an=function({children:e}){let t=(0,m.useRef)(null),[i,n]=(0,m.useState)(new Map),r=(0,m.useMemo)(()=>ae(i).filter(s7),[i]),[s,a]=(0,m.useState)([]),[o,l]=(0,m.useState)(null),u=(0,m.useRef)({elements:i,panels:r,widths:s}),c=(0,m.useCallback)(e=>({flexGrow:function(e,t,i){if(1===e.length)return"100";let n=i[e.findIndex(e=>e.id===t)];return null==n?"0":n.toPrecision(10)}(r,e,s),pointerEvents:null===o?void 0:"none"}),[o,r,s]),d=(0,m.useCallback)((e,t)=>{n(i=>{if(i.has(e))return i;let n=new Map(i);return n.set(e,t),n})},[]),p=(0,m.useCallback)(e=>{n(t=>{if(!t.has(e))return t;let i=new Map(t);return i.delete(e),i})},[]),f=(0,m.useRef)({containerWidth:window.innerWidth,dragOffset:0,panelAfter:null,panelBefore:null,resizerIndex:-1,resizerRect:null,startX:0,widths:[]}),v=(0,m.useCallback)((e,t)=>{let n=ae(i),r=n.findIndex(t=>t.id===e),s=i.get(e);if(!s||!s8(s))return;let a=s.el.current;a&&(f.current={resizerIndex:r,panelBefore:n.reduce((e,t,i)=>s7(t)&&i<r?t:e,null),panelAfter:n.reduce((e,t,i)=>null===e&&s7(t)&&i>r?t:e,null),containerWidth:window.innerWidth,startX:t.pageX,dragOffset:s6(t,a),resizerRect:a.getBoundingClientRect(),widths:u.current.widths},l(e))},[i]),g=(0,m.useCallback)(()=>{l(null)},[]),y=(0,m.useCallback)((e,n)=>{n.preventDefault(),n.stopPropagation();let{containerWidth:r,dragOffset:s,panelBefore:o,panelAfter:l,resizerRect:c}=f.current;if(null==o||null==l)return;let d=i.get(e);if(!d||!s8(d))return;let h=d.el.current;if(!h)return;let p=s6(n,h,s,c);if(0===p)return;let{widths:m}=u.current,v=function(e,t,i,n,r,s){let{panels:a,widths:o}=r,{widths:l}=s,u=l||o,c=[...u];{let r=e<0?n:i,s=u[a.findIndex(e=>e.id===r.id)],o=s4(r,s+Math.abs(e),t);if(s===o)return u;e=e<0?s-o:o-s}let d=0,h=e<0?i:n,p=a.findIndex(e=>e.id===h.id);for(;;){let i=a[p],n=u[p],r=s4(i,n-(Math.abs(e)-Math.abs(d)),t);if(n!==r&&(d+=n-r,c[p]=r,d.toPrecision(10).localeCompare(Math.abs(e).toPrecision(10),void 0,{numeric:!0})>=0))break;if(e<0){if(--p<0)break}else if(++p>=a.length)break}return 0===d?u:(h=e<0?n:i,c[p=a.findIndex(e=>e.id===h.id)]=u[p]+d,c)}(p/t.current.getBoundingClientRect().width*100,r,o,l,u.current,f.current);m.some((e,t)=>e!==v[t])&&a(v)},[i]);(0,m.useLayoutEffect)(()=>{u.current.elements=i,u.current.panels=r,u.current.widths=s},[i,r,s]);let x=(0,m.useMemo)(()=>{let e=(e,t)=>
20{var i;let n=s3(),r=s9(e);i={...n,[r]:t},localStorage.setItem(s5,JSON.stringify(i))};return{get:e=>{let t=s3(),i=s9(e);return Array.isArray(t[i])&&t[i].some(e=>null===e)?void 0:t[i]},set:e,setDebounced:sQ(e,100)}},[]);(0,m.useLayoutEffect)(()=>{let{widths:e}=u.current;if(e.length===r.length)return;let t=x.get(r);if(t)return void a(at(r,t,window.innerWidth));a(function(e){let t=e.length,i=100,n=e.map(e=>e.defaultSize?(i-=e.defaultSize,t-=1,e.defaultSize):null),r=i/t;return n.map(e=>null===e?r:e)}(r))},[x,r]),(0,m.useEffect)(()=>{s.length&&x.setDebounced(r,s)},[x,r,s]),(0,m.useLayoutEffect)(()=>{let e=new ResizeObserver(()=>{let{panels:e,widths:t}=u.current,i=at(e,t,window.innerWidth);t.some((e,t)=>e!==i[t])&&a(i)});return e.observe(t.current),()=>{e.disconnect()}},[]);let b=(0,m.useMemo)(()=>({activeResizer:o,drag:y,getPanelStyle:c,registerElement:d,startDragging:v,stopDragging:g,unregisterElement:p}),[o,y,c,d,v,g,p]);return(0,h.jsx)(s0.Provider,{value:b,children:(0,h.jsx)(ai,{ref:t,children:e})})};function ar(e){let{children:t,message:i,onRetry:n,onContinueAnyway:r,...s}
20=e,{t:a}=(0,v.$G7)(x.p),o=(0,h.jsx)(f.zx,{fontSize:1,mode:"ghost",onClick:n,text:a("error-card.retry-button.text")}),l=(0,h.jsx)(f.zx,{fontSize:1,mode:"ghost",tone:"critical",onClick:r,text:a("error-card.continue-button.text")});return(0,h.jsx)(f.Zb,{height:"fill",...s,children:(0,h.jsx)(f.kC,{align:"center",height:"fill",justify:"center",children:(0,h.jsx)(f.W2,{padding:4,sizing:"border",width:0,children:(0,h.jsxs)(f.Kq,{space:4,children:[(0,h.jsxs)(f.Kq,{space:3,children:[(0,h.jsx)(f.xv,{size:1,weight:"semibold",children:a("error-card.title")}),(0,h.jsx)(f.xv,{muted:!0,size:1,children:i})]}),t,n&&r?(0,h.jsxs)(f.gF,{space:2,children:[o,l]}):n?(0,h.jsx)(f.xu,{children:o}):r?(0,h.jsx)(f.xu,{children:l}):null]})})})})}let as=(0,m.forwardRef)(function(e,t){let{searchParams:i,...n}=e;return(0,h.jsx)(g.Px,{...n,ref:t,state:{type:void 0,_searchParams:Object.entries(i)},title:void 0})}),aa=(0,m.forwardRef)(function(e,t){let{documentId:i,documentType:n,parentRefPath:r,template:s,searchParams:a,...o}=e;return(0,h.jsx)(g.Px,{...o,ref:t,state:{id:i,type:n,_searchParams:Object.entries({...a,prefersLatestPublished:"published"===a.perspective?"true":void 0})},title:void 0})});function ao(e){let{children:t,onStructureParams:i,structureParams:n,searchParams:r,refs:s}=e,{state:a,resolvePathFromState:o}=(0,g.tv)(),l=(0,v.BoV)(Object.fromEntries(a._searchParams||[])),u=(0,m.useCallback)(e=>`${o(a)}${function(e){let t=["comment","inspect","instruction","pathKey","rev","since","template","prefersLatestPublished","view"];return function(e={}){let t=Object.entries(e).map(([e,t])=>`${e}=${t}`).join("&");return t.length?`?${t}`:""}(Object.entries(e).filter(([e])=>t.includes(e)).reduce((e,[t,i])=>null==i?e:{...e,[t]:i},{}))}({...l,...e})}`,[o,l,a]),c=(0,m.useMemo)(()=>({index:0,groupIndex:0,siblingIndex:0,payload:{},params:n,hasGroupSiblings:!1,groupLength:1,routerPanesState:[],ChildLink:e=>{let{childId:t,...i}=e,n=null==s?void 0:s.find(e=>e._id===t||(0,v.vsM)(e._id)===t);return n?(0,h.jsx)(g.Px,{...i,state:{id:t,type:n._type,_searchParams:Object.entries({...r,prefersLatestPublished:"published"===(null==r?void 0:r.perspective)?"true":void 0})}}):(0,h.jsx)("div",{...i})},BackLink:e=>(0,h.jsx)(as,{...e,searchParams:r}),ReferenceChildLink:e=>(0,h.jsx)(aa,{...e,searchParams:r}),ParameterizedLink:()=>(0,h.jsx)(h.Fragment,{children:"ParameterizedLink"}),closeCurrentAndAfter:()=>{console.warn("closeCurrentAndAfter")},handleEditReference:e=>{console.warn("handleEditReference",e)},replaceCurrent:e=>{console.warn("replaceCurrent",e)},closeCurrent:()=>{console.warn("closeCurrent")},duplicateCurrent:e=>{console.warn("duplicateCurrent",e)},setView:e=>{console.warn("setView",e)},setParams:e=>{var t;i({...e,inspect:null!=(t=e.inspect)?t:void 0})},setPayload:e=>{console.warn("setPayload",e)},navigateIntent:(e,t,i)=>{console.warn("navigateIntent",e,t,i)},createPathWithParams:u}),[u,i,s,r,n]);return(0,h.jsx)(w.ud.Provider,{value:c,children:t})}let al=(0,y.zo)(P.PaneLayout)`
21  height: 100%;
22`,au=(0,y.zo)(f.kC)`
23  & > div {
24    min-width: none !important;
25    max-width: none !important;
26  }
27`,ac=(0,y.zo)(f.EK)`
28  white-space: pre-wrap;
29`;function ad(e){let{mainDocumentState:t,onStructureParams:i,searchParams:n,refs:r}=e,{t:s}=(0,v.$G7)(x.p),{devMode:a}=(0,x.u)(),o=(0,m.useMemo)(()=>r.filter(e=>{var i;return(0,v.vsM)(e._id)!==(null==(i=null==t?void 0:t.document)?void 0:i._id)}).map(e=>e._id),[t,r]),l=(0,m.useMemo)(()=>({id:"$root",options:{filter:"_id in $ids",params:{ids:o}},schemaTypeName:"",title:s("document-list-pane.document-list.title"),type:"documentList"}),[o,s]),[u,c]=(0,m.useState)(null),d=(0,m.useCallback)(()=>c(null),[]),[p]=(0,m.useState)(()=>({}));return(0,m.useEffect)(()=>c(null),[r]),u?(0,h.jsx)(ar,{flex:1,message:s("document-list-pane.error.text"),onRetry:d,children:a&&(0,h.jsx)(f.Zb,{overflow:"auto",padding:3,radius:2,tone:"critical",children:(0,h.jsxs)(f.Kq,{space:3,children:[(0,h.jsx)(f.__,{muted:!0,size:0,children:s("presentation-error.label")}),(0,h.jsx)(ac,{size:1,children:u.error.message})]})})}):(0,h.jsx)(f.SV,{onCatch:c,children:(0,h.jsx)(al,{children:(0,h.jsx)(P.StructureToolProvider,{children:(0,h.jsx)(ao,{onStructureParam
29s:i,structureParams:p,searchParams:n,refs:r,children:(0,h.jsx)(au,{direction:"column",flex:1,children:(0,h.jsx)(P.PaneContainer,{index:0,itemId:"$root",pane:l,paneKey:"$root"})})})})})})}let ah=(0,y.zo)(f.EK)`
30  white-space: pre-wrap;
31`;function ap(e){let{documentId:t,documentType:i,onFocusPath:n,onStructureParams:r,searchParams:s,structureParams:a}=e,{template:o,templateParams:l}=a,{t:u}=(0,v.$G7)(x.p),{devMode:c}=(0,x.u)(),d=(0,m.useMemo)(()=>({id:t,options:{id:t,type:i,template:o,templateParameters:(0,g.ZB)(l)},title:"",type:"document"}),[t,i,o,l]),[p,y]=(0,m.useState)(null),b=(0,m.useCallback)(()=>y(null),[]);return(0,m.useEffect)(()=>{y(null)},[t,i,a]),p?(0,h.jsx)(ar,{flex:1,message:u("document-pane.error.text"),onRetry:b,children:c&&(0,h.jsx)(f.Zb,{overflow:"auto",padding:3,radius:2,tone:"critical",children:(0,h.jsxs)(f.Kq,{space:3,children:[(0,h.jsx)(f.__,{muted:!0,size:0,children:u("presentation-error.label")}),(0,h.jsx)(ah,{size:1,children:p.error.message})]})})}):(0,h.jsx)(f.SV,{onCatch:y,children:(0,h.jsx)(P.PaneLayout,{style:{height:"100%"},children:(0,h.jsx)(ao,{searchParams:s,onStructureParams:r,structureParams:a,children:(0,h.jsx)(P.DocumentPane,{paneKey:"document",index:1,itemId:"document",pane:d,onFocusPath:n})})})})}function af(e){let{documentId:t,documentType:i,onFocusPath:n,onStructureParams:r,searchParams:s,structureParams:a}=e;return(0,h.jsx)(P.StructureToolProvider,{children:(0,h.jsx)(ap,{documentId:t,documentType:i,onFocusPath:n,onStructureParams:r,searchParams:s,structureParams:a})})}function am(e){var t;let{documentId:i,documentType:n,mainDocumentState:r,onFocusPath:s,onStructureParams:a,refs:o,searchParams:l,structureParams:u}=e,{t:c}=(0,v.$G7)(x.p),d=(0,v.I_y)(),p=(0,m.useCallback)(e=>(0,h.jsx)(g.Px,{...e,state:{id:r.document._id,type:r.document._type,_searchParams:Object.entries({...l,prefersLatestPublished:"published"===(null==l?void 0:l.perspective)?"true":void 0})}}),[r,l]),y=(0,m.useMemo)(()=>{var e;return d.get((null==(e=null==r?void 0:r.document)?void 0:e._type)||"shoe")},[r,d]),w=function(e,t){let i=(0,v.rq_)(),[n,r]=(0,m.useState)({});return(0,m.useEffect)(()=>{if(!t)return;let n=(0,v.eLL)(i,t,e,"").subscribe(e=>{r(e)});return()=>{null==n||n.unsubscribe()}},[i,t,e]),n}((null==(t=null==r?void 0:r.document)?void 0:t._id)||"",y),P=(0,m.useMemo)(()=>r?(0,h.jsx)(v.ogX,{...(0,v.L_b)({value:r.document,published:w.published,draft:w.draft}),schemaType:y,status:(0,h.jsx)(f.Zb,{padding:1,radius:2,shadow:1,children:(0,h.jsx)(f.xv,{muted:!0,size:0,weight:"medium",children:c("main-document.label")})})}):null,[r,y,c,w]);return i&&n?(0,h.jsx)(af,{documentId:i,documentType:n,onFocusPath:s,onStructureParams:a,searchParams:l,structureParams:u}):(0,h.jsxs)(f.kC,{direction:"column",flex:1,height:"fill",children:[r&&(0,h.jsx)(f.Zb,{padding:3,tone:r.document?"inherit":"caution",children:r.document?(0,h.jsx)(v.oUE,{__unstable_focusRing:!0,as:p,"data-as":"a",radius:2,sizing:"border",tone:"inherit",children:P}):(0,h.jsx)(f.Zb,{padding:2,radius:2,tone:"inherit",children:(0,h.jsxs)(f.kC,{gap:3,children:[(0,h.jsx)(f.xu,{flex:"none",children:(0,h.jsx)(f.xv,{size:1,children:(0,h.jsx)(b.foC,{})})}),(0,h.jsx)(f.xu,{flex:1,children:(0,h.jsx)(f.xv,{size:1,children:(0,h.jsx)(v.vNl,{t:c,i18nKey:"main-document.missing.text",components:{Code:"code"},values:{path:r.path}})})})]})})}),(0,h.jsx)(ad,{mainDocumentState:r,onStructureParams:a,searchParams:l,refs:o})]})}let av=y.zo.div`
32  position: relative;
33`,ag=y.zo.div`
34  position: absolute;
35  top: 0;
36  bottom: 0;
37  left: -5px;
38  width: 9px;
39  z-index: 10;
40  cursor: ${({$disabled:e})=>e?"auto":"ew-resize"};
41
42  /* Border */
43  & > span:nth-child(1) {
44    display: block;
45    border-left: 1px solid var(--card-border-color);
46    position: absolute;
47    top: 0;
48    left: 4px;
49    bottom: 0;
50    transition: opacity 200ms;
51  }
52
53  ${({$disabled:e})=>!e&&"\n    /* Hover effect */\n    & > span:nth-child(2) {\n      display: block;\n      position: absolute;\n      top: 0;\n      left: 0;\n      width: 9px;\n      bottom: 0;\n      background-color: var(--card-border-color);\n      opacity: 0;\n      transition: opacity 150ms;\n    }\n\n    @media (hover: hover) {\n      &:hover > span:nth-child(2) {\n        opacity: 0.2;\n      }\n    }\n  "}
54`,ay=function({id:e,order:t,disabled:i=!1}){let n=(0,m.useRef)(null),r=(0,m.useContext)(s0);if(null===r)throw Error("Panel components must be rendered within a PanelGroup container");let s=(0,m.useRef)(e||sL()).current,{activeResizer:a,drag:o,startDragging:l,stopDragging:u,registerElement:c,unregisterElement:d}=r,p=a===s;if(null===r)throw Error("Panel components must be rendered within a PanelGroup container");let f=(0,m.useCallback)(e=>{l(s,e.nativeEvent)},[s,l]),v=(0,m.useCallback)(e=>{o(s,e)},[s,o]),g=(0,m.useCallback)(()=>{n.current.blur(),u()},[u]);return(0,m.useEffect)(()=>
54{if(p&&!i)return window.addEventListener("mousemove",v),window.addEventListener("mouseup",g),()=>{window.removeEventListener("mousemove",v),window.removeEventListener("mouseup",g)}},[i,p,v,g]),(0,m.useLayoutEffect)(()=>(c(s,{id:s,order:t,type:"resizer",el:n}),()=>{d(s)}),[s,t,c,d]),(0,h.jsx)(av,{onMouseDown:f,ref:n,children:(0,h.jsxs)(ag,{$disabled:i,children:[(0,h.jsx)("span",{}),(0,h.jsx)("span",{})]})})},ax=e=>{let{documentId:t,setDisplayedDocument:i,getCommentIntent:n}=e;return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ay,{order:4}),(0,h.jsx)(s2,{id:"content",minWidth:325,order:5,children:(0,h.jsx)(E.D,{documentId:t,setDisplayedDocument:i,children:(0,h.jsx)(v.dFz,{getIntent:n,children:e.children})})})]})},ab=e=>{let{documentId:t,documentsOnPage:i,documentType:n,getCommentIntent:r,mainDocumentState:s,onFocusPath:a,onStructureParams:o,searchParams:l,setDisplayedDocument:u,structureParams:c}=e;return(0,h.jsx)(ax,{documentId:t,getCommentIntent:r,setDisplayedDocument:u,children:(0,h.jsx)(am,{documentId:t,documentType:n,mainDocumentState:s,onFocusPath:a,onStructureParams:o,refs:i,searchParams:l,structureParams:c})})},aw=function(e){let{children:t,navigate:i}=e,n=(0,m.useCallback)((e,t)=>{i(t||{},e?{preview:e}:{})},[i]);return(0,h.jsx)(x.P.Provider,{value:n,children:t})},aP=(0,m.memo)(function(e){let{minWidth:t,maxWidth:i,component:n}=e;return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s2,{id:"navigator",minWidth:t,maxWidth:i,order:1,children:(0,h.jsx)(n,{})}),(0,h.jsx)(ay,{order:2,disabled:null!=t&&null!=i&&t===i})]})}),aE=function(e){let{children:t,params:i}=e,n=(0,m.useMemo)(()=>i,[i]);return(0,h.jsx)(x.a.Provider,{value:n,children:t})},aj=function(e){let{children:t,devMode:i,name:n,navigate:r,params:s,searchParams:a,structureParams:o}=e,l=(0,m.useMemo)(()=>({devMode:i,name:n,navigate:r,params:s,searchParams:a,structureParams:o}),[i,n,r,s,a,o]);return(0,h.jsx)(x.b.Provider,{value:l,children:t})},aS="ACTION_IFRAME_LOADED",ak="ACTION_IFRAME_REFRESH",aA="ACTION_IFRAME_RELOAD",aC="ACTION_VISUAL_EDITING_OVERLAYS_TOGGLE",aT=(e,t)=>{switch(t.type){case aS:return"loaded"===e.iframe.status?e:{...e,iframe:{...e.iframe,status:"loaded"}};case ak:return"refreshing"===e.iframe.status?e:{...e,iframe:{...e.iframe,status:"refreshing"}};case aA:return"reloading"===e.iframe.status?e:{...e,iframe:{...e.iframe,status:"reloading"}};case aC:return aM(e,t);default:return e}},aM=(e,t)=>e.visualEditing.overlaysEnabled===t.enabled?e:{...e,visualEditing:{...e.visualEditing,overlaysEnabled:t.enabled}},aR=sN({mainDocument:{...d=s_(),fallback:!1,_run(e,t){return d._run(e,t),e.issues?{typed:!0,value:"function"==typeof this.fallback?this.fallback(e,t):this.fallback}:e}},iframe:sN({status:function e(t,i){return{kind:"schema",type:"picklist",reference:e,expects:t.map(sU).join(" | ")||"never",async:!1,options:t,message:i,_run(e,t){return this.options.includes(e.value)?e.typed=!0:sz(this,"type",e,t),e}}}(["loading","loaded","refreshing","reloading"])}),visualEditing:sN({overlaysEnabled:s_()})}),aV={mainDocument:!1,iframe:{status:"loading"},visualEditing:{overlaysEnabled:!1}};function aD(e){return function(e,t,i){var n,r,s;let a=e._run({typed:!1,value:t},{lang:(n=void 0,null==o?void 0:o.lang),message:null==n?void 0:n.message,abortEarly:null!=(r=null==n?void 0:n.abortEarly)?r:null==o?void 0:o.abortEarly,abortPipeEarly:null!=(s=null==n?void 0:n.abortPipeEarly)?s:null==o?void 0:o.abortPipeEarly,skipPipe:null==n?void 0:n.skipPipe});if(a.issues)throw new sB(a.issues);return a.value}(aR,{...aV,...e})}let aL=sf(y.zo.iframe`
55  border: 0;
56  max-height: 100%;
57  width: 100%;
58  display: block;
59`),aI=function(e){var t;let{fontSize:i=1,onChange:n,origin:r,padding:s=3,prefix:a,suffix:o,value:l}=e,{t:u}=(0,v.$G7)(x.p),{basePath:c="/"}=(null==(t=(0,v.AJ_)())?void 0:t.activeWorkspace)||{},d=(0,m.useRef)(null),[p,g]=(0,m.useState)(void 0),[y,w]=(0,m.useState)(void 0),P=(0,m.useCallback)(e=>{g(e.currentTarget.value)},[]),E=(0,m.useCallback)(e=>{var t;if("Enter"===e.key){if(void 0===p)return;let e=p.startsWith("/")||""===p?`${r}${p}`:p;if(!e.startsWith(r+"/")&&e!==r)return void w(u("preview-location-input.error",{origin:r,context:"missing-origin"}));if(!r&&(e.startsWith(`${c}/`)||e===c))return void w(u("preview-location-input.error",{basePath:c,context:"same-base-path"}));let i=e===r?r+"/":e;w(void 0),g(void 0),n(i.slice(r.length)),null==(t=d.current)||t.blur()}"Escape"===e.key&&(w(void 0),g(void 0))},[c,n,r,p,u]),j=(0,m.useCallback)(()=>{w(void 0),g(void 0)},[]);(0,m.useEffect)(()=>{w(void 0),g(void 0)},[r,l]);let S=(0,m.useMemo)(()=>({icon:b.X5P}),[]);return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(f.oi,{clearButton:y?S:void 0,customValidity:y,fontSize:i,onBlur:j,onClear:()=>
59{w(void 0),g(r+l)},onChange:P,onKeyDownCapture:E,padding:s,prefix:a,style:{zIndex:1},radius:2,ref:d,space:s,suffix:o,value:void 0===p?`${r}${l}`:p})})};function a$(e){let{initialUrl:t,openPopup:i,previewLocationOrigin:n,previewLocationRoute:r}=e,{t:s}=(0,v.$G7)(x.p),a=(0,m.useCallback)(e=>{e.preventDefault(),i(e.currentTarget.href)},[i]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(aO,{initialUrl:t,previewLocationOrigin:n,previewLocationRoute:r}),(0,h.jsx)(f.sN,{icon:b.buG,text:s("share-url.menu-item.open.text"),as:"a",href:`${n}${r}`,onClick:a,rel:"opener",target:"_blank"})]})}function aO(e){let{initialUrl:t,previewLocationOrigin:i,previewLocationRoute:n}=e,{t:r}=(0,v.$G7)(x.p),{push:s}=(0,f.pm)(),a=(0,v.m85)({apiVersion:x.A}),o=(0,v.xJ)(),[l,u]=(0,m.useState)(!1);return(0,h.jsx)(f.sN,{disabled:l,onClick:()=>{let e;if(null==navigator||!navigator.clipboard)return s({closable:!0,status:"error",title:r("share-url.clipboard.status",{context:"unsupported"})}),!1;u(!0);let l=`${i}${n}`,c=()=>{s({id:e,closable:!0,status:"success",title:r("share-url.clipboard.status",{context:"success"})}),u(!1)},d=e=>{s({closable:!0,status:"error",title:r("share-url.clipboard.status",{context:"failed"}),description:e.message||e.toString()}),u(!1)};if(t.searchParams.has(S)){let i=async()=>(e=s({closable:!0,title:r("share-url.clipboard.status",{context:"copying"})}),(function(e,t,i){let n=new URL(e);return n.searchParams.set(S,t),n.searchParams.set(k,i),n})(t,(await sj(a,"@sanity/presentation",typeof window>"u"?"":location.href,null==o?void 0:o.id)).secret,n).toString());if("u">typeof ClipboardItem){let e="text/plain",t=new ClipboardItem({[e]:i().then(t=>new Blob([t],{type:e}))});navigator.clipboard.write([t]).then(c).catch(d)}else i().then(e=>navigator.clipboard.writeText(e)).then(c).catch(d)}else navigator.clipboard.writeText(l).then(c).catch(d)},text:r("share-url.menu-item.copy.text"),icon:b.TIy})}let aF=sf(f.kC),aU={previewDrafts:"preview-frame.perspective.previewDrafts.title",published:"preview-frame.perspective.published.title"},az={previewDrafts:b.dY8,published:b.EI4},aB=(0,m.forwardRef)(function(e,t){let{dispatch:i,iframe:n,initialUrl:r,loadersConnection:s,navigatorEnabled:a,onPathChange:o,onRefresh:l,openPopup:u,overlaysConnection:c,perspective:d,previewUrl:p,setPerspective:g,setViewport:y,targetOrigin:w,toggleNavigator:P,toggleOverlay:E,viewport:j,visualEditing:{overlaysEnabled:A}}=e,{t:C}=(0,v.$G7)(x.p),{devMode:T}=(0,x.u)(),M=(0,f.Tb)(),R=(0,m.useCallback)(()=>y("desktop"===j?"mobile":"desktop"),[y,j]),V="loading"===n.status||"reloading"===n.status,[D,L]=(0,m.useState)(!1),I="refreshing"===n.status,[$,O]=(0,m.useState)(!1),F=V||I||"connecting"===c,U=(0,m.useMemo)(()=>w===location.origin?"":w,[w]),z=(0,m.useCallback)(()=>{l(()=>{"function"!=typeof t&&null!=t&&t.current&&(i({type:aA}),t.current.src=`${w}${p||"/"}`)})},[i,l,p,w,t]),B=(0,m.useCallback)(()=>{"function"!=typeof t&&null!=t&&t.current&&(t.current.src=r.toString(),i({type:aA}))},[i,t,r]),_=(0,m.useCallback)(()=>{W(!0)},[]),[N,W]=(0,m.useState)(!1),[H,q]=(0,m.useState)(!1);(0,m.useEffect)(()=>{if(!(V||I||"connecting"!==c&&"reconnecting"!==c)){let e=setTimeout(()=>{q(!0)},1e3);return()=>clearTimeout(e)}},[c,V,I]),(0,m.useEffect)(()=>{if(!V&&!I&&H){if("connected"===c&&(O(!1),q(!1),L(!1),W(!1)),"connecting"===c){let e=setTimeout(()=>{L(!0),console.error("Unable to connect to visual editing. Make sure you've setup '@sanity/visual-editing' correctly")},x.M);return()=>clearTimeout(e)}if("reconnecting"===c){let e=setTimeout(()=>{L(!0),O(!0)},x.M);return()=>clearTimeout(e)}"disconnected"===c&&O(!0)}},[V,c,I,H]);let G=(0,m.useMemo)(()=>{let{pathname:e,search:t}=function(e){let t=new URL(e);return t.searchParams.delete(k),t.searchParams.delete(S),t}(new URL(p||"/",w));return`${e}${t}`},[p,w]),K=(0,m.useCallback)(()=>{i({type:aS})},[i]);return(0,m.useEffect)(()=>{if("function"==typeof t||null==t||!t.current)return;let e=t.current;function i(){e===document.activeElement&&e.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0,cancelable:!0}))}return window.addEventListener("blur",i),()=>{window.removeEventListener("blur",i)}},[t]),(0,h.jsx)(sm,{transition:M?{duration:0}:void 0,children:(0,h.jsxs)(f.uE,{delay:1e3,children:[(0,h.jsx)(f.Zb,{flex:"none",padding:2,shadow:1,style:{position:"relative"},children:(0,h.jsxs)(f.kC,{align:"center",style:{minHeight:0},children:[P&&(0,h.jsx)(f.xu,{flex:"none",marginRight:1,padding:1,children:(0,h.jsx)(f.u,{animate:!0,content:(0,h.jsx)(f.xv,{size:1,children:C("preview-frame.navigator.toggle-button.tooltip")}),fallbackPlacements:["bottom-start"],padding:2,placement:"bottom",portal:!0,children:(0,h.jsx)(f.zx,{"aria-label":C("preview-frame.navigator.toggle-button.aria-label"),fontSize:1,icon:b.bl6,mode:"bleed",onClick:P,padding:2,selected:a})})}),(0,h.jsx)(f.u,{animate:!0,content:(0,h.jsxs)(f.kC,{align:"center",style:{whiteSpace:"nowrap"},children:[(0,h.jsx)(f.xu,{padding:1,children:(0,h.jsx)(f.xv,{size:1,children:C("preview-frame.overlay.toggle-button.tooltip",{context:A?"disable":"enable"})})}),(0,h.jsx)(f.xu,{paddingY:1,children:(0,h.jsx)(v.SV0,{keys:["Alt"],style:{marginTop:-4,marginBottom:-4}})})]}),fallbackPlacements:["bottom-start"],padding:1,placement:"bottom",portal:!0,children:(0,h.jsx)(f.Zb,{as:"label",flex:"none",marginRight:1,padding:3,style:{lineHeight:0,borderRadius:999,userSelect:"none"},tone:A?"transparent":void 0,children:(0,h.jsxs)(f.kC,{align:"center",gap:3,children:[(0,h.jsx)("div",{style:{margin:-4},children:(0,h.jsx)(f.rs,{checked:A,onChange:E,disabled:"loading"===n.status||"connected"!==c})}),(0,h.jsx)(f.xu,{children:(0,h.jsx)(f.xv,{muted:!A,size:1,weight:"medium",children:C("preview-frame.overlay.toggle-button.text")})})]})})}),(0,h.jsx)(f.xu,{flex:1,marginX:1,children:(0,h.jsx)(aI,{prefix:(0,h.jsx)(f.xu,{padding:1,children:(0,h.jsx)(f.u,{animate:!0,content:(0,h.jsx)(f.xv,{size:1,children:"loaded"===n.status?C("preview-frame.refresh-button.tooltip"):C("preview-frame.status",{context:n.status})}),fallbackPlacements:["bottom-start"],padding:2,placement:"bottom",portal:!0,children:(0,h.jsx)(f.zx,{"aria-label":C("preview-frame.refresh-button.aria-label"),fontSize:1,icon:b.DuK,mode:"bleed",loading:"reloading"===n.status||"refreshing"===n.status,onClick:z,padding:2})})}),onChange:o,origin:U,suffix:(0,h.jsx)(f.xu,{padding:1,children:(0,h.jsx)(f.j2,{button:(0,h.jsx)(f.zx,{fontSize:1,iconRight:b.aAc,mode:"bleed",padding:2,space:2}),id:"location-menu",menu:(0,h.jsx)(f.v2,{children:(0,h.jsx)(a$,{initialUrl:r,openPopup:u,previewLocationOrigin:U,previewLocationRoute:G})}),popover:{animate:!0,constrainSize:!0,placement:"bottom",portal:!0}})}),value:G})}),(0,h.jsx)(f.kC,{align:"center",flex:"none",gap:1,padding:1,children:(0,h.jsx)(f.j2,{button:(0,h.jsx)(f.zx,{fontSize:1,iconRight:b.v4q,mode:"bleed",padding:2,space:2,text:C(aU["connected"===s?d:"previewDrafts"]),loading:"reconnecting"===s&&"loaded"!==n.status,disabled:"connected"!==s}),id:"perspective-menu",menu:(0,h.jsxs)(f.v2,{style:{maxWidth:240},children:[(0,h.jsx)(f.sN,{fontSize:1,onClick:()=>g("previewDrafts"),padding:3,pressed:"previewDrafts"===d,tone:"caution",children:(0,h.jsxs)(f.kC,{align:"flex-start",ga
59p:3,children:[(0,h.jsx)(f.xu,{flex:"none",children:(0,h.jsx)(f.xv,{size:1,children:(0,m.createElement)(az.previewDrafts)})}),(0,h.jsxs)(f.Kq,{flex:1,space:2,children:[(0,h.jsx)(f.xv,{size:1,weight:"medium",children:C(aU.previewDrafts)}),(0,h.jsx)(f.xv,{muted:!0,size:1,children:C("preview-frame.perspective.previewDrafts.text")})]}),(0,h.jsx)(f.xu,{flex:"none",children:(0,h.jsx)(f.xv,{muted:!0,size:1,style:{opacity:"previewDrafts"===d?1:0},children:(0,h.jsx)(b.KML,{})})})]})}),(0,h.jsx)(f.sN,{fontSize:1,onClick:()=>g("published"),padding:3,pressed:"published"===d,tone:"positive",children:(0,h.jsxs)(f.kC,{align:"flex-start",gap:3,children:[(0,h.jsx)(f.xu,{flex:"none",children:(0,h.jsx)(f.xv,{size:1,children:(0,m.createElement)(az.published)})}),(0,h.jsxs)(f.Kq,{flex:1,space:2,children:[(0,h.jsx)(f.xv,{size:1,weight:"medium",children:C(aU.published)}),(0,h.jsx)(f.xv,{muted:!0,size:1,children:C("preview-frame.perspective.published.text")})]}),(0,h.jsx)(f.xu,{flex:"none",children:(0,h.jsx)(f.xv,{muted:!0,size:1,style:{opacity:"published"===d?1:0},children:(0,h.jsx)(b.KML,{})})})]})})]}),popover:{animate:!0,constrainSize:!0,placement:"bottom",portal:!0}})}),(0,h.jsx)(f.kC,{align:"center",flex:"none",gap:1,children:(0,h.jsx)(f.u,{animate:!0,content:(0,h.jsx)(f.xv,{size:1,children:C("preview-frame.viewport-button.tooltip",{context:"desktop"===j?"narrow":"full"})}),fallbackPlacements:["bottom-start"],padding:2,placement:"bottom",portal:!0,children:(0,h.jsx)(f.zx,{"aria-label":C("preview-frame.viewport-button.aria-label"),fontSize:1,icon:"desktop"===j?b.RbG:b.ugZ,mode:"bleed",onClick:R,padding:2})})})]})}),(0,h.jsx)(f.Zb,{flex:1,tone:"transparent",children:(0,h.jsxs)(f.kC,{align:"center",height:"fill",justify:"center",padding:"desktop"===j?0:2,sizing:"border",style:{position:"relative",cursor:F?"wait":void 0},children:[(0,h.jsx)(sP,{children:$||V||I||!H||N?(V||"connecting"===c&&"refreshing"!==n.status)&&!N?(0,h.jsx)(aF,{initial:"initial",animate:"animate",exit:"exit",variants:aN,justify:"center",align:"center",style:{inset:"0",position:"absolute"},children:(0,h.jsxs)(f.kC,{style:{...a_[j]},justify:"center",align:"center",direction:"column",gap:4,children:[(0,h.jsx)(f.$j,{muted:!0}),(0,h.jsx)(f.xv,{muted:!0,size:1,children:C("preview-frame.status",{context:"loading"})})]})}):$&&!N?(0,h.jsx)(aF,{initial:"initial",animate:"animate",exit:"exit",variants:aW,justify:"center",align:"center",style:{background:"var(--card-bg-color)",inset:"0",position:"absolute",borderTop:"1px solid transparent",boxShadow:"0 0 0 1px var(--card-border-color)"},children:(0,h.jsx)(ar,{flex:1,message:C("preview-frame.connection.error.text"),onRetry:B,onContinueAnyway:_,children:T&&(0,h.jsxs)(h.Fragment,{children:["connected"!==c&&(0,h.jsx)(f.Zb,{padding:3,radius:2,tone:"critical",children:(0,h.jsxs)(f.Kq,{space:3,children:[(0,h.jsx)(f.__,{muted:!0,size:0,children:C("preview-frame.overlay.connection-status.label")}),(0,h.jsx)(f.EK,{size:1,children:C("channel.status",{context:c})})]})}),"connected"!==s&&(0,h.jsx)(f.Zb,{padding:3,radius:2,tone:"critical",children:(0,h.jsxs)(f.Kq,{space:3,children:[(0,h.jsx)(f.__,{muted:!0,size:0,children:C("preview-frame.loader.connection-status.label")}),(0,h.jsx)(f.EK,{size:1,children:C("channel.status",{context:s})})]})})]})})}):null:(0,h.jsx)(aF,{initial:"initial",animate:"animate",exit:"exit",variants:aN,justify:"center",align:"center",style:{inset:"0",position:"absolute",backdropFilter:D?"blur(16px) saturate(0.5) grayscale(0.5)":"blur(2px)",transition:"backdrop-filter 0.2s ease-in-out",WebkitBackdropFilter:D?"blur(16px) saturate(0.5) grayscale(0.5)":"blur(2px)",WebkitTransition:"-webkit-backdrop-filter 0.2s ease-in-out",zIndex:1},children:(0,h.jsxs)(f.kC,{style:{...a_[j]},justify:"center",align:"center",direction:"column",gap:4,children:[D&&(0,h.jsx)(f.zx,{disabled:!0,fontSize:1,mode:"ghost",text:C("preview-frame.continue-button.text"),style:{opacity:0}}),(0,h.jsx)(f.Zb,{radius:2,tone:D?"caution":"inherit",padding:4,shadow:1,children:(0,h.jsxs)(f.kC,{justify:"center",align:"center",direction:"column",gap:4,children:[(0,h.jsx)(f.$j,{muted:!0}
59),(0,h.jsx)(f.xv,{muted:!0,size:1,children:C("preview-frame.status",D?{context:"timeout"}:{context:"connecting"})})]})}),D&&(0,h.jsx)(f.zx,{fontSize:1,tone:"critical",onClick:_,text:C("preview-frame.continue-button.text")})]})})}),(0,h.jsx)(aL,{ref:t,style:{pointerEvents:(V||"connecting"===c&&"refreshing"!==n.status)&&!N?"none":"auto",boxShadow:"0 0 0 1px var(--card-border-color)",borderTop:"1px solid transparent"},src:r.toString(),initial:["background"],variants:aH,animate:[(V||"connecting"===c&&"refreshing"!==n.status)&&!N?"background":"active",V?"reloading":"idle",j,H&&!N?"timedOut":""],onLoad:K})]})})]})})}),a_={desktop:{width:"100%",height:"100%"},mobile:{width:375,height:650}},aN={initial:{opacity:1},animate:{opacity:[0,0,1]},exit:{opacity:[1,0,0]}},aW={initial:{opacity:1},animate:{opacity:[0,0,1]},exit:{opacity:[1,0,0]}},aH={desktop:{...a_.desktop,boxShadow:"0 0 0 0px var(--card-border-color)"},mobile:{...a_.mobile,boxShadow:"0 0 0 1px var(--card-border-color)"},background:{opacity:0,scale:1},idle:{scale:1},reloading:{scale:[1,1,1,.98]},active:{opacity:[0,0,1],scale:1},timedOut:{opacity:[0,0,1]}},aq=!1;function aG(e,t){return e instanceof Function?e(t):e}function aK(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e&&""!==e&&null!==e))}let aZ=Symbol(),aX=(0,m.lazy)(()=>i.e(9490).then(i.bind(i,49490))),aY=(0,m.lazy)(()=>i.e(4109).then(i.bind(i,4109))),aJ=(0,y.zo)(f.kC)`
60  overflow-x: auto;
61`;function aQ(e){var t,i,n,r;let{previewUrl:s,components:a}=null!=(t=e.tool.options)?t:{},o=e.tool.name||x.D,{unstable_navigator:l}=a||{},{navigate:u,state:c}=(0,g.tv)(),d=(0,v.BoV)(Object.fromEntries(c._searchParams||[])),y=function(e,t,i){var n,r;let s=(0,v.m85)({apiVersion:x.A}),a=(0,v.AJ_)(),o=(null==(n=null==a?void 0:a.activeWorkspace)?void 0:n.basePath)||"/",l=function(e,t,i,n){let[r,s]=(0,m.useState)(()=>n||""),a=(0,m.useRef)(0);(0,m.useEffect)(()=>{if(r&&n)return window.clearTimeout(a.current),()=>{a.current=window.setTimeout(()=>{s("")},100)}},[r,n]);let o=(0,v.xJ)();return(0,m.useMemo)(()=>["@sanity/presentation",t,i,e,null==o?void 0:o.id,aZ,r],[t,null==o?void 0:o.id,e,i,r])}(t,o,(null==(r=null==a?void 0:a.activeWorkspace)?void 0:r.name)||"default",i),u=function(e,t){let i=(0,v.m85)({apiVersion:x.A}),n=(0,v.xJ)(),[r,s]=(0,m.useState)(""),a=e?(0,sC.Rq)(async()=>await sj(i,"@sanity/presentation",typeof window>"u"?"":location.href,null==n?void 0:n.id),[...t,r]):null;return(0,m.useEffect)(()=>{if(!a)return;let e=setTimeout(()=>{(0,m.startTransition)(()=>s(a.expiresAt.toString()))},a.expiresAt.getTime()-Date.now());return()=>clearTimeout(e)},[a]),(null==a?void 0:a.secret)||null}("object"==typeof e||"function"==typeof e,l);return(0,sC.Rq)(async()=>{if("string"==typeof e){let t=new URL(e,location.origin),n=t;try{if(i){let e=new URL(i,t);e.origin===t.origin&&(n=e)}else if(document.referrer){let e=new URL(document.referrer);e.origin===t.origin&&(n=e)}}catch{}return location.origin===n.origin&&(n.pathname.startsWith(`${o}/`)||n.pathname===o)?t:n}let t=await ("object"==typeof e?function(e){let{draftMode:t,previewMode:i,origin:n=typeof location>"u"?"https://localhost":location.origin}=e,r=(null==i?void 0:i.enable)||(null==t?void 0:t.enable),{preview:s="/"}=e,a=new URL(s,n),o=r?new URL(r,n):void 0;return async t=>{try{if(t.previewSearchParam){let e=new URL(t.previewSearchParam,a);e.origin===a.origin&&(s=`${e.pathname}${e.search}`)}else if(t.referrer){let e=new URL(t.referrer);e.origin===a.origin&&(s=`${e.pathname}${e.search}`)}}catch{}"u">typeof location&&location.origin===a.origin&&t.studioBasePath&&(s.startsWith(`${t.studioBasePath}/`)||s===t.studioBasePath)&&(s=e.preview||"/");let i=new URL(s,a);if(o){let e=new URL(o),{searchParams:n}=e;return n.set(S,t.previewUrlSecret),i.pathname!==e.pathname&&n.set(k,`${i.pathname}${i.search}`),e.toString()}return i.toString()}}(e):e)({client:s,previewUrlSecret:u,previewSearchParam:i,referrer:typeof document>"u"?null:document.referrer,studioBasePath:o});return new URL(t,location.origin)},[...l,u])}(s||"/",o,d.preview||null),[b]=(0,m.useState)(()=>{var t;let i=null==(t=e.tool.options)?void 0:t.devMode;return"function"==typeof i?i():"boolean"==typeof i?i:"u">typeof window&&"localhost"===window.location.hostname}),w=(0,m.useMemo)(()=>y.origin,[y.origin]),P=(0,m.useRef)(null),[E,j]=(0,m.useState)(),[A,C]=(0,m.useState)({}),T=(0,m.useRef)({title:void 0,url:void 0}
61),{navigate:M,params:R,searchParams:V,structureParams:D}=function({initialPreviewUrl:e,routerNavigate:t,routerState:i,routerSearchParams:n,frameStateRef:r}){let s=(0,m.useMemo)(()=>{let{id:t,path:r,type:s}={id:function(e){var t;if(void 0===e)return;let i=null==(t=decodeURIComponent(e))?void 0:t.split(".");return"drafts"===i[0]&&i.shift(),i.join(".")}(i.id),path:function(e){if(void 0!==e)return p.eT.toString(function(e){let t=[];for(let i of e.split(".")){let e=sq.exec(i);if(e){t.push(e[1],Number(e[2]));continue}let n=sG.exec(i);if(n){t.push(n[1],[Number(n[2]),Number(n[3])]);continue}let r=sK.exec(i);r?t.push(r[1],{_key:r[2]}):t.push(i)}return t}(decodeURIComponent(e)))}(i.path),type:i.type};return{id:t,type:s,path:r,preview:n.preview||`${e.pathname}${e.search}`,perspective:n.perspective,viewport:n.viewport,inspect:n.inspect,rev:n.rev,prefersLatestPublished:n.prefersLatestPublished,since:n.since,template:n.template,templateParams:n.templateParams,view:n.view,pathKey:n.pathKey,instruction:n.instruction,comment:n.comment}},[i,n,e]),a=(0,m.useMemo)(()=>aK({inspect:s.inspect,path:s.path,rev:s.rev,prefersLatestPublished:s.prefersLatestPublished,since:s.since,template:s.template,templateParams:s.templateParams,view:s.view,pathKey:s.pathKey,instruction:s.instruction,comment:s.comment}),[s.comment,s.inspect,s.instruction,s.path,s.pathKey,s.prefersLatestPublished,s.rev,s.since,s.template,s.templateParams,s.view]),o=(0,m.useMemo)(()=>aK({perspective:s.perspective,preview:s.preview,viewport:s.viewport}),[s.perspective,s.preview,s.viewport]),l=(0,m.useRef)(i);return(0,m.useEffect)(()=>{l.current=i},[i]),{navigate:(0,m.useCallback)((e,i={},n)=>{e.id&&(e.id=(0,v.vsM)(e.id));let{_searchParams:s,...a}=l.current,o=(s||[]).reduce((e,[t,i])=>(e[t]=i,e),{}),u=aK({...a,...e}),c=aK({...o,...i});a.id!==u.id&&(delete c.template,delete c.templateParams),u._searchParams=Object.entries(c).reduce((e,[t,i])=>[...e,[t,i]],[]),t(u,{replace:null!=n?n:c.preview===r.current.url})},[t,r]),params:s,searchParams:o,structureParams:a}}({initialPreviewUrl:y,routerNavigate:u,routerState:c,routerSearchParams:d,frameStateRef:T}),L=(0,m.useMemo)(()=>sQ(M,50),[M]),[I,$]=(0,m.useReducer)(aT,{},aD),O=(0,m.useMemo)(()=>R.perspective?"published":"previewDrafts",[R.perspective]),F=(0,m.useMemo)(()=>R.viewport?"mobile":"desktop",[R.viewport]),[U,z]=function(e,t){if("published"!==e&&"previewDrafts"!==e)throw Error(`Invalid perspective: ${e}`);let[i,n]=(0,m.useState)({}),[r,s]=(0,m.useState)({}),a=(0,m.useRef)(""),o=(0,m.useCallback)((e,i,r=[])=>{let o=r.filter(e=>"_projectId"in e&&e._projectId?(aq||(console.warn("Cross dataset references are not supported yet, ignoring source document",e),aq=!0),!1):e);("published"===i?n:s)(i=>{let n={};for(let e of o)n[e._id]=e;return a.current!==t.current.url?(a.current=t.current.url,{[e]:n}):sS(i[e],n)?i:{...i,[e]:n}})},[t]);return[(0,m.useMemo)(()=>Object.values(Object.values("published"===e?i:r).reduce((e,t)=>(Object.values(t).forEach(t=>{e[t._id]=t}),e),{})),[e,r,i]),o]}(O,T),B=(0,v.vpR)(),_=(0,v.p9V)(),N=function(e){let{navigate:t,resolvers:i=[],path:n,previewUrl:r}=e,{state:s}=(0,g.tv)(),a=(0,v.m85)({apiVersion:x.A}),[o,l]=(0,m.useState)(void 0),u=(0,m.useRef)(void 0),c=(0,m.useMemo)(()=>{var e,t;return new URL(n||(null==(t=null==(e=s._searchParams)?void 0:e.find(([e])=>"preview"===e))?void 0:t[1])||"","string"==typeof r?r:"object"==typeof r&&(null==r?void 0:r.origin)||location.origin)},[n,r,s._searchParams]),d=(0,m.useCallback)(()=>{l(void 0),u.current=void 0},[]);return(0,m.useEffect)(()=>{var e,n,r,s,o;if(i.length&&c){let d;for(let e of i){let t=function(e,t){for(e of Array.isArray(e)?e:[e]){let i,n=e;if("string"==typeof e)try{let t=new URL(e);i=t.origin,n=t.pathname}catch{}if(!i||t.origin===i)try{let e=(function(e,t){var i=[];return function(e,t,i){void 0===i&&(i={});var n=i.decode,r=void 0===n?function(e){return e}:n;return function(i){var n=e.exec(i);if(!n)return!1;for(var s=n[0],a=n.index,o=Object.create(null),l=1;l<n.length;l++)!function(e){if(void 0!==n[e]){var i=t[e-1];"*"===i.modifier||"+"===i.modifier?o[i.name]=n[e].split(i.prefix+i.suffix
61).map(function(e){return r(e,i)}):o[i.name]=r(n[e],i)}}(l);return{path:s,index:a,params:o}}}(function e(t,i,n){var r;return t instanceof RegExp?function(e,t){if(!t)return e;for(var i=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,r=i.exec(e.source);r;)t.push({name:r[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),r=i.exec(e.source);return e}(t,i):Array.isArray(t)?(r=t.map(function(t){return e(t,i,n).source}),new RegExp("(?:".concat(r.join("|"),")"),sA(n))):function(e,t,i){void 0===i&&(i={});for(var n=i.strict,r=void 0!==n&&n,s=i.start,a=i.end,o=i.encode,l=void 0===o?function(e){return e}:o,u=i.delimiter,c=i.endsWith,d="[".concat(sk(void 0===c?"":c),"]|$"),h="[".concat(sk(void 0===u?"/#?":u),"]"),p=void 0===s||s?"^":"",f=0;f<e.length;f++){var m=e[f];if("string"==typeof m)p+=sk(l(m));else{var v=sk(l(m.prefix)),g=sk(l(m.suffix));if(m.pattern){if(t&&t.push(m),v||g){if("+"===m.modifier||"*"===m.modifier){var y="*"===m.modifier?"?":"";p+="(?:".concat(v,"((?:").concat(m.pattern,")(?:").concat(g).concat(v,"(?:").concat(m.pattern,"))*)").concat(g,")").concat(y)}else p+="(?:".concat(v,"(").concat(m.pattern,")").concat(g,")").concat(m.modifier)}else"+"===m.modifier||"*"===m.modifier?p+="((?:".concat(m.pattern,")").concat(m.modifier,")"):p+="(".concat(m.pattern,")").concat(m.modifier)}else p+="(?:".concat(v).concat(g,")").concat(m.modifier)}}if(void 0===a||a)r||(p+="".concat(h,"?")),p+=i.endsWith?"(?=".concat(d,")"):"$";else{var x=e[e.length-1],b="string"==typeof x?h.indexOf(x[x.length-1])>-1:void 0===x;r||(p+="(?:".concat(h,"(?=").concat(d,"))?")),b||(p+="(?=".concat(h,"|").concat(d,")"))}return new RegExp(p,sA(i))}(function(e,t){void 0===t&&(t={});for(var i=function(e){for(var t=[],i=0;i<e.length;){var n=e[i];if("*"===n||"+"===n||"?"===n){t.push({type:"MODIFIER",index:i,value:e[i++]});continue}if("\\"===n){t.push({type:"ESCAPED_CHAR",index:i++,value:e[i++]});continue}if("{"===n){t.push({type:"OPEN",index:i,value:e[i++]});continue}if("}"===n){t.push({type:"CLOSE",index:i,value:e[i++]});continue}if(":"===n){for(var r="",s=i+1;s<e.length;){var a=e.charCodeAt(s);if(a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||95===a){r+=e[s++];continue}break}if(!r)throw TypeError("Missing parameter name at ".concat(i));t.push({type:"NAME",index:i,value:r}),i=s;continue}if("("===n){var o=1,l="",s=i+1;if("?"===e[s])throw TypeError('Pattern cannot start with "?" at '.concat(s));for(;s<e.length;){if("\\"===e[s]){l+=e[s++]+e[s++];continue}
61if(")"===e[s]){if(0==--o){s++;break}}else if("("===e[s]&&(o++,"?"!==e[s+1]))throw TypeError("Capturing groups are not allowed at ".concat(s));l+=e[s++]}if(o)throw TypeError("Unbalanced pattern at ".concat(i));if(!l)throw TypeError("Missing pattern at ".concat(i));t.push({type:"PATTERN",index:i,value:l}),i=s;continue}t.push({type:"CHAR",index:i,value:e[i++]})}return t.push({type:"END",index:i,value:""}),t}(e),n=t.prefixes,r=void 0===n?"./":n,s="[^".concat(sk(t.delimiter||"/#?"),"]+?"),a=[],o=0,l=0,u="",c=function(e){if(l<i.length&&i[l].type===e)return i[l++].value},d=function(e){var t=c(e);if(void 0!==t)return t;var n=i[l],r=n.type,s=n.index;throw TypeError("Unexpected ".concat(r," at ").concat(s,", expected ").concat(e))},h=function(){for(var e,t="";e=c("CHAR")||c("ESCAPED_CHAR");)t+=e;return t};l<i.length;){var p=c("CHAR"),f=c("NAME"),m=c("PATTERN");if(f||m){var v=p||"";-1===r.indexOf(v)&&(u+=v,v=""),u&&(a.push(u),u=""),a.push({name:f||o++,prefix:v,suffix:"",pattern:m||s,modifier:c("MODIFIER")||""});continue}var g=p||c("ESCAPED_CHAR");if(g){u+=g;continue}if(u&&(a.push(u),u=""),c("OPEN")){var v=h(),y=c("NAME")||"",x=c("PATTERN")||"",b=h();d("CLOSE"),a.push({name:y||(x?o++:""),pattern:y&&!x?s:x,prefix:v,suffix:b,modifier:c("MODIFIER")||""});continue}d("END")}return a}(t,n),i,n)}(e,i,t),i,t)})(n,{decode:decodeURIComponent})(t.pathname);if(e){let{params:t,path:n}=e;return{origin:i,params:t,path:n}}}catch{throw Error(`"${e}" is not a valid route pattern`)}}}(e.route,c);if(t){d={context:t,resolver:e};break}}if(d){let i=function(e,t){var i;if(e.resolve){let n=null==(i=e.resolve(t))?void 0:i.filter;return n?`*[${n}][0]{_id, _type}`:void 0}return"type"in e?`*[_type == "${e.type}"][0]{_id, _type}`:`*[${aG(e.filter,t)}][0]{_id, _type}`}(d.resolver,d.context),h=(e=d.resolver,n=d.context,e.resolve?null!=(s=null==(r=e.resolve(n))?void 0:r.params)?s:n.params:"type"in e?{}:null!=(o=aG(e.params,n))?o:n.params);if(i){let e=new AbortController,n={perspective:"previewDrafts",signal:e.signal};return a.fetch(i,h,n).then(e=>{e&&u.current===e._id||(l({document:e,path:c.pathname}),null==t||t({id:null==e?void 0:e._id,type:null==e?void 0:e._type}),u.current=null==e?void 0:e._id)}).catch(e=>{e instanceof Error&&"AbortError"===e.name||(l({document:void 0,path:c.pathname}),u.current=void 0)}),()=>{e.abort()}}}}d()},[a,d,t,i,c]),o}({resolvers:null==(n=null==(i=e.tool.options)?void 0:i.resolve)?void 0:n.mainDocuments,previewUrl:null==(r=e.tool.options)?void 0:r.previewUrl,path:R.preview,navigate:M}),[W,H]=(0,m.useState)("connecting"),[q,G]=(0,m.useState)("connecting"),[K,Z]=(0,m.useState)("connecting"),[X]=(0,m.useState)(()=>new Set),Y=(0,m.useCallback)(e=>{let t=window.open(e,"_blank");t&&X.add(t)},[X]);(0,m.useEffect)(()=>{if(X.size&&E)for(let e of X)e&&"closed"in e&&!e.closed&&E.addSource(e)},[E,X,X.size]);let J=(0,m.useRef)(O);(0,m.useEffect)(()=>{J.current=O},[O]),(0,m.useEffect)(()=>{var e;let t=null==(e=P.current)?void 0:e.contentWindow;if(!t)return;let i=function(e){let{destroy:t,send:i}=sF(e),n=new Set,r=new WeakMap,s=new Set;return{destroy:()=>{for(let e of(t(),s))e()},send:(e,...t)=>{for(let s of(i(e,...t),n))s&&"closed"in s&&!s.closed&&r.has(s)&&r.get(s)(e,...t)},addSource(t){if(n.has(t))return;if(!("closed"in t))throw console.warn("Source is unsupported",{source:t}),Error("Source is unsupported");if(t.closed)throw Error("Source is closed");let{send:i,destroy:a}=sF({...e,target:t,connectTo:e.connectTo.map(e=>{let{onStatusUpdate:t,onEvent:i,...n}=e;return{...n,onEvent:i?(...e)=>{let[t]=e;if("preview-kit/documents"!==t&&"overlay/navigate"!==t&&"loader/documents"!==t)return i(...e)}:void 0}})});s.add(a),r.set(t,i),n.add(t)}}}({id:"presentation",target:t,targetOrigin:w,connectTo:[{id:"overlays",heartbeat:!0,onStatusUpdate:H,onEvent(e,t){if(("visual-editing/focus"===e||"overlay/focus"===e)&&"id"in t)L({type:t.type,id:t.id,path:t.path},{prefersLatestPublished:"isDraft"in t||"previewDrafts"===J.current?void 0:"true"});else if("visual-editing/navigate"===e||"overlay/navigate"===e){let{title:e,url:i}=t;T.current.url!==i&&L({},{preview:i}),T.current={title:e,url:i}}else"visual-editing/meta"===e?T.current.title=t.title:"visual-editing/toggle"===e||"overlay/toggle"===e?$({type:aC,enabled:t.enabled}):"visual-editing/documents"===e?z("visual-editing",t.perspective,t.documents):"visual-editing/refreshing"===e&&"manual"===t.source?clearTimeout(eh.current):"visual-editing/refreshing"===e&&"mutation"===t.source?$({type:ak}):"visual-editing/refreshed"===e&&$({type:aS})}},{id:"loaders",heartbeat:!0,onStatusUpdate:G,onEvent(e,t){if("loader/documents"===e&&t.projectId===B&&t.dataset===_)z("loaders",t.perspective,t.documents);else if("loader/query-listen"===e&&t.projectId===B&&t.dataset===_){if("number"==typeof t.heartbeat&&t.heartbeat<x.c)throw Error(`Loader query listen heartbeat interval must be at least ${x.c}ms`);C(e=>{var i,n,r;return{...e,[(n=t.query,r=t.params,`${n}-${"string"==typeof r?r:JSON.stringify(r)}`)]:{perspective:t.perspective,query:t.query,params:t.params,receivedAt:Date.now(),heartbeat:null!=(i=t.heartbeat)&&i}}})}}},{id:"preview-kit",heartbeat:!0,onStatusUpdate:Z,onEvent(e,t){"preview-kit/documents"===e&&t.projectId===B&&t.dataset===_&&z("preview-kit",t.perspective,t.documents)}}]});return j(i),()=>{i.destroy(),j(void 0)}},[_,B,z,L,w]),(0,m.useEffect)(()=>{let e=setInterval(()=>C(e=>{if(Object.keys(e).length<1)return e;let t=Date.now();if(!Object.values(e).some(e=>!1!==e.heartbeat&&t>e.receivedAt+e.heartbeat))return e;let i={};for(let[n,r]of Object.entries(e))!1!==r.heartbeat&&t>r.receivedAt+r.heartbeat||(i[n]=r);return i}),x.c);return()=>clearInterval(e)},[]);let Q=(0,m.useCallback)(e=>{L({path:p.eT.toString(e)},{},!0)},[L]),ee=(0,m.useCallback)(e=>{let t=new URL(e,y.origin),i=t.pathname+t.search;t.origin===y.origin&&i!==R.preview&&L({},{preview:i})},[y,R,L]),et=(0,m.useCallback)(e=>{L({},{...e,prefersLatestPublished:void 0})},[L]);(0,m.useEffect)(()=>{null==E||E.send("overlays","presentation/perspective",{perspective:O})},[E,O]),(0,m.useEffect)(()=>{R.id&&R.path?null==E||E.send("overlays","presentation/focus",{id:R.id,path:R.path}):null==E||E.send("overlays","presentation/blur",void 0)},[E,R.id,R.path]);let ei=(0,m.useRef)(void 0);(0,m.useEffect)(()=>{"published"!==O||!R.id||R.id===ei.current||R.rev||R.prefersLatestPublished||L({},{prefersLatestPublished:"true"},!0),ei.current=R.id},[L,R.id,R.prefersLatestPublished,R.rev,O]),(0,m.useEffect)(()=>{T.current.url&&R.preview&&T.current.url!==R.preview&&(T.current.url=R.preview,"connected"!==W&&P.current?P.current.src=`${w}${R.preview}`:null==E||E.send("overlays","presentation/navigate",{url:R.preview,type:"replace"}))},[E,W,w,R.preview]);let en=(0,m.useCallback)(()=>null==E?void 0:E.send("overlays","presentation/toggleOverlay",void 0),[E]),[er,es]=(0,m.useState)(null);(0,m.useEffect)(()=>{let e=e=>{sJ(e)&&en()},t=e=>{sJ(e)&&en(),["mod","\\"].every(t=>sY[t]?e[sY[t]]:e.key===t.toUpperCase())&&en()};return window.addEventListener("keydown",t),window.addEventListener("keyup",e),()=>{window.removeEventListener("keydown",t),window.removeEventListener("keyup",e)}},[en]);let[ea,eo]=(0,m.useState)(null),[{navigatorEnabled:el,toggleNavigator:eu},ec]=function(e){let{unstable_navigator:t}=e,i=!(null==t||!t.component),[n,r]=function(e,t){let[i,n]=(0,m.useState)(()=>{var i;return JSON.parse(null!=(i=localStorage.getItem(e))?i:JSON.stringify(t))});return(0,m.useEffect)(()=>{localStorage.setItem(e,JSON.stringify(i))},[e,i]),[i,n]}("presentation/navigator",i),s=!!i&&n,a=(0,m.useMemo)(()=>
61{if(i)return()=>r(e=>!e)},[i,r]),o=(0,m.useCallback)(function(){return(0,h.jsx)(h.Fragment,{children:s&&(0,h.jsx)(aP,{...t})})},[s,t]);return[{navigatorEnabled:s,toggleNavigator:a},o]}({unstable_navigator:l}),ed=(0,m.useRef)(R.id);(0,m.useEffect)(()=>{R.rev&&ed.current&&R.id!==ed.current&&L({},{rev:void 0}),ed.current=R.id});let eh=(0,m.useRef)(),ep=(0,m.useCallback)(e=>{if($({type:ak}),E)return eh.current=window.setTimeout(e,300),void E.send("overlays","presentation/refresh",{source:"manual",livePreviewEnabled:"connected"===K||"connected"===q});e()},[E,q,K]),ef=(0,v.cFj)(),em=(0,m.useCallback)(({id:e,type:t,path:i})=>{if(T.current.url)return{title:T.current.title||T.current.url,name:"edit",params:{id:e,path:i,type:t,inspect:x.C,workspace:ef.name,mode:x.E,preview:R.preview}}},[R.preview,ef.name]),ev=(0,m.useCallback)(e=>{L({},{viewport:"desktop"===e?void 0:"mobile"},!0)},[L]),eg=(0,m.useCallback)(e=>{L({},{perspective:"previewDrafts"===e?void 0:e})},[L]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(aj,{devMode:b,name:o,navigate:L,params:R,searchParams:V,structureParams:D,children:(0,h.jsx)(aw,{navigate:L,children:(0,h.jsx)(aE,{params:R,children:(0,h.jsx)(aJ,{height:"fill",children:(0,h.jsxs)(an,{children:[(0,h.jsx)(ec,{}),(0,h.jsx)(s2,{id:"preview",minWidth:325,defaultSize:el?50:75,order:3,children:(0,h.jsx)(f.kC,{direction:"column",flex:1,height:"fill",ref:eo,children:(0,h.jsx)(f.NM,{element:ea,children:(0,h.jsx)(aB,{dispatch:$,iframe:I.iframe,initialUrl:y,loadersConnection:q,navigatorEnabled:el,onPathChange:ee,onRefresh:ep,openPopup:Y,overlaysConnection:W,previewUrl:R.preview,perspective:O,ref:P,setPerspective:eg,setViewport:ev,targetOrigin:w,toggleNavigator:eu,toggleOverlay:en,viewport:F,visualEditing:I.visualEditing})})})}),(0,h.jsx)(ab,{documentId:R.id,documentsOnPage:U,documentType:R.type,getCommentIntent:em,mainDocumentState:N,onFocusPath:Q,onStructureParams:et,searchParams:V,setDisplayedDocument:es,structureParams:D})]})})})})}),E&&(0,h.jsx)(m.Suspense,{children:(0,h.jsx)(aX,{channel:E,liveQueries:A,perspective:O,liveDocument:er,documentsOnPage:U})}),E&&R.id&&R.type&&(0,h.jsx)(m.Suspense,{children:(0,h.jsx)(aY,{channel:E,id:R.id,type:R.type,loadersConnection:q,previewKitConnection:K})})]})}}}]);

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.