@ssot-registry/lineage-graph 0.2.25-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/dist/LineageGraph.d.ts +2 -0
- package/dist/LineageGraphApp.d.ts +1 -0
- package/dist/components/ConnectedEdgesPanel.d.ts +9 -0
- package/dist/components/FamilyFilters.d.ts +6 -0
- package/dist/components/Legend.d.ts +4 -0
- package/dist/components/LineageGraphCanvas.d.ts +40 -0
- package/dist/components/PackageSummary.d.ts +6 -0
- package/dist/components/ResultsList.d.ts +8 -0
- package/dist/components/SelectedNodePanel.d.ts +8 -0
- package/dist/components/ViewControls.d.ts +33 -0
- package/dist/constants.d.ts +6 -0
- package/dist/html.d.ts +2 -0
- package/dist/index.d.ts +5 -0
- package/dist/layout.d.ts +12 -0
- package/dist/lineage-graph.cjs +95 -0
- package/dist/lineage-graph.css +1 -0
- package/dist/lineage-graph.js +9267 -0
- package/dist/standalone/ssot-lineage-graph.css +1 -0
- package/dist/standalone/ssot-lineage-graph.js +84 -0
- package/dist/standalone.d.ts +6 -0
- package/dist/subcomponents/KeyValue.d.ts +5 -0
- package/dist/subcomponents/Section.d.ts +8 -0
- package/dist/subcomponents/StatCard.d.ts +5 -0
- package/dist/subcomponents/format.d.ts +1 -0
- package/dist/types.d.ts +179 -0
- package/dist/views/LineageGraphAppView.d.ts +18 -0
- package/dist/workspace/App.d.ts +5 -0
- package/dist/workspace/components/LeftSidebar.d.ts +35 -0
- package/dist/workspace/components/LineageGraphApp.d.ts +26 -0
- package/dist/workspace/components/LineageGraphCanvas.d.ts +48 -0
- package/dist/workspace/components/RightInspector.d.ts +18 -0
- package/dist/workspace/components/StorybookDocs.d.ts +6 -0
- package/dist/workspace/main.d.ts +1 -0
- package/dist/workspace/types.d.ts +190 -0
- package/dist/workspace/utils/graphHelpers.d.ts +21 -0
- package/dist/workspace/utils/indexedDbHelper.d.ts +45 -0
- package/dist/workspace/utils/mockData.d.ts +10 -0
- package/package.json +54 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react");function fl(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const Es=fl(y);var ns={exports:{}},zt={};var ji;function ml(){if(ji)return zt;ji=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(n,i,r){var o=null;if(r!==void 0&&(o=""+r),i.key!==void 0&&(o=""+i.key),"key"in i){r={};for(var l in i)l!=="key"&&(r[l]=i[l])}else r=i;return i=r.ref,{$$typeof:e,type:n,key:o,ref:i!==void 0?i:null,props:r}}return zt.Fragment=t,zt.jsx=s,zt.jsxs=s,zt}var Ot={};var Ni;function pl(){return Ni||(Ni=1,process.env.NODE_ENV!=="production"&&(function(){function e(g){if(g==null)return null;if(typeof g=="function")return g.$$typeof===D?null:g.displayName||g.name||null;if(typeof g=="string")return g;switch(g){case k:return"Fragment";case b:return"Profiler";case T:return"StrictMode";case M:return"Suspense";case F:return"SuspenseList";case N:return"Activity"}if(typeof g=="object")switch(typeof g.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),g.$$typeof){case v:return"Portal";case C:return g.displayName||"Context";case w:return(g._context.displayName||"Context")+".Consumer";case I:var z=g.render;return g=g.displayName,g||(g=z.displayName||z.name||"",g=g!==""?"ForwardRef("+g+")":"ForwardRef"),g;case P:return z=g.displayName||null,z!==null?z:e(g.type)||"Memo";case j:z=g._payload,g=g._init;try{return e(g(z))}catch{}}return null}function t(g){return""+g}function s(g){try{t(g);var z=!1}catch{z=!0}if(z){z=console;var se=z.error,re=typeof Symbol=="function"&&Symbol.toStringTag&&g[Symbol.toStringTag]||g.constructor.name||"Object";return se.call(z,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",re),t(g)}}function n(g){if(g===k)return"<>";if(typeof g=="object"&&g!==null&&g.$$typeof===j)return"<...>";try{var z=e(g);return z?"<"+z+">":"<...>"}catch{return"<...>"}}function i(){var g=$.A;return g===null?null:g.getOwner()}function r(){return Error("react-stack-top-frame")}function o(g){if(_.call(g,"key")){var z=Object.getOwnPropertyDescriptor(g,"key").get;if(z&&z.isReactWarning)return!1}return g.key!==void 0}function l(g,z){function se(){X||(X=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",z))}se.isReactWarning=!0,Object.defineProperty(g,"key",{get:se,configurable:!0})}function d(){var g=e(this.type);return xe[g]||(xe[g]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),g=this.props.ref,g!==void 0?g:null}function h(g,z,se,re,We,ie){var me=se.ref;return g={$$typeof:x,type:g,key:z,props:se,_owner:re},(me!==void 0?me:null)!==null?Object.defineProperty(g,"ref",{enumerable:!1,get:d}):Object.defineProperty(g,"ref",{enumerable:!1,value:null}),g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(g,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(g,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:We}),Object.defineProperty(g,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ie}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g}function c(g,z,se,re,We,ie){var me=z.children;if(me!==void 0)if(re)if(B(me)){for(re=0;re<me.length;re++)u(me[re]);Object.freeze&&Object.freeze(me)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else u(me);if(_.call(z,"key")){me=e(g);var ve=Object.keys(z).filter(function($e){return $e!=="key"});re=0<ve.length?"{key: someKey, "+ve.join(": ..., ")+": ...}":"{key: someKey}",S[me+re]||(ve=0<ve.length?"{"+ve.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
|
+
let props = %s;
|
|
3
|
+
<%s {...props} />
|
|
4
|
+
React keys must be passed directly to JSX without using spread:
|
|
5
|
+
let props = %s;
|
|
6
|
+
<%s key={someKey} {...props} />`,re,me,ve,me),S[me+re]=!0)}if(me=null,se!==void 0&&(s(se),me=""+se),o(z)&&(s(z.key),me=""+z.key),"key"in z){se={};for(var oe in z)oe!=="key"&&(se[oe]=z[oe])}else se=z;return me&&l(se,typeof g=="function"?g.displayName||g.name||"Unknown":g),h(g,me,se,i(),We,ie)}function u(g){m(g)?g._store&&(g._store.validated=1):typeof g=="object"&&g!==null&&g.$$typeof===j&&(g._payload.status==="fulfilled"?m(g._payload.value)&&g._payload.value._store&&(g._payload.value._store.validated=1):g._store&&(g._store.validated=1))}function m(g){return typeof g=="object"&&g!==null&&g.$$typeof===x}var p=y,x=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),C=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),D=Symbol.for("react.client.reference"),$=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_=Object.prototype.hasOwnProperty,B=Array.isArray,K=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(g){return g()}};var X,xe={},Z=p.react_stack_bottom_frame.bind(p,r)(),ne=K(n(r)),S={};Ot.Fragment=k,Ot.jsx=function(g,z,se){var re=1e4>$.recentlyCreatedOwnerStacks++;return c(g,z,se,!1,re?Error("react-stack-top-frame"):Z,re?K(n(g)):ne)},Ot.jsxs=function(g,z,se){var re=1e4>$.recentlyCreatedOwnerStacks++;return c(g,z,se,!0,re?Error("react-stack-top-frame"):Z,re?K(n(g)):ne)}})()),Ot}var Ti;function xl(){return Ti||(Ti=1,process.env.NODE_ENV==="production"?ns.exports=ml():ns.exports=pl()),ns.exports}var a=xl();const gl={ADR:"#7c3aed",Boundary:"#0891b2",Claim:"#b45309",Evidence:"#64748b",Feature:"#0f766e",Issue:"#e11d48",Profile:"#9333ea",Release:"#16a34a",Risk:"#ea580c",Spec:"#2563eb",Test:"#dc2626"},yl={ADR:0,Spec:1,Feature:2,Claim:3,Test:4,Evidence:5,Boundary:6,Profile:7,Release:8,Issue:9,Risk:10};function rr(e){return gl[String(e)]??"#475569"}function bl(e){return yl[String(e)]??99}function ar(e){return e.map((t,s)=>({id:t.id,family:t.family,label:t.label||t.id,status:t.status||"",tier:t.tier||"",origin:t.origin||"",path:t.path||"",degree:Number(t.degree||0),x:Number.isFinite(t.x)?Number(t.x):s%100*46,y:Number.isFinite(t.y)?Number(t.y):Math.floor(s/100)*46,vx:Number(t.vx||0),vy:Number(t.vy||0),pinned:!!t.pinned}))}function lr(e,t,s,n=""){const i=new Set(t),r=[];let o=new Set(t);const l=s==="max"?Number.POSITIVE_INFINITY:Number(s);for(let d=0;d<l&&o.size>0;d+=1){const h=new Set;for(const c of e){if(n&&c.type!==n)continue;const u=o.has(c.from),m=o.has(c.to);!u&&!m||(r.push(c),i.has(c.from)||(i.add(c.from),h.add(c.from)),i.has(c.to)||(i.add(c.to),h.add(c.to)))}if(o=h,s==="max"&&h.size===0)break}return{ids:i,edges:r}}function cr(e,t,s){const n=210*t,i=90*s,r=new Map;for(const o of e){const l=bl(o.family),d=r.get(l)||[];d.push(o),r.set(l,d)}for(const[o,l]of r)l.sort((d,h)=>d.id.localeCompare(h.id)),l.forEach((d,h)=>{d.x=80+h*n,d.y=70+o*i,d.vx=0,d.vy=0});return e}function dr(e,t,s=1,n={}){const i=n.springStrength??1,r=n.repulsionStrength??1;vl(e);const o=new Map(e.map(l=>[l.id,l]));for(let l=0;l<s;l+=1){for(const d of t){const h=o.get(d.from),c=o.get(d.to);if(!h||!c)continue;const u=c.x-h.x,m=c.y-h.y,p=Math.hypot(u,m)||1;if(!Number.isFinite(p))continue;const x=Math.max(-4,Math.min(4,(p-140)*.015*i)),v=u/p*x,k=m/p*x;h.pinned||(h.vx+=v,h.vy+=k),c.pinned||(c.vx-=v,c.vy-=k)}kl(e,r);for(const d of e){if(d.pinned){d.vx=0,d.vy=0;continue}d.vx=Tt(d.vx*.82,-24,24),d.vy=Tt(d.vy*.82,-24,24),d.x+=d.vx,d.y+=d.vy,!Number.isFinite(d.x)||!Number.isFinite(d.y)?(d.x=0,d.y=0,d.vx=0,d.vy=0):(d.x=Tt(d.x,-1e6,1e6),d.y=Tt(d.y,-1e6,1e6))}}return e}function Tt(e,t,s){return Number.isFinite(e)?Math.max(t,Math.min(s,e)):0}function vl(e){e.forEach((t,s)=>{Number.isFinite(t.x)||(t.x=s%100*46),Number.isFinite(t.y)||(t.y=Math.floor(s/100)*46),t.vx=Tt(t.vx,-24,24),t.vy=Tt(t.vy,-24,24)})}function ur(e,t,s){return{x:e,y:t,size:s,mass:0,cx:0,cy:0,node:null,children:null}}function wl(e,t){const s=e.size/2;return ur(e.x+(t&1?s:0),e.y+(t&2?s:0),s)}function Ci(e,t){const s=e.x+e.size/2,n=e.y+e.size/2;return(t.x>s?1:0)+(t.y>n?2:0)}function ln(e,t,s=0){if(!e.node&&!e.children){e.node=t;return}if(!e.children){e.children=[0,1,2,3].map(i=>wl(e,i));const n=e.node;e.node=null,n&&ln(e.children[Ci(e,n)],n,s+1)}s<32&&ln(e.children[Ci(e,t)],t,s+1)}function hr(e){if(e.children){for(const t of e.children)hr(t),e.mass+=t.mass,e.cx+=t.cx*t.mass,e.cy+=t.cy*t.mass;e.mass>0&&(e.cx/=e.mass,e.cy/=e.mass)}else e.node&&(e.mass=1,e.cx=e.node.x,e.cy=e.node.y)}function kl(e,t=1){if(e.length<2)return;const s=e.filter(c=>Number.isFinite(c.x)&&Number.isFinite(c.y));if(s.length<2)return;let n=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(const c of s)n=Math.min(n,c.x),i=Math.min(i,c.y),r=Math.max(r,c.x),o=Math.max(o,c.y);const l=Math.max(1,r-n,o-i)+2,d=ur(n-1,i-1,l);for(const c of s)ln(d,c);hr(d);const h=(c,u)=>{if(c.mass===0||c.node===u||u.pinned)return;const m=c.cx-u.x,p=c.cy-u.y,x=Math.hypot(m,p)||1;if(!c.children||c.size/x<.7){if(!Number.isFinite(x))return;const v=Math.min(2.5,1400*t*c.mass/(x*x));u.vx-=m*v*.01,u.vy-=p*v*.01;return}for(const v of c.children)h(v,u)};for(const c of s)h(d,c)}const cn=1e-4,dn=50;function Sl(e,t){if(t==="off")return e;const s=t==="strong"?2:8,n=new Map;return e.filter(i=>{const r=`${i.from}:${i.to}:${i.type||"RELATED"}`,o=n.get(r)||0;return n.set(r,o+1),o<s})}function jl(e,t,s){const[n,i]=y.useState(0),[r,o]=y.useState({x:0,y:0,zoom:1}),l=s.renderer==="canvas"?"canvas":"webgl",d=y.useMemo(()=>{const h=s.search.trim().toLowerCase(),c=h?e.filter(b=>`${b.id} ${b.label} ${b.family}`.toLowerCase().includes(h)).map(b=>b.id):e.map(b=>b.id),u=s.centerId?[s.centerId]:c,m=s.centerId?s.depth:"1",p=lr(t,u,m,s.edgeType);let x=e.filter(b=>p.ids.has(b.id));if(x=x.filter(b=>s.familyVisible[b.family]!==!1||b.id===s.centerId||b.id===s.selectedNodeId),!s.centerId&&!h&&(x=[...x].sort((b,w)=>w.degree-b.degree||b.id.localeCompare(w.id))),s.nodeLimit!=="all"&&(x=x.slice(0,s.nodeLimit)),s.selectedNodeId&&!x.some(b=>b.id===s.selectedNodeId)){const b=e.find(w=>w.id===s.selectedNodeId);b&&(x=[b,...x])}const v=new Set(x.map(b=>b.id)),k=(s.centerId?p.edges:t).filter(b=>v.has(b.from)&&v.has(b.to)&&(!s.edgeType||b.type===s.edgeType));s.mode==="lineage"?cr(x,s.xScale,s.yScale):x.length<=s.forceCutoff&&dr(x,k,2,{springStrength:s.forceStrength,repulsionStrength:s.repulsionStrength});const T=Sl(k,s.mode==="lineage"?s.ribbonCulling:"off");return{visibleNodes:x,visibleEdges:T}},[t,e,s,n]);return y.useEffect(()=>{if(s.mode!=="network"||d.visibleNodes.length>s.forceCutoff)return;const h=window.setInterval(()=>i(c=>c+1),34);return()=>window.clearInterval(h)},[s.mode,s.forceCutoff,d.visibleNodes.length]),{...d,rendererMode:l,viewport:r}}function Nl(e,t,s,n,i,r,o,l){const d=e.canvas.clientWidth,h=e.canvas.clientHeight;e.clearRect(0,0,d,h);const c=new Map(t.map(m=>[m.id,m])),u=m=>({x:m.x*n.zoom+n.x,y:m.y*n.zoom+n.y});for(const[m,p]of s.entries()){const x=c.get(p.from),v=c.get(p.to);if(!x||!v)continue;const k=u(x),T=u(v);if(!Number.isFinite(k.x+k.y+T.x+T.y))continue;const b=r===m||i===p.from||i===p.to;e.lineWidth=b?l+2.2:l,e.strokeStyle=b?"#be123c":`rgba(8,145,178,${o})`,e.beginPath(),e.moveTo(k.x,k.y),e.lineTo(T.x,T.y),e.stroke()}for(const m of t){const p=u(m);if(!Number.isFinite(p.x+p.y))continue;const x=m.id===i;e.fillStyle=rr(m.family),e.strokeStyle=x?"#111827":"#fff",e.lineWidth=x?3:1.5,e.beginPath(),e.arc(p.x,p.y,x?8:6,0,Math.PI*2),e.fill(),e.stroke(),n.zoom>.45&&t.length<1200&&(e.fillStyle="#111827",e.font="11px system-ui",e.fillText(m.id,p.x+9,p.y+4))}}function Tl(e){const[t,s]=y.useState(0);return y.useEffect(()=>{const n=e.current;if(!n)return;const i=()=>{const o=n.getBoundingClientRect(),l=window.devicePixelRatio||1;n.width=Math.max(1,Math.floor(o.width*l)),n.height=Math.max(1,Math.floor(o.height*l));const d=n.getContext("2d");d&&d.setTransform(l,0,0,l,0,0),s(h=>h+1)};i();const r=new ResizeObserver(i);return r.observe(n),()=>r.disconnect()},[e]),t}function Cl(e,t,s){const n=e.filter(c=>Number.isFinite(c.x)&&Number.isFinite(c.y));if(!n.length)return{x:0,y:0,zoom:1};const i=Math.min(...n.map(c=>c.x)),r=Math.max(...n.map(c=>c.x)),o=Math.min(...n.map(c=>c.y)),l=Math.max(...n.map(c=>c.y)),d=Math.min(t/Math.max(1,r-i+220),s/Math.max(1,l-o+220)),h=Number.isFinite(d)&&d>0?Math.max(cn,Math.min(dn,d)):1;return{x:Number.isFinite(i+r)?(t-(i+r)*h)/2:0,y:Number.isFinite(o+l)?(s-(o+l)*h)/2:0,zoom:h}}function Ml({payload:e,options:t,className:s,onSelectionChange:n}){const i=y.useRef(null),r=y.useRef(ar(e.nodes)),o=y.useRef(null),[l,d]=y.useState(null),[h,c]=y.useState(null),[u,m]=y.useState({x:0,y:0,zoom:1}),p=Tl(i),x={mode:t?.mode||"network",depth:t?.depth||"1",nodeLimit:t?.nodeLimit||250,edgeType:t?.edgeType||"",search:t?.search||"",familyVisible:t?.familyVisible||{},centerId:t?.centerId||null,renderer:t?.renderer||"auto",xScale:t?.xScale||1,yScale:t?.yScale||1,edgeOpacity:t?.edgeOpacity??.92,edgeWidth:t?.edgeWidth??2.25,ribbonCulling:t?.ribbonCulling||"light",forceCutoff:t?.forceCutoff||1e4,forceStrength:t?.forceStrength??1,repulsionStrength:t?.repulsionStrength??1,selectedNodeId:t?.selectedNodeId,selectedEdgeIndex:t?.selectedEdgeIndex},v=jl(r.current,e.edges,x),k=x.selectedNodeId!==void 0?x.selectedNodeId:l,T=x.selectedEdgeIndex!==void 0?x.selectedEdgeIndex:h,b=(j,N)=>{d(j),c(N),n?.({selectedNodeId:j,selectedEdgeIndex:N,focusNodeId:x.centerId})},w=y.useCallback(()=>{const j=i.current;if(!j)return;const N=Math.max(1,j.clientWidth||j.width||1),D=Math.max(1,j.clientHeight||j.height||1);m(Cl(v.visibleNodes,N,D))},[v.visibleNodes]),C=j=>{const N=i.current,D=(N?.clientWidth||N?.width||1)/2,$=(N?.clientHeight||N?.height||1)/2;m(_=>{const B=Number.isFinite(_.zoom)&&_.zoom>0?_.zoom:1,K=(D-_.x)/B,X=($-_.y)/B,xe=Math.max(cn,Math.min(dn,B*j));return{x:D-K*xe,y:$-X*xe,zoom:xe}})};y.useEffect(()=>{w()},[p,x.mode,x.centerId,x.nodeLimit,x.depth,x.edgeType,x.search,x.xScale,x.yScale,x.forceStrength,x.repulsionStrength]),y.useEffect(()=>{const N=i.current?.getContext("2d");N&&Nl(N,v.visibleNodes,v.visibleEdges,u,k,T,x.edgeOpacity,x.edgeWidth)},[v.visibleNodes,v.visibleEdges,u,k,T,x.edgeOpacity,x.edgeWidth]),y.useEffect(()=>{n?.({selectedNodeId:k??null,selectedEdgeIndex:T??null,focusNodeId:x.centerId})},[n,k,T,x.centerId]);const I=j=>({x:j.x*u.zoom+u.x,y:j.y*u.zoom+u.y}),M=(j,N)=>{let D=null,$=14;for(const _ of v.visibleNodes){const B=I(_),K=Math.hypot(B.x-j,B.y-N);K<$&&(D=_,$=K)}return D},F=()=>{const j=document.createElement("a");j.href=i.current?.toDataURL("image/png")||"",j.download="ssot-lineage-graph.png",j.click()},P=()=>{const j=new Map(v.visibleNodes.map(_=>[_.id,_])),N=[];for(const _ of v.visibleEdges){const B=j.get(_.from),K=j.get(_.to);if(!B||!K)continue;const X=I(B),xe=I(K);N.push(`<line x1="${X.x}" y1="${X.y}" x2="${xe.x}" y2="${xe.y}" stroke="#0891b2" stroke-width="2.25"/>`)}for(const _ of v.visibleNodes){const B=I(_);N.push(`<circle cx="${B.x}" cy="${B.y}" r="6" fill="${rr(_.family)}"/>`)}const D=new Blob([`<svg xmlns="http://www.w3.org/2000/svg" width="${i.current?.clientWidth||1}" height="${i.current?.clientHeight||1}">${N.join("")}</svg>`],{type:"image/svg+xml"}),$=document.createElement("a");$.href=URL.createObjectURL(D),$.download="ssot-lineage-graph.svg",$.click(),setTimeout(()=>URL.revokeObjectURL($.href),1e3)};return a.jsxs("main",{className:`ssot-canvas-stage ${s||""}`,"data-renderer":v.rendererMode,children:[a.jsx("canvas",{ref:i,"data-testid":"ssot-lineage-canvas",onDoubleClick:w,onClick:j=>{if(o.current?.moved){o.current=null;return}const N=M(j.nativeEvent.offsetX,j.nativeEvent.offsetY);N&&b(N.id,null)},onMouseDown:j=>{const N=M(j.nativeEvent.offsetX,j.nativeEvent.offsetY);o.current={kind:N?"node":"pan",nodeId:N?.id||null,lastX:j.clientX,lastY:j.clientY,moved:!1}},onMouseMove:j=>{const N=o.current;if(!N)return;const D=j.clientX-N.lastX,$=j.clientY-N.lastY;if(Math.abs(D)+Math.abs($)>1&&(N.moved=!0),N.kind==="pan"){N.lastX=j.clientX,N.lastY=j.clientY,m(B=>({...B,x:B.x+D,y:B.y+$}));return}const _=r.current.find(B=>B.id===N.nodeId);_&&(_.x+=D/u.zoom,_.y+=$/u.zoom,_.vx=0,_.vy=0,_.pinned=!0),N.lastX=j.clientX,N.lastY=j.clientY,m(B=>({...B}))},onMouseUp:()=>{o.current=null},onMouseLeave:()=>{o.current=null},onWheel:j=>{j.preventDefault();const N=j.deltaY<0?1.1:.9,D=(j.nativeEvent.offsetX-u.x)/u.zoom,$=(j.nativeEvent.offsetY-u.y)/u.zoom,_=Math.max(cn,Math.min(dn,u.zoom*N));m({x:j.nativeEvent.offsetX-D*_,y:j.nativeEvent.offsetY-$*_,zoom:_})}}),a.jsxs("div",{className:"ssot-toolbar",children:[a.jsx("button",{type:"button",onClick:w,children:"Fit"}),a.jsx("button",{type:"button",onClick:()=>C(1.25),children:"+"}),a.jsx("button",{type:"button",onClick:()=>C(.8),children:"-"}),a.jsx("button",{type:"button",onClick:()=>m({x:0,y:0,zoom:1}),children:"100%"}),a.jsx("button",{type:"button",onClick:F,children:"PNG"}),a.jsx("button",{type:"button",onClick:P,children:"SVG"}),a.jsxs("span",{className:"pill",children:[v.visibleNodes.length," visible nodes / ",v.visibleEdges.length," visible edges - zoom"," ",Number.isFinite(u.zoom)?Math.round(u.zoom*100):100,"%"]})]})]})}const Pl=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),El=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,n)=>n?n.toUpperCase():s.toLowerCase()),Mi=e=>{const t=El(e);return t.charAt(0).toUpperCase()+t.slice(1)},fr=(...e)=>e.filter((t,s,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===s).join(" ").trim(),Al=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Rl={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Vl=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:n,className:i="",children:r,iconNode:o,...l},d)=>y.createElement("svg",{ref:d,...Rl,width:t,height:t,stroke:e,strokeWidth:n?Number(s)*24/Number(t):s,className:fr("lucide",i),...!r&&!Al(l)&&{"aria-hidden":"true"},...l},[...o.map(([h,c])=>y.createElement(h,c)),...Array.isArray(r)?r:[r]]));const Q=(e,t)=>{const s=y.forwardRef(({className:n,...i},r)=>y.createElement(Vl,{ref:r,iconNode:t,className:fr(`lucide-${Pl(Mi(e))}`,`lucide-${e}`,n),...i}));return s.displayName=Mi(e),s};const Dl=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],ys=Q("activity",Dl);const Ll=[["path",{d:"M12 22V8",key:"qkxhtm"}],["path",{d:"M5 12H2a10 10 0 0 0 20 0h-3",key:"1hv3nh"}],["circle",{cx:"12",cy:"5",r:"3",key:"rqqgnr"}]],Pi=Q("anchor",Ll);const Il=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],mr=Q("book-open",Il);const Fl=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ei=Q("check",Fl);const $l=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],pr=Q("chevron-left",$l);const zl=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],un=Q("chevron-right",zl);const Ol=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],_l=Q("circle-question-mark",Ol);const Bl=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Wl=Q("code",Bl);const Ul=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],At=Q("copy",Ul);const Hl=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],Yl=Q("cpu",Hl);const Gl=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Ai=Q("database",Gl);const Kl=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],xr=Q("eye-off",Kl);const Xl=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Zl=Q("eye",Xl);const ql=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]],Jl=Q("file-down",ql);const Ql=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ec=Q("file-text",Ql);const tc=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Ri=Q("folder",tc);const sc=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],bs=Q("layers",sc);const nc=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],gr=Q("map",nc);const ic=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],oc=Q("maximize",ic);const rc=[["path",{d:"M5 12h14",key:"1ays0h"}]],ac=Q("minus",rc);const lc=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],cc=Q("network",lc);const dc=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Vi=Q("package",dc);const uc=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]],hc=Q("pin-off",uc);const fc=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],mc=Q("pin",fc);const pc=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],xc=Q("play",pc);const gc=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],yc=Q("plus",gc);const bc=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],Di=Q("refresh-ccw",bc);const vc=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],wc=Q("refresh-cw",vc);const kc=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],Li=Q("rocket",kc);const Sc=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],jc=Q("search",Sc);const Nc=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Tc=Q("settings",Nc);const Cc=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],Mc=Q("shield-alert",Cc);const Pc=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ii=Q("shield-check",Pc);const Ec=[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],hn=Q("sliders-vertical",Ec);const Ac=[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Rc=Q("trash",Ac);const Vc=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],wt=Q("x",Vc);const Dc=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Fi=Q("zap",Dc);const Lc=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],Ic=Q("zoom-in",Lc);const Fc=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],$c=Q("zoom-out",Fc),zn=y.createContext({});function On(e){const t=y.useRef(null);return t.current===null&&(t.current=e()),t.current}const zc=typeof window<"u",yr=zc?y.useLayoutEffect:y.useEffect,As=y.createContext(null);function _n(e,t){e.indexOf(t)===-1&&e.push(t)}function vs(e,t){const s=e.indexOf(t);s>-1&&e.splice(s,1)}const qe=(e,t,s)=>s>t?t:s<e?e:s;function fn(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let Dt=()=>{},st=()=>{};typeof process<"u"&&process.env?.NODE_ENV!=="production"&&(Dt=(e,t,s)=>{!e&&typeof console<"u"&&console.warn(fn(t,s))},st=(e,t,s)=>{if(!e)throw new Error(fn(t,s))});const ut={},br=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),vr=e=>typeof e=="object"&&e!==null,wr=e=>/^0[^.\s]+$/u.test(e);function kr(e){let t;return()=>(t===void 0&&(t=e()),t)}const Be=e=>e,Zt=(...e)=>e.reduce((t,s)=>n=>s(t(n))),Yt=(e,t,s)=>{const n=t-e;return n?(s-e)/n:1};class Bn{constructor(){this.subscriptions=[]}add(t){return _n(this.subscriptions,t),()=>vs(this.subscriptions,t)}notify(t,s,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,s,n);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(t,s,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ie=e=>e*1e3,_e=e=>e/1e3,Sr=(e,t)=>t?e*(1e3/t):0,$i=new Set;function Wn(e,t,s){e||$i.has(t)||(console.warn(fn(t,s)),$i.add(t))}const jr=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e,Oc=1e-7,_c=12;function Bc(e,t,s,n,i){let r,o,l=0;do o=t+(s-t)/2,r=jr(o,n,i)-e,r>0?s=o:t=o;while(Math.abs(r)>Oc&&++l<_c);return o}function qt(e,t,s,n){if(e===t&&s===n)return Be;const i=r=>Bc(r,0,1,e,s);return r=>r===0||r===1?r:jr(i(r),t,n)}const Nr=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Tr=e=>t=>1-e(1-t),Cr=qt(.33,1.53,.69,.99),Un=Tr(Cr),Mr=Nr(Un),Pr=e=>e>=1?1:(e*=2)<1?.5*Un(e):.5*(2-Math.pow(2,-10*(e-1))),Hn=e=>1-Math.sin(Math.acos(e)),Er=Tr(Hn),Ar=Nr(Hn),Wc=qt(.42,0,1,1),Uc=qt(0,0,.58,1),Rr=qt(.42,0,.58,1),Hc=e=>Array.isArray(e)&&typeof e[0]!="number",Vr=e=>Array.isArray(e)&&typeof e[0]=="number",zi={linear:Be,easeIn:Wc,easeInOut:Rr,easeOut:Uc,circIn:Hn,circInOut:Ar,circOut:Er,backIn:Un,backInOut:Mr,backOut:Cr,anticipate:Pr},Yc=e=>typeof e=="string",Oi=e=>{if(Vr(e)){st(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,s,n,i]=e;return qt(t,s,n,i)}else if(Yc(e))return st(zi[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),zi[e];return e},is=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Gc(e,t){let s=new Set,n=new Set,i=!1,r=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function d(c){o.has(c)&&(h.schedule(c),e()),c(l)}const h={schedule:(c,u=!1,m=!1)=>{const x=m&&i?s:n;return u&&o.add(c),x.add(c),c},cancel:c=>{n.delete(c),o.delete(c)},process:c=>{if(l=c,i){r=!0;return}i=!0;const u=s;s=n,n=u,s.forEach(d),s.clear(),i=!1,r&&(r=!1,h.process(c))}};return h}const Kc=40;function Dr(e,t){let s=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>s=!0,o=is.reduce((w,C)=>(w[C]=Gc(r),w),{}),{setup:l,read:d,resolveKeyframes:h,preUpdate:c,update:u,preRender:m,render:p,postRender:x}=o,v=()=>{const w=ut.useManualTiming,C=w?i.timestamp:performance.now();s=!1,w||(i.delta=n?1e3/60:Math.max(Math.min(C-i.timestamp,Kc),1)),i.timestamp=C,i.isProcessing=!0,l.process(i),d.process(i),h.process(i),c.process(i),u.process(i),m.process(i),p.process(i),x.process(i),i.isProcessing=!1,s&&t&&(n=!1,e(v))},k=()=>{s=!0,n=!0,i.isProcessing||e(v)};return{schedule:is.reduce((w,C)=>{const I=o[C];return w[C]=(M,F=!1,P=!1)=>(s||k(),I.schedule(M,F,P)),w},{}),cancel:w=>{for(let C=0;C<is.length;C++)o[is[C]].cancel(w)},state:i,steps:o}}const{schedule:ce,cancel:ht,state:Te,steps:Us}=Dr(typeof requestAnimationFrame<"u"?requestAnimationFrame:Be,!0);let cs;function Xc(){cs=void 0}const Ae={now:()=>(cs===void 0&&Ae.set(Te.isProcessing||ut.useManualTiming?Te.timestamp:performance.now()),cs),set:e=>{cs=e,queueMicrotask(Xc)}},Lr=e=>t=>typeof t=="string"&&t.startsWith(e),Ir=Lr("--"),Zc=Lr("var(--"),Yn=e=>Zc(e)?qc.test(e.split("/*")[0].trim()):!1,qc=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function _i(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Lt={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Gt={...Lt,transform:e=>qe(0,1,e)},os={...Lt,default:1},Wt=e=>Math.round(e*1e5)/1e5,Gn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Jc(e){return e==null}const Qc=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Kn=(e,t)=>s=>!!(typeof s=="string"&&Qc.test(s)&&s.startsWith(e)||t&&!Jc(s)&&Object.prototype.hasOwnProperty.call(s,t)),Fr=(e,t,s)=>n=>{if(typeof n!="string")return n;const[i,r,o,l]=n.match(Gn);return{[e]:parseFloat(i),[t]:parseFloat(r),[s]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},ed=e=>qe(0,255,e),Hs={...Lt,transform:e=>Math.round(ed(e))},bt={test:Kn("rgb","red"),parse:Fr("red","green","blue"),transform:({red:e,green:t,blue:s,alpha:n=1})=>"rgba("+Hs.transform(e)+", "+Hs.transform(t)+", "+Hs.transform(s)+", "+Wt(Gt.transform(n))+")"};function td(e){let t="",s="",n="",i="";return e.length>5?(t=e.substring(1,3),s=e.substring(3,5),n=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),s=e.substring(2,3),n=e.substring(3,4),i=e.substring(4,5),t+=t,s+=s,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const mn={test:Kn("#"),parse:td,transform:bt.transform},Jt=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),et=Jt("deg"),Ze=Jt("%"),O=Jt("px"),sd=Jt("vh"),nd=Jt("vw"),Bi={...Ze,parse:e=>Ze.parse(e)/100,transform:e=>Ze.transform(e*100)},Ct={test:Kn("hsl","hue"),parse:Fr("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:s,alpha:n=1})=>"hsla("+Math.round(e)+", "+Ze.transform(Wt(t))+", "+Ze.transform(Wt(s))+", "+Wt(Gt.transform(n))+")"},we={test:e=>bt.test(e)||mn.test(e)||Ct.test(e),parse:e=>bt.test(e)?bt.parse(e):Ct.test(e)?Ct.parse(e):mn.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?bt.transform(e):Ct.transform(e),getAnimatableNone:e=>{const t=we.parse(e);return t.alpha=0,we.transform(t)}},id=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function od(e){return isNaN(e)&&typeof e=="string"&&(e.match(Gn)?.length||0)+(e.match(id)?.length||0)>0}const $r="number",zr="color",rd="var",ad="var(",Wi="${}",ld=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Rt(e){const t=e.toString(),s=[],n={color:[],number:[],var:[]},i=[];let r=0;const l=t.replace(ld,d=>(we.test(d)?(n.color.push(r),i.push(zr),s.push(we.parse(d))):d.startsWith(ad)?(n.var.push(r),i.push(rd),s.push(d)):(n.number.push(r),i.push($r),s.push(parseFloat(d))),++r,Wi)).split(Wi);return{values:s,split:l,indexes:n,types:i}}function cd(e){return Rt(e).values}function Or({split:e,types:t}){const s=e.length;return n=>{let i="";for(let r=0;r<s;r++)if(i+=e[r],n[r]!==void 0){const o=t[r];o===$r?i+=Wt(n[r]):o===zr?i+=we.transform(n[r]):i+=n[r]}return i}}function dd(e){return Or(Rt(e))}const ud=e=>typeof e=="number"?0:we.test(e)?we.getAnimatableNone(e):e,hd=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:ud(e);function fd(e){const t=Rt(e);return Or(t)(t.values.map((n,i)=>hd(n,t.split[i])))}const Ge={test:od,parse:cd,createTransformer:dd,getAnimatableNone:fd};function Ys(e,t,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(t-e)*6*s:s<1/2?t:s<2/3?e+(t-e)*(2/3-s)*6:e}function md({hue:e,saturation:t,lightness:s,alpha:n}){e/=360,t/=100,s/=100;let i=0,r=0,o=0;if(!t)i=r=o=s;else{const l=s<.5?s*(1+t):s+t-s*t,d=2*s-l;i=Ys(d,l,e+1/3),r=Ys(d,l,e),o=Ys(d,l,e-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:n}}function ws(e,t){return s=>s>0?t:e}const le=(e,t,s)=>e+(t-e)*s,Gs=(e,t,s)=>{const n=e*e,i=s*(t*t-n)+n;return i<0?0:Math.sqrt(i)},pd=[mn,bt,Ct],xd=e=>pd.find(t=>t.test(e));function Ui(e){const t=xd(e);if(Dt(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let s=t.parse(e);return t===Ct&&(s=md(s)),s}const Hi=(e,t)=>{const s=Ui(e),n=Ui(t);if(!s||!n)return ws(e,t);const i={...s};return r=>(i.red=Gs(s.red,n.red,r),i.green=Gs(s.green,n.green,r),i.blue=Gs(s.blue,n.blue,r),i.alpha=le(s.alpha,n.alpha,r),bt.transform(i))},pn=new Set(["none","hidden"]);function gd(e,t){return pn.has(e)?s=>s<=0?e:t:s=>s>=1?t:e}function yd(e,t){return s=>le(e,t,s)}function Xn(e){return typeof e=="number"?yd:typeof e=="string"?Yn(e)?ws:we.test(e)?Hi:wd:Array.isArray(e)?_r:typeof e=="object"?we.test(e)?Hi:bd:ws}function _r(e,t){const s=[...e],n=s.length,i=e.map((r,o)=>Xn(r)(r,t[o]));return r=>{for(let o=0;o<n;o++)s[o]=i[o](r);return s}}function bd(e,t){const s={...e,...t},n={};for(const i in s)e[i]!==void 0&&t[i]!==void 0&&(n[i]=Xn(e[i])(e[i],t[i]));return i=>{for(const r in n)s[r]=n[r](i);return s}}function vd(e,t){const s=[],n={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const r=t.types[i],o=e.indexes[r][n[r]],l=e.values[o]??0;s[i]=l,n[r]++}return s}const wd=(e,t)=>{const s=Ge.createTransformer(t),n=Rt(e),i=Rt(t);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?pn.has(e)&&!i.values.length||pn.has(t)&&!n.values.length?gd(e,t):Zt(_r(vd(n,i),i.values),s):(Dt(!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.`,"complex-values-different"),ws(e,t))};function Br(e,t,s){return typeof e=="number"&&typeof t=="number"&&typeof s=="number"?le(e,t,s):Xn(e)(e,t)}const kd=e=>{const t=({timestamp:s})=>e(s);return{start:(s=!0)=>ce.update(t,s),stop:()=>ht(t),now:()=>Te.isProcessing?Te.timestamp:Ae.now()}},Wr=(e,t,s=10)=>{let n="";const i=Math.max(Math.round(t/s),2);for(let r=0;r<i;r++)n+=Math.round(e(r/(i-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},ks=2e4;function Zn(e){let t=0;const s=50;let n=e.next(t);for(;!n.done&&t<ks;)t+=s,n=e.next(t);return t>=ks?1/0:t}function Sd(e,t=100,s){const n=s({...e,keyframes:[0,t]}),i=Math.min(Zn(n),ks);return{type:"keyframes",ease:r=>n.next(i*r).value/t,duration:_e(i)}}const ge={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function xn(e,t){return e*Math.sqrt(1-t*t)}const jd=12;function Nd(e,t,s){let n=s;for(let i=1;i<jd;i++)n=n-e(n)/t(n);return n}const Ks=.001;function Td({duration:e=ge.duration,bounce:t=ge.bounce,velocity:s=ge.velocity,mass:n=ge.mass}){let i,r;Dt(e<=Ie(ge.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-t;o=qe(ge.minDamping,ge.maxDamping,o),e=qe(ge.minDuration,ge.maxDuration,_e(e)),o<1?(i=h=>{const c=h*o,u=c*e,m=c-s,p=xn(h,o),x=Math.exp(-u);return Ks-m/p*x},r=h=>{const u=h*o*e,m=u*s+s,p=Math.pow(o,2)*Math.pow(h,2)*e,x=Math.exp(-u),v=xn(Math.pow(h,2),o);return(-i(h)+Ks>0?-1:1)*((m-p)*x)/v}):(i=h=>{const c=Math.exp(-h*e),u=(h-s)*e+1;return-Ks+c*u},r=h=>{const c=Math.exp(-h*e),u=(s-h)*(e*e);return c*u});const l=5/e,d=Nd(i,r,l);if(e=Ie(e),isNaN(d))return{stiffness:ge.stiffness,damping:ge.damping,duration:e};{const h=Math.pow(d,2)*n;return{stiffness:h,damping:o*2*Math.sqrt(n*h),duration:e}}}const Cd=["duration","bounce"],Md=["stiffness","damping","mass"];function Yi(e,t){return t.some(s=>e[s]!==void 0)}function Pd(e){let t={velocity:ge.velocity,stiffness:ge.stiffness,damping:ge.damping,mass:ge.mass,isResolvedFromDuration:!1,...e};if(!Yi(e,Md)&&Yi(e,Cd))if(t.velocity=0,e.visualDuration){const s=e.visualDuration,n=2*Math.PI/(s*1.2),i=n*n,r=2*qe(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:ge.mass,stiffness:i,damping:r}}else{const s=Td({...e,velocity:0});t={...t,...s,mass:ge.mass},t.isResolvedFromDuration=!0}return t}function Ss(e=ge.visualDuration,t=ge.bounce){const s=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:i}=s;const r=s.keyframes[0],o=s.keyframes[s.keyframes.length-1],l={done:!1,value:r},{stiffness:d,damping:h,mass:c,duration:u,velocity:m,isResolvedFromDuration:p}=Pd({...s,velocity:-_e(s.velocity||0)}),x=m||0,v=h/(2*Math.sqrt(d*c)),k=o-r,T=_e(Math.sqrt(d/c)),b=Math.abs(k)<5;n||(n=b?ge.restSpeed.granular:ge.restSpeed.default),i||(i=b?ge.restDelta.granular:ge.restDelta.default);let w,C,I,M,F,P;if(v<1)I=xn(T,v),M=(x+v*T*k)/I,w=N=>{const D=Math.exp(-v*T*N);return o-D*(M*Math.sin(I*N)+k*Math.cos(I*N))},F=v*T*M+k*I,P=v*T*k-M*I,C=N=>Math.exp(-v*T*N)*(F*Math.sin(I*N)+P*Math.cos(I*N));else if(v===1){w=D=>o-Math.exp(-T*D)*(k+(x+T*k)*D);const N=x+T*k;C=D=>Math.exp(-T*D)*(T*N*D-x)}else{const N=T*Math.sqrt(v*v-1);w=B=>{const K=Math.exp(-v*T*B),X=Math.min(N*B,300);return o-K*((x+v*T*k)*Math.sinh(X)+N*k*Math.cosh(X))/N};const D=(x+v*T*k)/N,$=v*T*D-k*N,_=v*T*k-D*N;C=B=>{const K=Math.exp(-v*T*B),X=Math.min(N*B,300);return K*($*Math.sinh(X)+_*Math.cosh(X))}}const j={calculatedDuration:p&&u||null,velocity:N=>Ie(C(N)),next:N=>{if(!p&&v<1){const $=Math.exp(-v*T*N),_=Math.sin(I*N),B=Math.cos(I*N),K=o-$*(M*_+k*B),X=Ie($*(F*_+P*B));return l.done=Math.abs(X)<=n&&Math.abs(o-K)<=i,l.value=l.done?o:K,l}const D=w(N);if(p)l.done=N>=u;else{const $=Ie(C(N));l.done=Math.abs($)<=n&&Math.abs(o-D)<=i}return l.value=l.done?o:D,l},toString:()=>{const N=Math.min(Zn(j),ks),D=Wr($=>j.next(N*$).value,N,30);return N+"ms "+D},toTransition:()=>{}};return j}Ss.applyToOptions=e=>{const t=Sd(e,100,Ss);return e.ease=t.ease,e.duration=Ie(t.duration),e.type="keyframes",e};const Ed=5;function Ur(e,t,s){const n=Math.max(t-Ed,0);return Sr(s-e(n),t-n)}function gn({keyframes:e,velocity:t=0,power:s=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:l,max:d,restDelta:h=.5,restSpeed:c}){const u=e[0],m={done:!1,value:u},p=P=>l!==void 0&&P<l||d!==void 0&&P>d,x=P=>l===void 0?d:d===void 0||Math.abs(l-P)<Math.abs(d-P)?l:d;let v=s*t;const k=u+v,T=o===void 0?k:o(k);T!==k&&(v=T-u);const b=P=>-v*Math.exp(-P/n),w=P=>T+b(P),C=P=>{const j=b(P),N=w(P);m.done=Math.abs(j)<=h,m.value=m.done?T:N};let I,M;const F=P=>{p(m.value)&&(I=P,M=Ss({keyframes:[m.value,x(m.value)],velocity:Ur(w,P,m.value),damping:i,stiffness:r,restDelta:h,restSpeed:c}))};return F(0),{calculatedDuration:null,next:P=>{let j=!1;return!M&&I===void 0&&(j=!0,C(P),F(P)),I!==void 0&&P>=I?M.next(P-I):(!j&&C(P),m)}}}function Ad(e,t,s){const n=[],i=s||ut.mix||Br,r=e.length-1;for(let o=0;o<r;o++){let l=i(e[o],e[o+1]);if(t){const d=Array.isArray(t)?t[o]||Be:t;l=Zt(d,l)}n.push(l)}return n}function Rd(e,t,{clamp:s=!0,ease:n,mixer:i}={}){const r=e.length;if(st(r===t.length,"Both input and output ranges must be the same length","range-length"),r===1)return()=>t[0];if(r===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[r-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=Ad(t,n,i),d=l.length,h=c=>{if(o&&c<e[0])return t[0];let u=0;if(d>1)for(;u<e.length-2&&!(c<e[u+1]);u++);const m=Yt(e[u],e[u+1],c);return l[u](m)};return s?c=>h(qe(e[0],e[r-1],c)):h}function Vd(e,t){const s=e[e.length-1];for(let n=1;n<=t;n++){const i=Yt(0,t,n);e.push(le(s,1,i))}}function Dd(e){const t=[0];return Vd(t,e.length-1),t}function Ld(e,t){return e.map(s=>s*t)}function Id(e,t){return e.map(()=>t||Rr).splice(0,e.length-1)}function Mt({duration:e=300,keyframes:t,times:s,ease:n="easeInOut"}){const i=Hc(n)?n.map(Oi):Oi(n),r={done:!1,value:t[0]},o=Ld(s&&s.length===t.length?s:Dd(t),e),l=Rd(o,t,{ease:Array.isArray(i)?i:Id(t,i)});return{calculatedDuration:e,next:d=>(r.value=l(d),r.done=d>=e,r)}}const Fd=e=>e!==null;function Rs(e,{repeat:t,repeatType:s="loop"},n,i=1){const r=e.filter(Fd),l=i<0||t&&s!=="loop"&&t%2===1?0:r.length-1;return!l||n===void 0?r[l]:n}const $d={decay:gn,inertia:gn,tween:Mt,keyframes:Mt,spring:Ss};function Hr(e){typeof e.type=="string"&&(e.type=$d[e.type])}class qn{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,s){return this.finished.then(t,s)}}const zd=e=>e/100;class js extends qn{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:s}=this.options;s&&s.updatedAt!==Ae.now()&&this.tick(Ae.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Hr(t);const{type:s=Mt,repeat:n=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=t;let{keyframes:l}=t;const d=s||Mt;process.env.NODE_ENV!=="production"&&d!==Mt&&st(l.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${l}`,"spring-two-frames"),d!==Mt&&typeof l[0]!="number"&&(this.mixKeyframes=Zt(zd,Br(l[0],l[1])),l=[0,100]);const h=d({...t,keyframes:l});r==="mirror"&&(this.mirroredGenerator=d({...t,keyframes:[...l].reverse(),velocity:-o})),h.calculatedDuration===null&&(h.calculatedDuration=Zn(h));const{calculatedDuration:c}=h;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=h}updateTime(t){const s=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=s}tick(t,s=!1){const{generator:n,totalDuration:i,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:d}=this;if(this.startTime===null)return n.next(0);const{delay:h=0,keyframes:c,repeat:u,repeatType:m,repeatDelay:p,type:x,onUpdate:v,finalKeyframe:k}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),s?this.currentTime=t:this.updateTime(t);const T=this.currentTime-h*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?T<0:T>i;this.currentTime=Math.max(T,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let w=this.currentTime,C=n;if(u){const P=Math.min(this.currentTime,i)/l;let j=Math.floor(P),N=P%1;!N&&P>=1&&(N=1),N===1&&j--,j=Math.min(j,u+1),j%2&&(m==="reverse"?(N=1-N,p&&(N-=p/l)):m==="mirror"&&(C=o)),w=qe(0,1,N)*l}let I;b?(this.delayState.value=c[0],I=this.delayState):I=C.next(w),r&&!b&&(I.value=r(I.value));let{done:M}=I;!b&&d!==null&&(M=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const F=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return F&&x!==gn&&(I.value=Rs(c,this.options,k,this.speed)),v&&v(I.value),F&&this.finish(),I}then(t,s){return this.finished.then(t,s)}get duration(){return _e(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+_e(t)}get time(){return _e(this.currentTime)}set time(t){t=Ie(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const s=this.generator.next(t).value;return Ur(n=>this.generator.next(n).value,t,s)}get speed(){return this.playbackSpeed}set speed(t){const s=this.playbackSpeed!==t;s&&this.driver&&this.updateTime(Ae.now()),this.playbackSpeed=t,s&&this.driver&&(this.time=_e(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=kd,startTime:s}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),this.options.onPlay?.();const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=s??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ae.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function Od(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const vt=e=>e*180/Math.PI,yn=e=>{const t=vt(Math.atan2(e[1],e[0]));return bn(t)},_d={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:yn,rotateZ:yn,skewX:e=>vt(Math.atan(e[1])),skewY:e=>vt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},bn=e=>(e=e%360,e<0&&(e+=360),e),Gi=yn,Ki=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Xi=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Bd={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ki,scaleY:Xi,scale:e=>(Ki(e)+Xi(e))/2,rotateX:e=>bn(vt(Math.atan2(e[6],e[5]))),rotateY:e=>bn(vt(Math.atan2(-e[2],e[0]))),rotateZ:Gi,rotate:Gi,skewX:e=>vt(Math.atan(e[4])),skewY:e=>vt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function vn(e){return e.includes("scale")?1:0}function wn(e,t){if(!e||e==="none")return vn(t);const s=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(s)n=Bd,i=s;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=_d,i=l}if(!i)return vn(t);const r=n[t],o=i[1].split(",").map(Ud);return typeof r=="function"?r(o):o[r]}const Wd=(e,t)=>{const{transform:s="none"}=getComputedStyle(e);return wn(s,t)};function Ud(e){return parseFloat(e.trim())}const It=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ft=new Set([...It,"pathRotation"]),Zi=e=>e===Lt||e===O,Hd=new Set(["x","y","z"]),Yd=It.filter(e=>!Hd.has(e));function Gd(e){const t=[];return Yd.forEach(s=>{const n=e.getValue(s);n!==void 0&&(t.push([s,n.get()]),n.set(s.startsWith("scale")?1:0))}),t}const dt={width:({x:e},{paddingLeft:t="0",paddingRight:s="0",boxSizing:n})=>{const i=e.max-e.min;return n==="border-box"?i:i-parseFloat(t)-parseFloat(s)},height:({y:e},{paddingTop:t="0",paddingBottom:s="0",boxSizing:n})=>{const i=e.max-e.min;return n==="border-box"?i:i-parseFloat(t)-parseFloat(s)},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:(e,{transform:t})=>wn(t,"x"),y:(e,{transform:t})=>wn(t,"y")};dt.translateX=dt.x;dt.translateY=dt.y;const kt=new Set;let kn=!1,Sn=!1,jn=!1;function Yr(){if(Sn){const e=Array.from(kt).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),s=new Map;t.forEach(n=>{const i=Gd(n);i.length&&(s.set(n,i),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();const i=s.get(n);i&&i.forEach(([r,o])=>{n.getValue(r)?.set(o)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}Sn=!1,kn=!1,kt.forEach(e=>e.complete(jn)),kt.clear()}function Gr(){kt.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Sn=!0)})}function Kd(){jn=!0,Gr(),Yr(),jn=!1}class Jn{constructor(t,s,n,i,r,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=s,this.name=n,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(kt.add(this),kn||(kn=!0,ce.read(Gr),ce.resolveKeyframes(Yr))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:s,element:n,motionValue:i}=this;if(t[0]===null){const r=i?.get(),o=t[t.length-1];if(r!==void 0)t[0]=r;else if(n&&s){const l=n.readValue(s,o);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=o),i&&r===void 0&&i.set(t[0])}Od(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),kt.delete(this)}cancel(){this.state==="scheduled"&&(kt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Xd=e=>e.startsWith("--");function Kr(e,t,s){Xd(t)?e.style.setProperty(t,s):e.style[t]=s}const Zd={};function Xr(e,t){const s=kr(e);return()=>Zd[t]??s()}const qd=Xr(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Zr=Xr(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Bt=([e,t,s,n])=>`cubic-bezier(${e}, ${t}, ${s}, ${n})`,qi={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Bt([0,.65,.55,1]),circOut:Bt([.55,0,1,.45]),backIn:Bt([.31,.01,.66,-.59]),backOut:Bt([.33,1.53,.69,.99])};function qr(e,t){if(e)return typeof e=="function"?Zr()?Wr(e,t):"ease-out":Vr(e)?Bt(e):Array.isArray(e)?e.map(s=>qr(s,t)||qi.easeOut):qi[e]}function Jd(e,t,s,{delay:n=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:l="easeOut",times:d}={},h=void 0){const c={[t]:s};d&&(c.offset=d);const u=qr(l,i);Array.isArray(u)&&(c.easing=u);const m={delay:n,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return h&&(m.pseudoElement=h),e.animate(c,m)}function Jr(e){return typeof e=="function"&&"applyToOptions"in e}function Qd({type:e,...t}){return Jr(e)&&Zr()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Qr extends qn{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:s,name:n,keyframes:i,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:l,onComplete:d}=t;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=t,st(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const h=Qd(t);this.animation=Jd(s,n,i,h,r),h.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const c=Rs(i,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(c),Kr(s,n,c),this.animation.cancel()}d?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return _e(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+_e(t)}get time(){return _e(Number(this.animation.currentTime)||0)}set time(t){const s=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ie(t),s&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:s,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&qd()?(this.animation.timeline=t,s&&(this.animation.rangeStart=s),n&&(this.animation.rangeEnd=n),Be):i(this)}}const ea={anticipate:Pr,backInOut:Mr,circInOut:Ar};function eu(e){return e in ea}function tu(e){typeof e.ease=="string"&&eu(e.ease)&&(e.ease=ea[e.ease])}const Xs=10;class su extends Qr{constructor(t){tu(t),Hr(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:s,onUpdate:n,onComplete:i,element:r,...o}=this.options;if(!s)return;if(t!==void 0){s.set(t);return}const l=new js({...o,autoplay:!1}),d=Math.max(Xs,Ae.now()-this.startTime),h=qe(0,Xs,d-Xs),c=l.sample(d).value,{name:u}=this.options;r&&u&&Kr(r,u,c),s.setWithVelocity(l.sample(Math.max(0,d-h)).value,c,h),l.stop()}}const Ji=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ge.test(e)||e==="0")&&!e.startsWith("url("));function nu(e){const t=e[0];if(e.length===1)return!0;for(let s=0;s<e.length;s++)if(e[s]!==t)return!0}function iu(e,t,s,n){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const r=e[e.length-1],o=Ji(i,t),l=Ji(r,t);return Dt(o===l,`You are trying to animate ${t} from "${i}" to "${r}". "${o?r:i}" is not an animatable value.`,"value-not-animatable"),!o||!l?!1:nu(e)||(s==="spring"||Jr(s))&&n}function Nn(e){e.duration=0,e.type="keyframes"}const ta=new Set(["opacity","clipPath","filter","transform"]),ou=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function ru(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&ou.test(e[t]))return!0;return!1}const au=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),lu=kr(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function cu(e){const{motionValue:t,name:s,repeatDelay:n,repeatType:i,damping:r,type:o,keyframes:l}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:c}=t.owner.getProps();return lu()&&s&&(ta.has(s)||au.has(s)&&ru(l))&&(s!=="transform"||!c)&&!h&&!n&&i!=="mirror"&&r!==0&&o!=="inertia"}const du=40;class uu extends qn{constructor({autoplay:t=!0,delay:s=0,type:n="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",keyframes:l,name:d,motionValue:h,element:c,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Ae.now();const m={autoplay:t,delay:s,type:n,repeat:i,repeatDelay:r,repeatType:o,name:d,motionValue:h,element:c,...u},p=c?.KeyframeResolver||Jn;this.keyframeResolver=new p(l,(x,v,k)=>this.onKeyframesResolved(x,v,m,!k),d,h,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,s,n,i){this.keyframeResolver=void 0;const{name:r,type:o,velocity:l,delay:d,isHandoff:h,onUpdate:c}=n;this.resolvedAt=Ae.now();let u=!0;iu(t,r,o,l)||(u=!1,(ut.instantAnimations||!d)&&c?.(Rs(t,n,s)),t[0]=t[t.length-1],Nn(n),n.repeat=0);const p={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>du?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:s,...n,keyframes:t},x=u&&!h&&cu(p),v=p.motionValue?.owner?.current;let k;if(x)try{k=new su({...p,element:v})}catch{k=new js(p)}else k=new js(p);k.finished.then(()=>{this.notifyFinished()}).catch(Be),this.pendingTimeline&&(this.stopTimeline=k.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=k}get finished(){return this._animation?this.animation.finished:this._finished}then(t,s){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Kd()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function sa(e,t,s,n=0,i=1){const r=Array.from(e).sort((h,c)=>h.sortNodePosition(c)).indexOf(t),o=e.size,l=(o-1)*n;return typeof s=="function"?s(r,o):i===1?r*n:l-r*n}const Qi=30,hu=e=>!isNaN(parseFloat(e));class fu{constructor(t,s={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{const i=Ae.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=s.owner}setCurrent(t){this.current=t,this.updatedAt=Ae.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=hu(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Wn(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,s){this.events[t]||(this.events[t]=new Bn);const n=this.events[t].add(s);return t==="change"?()=>{n(),ce.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,s){this.passiveEffect=t,this.stopPassiveEffect=s}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,s,n){this.set(s),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,s=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ae.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Qi)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,Qi);return Sr(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(t){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=t(s),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.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Vt(e,t){return new fu(e,t)}function na(e,t){if(e?.inherit&&t){const{inherit:s,...n}=e;return{...t,...n}}return e}function Qn(e,t){const s=e?.[t]??e?.default??e;return s!==e?na(s,e):s}const mu={type:"spring",stiffness:500,damping:25,restSpeed:10},pu=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),xu={type:"keyframes",duration:.8},gu={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},yu=(e,{keyframes:t})=>t.length>2?xu:Ft.has(e)?e.startsWith("scale")?pu(t[1]):mu:gu,bu=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function vu(e){for(const t in e)if(!bu.has(t))return!0;return!1}const ei=(e,t,s,n={},i,r)=>o=>{const l=Qn(n,e)||{},d=l.delay||n.delay||0;let{elapsed:h=0}=n;h=h-Ie(d);const c={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-h,onUpdate:m=>{t.set(m),l.onUpdate&&l.onUpdate(m)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:r?void 0:i};vu(l)||Object.assign(c,yu(e,c)),c.duration&&(c.duration=Ie(c.duration)),c.repeatDelay&&(c.repeatDelay=Ie(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let u=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(Nn(c),c.delay===0&&(u=!0)),(ut.instantAnimations||ut.skipAnimations||i?.shouldSkipAnimations||l.skipAnimations)&&(u=!0,Nn(c),c.delay=0),c.allowFlatten=!l.type&&!l.ease,u&&!r&&t.get()!==void 0){const m=Rs(c.keyframes,l);if(m!==void 0){ce.update(()=>{c.onUpdate(m),c.onComplete()});return}}return l.isSync?new js(c):new uu(c)},wu=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ku(e){const t=wu.exec(e);if(!t)return[,];const[,s,n,i]=t;return[`--${s??n}`,i]}const Su=4;function ia(e,t,s=1){st(s<=Su,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[n,i]=ku(e);if(!n)return;const r=window.getComputedStyle(t).getPropertyValue(n);if(r){const o=r.trim();return br(o)?parseFloat(o):o}return Yn(i)?ia(i,t,s+1):i}function eo(e){const t=[{},{}];return e?.values.forEach((s,n)=>{t[0][n]=s.get(),t[1][n]=s.getVelocity()}),t}function ti(e,t,s,n){if(typeof t=="function"){const[i,r]=eo(n);t=t(s!==void 0?s:e.custom,i,r)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,r]=eo(n);t=t(s!==void 0?s:e.custom,i,r)}return t}function St(e,t,s){const n=e.getProps();return ti(n,t,s!==void 0?s:n.custom,e)}const oa=new Set(["width","height","top","left","right","bottom",...It]),Tn=e=>Array.isArray(e);function ju(e,t,s){e.hasValue(t)?e.getValue(t).set(s):e.addValue(t,Vt(s))}function Nu(e){return Tn(e)?e[e.length-1]||0:e}function Tu(e,t){const s=St(e,t);let{transitionEnd:n={},transition:i={},...r}=s||{};r={...r,...n};for(const o in r){const l=Nu(r[o]);ju(e,o,l)}}const Ce=e=>!!(e&&e.getVelocity);function Cu(e){return!!(Ce(e)&&e.add)}function Cn(e,t){const s=e.getValue("willChange");if(Cu(s))return s.add(t);if(!s&&ut.WillChange){const n=new ut.WillChange("auto");e.addValue("willChange",n),n.add(t)}}function si(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Mu="framerAppearId",ra="data-"+si(Mu);function aa(e){return e.props[ra]}function Pu({protectedKeys:e,needsAnimating:t},s){const n=e.hasOwnProperty(s)&&t[s]!==!0;return t[s]=!1,n}function la(e,t,{delay:s=0,transitionOverride:n,type:i}={}){let{transition:r,transitionEnd:o,...l}=t;const d=e.getDefaultTransition();r=r?na(r,d):d;const h=r?.reduceMotion,c=r?.skipAnimations;n&&(r=n);const u=[],m=i&&e.animationState&&e.animationState.getState()[i],p=r?.path;p&&p.animateVisualElement(e,l,r,s,u);for(const x in l){const v=e.getValue(x,e.latestValues[x]??null),k=l[x];if(k===void 0||m&&Pu(m,x))continue;const T={delay:s,...Qn(r||{},x)};c&&(T.skipAnimations=!0);const b=v.get();if(b!==void 0&&!v.isAnimating()&&!Array.isArray(k)&&k===b&&!T.velocity){ce.update(()=>v.set(k));continue}let w=!1;if(window.MotionHandoffAnimation){const M=aa(e);if(M){const F=window.MotionHandoffAnimation(M,x,ce);F!==null&&(T.startTime=F,w=!0)}}Cn(e,x);const C=h??e.shouldReduceMotion;v.start(ei(x,v,k,C&&oa.has(x)?{type:!1}:T,e,w));const I=v.animation;I&&u.push(I)}if(o){const x=()=>ce.update(()=>{o&&Tu(e,o)});u.length?Promise.all(u).then(x):x()}return u}function Mn(e,t,s={}){const n=St(e,t,s.type==="exit"?e.presenceContext?.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=n||{};s.transitionOverride&&(i=s.transitionOverride);const r=n?()=>Promise.all(la(e,n,s)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:h=0,staggerChildren:c,staggerDirection:u}=i;return Eu(e,t,d,h,c,u,s)}:()=>Promise.resolve(),{when:l}=i;if(l){const[d,h]=l==="beforeChildren"?[r,o]:[o,r];return d().then(()=>h())}else return Promise.all([r(),o(s.delay)])}function Eu(e,t,s=0,n=0,i=0,r=1,o){const l=[];for(const d of e.variantChildren)d.notify("AnimationStart",t),l.push(Mn(d,t,{...o,delay:s+(typeof n=="function"?0:n)+sa(e.variantChildren,d,n,i,r)}).then(()=>d.notify("AnimationComplete",t)));return Promise.all(l)}function Au(e,t,s={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){const i=t.map(r=>Mn(e,r,s));n=Promise.all(i)}else if(typeof t=="string")n=Mn(e,t,s);else{const i=typeof t=="function"?St(e,t,s.custom):t;n=Promise.all(la(e,i,s))}return n.then(()=>{e.notify("AnimationComplete",t)})}const Ru={test:e=>e==="auto",parse:e=>e},ca=e=>t=>t.test(e),da=[Lt,O,Ze,et,nd,sd,Ru],to=e=>da.find(ca(e));function Vu(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||wr(e):!0}const Du=new Set(["brightness","contrast","saturate","opacity"]);function Lu(e){const[t,s]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=s.match(Gn)||[];if(!n)return e;const i=s.replace(n,"");let r=Du.has(t)?1:0;return n!==s&&(r*=100),t+"("+r+i+")"}const Iu=/\b([a-z-]*)\(.*?\)/gu,Pn={...Ge,getAnimatableNone:e=>{const t=e.match(Iu);return t?t.map(Lu).join(" "):e}},En={...Ge,getAnimatableNone:e=>{const t=Ge.parse(e);return Ge.createTransformer(e)(t.map(n=>typeof n=="number"?0:typeof n=="object"?{...n,alpha:1}:n))}},so={...Lt,transform:Math.round},Fu={rotate:et,pathRotation:et,rotateX:et,rotateY:et,rotateZ:et,scale:os,scaleX:os,scaleY:os,scaleZ:os,skew:et,skewX:et,skewY:et,distance:O,translateX:O,translateY:O,translateZ:O,x:O,y:O,z:O,perspective:O,transformPerspective:O,opacity:Gt,originX:Bi,originY:Bi,originZ:O},Ns={borderWidth:O,borderTopWidth:O,borderRightWidth:O,borderBottomWidth:O,borderLeftWidth:O,borderRadius:O,borderTopLeftRadius:O,borderTopRightRadius:O,borderBottomRightRadius:O,borderBottomLeftRadius:O,width:O,maxWidth:O,height:O,maxHeight:O,top:O,right:O,bottom:O,left:O,inset:O,insetBlock:O,insetBlockStart:O,insetBlockEnd:O,insetInline:O,insetInlineStart:O,insetInlineEnd:O,padding:O,paddingTop:O,paddingRight:O,paddingBottom:O,paddingLeft:O,paddingBlock:O,paddingBlockStart:O,paddingBlockEnd:O,paddingInline:O,paddingInlineStart:O,paddingInlineEnd:O,margin:O,marginTop:O,marginRight:O,marginBottom:O,marginLeft:O,marginBlock:O,marginBlockStart:O,marginBlockEnd:O,marginInline:O,marginInlineStart:O,marginInlineEnd:O,fontSize:O,backgroundPositionX:O,backgroundPositionY:O,...Fu,zIndex:so,fillOpacity:Gt,strokeOpacity:Gt,numOctaves:so},$u={...Ns,color:we,backgroundColor:we,outlineColor:we,fill:we,stroke:we,borderColor:we,borderTopColor:we,borderRightColor:we,borderBottomColor:we,borderLeftColor:we,filter:Pn,WebkitFilter:Pn,mask:En,WebkitMask:En},ua=e=>$u[e],zu=new Set([Pn,En]);function ha(e,t){let s=ua(e);return zu.has(s)||(s=Ge),s.getAnimatableNone?s.getAnimatableNone(t):void 0}const Ou=new Set(["auto","none","0"]);function _u(e,t,s){let n=0,i;for(;n<e.length&&!i;){const r=e[n];typeof r=="string"&&!Ou.has(r)&&Rt(r).values.length&&(i=e[n]),n++}if(i&&s)for(const r of t)e[r]=ha(s,i)}class Bu extends Jn{constructor(t,s,n,i,r){super(t,s,n,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:s,name:n}=this;if(!s||!s.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let u=t[c];if(typeof u=="string"&&(u=u.trim(),Yn(u))){const m=ia(u,s.current);m!==void 0&&(t[c]=m),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!oa.has(n)||t.length!==2)return;const[i,r]=t,o=to(i),l=to(r),d=_i(i),h=_i(r);if(d!==h&&dt[n]){this.needsMeasurement=!0;return}if(o!==l)if(Zi(o)&&Zi(l))for(let c=0;c<t.length;c++){const u=t[c];typeof u=="string"&&(t[c]=parseFloat(u))}else dt[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:s}=this,n=[];for(let i=0;i<t.length;i++)(t[i]===null||Vu(t[i]))&&n.push(i);n.length&&_u(t,n,s)}measureInitialState(){const{element:t,unresolvedKeyframes:s,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=dt[n](t.measureViewportBox(),window.getComputedStyle(t.current)),s[0]=this.measuredOrigin;const i=s[s.length-1];i!==void 0&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:s,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(s);i&&i.jump(this.measuredOrigin,!1);const r=n.length-1,o=n[r];n[r]=dt[s](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([l,d])=>{t.getValue(l).set(d)}),this.resolveNoneKeyframes()}}function fa(e,t,s){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let n=document;const i=s?.[e]??n.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(n=>n!=null)}const An=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function ds(e){return vr(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:ni}=Dr(queueMicrotask,!1),Ye={x:!1,y:!1};function ma(){return Ye.x||Ye.y}function Wu(e){return e==="x"||e==="y"?Ye[e]?null:(Ye[e]=!0,()=>{Ye[e]=!1}):Ye.x||Ye.y?null:(Ye.x=Ye.y=!0,()=>{Ye.x=Ye.y=!1})}function pa(e,t){const s=fa(e),n=new AbortController,i={passive:!0,...t,signal:n.signal};return[s,i,()=>n.abort()]}function Uu(e){return!(e.pointerType==="touch"||ma())}function Hu(e,t,s={}){const[n,i,r]=pa(e,s);return n.forEach(o=>{let l=!1,d=!1,h;const c=()=>{o.removeEventListener("pointerleave",x)},u=k=>{h&&(h(k),h=void 0),c()},m=k=>{l=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),d&&(d=!1,u(k))},p=()=>{l=!0,window.addEventListener("pointerup",m,i),window.addEventListener("pointercancel",m,i)},x=k=>{if(k.pointerType!=="touch"){if(l){d=!0;return}u(k)}},v=k=>{if(!Uu(k))return;d=!1;const T=t(o,k);typeof T=="function"&&(h=T,o.addEventListener("pointerleave",x,i))};o.addEventListener("pointerenter",v,i),o.addEventListener("pointerdown",p,i)}),r}const xa=(e,t)=>t?e===t?!0:xa(e,t.parentElement):!1,ii=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Yu=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Gu(e){return Yu.has(e.tagName)||e.isContentEditable===!0}const Ku=new Set(["INPUT","SELECT","TEXTAREA"]);function Xu(e){return Ku.has(e.tagName)||e.isContentEditable===!0}const us=new WeakSet;function no(e){return t=>{t.key==="Enter"&&e(t)}}function Zs(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Zu=(e,t)=>{const s=e.currentTarget;if(!s)return;const n=no(()=>{if(us.has(s))return;Zs(s,"down");const i=no(()=>{Zs(s,"up")}),r=()=>Zs(s,"cancel");s.addEventListener("keyup",i,t),s.addEventListener("blur",r,t)});s.addEventListener("keydown",n,t),s.addEventListener("blur",()=>s.removeEventListener("keydown",n),t)};function io(e){return ii(e)&&!ma()}const oo=new WeakSet;function qu(e,t,s={}){const[n,i,r]=pa(e,s),o=l=>{const d=l.currentTarget;if(!io(l)||oo.has(l))return;us.add(d),s.stopPropagation&&oo.add(l);const h=t(d,l),c=(p,x)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",m),us.has(d)&&us.delete(d),io(p)&&typeof h=="function"&&h(p,{success:x})},u=p=>{c(p,d===window||d===document||s.useGlobalTarget||xa(d,p.target))},m=p=>{c(p,!1)};window.addEventListener("pointerup",u,i),window.addEventListener("pointercancel",m,i)};return n.forEach(l=>{(s.useGlobalTarget?window:l).addEventListener("pointerdown",o,i),ds(l)&&(l.addEventListener("focus",h=>Zu(h,i)),!Gu(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),r}function oi(e){return vr(e)&&"ownerSVGElement"in e}const hs=new WeakMap;let fs;const ga=(e,t,s)=>(n,i)=>i&&i[0]?i[0][e+"Size"]:oi(n)&&"getBBox"in n?n.getBBox()[t]:n[s],Ju=ga("inline","width","offsetWidth"),Qu=ga("block","height","offsetHeight");function eh({target:e,borderBoxSize:t}){hs.get(e)?.forEach(s=>{s(e,{get width(){return Ju(e,t)},get height(){return Qu(e,t)}})})}function th(e){e.forEach(eh)}function sh(){typeof ResizeObserver>"u"||(fs=new ResizeObserver(th))}function nh(e,t){fs||sh();const s=fa(e);return s.forEach(n=>{let i=hs.get(n);i||(i=new Set,hs.set(n,i)),i.add(t),fs?.observe(n)}),()=>{s.forEach(n=>{const i=hs.get(n);i?.delete(t),i?.size||fs?.unobserve(n)})}}const ms=new Set;let Pt;function ih(){Pt=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};ms.forEach(t=>t(e))},window.addEventListener("resize",Pt)}function oh(e){return ms.add(e),Pt||ih(),()=>{ms.delete(e),!ms.size&&typeof Pt=="function"&&(window.removeEventListener("resize",Pt),Pt=void 0)}}function ro(e,t){return typeof e=="function"?oh(e):nh(e,t)}function rh(e){return oi(e)&&e.tagName==="svg"}const ah=[...da,we,Ge],lh=e=>ah.find(ca(e)),ao=()=>({translate:0,scale:1,origin:0,originPoint:0}),Et=()=>({x:ao(),y:ao()}),lo=()=>({min:0,max:0}),Se=()=>({x:lo(),y:lo()}),ch=new WeakMap;function Vs(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Kt(e){return typeof e=="string"||Array.isArray(e)}const ri=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ai=["initial",...ri];function Ds(e){return Vs(e.animate)||ai.some(t=>Kt(e[t]))}function ya(e){return!!(Ds(e)||e.variants)}function dh(e,t,s){for(const n in t){const i=t[n],r=s[n];if(Ce(i))e.addValue(n,i);else if(Ce(r))e.addValue(n,Vt(i,{owner:e}));else if(r!==i)if(e.hasValue(n)){const o=e.getValue(n);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(n);e.addValue(n,Vt(o!==void 0?o:i,{owner:e}))}}for(const n in s)t[n]===void 0&&e.removeValue(n);return t}const Rn={current:null},ba={current:!1},uh=typeof window<"u";function hh(){if(ba.current=!0,!!uh)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Rn.current=e.matches;e.addEventListener("change",t),t()}else Rn.current=!1}const co=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Ts={};function va(e){Ts=e}function fh(){return Ts}class mh{scrapeMotionValuesFromProps(t,s,n){return{}}constructor({parent:t,props:s,presenceContext:n,reducedMotionConfig:i,skipAnimations:r,blockInitialAnimation:o,visualState:l},d={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Jn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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.renderScheduledAt=0,this.scheduleRender=()=>{const p=Ae.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,ce.render(this.render,!1,!0))};const{latestValues:h,renderState:c}=l;this.latestValues=h,this.baseTarget={...h},this.initialValues=s.initial?{...h}:{},this.renderState=c,this.parent=t,this.props=s,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=r,this.options=d,this.blockInitialAnimation=!!o,this.isControllingVariants=Ds(s),this.isVariantNode=ya(s),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...m}=this.scrapeMotionValuesFromProps(s,{},this);for(const p in m){const x=m[p];h[p]!==void 0&&Ce(x)&&x.set(h[p])}}mount(t){if(this.hasBeenMounted)for(const s in this.initialValues)this.values.get(s)?.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,ch.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,n)=>this.bindToMotionValue(n,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(ba.current||hh(),this.shouldReduceMotion=Rn.current),process.env.NODE_ENV!=="production"&&Wn(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),ht(this.notifyUpdate),ht(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const s=this.features[t];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,s){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),s.accelerate&&ta.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:d,ease:h,duration:c}=s.accelerate,u=new Qr({element:this.current,name:t,keyframes:l,times:d,ease:h,duration:Ie(c)}),m=o(u);this.valueSubscriptions.set(t,()=>{m(),u.cancel()});return}const n=Ft.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=s.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&ce.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;typeof window<"u"&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,s)),this.valueSubscriptions.set(t,()=>{i(),r&&r()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ts){const s=Ts[t];if(!s)continue;const{isEnabled:n,Feature:i}=s;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const r=this.features[t];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Se()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,s){this.latestValues[t]=s}update(t,s){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let n=0;n<co.length;n++){const i=co[n];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=t[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=dh(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const s=this.getClosestVariantNode();if(s)return s.variantChildren&&s.variantChildren.add(t),()=>s.variantChildren.delete(t)}addValue(t,s){const n=this.values.get(t);s!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,s),this.values.set(t,s),this.latestValues[t]=s.get())}removeValue(t){this.values.delete(t);const s=this.valueSubscriptions.get(t);s&&(s(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,s){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&s!==void 0&&(n=Vt(s===null?void 0:s,{owner:this}),this.addValue(t,n)),n}readValue(t,s){let n=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return n!=null&&(typeof n=="string"&&(br(n)||wr(n))?n=parseFloat(n):!lh(n)&&Ge.test(s)&&(n=ha(t,s)),this.setBaseTarget(t,Ce(n)?n.get():n)),Ce(n)?n.get():n}setBaseTarget(t,s){this.baseTarget[t]=s}getBaseTarget(t){const{initial:s}=this.props;let n;if(typeof s=="string"||typeof s=="object"){const r=ti(this.props,s,this.presenceContext?.custom);r&&(n=r[t])}if(s&&n!==void 0)return n;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Ce(i)?i:this.initialValues[t]!==void 0&&n===void 0?void 0:this.baseTarget[t]}on(t,s){return this.events[t]||(this.events[t]=new Bn),this.events[t].add(s)}notify(t,...s){this.events[t]&&this.events[t].notify(...s)}scheduleRenderMicrotask(){ni.render(this.render)}}class wa extends mh{constructor(){super(...arguments),this.KeyframeResolver=Bu}sortInstanceNodePosition(t,s){return t.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(t,s){const n=t.style;return n?n[s]:void 0}removeValueFromRenderState(t,{vars:s,style:n}){delete s[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ce(t)&&(this.childSubscription=t.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}class ft{constructor(t){this.isMounted=!1,this.node=t}update(){}}function ka({top:e,left:t,right:s,bottom:n}){return{x:{min:t,max:s},y:{min:e,max:n}}}function ph({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function xh(e,t){if(!t)return e;const s=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:s.y,left:s.x,bottom:n.y,right:n.x}}function qs(e){return e===void 0||e===1}function Vn({scale:e,scaleX:t,scaleY:s}){return!qs(e)||!qs(t)||!qs(s)}function yt(e){return Vn(e)||Sa(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Sa(e){return uo(e.x)||uo(e.y)}function uo(e){return e&&e!=="0%"}function Cs(e,t,s){const n=e-s,i=t*n;return s+i}function ho(e,t,s,n,i){return i!==void 0&&(e=Cs(e,i,n)),Cs(e,s,n)+t}function Dn(e,t=0,s=1,n,i){e.min=ho(e.min,t,s,n,i),e.max=ho(e.max,t,s,n,i)}function ja(e,{x:t,y:s}){Dn(e.x,t.translate,t.scale,t.originPoint),Dn(e.y,s.translate,s.scale,s.originPoint)}const fo=.999999999999,mo=1.0000000000001;function gh(e,t,s,n=!1){const i=s.length;if(!i)return;t.x=t.y=1;let r,o;for(let l=0;l<i;l++){r=s[l],o=r.projectionDelta;const{visualElement:d}=r.options;d&&d.props.style&&d.props.style.display==="contents"||(n&&r.options.layoutScroll&&r.scroll&&r!==r.root&&(Xe(e.x,-r.scroll.offset.x),Xe(e.y,-r.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ja(e,o)),n&&yt(r.latestValues)&&ps(e,r.latestValues,r.layout?.layoutBox))}t.x<mo&&t.x>fo&&(t.x=1),t.y<mo&&t.y>fo&&(t.y=1)}function Xe(e,t){e.min+=t,e.max+=t}function po(e,t,s,n,i=.5){const r=le(e.min,e.max,i);Dn(e,t,s,r,n)}function xo(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function ps(e,t,s){const n=s??e;po(e.x,xo(t.x,n.x),t.scaleX,t.scale,t.originX),po(e.y,xo(t.y,n.y),t.scaleY,t.scale,t.originY)}function Na(e,t){return ka(xh(e.getBoundingClientRect(),t))}function yh(e,t,s){const n=Na(e,s),{scroll:i}=t;return i&&(Xe(n.x,i.offset.x),Xe(n.y,i.offset.y)),n}const bh={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},vh=It.length;function wh(e,t,s){let n="",i=!0;for(let o=0;o<vh;o++){const l=It[o],d=e[l];if(d===void 0)continue;let h=!0;if(typeof d=="number")h=d===(l.startsWith("scale")?1:0);else{const c=parseFloat(d);h=l.startsWith("scale")?c===1:c===0}if(!h||s){const c=An(d,Ns[l]);if(!h){i=!1;const u=bh[l]||l;n+=`${u}(${c}) `}s&&(t[l]=c)}}const r=e.pathRotation;return r&&(i=!1,n+=`rotate(${An(r,Ns.pathRotation)}) `),n=n.trim(),s?n=s(t,i?"":n):i&&(n="none"),n}function li(e,t,s){const{style:n,vars:i,transformOrigin:r}=e;let o=!1,l=!1;for(const d in t){const h=t[d];if(Ft.has(d)){o=!0;continue}else if(Ir(d)){i[d]=h;continue}else{const c=An(h,Ns[d]);d.startsWith("origin")?(l=!0,r[d]=c):n[d]=c}}if(t.transform||(o||s?n.transform=wh(t,e.transform,s):n.transform&&(n.transform="none")),l){const{originX:d="50%",originY:h="50%",originZ:c=0}=r;n.transformOrigin=`${d} ${h} ${c}`}}function Ta(e,{style:t,vars:s},n,i){const r=e.style;let o;for(o in t)r[o]=t[o];i?.applyProjectionStyles(r,n);for(o in s)r.setProperty(o,s[o])}function go(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const _t={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(O.test(e))e=parseFloat(e);else return e;const s=go(e,t.target.x),n=go(e,t.target.y);return`${s}% ${n}%`}},kh={correct:(e,{treeScale:t,projectionDelta:s})=>{const n=e,i=Ge.parse(e);if(i.length>5)return n;const r=Ge.createTransformer(e),o=typeof i[0]!="number"?1:0,l=s.x.scale*t.x,d=s.y.scale*t.y;i[0+o]/=l,i[1+o]/=d;const h=le(l,d,.5);return typeof i[2+o]=="number"&&(i[2+o]/=h),typeof i[3+o]=="number"&&(i[3+o]/=h),r(i)}},Ln={borderRadius:{..._t,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:_t,borderTopRightRadius:_t,borderBottomLeftRadius:_t,borderBottomRightRadius:_t,boxShadow:kh};function Ca(e,{layout:t,layoutId:s}){return Ft.has(e)||e.startsWith("origin")||(t||s!==void 0)&&(!!Ln[e]||e==="opacity")}function ci(e,t,s){const n=e.style,i=t?.style,r={};if(!n)return r;for(const o in n)(Ce(n[o])||i&&Ce(i[o])||Ca(o,e)||s?.getValue(o)?.liveStyle!==void 0)&&(r[o]=n[o]);return r}function Sh(e){return window.getComputedStyle(e)}class jh extends wa{constructor(){super(...arguments),this.type="html",this.renderInstance=Ta}readValueFromInstance(t,s){if(Ft.has(s))return this.projection?.isProjecting?vn(s):Wd(t,s);{const n=Sh(t),i=(Ir(s)?n.getPropertyValue(s):n[s])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:s}){return Na(t,s)}build(t,s,n){li(t,s,n.transformTemplate)}scrapeMotionValuesFromProps(t,s,n){return ci(t,s,n)}}const Nh={offset:"stroke-dashoffset",array:"stroke-dasharray"},Th={offset:"strokeDashoffset",array:"strokeDasharray"};function Ch(e,t,s=1,n=0,i=!0){e.pathLength=1;const r=i?Nh:Th;e[r.offset]=`${-n}`,e[r.array]=`${t} ${s}`}const Mh=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ma(e,{attrX:t,attrY:s,attrScale:n,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...l},d,h,c){if(li(e,l,h),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:u,style:m}=e;u.transform&&(m.transform=u.transform,delete u.transform),(m.transform||u.transformOrigin)&&(m.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),m.transform&&(m.transformBox=c?.transformBox??"fill-box",delete u.transformBox);for(const p of Mh)u[p]!==void 0&&(m[p]=u[p],delete u[p]);t!==void 0&&(u.x=t),s!==void 0&&(u.y=s),n!==void 0&&(u.scale=n),i!==void 0&&Ch(u,i,r,o,!1)}const Pa=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"]),Ea=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Ph(e,t,s,n){Ta(e,t,void 0,n);for(const i in t.attrs)e.setAttribute(Pa.has(i)?i:si(i),t.attrs[i])}function Aa(e,t,s){const n=ci(e,t,s);for(const i in e)if(Ce(e[i])||Ce(t[i])){const r=It.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[r]=e[i]}return n}class Eh extends wa{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Se}getBaseTargetFromProps(t,s){return t[s]}readValueFromInstance(t,s){if(Ft.has(s)){const n=ua(s);return n&&n.default||0}return s=Pa.has(s)?s:si(s),t.getAttribute(s)}scrapeMotionValuesFromProps(t,s,n){return Aa(t,s,n)}build(t,s,n){Ma(t,s,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,s,n,i){Ph(t,s,n,i)}mount(t){this.isSVGTag=Ea(t.tagName),super.mount(t)}}const Ah=ai.length;function Ra(e){if(!e)return;if(!e.isControllingVariants){const s=e.parent?Ra(e.parent)||{}:{};return e.props.initial!==void 0&&(s.initial=e.props.initial),s}const t={};for(let s=0;s<Ah;s++){const n=ai[s],i=e.props[n];(Kt(i)||i===!1)&&(t[n]=i)}return t}function Va(e,t){if(!Array.isArray(t))return!1;const s=t.length;if(s!==e.length)return!1;for(let n=0;n<s;n++)if(t[n]!==e[n])return!1;return!0}const Rh=[...ri].reverse(),Vh=ri.length;function Dh(e){return t=>Promise.all(t.map(({animation:s,options:n})=>Au(e,s,n)))}function Lh(e){let t=Dh(e),s=yo(),n=!0,i=!1;const r=h=>(c,u)=>{const m=St(e,u,h==="exit"?e.presenceContext?.custom:void 0);if(m){const{transition:p,transitionEnd:x,...v}=m;c={...c,...v,...x}}return c};function o(h){t=h(e)}function l(h){const{props:c}=e,u=Ra(e.parent)||{},m=[],p=new Set;let x={},v=1/0;for(let T=0;T<Vh;T++){const b=Rh[T],w=s[b],C=c[b]!==void 0?c[b]:u[b],I=Kt(C),M=b===h?w.isActive:null;M===!1&&(v=T);let F=C===u[b]&&C!==c[b]&&I;if(F&&(n||i)&&e.manuallyAnimateOnMount&&(F=!1),w.protectedKeys={...x},!w.isActive&&M===null||!C&&!w.prevProp||Vs(C)||typeof C=="boolean")continue;if(b==="exit"&&w.isActive&&M!==!0){w.prevResolvedValues&&(x={...x,...w.prevResolvedValues});continue}const P=Ih(w.prevProp,C);let j=P||b===h&&w.isActive&&!F&&I||T>v&&I,N=!1;const D=Array.isArray(C)?C:[C];let $=D.reduce(r(b),{});M===!1&&($={});const{prevResolvedValues:_={}}=w,B={..._,...$},K=Z=>{j=!0,p.has(Z)&&(N=!0,p.delete(Z)),w.needsAnimating[Z]=!0;const ne=e.getValue(Z);ne&&(ne.liveStyle=!1)};for(const Z in B){const ne=$[Z],S=_[Z];if(x.hasOwnProperty(Z))continue;let g=!1;Tn(ne)&&Tn(S)?g=!Va(ne,S)||P:g=ne!==S,g?ne!=null?K(Z):p.add(Z):ne!==void 0&&p.has(Z)?K(Z):w.protectedKeys[Z]=!0}w.prevProp=C,w.prevResolvedValues=$,w.isActive&&(x={...x,...$}),(n||i)&&e.blockInitialAnimation&&(j=!1);const X=F&&P;j&&(!X||N)&&m.push(...D.map(Z=>{const ne={type:b};if(typeof Z=="string"&&(n||i)&&!X&&e.manuallyAnimateOnMount&&e.parent){const{parent:S}=e,g=St(S,Z);if(S.enteringChildren&&g){const{delayChildren:z}=g.transition||{};ne.delay=sa(S.enteringChildren,e,z)}}return{animation:Z,options:ne}}))}if(p.size){const T={};if(typeof c.initial!="boolean"){const b=St(e,Array.isArray(c.initial)?c.initial[0]:c.initial);b&&b.transition&&(T.transition=b.transition)}p.forEach(b=>{const w=e.getBaseTarget(b),C=e.getValue(b);C&&(C.liveStyle=!0),T[b]=w??null}),m.push({animation:T})}let k=!!m.length;return n&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(k=!1),n=!1,i=!1,k?t(m):Promise.resolve()}function d(h,c){if(s[h].isActive===c)return Promise.resolve();e.variantChildren?.forEach(m=>m.animationState?.setActive(h,c)),s[h].isActive=c;const u=l(h);for(const m in s)s[m].protectedKeys={};return u}return{animateChanges:l,setActive:d,setAnimateFunction:o,getState:()=>s,reset:()=>{s=yo(),i=!0}}}function Ih(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Va(t,e):!1}function gt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function yo(){return{animate:gt(!0),whileInView:gt(),whileHover:gt(),whileTap:gt(),whileDrag:gt(),whileFocus:gt(),exit:gt()}}function In(e,t){e.min=t.min,e.max=t.max}function He(e,t){In(e.x,t.x),In(e.y,t.y)}function bo(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Da=1e-4,Fh=1-Da,$h=1+Da,La=.01,zh=0-La,Oh=0+La;function Re(e){return e.max-e.min}function _h(e,t,s){return Math.abs(e-t)<=s}function vo(e,t,s,n=.5){e.origin=n,e.originPoint=le(t.min,t.max,e.origin),e.scale=Re(s)/Re(t),e.translate=le(s.min,s.max,e.origin)-e.originPoint,(e.scale>=Fh&&e.scale<=$h||isNaN(e.scale))&&(e.scale=1),(e.translate>=zh&&e.translate<=Oh||isNaN(e.translate))&&(e.translate=0)}function Ut(e,t,s,n){vo(e.x,t.x,s.x,n?n.originX:void 0),vo(e.y,t.y,s.y,n?n.originY:void 0)}function wo(e,t,s,n=0){const i=n?le(s.min,s.max,n):s.min;e.min=i+t.min,e.max=e.min+Re(t)}function Bh(e,t,s,n){wo(e.x,t.x,s.x,n?.x),wo(e.y,t.y,s.y,n?.y)}function ko(e,t,s,n=0){const i=n?le(s.min,s.max,n):s.min;e.min=t.min-i,e.max=e.min+Re(t)}function Ms(e,t,s,n){ko(e.x,t.x,s.x,n?.x),ko(e.y,t.y,s.y,n?.y)}function So(e,t,s,n,i){return e-=t,e=Cs(e,1/s,n),i!==void 0&&(e=Cs(e,1/i,n)),e}function Wh(e,t=0,s=1,n=.5,i,r=e,o=e){if(Ze.test(t)&&(t=parseFloat(t),t=le(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=le(r.min,r.max,n);e===r&&(l-=t),e.min=So(e.min,t,s,l,i),e.max=So(e.max,t,s,l,i)}function jo(e,t,[s,n,i],r,o){Wh(e,t[s],t[n],t[i],t.scale,r,o)}const Uh=["x","scaleX","originX"],Hh=["y","scaleY","originY"];function No(e,t,s,n){jo(e.x,t,Uh,s?s.x:void 0,n?n.x:void 0),jo(e.y,t,Hh,s?s.y:void 0,n?n.y:void 0)}function To(e){return e.translate===0&&e.scale===1}function Ia(e){return To(e.x)&&To(e.y)}function Co(e,t){return e.min===t.min&&e.max===t.max}function Yh(e,t){return Co(e.x,t.x)&&Co(e.y,t.y)}function Mo(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Fa(e,t){return Mo(e.x,t.x)&&Mo(e.y,t.y)}function Po(e){return Re(e.x)/Re(e.y)}function Eo(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Ke(e){return[e("x"),e("y")]}function Gh(e,t,s){let n="";const i=e.x.translate/t.x,r=e.y.translate/t.y,o=s?.z||0;if((i||r||o)&&(n=`translate3d(${i}px, ${r}px, ${o}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),s){const{transformPerspective:h,rotate:c,pathRotation:u,rotateX:m,rotateY:p,skewX:x,skewY:v}=s;h&&(n=`perspective(${h}px) ${n}`),c&&(n+=`rotate(${c}deg) `),u&&(n+=`rotate(${u}deg) `),m&&(n+=`rotateX(${m}deg) `),p&&(n+=`rotateY(${p}deg) `),x&&(n+=`skewX(${x}deg) `),v&&(n+=`skewY(${v}deg) `)}const l=e.x.scale*t.x,d=e.y.scale*t.y;return(l!==1||d!==1)&&(n+=`scale(${l}, ${d})`),n||"none"}const $a=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Kh=$a.length,Ao=e=>typeof e=="string"?parseFloat(e):e,Ro=e=>typeof e=="number"||O.test(e);function Xh(e,t,s,n,i,r){i?(e.opacity=le(0,s.opacity??1,Zh(n)),e.opacityExit=le(t.opacity??1,0,qh(n))):r&&(e.opacity=le(t.opacity??1,s.opacity??1,n));for(let o=0;o<Kh;o++){const l=$a[o];let d=Vo(t,l),h=Vo(s,l);if(d===void 0&&h===void 0)continue;d||(d=0),h||(h=0),d===0||h===0||Ro(d)===Ro(h)?(e[l]=Math.max(le(Ao(d),Ao(h),n),0),(Ze.test(h)||Ze.test(d))&&(e[l]+="%")):e[l]=h}(t.rotate||s.rotate)&&(e.rotate=le(t.rotate||0,s.rotate||0,n))}function Vo(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Zh=za(0,.5,Er),qh=za(.5,.95,Be);function za(e,t,s){return n=>n<e?0:n>t?1:s(Yt(e,t,n))}function Jh(e,t,s){const n=Ce(e)?e:Vt(e);return n.start(ei("",n,t,s)),n.animation}function Xt(e,t,s,n={passive:!0}){return e.addEventListener(t,s,n),()=>e.removeEventListener(t,s)}const Qh=(e,t)=>e.depth-t.depth;class ef{constructor(){this.children=[],this.isDirty=!1}add(t){_n(this.children,t),this.isDirty=!0}remove(t){vs(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Qh),this.isDirty=!1,this.children.forEach(t)}}function tf(e,t){const s=Ae.now(),n=({timestamp:i})=>{const r=i-s;r>=t&&(ht(n),e(r-t))};return ce.setup(n,!0),()=>ht(n)}function xs(e){return Ce(e)?e.get():e}class sf{constructor(){this.members=[]}add(t){_n(this.members,t);for(let s=this.members.length-1;s>=0;s--){const n=this.members[s];if(n===t||n===this.lead||n===this.prevLead)continue;const i=n.instance;(!i||i.isConnected===!1)&&!n.snapshot&&(vs(this.members,n),n.unmount())}t.scheduleRender()}remove(t){if(vs(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(t){for(let s=this.members.indexOf(t)-1;s>=0;s--){const n=this.members[s];if(n.isPresent!==!1&&n.instance?.isConnected!==!1)return this.promote(n),!0}return!1}promote(t,s){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=n.options,{layoutDependency:r}=t.options;(i===void 0||i!==r)&&(t.resumeFrom=n,s&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const gs={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Js=["","X","Y","Z"],nf=1e3;let of=0;function Qs(e,t,s,n){const{latestValues:i}=t;i[e]&&(s[e]=i[e],t.setStaticValue(e,0),n&&(n[e]=0))}function Oa(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const s=aa(t);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:i,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",ce,!(i||r))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&Oa(n)}function _a({attachResizeListener:e,defaultParent:t,measureScroll:s,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o={},l=t?.()){this.id=of++,this.animationId=0,this.animationCommitId=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.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(lf),this.nodes.forEach(mf),this.nodes.forEach(pf),this.nodes.forEach(cf)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let d=0;d<this.path.length;d++)this.path[d].shouldResetTransform=!0;this.root===this&&(this.nodes=new ef)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Bn),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const d=this.eventHandlers.get(o);d&&d.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=oi(o)&&!rh(o),this.instance=o;const{layoutId:l,layout:d,visualElement:h}=this.options;if(h&&!h.current&&h.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(d||l)&&(this.isLayoutDirty=!0),e){let c,u=0;const m=()=>this.root.updateBlockedByResize=!1;ce.read(()=>{u=window.innerWidth}),e(o,()=>{const p=window.innerWidth;p!==u&&(u=p,this.root.updateBlockedByResize=!0,c&&c(),c=tf(m,250),gs.hasAnimatedSinceResize&&(gs.hasAnimatedSinceResize=!1,this.nodes.forEach(Io)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&h&&(l||d)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u,hasRelativeLayoutChanged:m,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||h.getDefaultTransition()||vf,{onLayoutAnimationStart:v,onLayoutAnimationComplete:k}=h.getProps(),T=!this.targetLayout||!Fa(this.targetLayout,p),b=!u&&m;if(this.options.layoutRoot||this.resumeFrom||b||u&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...Qn(x,"layout"),onPlay:v,onComplete:k};(h.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(c,b,w.path)}else u||Io(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ht(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.forEach(xf),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Oa(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const u=this.path[c];u.shouldResetTransform=!0,(typeof u.latestValues.x=="string"||typeof u.latestValues.y=="string")&&(u.isLayoutDirty=!0),u.updateScroll("snapshot"),u.options.layoutRoot&&u.willUpdate(!1)}const{layoutId:l,layout:d}=this.options;if(l===void 0&&!d)return;const h=this.getTransformTemplate();this.prevTransformTemplateValue=h?h(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const d=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),d&&this.nodes.forEach(uf),this.nodes.forEach(Do);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Lo);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(hf),this.nodes.forEach(ff),this.nodes.forEach(rf),this.nodes.forEach(af)):this.nodes.forEach(Lo),this.clearAllSnapshots();const l=Ae.now();Te.delta=qe(0,1e3/60,l-Te.timestamp),Te.timestamp=l,Te.isProcessing=!0,Us.update.process(Te),Us.preRender.process(Te),Us.render.process(Te),Te.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ni.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(df),this.sharedNodes.forEach(gf)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ce.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ce.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Re(this.snapshot.measuredBox.x)&&!Re(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let d=0;d<this.path.length;d++)this.path[d].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Se()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const d=n(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:d,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:d}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!Ia(this.projectionDelta),d=this.getTransformTemplate(),h=d?d(this.latestValues,""):void 0,c=h!==this.prevTransformTemplateValue;o&&this.instance&&(l||yt(this.latestValues)||c)&&(i(this.instance,h),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let d=this.removeElementScroll(l);return o&&(d=this.removeTransform(d)),wf(d),{animationId:this.root.animationId,measuredBox:l,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return Se();const l=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(kf))){const{scroll:h}=this.root;h&&(Xe(l.x,h.offset.x),Xe(l.y,h.offset.y))}return l}removeElementScroll(o){const l=Se();if(He(l,o),this.scroll?.wasRoot)return l;for(let d=0;d<this.path.length;d++){const h=this.path[d],{scroll:c,options:u}=h;h!==this.root&&c&&u.layoutScroll&&(c.wasRoot&&He(l,o),Xe(l.x,c.offset.x),Xe(l.y,c.offset.y))}return l}applyTransform(o,l=!1,d){const h=d||Se();He(h,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];!l&&u.options.layoutScroll&&u.scroll&&u!==u.root&&(Xe(h.x,-u.scroll.offset.x),Xe(h.y,-u.scroll.offset.y)),yt(u.latestValues)&&ps(h,u.latestValues,u.layout?.layoutBox)}return yt(this.latestValues)&&ps(h,this.latestValues,this.layout?.layoutBox),h}removeTransform(o){const l=Se();He(l,o);for(let d=0;d<this.path.length;d++){const h=this.path[d];if(!yt(h.latestValues))continue;let c;h.instance&&(Vn(h.latestValues)&&h.updateSnapshot(),c=Se(),He(c,h.measurePageBox())),No(l,h.latestValues,h.snapshot?.layoutBox,c)}return yt(this.latestValues)&&No(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}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!==Te.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const d=!!this.resumingFrom||this!==l;if(!(o||d&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:u}=this.options;if(!this.layout||!(c||u))return;this.resolvedRelativeTargetAt=Te.timestamp;const m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Se(),this.targetWithTransforms=Se()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Bh(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):He(this.target,this.layout.layoutBox),ja(this.target,this.targetDelta)):He(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Vn(this.parent.latestValues)||Sa(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,l,d){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Se(),this.relativeTargetOrigin=Se(),Ms(this.relativeTargetOrigin,l,d,this.options.layoutAnchor||void 0),He(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const o=this.getLead(),l=!!this.resumingFrom||this!==o;let d=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(d=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(d=!1),this.resolvedRelativeTargetAt===Te.timestamp&&(d=!1),d)return;const{layout:h,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(h||c))return;He(this.layoutCorrected,this.layout.layoutBox);const u=this.treeScale.x,m=this.treeScale.y;gh(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Se());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(bo(this.prevProjectionDelta.x,this.projectionDelta.x),bo(this.prevProjectionDelta.y,this.projectionDelta.y)),Ut(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==u||this.treeScale.y!==m||!Eo(this.projectionDelta.x,this.prevProjectionDelta.x)||!Eo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Et(),this.projectionDelta=Et(),this.projectionDeltaWithTransform=Et()}setAnimationOrigin(o,l=!1,d){const h=this.snapshot,c=h?h.latestValues:{},u={...this.latestValues},m=Et();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const p=Se(),x=h?h.source:void 0,v=this.layout?this.layout.source:void 0,k=x!==v,T=this.getStack(),b=!T||T.members.length<=1,w=!!(k&&!b&&this.options.crossfade===!0&&!this.path.some(bf));this.animationProgress=0;let C;const I=d?.interpolateProjection(o);this.mixTargetDelta=M=>{const F=M/1e3,P=I?.(F);P?(m.x.translate=P.x,m.x.scale=le(o.x.scale,1,F),m.x.origin=o.x.origin,m.x.originPoint=o.x.originPoint,m.y.translate=P.y,m.y.scale=le(o.y.scale,1,F),m.y.origin=o.y.origin,m.y.originPoint=o.y.originPoint):(Fo(m.x,o.x,F),Fo(m.y,o.y,F)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ms(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),yf(this.relativeTarget,this.relativeTargetOrigin,p,F),C&&Yh(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=Se()),He(C,this.relativeTarget)),k&&(this.animationValues=u,Xh(u,c,this.latestValues,F,w,b)),P&&P.rotate!==void 0&&(this.animationValues||(this.animationValues=u),this.animationValues.pathRotation=P.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=F},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(ht(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ce.update(()=>{gs.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Vt(0)),this.motionValue.jump(0,!1),this.currentAnimation=Jh(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.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);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(nf),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:d,layout:h,latestValues:c}=o;if(!(!l||!d||!h)){if(this!==o&&this.layout&&h&&Ba(this.options.animationType,this.layout.layoutBox,h.layoutBox)){d=this.target||Se();const u=Re(this.layout.layoutBox.x);d.x.min=o.target.x.min,d.x.max=d.x.min+u;const m=Re(this.layout.layoutBox.y);d.y.min=o.target.y.min,d.y.max=d.y.min+m}He(l,d),ps(l,c),Ut(this.projectionDeltaWithTransform,this.layoutCorrected,l,c)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new sf),this.sharedNodes.get(o).add(l);const h=l.options.initialPromotionConfig;l.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:d}={}){const h=this.getStack();h&&h.promote(this,d),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:d}=o;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(l=!0),!l)return;const h={};d.z&&Qs("z",o,h,this.animationValues);for(let c=0;c<Js.length;c++)Qs(`rotate${Js[c]}`,o,h,this.animationValues),Qs(`skew${Js[c]}`,o,h,this.animationValues);o.render();for(const c in h)o.setStaticValue(c,h[c]),this.animationValues&&(this.animationValues[c]=h[c]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const d=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=xs(l?.pointerEvents)||"",o.transform=d?d(this.latestValues,""):"none";return}const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=xs(l?.pointerEvents)||""),this.hasProjected&&!yt(this.latestValues)&&(o.transform=d?d({},""):"none",this.hasProjected=!1);return}o.visibility="";const c=h.animationValues||h.latestValues;this.applyTransformsToTarget();let u=Gh(this.projectionDeltaWithTransform,this.treeScale,c);d&&(u=d(c,u)),o.transform=u;const{x:m,y:p}=this.projectionDelta;o.transformOrigin=`${m.origin*100}% ${p.origin*100}% 0`,h.animationValues?o.opacity=h===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:o.opacity=h===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const x in Ln){if(c[x]===void 0)continue;const{correct:v,applyTo:k,isCSSVariable:T}=Ln[x],b=u==="none"?c[x]:v(c[x],h);if(k){const w=k.length;for(let C=0;C<w;C++)o[k[C]]=b}else T?this.options.visualElement.renderState.vars[x]=b:o[x]=b}this.options.layoutId&&(o.pointerEvents=h===this?xs(l?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(Do),this.root.sharedNodes.clear()}}}function rf(e){e.updateLayout()}function af(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:n}=e.layout,{animationType:i}=e.options,r=t.source!==e.layout.source;if(i==="size")Ke(c=>{const u=r?t.measuredBox[c]:t.layoutBox[c],m=Re(u);u.min=s[c].min,u.max=u.min+m});else if(i==="x"||i==="y"){const c=i==="x"?"y":"x";In(r?t.measuredBox[c]:t.layoutBox[c],s[c])}else Ba(i,t.layoutBox,s)&&Ke(c=>{const u=r?t.measuredBox[c]:t.layoutBox[c],m=Re(s[c]);u.max=u.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[c].max=e.relativeTarget[c].min+m)});const o=Et();Ut(o,s,t.layoutBox);const l=Et();r?Ut(l,e.applyTransform(n,!0),t.measuredBox):Ut(l,s,t.layoutBox);const d=!Ia(o);let h=!1;if(!e.resumeFrom){const c=e.getClosestProjectingParent();if(c&&!c.resumeFrom){const{snapshot:u,layout:m}=c;if(u&&m){const p=e.options.layoutAnchor||void 0,x=Se();Ms(x,t.layoutBox,u.layoutBox,p);const v=Se();Ms(v,s,m.layoutBox,p),Fa(x,v)||(h=!0),c.options.layoutRoot&&(e.relativeTarget=v,e.relativeTargetOrigin=x,e.relativeParent=c)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:t,delta:l,layoutDelta:o,hasLayoutChanged:d,hasRelativeLayoutChanged:h})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function lf(e){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 cf(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function df(e){e.clearSnapshot()}function Do(e){e.clearMeasurements()}function uf(e){e.isLayoutDirty=!0,e.updateLayout()}function Lo(e){e.isLayoutDirty=!1}function hf(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function ff(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Io(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function mf(e){e.resolveTargetDelta()}function pf(e){e.calcProjection()}function xf(e){e.resetSkewAndRotation()}function gf(e){e.removeLeadSnapshot()}function Fo(e,t,s){e.translate=le(t.translate,0,s),e.scale=le(t.scale,1,s),e.origin=t.origin,e.originPoint=t.originPoint}function $o(e,t,s,n){e.min=le(t.min,s.min,n),e.max=le(t.max,s.max,n)}function yf(e,t,s,n){$o(e.x,t.x,s.x,n),$o(e.y,t.y,s.y,n)}function bf(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const vf={duration:.45,ease:[.4,0,.1,1]},zo=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Oo=zo("applewebkit/")&&!zo("chrome/")?Math.round:Be;function _o(e){e.min=Oo(e.min),e.max=Oo(e.max)}function wf(e){_o(e.x),_o(e.y)}function Ba(e,t,s){return e==="position"||e==="preserve-aspect"&&!_h(Po(t),Po(s),.2)}function kf(e){return e!==e.root&&e.scroll?.wasRoot}const Sf=_a({attachResizeListener:(e,t)=>Xt(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),en={current:void 0},Wa=_a({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!en.current){const e=new Sf({});e.mount(window),e.setOptions({layoutScroll:!0}),en.current=e}return en.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),di=y.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Bo(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function jf(...e){return t=>{let s=!1;const n=e.map(i=>{const r=Bo(i,t);return!s&&typeof r=="function"&&(s=!0),r});if(s)return()=>{for(let i=0;i<n.length;i++){const r=n[i];typeof r=="function"?r():Bo(e[i],null)}}}}function Nf(...e){return Es.useCallback(jf(...e),e)}class Tf extends Es.Component{getSnapshotBeforeUpdate(t){const s=this.props.childRef.current;if(ds(s)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const n=s.offsetParent,i=ds(n)&&n.offsetWidth||0,r=ds(n)&&n.offsetHeight||0,o=getComputedStyle(s),l=this.props.sizeRef.current;l.height=parseFloat(o.height),l.width=parseFloat(o.width),l.top=s.offsetTop,l.left=s.offsetLeft,l.right=i-l.width-l.left,l.bottom=r-l.height-l.top,l.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function Cf({children:e,isPresent:t,anchorX:s,anchorY:n,root:i,pop:r}){const o=y.useId(),l=y.useRef(null),d=y.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:h}=y.useContext(di),c=e.props?.ref??e?.ref,u=Nf(l,c);return y.useInsertionEffect(()=>{const{width:m,height:p,top:x,left:v,right:k,bottom:T,direction:b}=d.current;if(t||r===!1||!l.current||!m||!p)return;const w=b==="rtl",C=s==="left"?w?`right: ${k}`:`left: ${v}`:w?`left: ${v}`:`right: ${k}`,I=n==="bottom"?`bottom: ${T}`:`top: ${x}`;l.current.dataset.motionPopId=o;const M=document.createElement("style");h&&(M.nonce=h);const F=i??document.head;return F.appendChild(M),M.sheet&&M.sheet.insertRule(`
|
|
7
|
+
[data-motion-pop-id="${o}"] {
|
|
8
|
+
position: absolute !important;
|
|
9
|
+
width: ${m}px !important;
|
|
10
|
+
height: ${p}px !important;
|
|
11
|
+
${C}px !important;
|
|
12
|
+
${I}px !important;
|
|
13
|
+
}
|
|
14
|
+
`),()=>{l.current?.removeAttribute("data-motion-pop-id"),F.contains(M)&&F.removeChild(M)}},[t]),a.jsx(Tf,{isPresent:t,childRef:l,sizeRef:d,pop:r,children:r===!1?e:Es.cloneElement(e,{ref:u})})}const Mf=({children:e,initial:t,isPresent:s,onExitComplete:n,custom:i,presenceAffectsLayout:r,mode:o,anchorX:l,anchorY:d,root:h})=>{const c=On(Pf),u=y.useId();let m=!0,p=y.useMemo(()=>(m=!1,{id:u,initial:t,isPresent:s,custom:i,onExitComplete:x=>{c.set(x,!0);for(const v of c.values())if(!v)return;n&&n()},register:x=>(c.set(x,!1),()=>c.delete(x))}),[s,c,n]);return r&&m&&(p={...p}),y.useMemo(()=>{c.forEach((x,v)=>c.set(v,!1))},[s]),Es.useEffect(()=>{!s&&!c.size&&n&&n()},[s]),e=a.jsx(Cf,{pop:o==="popLayout",isPresent:s,anchorX:l,anchorY:d,root:h,children:e}),a.jsx(As.Provider,{value:p,children:e})};function Pf(){return new Map}function Ua(e=!0){const t=y.useContext(As);if(t===null)return[!0,null];const{isPresent:s,onExitComplete:n,register:i}=t,r=y.useId();y.useEffect(()=>{if(e)return i(r)},[e]);const o=y.useCallback(()=>e&&n&&n(r),[r,n,e]);return!s&&n?[!1,o]:[!0]}const rs=e=>e.key||"";function Wo(e){const t=[];return y.Children.forEach(e,s=>{y.isValidElement(s)&&t.push(s)}),t}const Ef=({children:e,custom:t,initial:s=!0,onExitComplete:n,presenceAffectsLayout:i=!0,mode:r="sync",propagate:o=!1,anchorX:l="left",anchorY:d="top",root:h})=>{const[c,u]=Ua(o),m=y.useMemo(()=>Wo(e),[e]),p=o&&!c?[]:m.map(rs),x=y.useRef(!0),v=y.useRef(m),k=On(()=>new Map),T=y.useRef(new Set),[b,w]=y.useState(m),[C,I]=y.useState(m);yr(()=>{x.current=!1,v.current=m;for(let P=0;P<C.length;P++){const j=rs(C[P]);p.includes(j)?(k.delete(j),T.current.delete(j)):k.get(j)!==!0&&k.set(j,!1)}},[C,p.length,p.join("-")]);const M=[];if(m!==b){let P=[...m];for(let j=0;j<C.length;j++){const N=C[j],D=rs(N);p.includes(D)||(P.splice(j,0,N),M.push(N))}return r==="wait"&&M.length&&(P=M),I(Wo(P)),w(m),null}process.env.NODE_ENV!=="production"&&r==="wait"&&C.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:F}=y.useContext(zn);return a.jsx(a.Fragment,{children:C.map(P=>{const j=rs(P),N=o&&!c?!1:m===C||p.includes(j),D=()=>{if(T.current.has(j))return;if(k.has(j))T.current.add(j),k.set(j,!0);else return;let $=!0;k.forEach(_=>{_||($=!1)}),$&&(F?.(),I(v.current),o&&u?.(),n&&n())};return a.jsx(Mf,{isPresent:N,initial:!x.current||s?void 0:!1,custom:t,presenceAffectsLayout:i,mode:r,root:h,onExitComplete:N?void 0:D,anchorX:l,anchorY:d,children:P},j)})})},Ha=y.createContext({strict:!1}),Uo={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"]};let Ho=!1;function Af(){if(Ho)return;const e={};for(const t in Uo)e[t]={isEnabled:s=>Uo[t].some(n=>!!s[n])};va(e),Ho=!0}function Ya(){return Af(),fh()}function Rf(e){const t=Ya();for(const s in e)t[s]={...t[s],...e[s]};va(t)}const Vf=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","propagate","ignoreStrict","viewport"]);function Ps(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Vf.has(e)}let Ga=e=>!Ps(e);function Df(e){typeof e=="function"&&(Ga=t=>t.startsWith("on")?!Ps(t):e(t))}try{Df(require("@emotion/is-prop-valid").default)}catch{}function Lf(e,t,s){const n={};for(const i in e)i==="values"&&typeof e.values=="object"||Ce(e[i])||(Ga(i)||s===!0&&Ps(i)||!t&&!Ps(i)||e.draggable&&i.startsWith("onDrag"))&&(n[i]=e[i]);return n}const Ls=y.createContext({});function If(e,t){if(Ds(e)){const{initial:s,animate:n}=e;return{initial:s===!1||Kt(s)?s:void 0,animate:Kt(n)?n:void 0}}return e.inherit!==!1?t:{}}function Ff(e){const{initial:t,animate:s}=If(e,y.useContext(Ls));return y.useMemo(()=>({initial:t,animate:s}),[Yo(t),Yo(s)])}function Yo(e){return Array.isArray(e)?e.join(" "):e}const ui=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ka(e,t,s){for(const n in t)!Ce(t[n])&&!Ca(n,s)&&(e[n]=t[n])}function $f({transformTemplate:e},t){return y.useMemo(()=>{const s=ui();return li(s,t,e),Object.assign({},s.vars,s.style)},[t])}function zf(e,t){const s=e.style||{},n={};return Ka(n,s,e),Object.assign(n,$f(e,t)),n}function Of(e,t){const s={},n=zf(e,t);return e.drag&&e.dragListener!==!1&&(s.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(s.tabIndex=0),s.style=n,s}const Xa=()=>({...ui(),attrs:{}});function _f(e,t,s,n){const i=y.useMemo(()=>{const r=Xa();return Ma(r,t,Ea(n),e.transformTemplate,e.style),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};Ka(r,e.style,e),i.style={...r,...i.style}}return i}const Bf=["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 hi(e){return typeof e!="string"||e.includes("-")?!1:!!(Bf.indexOf(e)>-1||/[A-Z]/u.test(e))}function Wf(e,t,s,{latestValues:n},i,r=!1,o){const d=(o??hi(e)?_f:Of)(t,n,i,e),h=Lf(t,typeof e=="string",r),c=e!==y.Fragment?{...h,...d,ref:s}:{},{children:u}=t,m=y.useMemo(()=>Ce(u)?u.get():u,[u]);return y.createElement(e,{...c,children:m})}function Uf({scrapeMotionValuesFromProps:e,createRenderState:t},s,n,i){return{latestValues:Hf(s,n,i,e),renderState:t()}}function Hf(e,t,s,n){const i={},r=n(e,{});for(const m in r)i[m]=xs(r[m]);let{initial:o,animate:l}=e;const d=Ds(e),h=ya(e);t&&h&&!d&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let c=s?s.initial===!1:!1;c=c||o===!1;const u=c?l:o;if(u&&typeof u!="boolean"&&!Vs(u)){const m=Array.isArray(u)?u:[u];for(let p=0;p<m.length;p++){const x=ti(e,m[p]);if(x){const{transitionEnd:v,transition:k,...T}=x;for(const b in T){let w=T[b];if(Array.isArray(w)){const C=c?w.length-1:0;w=w[C]}w!==null&&(i[b]=w)}for(const b in v)i[b]=v[b]}}}return i}const Za=e=>(t,s)=>{const n=y.useContext(Ls),i=y.useContext(As),r=()=>Uf(e,t,n,i);return s?r():On(r)},Yf=Za({scrapeMotionValuesFromProps:ci,createRenderState:ui}),Gf=Za({scrapeMotionValuesFromProps:Aa,createRenderState:Xa}),Kf=Symbol.for("motionComponentSymbol");function Xf(e,t,s){const n=y.useRef(s);y.useInsertionEffect(()=>{n.current=s});const i=y.useRef(null);return y.useCallback(r=>{r&&e.onMount?.(r),t&&(r?t.mount(r):t.unmount());const o=n.current;if(typeof o=="function")if(r){const l=o(r);typeof l=="function"&&(i.current=l)}else i.current?(i.current(),i.current=null):o(r);else o&&(o.current=r)},[t])}const qa=y.createContext({});function Nt(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Zf(e,t,s,n,i,r){const{visualElement:o}=y.useContext(Ls),l=y.useContext(Ha),d=y.useContext(As),h=y.useContext(di),c=h.reducedMotion,u=h.skipAnimations,m=y.useRef(null),p=y.useRef(!1);n=n||l.renderer,!m.current&&n&&(m.current=n(e,{visualState:t,parent:o,props:s,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:c,skipAnimations:u,isSVG:r}),p.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const x=m.current,v=y.useContext(qa);x&&!x.projection&&i&&(x.type==="html"||x.type==="svg")&&qf(m.current,s,i,v);const k=y.useRef(!1);y.useInsertionEffect(()=>{x&&k.current&&x.update(s,d)});const T=s[ra],b=y.useRef(!!T&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(T)&&window.MotionHasOptimisedAnimation?.(T));return yr(()=>{p.current=!0,x&&(k.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),b.current&&x.animationState&&x.animationState.animateChanges())}),y.useEffect(()=>{x&&(!b.current&&x.animationState&&x.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(T)}),b.current=!1),x.enteringChildren=void 0)}),x}function qf(e,t,s,n){const{layoutId:i,layout:r,drag:o,dragConstraints:l,layoutScroll:d,layoutRoot:h,layoutAnchor:c,layoutCrossfade:u}=t;e.projection=new s(e.latestValues,t["data-framer-portal-id"]?void 0:Ja(e.parent)),e.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||l&&Nt(l),visualElement:e,animationType:typeof r=="string"?r:"both",initialPromotionConfig:n,crossfade:u,layoutScroll:d,layoutRoot:h,layoutAnchor:c})}function Ja(e){if(e)return e.options.allowProjection!==!1?e.projection:Ja(e.parent)}function tn(e,{forwardMotionProps:t=!1,type:s}={},n,i){n&&Rf(n);const r=s?s==="svg":hi(e),o=r?Gf:Yf;function l(h,c){let u;const m={...y.useContext(di),...h,layoutId:Jf(h)},{isStatic:p}=m,x=Ff(h),v=o(h,p);if(!p&&typeof window<"u"){Qf(m,n);const k=em(m);u=k.MeasureLayout,x.visualElement=Zf(e,v,m,i,k.ProjectionNode,r)}return a.jsxs(Ls.Provider,{value:x,children:[u&&x.visualElement?a.jsx(u,{visualElement:x.visualElement,...m}):null,Wf(e,h,Xf(v,x.visualElement,c),v,p,t,r)]})}l.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const d=y.forwardRef(l);return d[Kf]=e,d}function Jf({layoutId:e}){const t=y.useContext(zn).id;return t&&e!==void 0?t+"-"+e:e}function Qf(e,t){const s=y.useContext(Ha).strict;if(process.env.NODE_ENV!=="production"&&t&&s){const n="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Dt(!1,n,"lazy-strict-mode"):st(!1,n,"lazy-strict-mode")}}function em(e){const t=Ya(),{drag:s,layout:n}=t;if(!s&&!n)return{};const i={...s,...n};return{MeasureLayout:s?.isEnabled(e)||n?.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function tm(e,t){if(typeof Proxy>"u")return tn;const s=new Map,n=(r,o)=>tn(r,o,e,t),i=(r,o)=>(process.env.NODE_ENV!=="production"&&Wn(!1,"motion() is deprecated. Use motion.create() instead."),n(r,o));return new Proxy(i,{get:(r,o)=>o==="create"?n:(s.has(o)||s.set(o,tn(o,void 0,e,t)),s.get(o))})}const sm=(e,t)=>t.isSVG??hi(e)?new Eh(t):new jh(t,{allowProjection:e!==y.Fragment});class nm extends ft{constructor(t){super(t),t.animationState||(t.animationState=Lh(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Vs(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:s}=this.node.prevProps||{};t!==s&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let im=0;class om extends ft{constructor(){super(...arguments),this.id=im++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:s}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;if(t&&n===!1){if(this.isExitComplete){const{initial:r,custom:o}=this.node.getProps();if(typeof r=="string"||typeof r=="object"&&r!==null&&!Array.isArray(r)){const l=St(this.node,r,o);if(l){const{transition:d,transitionEnd:h,...c}=l;for(const u in c)this.node.getValue(u)?.jump(c[u])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const i=this.node.animationState.setActive("exit",!t);s&&!t&&i.then(()=>{this.isExitComplete=!0,s(this.id)})}mount(){const{register:t,onExitComplete:s}=this.node.presenceContext||{};s&&s(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const rm={animation:{Feature:nm},exit:{Feature:om}};function Qt(e){return{point:{x:e.pageX,y:e.pageY}}}const am=e=>t=>ii(t)&&e(t,Qt(t));function Ht(e,t,s,n){return Xt(e,t,am(s),n)}const Qa=({current:e})=>e?e.ownerDocument.defaultView:null,Go=(e,t)=>Math.abs(e-t);function lm(e,t){const s=Go(e.x,t.x),n=Go(e.y,t.y);return Math.sqrt(s**2+n**2)}const Ko=new Set(["auto","scroll"]);class el{constructor(t,s,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:o=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=as(this.lastRawMoveEventInfo,this.transformPagePoint));const p=sn(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,v=lm(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!v)return;const{point:k}=p,{timestamp:T}=Te;this.history.push({...k,timestamp:T});const{onStart:b,onMove:w}=this.handlers;x||(b&&b(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,p)},this.handlePointerMove=(p,x)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=x,this.lastMoveEventInfo=as(x,this.transformPagePoint),ce.update(this.updatePoint,!0)},this.handlePointerUp=(p,x)=>{this.end();const{onEnd:v,onSessionEnd:k,resumeAnimation:T}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&T&&T(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=sn(p.type==="pointercancel"?this.lastMoveEventInfo:as(x,this.transformPagePoint),this.history);this.startEvent&&v&&v(p,b),k&&k(p,b)},!ii(t))return;this.dragSnapToOrigin=r,this.handlers=s,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=i||window;const d=Qt(t),h=as(d,this.transformPagePoint),{point:c}=h,{timestamp:u}=Te;this.history=[{...c,timestamp:u}];const{onSessionStart:m}=s;m&&m(t,sn(h,this.history)),this.removeListeners=Zt(Ht(this.contextWindow,"pointermove",this.handlePointerMove),Ht(this.contextWindow,"pointerup",this.handlePointerUp),Ht(this.contextWindow,"pointercancel",this.handlePointerUp)),l&&this.startScrollTracking(l)}startScrollTracking(t){let s=t.parentElement;for(;s;){const n=getComputedStyle(s);(Ko.has(n.overflowX)||Ko.has(n.overflowY))&&this.scrollPositions.set(s,{x:s.scrollLeft,y:s.scrollTop}),s=s.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const s=this.scrollPositions.get(t);if(!s)return;const n=t===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},r={x:i.x-s.x,y:i.y-s.y};r.x===0&&r.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=r.x,this.lastMoveEventInfo.point.y+=r.y):this.history.length>0&&(this.history[0].x-=r.x,this.history[0].y-=r.y),this.scrollPositions.set(t,i),ce.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ht(this.updatePoint)}}function as(e,t){return t?{point:t(e.point)}:e}function Xo(e,t){return{x:e.x-t.x,y:e.y-t.y}}function sn({point:e},t){return{point:e,delta:Xo(e,tl(t)),offset:Xo(e,cm(t)),velocity:dm(t,.1)}}function cm(e){return e[0]}function tl(e){return e[e.length-1]}function dm(e,t){if(e.length<2)return{x:0,y:0};let s=e.length-1,n=null;const i=tl(e);for(;s>=0&&(n=e[s],!(i.timestamp-n.timestamp>Ie(t)));)s--;if(!n)return{x:0,y:0};n===e[0]&&e.length>2&&i.timestamp-n.timestamp>Ie(t)*2&&(n=e[1]);const r=_e(i.timestamp-n.timestamp);if(r===0)return{x:0,y:0};const o={x:(i.x-n.x)/r,y:(i.y-n.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function um(e,{min:t,max:s},n){return t!==void 0&&e<t?e=n?le(t,e,n.min):Math.max(e,t):s!==void 0&&e>s&&(e=n?le(s,e,n.max):Math.min(e,s)),e}function Zo(e,t,s){return{min:t!==void 0?e.min+t:void 0,max:s!==void 0?e.max+s-(e.max-e.min):void 0}}function hm(e,{top:t,left:s,bottom:n,right:i}){return{x:Zo(e.x,s,i),y:Zo(e.y,t,n)}}function qo(e,t){let s=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([s,n]=[n,s]),{min:s,max:n}}function fm(e,t){return{x:qo(e.x,t.x),y:qo(e.y,t.y)}}function mm(e,t){let s=.5;const n=Re(e),i=Re(t);return i>n?s=Yt(t.min,t.max-n,e.min):n>i&&(s=Yt(e.min,e.max-i,t.min)),qe(0,1,s)}function pm(e,t){const s={};return t.min!==void 0&&(s.min=t.min-e.min),t.max!==void 0&&(s.max=t.max-e.min),s}const Fn=.35;function xm(e=Fn){return e===!1?e=0:e===!0&&(e=Fn),{x:Jo(e,"left","right"),y:Jo(e,"top","bottom")}}function Jo(e,t,s){return{min:Qo(e,t),max:Qo(e,s)}}function Qo(e,t){return typeof e=="number"?e:e[t]||0}const gm=new WeakMap;class ym{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Se(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:s=!1,distanceThreshold:n}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=u=>{s&&this.snapToCursor(Qt(u).point),this.stopAnimation()},o=(u,m)=>{const{drag:p,dragPropagation:x,onDragStart:v}=this.getProps();if(p&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Wu(p),!this.openDragLock))return;this.latestPointerEvent=u,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ke(T=>{let b=this.getAxisMotionValue(T).get()||0;if(Ze.test(b)){const{projection:w}=this.visualElement;if(w&&w.layout){const C=w.layout.layoutBox[T];C&&(b=Re(C)*(parseFloat(b)/100))}}this.originPoint[T]=b}),v&&ce.update(()=>v(u,m),!1,!0),Cn(this.visualElement,"transform");const{animationState:k}=this.visualElement;k&&k.setActive("whileDrag",!0)},l=(u,m)=>{this.latestPointerEvent=u,this.latestPanInfo=m;const{dragPropagation:p,dragDirectionLock:x,onDirectionLock:v,onDrag:k}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:T}=m;if(x&&this.currentDirection===null){this.currentDirection=vm(T),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",m.point,T),this.updateAxis("y",m.point,T),this.visualElement.render(),k&&ce.update(()=>k(u,m),!1,!0)},d=(u,m)=>{this.latestPointerEvent=u,this.latestPanInfo=m,this.stop(u,m),this.latestPointerEvent=null,this.latestPanInfo=null},h=()=>{const{dragSnapToOrigin:u}=this.getProps();(u||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new el(t,{onSessionStart:r,onStart:o,onMove:l,onSessionEnd:d,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:n,contextWindow:Qa(this.visualElement),element:this.visualElement.current})}stop(t,s){const n=t||this.latestPointerEvent,i=s||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!n)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&ce.postRender(()=>l(n,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:s}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,s,n){const{drag:i}=this.getProps();if(!n||!ls(t,i,this.currentDirection))return;const r=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=um(o,this.constraints[t],this.elastic[t])),r.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:s}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&Nt(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=hm(n.layoutBox,t):this.constraints=!1,this.elastic=xm(s),i!==this.constraints&&!Nt(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&Ke(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=pm(n.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!Nt(t))return!1;const n=t.current;st(n!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());const r=yh(n,i.root,this.visualElement.getTransformPagePoint());let o=fm(i.layout.layoutBox,r);if(s){const l=s(ph(o));this.hasMutatedConstraints=!!l,l&&(o=ka(l))}return o}startAnimation(t){const{drag:s,dragMomentum:n,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),d=this.constraints||{},h=Ke(c=>{if(!ls(c,s,this.currentDirection))return;let u=d&&d[c]||{};(o===!0||o===c)&&(u={min:0,max:0});const m=i?200:1e6,p=i?40:1e7,x={type:"inertia",velocity:n?t[c]:0,bounceStiffness:m,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...r,...u};return this.startAxisValueAnimation(c,x)});return Promise.all(h).then(l)}startAxisValueAnimation(t,s){const n=this.getAxisMotionValue(t);return Cn(this.visualElement,t),n.start(ei(t,n,0,s,this.visualElement,!1))}stopAnimation(){Ke(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const s=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps()[s];return i||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){Ke(s=>{const{drag:n}=this.getProps();if(!ls(s,n,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(s);if(i&&i.layout){const{min:o,max:l}=i.layout.layoutBox[s],d=r.get()||0;r.set(t[s]-le(o,l,.5)+d)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:s}=this.getProps(),{projection:n}=this.visualElement;if(!Nt(s)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ke(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const d=l.get();i[o]=mm({min:d,max:d},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ke(o=>{if(!ls(o,t,null))return;const l=this.getAxisMotionValue(o),{min:d,max:h}=this.constraints[o];l.set(le(d,h,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;gm.set(this.visualElement,this);const t=this.visualElement.current,s=Ht(t,"pointerdown",h=>{const{drag:c,dragListener:u=!0}=this.getProps(),m=h.target,p=m!==t&&Xu(m);c&&u&&!p&&this.start(h)});let n;const i=()=>{const{dragConstraints:h}=this.getProps();Nt(h)&&h.current&&(this.constraints=this.resolveRefConstraints(),n||(n=bm(t,h.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,o=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),ce.read(i);const l=Xt(window,"resize",()=>this.scalePositionWithinConstraints()),d=r.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:c})=>{this.isDragging&&c&&(Ke(u=>{const m=this.getAxisMotionValue(u);m&&(this.originPoint[u]+=h[u].translate,m.set(m.get()+h[u].translate))}),this.visualElement.render())}));return()=>{l(),s(),o(),d&&d(),n&&n()}}getProps(){const t=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=Fn,dragMomentum:l=!0}=t;return{...t,drag:s,dragDirectionLock:n,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:l}}}function er(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function bm(e,t,s){const n=ro(e,er(s)),i=ro(t,er(s));return()=>{n(),i()}}function ls(e,t,s){return(t===!0||t===e)&&(s===null||s===e)}function vm(e,t=10){let s=null;return Math.abs(e.y)>t?s="y":Math.abs(e.x)>t&&(s="x"),s}class wm extends ft{constructor(t){super(t),this.removeGroupControls=Be,this.removeListeners=Be,this.controls=new ym(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Be}update(){const{dragControls:t}=this.node.getProps(),{dragControls:s}=this.node.prevProps||{};t!==s&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const nn=e=>(t,s)=>{e&&ce.update(()=>e(t,s),!1,!0)};class km extends ft{constructor(){super(...arguments),this.removePointerDownListener=Be}onPointerDown(t){this.session=new el(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Qa(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:s,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:nn(t),onStart:nn(s),onMove:nn(n),onEnd:(r,o)=>{delete this.session,i&&ce.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=Ht(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let on=!1;class Sm extends y.Component{componentDidMount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:n,layoutId:i}=this.props,{projection:r}=t;r&&(s.group&&s.group.add(r),n&&n.register&&i&&n.register(r),on&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),gs.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:s,visualElement:n,drag:i,isPresent:r}=this.props,{projection:o}=n;return o&&(o.isPresent=r,t.layoutDependency!==s&&o.setOptions({...o.options,layoutDependency:s}),on=!0,i||t.layoutDependency!==s||s===void 0||t.isPresent!==r?o.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?o.promote():o.relegate()||ce.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:s}=this.props,{projection:n}=t;n&&(n.options.layoutAnchor=s,n.root.didUpdate(),ni.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:n}=this.props,{projection:i}=t;on=!0,i&&(i.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function sl(e){const[t,s]=Ua(),n=y.useContext(zn);return a.jsx(Sm,{...e,layoutGroup:n,switchLayoutGroup:y.useContext(qa),isPresent:t,safeToRemove:s})}const jm={pan:{Feature:km},drag:{Feature:wm,ProjectionNode:Wa,MeasureLayout:sl}};function tr(e,t,s){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",s==="Start");const i="onHover"+s,r=n[i];r&&ce.postRender(()=>r(t,Qt(t)))}class Nm extends ft{mount(){const{current:t}=this.node;t&&(this.unmount=Hu(t,(s,n)=>(tr(this.node,n,"Start"),i=>tr(this.node,i,"End"))))}unmount(){}}class Tm extends ft{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=Zt(Xt(this.node.current,"focus",()=>this.onFocus()),Xt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function sr(e,t,s){const{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",s==="Start");const i="onTap"+(s==="End"?"":s),r=n[i];r&&ce.postRender(()=>r(t,Qt(t)))}class Cm extends ft{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:s,propagate:n}=this.node.props;this.unmount=qu(t,(i,r)=>(sr(this.node,r,"Start"),(o,{success:l})=>sr(this.node,o,l?"End":"Cancel")),{useGlobalTarget:s,stopPropagation:n?.tap===!1})}unmount(){}}const $n=new WeakMap,rn=new WeakMap,Mm=e=>{const t=$n.get(e.target);t&&t(e)},Pm=e=>{e.forEach(Mm)};function Em({root:e,...t}){const s=e||document;rn.has(s)||rn.set(s,{});const n=rn.get(s),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(Pm,{root:e,...t})),n[i]}function Am(e,t,s){const n=Em(t);return $n.set(e,s),n.observe(e),()=>{$n.delete(e),n.unobserve(e)}}const Rm={some:0,all:1};class Vm extends ft{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:s,margin:n,amount:i="some",once:r}=t,o={root:s?s.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:Rm[i]},l=d=>{const{isIntersecting:h}=d;if(this.isInView===h||(this.isInView=h,r&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:c,onViewportLeave:u}=this.node.getProps(),m=h?c:u;m&&m(d)};this.stopObserver=Am(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:s}=this.node;["amount","margin","root"].some(Dm(t,s))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function Dm({viewport:e={}},{viewport:t={}}={}){return s=>e[s]!==t[s]}const Lm={inView:{Feature:Vm},tap:{Feature:Cm},focus:{Feature:Tm},hover:{Feature:Nm}},Im={layout:{ProjectionNode:Wa,MeasureLayout:sl}},Fm={...rm,...Lm,...jm,...Im},nr=tm(Fm,sm),$m={ADR:0,Spec:1,SPEC:1,Feature:2,Claim:3,Test:4,Evidence:5,Release:6,Boundary:1,Profile:1,Risk:3,Issue:4};function fi(e,t){let s=$m[e.family]??3;if(t==="packs"){const n=e.governancePacks&&e.governancePacks.length>0||e.packs&&e.packs.some(o=>o.includes("governance")||o.includes("core")),i=e.contractPacks&&e.contractPacks.length>0||e.packs&&e.packs.some(o=>o.includes("contract")),r=e.packs&&e.packs.length>0;n?s=1:i?s=2:r?s=3:s=0}else if(t==="validation"){const n=e.validation?.status||(e.status==="certified"?"pass":"unknown");n==="pass"?s=0:n==="warn"?s=1:n==="fail"?s=2:s=3}else if(t==="release"){const n=e.family==="Release",i=e.status||"active";n?s=3:i==="certified"?s=2:i==="active"?s=1:s=0}else if(t==="origins"){const n=e.originKind||"unknown";n==="ssot-core"?s=0:n==="ssot-origin"?s=1:n==="repo-local"?s=2:n==="extension-pack"||n==="generated"?s=3:s=4}else t==="proof"&&(e.family==="ADR"||e.family==="Spec"||e.family==="SPEC"?s=0:e.family==="Feature"?s=1:e.family==="Claim"?s=2:e.family==="Test"||e.family==="Evidence"?s=3:s=4);return s}function nl(e){const t=new Map;e.nodes.forEach(r=>t.set(r.id,r));const s=new Map,n=new Map,i=new Map;return e.edges.forEach(r=>{const o=n.get(r.from)||[];o.push(r.to),n.set(r.from,o);const l=s.get(r.to)||[];l.push(r.from),s.set(r.to,l);const d=i.get(r.from)||[];d.push(r),i.set(r.from,d);const h=i.get(r.to)||[];h.push(r),i.set(r.to,h)}),{nodeMap:t,incoming:s,outgoing:n,edgeMap:i}}function an(e,t,s){let n=e;const i=new Set;for(;n;){if(i.has(n))return!1;i.add(n);const r=t.get(n);if(!r||r.length===0)return!1;const o=r[0];if(s.has(o))return!0;n=o}return!1}function ir(e,t,s,n,i=220,r=90,o=1e3,l=600,d,h){const c={},u={};for(let M=0;M<=6;M++)u[M]=[];const m=new Set;h&&h.forEach(M=>m.add(M));const p=Array.from(n),x=new Set;for(;p.length>0;){const M=p.shift();if(x.has(M))continue;x.add(M);const F=s.get(M)||[];for(const P of F)m.add(P),x.has(P)||p.push(P)}const v=e.length>5e3;e.forEach((M,F)=>{if(v){const j=M.id.match(/-(\d+)$/),N=j?parseInt(j[1],10):-1;if(N!==-1){if(N>150&&N%500!==0)return}else if(F%50!==0)return}if(m.has(M.id))return;const P=fi(M,d);u[P]||(u[P]=[]),u[P].push(M.id)});const k=60,T=120,b=200,w=52,C=32;let I=k;return Object.entries(u).forEach(([,M])=>{const F=M.length;if(F===0)return;let P=Math.min(4,Math.ceil(F/15));if(F>60){const B=Math.max(12,Math.ceil(Math.sqrt(F)*1.5));P=Math.min(C,Math.max(4,Math.ceil(F/B)))}const N=(Math.ceil(F/P)-1)*r,D=Math.max(90,(l-N)/2),$=Math.max(b,(P-1)*w+120),_=I+$/2;M.forEach((B,K)=>{const X=K%P,xe=Math.floor(K/P),Z=(X-(P-1)/2)*w;c[B]={x:_+Z,y:D+xe*r}}),I+=$+T}),c}function zm(e,t,s,n,i=1e3,r=600,o=.05,l=3200,d=.06,h=130,c){const u={...s};e.forEach(b=>{n.has(b.id)||(u[b.id]?(u[b.id].vx===void 0&&(u[b.id].vx=0),u[b.id].vy===void 0&&(u[b.id].vy=0)):u[b.id]={x:i/2+(Math.random()-.5)*200,y:r/2+(Math.random()-.5)*200,vx:0,vy:0})});const m=e.filter(b=>!n.has(b.id)).map(b=>b.id),p=m.length;if(p>100){const w=new Map;m.forEach(I=>{const M=u[I];if(!M)return;const F=Math.floor(M.x/250),P=Math.floor(M.y/250),j=`${F},${P}`;w.has(j)||w.set(j,[]),w.get(j).push(I)});const C=new Set;m.forEach(I=>{const M=u[I];if(!M)return;const F=Math.floor(M.x/250),P=Math.floor(M.y/250);for(let j=-1;j<=1;j++)for(let N=-1;N<=1;N++){const D=`${F+j},${P+N}`,$=w.get(D);if($)for(const _ of $){if(I===_)continue;const B=I<_?`${I}:${_}`:`${_}:${I}`;if(C.has(B))continue;C.add(B);const K=u[_];if(!K)continue;const X=M.x-K.x,xe=M.y-K.y,Z=X*X+xe*xe+.1,ne=Math.sqrt(Z);if(ne<450){const S=Math.min(8,l/(Z+400)),g=X/ne*S,z=xe/ne*S;(M.fx===void 0||M.fx===null)&&(M.vx=(M.vx||0)+g,M.vy=(M.vy||0)+z),(K.fx===void 0||K.fx===null)&&(K.vx=(K.vx||0)-g,K.vy=(K.vy||0)-z)}}}})}else for(let b=0;b<p;b++){const w=m[b],C=u[w];if(C)for(let I=b+1;I<p;I++){const M=m[I],F=u[M];if(!F)continue;const P=C.x-F.x,j=C.y-F.y,N=P*P+j*j+.1,D=Math.sqrt(N);if(D<450){const $=Math.min(8,l/(N+400)),_=P/D*$,B=j/D*$;(C.fx===void 0||C.fx===null)&&(C.vx=(C.vx||0)+_,C.vy=(C.vy||0)+B),(F.fx===void 0||F.fx===null)&&(F.vx=(F.vx||0)-_,F.vy=(F.vy||0)-B)}}}t.forEach(b=>{if(n.has(b.from)||n.has(b.to))return;const w=u[b.from],C=u[b.to];if(!w||!C)return;const I=C.x-w.x,M=C.y-w.y,F=Math.sqrt(I*I+M*M)||1,P=F-h,j=Math.max(-12,Math.min(12,d*P)),N=I/F*j,D=M/F*j;(w.fx===void 0||w.fx===null)&&(w.vx=(w.vx||0)+N,w.vy=(w.vy||0)+D),(C.fx===void 0||C.fx===null)&&(C.vx=(C.vx||0)-N,C.vy=(C.vy||0)-D)});const x=i/2,v=r/2,k=c==="flow-force"?.72:.62,T=new Map;return e.forEach(b=>T.set(b.id,b)),m.forEach(b=>{const w=u[b];if(!w)return;if(w.fx!==void 0&&w.fx!==null&&w.fy!==void 0&&w.fy!==null){w.x=w.fx,w.y=w.fy,w.vx=0,w.vy=0;return}if(c==="flow-force"){const I=T.get(b),M=I?fi(I):3,F=60+M*220;let P=.28;(M===0||M===6)&&(P=.85);const j=(F-w.x)*P;w.vx=(w.vx||0)+j;const N=(v-w.y)*.075;w.vy=(w.vy||0)+N}else{const I=x-w.x,M=v-w.y;w.vx=(w.vx||0)+I*o,w.vy=(w.vy||0)+M*o}w.x+=(w.vx||0)*k,w.y+=(w.vy||0)*k,w.vx*=k,w.vy*=k;const C=40;w.x<C&&(w.x=C,w.vx=0),w.x>i-C&&(w.x=i-C,w.vx=0),w.y<C&&(w.y=C,w.vy=0),w.y>r-C&&(w.y=r-C,w.vy=0)}),u}function Om(e,t,s,n,i){if(i==="lineage"||i==="proof"||i==="packs"){const u=(e+s)/2;return`M ${e} ${t} C ${u} ${t}, ${u} ${n}, ${s} ${n}`}const r=s-e,o=n-t,l=Math.sqrt(r*r+o*o);if(l<40)return`M ${e} ${t} L ${s} ${n}`;const d=25,h=(e+s)/2-o/l*d,c=(t+n)/2+r/l*d;return`M ${e} ${t} Q ${h} ${c}, ${s} ${n}`}const tt={ADR:{bg:"bg-amber-100",text:"text-amber-800",border:"border-amber-300",glow:"shadow-amber-200"},Spec:{bg:"bg-blue-100",text:"text-blue-800",border:"border-blue-300",glow:"shadow-blue-200"},SPEC:{bg:"bg-blue-100",text:"text-blue-800",border:"border-blue-300",glow:"shadow-blue-200"},Feature:{bg:"bg-indigo-100",text:"text-indigo-800",border:"border-indigo-300",glow:"shadow-indigo-200"},Claim:{bg:"bg-purple-100",text:"text-purple-800",border:"border-purple-300",glow:"shadow-purple-200"},Test:{bg:"bg-rose-100",text:"text-rose-800",border:"border-rose-300",glow:"shadow-rose-200"},Evidence:{bg:"bg-emerald-100",text:"text-emerald-800",border:"border-emerald-300",glow:"shadow-emerald-200"},Release:{bg:"bg-teal-100",text:"text-teal-800",border:"border-teal-300",glow:"shadow-teal-200"},Boundary:{bg:"bg-slate-100",text:"text-slate-800",border:"border-slate-300",glow:"shadow-slate-200"},Profile:{bg:"bg-gray-100",text:"text-gray-800",border:"border-gray-300",glow:"shadow-gray-200"},Risk:{bg:"bg-orange-100",text:"text-orange-800",border:"border-orange-300",glow:"shadow-orange-200"},Issue:{bg:"bg-red-100",text:"text-red-800",border:"border-red-300",glow:"shadow-red-200"}};function or(e,t,s,n,i,r){if(i==="lineage"||i==="proof"||i==="packs"){const p=(e+s)/2;return`M ${e} ${t+r} C ${p} ${t+r}, ${p} ${n+r}, ${s} ${n+r}`}const o=s-e,l=n-t,d=Math.sqrt(o*o+l*l)||1,h=-l/d,c=o/d,u=h*r,m=c*r;return`M ${e+u} ${t+m} L ${s+u} ${n+m}`}const _m=({payload:e,positions:t,mode:s,selectedNodeId:n,selectedNodeIds:i=new Set,focusNodeId:r,collapsedNodeIds:o,hiddenNodeIds:l,onSelectNode:d,onToggleCollapse:h,onToggleHideNode:c,onClearHiddenNodes:u,onUpdatePositions:m,viewSettings:p,precomputedIndices:x,egoHops:v=1,onAddGroup:k,onBulkHideNodes:T,onBulkHighlightNodes:b,highlightedNodeIds:w=new Set,customGroups:C=[],isolateEgo:I=!1})=>{const M=y.useRef(null),P=s==="network"||s==="flow-force"?"":"transition-all duration-300",[j,N]=y.useState({x:50,y:50}),[D,$]=y.useState(.85),[_,B]=y.useState(!1),K=y.useRef({x:0,y:0}),[X,xe]=y.useState(!1),[Z,ne]=y.useState(null),[S,g]=y.useState(null),z=y.useRef({x:0,y:0}),se=y.useRef({x:0,y:0}),re=y.useRef(!1),We=y.useRef(null);y.useEffect(()=>{const f=E=>{const A=E.target;if(A&&(A.tagName==="INPUT"||A.tagName==="TEXTAREA"||A.isContentEditable))return;const V=35/D;E.key==="ArrowUp"?(E.preventDefault(),N(L=>({...L,y:L.y+V}))):E.key==="ArrowDown"?(E.preventDefault(),N(L=>({...L,y:L.y-V}))):E.key==="ArrowLeft"?(E.preventDefault(),N(L=>({...L,x:L.x+V}))):E.key==="ArrowRight"?(E.preventDefault(),N(L=>({...L,x:L.x-V}))):E.key==="+"||E.key==="="?(E.preventDefault(),$(L=>Math.min(L*1.15,3))):E.key==="-"&&(E.preventDefault(),$(L=>Math.max(L/1.15,.15)))};return window.addEventListener("keydown",f),()=>{window.removeEventListener("keydown",f)}},[D]);const[ie,me]=y.useState(()=>{const f=-58.82352941176471,E=-50/.85,A=1050/.85,V=570/.85;return{left:f,right:A,top:E,bottom:V,zoom:.85}});y.useEffect(()=>{const A=setTimeout(()=>{const V=M.current?.clientWidth||1100,L=M.current?.clientHeight||620,Y=(0-j.x)/(D||1),G=(0-j.y)/(D||1),te=(V-j.x)/(D||1),J=(L-j.y)/(D||1);me({left:Y,right:te,top:G,bottom:J,zoom:D})},_||S!==null?55:0);return()=>{clearTimeout(A)}},[j.x,j.y,D,_,S]);const ve=y.useMemo(()=>x||nl(e),[e,x]),oe=Z||n;y.useEffect(()=>{if(r&&t[r]&&M.current){const f=t[r],E=M.current,{width:A,height:V}=E.getBoundingClientRect(),L=Math.max(D,1);$(L),N({x:A/2-f.x*L,y:V/2-f.y*L})}},[r]),y.useEffect(()=>{if(Object.keys(t).length>0&&e!==We.current){if(We.current=e,e.nodes.length>1500)return;setTimeout(()=>{nt()},50)}},[e,t]);const $e=f=>{const E=f.target;E.closest(".graph-node-avatar")||E.closest(".canvas-button")||(B(!0),f.currentTarget.setPointerCapture(f.pointerId),K.current={x:f.clientX-j.x,y:f.clientY-j.y})},$t=f=>{_&&N({x:f.clientX-K.current.x,y:f.clientY-K.current.y})},jt=f=>{_&&(f.currentTarget.releasePointerCapture(f.pointerId),B(!1))},Pe=(f,E)=>{E.stopPropagation(),E.currentTarget.setPointerCapture(E.pointerId),g(f),re.current=!1;const A=t[f]||{x:0,y:0};z.current={x:E.clientX,y:E.clientY},se.current={x:A.x,y:A.y}},Is=(f,E)=>{if(S!==f)return;E.stopPropagation();const A=E.clientX-z.current.x,V=E.clientY-z.current.y;(Math.abs(A)>3||Math.abs(V)>3)&&(re.current=!0);const L=A/D,Y=V/D,G={...t};if(G[f]){const te=se.current.x+L,J=se.current.y+Y;G[f]={...G[f],fx:te,fy:J,x:te,y:J},m(G)}},Fs=(f,E)=>{if(S!==f)return;E.stopPropagation(),E.currentTarget.releasePointerCapture(E.pointerId);const A=E.clientX-z.current.x,V=E.clientY-z.current.y,L=A/D,Y=V/D,G=se.current.x+L,te=se.current.y+Y,J={...t};J[f]&&(s==="network"?J[f]={...J[f],fx:G,fy:te,x:G,y:te}:J[f]={...J[f],fx:null,fy:null,x:G,y:te},m(J)),g(null)},$s=(f,E)=>{if(E.stopPropagation(),s!=="network")return;const A={...t};A[f]&&(A[f]={...A[f],fx:null,fy:null},m(A))},zs=(f,E)=>{E.stopPropagation();const A={...t},V=A[f];if(V){const L=V.fx!==null&&V.fx!==void 0;A[f]={...V,fx:L?null:V.x,fy:L?null:V.y},m(A)}},mt=f=>{f.preventDefault();const E=1.1,A=M.current;if(!A)return;const V=A.getBoundingClientRect(),L=f.clientX-V.left,Y=f.clientY-V.top,G=(L-j.x)/D,te=(Y-j.y)/D;let J=D;f.deltaY<0?J=Math.min(D*E,3):J=Math.max(D/E,.15),$(J),N({x:L-G*J,y:Y-te*J})},nt=()=>{const f=Object.values(t);if(f.length===0)return;const E=f.map(H=>H.x),A=f.map(H=>H.y),V=Math.min(...E),L=Math.max(...E),Y=Math.min(...A),G=Math.max(...A),te=L-V+200,J=G-Y+200,de=M.current;if(!de)return;const{width:ue,height:ye}=de.getBoundingClientRect(),be=Math.min(ue/te,ye/J,1.2);$(be),N({x:(ue-(L+V)*be)/2,y:(ye-(G+Y)*be)/2})},Os=()=>{$(.85),N({x:80,y:70})},it=y.useMemo(()=>{const f=new Set;if(o.size===0)return f;const E=Array.from(o),A=new Set;for(;E.length>0;){const V=E.shift();if(A.has(V))continue;A.add(V);const L=ve.outgoing.get(V)||[];for(const Y of L)f.add(Y),A.has(Y)||E.push(Y)}return f},[o,ve.outgoing]),Je=y.useCallback(f=>it.has(f),[it]),ot=y.useCallback(f=>o.has(f.from)||o.has(f.to)?!0:it.has(f.from)||it.has(f.to),[o,it]),es=f=>{if(s==="validation")switch(f.validation?.status){case"fail":return{className:"bg-rose-500 text-white animate-pulse",icon:"fail",label:"ValidationError"};case"warn":return{className:"bg-amber-500 text-white",icon:"warn",label:"Warning"};default:return{className:"bg-emerald-500 text-white",icon:"verified",label:"Verified Proof"}}if(s==="proof"){if(f.proof?.testStatus==="failed")return{className:"bg-rose-500 text-white animate-pulse",icon:"fail",label:"ValidationError"};if(f.proof?.testStatus==="passed")return{className:"bg-indigo-500 text-white",icon:"pass",label:"Active Layer Node"}}return f.validation?.status==="fail"||f.proof?.testStatus==="failed"?{className:"bg-rose-500 text-white animate-pulse",icon:"fail",label:"ValidationError"}:f.proof?.testStatus==="passed"?{className:"bg-indigo-500 text-white",icon:"pass",label:"Active Layer Node"}:f.validation?.status==="pass"||f.status==="certified"?{className:"bg-emerald-500 text-white",icon:"verified",label:"Verified Proof"}:f.validation?.status==="warn"?{className:"bg-amber-500 text-white",icon:"warn",label:"Warning"}:null},_s=y.useMemo(()=>{switch(s){case"lineage":case"flow-force":return[{col:0,title:"ADR Setup"},{col:1,title:"Specification"},{col:2,title:"Core Features"},{col:3,title:"Claims"},{col:4,title:"Verifications"},{col:5,title:"Certificates"},{col:6,title:"Releases"}];case"proof":return[{col:0,title:"Specifications"},{col:1,title:"Implementations"},{col:2,title:"Claims assertions"},{col:3,title:"Verification Tests"},{col:4,title:"Target Releases/Risks"}];case"origins":return[{col:0,title:"Core Rules"},{col:1,title:"Specification Registry"},{col:2,title:"Local Repo Implementations"},{col:3,title:"Custom Extensions"},{col:4,title:"External Dependencies"}];case"packs":return[{col:0,title:"Core Registry (General)"},{col:1,title:"Governance Standards"},{col:2,title:"Contract Packs"},{col:3,title:"Extension Packs"}];case"validation":return[{col:0,title:"Passing (No Drift)"},{col:1,title:"Warnings (Drift Risk)"},{col:2,title:"Failures (Blockers)"},{col:3,title:"Draft / Unknown"}];case"release":return[{col:0,title:"Planned Backlog"},{col:1,title:"Active Development"},{col:2,title:"Certified Checked"},{col:3,title:"Official Release checkpoints"}];default:return[]}},[s]),ts=y.useMemo(()=>{const f=new Map;return e.nodes.forEach(E=>{if(l.has(E.id)||Je(E.id))return;const A=t[E.id];if(!A)return;const V=fi(E,s),L=f.get(V);L?(L.left=Math.min(L.left,A.x),L.width=Math.max(L.width,A.x)):f.set(V,{left:A.x,center:A.x,width:A.x})}),f.forEach((E,A)=>{const V=E.left,L=E.width;f.set(A,{left:V-70,center:(V+L)/2,width:Math.max(200,L-V+140)})}),f},[e.nodes,t,s,l,Je]),Ve=180,pt=110,{minX:R,maxX:q,minY:U,maxY:ae,mapScale:ke,offsetX:Fe,offsetY:Qe,visibleNodes:Ee}=y.useMemo(()=>{const E=e.nodes.length>5e3?e.nodes.filter((fe,W)=>{if(l.has(fe.id)||Je(fe.id))return!1;const Ne=fe.id.match(/-(\d+)$/),Me=Ne?parseInt(Ne[1],10):-1;return Me!==-1?Me<=150||Me%500===0:W%50===0}):e.nodes.filter(fe=>!l.has(fe.id)&&!Je(fe.id)),A=new Set,V=E.filter(fe=>A.has(fe.id)?!1:(A.add(fe.id),!0));let L=1/0,Y=-1/0,G=1/0,te=-1/0;V.forEach(fe=>{const W=t[fe.id];W&&(W.x<L&&(L=W.x),W.x>Y&&(Y=W.x),W.y<G&&(G=W.y),W.y>te&&(te=W.y))}),(L===1/0||Y===-1/0)&&(L=0,Y=1100),(G===1/0||te===-1/0)&&(G=0,te=620);const J=100;L-=J,Y+=J,G-=J,te+=J;const de=Math.max(1,Y-L),ue=Math.max(1,te-G),ye=(Ve-12)/de,be=(pt-12)/ue,H=Math.max(.001,Math.min(ye,be)),ee=(Ve-de*H)/2,he=(pt-ue*H)/2;return{minX:L,maxX:Y,minY:G,maxY:te,mapScale:H,offsetX:ee,offsetY:he,visibleNodes:V}},[e.nodes,t,l,o]),pe=y.useMemo(()=>{if(!oe)return null;const f=new Set([oe]),E=new Set(Ee.map(L=>L.id));let A=new Set([oe]);const V=v||1;for(let L=0;L<V;L++){const Y=new Set;A.forEach(G=>{const te=new Set([G]),J=[{id:G,d:0}];for(;J.length>0;){const{id:de,d:ue}=J.shift(),ye=ve.incoming.get(de)||[],be=ve.outgoing.get(de)||[],H=[...ye,...be];for(const ee of H)te.has(ee)||(te.add(ee),E.has(ee)?f.has(ee)||(f.add(ee),Y.add(ee)):ue<3&&J.push({id:ee,d:ue+1}))}}),A=Y}return f},[oe,ve,v,Ee]),rt=(f,E)=>({x:(f-R)*ke+Fe,y:(E-U)*ke+Qe}),xt=y.useMemo(()=>{if(e.nodes.length>5e3){const E=new Set(Ee.map(A=>A.id));return e.edges.filter(A=>E.has(A.from)&&E.has(A.to)&&!ot(A))}return e.edges.filter(E=>!ot(E))},[e.edges,Ee,ot]);M.current?.clientWidth,M.current?.clientHeight;const at=ie.left,lt=ie.top,ct=ie.right,De=ie.bottom,{renderedNodes:il,renderedEdges:ol}=y.useMemo(()=>{const f=250/Math.max(.1,ie.zoom),E=at-f,A=ct+f,V=lt-f,L=De+f,Y=[],G=new Set;Ee.forEach(H=>{const ee=t[H.id];ee&&ee.x>=E&&ee.x<=A&&ee.y>=V&&ee.y<=L&&(G.has(H.id)||(Y.push(H),G.add(H.id)))});const te=[n,r,S].filter(H=>!!H);te.forEach(H=>{if(!G.has(H)){const ee=ve.nodeMap.get(H);ee&&!l.has(H)&&!Je(H)&&(Y.push(ee),G.add(H))}});const J=[],de=new Set,ue=new Set(Y.map(H=>H.id)),ye=new Set(te),be=e.edges.length>2e3?900:2e3;for(const H of xt){const ee=ye.has(H.from)||ye.has(H.to);if(J.length>=be&&!ee)continue;const he=`${H.from}->${H.to}:${H.type||""}`;if(de.has(he)||l.has(H.from)||l.has(H.to)||ot(H)||(!ue.has(H.from)||!ue.has(H.to))&&!ee)continue;const fe=t[H.from],W=t[H.to];if(!fe||!W)continue;const Ne=180/Math.max(.05,ie.zoom),Me=Math.min(fe.x,W.x)-Ne,Le=Math.max(fe.x,W.x)+Ne,ze=Math.min(fe.y,W.y)-Ne,Oe=Math.max(fe.y,W.y)+Ne;!(Le>=at&&Me<=ct&&Oe>=lt&&ze<=De)&&!ee||(J.push(H),de.add(he))}return{renderedNodes:Y,renderedEdges:J}},[Ee,xt,t,at,ct,lt,De,ie.zoom,n,r,S,ve.nodeMap,l,o,ot]),rl=y.useMemo(()=>{const f=[],E=new Set,A=new Set(Ee.map(V=>V.id));return Ee.forEach(V=>{const L=(Y,G,te)=>{(ve.edgeMap.get(Y)||[]).forEach(de=>{if(de.from!==Y)return;const ue=de.to;if(ue!==V.id)if(A.has(ue)){if(G.length>0){const ye=`${V.id}->${ue}`;E.has(ye)||(E.add(ye),f.push({from:V.id,to:ue,type:[...te,de].map(be=>be.type||be.label||"link").join(" -> "),originalEdges:[...te,de],ghostNodeIds:G,isGhost:!0}))}}else G.length<3&&!G.includes(ue)&&L(ue,[...G,ue],[...te,de])})};L(V.id,[],[])}),f},[Ee,ve.edgeMap]),ss=rt(at,lt),mi=rt(ct,De),pi=Math.max(0,Math.min(Ve,ss.x)),xi=Math.max(0,Math.min(pt,ss.y)),al=Math.max(4,Math.min(Ve-pi,mi.x-ss.x)),ll=Math.max(4,Math.min(pt-xi,mi.y-ss.y)),gi=f=>{if(!M.current)return;const E=f.currentTarget.getBoundingClientRect(),A=f.clientX-E.left,V=f.clientY-E.top,L=(A-Fe)/(ke||1)+R,Y=(V-Qe)/(ke||1)+U,G=M.current.clientWidth,te=M.current.clientHeight;N({x:G/2-L*D,y:te/2-Y*D})},cl=f=>{f.stopPropagation(),f.preventDefault(),xe(!0),f.currentTarget.setPointerCapture(f.pointerId),gi(f)},dl=f=>{X&&(f.stopPropagation(),gi(f))},ul=f=>{X&&(f.stopPropagation(),xe(!1),f.currentTarget.releasePointerCapture(f.pointerId))},hl=f=>{switch(f){case"ADR":return"#d97706";case"SPEC":return"#2563eb";case"Feature":return"#4f46e5";case"Claim":return"#9333ea";case"Test":return"#e11d48";case"Evidence":return"#059669";case"Release":return"#0d9488";case"Boundary":return"#475569";case"Risk":return"#ea580c";case"Issue":return"#dc2626";default:return"#4b5563"}};return a.jsxs("div",{ref:M,id:"lineage-graph-viewport",className:`relative w-full h-full overflow-hidden select-none cursor-grab active:cursor-grabbing transition-colors duration-300 ${p.theme==="steel-dark"?"bg-slate-900 border border-slate-800":"bg-slate-50/50 border border-slate-200"}`,onPointerDown:$e,onPointerMove:$t,onPointerUp:jt,onPointerLeave:jt,onWheel:mt,children:[a.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-40",style:{backgroundImage:`radial-gradient(${p.theme==="steel-dark"?"#ffffff33":"#00000018"} 1px, transparent 1px)`,backgroundSize:"24px 24px",transform:`translate(${j.x}px, ${j.y}px)`}}),a.jsx("div",{className:"absolute top-4 left-4 pointer-events-none z-10 hidden sm:block",children:a.jsxs("span",{className:"text-[10px] font-mono tracking-wider text-slate-400 uppercase bg-slate-800/80 px-2 py-0.5 rounded border border-slate-700/80",children:[s.slice(0,1).toUpperCase()+s.slice(1)," Mode"]})}),a.jsxs("div",{className:`absolute w-0 h-0 origin-top-left ${_||S!==null?"":"transition-transform duration-300 ease-out"}`,style:{transform:`translate(${j.x}px, ${j.y}px) scale(${D})`},children:[s!=="network"&&_s.map(f=>{const E=ts.get(f.col),A=E?.center??60+f.col*210;return a.jsxs("div",{className:"absolute pointer-events-none flex flex-col items-center",style:{left:E?.left??A-100,top:-30,width:E?.width??200,height:1200},children:[a.jsx("div",{className:`w-0 h-[850px] border-l border-dashed my-8 opacity-20 ${p.theme==="steel-dark"?"border-slate-500":"border-indigo-400"}`}),a.jsx("div",{className:`absolute top-0 px-2.5 py-1 rounded-full text-[9px] font-bold font-mono tracking-wider uppercase border shadow-sm backdrop-blur-md transition-colors ${p.theme==="steel-dark"?"bg-slate-800/90 text-slate-300 border-slate-700/80":"bg-white/95 text-indigo-800 border-indigo-100"}`,children:f.title})]},f.col)}),a.jsxs("svg",{className:"absolute overflow-visible pointer-events-none z-0",style:{width:1,height:1},children:[a.jsx("style",{children:`
|
|
15
|
+
@keyframes line-flow-active {
|
|
16
|
+
to {
|
|
17
|
+
stroke-dashoffset: -20;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
.flow-active-dash {
|
|
21
|
+
animation: line-flow-active 0.85s linear infinite;
|
|
22
|
+
}
|
|
23
|
+
`}),a.jsxs("defs",{children:[a.jsx("marker",{id:"arrow",viewBox:"0 0 10 10",refX:"18",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:a.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"#94a3b8"})}),a.jsx("marker",{id:"arrow-selected",viewBox:"0 0 10 10",refX:"18",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:a.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"#6366f1"})}),a.jsx("marker",{id:"arrow-error",viewBox:"0 0 10 10",refX:"18",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:a.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"#ef4444"})}),a.jsx("marker",{id:"arrow-success",viewBox:"0 0 10 10",refX:"18",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:a.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"#10b981"})}),a.jsx("marker",{id:"arrow-incoming",viewBox:"0 0 10 10",refX:"18",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:a.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"#06b6d4"})}),a.jsx("marker",{id:"arrow-outgoing",viewBox:"0 0 10 10",refX:"18",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:a.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"#ec4899"})})]}),ol.map((f,E)=>{const A=t[f.from],V=t[f.to];if(!A||!V||l.has(f.from)||l.has(f.to)||ot(f)||I&&pe&&(!pe.has(f.from)||!pe.has(f.to)))return null;const L=180/Math.max(.05,D),Y=Math.min(A.x,V.x)-L,G=Math.max(A.x,V.x)+L,te=Math.min(A.y,V.y)-L,J=Math.max(A.y,V.y)+L,de=G>=at&&Y<=ct&&J>=lt&&te<=De,ue=n===f.from||n===f.to,ye=r===f.from||r===f.to,be=S===f.from||S===f.to;if(!de&&!ue&&!ye&&!be)return null;const H=Z===f.from||Z===f.to,ee=ye,he=oe===f.to,fe=oe===f.from,W=he||fe,Ne=!!(oe&&pe&&pe.has(f.from)&&pe.has(f.to));let Me="#94a3b8",Le=p.edgeWidth,ze=p.edgeOpacity,Oe="url(#arrow)";s==="validation"&&(f.status==="stale"||f.status==="missing"||f.proof?.blocker)?(Me="#ef4444",Le=p.edgeWidth+1.2,Oe="url(#arrow-error)"):s==="proof"&&(f.status==="active"?(Me="#10b981",Oe="url(#arrow-success)"):(Me="#f59e0b",Oe="url(#arrow-error)")),(ue||ee||be)&&(Me="#6366f1",Le=p.edgeWidth+2.5,ze=1,Oe="url(#arrow-selected)"),oe?W?(ze=1,Le=p.edgeWidth+2,Me=he?"#06b6d4":"#ec4899",Oe=he?"url(#arrow-incoming)":"url(#arrow-outgoing)"):Ne?(ze=1,Le=p.edgeWidth+1.2,Me="#818cf8",Oe="url(#arrow-selected)"):(ze=.1,Le=Math.max(1,p.edgeWidth-.5)):Z&&(H?(ze=1,Le=p.edgeWidth+1.5):ze=.12);const je=Om(A.x,A.y,V.x,V.y,s);return a.jsxs("g",{className:P,children:[a.jsx("path",{d:je,fill:"none",stroke:"transparent",strokeWidth:14,className:"cursor-pointer pointer-events-auto"}),oe&&(W||Ne)&&a.jsx("path",{d:je,fill:"none",stroke:W?he?"#06b6d4":"#ec4899":"#818cf8",strokeWidth:Le+5,opacity:.16,className:`${P} blur-[2px]`}),oe&&(W||Ne)&&a.jsx("path",{d:je,fill:"none",stroke:W?he?"#06b6d4":"#ec4899":"#818cf8",strokeWidth:Le,strokeDasharray:"6,6",opacity:.8,className:`flow-active-dash ${P}`}),a.jsx("path",{d:je,fill:"none",stroke:Me,strokeWidth:Le,strokeDasharray:oe&&(W||Ne)?void 0:f.status==="planned"||f.status==="stale"?"5,5":void 0,opacity:ze,markerEnd:Oe,className:P}),p.showLabels&&f.type&&a.jsx("text",{x:(A.x+V.x)/2,y:(A.y+V.y)/2-4,fill:p.theme==="steel-dark"?"#94a3b8":"#475569",fontSize:9,fontFamily:"monospace",textAnchor:"middle",opacity:ze,children:f.type})]},`${f.from}-${f.to}-${E}`)}),rl.map((f,E)=>{const A=t[f.from],V=t[f.to];if(!A||!V||I&&pe&&(!pe.has(f.from)||!pe.has(f.to)))return null;const L=n===f.from||n===f.to,Y=r===f.from||r===f.to,G=S===f.from||S===f.to,te=Z===f.from||Z===f.to,J=Y,de=oe===f.to,ue=oe===f.from,ye=de||ue,be=!!(oe&&pe&&pe.has(f.from)&&pe.has(f.to));let H=p.theme==="steel-dark"?"#a78bfa":"#8b5cf6",ee=p.edgeWidth||2,he=(p.edgeOpacity||.6)*.95,fe="url(#arrow-selected)";(L||J||G)&&(H="#7c3aed",ee=(p.edgeWidth||2)+2,he=1),oe?ye?(he=1,ee=(p.edgeWidth||2)+1.5,H=de?"#06b6d4":"#ec4899",fe=de?"url(#arrow-incoming)":"url(#arrow-outgoing)"):be?(he=1,ee=(p.edgeWidth||2)+1,H="#818cf8"):he=.1:Z&&(te?(he=1,ee=(p.edgeWidth||2)+1.2):he=.12);const W=(A.x+V.x)/2,Ne=(A.y+V.y)/2,Me=4,Le=or(A.x,A.y,V.x,V.y,s,-Me),ze=or(A.x,A.y,V.x,V.y,s,Me),Oe=ve.nodeMap.get(f.ghostNodeIds[0]);let je="G";if(Oe){const Ue=(Oe.family||"").toUpperCase();Ue.startsWith("SPEC")?je="S":Ue.startsWith("ADR")?je="A":Ue.startsWith("FEAT")?je="F":Ue.startsWith("CLAIM")?je="C":Ue.startsWith("TEST")?je="T":Ue.startsWith("EVID")?je="E":Ue.startsWith("RELE")||Ue.startsWith("RISK")?je="R":Ue.startsWith("BOU")?je="B":Ue.startsWith("ISS")?je="I":je=Ue.charAt(0)||"G"}const Bs=f.originalEdges[0]?.type||f.originalEdges[0]?.label||"link",Ws=f.originalEdges[f.originalEdges.length-1]?.type||f.originalEdges[f.originalEdges.length-1]?.label||"link",yi=(A.x+W)/2,bi=(A.y+Ne)/2-8,vi=(W+V.x)/2,wi=(Ne+V.y)/2-8,ki=Bs.length*5.2,Si=Ws.length*5.2;return a.jsxs("g",{className:P,children:[a.jsx("path",{d:Le,fill:"none",stroke:H,strokeWidth:ee-.5,strokeDasharray:"4,4",opacity:he,markerEnd:fe,className:P}),a.jsx("path",{d:ze,fill:"none",stroke:H,strokeWidth:ee-.5,strokeDasharray:"4,4",opacity:he,markerEnd:fe,className:P}),oe&&(ye||be)&&a.jsx("path",{d:Le,fill:"none",stroke:ye?de?"#06b6d4":"#ec4899":"#818cf8",strokeWidth:ee+4,opacity:.14,className:`${P} blur-[2px]`}),a.jsx("circle",{cx:W,cy:Ne,r:12,fill:p.theme==="steel-dark"?"#1e293b":"#f8fafc",stroke:H,strokeWidth:2,strokeDasharray:"3,2",opacity:he}),a.jsx("text",{x:W,y:Ne+3.5,fill:H,fontSize:10,fontWeight:"bold",fontFamily:"monospace",textAnchor:"middle",opacity:he,children:je}),p.showLabels&&Bs&&a.jsxs("g",{opacity:he,children:[a.jsx("rect",{x:yi-ki/2-2,y:bi-7,width:ki+4,height:11,rx:2,fill:p.theme==="steel-dark"?"#111827":"#ffffff",stroke:H,strokeWidth:.5,strokeOpacity:.4,opacity:.9}),a.jsx("text",{x:yi,y:bi+1,fill:p.theme==="steel-dark"?"#cbd5e1":"#1e293b",fontSize:8,fontFamily:"monospace",textAnchor:"middle",children:Bs})]}),p.showLabels&&Ws&&a.jsxs("g",{opacity:he,children:[a.jsx("rect",{x:vi-Si/2-2,y:wi-7,width:Si+4,height:11,rx:2,fill:p.theme==="steel-dark"?"#111827":"#ffffff",stroke:H,strokeWidth:.5,strokeOpacity:.4,opacity:.9}),a.jsx("text",{x:vi,y:wi+1,fill:p.theme==="steel-dark"?"#cbd5e1":"#1e293b",fontSize:8,fontFamily:"monospace",textAnchor:"middle",children:Ws})]})]},`ghost-${f.from}-${f.to}-${E}`)})]}),il.map(f=>{if(l.has(f.id))return null;const E=t[f.id];if(!E||Je(f.id))return null;const A=150/Math.max(.05,D),V=E.x>=at-A&&E.x<=ct+A&&E.y>=lt-A&&E.y<=De+A,L=n===f.id||i&&i.has(f.id),Y=r===f.id,G=w&&w.has(f.id),J=w&&w.size>0&&!G?"opacity-35 grayscale":"opacity-100";if(!V&&!L&&!Y&&S!==f.id&&!G)return null;const de=pe===null||pe.has(f.id);if(I&&pe&&!pe.has(f.id))return null;const ue=(ve.outgoing.get(f.id)||[]).length>0,ye=o.has(f.id),be=!!(oe&&pe&&pe.has(f.id)&&f.id!==oe),H=oe===f.id;let ee=tt[f.family]||tt.Profile;be&&(ee={bg:f.family==="ADR"?"bg-amber-200/95":f.family==="SPEC"?"bg-blue-200/95":f.family==="Feature"?"bg-indigo-200/95":f.family==="Claim"?"bg-purple-200/95":f.family==="Test"?"bg-rose-200/95":f.family==="Evidence"?"bg-emerald-200/95":f.family==="Release"?"bg-teal-200/95":f.family==="Boundary"?"bg-slate-200/95":f.family==="Risk"?"bg-orange-200/95":f.family==="Issue"?"bg-red-200/95":"bg-slate-300",text:f.family==="ADR"?"text-amber-950 font-extrabold":f.family==="SPEC"?"text-blue-950 font-extrabold":f.family==="Feature"?"text-indigo-950 font-extrabold":f.family==="Claim"?"text-purple-950 font-extrabold":f.family==="Test"?"text-rose-950 font-extrabold":f.family==="Evidence"?"text-emerald-950 font-extrabold":f.family==="Release"?"text-teal-950 font-extrabold":f.family==="Boundary"?"text-slate-950 font-extrabold":f.family==="Risk"?"text-orange-950 font-extrabold":f.family==="Issue"?"text-red-950 font-extrabold":"text-black",border:f.family==="ADR"?"border-amber-600":f.family==="SPEC"?"border-blue-600":f.family==="Feature"?"border-indigo-600":f.family==="Claim"?"border-purple-600":f.family==="Test"?"border-rose-600":f.family==="Evidence"?"border-emerald-600":f.family==="Release"?"border-teal-600":f.family==="Boundary"?"border-slate-700":f.family==="Risk"?"border-orange-600":f.family==="Issue"?"border-red-600":"border-slate-800",glow:"shadow-lg shadow-slate-350/50"});let he=L?"ring-4 ring-offset-2 ring-indigo-500 scale-105 z-40 shadow-indigo-400":Y?"ring-4 ring-offset-2 ring-teal-500 scale-105 z-40 shadow-teal-300":H?"ring-4 ring-offset-2 ring-indigo-600 scale-110 z-50 shadow-indigo-500 shadow-2xl font-black":be?`${ee.border} border-[3.5px] scale-105 z-30 shadow-xl`:G?"ring-4 ring-offset-1 ring-amber-500 shadow-amber-300 scale-105 animate-pulse z-35":"border-slate-300 border-2";p.theme==="steel-dark"&&!L&&!Y&&!H&&!be&&!G&&(he="border-slate-600 border");const fe=C?.find(W=>W.nodeIds.includes(f.id));return a.jsxs(nr.div,{id:`node-${f.id}`,className:`absolute graph-node-avatar group flex flex-col items-center justify-center ${P} ${de?"scale-100":"opacity-25 scale-90 blur-[1px]"} ${J}`,style:{left:E.x-30,top:E.y-30,width:60,height:60},onMouseEnter:()=>ne(f.id),onMouseLeave:()=>ne(null),onClick:W=>{W.stopPropagation(),!re.current&&d(f.id,W.shiftKey)},onPointerDown:W=>Pe(f.id,W),onPointerMove:W=>Is(f.id,W),onPointerUp:W=>Fs(f.id,W),onDoubleClick:W=>$s(f.id,W),title:s==="network"?"Drag to place - Double-click to unpin":"Drag to reposition",children:[fe&&a.jsxs("span",{className:"absolute -top-3 bg-slate-900 border border-slate-700 text-amber-300 font-extrabold px-1.5 py-0.2 rounded text-[7.5px] font-mono tracking-wider shadow z-50 whitespace-nowrap uppercase select-none",children:["* ",fe.label]}),a.jsxs("div",{className:`w-12 h-12 rounded-full flex items-center justify-center font-bold text-xs shadow-md transition-transform duration-200 relative ${S===f.id?"cursor-grabbing scale-110 shadow-2xl ring-4 ring-indigo-500":"cursor-grab hover:cursor-grab active:cursor-grabbing hover:scale-115 active:scale-95"} ${ee.bg} ${ee.text} ${he} ${ee.glow}`,children:[a.jsx("span",{className:"text-[10px] font-mono select-none pointer-events-none",children:f.family.substring(0,3).toUpperCase()}),ue&&a.jsx("button",{className:"absolute -bottom-1 -right-1 w-5 h-5 rounded-full bg-slate-800 text-white flex items-center justify-center border border-slate-600 hover:bg-slate-700 pointer-events-auto shadow-sm transition-colors z-20",onClick:W=>{W.stopPropagation(),h(f.id)},title:ye?"Expand Subtree":"Collapse Subtree",children:ye?a.jsx(yc,{size:10,className:"stroke-[3] text-emerald-400"}):a.jsx(ac,{size:10,className:"stroke-[3] text-slate-300"})}),a.jsx("button",{className:`absolute -top-1.5 -left-1.5 rounded-full w-5 h-5 flex items-center justify-center border shadow-sm transition-all pointer-events-auto z-30 ${E.fx!==null&&E.fx!==void 0?"bg-indigo-600 border-indigo-500 text-white hover:bg-indigo-700 scale-100 opacity-100":"bg-white border-slate-300 text-slate-400 opacity-0 group-hover:opacity-100 hover:text-slate-600 hover:bg-slate-50 scale-90 group-hover:scale-100"}`,onClick:W=>zs(f.id,W),title:E.fx!==null&&E.fx!==void 0?"Click to unpin node (Release physics)":"Click to pin node in current position",children:a.jsx(mc,{size:9,className:E.fx!==null&&E.fx!==void 0?"rotate-45 fill-white":"rotate-45"})}),es(f)&&(()=>{const W=es(f);return a.jsxs("div",{className:`absolute -top-1.5 -right-1.5 rounded-full w-5 h-5 flex items-center justify-center border border-white shadow-md z-30 pointer-events-none ${W.className}`,title:W.label,children:[W.icon==="fail"&&a.jsx(wt,{size:10,className:"stroke-[4] text-white"}),W.icon==="warn"&&a.jsx(_l,{size:10,className:"stroke-[3] text-white"}),W.icon==="verified"&&a.jsx(Ei,{size:10,className:"stroke-[4] text-white"}),W.icon==="pass"&&a.jsx(Ei,{size:10,className:"stroke-[4] text-white"})]})})(),a.jsx("button",{className:"absolute -bottom-1.5 -left-1.5 rounded-full w-5 h-5 bg-white border border-slate-300 text-slate-400 hover:text-rose-500 hover:border-rose-300 flex items-center justify-center shadow-sm transition-all pointer-events-auto z-30 scale-90 group-hover:scale-100 opacity-0 group-hover:opacity-100 hover:bg-rose-50 cursor-pointer",onClick:W=>{W.stopPropagation(),c(f.id)},title:"Hide this node from view",children:a.jsx(xr,{size:9,className:"stroke-[2.5]"})})]}),p.showLabels&&a.jsx("div",{className:`absolute top-13 pointer-events-none text-[10px] font-medium tracking-tight truncate max-w-[120px] text-center px-1.5 py-0.5 rounded shadow-sm border ${p.theme==="steel-dark"?"bg-slate-800 text-slate-200 border-slate-700":"bg-white text-slate-700 border-slate-200"}`,children:f.label||f.id})]},f.id)})]}),a.jsxs("div",{className:"absolute bottom-4 right-4 flex items-center gap-1.5 bg-slate-900/90 border border-slate-700/80 rounded-lg p-1.5 shadow-xl backdrop-blur-md z-10",children:[a.jsx("button",{onClick:()=>$(f=>Math.max(f/1.25,.15)),className:"canvas-button p-2 text-slate-300 hover:text-white rounded hover:bg-slate-800 transition",title:"Zoom Out",children:a.jsx($c,{size:16})}),a.jsx("button",{onClick:()=>$(f=>Math.min(f*1.25,3)),className:"canvas-button p-2 text-slate-300 hover:text-white rounded hover:bg-slate-800 transition",title:"Zoom In",children:a.jsx(Ic,{size:16})}),a.jsx("button",{onClick:nt,className:"canvas-button p-2 text-slate-300 hover:text-white rounded hover:bg-slate-800 transition",title:"Fit Viewport on Nodes",children:a.jsx(oc,{size:16})}),a.jsx("button",{onClick:Os,className:"canvas-button p-2 text-slate-300 hover:text-white rounded hover:bg-slate-850 transition",title:"Reset Zoom to 100%",children:a.jsx(wc,{size:16})}),s==="network"&&a.jsx("button",{onClick:()=>{const f={...t};Object.keys(f).forEach(E=>{f[E]={...f[E],fx:null,fy:null}}),m(f)},className:"canvas-button p-2 text-slate-300 hover:text-indigo-400 rounded hover:bg-slate-800 transition border-l border-slate-700 pl-2",title:"Unpin All Anchors (Release Physics)",children:a.jsx(hc,{size:16})}),l.size>0&&a.jsxs("button",{onClick:u,className:"canvas-button p-2 text-rose-400 hover:text-white rounded hover:bg-slate-800 transition border-l border-slate-700 pl-2 flex items-center gap-1 text-xs font-bold",title:`Reveal all ${l.size} hidden nodes`,children:[a.jsx(Zl,{size:15}),a.jsxs("span",{children:["Show All (",l.size,")"]})]})]}),a.jsxs("div",{className:`absolute bottom-4 left-4 pointer-events-none hidden lg:flex items-center gap-4 px-3 py-2 rounded-lg border shadow-lg z-10 font-sans backdrop-blur-md ${p.theme==="steel-dark"?"bg-slate-900/90 border-slate-700/80 text-slate-300":"bg-white/95 border-slate-200 text-slate-600"}`,children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-indigo-500 shadow-sm"}),a.jsx("span",{className:"text-[10px] font-semibold",children:"Active Layer Node"})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-emerald-500 shadow-sm"}),a.jsx("span",{className:"text-[10px] font-semibold",children:"Verified Proof"})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-rose-500 animate-pulse"}),a.jsx("span",{className:"text-[10px] font-semibold",children:"ValidationError"})]})]}),a.jsx(Ef,{children:p.showMinimap&&a.jsxs(nr.div,{initial:{opacity:0,scale:.95,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},transition:{duration:.18,ease:"easeOut"},className:`absolute top-4 right-4 rounded-xl border overflow-hidden shadow-2xl backdrop-blur-md z-30 transition-shadow duration-300 ${p.theme==="steel-dark"?"bg-slate-900/90 border-slate-800 shadow-indigo-950/25":"bg-white/95 border-slate-200/90 shadow-slate-200/40"}`,children:[a.jsxs("div",{className:`px-2.5 py-1.5 border-b flex items-center justify-between text-[9px] font-bold tracking-wider uppercase select-none ${p.theme==="steel-dark"?"border-slate-800 text-slate-400 bg-slate-950/40":"border-slate-100 text-slate-500 bg-slate-50/50"}`,children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(gr,{size:10,className:"text-indigo-500"}),a.jsx("span",{children:"Navigation Overview"})]}),a.jsxs("span",{className:"font-mono text-[8px] opacity-75",children:[Math.round(D*100),"%"]})]}),a.jsxs("div",{className:"relative cursor-crosshair overflow-hidden",style:{width:Ve,height:pt},onPointerDown:cl,onPointerMove:dl,onPointerUp:ul,children:[a.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[0.12]",style:{backgroundImage:`radial-gradient(${p.theme==="steel-dark"?"#ffffff":"#000000"} 1px, transparent 1px)`,backgroundSize:"12px 12px"}}),a.jsxs("svg",{width:"100%",height:"100%",className:"absolute inset-0 pointer-events-none",children:[xt.length<=400&&xt.map((f,E)=>{const A=t[f.from],V=t[f.to];if(!A||!V)return null;const L=rt(A.x,A.y),Y=rt(V.x,V.y);return a.jsx("line",{x1:L.x,y1:L.y,x2:Y.x,y2:Y.y,stroke:p.theme==="steel-dark"?"rgba(100, 116, 139, 0.3)":"rgba(148, 163, 184, 0.45)",strokeWidth:1},`mini-edge-${E}`)}),Ee.map(f=>{const E=t[f.id];if(!E)return null;const A=rt(E.x,E.y),V=n===f.id,L=r===f.id,Y=hl(f.family);return a.jsxs("g",{children:[(V||L)&&a.jsx("circle",{cx:A.x,cy:A.y,r:V?5.5:4.5,fill:"none",stroke:V?"#6366f1":"#14b8a6",strokeWidth:1.5}),a.jsx("circle",{cx:A.x,cy:A.y,r:V?3.2:L?2.5:2,fill:Y,opacity:V||L?1:.8})]},`mini-node-${f.id}`)})]}),a.jsx("div",{className:"absolute border border-indigo-500 bg-indigo-500/10 pointer-events-none transition-all duration-75",style:{left:pi,top:xi,width:al,height:ll,boxShadow:"0 0 8px rgba(99, 102, 241, 0.25)"}})]})]})})]})},Bm=["ADR","Spec","SPEC","Feature","Claim","Test","Evidence","Release","Boundary","Profile","Risk","Issue"],Wm=["ssot-core","ssot-origin","repo-local","extension-pack","generated","unknown"],Um=({payload:e,filters:t,onUpdateFilters:s,viewMode:n,onChangeViewMode:i,selectedRegistryKey:r,onChangeRegistry:o,registryOptions:l=[],allPacks:d,allTiers:h,allOriginKinds:c,filteredNodes:u,isCollapsed:m,onToggleCollapse:p,onSelectNode:x,onFocusNode:v,nodeLimit:k=300,onUpdateNodeLimit:T,egoHops:b=1,onUpdateEgoHops:w,isolateEgo:C=!1,onUpdateIsolateEgo:I})=>{const[M,F]=y.useState("search"),P=y.useMemo(()=>Array.from(new Set([...Bm,...e.nodes.map(S=>S.family)])),[e.nodes]),j=y.useMemo(()=>Array.from(new Set([...Wm,...c])),[c]),N=l.find(S=>S.key===r)?.label||e.package?.name||r,D=()=>{s({search:"",families:new Set(P),statuses:new Set,originKinds:new Set(j),tiers:new Set,packs:new Set,validationStatuses:new Set,edgeTypes:new Set})},$=()=>{s({search:"",families:new Set,statuses:new Set,originKinds:new Set,tiers:new Set,packs:new Set,validationStatuses:new Set,edgeTypes:new Set})},_=S=>{const g=new Set(t.families);g.has(S)?g.delete(S):g.add(S),s({...t,families:g})},B=S=>{const g=new Set(t.originKinds);g.has(S)?g.delete(S):g.add(S),s({...t,originKinds:g})},K=S=>{const g=new Set(t.tiers);g.has(S)?g.delete(S):g.add(S),s({...t,tiers:g})},X=S=>{const g=new Set(t.packs);g.has(S)?g.delete(S):g.add(S),s({...t,packs:g})},xe=S=>{const g=new Set(t.validationStatuses);g.has(S)?g.delete(S):g.add(S),s({...t,validationStatuses:g})},Z=S=>{const g=new Set(t.statuses);g.has(S)?g.delete(S):g.add(S),s({...t,statuses:g})},ne=y.useMemo(()=>{let S=0;return t.search&&S++,t.families.size<P.length&&(S+=P.length-t.families.size),t.originKinds.size<j.length&&(S+=j.length-t.originKinds.size),t.tiers.size>0&&(S+=t.tiers.size),t.packs.size>0&&(S+=t.packs.size),t.validationStatuses.size>0&&(S+=t.validationStatuses.size),t.statuses.size>0&&(S+=t.statuses.size),S},[t,P,j]);return m?a.jsxs("div",{className:"w-12 h-full border-r border-slate-200 bg-white flex flex-col items-center py-4 gap-4 shrink-0 overflow-hidden font-sans select-none shadow-[1px_0_6px_-2px_rgba(0,0,0,0.05)] z-10 animate-fadeIn",children:[a.jsx("button",{onClick:p,className:"p-1.5 hover:bg-slate-100 rounded-lg text-slate-500 hover:text-slate-800 transition",title:"Expand left sidebar",children:a.jsx(un,{size:18})}),a.jsx("div",{className:"w-6 border-b border-slate-100 my-1"}),a.jsxs("div",{className:"p-2 text-indigo-600 rounded-lg hover:bg-indigo-50/50 cursor-pointer transition relative group",onClick:p,title:`Active registry: ${N}. Click to expand and change.`,children:[a.jsx(Ai,{size:16}),a.jsxs("div",{className:"absolute left-14 top-1/2 -translate-y-1/2 bg-slate-800 text-white text-[10px] px-2 py-1 rounded shadow opacity-0 pointer-events-none group-hover:opacity-100 transition duration-150 whitespace-nowrap z-50 font-sans",children:["Active Registry: ",N]})]}),a.jsx("div",{className:"w-6 border-b border-slate-100 my-1"}),a.jsx("div",{className:"flex flex-col items-center gap-1",children:[{mode:"lineage",label:"Lineage Flow",icon:bs},{mode:"proof",label:"Proof Chain",icon:Ii},{mode:"origins",label:"Origins Mode",icon:Ri},{mode:"packs",label:"Packs Lineage",icon:Vi},{mode:"release",label:"Release Board",icon:Li},{mode:"validation",label:"Validation",icon:ys}].map(S=>{const g=S.icon,z=n===S.mode;return a.jsxs("button",{onClick:()=>i(S.mode),className:`p-2 rounded-lg transition relative group ${z?"bg-indigo-50 text-indigo-600":"text-slate-400 hover:text-slate-600 hover:bg-slate-50"}`,children:[a.jsx(g,{size:16}),a.jsx("div",{className:"absolute left-14 top-1/2 -translate-y-1/2 bg-slate-800 text-white text-[10px] px-2 py-1 rounded shadow opacity-0 pointer-events-none group-hover:opacity-100 transition duration-150 whitespace-nowrap z-50 font-sans",children:S.label})]},S.mode)})}),a.jsx("div",{className:"flex-1"}),ne>0&&a.jsxs("button",{onClick:D,className:"p-2 bg-amber-50 hover:bg-amber-100 text-amber-600 rounded-lg transition relative group",title:"Reset active filters",children:[a.jsx(Di,{size:14,className:"animate-spin-hover"}),a.jsx("span",{className:"absolute -top-1 -right-1 bg-amber-600 text-white text-[8px] font-bold w-4 h-4 rounded-full flex items-center justify-center border border-white",children:ne}),a.jsxs("div",{className:"absolute left-14 top-1/2 -translate-y-1/2 bg-slate-800 text-white text-[10px] px-2 py-1 rounded shadow opacity-0 pointer-events-none group-hover:opacity-100 transition duration-150 whitespace-nowrap z-50 font-sans",children:["Reset ",ne," filters"]})]})]}):a.jsxs("div",{className:"w-80 h-full border-r border-slate-200 bg-white flex flex-col shrink-0 overflow-hidden font-sans select-none shadow-[2px_0_12px_-4px_rgba(0,0,0,0.06)] z-10",children:[a.jsxs("div",{className:"p-4 border-b border-slate-100 bg-slate-50/70",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ai,{size:18,className:"text-indigo-600"}),a.jsx("h2",{className:"text-sm font-bold tracking-tight text-slate-800",children:"SSOT Registry Scope"})]}),a.jsx("button",{onClick:p,className:"p-1 hover:bg-slate-200/60 rounded text-slate-400 hover:text-slate-600 transition",title:"Collapse left sidebar",children:a.jsx(pr,{size:16})})]}),a.jsx("select",{value:r,onChange:S=>o(S.target.value),className:"w-full bg-white border border-slate-200 rounded-md py-1.5 px-2.5 text-xs text-slate-700 font-medium focus:ring-1 focus:ring-indigo-500 focus:outline-none",children:l.length>0?l.map(S=>a.jsx("option",{value:S.key,children:S.label},S.key)):a.jsx("option",{value:r,children:N})})]}),a.jsxs("div",{className:"flex border-b border-slate-100 text-xs font-semibold text-slate-500 bg-white",children:[a.jsx("button",{onClick:()=>F("search"),className:`flex-1 py-3 text-center border-b-2 transition ${M==="search"?"border-indigo-600 text-indigo-600 bg-slate-50/20 font-bold":"border-transparent hover:text-slate-800"}`,children:"Index & Search"}),a.jsxs("button",{onClick:()=>F("filters"),className:`flex-1 py-3 text-center border-b-2 transition flex items-center justify-center gap-1.5 ${M==="filters"?"border-indigo-600 text-indigo-600 bg-slate-50/20 font-bold":"border-transparent hover:text-slate-800"}`,children:["Filters",ne>0&&a.jsx("span",{className:"bg-indigo-100 text-indigo-700 text-[10px] px-1.5 py-0.2 rounded-full font-bold",children:ne})]}),a.jsx("button",{onClick:()=>F("limits"),className:`flex-1 py-3 text-center border-b-2 transition flex items-center justify-center gap-1.5 ${M==="limits"?"border-indigo-600 text-indigo-600 bg-slate-50/20 font-bold":"border-transparent hover:text-slate-800"}`,children:"Limits"})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[M==="search"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx("span",{className:"absolute inset-y-0 left-3 flex items-center pointer-events-none text-slate-400",children:a.jsx(jc,{size:14})}),a.jsx("input",{type:"text",placeholder:"Search IDs, labels, files, summaries...",value:t.search,onChange:S=>s({...t,search:S.target.value}),className:"w-full bg-slate-50 border border-slate-200 rounded-lg py-2 pl-9 pr-8 text-xs text-slate-700 focus:bg-white focus:outline-none focus:ring-1 focus:ring-indigo-500 transition-all font-mono"}),t.search&&a.jsx("button",{onClick:()=>s({...t,search:""}),className:"absolute inset-y-0 right-2.5 flex items-center text-slate-400 hover:text-slate-600",children:a.jsx(wt,{size:14})})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-400 mb-2 font-mono",children:"Lineage View Modes"}),a.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:[{mode:"network",label:"Network Force",icon:cc},{mode:"lineage",label:"Lineage Flow",icon:bs},{mode:"flow-force",label:"Flow Force",icon:Di},{mode:"proof",label:"Proof Chain",icon:Ii},{mode:"origins",label:"Origins Mode",icon:Ri},{mode:"packs",label:"Packs Lineage",icon:Vi},{mode:"release",label:"Release Board",icon:Li},{mode:"validation",label:"Validation",icon:ys}].map(S=>{const g=S.icon,z=n===S.mode;return a.jsxs("button",{onClick:()=>i(S.mode),className:`flex items-center gap-1.5 px-2.5 py-2 rounded-md text-left text-xs transition border ${z?"bg-indigo-50 text-indigo-700 border-indigo-200 font-semibold":"bg-white text-slate-600 border-slate-100 hover:bg-slate-50"}`,children:[a.jsx(g,{size:12,className:z?"text-indigo-600":"text-slate-400"}),a.jsx("span",{children:S.label})]},S.mode)})})]}),a.jsxs("div",{children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsxs("h3",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-400 font-mono",children:["Registry Index (",u.length,")"]})}),u.length===0?a.jsx("div",{className:"text-center py-6 bg-slate-50 rounded-lg border border-slate-100",children:a.jsx("span",{className:"text-[11px] text-slate-500 font-mono",children:"No registry nodes match filters."})}):a.jsxs("div",{className:"space-y-1.5 max-h-[280px] overflow-y-auto pr-1",children:[u.slice(0,250).map((S,g)=>{const z=tt[S.family];return a.jsxs("div",{onClick:()=>{x&&x(S.id),v&&v(S.id);const se=document.getElementById(`node-${S.id}`);se&&(se.click(),se.scrollIntoView({behavior:"smooth",block:"center"}))},className:"p-2 border border-slate-100 rounded-md hover:bg-slate-50 hover:border-slate-200 cursor-pointer transition flex items-center justify-between",children:[a.jsxs("div",{className:"truncate pr-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[a.jsx("span",{className:`text-[8px] font-mono font-bold px-1 rounded-sm uppercase ${z?.bg||"bg-slate-100"} ${z?.text||"text-slate-700"}`,children:S.family}),a.jsx("span",{className:"text-[10px] font-bold text-slate-700 font-mono truncate",children:S.id})]}),a.jsx("p",{className:"text-[10px] text-slate-500 truncate max-w-[200px]",children:S.label||S.title})]}),a.jsxs("span",{className:"text-[9px] text-slate-400 font-mono shrink-0 font-bold bg-slate-50 px-1 py-0.5 rounded border border-slate-100",children:["dg:",S.degree||0]})]},`${S.id}-${g}`)}),u.length>250&&a.jsxs("div",{className:"text-center py-2 bg-indigo-50/40 rounded border border-dashed border-indigo-100/50 mt-1",children:[a.jsxs("p",{className:"text-[9px] text-indigo-700 font-mono font-medium",children:["Showing first 250 of ",u.length," matches."]}),a.jsx("p",{className:"text-[8px] text-slate-400",children:"Type in search box to filter details further."})]})]})]})]}),M==="filters"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-slate-100 pb-2",children:[a.jsxs("span",{className:"text-xs font-bold text-slate-700 flex items-center gap-1",children:[a.jsx(hn,{size:12,className:"text-indigo-600"}),"Active Filters"]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("button",{onClick:$,className:"text-[10px] text-slate-400 hover:text-rose-600 font-mono font-bold flex items-center gap-0.5 transition cursor-pointer",title:"Uncheck all checkboxes",children:"Clear"}),a.jsx("span",{className:"text-[10px] text-slate-300 font-mono font-bold select-none",children:"|"}),a.jsx("button",{onClick:D,className:"text-[10px] text-slate-400 hover:text-indigo-600 font-mono font-bold flex items-center gap-0.5 transition cursor-pointer",title:"Default checkboxes state",children:"Reset"})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("h4",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-400 font-mono",children:"Entity Family Filters"}),a.jsx("div",{className:"flex flex-wrap gap-1.5",children:P.map(S=>{const g=t.families.has(S),z=tt[S];return a.jsxs("button",{onClick:()=>_(S),className:`text-[10px] font-medium px-2 py-1 rounded transition border flex items-center gap-1 ${g?`${z?.bg||"bg-slate-100"} ${z?.text||"text-slate-700"} ${z?.border||"border-slate-300"} border-2 font-bold`:"bg-white text-slate-500 border-slate-200 hover:bg-slate-50"}`,children:[a.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${z?.bg||"bg-slate-400"}`}),S]},S)})})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("h4",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-400 font-mono",children:"Provenance Origin Kind"}),a.jsx("div",{className:"space-y-1",children:j.map(S=>{const g=t.originKinds.has(S);return a.jsxs("label",{className:"flex items-center gap-2 text-xs text-slate-600 cursor-pointer hover:text-slate-800",children:[a.jsx("input",{type:"checkbox",checked:g,onChange:()=>B(S),className:"rounded text-indigo-600 focus:ring-indigo-500 w-3.5 h-3.5 border-slate-300"}),a.jsx("span",{className:"font-mono text-[11px] truncate capitalize",children:S.replace("-"," ")})]},S)})})]}),h.length>0&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("h4",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-400 font-mono",children:"SLA Compliance Tiers"}),a.jsx("div",{className:"space-y-1",children:h.map(S=>{const g=t.tiers.has(S);return a.jsxs("label",{className:"flex items-center gap-2 text-xs text-slate-600 cursor-pointer hover:text-slate-800",children:[a.jsx("input",{type:"checkbox",checked:g,onChange:()=>K(S),className:"rounded text-indigo-600 focus:ring-indigo-500 w-3.5 h-3.5 border-slate-300"}),a.jsx("span",{className:"font-mono text-[11px]",children:S})]},S)})})]}),d.length>0&&a.jsxs("div",{className:"space-y-1.5 border-t border-slate-100 pt-3",children:[a.jsx("h4",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-400 font-mono",children:"Governance Registry Packs"}),a.jsx("div",{className:"space-y-1 max-h-[140px] overflow-y-auto pr-1",children:d.map(S=>{const g=t.packs.has(S);return a.jsxs("label",{className:"flex items-center gap-2 text-xs text-slate-600 cursor-pointer hover:text-slate-800",children:[a.jsx("input",{type:"checkbox",checked:g,onChange:()=>X(S),className:"rounded text-indigo-600 focus:ring-indigo-500 w-3.5 h-3.5 border-slate-300"}),a.jsx("span",{className:"font-mono text-[11px] truncate flex-1",title:S,children:S})]},S)})})]}),a.jsxs("div",{className:"space-y-1.5 border-t border-slate-100 pt-3",children:[a.jsx("h4",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-400 font-mono",children:"Validation Outcome Filters"}),a.jsx("div",{className:"space-y-1",children:[{key:"pass",label:"Pass (Certified No Drift)",color:"text-emerald-600 bg-emerald-50"},{key:"warn",label:"Warn (Minor Compliance Gaps)",color:"text-amber-600 bg-amber-50"},{key:"fail",label:"Fail (Critical Blockers)",color:"text-red-600 bg-red-50"},{key:"unknown",label:"Unvalidated Entries",color:"text-slate-500 bg-slate-50"}].map(S=>{const g=t.validationStatuses.has(S.key);return a.jsxs("label",{className:"flex items-center gap-2 text-xs text-slate-600 cursor-pointer hover:text-slate-800",children:[a.jsx("input",{type:"checkbox",checked:g,onChange:()=>xe(S.key),className:"rounded text-indigo-600 focus:ring-indigo-500 w-3.5 h-3.5 border-slate-300"}),a.jsxs("span",{className:"font-mono text-[11px] flex-1 flex items-center justify-between",children:[a.jsx("span",{children:S.key.toUpperCase()}),a.jsx("span",{className:`text-[9px] px-1 py-0.2 rounded scale-90 ${S.color}`,children:S.label})]})]},S.key)})})]}),a.jsxs("div",{className:"space-y-1.5 border-t border-slate-100 pt-3",children:[a.jsx("h4",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-400 font-mono",children:"Lifecycle Compliance Status"}),a.jsx("div",{className:"space-y-1",children:["active","certified","deprecated","experimental"].map(S=>{const g=t.statuses.has(S);return a.jsxs("label",{className:"flex items-center gap-2 text-xs text-slate-600 cursor-pointer hover:text-slate-800",children:[a.jsx("input",{type:"checkbox",checked:g,onChange:()=>Z(S),className:"rounded text-indigo-600 focus:ring-indigo-500 w-3.5 h-3.5 border-slate-300"}),a.jsx("span",{className:"font-mono text-[11px] capitalize",children:S})]},S)})})]})]}),M==="limits"&&a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-center justify-between border-b border-slate-100 pb-2",children:a.jsxs("span",{className:"text-xs font-bold text-slate-700 flex items-center gap-1",children:[a.jsx(hn,{size:12,className:"text-indigo-600"}),"Workspace Limits"]})}),a.jsxs("div",{className:"bg-slate-50 rounded-lg p-3 border border-slate-150 space-y-4",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[a.jsx("span",{className:"text-slate-600 font-medium",children:"Render Node Limit"}),a.jsx("span",{className:"font-mono text-indigo-600 font-bold whitespace-nowrap",children:k>5e3?"Unlimited":`${k} Nodes`})]}),a.jsx("input",{type:"range",min:"50",max:"500",step:"50",value:k>5e3?500:k,onChange:S=>{const g=parseInt(S.target.value);T?.(g===500?999999:g)},className:"w-full accent-indigo-600 cursor-pointer h-1 bg-slate-200 rounded-lg focus:outline-none"}),a.jsxs("div",{className:"flex justify-between text-[8px] text-slate-400 font-mono",children:[a.jsx("span",{children:"50"}),a.jsx("span",{children:"150"}),a.jsx("span",{children:"300"}),a.jsx("span",{children:"Unlimited"})]})]}),a.jsxs("div",{className:"space-y-1.5 pt-3 border-t border-slate-200/50",children:[a.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[a.jsx("span",{className:"text-slate-600 font-medium",children:"Ego-Focus Hops Limit"}),a.jsxs("span",{className:"font-mono text-indigo-600 font-bold",children:[b," ",b===1?"Hop":"Hops"]})]}),a.jsx("div",{className:"flex gap-1.5",children:[1,2,3,4].map(S=>a.jsx("button",{onClick:()=>w?.(S),className:`flex-1 py-1 rounded text-xs font-mono transition font-bold border cursor-pointer ${b===S?"bg-indigo-600 border-indigo-750 text-white":"bg-white border-slate-200 text-slate-600 hover:bg-slate-50"}`,children:S},S))}),a.jsx("p",{className:"text-[10px] text-slate-400 mt-1 leading-relaxed",children:"Deepens or constrains the neighbor-traversal range (hops) when filtering the central active ego node."})]}),a.jsxs("div",{className:"space-y-1.5 pt-3 border-t border-slate-200/50",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[11px] text-slate-600 font-medium",children:"Isolate Active Focus"}),a.jsx("button",{onClick:()=>I?.(!C),className:`relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none ${C?"bg-indigo-600":"bg-slate-200"}`,children:a.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out ${C?"translate-x-4":"translate-x-0"}`})})]}),a.jsx("p",{className:"text-[10px] text-slate-400 leading-relaxed",children:"When enabled, completely hides any nodes and ribbons outside of the active focus neighborhood."})]})]})]})]}),a.jsxs("div",{className:"p-4 border-t border-slate-100 bg-slate-50",children:[a.jsxs("div",{className:"flex items-center justify-between text-[11px] text-slate-500 font-mono mb-2",children:[a.jsxs("span",{children:["Schema: v",e.schemaVersion||"2.4.0"]}),a.jsxs("span",{children:["Edges: ",e.edges.length||0]})]}),a.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-slate-500 font-mono",children:[a.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500 animate-pulse"}),a.jsx("span",{children:"Registry Status: 100% VALIDATED"})]})]})]})},Hm=({payload:e,selectedNodeId:t,focusNodeId:s,onSelectNode:n,onSetFocusNode:i,onClearFocusNode:r,isCollapsed:o,onToggleCollapse:l})=>{const[d,h]=y.useState(null),c=y.useMemo(()=>{const v=new Map;return e.nodes.forEach(k=>v.set(k.id,k)),v},[e.nodes]),u=y.useMemo(()=>t&&c.get(t)||null,[t,c]),m=y.useMemo(()=>{if(!t)return{incoming:[],outgoing:[]};const v=[],k=[];return e.edges.forEach(T=>{if(T.to===t){const b=c.get(T.from);b&&v.push({node:b,edge:T})}if(T.from===t){const b=c.get(T.to);b&&k.push({node:b,edge:T})}}),{incoming:v,outgoing:k}},[t,c,e.edges]),p=(v,k)=>{navigator.clipboard.writeText(v),h(k),setTimeout(()=>h(null),2e3)};if(o)return a.jsxs("div",{className:"w-12 h-full border-l border-slate-200 bg-slate-50 flex flex-col items-center py-4 gap-4 shrink-0 overflow-hidden font-sans select-none shadow-[-1px_0_6px_-2px_rgba(0,0,0,0.05)] z-10 animate-fadeIn",children:[a.jsx("button",{onClick:l,className:"p-1.5 hover:bg-slate-200 rounded-lg text-slate-500 hover:text-slate-800 transition",title:"Expand inspector panel",children:a.jsx(pr,{size:18})}),a.jsx("div",{className:"w-6 border-b border-slate-200/60 my-1"}),u?a.jsxs("div",{className:"flex flex-col items-center gap-4 flex-1 w-full relative",children:[a.jsx("div",{className:`w-3.5 h-3.5 rounded-full relative group cursor-pointer shadow-sm border border-slate-200 ${tt[u.family]?.bg||"bg-indigo-400"}`,onClick:l,children:a.jsxs("div",{className:"absolute right-14 top-1/2 -translate-y-1/2 bg-slate-800 text-white text-[10px] px-2.5 py-1 rounded-md shadow-lg opacity-0 pointer-events-none group-hover:opacity-100 transition duration-150 whitespace-nowrap z-50 font-sans font-medium",children:[u.family,": ",u.id]})}),a.jsxs("button",{onClick:()=>p(u.id,"ID"),className:"p-2 text-slate-400 hover:text-slate-600 hover:bg-slate-200/50 rounded-lg transition relative group",children:[a.jsx(At,{size:14}),a.jsx("div",{className:"absolute right-14 top-1/2 -translate-y-1/2 bg-slate-800 text-white text-[10px] px-2.5 py-1 rounded-md shadow-lg opacity-0 pointer-events-none group-hover:opacity-100 transition duration-150 whitespace-nowrap z-50 font-sans",children:d==="ID"?"Copied!":"Copy Node ID"})]}),u.id!==s?a.jsxs("button",{onClick:()=>i(u.id),className:"p-2 text-teal-600 hover:text-teal-800 hover:bg-teal-50 rounded-lg transition relative group",children:[a.jsx(Pi,{size:14}),a.jsx("div",{className:"absolute right-14 top-1/2 -translate-y-1/2 bg-slate-800 text-white text-[10px] px-2.5 py-1 rounded-md shadow-lg opacity-0 pointer-events-none group-hover:opacity-100 transition duration-150 whitespace-nowrap z-50 font-sans",children:"Focus Node"})]}):a.jsxs("button",{onClick:r,className:"p-2 text-amber-600 hover:text-amber-800 hover:bg-amber-50 rounded-lg transition relative group",children:[a.jsx(wt,{size:14}),a.jsx("div",{className:"absolute right-14 top-1/2 -translate-y-1/2 bg-slate-800 text-white text-[10px] px-2.5 py-1 rounded-md shadow-lg opacity-0 pointer-events-none group-hover:opacity-100 transition duration-150 whitespace-nowrap z-50 font-sans",children:"Unfocus"})]}),a.jsx("div",{className:"flex-1"}),a.jsxs("button",{onClick:()=>n(null),className:"p-2 text-slate-400 hover:text-rose-600 hover:bg-rose-50 rounded-lg transition relative group",children:[a.jsx(Rc,{size:14}),a.jsx("div",{className:"absolute right-14 top-1/2 -translate-y-1/2 bg-slate-800 text-white text-[10px] px-2.5 py-1 rounded-md shadow-lg opacity-0 pointer-events-none group-hover:opacity-100 transition duration-150 whitespace-nowrap z-50 font-sans",children:"Deselect Node"})]})]}):a.jsxs("div",{className:"flex flex-col items-center gap-4 flex-1 justify-center opacity-45",children:[a.jsx(ys,{size:16,className:"text-slate-400 animate-pulse"}),a.jsx("span",{className:"text-[9px] text-slate-400 font-extrabold tracking-widest uppercase pointer-events-none select-none [writing-mode:vertical-lr] my-auto rotate-180",children:"Inspector Empty"})]})]});if(!u)return a.jsxs("div",{className:"w-80 h-full border-l border-slate-200 bg-slate-50 flex flex-col items-center justify-center p-6 text-center select-none shrink-0 shadow-[-2px_0_12px_-4px_rgba(0,0,0,0.04)] relative",children:[a.jsx("button",{onClick:l,className:"absolute top-4 right-4 p-1.5 hover:bg-slate-200/60 text-slate-400 hover:text-slate-600 rounded-lg transition",title:"Collapse inspector",children:a.jsx(un,{size:16})}),a.jsx(ys,{size:32,className:"text-slate-300 mb-2 animate-pulse"}),a.jsx("p",{className:"text-xs font-semibold text-slate-500",children:"No Element Selected"}),a.jsx("p",{className:"text-[10px] text-slate-400 max-w-[200px] mt-1",children:"Click any circular node in the lineage graph to view source provenance, tests, claims, and relations."})]});const x=tt[u.family]||tt.Profile;return a.jsxs("div",{className:"w-80 h-full border-l border-slate-200 bg-white flex flex-col shrink-0 overflow-hidden font-sans shadow-[-2px_0_12px_-4px_rgba(0,0,0,0.06)] z-10 animate-slideIn",children:[a.jsxs("div",{className:"p-4 border-b border-slate-100 flex items-center justify-between bg-slate-50/40",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:`text-[9px] font-mono font-extrabold px-1.5 py-0.5 rounded uppercase ${x.bg} ${x.text} border ${x.border}`,children:u.family}),a.jsx("span",{className:"text-xs font-bold text-slate-800 font-mono truncate max-w-[125px]",children:u.id})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{onClick:l,className:"text-slate-400 hover:text-slate-600 p-1 hover:bg-slate-100 rounded-lg transition",title:"Collapse inspector",children:a.jsx(un,{size:15})}),a.jsx("button",{onClick:()=>n(null),className:"text-slate-400 hover:text-slate-600 p-1 hover:bg-slate-100 rounded-full transition",title:"Close Inspector",children:a.jsx(wt,{size:15})})]})]}),a.jsxs("div",{className:"px-4 py-2 bg-slate-50 border-b border-slate-100 flex items-center gap-1.5",children:[a.jsxs("button",{onClick:()=>p(u.id,"ID"),className:"flex-1 py-1 px-2.5 text-[9px] font-mono font-bold text-slate-600 bg-white border border-slate-200 rounded hover:bg-slate-100 hover:text-slate-800 transition flex items-center justify-center gap-1",title:"Copy node ID to clipboard",children:[a.jsx(At,{size:10}),a.jsx("span",{children:d==="ID"?"Copied!":"Copy Node ID"})]}),u.id!==s?a.jsxs("button",{onClick:()=>i(u.id),className:"flex-1 py-1 px-2.5 text-[9px] font-bold text-teal-700 bg-teal-50/60 border border-teal-200 rounded hover:bg-teal-100 hover:text-teal-900 transition flex items-center justify-center gap-1",title:"Focus graph layout center around this node",children:[a.jsx(Pi,{size:11}),a.jsx("span",{children:"Focus Node"})]}):a.jsxs("button",{onClick:r,className:"flex-1 py-1 px-2.5 text-[9px] font-bold text-amber-700 bg-amber-50/60 border border-amber-200 rounded hover:bg-amber-100 hover:text-amber-900 transition flex items-center justify-center gap-1",title:"Clear manual layout focus center",children:[a.jsx(wt,{size:10}),a.jsx("span",{children:"Unfocus"})]})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("h1",{className:"text-xs font-bold text-slate-800",children:u.title||u.label||u.id}),u.body?a.jsx("div",{className:"bg-slate-50/80 border border-slate-200/60 rounded-lg p-3 text-[10.5px] leading-relaxed text-slate-600 font-mono whitespace-pre-wrap max-h-48 overflow-y-auto shadow-inner",children:u.body}):a.jsx("p",{className:"text-[11px] leading-relaxed text-slate-500",children:u.description||u.summary||"No description document supplied in registry payload definition."})]}),a.jsxs("div",{className:"bg-slate-50/70 border border-slate-100 rounded-lg p-2.5 space-y-1.5",children:[a.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[a.jsx("span",{className:"text-slate-400 font-medium",children:"Compliance status"}),a.jsx("span",{className:"font-mono uppercase font-bold text-indigo-600 bg-indigo-50 px-1.5 py-0.5 rounded text-[9px]",children:u.status||"active"})]}),u.tier&&a.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[a.jsx("span",{className:"text-slate-400 font-medium",children:"SLA Tier level"}),a.jsx("span",{className:"font-mono text-[9px] text-slate-600 font-semibold",children:u.tier})]}),u.proof?.completeness!==void 0&&a.jsxs("div",{className:"space-y-1 pt-1.5 border-t border-slate-200/50",children:[a.jsxs("div",{className:"flex items-center justify-between text-[10px] font-mono",children:[a.jsx("span",{className:"text-slate-500 font-bold",children:"Proof Progress"}),a.jsxs("span",{className:"text-slate-700 font-black",children:[u.proof.completeness,"%"]})]}),a.jsx("div",{className:"w-full bg-slate-200 h-1 rounded-full overflow-hidden",children:a.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${u.proof.completeness===100?"bg-emerald-500":"bg-indigo-500"}`,style:{width:`${u.proof.completeness}%`}})})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("h3",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-400 font-mono",children:"Origin Provenance"}),a.jsxs("div",{className:"text-xs border border-slate-100 rounded-lg p-2.5 space-y-1 bg-white",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-slate-400 text-[10px]",children:"Registry package:"}),a.jsx("span",{className:"font-mono text-[10px] text-slate-600 capitalize",children:u.originKind||"Local"})]}),u.path&&a.jsxs("div",{className:"space-y-1 pt-1",children:[a.jsx("div",{className:"text-slate-400 text-[10px]",children:"File path:"}),a.jsxs("div",{className:"flex items-center gap-1 bg-slate-50 hover:bg-slate-100 p-1 rounded border border-slate-200/50",children:[a.jsx(ec,{size:10,className:"text-slate-400"}),a.jsx("span",{className:"font-mono text-[10px] text-slate-700 truncate select-all flex-1",children:u.path}),a.jsx("button",{onClick:()=>p(u.path||"","FilePath"),className:"p-0.5 text-slate-400 hover:text-slate-700",title:"Copy relative file coordinate path",children:a.jsx(At,{size:9})})]})]})]})]}),u.validation&&u.validation.status!=="pass"&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("h3",{className:"text-[10px] font-bold uppercase tracking-wider text-red-500 font-mono flex items-center gap-1",children:[a.jsx(Mc,{size:12}),"Validation Warnings"]}),a.jsx("div",{className:"bg-red-50/50 border border-red-100 rounded-lg p-2.5 space-y-1.5 max-h-[140px] overflow-y-auto",children:(u.validation.issues||[]).map((v,k)=>a.jsxs("div",{className:"text-[10px] text-red-700 leading-relaxed font-mono flex items-start gap-1",children:[a.jsx("span",{children:"-"}),a.jsx("span",{children:v})]},k))})]}),a.jsxs("div",{className:"space-y-3 pt-1 border-t border-slate-100",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("h3",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-400 font-mono",children:["Upstream Ancestors (",m.incoming.length,")"]}),m.incoming.length===0?a.jsx("p",{className:"text-[10px] text-slate-400 italic",children:"No incoming connections."}):a.jsx("div",{className:"space-y-1",children:m.incoming.map(({node:v,edge:k},T)=>{const b=tt[v.family];return a.jsxs("div",{onClick:()=>n(v.id),className:"p-1 px-2 border border-slate-100 rounded hover:bg-slate-50 cursor-pointer flex items-center justify-between text-[11px] transition",children:[a.jsxs("div",{className:"flex items-center gap-1.5 truncate max-w-[160px]",children:[a.jsx("span",{className:`text-[8px] font-mono px-1 rounded uppercase ${b?.bg} ${b?.text}`,children:v.family.substring(0,3)}),a.jsx("span",{className:"font-mono text-[10px] font-semibold text-slate-700 truncate",children:v.id})]}),a.jsx("span",{className:"text-[9px] text-indigo-500 font-mono font-bold lowercase",children:k.type||"drives"})]},`${v.id}-${k.type||"incoming"}-${T}`)})})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("h3",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-400 font-mono",children:["Downstream Relations (",m.outgoing.length,")"]}),m.outgoing.length===0?a.jsx("p",{className:"text-[10px] text-slate-400 italic",children:"No outgoing connections."}):a.jsx("div",{className:"space-y-1",children:m.outgoing.map(({node:v,edge:k},T)=>{const b=tt[v.family];return a.jsxs("div",{onClick:()=>n(v.id),className:"p-1 px-2 border border-slate-100 rounded hover:bg-slate-50 cursor-pointer flex items-center justify-between text-[11px] transition",children:[a.jsxs("div",{className:"flex items-center gap-1.5 truncate max-w-[160px]",children:[a.jsx("span",{className:`text-[8px] font-mono px-1 rounded uppercase ${b?.bg} ${b?.text}`,children:v.family.substring(0,3)}),a.jsx("span",{className:"font-mono text-[10px] font-semibold text-slate-700 truncate",children:v.id})]}),a.jsx("span",{className:"text-[9px] text-slate-400 font-mono font-bold lowercase",children:k.type||"triggers"})]},`${v.id}-${k.type||"outgoing"}-${T}`)})})]})]})]})]})},Ym=()=>{const[e,t]=y.useState("api"),[s,n]=y.useState(null),i=(d,h)=>{navigator.clipboard.writeText(d),n(h),setTimeout(()=>n(null),2e3)},r=`import { LineageGraphApp } from "@ssot-registry/lineage-graph";
|
|
24
|
+
import { LineagePayload } from "./types";
|
|
25
|
+
|
|
26
|
+
const payload: LineagePayload = {
|
|
27
|
+
schemaVersion: "2.4.0",
|
|
28
|
+
generatedAt: "2026-06-21T21:00:00-07:00",
|
|
29
|
+
nodes: [
|
|
30
|
+
{ id: "adr:01", family: "ADR", label: "ADR-01: Offline Portability", status: "active" },
|
|
31
|
+
{ id: "spec:01", family: "SPEC", label: "SPEC: Schema v2", status: "certified" }
|
|
32
|
+
],
|
|
33
|
+
edges: [
|
|
34
|
+
{ from: "adr:01", to: "spec:01", type: "defines" }
|
|
35
|
+
]
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default function App() {
|
|
39
|
+
return (
|
|
40
|
+
<div className="w-screen h-screen">
|
|
41
|
+
<LineageGraphApp
|
|
42
|
+
payload={payload}
|
|
43
|
+
defaultMode="lineage"
|
|
44
|
+
theme="light"
|
|
45
|
+
/>
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
}`,o=`def _lineage_payload(self) -> dict:
|
|
49
|
+
"""
|
|
50
|
+
Python backend generator mapping active compliance records
|
|
51
|
+
into standard LineagePayload JSON contracts.
|
|
52
|
+
"""
|
|
53
|
+
nodes = []
|
|
54
|
+
edges = []
|
|
55
|
+
|
|
56
|
+
# Trace ADRs, SPECs, Features, and releases to build proof chains
|
|
57
|
+
for entity in self.registry.get_entities():
|
|
58
|
+
nodes.append({
|
|
59
|
+
"id": entity.id,
|
|
60
|
+
"family": entity.family,
|
|
61
|
+
"label": entity.label,
|
|
62
|
+
"status": entity.status,
|
|
63
|
+
"originKind": "repo-local" if entity.is_local else "ssot-origin",
|
|
64
|
+
"path": entity.relative_path
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
for link in self.registry.get_links():
|
|
68
|
+
edges.append({
|
|
69
|
+
"from": link.source_id,
|
|
70
|
+
"to": link.target_id,
|
|
71
|
+
"type": link.relationship_type,
|
|
72
|
+
"status": "active"
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
"schemaVersion": "2.4.0",
|
|
77
|
+
"generatedAt": "2026-06-21T22:20:00-07:00",
|
|
78
|
+
"nodes": nodes,
|
|
79
|
+
"edges": edges,
|
|
80
|
+
"registry": { "validationStatus": "valid" }
|
|
81
|
+
}`,l="uv run ssot graph lineage . --output .ssot/graphs/registry.lineage.html";return a.jsxs("div",{className:"flex-1 bg-slate-50 overflow-y-auto font-sans p-6",children:[a.jsxs("div",{className:"max-w-4xl mx-auto mb-8 bg-gradient-to-r from-indigo-700 to-indigo-900 border border-indigo-950 p-6 rounded-2xl shadow-xl text-white",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx(mr,{className:"text-indigo-200 animate-pulse",size:24}),a.jsx("span",{className:"text-[10px] font-mono tracking-widest text-indigo-200 uppercase bg-indigo-800/80 px-2.5 py-0.5 rounded-full font-bold",children:"Interactive Documentation System"})]}),a.jsx("h1",{className:"text-xl sm:text-2xl font-extrabold tracking-tight",children:"@ssot-registry/lineage-graph"}),a.jsx("p",{className:"text-sm text-indigo-100 max-w-2xl mt-1.5 leading-relaxed",children:"The canonical visual React workspace for proving, validating, and explaining how Single Source of Truth repositories release certified products. Fully typed, offline capable, rendering with high-speed coordinate canvas bounds."}),a.jsxs("div",{className:"flex bg-indigo-950/40 p-1 rounded-lg mt-6 max-w-md border border-indigo-800/40",children:[a.jsx("button",{onClick:()=>t("api"),className:`flex-1 py-1.5 px-3 rounded text-xs font-semibold select-none transition ${e==="api"?"bg-indigo-600 text-white shadow":"text-indigo-200 hover:text-white"}`,children:"React API Reference"}),a.jsx("button",{onClick:()=>t("stories"),className:`flex-1 py-1.5 px-3 rounded text-xs font-semibold select-none transition ${e==="stories"?"bg-indigo-600 text-white shadow":"text-indigo-200 hover:text-white"}`,children:"Interactive Stories"}),a.jsx("button",{onClick:()=>t("cli"),className:`flex-1 py-1.5 px-3 rounded text-xs font-semibold select-none transition ${e==="cli"?"bg-indigo-600 text-white shadow":"text-indigo-200 hover:text-white"}`,children:"SSOT CLI Exports"})]})]}),a.jsxs("div",{className:"max-w-4xl mx-auto bg-white border border-slate-200 rounded-xl shadow-md p-6",children:[e==="api"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsxs("h2",{className:"text-base font-bold text-slate-800 mb-1 flex items-center gap-1.5 border-b border-slate-100 pb-2",children:[a.jsx(Wl,{size:18,className:"text-indigo-600"})," Component Signatures"]}),a.jsxs("p",{className:"text-xs text-slate-500 leading-relaxed mt-2",children:["The visual widget package exports a main application workspace wrapper ",a.jsx("strong",{className:"font-mono text-[11px] bg-slate-100 p-0.5 rounded text-slate-800",children:"LineageGraphApp"})," that houses all coordinate math, filter buttons, searches, legends, and sidebars."]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-xs font-bold text-slate-700 uppercase tracking-wider font-mono",children:"LineageGraphApp Props Layout"}),a.jsx("div",{className:"overflow-x-auto border border-slate-100 rounded-lg",children:a.jsxs("table",{className:"w-full text-left border-collapse text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-slate-50 border-b border-slate-200 font-mono text-slate-500",children:[a.jsx("th",{className:"p-2.5 font-bold",children:"Prop Name"}),a.jsx("th",{className:"p-2.5 font-bold",children:"Type"}),a.jsx("th",{className:"p-2.5 font-bold",children:"Required"}),a.jsx("th",{className:"p-2.5 font-bold",children:"Description"})]})}),a.jsxs("tbody",{className:"divide-y divide-slate-100 text-[11px] font-mono text-slate-600",children:[a.jsxs("tr",{children:[a.jsx("td",{className:"p-2.5 font-bold text-indigo-600",children:"payload"}),a.jsx("td",{className:"p-2.5",children:"LineagePayload"}),a.jsx("td",{className:"p-2.5 text-rose-500 font-bold",children:"Yes"}),a.jsx("td",{className:"p-2.5 text-slate-500 font-sans",children:"The complete typed SSOT registry JSON payload structure."})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"p-2.5 font-bold text-indigo-600",children:"defaultMode"}),a.jsx("td",{className:"p-2.5",children:'"network" | "lineage" | "proof" | "origins"'}),a.jsx("td",{className:"p-2.5 text-slate-400",children:"No"}),a.jsx("td",{className:"p-2.5 text-slate-500 font-sans",children:'Initial render mode. Defaults to "lineage".'})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"p-2.5 font-bold text-indigo-600",children:"theme"}),a.jsx("td",{className:"p-2.5",children:'"light" | "steel-dark"'}),a.jsx("td",{className:"p-2.5 text-slate-400",children:"No"}),a.jsx("td",{className:"p-2.5 text-slate-500 font-sans",children:'Color theme preset. Defaults to "light".'})]})]})]})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-bold text-slate-700",children:"React Embed Code Example"}),a.jsxs("button",{onClick:()=>i(r,"react"),className:"text-[10px] text-slate-500 hover:text-indigo-600 flex items-center gap-1 font-mono hover:underline",children:[a.jsx(At,{size:11})," ",s==="react"?"Copied!":"Copy Code"]})]}),a.jsx("pre",{className:"bg-slate-900 text-slate-100 p-4 rounded-xl text-[10px] font-mono overflow-x-auto leading-relaxed border border-slate-950",children:r})]})]}),e==="stories"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("h2",{className:"text-base font-bold text-slate-800 flex items-center gap-1.5 border-b border-slate-100 pb-2",children:[a.jsx(xc,{size:18,className:"text-indigo-600"})," Live Visual Testing Stories"]}),a.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"p-4 border border-slate-150 rounded-xl hover:shadow-md transition",children:[a.jsx("span",{className:"text-[9px] font-mono font-bold bg-amber-50 text-amber-700 px-2 py-0.5 rounded border border-amber-200",children:"Story #1: Tree Structure Collapse"}),a.jsx("h3",{className:"text-xs font-bold text-slate-800 mt-2",children:"Recursive Sub-tree Collapsible Nodes"}),a.jsxs("p",{className:"text-[11px] text-slate-500 mt-1 leading-relaxed",children:["Clicking the circle expansion badge ",a.jsx("strong",{className:"font-mono text-slate-800",children:"[+]"})," or ",a.jsx("strong",{className:"font-mono text-slate-800",children:"[-]"})," at the base of the circular nodes dynamically hides or reveals children subtrees cleanly. Perfect for reducing visual noise in deep registries."]})]}),a.jsxs("div",{className:"p-4 border border-slate-150 rounded-xl hover:shadow-md transition",children:[a.jsx("span",{className:"text-[9px] font-mono font-bold bg-emerald-50 text-emerald-700 px-2 py-0.5 rounded border border-emerald-200",children:"Story #2: Ego-Centric Filtering Triggers"}),a.jsx("h3",{className:"text-xs font-bold text-slate-800 mt-2",children:"Instant Ego Neighborhood Hover Analysis"}),a.jsx("p",{className:"text-[11px] text-slate-500 mt-1 leading-relaxed",children:"Hovering over any node dynamically highlights connected outgoing specifications and upstream ADR ancestors while executing a fluid, 60fps linear opacity fade on unrelated components."})]}),a.jsxs("div",{className:"p-4 border border-slate-150 rounded-xl hover:shadow-md transition",children:[a.jsx("span",{className:"text-[9px] font-mono font-bold bg-indigo-50 text-indigo-700 px-2 py-0.5 rounded border border-indigo-200",children:"Story #3: Draggable Reposition Node Locking"}),a.jsx("h3",{className:"text-xs font-bold text-slate-800 mt-2",children:"Frictionless Free-form Layout Repositioning"}),a.jsx("p",{className:"text-[11px] text-slate-500 mt-1 leading-relaxed",children:"At any point, grab and slide circular elements manually to alter connections. Layout positions are computed dividing coordinate movements by scale coefficients, ensuring zero drifting under variable zoom viewports."})]}),a.jsxs("div",{className:"p-4 border border-slate-150 rounded-xl hover:shadow-md transition",children:[a.jsx("span",{className:"text-[9px] font-mono font-bold bg-red-50 text-red-700 px-2 py-0.5 rounded border border-red-200",children:"Story #4: Validation Drift Spotlighting"}),a.jsx("h3",{className:"text-xs font-bold text-slate-800 mt-2",children:"Dotted Stale Link Warning Metrics"}),a.jsx("p",{className:"text-[11px] text-slate-500 mt-1 leading-relaxed",children:"Validation drifts trigger color alerts on the canvas node rims (red alerts) and draw invalid links with dotted ruby traces. The right inspector immediately lists failure issue lines."})]})]})]}),e==="cli"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("h2",{className:"text-base font-bold text-slate-800 flex items-center gap-1.5 border-b border-slate-100 pb-2",children:[a.jsx(Yl,{size:18,className:"text-indigo-600"})," CLI Standalone Exporters"]}),a.jsxs("div",{className:"space-y-4 text-xs text-slate-600",children:[a.jsx("p",{className:"leading-relaxed",children:"The visual React package compiles directly to an inline static single-page viewer containing no external runtime CDN links or package dependencies. PyPI users invoke this build engine via the Python command-line utility to generate completely offline *.html assets."}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-bold text-slate-700",children:"Python CLI trigger terminal snip"}),a.jsxs("button",{onClick:()=>i(l,"cli"),className:"text-[10px] text-slate-500 hover:text-indigo-600 flex items-center gap-1 font-mono hover:underline",children:[a.jsx(At,{size:11})," ",s==="cli"?"Copied!":"Copy Command"]})]}),a.jsxs("pre",{className:"bg-slate-900 text-slate-100 p-3 rounded-xl font-mono text-[10.5px] border border-slate-950 overflow-x-auto select-all",children:["$ ",l]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-bold text-slate-700",children:"Primary Python payload producer schema mapping"}),a.jsxs("button",{onClick:()=>i(o,"python"),className:"text-[10px] text-slate-500 hover:text-indigo-600 flex items-center gap-1 font-mono hover:underline",children:[a.jsx(At,{size:11})," ","Copy Code"]})]}),a.jsx("pre",{className:"bg-slate-900 text-slate-100 p-4 rounded-xl text-[10px] font-mono overflow-x-auto leading-relaxed border border-slate-950",children:o})]})]})]})]})]})},Gm=({payload:e,selectedRegistryKey:t=e.package?.id||e.package?.name||"current",onChangeRegistry:s=()=>{},registryOptions:n=[],defaultMode:i="lineage",theme:r="light",showDocumentation:o=!1,precomputedIndices:l})=>{const[d,h]=y.useState("workspace"),[c,u]=y.useState(null),[m,p]=y.useState(new Set),[x,v]=y.useState(new Set),[k,T]=y.useState([]),[b,w]=y.useState(300),[C,I]=y.useState(1),[M,F]=y.useState(!1),[P,j]=y.useState(null),[N,D]=y.useState([]),[$,_]=y.useState(new Set),[B,K]=y.useState(new Set),[X,xe]=y.useState(i),[Z,ne]=y.useState({showLabels:!0,edgeWidth:2,edgeOpacity:.6,showMinimap:!1,theme:r}),[S,g]=y.useState(!1),[z,se]=y.useState(!1),re=y.useMemo(()=>Array.from(new Set(["ADR","Spec","SPEC","Feature","Claim","Test","Evidence","Release","Boundary","Profile","Risk","Issue",...e.nodes.map(R=>R.family)])),[e.nodes]),We=y.useMemo(()=>Array.from(new Set(["ssot-core","ssot-origin","repo-local","extension-pack","generated","unknown",...e.nodes.map(R=>R.originKind).filter(R=>!!R)])),[e.nodes]),[ie,me]=y.useState({search:"",families:new Set(re),statuses:new Set,originKinds:new Set(We),tiers:new Set,packs:new Set,validationStatuses:new Set,edgeTypes:new Set}),[ve,oe]=y.useState({}),$e=y.useRef(null),$t=1100,jt=620;y.useEffect(()=>{console.log("[LineageGraphApp] Ready! Graph initialized successfully")},[]),y.useEffect(()=>{console.log(`[LineageGraphApp] View Mode changed to: ${X.toUpperCase()}`)},[X]),y.useEffect(()=>{c?(console.log(`[LineageGraphApp] Node Selected: ${c}`),se(!1)):(console.log("[LineageGraphApp] Node Selection Cleared"),se(!0))},[c]),y.useEffect(()=>{P&&console.log(`[LineageGraphApp] Viewport camera locked onto focus node: ${P}`)},[P]),y.useEffect(()=>{!o&&d==="storybook"&&h("workspace")},[d,o]),y.useEffect(()=>{me(R=>({...R,families:new Set([...re,...R.families]),originKinds:new Set([...We,...R.originKinds])}))},[re,We]);const Pe=y.useMemo(()=>l||nl(e),[e,l]);y.useMemo(()=>c&&e.nodes.find(R=>R.id===c)||null,[c,e.nodes]);const{allPacks:Is,allTiers:Fs,allOriginKinds:$s}=y.useMemo(()=>{const R=new Set,q=new Set,U=new Set,ae=e.nodes.length>5e3;return e.nodes.forEach((ke,Fe)=>{ae&&Fe%10!==0||(ke.packs&&ke.packs.forEach(Qe=>R.add(Qe)),ke.tier&&q.add(ke.tier),ke.originKind&&U.add(ke.originKind))}),{allPacks:Array.from(R).sort(),allTiers:Array.from(q).sort(),allOriginKinds:Array.from(U).sort()}},[e.nodes]),zs=R=>{_(q=>{const U=new Set(q);return U.has(R)?U.delete(R):U.add(R),U})},mt=y.useMemo(()=>e.nodes.filter(R=>{if(ie.search){const q=ie.search.toLowerCase(),U=R.id.toLowerCase().includes(q),ae=(R.label||"").toLowerCase().includes(q),ke=(R.title||"").toLowerCase().includes(q),Fe=(R.description||"").toLowerCase().includes(q),Qe=(R.path||"").toLowerCase().includes(q),Ee=(R.tags||[]).some(pe=>pe.toLowerCase().includes(q));if(!U&&!ae&&!ke&&!Fe&&!Qe&&!Ee)return!1}if(!ie.families.has(R.family)||ie.statuses.size>0&&R.status&&!ie.statuses.has(R.status)||R.originKind&&!ie.originKinds.has(R.originKind)||ie.tiers.size>0&&R.tier&&!ie.tiers.has(R.tier)||ie.packs&&ie.packs.size>0&&(!R.packs||!R.packs.some(q=>ie.packs.has(q))))return!1;if(ie.validationStatuses&&ie.validationStatuses.size>0){const q=R.validation?.status||"unknown";if(!ie.validationStatuses.has(q))return!1}return!0}),[e.nodes,ie]),nt=y.useMemo(()=>b&&mt.length>b?mt.slice(0,b):mt,[mt,b]),Os=y.useMemo(()=>({...e,nodes:nt}),[e,nt]),it=(R,q)=>{if(!R){u(null),p(new Set);return}q?p(U=>{const ae=new Set(U);return ae.has(R)?(ae.delete(R),c===R&&u(ae.size>0?Array.from(ae)[ae.size-1]:null)):(ae.add(R),u(R)),ae}):(u(R),p(new Set([R])))},Je=R=>{j(R),R&&D(q=>[...q,R])},ot=()=>{j(null)},es=R=>{K(q=>{const U=new Set(q);return U.has(R)?U.delete(R):(U.add(R),c===R&&u(null),P===R&&j(null)),U})},_s=()=>{K(new Set)},ts=y.useMemo(()=>{const q=e.nodes.length>5e3?nt.filter((U,ae)=>{if(B.has(U.id)||an(U.id,Pe.incoming,$))return!1;const ke=U.id.match(/-(\d+)$/),Fe=ke?parseInt(ke[1],10):-1;return Fe!==-1?Fe<=150||Fe%500===0:ae%50===0}):nt.filter(U=>B.has(U.id)?!1:!an(U.id,Pe.incoming,$));return new Set(q.map(U=>U.id))},[nt,B,$,Pe]),Ve=y.useMemo(()=>{const R=P||c;if(!M||!R)return null;const q=new Set([R]);let U=new Set([R]);const ae=C||1;for(let ke=0;ke<ae;ke++){const Fe=new Set;U.forEach(Qe=>{const Ee=new Set([Qe]),pe=[{id:Qe,d:0}];for(;pe.length>0;){const{id:rt,d:xt}=pe.shift(),at=Pe.incoming.get(rt)||[],lt=Pe.outgoing.get(rt)||[],ct=[...at,...lt];for(const De of ct)Ee.has(De)||(Ee.add(De),ts.has(De)?q.has(De)||(q.add(De),Fe.add(De)):xt<3&&pe.push({id:De,d:xt+1}))}}),U=Fe}return q},[M,P,c,C,ts,Pe]);y.useEffect(()=>{if(X!=="network"&&X!=="flow-force"){$e.current!==null&&(cancelAnimationFrame($e.current),$e.current=null);const R=new Set(B);M&&Ve&&e.nodes.forEach(U=>{Ve.has(U.id)||R.add(U.id)});const q=ir(e.nodes,Pe.incoming,Pe.outgoing,$,210,90,$t,jt,X,R);oe(q)}else{const R=new Set(B);M&&Ve&&e.nodes.forEach(U=>{Ve.has(U.id)||R.add(U.id)});const q=ir(e.nodes,Pe.incoming,Pe.outgoing,$,210,90,$t,jt,X,R);oe(q)}},[X,e,$,B,M,Ve,Pe]),y.useEffect(()=>{if(X==="network"||X==="flow-force"){if(e.nodes.length>1500)return;const R=new Set;e.nodes.forEach(U=>{if(B.has(U.id)){R.add(U.id);return}if(M&&Ve&&!Ve.has(U.id)){R.add(U.id);return}an(U.id,Pe.incoming,$)&&R.add(U.id)});const q=()=>{oe(U=>{const ae=X==="flow-force";return zm(e.nodes,e.edges,U,R,$t,jt,ae?.015:.012,ae?12e3:25e3,ae?.08:.03,ae?130:220,X)}),$e.current=requestAnimationFrame(q)};return $e.current=requestAnimationFrame(q),()=>{$e.current!==null&&(cancelAnimationFrame($e.current),$e.current=null)}}},[X,e,$,B,M,Ve,Pe]);const pt=()=>{const R=JSON.stringify(e,null,2),q=new Blob([R],{type:"application/json"}),U=URL.createObjectURL(q),ae=document.createElement("a");ae.href=U,ae.download=`${e.package?.id?.replace(/[\\/]/g,"_")||"registry"}_lineage_payload.json`,document.body.appendChild(ae),ae.click(),document.body.removeChild(ae),URL.revokeObjectURL(U)};return a.jsxs("div",{id:"graph-application-shell",className:"h-full w-full flex flex-col bg-slate-50 select-none overflow-hidden font-sans",children:[a.jsxs("header",{className:"h-14 border-b border-slate-200 bg-white flex items-center justify-between px-6 shrink-0 shadow-sm z-30",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg bg-indigo-600 flex items-center justify-center text-white font-bold shadow-md shadow-indigo-100 shrink-0",children:a.jsx(Fi,{size:16,className:"animate-pulse"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("h1",{className:"text-xs font-black text-slate-800 tracking-tight",children:"SSOT Lineage"}),a.jsx("span",{className:"bg-slate-100 text-slate-500 text-[8px] font-extrabold px-1 py-0.2 rounded font-mono uppercase",children:"Interactive Viewer"})]}),a.jsxs("p",{className:"text-[10px] text-slate-400 font-medium truncate max-w-[180px] sm:max-w-none",children:[e.package?.name||"SSOT-Registry"," - v",e.package?.version||"0.0.1"]})]})]}),o&&a.jsxs("div",{className:"flex bg-slate-100 p-1 rounded-md border border-slate-200/50 text-xs font-medium",children:[a.jsxs("button",{onClick:()=>h("workspace"),className:`flex items-center gap-1.5 px-3 py-1 rounded transition select-none ${d==="workspace"?"bg-white text-slate-800 font-bold shadow-sm":"text-slate-500 hover:text-slate-800"}`,children:[a.jsx(bs,{size:13}),a.jsx("span",{children:"Interactive Graph"})]}),a.jsxs("button",{onClick:()=>h("storybook"),className:`flex items-center gap-1.5 px-3 py-1 rounded transition select-none ${d==="storybook"?"bg-white text-slate-800 font-bold shadow-sm":"text-slate-500 hover:text-slate-800"}`,children:[a.jsx(mr,{size:13}),a.jsx("span",{children:"Storybook Docs"})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{onClick:()=>ne(R=>({...R,showLabels:!R.showLabels})),className:`p-2 border rounded-lg transition flex items-center gap-1.5 text-xs font-semibold select-none ${Z.showLabels?"bg-indigo-50 border-indigo-200 text-indigo-700 hover:bg-indigo-100":"border-slate-200 text-slate-500 hover:text-slate-800 hover:bg-slate-50"}`,title:"Toggle displaying descriptive connection labels directly on graph edges (show/hide)",children:[a.jsx(hn,{size:14,className:Z.showLabels?"text-indigo-600 stroke-[2.5]":""}),a.jsx("span",{className:"hidden md:inline",children:"Connection Labels"}),a.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${Z.showLabels?"bg-indigo-600 animate-pulse":"bg-slate-300"}`})]}),a.jsxs("button",{onClick:()=>ne(R=>({...R,showMinimap:!R.showMinimap})),className:`p-2 border rounded-lg transition flex items-center gap-1.5 text-xs font-semibold select-none ${Z.showMinimap?"bg-indigo-50 border-indigo-200 text-indigo-700 hover:bg-indigo-100":"border-slate-200 text-slate-500 hover:text-slate-800 hover:bg-slate-50"}`,title:"Toggle Minimap navigation overview (show/hide)",children:[a.jsx(gr,{size:14,className:Z.showMinimap?"stroke-[2.5]":""}),a.jsx("span",{className:"hidden md:inline",children:"Minimap"}),a.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${Z.showMinimap?"bg-indigo-600":"bg-slate-300"}`})]}),a.jsx("button",{onClick:()=>ne(R=>({...R,theme:R.theme==="light"?"steel-dark":"light"})),className:"p-2 border border-slate-200 text-slate-500 hover:text-slate-800 hover:bg-slate-50 rounded-lg transition",title:"Toggle canvas color scheme",children:a.jsx(Tc,{size:14})}),a.jsxs("button",{onClick:pt,className:"flex items-center gap-1.5 px-3 py-1.5 bg-indigo-600 hover:bg-indigo-700 text-white rounded-lg text-xs font-extrabold transition shadow-lg shadow-indigo-100 hover:shadow-indigo-200",title:"Download the current lineage payload JSON",children:[a.jsx(Jl,{size:13}),a.jsx("span",{className:"hidden sm:inline",children:"Export Payload JSON"})]})]})]}),o&&d==="storybook"?a.jsx(Ym,{}):a.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[a.jsx(Um,{payload:e,filters:ie,onUpdateFilters:me,viewMode:X,onChangeViewMode:xe,selectedRegistryKey:t,onChangeRegistry:s,registryOptions:n,allPacks:Is,allTiers:Fs,allOriginKinds:$s,filteredNodes:mt,isCollapsed:S,onToggleCollapse:()=>g(!S),onSelectNode:it,onFocusNode:Je,nodeLimit:b,onUpdateNodeLimit:w,egoHops:C,onUpdateEgoHops:I,isolateEgo:M,onUpdateIsolateEgo:F}),a.jsx("div",{className:"flex-1 h-full flex flex-col overflow-hidden bg-slate-100",children:a.jsxs("div",{className:"flex-1 relative overflow-hidden",children:[a.jsx(_m,{payload:Os,positions:ve,mode:X,selectedNodeId:c,selectedNodeIds:m,focusNodeId:P,collapsedNodeIds:$,hiddenNodeIds:B,onSelectNode:it,onToggleCollapse:zs,onToggleHideNode:es,onClearHiddenNodes:_s,onUpdatePositions:oe,viewSettings:Z,precomputedIndices:l,egoHops:C,highlightedNodeIds:x,customGroups:k,isolateEgo:M}),m.size>1&&a.jsxs("div",{id:"multi-select-actions-bar",className:"absolute bottom-6 left-1/2 -translate-x-1/2 bg-slate-900/95 backdrop-blur border border-slate-800 text-white px-5 py-3 rounded-full flex items-center gap-4 shadow-2xl z-50 transition-all duration-300",children:[a.jsxs("div",{className:"flex items-center gap-2 pr-3 border-r border-slate-800",children:[a.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-indigo-500 animate-pulse"}),a.jsxs("span",{className:"text-xs font-mono font-bold text-slate-300",children:[m.size," NODES SELECTED"]})]}),a.jsxs("button",{onClick:()=>{v(new Set(m)),console.log("[LineageGraphApp] Highlighted nodes:",Array.from(m))},className:"px-3.5 py-1.5 bg-amber-500 hover:bg-amber-600 text-slate-950 rounded-full font-bold text-xs flex items-center gap-1.5 transition-all active:scale-95 cursor-pointer",title:"Highlight all multi-selected nodes",children:[a.jsx(Fi,{size:13}),a.jsx("span",{children:"Highlight"})]}),a.jsxs("button",{onClick:()=>{const R=prompt("Enter a label/contract zone name for this node group:",`Module Spec Group ${k.length+1}`)||`Group ${k.length+1}`,q={id:`group-custom-${Date.now()}`,label:R,nodeIds:Array.from(m)};T(U=>[...U,q]),p(new Set),u(null),console.log("[LineageGraphApp] Created custom group:",q)},className:"px-3.5 py-1.5 bg-indigo-600 hover:bg-indigo-700 text-white rounded-full font-bold text-xs flex items-center gap-1.5 transition-all active:scale-95 cursor-pointer",title:"Group selected nodes into a custom boundary zone",children:[a.jsx(bs,{size:13}),a.jsx("span",{children:"Group"})]}),a.jsxs("button",{onClick:()=>{K(R=>{const q=new Set(R);return m.forEach(U=>q.add(U)),q}),p(new Set),u(null),console.log("[LineageGraphApp] Bulk-hid nodes:",Array.from(m))},className:"px-3.5 py-1.5 bg-rose-600 hover:bg-rose-700 text-white rounded-full font-bold text-xs flex items-center gap-1.5 transition-all active:scale-95 cursor-pointer",title:"Deselect and bulk-hide selected nodes from view",children:[a.jsx(xr,{size:13,className:"text-rose-100"}),a.jsx("span",{children:"Bulk-Hide"})]}),x.size>0&&a.jsxs("button",{onClick:()=>{v(new Set)},className:"px-3.5 py-1.5 bg-slate-800 hover:bg-slate-700 text-slate-300 rounded-full font-bold text-xs flex items-center gap-1.5 transition-all active:scale-95 cursor-pointer",title:"Clear all highlights",children:[a.jsx(wt,{size:13}),a.jsx("span",{children:"Clear Highlights"})]}),a.jsx("button",{onClick:()=>{p(new Set),u(null)},className:"text-slate-400 hover:text-white p-1 rounded-full hover:bg-slate-800 transition cursor-pointer",title:"Deselect all nodes",children:a.jsx(wt,{size:15})})]})]})}),a.jsx(Hm,{payload:e,selectedNodeId:c,focusNodeId:P,onSelectNode:u,onSetFocusNode:Je,onClearFocusNode:ot,isCollapsed:z,onToggleCollapse:()=>se(!z)})]})]})};function Km(e){return a.jsx(Gm,{...e})}function Xm(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function Zm(e,t={}){const s=t.title||"SSOT Lineage Graph",n=t.rootId||"ssot-lineage-root";return`<!doctype html>
|
|
82
|
+
<html lang="en">
|
|
83
|
+
<head>
|
|
84
|
+
<meta charset="utf-8">
|
|
85
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
86
|
+
<title>${s}</title>
|
|
87
|
+
<style>html,body,#${n}{width:100%;height:100%;margin:0}body{overflow:hidden}#${n}{min-height:100vh}${t.style||""}</style>
|
|
88
|
+
</head>
|
|
89
|
+
<body>
|
|
90
|
+
<div id="${n}"></div>
|
|
91
|
+
<script>window.__SSOT_LINEAGE_PAYLOAD__=${Xm(e)};<\/script>
|
|
92
|
+
<script>${t.script||""}<\/script>
|
|
93
|
+
</body>
|
|
94
|
+
</html>
|
|
95
|
+
`}exports.LineageGraph=Ml;exports.LineageGraphApp=Km;exports.applyForceLayoutStep=dr;exports.applyLineageLayout=cr;exports.createStandaloneHtml=Zm;exports.normalizeNodes=ar;exports.resolveDepth=lr;
|