exodeui 6.2.9 → 6.2.10
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/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31,4 +31,4 @@
|
|
|
31
31
|
`&&BA++)}),A.globalAlpha=b}if(g.stroke&&g.stroke.width>0){const b=A.globalAlpha;g.fill&&g.fill.type!=="None"&&g.fill.isEnabled!==!1&&g.fill.opacity!==0&&g.fill.color!=="transparent"&&g.fill.color!=="rgba(0,0,0,0)"&&(A.shadowColor="transparent",A.shadowBlur=0,A.shadowOffsetX=0,A.shadowOffsetY=0),A.strokeStyle=g.stroke.color,A.lineWidth=g.stroke.width,A.globalAlpha=b*this.normalizeOpacity(g.stroke.opacity??100);let iA=0,BA=T;(v||[]).forEach(aA=>{let MA=-B/2;F==="center"?MA=0:F==="right"&&(MA=B/2),O(aA.text,MA,BA,!0,iA),iA+=(aA.text||"").length,BA+=L,iA<s.length&&(s[iA]===`
|
|
32
32
|
`||s[iA]==="\r")&&(R>0&&(BA+=R),iA++,s[iA-1]==="\r"&&s[iA]===`
|
|
33
33
|
`&&iA++)}),A.globalAlpha=b}}}applyStrokeAlignment(A,I,C,g,Q,B){if(!I.stroke||I.stroke.width<=0||I.stroke.isEnabled===!1)return;const i=I.stroke,D=i.width,o=(i.alignment||"center").toLowerCase();if(A.save(),I.fill&&I.fill.type!=="None"&&I.fill.isEnabled!==!1&&I.fill.opacity!==0&&I.fill.color!=="transparent"&&I.fill.color!=="rgba(0,0,0,0)"&&(A.shadowColor="transparent",A.shadowBlur=0,A.shadowOffsetX=0,A.shadowOffsetY=0),i.fill){const K=this.createCanvasFill(A,i.fill,g,Q);K?A.strokeStyle=K:A.strokeStyle=i.color||"#000000"}else A.strokeStyle=i.color||"#000000";const s=A.globalAlpha;A.globalAlpha=s*this.normalizeOpacity(i.opacity??100),A.lineWidth=D,A.lineCap=i.lineCap||"round",A.lineJoin=i.lineJoin||"round",i.miterLimit!==void 0&&(A.miterLimit=i.miterLimit);const h=i.trimStart??0,t=i.trimEnd??1,G=i.trimOffset??0,S=i.dashOffset??0,y=i.dashArray||[];if(h!==0||t!==1||G!==0){const K=this.getPerimeter(C,g,Q);if(K>0){const e=Math.max(0,Math.min(1,h)),N=Math.max(0,Math.min(1,t));if(e<N){const k=K*(N-e),F=K-k,c=-(K*(e+G%1));A.setLineDash([k,F]),A.lineDashOffset=c+S*K}else if(e===N)A.setLineDash([0,K]);else{const k=K*(1-e+N),F=K-k,c=-(K*e);A.setLineDash([k,F]),A.lineDashOffset=c+S*K}}}else y.length>0&&(A.setLineDash(y),A.lineDashOffset=S);C.type==="Line"||g===0||Q===0?(this.applyPath(A,C,g,Q,B),A.stroke()):o==="inside"?(A.lineWidth=D*2,A.save(),this.applyPath(A,C,g,Q,B),A.clip(),A.stroke(),A.restore()):o==="outside"?(A.lineWidth=D*2,this.applyPath(A,C,g,Q,B),A.stroke(),A.save(),A.globalCompositeOperation="destination-out",this.applyPath(A,C,g,Q,B),A.fill(),A.restore()):(A.lineWidth=D,this.applyPath(A,C,g,Q,B),A.stroke()),A.restore()}getPerimeter(A,I,C){switch(this.ensurePathPoints(A),A.type){case"Rectangle":return(I+C)*2;case"Ellipse":{const g=Math.abs(I)/2,Q=Math.abs(C)/2,B=Math.abs(A.sweepAngle??360),i=A.ratio||0,D=Math.PI*(3*(g+Q)-Math.sqrt((3*g+Q)*(g+3*Q)));if(B>=360&&i<=0)return D;let o=B/360*D;if(i>0){const w=Math.PI*(3*(g*i+Q*i)-Math.sqrt((3*g*i+Q*i)*(g*i+3*Q*i)));o+=B/360*w,B<360&&(o+=2*Math.sqrt((g-g*i)**2+(Q-Q*i)**2))}else B<360&&(o+=2*Math.max(g,Q));return isNaN(o)?0:o}case"Line":return A.length||Math.sqrt(I*I+C*C);case"Triangle":return I+Math.sqrt((I/2)**2+C**2)*2;case"Polygon":{const g=A.sides||3,Q=A.radius||Math.min(I,C)/2;return 2*g*Q*Math.sin(Math.PI/g)}case"Star":{const g=A.points||5,Q=A.outer_radius||Math.min(I,C)/2,B=A.inner_radius||Q/2,i=Math.PI/g;return Math.sqrt(Q*Q+B*B-2*Q*B*Math.cos(i))*g*2}case"Path":{const g=A.points||[];if(g.length<2)return A.length||0;let Q=0,B=g[0].x,i=g[0].y;for(let D=1;D<g.length;D++){const o=g[D];if(o.moveTo){B=o.x,i=o.y;continue}const w=B,s=i,h=g[D-1].out_x,t=g[D-1].out_y;if(h!==void 0||o.in_x!==void 0?Q+=this.getBezierLength(w,s,h??w,t??s,o.in_x??o.x,o.in_y??o.y,o.x,o.y):Q+=Math.sqrt((o.x-w)**2+(o.y-s)**2),B=o.x,i=o.y,o.closePath||D===g.length-1&&(A.is_closed||A.isClosed)){const G=B,S=i,y=[...g.slice(0,D+1)].reverse().find(R=>R.moveTo)||g[0],K=y.x,e=y.y,N=g[D].out_x,k=g[D].out_y,F=y.in_x,c=y.in_y;N!==void 0||F!==void 0?Q+=this.getBezierLength(G,S,N??G,k??S,F??K,c??e,K,e):Q+=Math.sqrt((K-G)**2+(e-S)**2)}}return Q}default:return(I+C)*2}}getBezierLength(A,I,C,g,Q,B,i,D,o=10){let w=0,s=A,h=I;for(let t=1;t<=o;t++){const G=t/o,S=1-G,y=G*G,K=S*S,e=K*S,N=y*G,k=e*A+3*K*G*C+3*S*y*Q+N*i,F=e*I+3*K*G*g+3*S*y*B+N*D,c=k-s,R=F-h;w+=Math.sqrt(c*c+R*R),s=k,h=F}return w}getBezierTAtLength(A,I,C,g,Q,B,i,D,o,w=20){if(A<=0)return 0;let s=0,h=I,t=C;for(let G=1;G<=w;G++){const S=G/w,y=1-S,K=S*S,e=y*y,N=e*y,k=K*S,F=N*I+3*e*S*g+3*y*K*B+k*D,c=N*C+3*e*S*Q+3*y*K*i+k*o,R=F-h,J=c-t,L=Math.sqrt(R*R+J*J);if(s+L>=A){const l=A-s,Y=L===0?0:l/L;return(G-1+Y)/w}s+=L,h=F,t=c}return 1}getPointOnPath(A,I,C,g){if(this.ensurePathPoints(A),A.type==="Path"){const Q=A.points||[];if(Q.length<2)return{x:0,y:0,angle:0};let B=1/0,i=-1/0,D=1/0,o=-1/0;Q.forEach(e=>{typeof e.x=="number"&&typeof e.y=="number"&&(B=Math.min(B,e.x),i=Math.max(i,e.x),D=Math.min(D,e.y),o=Math.max(o,e.y),e.out_x!==void 0&&(B=Math.min(B,e.out_x),i=Math.max(i,e.out_x)),e.out_y!==void 0&&(D=Math.min(D,e.out_y),o=Math.max(o,e.out_y)),e.in_x!==void 0&&(B=Math.min(B,e.in_x),i=Math.max(i,e.in_x)),e.in_y!==void 0&&(D=Math.min(D,e.in_y),o=Math.max(o,e.in_y)))});const w=(B+i)/2,s=(D+o)/2,t=this.getPerimeter(A,I,C)*g;let G=0;const S=[];let y=Q[0],K=Q[0];for(let e=1;e<Q.length;e++){const N=Q[e];if(N.moveTo){y=N,K=N;continue}S.push({p0:y,p1:N}),(N.closePath||e===Q.length-1&&(A.is_closed||A.isClosed))&&S.push({p0:N,p1:K}),y=N}for(const e of S){const N=e.p0,k=e.p1;let F=0;const c=N.out_x!==void 0||k.in_x!==void 0;if(c?F=this.getBezierLength(N.x,N.y,N.out_x??N.x,N.out_y??N.y,k.in_x??k.x,k.in_y??k.y,k.x,k.y):F=Math.sqrt((k.x-N.x)**2+(k.y-N.y)**2),G+F>=t||e===S[S.length-1]){let R=0;if(c)return R=this.getBezierTAtLength(t-G,N.x,N.y,N.out_x??N.x,N.out_y??N.y,k.in_x??k.x,k.in_y??k.y,k.x,k.y,20),this.getBezierPointAndAngle(R,N,k,w,s);{R=F===0?0:(t-G)/F;const J=N.x+(k.x-N.x)*R-w,L=N.y+(k.y-N.y)*R-s,l=Math.atan2(k.y-N.y,k.x-N.x);return{x:J,y:L,angle:l}}}G+=F}}else if(A.type==="Ellipse"){const Q=Math.abs(I)/2,B=Math.abs(C)/2,i=A.sweepAngle??360,o=((A.startAngle??0)+i*g)*Math.PI/180,w=Q*Math.cos(o),s=B*Math.sin(o),h=-Q*Math.sin(o),t=B*Math.cos(o),G=Math.atan2(t,h);return{x:w,y:s,angle:G}}else if(A.type==="Rectangle"){const Q=Math.abs(I),B=Math.abs(C),D=(Q+B)*2*g;let o=0,w=0,s=0;return D<Q?(o=-Q/2+D,w=-B/2,s=0):D<Q+B?(o=Q/2,w=-B/2+(D-Q),s=Math.PI/2):D<2*Q+B?(o=Q/2-(D-(Q+B)),w=B/2,s=Math.PI):(o=-Q/2,w=B/2-(D-(2*Q+B)),s=-Math.PI/2),{x:o,y:w,angle:s}}return{x:0,y:0,angle:0}}getBezierPointAndAngle(A,I,C,g,Q){const B=I.x,i=I.y,D=I.out_x??I.x,o=I.out_y??I.y,w=C.in_x??C.x,s=C.in_y??C.y,h=C.x,t=C.y,G=1-A,S=A*A,y=G*G,K=y*G,e=S*A,N=K*B+3*y*A*D+3*G*S*w+e*h-g,k=K*i+3*y*A*o+3*G*S*s+e*t-Q,F=3*y*(D-B)+6*G*A*(w-D)+3*S*(h-w),c=3*y*(o-i)+6*G*A*(s-o)+3*S*(t-s),R=Math.atan2(c,F);return{x:N,y:k,angle:R}}applyAbsoluteTransform(A,I,C){if(!C.get(I))return;const Q=[];let B=I;for(;B;){Q.unshift(B);const i=C.get(B);B=i==null?void 0:i.parentId}Q.forEach(i=>{this.applyObjectTransform(A,i)})}applyObjectTransform(A,I){const C=this.objectStates.get(I);if(!C)return;A.translate(C.x,C.y),A.rotate(C.rotation*Math.PI/180);const g=(C.scale_x??1)*(C.flip_x===!0?-1:1),Q=(C.scale_y??1)*(C.flip_y===!0?-1:1);A.scale(g,Q)}applyArtEffectOverlay(A,I,C,g,Q,B){var s;const i=I.artEffect||((s=I.style)==null?void 0:s.artEffect);if(!i||!i.enabled)return;const D=i.type,o=i.intensity??.5,w=i.speed??1;if(D==="acid_gradient"||D==="acid_rave"||D==="shimmer"||D==="halftone"||D==="noise"||D==="scanlines"||D==="chromatic_aberration"){if(A.save(),this.applyPath(A,C,g,Q,B),A.clip(),D==="shimmer"){const t=this.currentTime*w%2/2,G=A.createLinearGradient(-g,-Q,g,Q);G.addColorStop(Math.max(0,t-.2),"rgba(255,255,255,0)"),G.addColorStop(t,`rgba(255,255,255,${o*.8})`),G.addColorStop(Math.min(1,t+.2),"rgba(255,255,255,0)"),A.fillStyle=G,A.globalCompositeOperation="screen",A.fillRect(-g/2,-Q/2,g,Q)}else if(D==="acid_gradient"||D==="acid_rave"){const h=this.currentTime*w,t=A.createLinearGradient(-g/2,-Q/2,g/2,Q/2),G=h*100%360,S=(G+180)%360;t.addColorStop(0,`hsla(${G}, 80%, 50%, ${o*.5})`),t.addColorStop(1,`hsla(${S}, 80%, 50%, ${o*.5})`),A.fillStyle=t,A.globalCompositeOperation="screen",A.fillRect(-g/2,-Q/2,g,Q)}else if(D==="halftone"){const h=Math.max(2,20*(1-o)),t=document.createElement("canvas");t.width=h,t.height=h;const G=t.getContext("2d");if(G){G.fillStyle="black",G.beginPath(),G.arc(h/2,h/2,h/2*o,0,Math.PI*2),G.fill();const S=A.createPattern(t,"repeat");S&&(A.globalAlpha=.3*o,A.fillStyle=S,A.fillRect(-g/2,-Q/2,g,Q))}}else if(D==="noise"){A.globalAlpha=.1*o;for(let h=0;h<5;h++)A.fillStyle=`rgba(${Math.random()*255}, ${Math.random()*255}, ${Math.random()*255}, ${o})`,A.fillRect(-g/2+Math.random()*g,-Q/2+Math.random()*Q,2,2)}else if(D==="scanlines"){A.globalAlpha=.2*o,A.strokeStyle="rgba(0,0,0,0.5)",A.lineWidth=1;for(let h=-Q/2;h<Q/2;h+=4)A.beginPath(),A.moveTo(-g/2,h),A.lineTo(g/2,h),A.stroke()}else if(D==="chromatic_aberration"){const h=5*o;A.globalCompositeOperation="screen",A.globalAlpha=.5,A.fillStyle="cyan",A.fillRect(-g/2-h,-Q/2,g,Q),A.fillStyle="magenta",A.fillRect(-g/2+h,-Q/2,g,Q)}A.restore()}}applyPath(A,I,C,g,Q){I.data&&(I.type==="Path"||I.type==="Subtract"||I.type==="Union"||I.type==="Intersect"||I.type==="Exclude"||I.type),A.beginPath(),this._tracePath(A,I,C,g,Q)}_tracePath(A,I,C,g,Q){if(I){if(this.ensurePathPoints(I),I.type==="Rectangle"||I.type==="Image"){const B=Q!==void 0?Q:I.corner_radius??0;this.drawRoundRect(A,-C/2,-g/2,C,g,B)}else if(I.type==="Line")A.moveTo(-C/2,0),A.lineTo(C/2,0);else if(I.type==="Ellipse"){const{startAngle:B=0,sweepAngle:i=360,ratio:D=0}=I,o=C/2,w=g/2,s=B*Math.PI/180,h=i*Math.PI/180,t=s+h;i>=360&&D<=0?A.ellipse(0,0,o,w,0,0,Math.PI*2):(A.ellipse(0,0,o,w,0,s,t,!1),D>0?A.ellipse(0,0,o*D,w*D,0,t,s,!0):A.lineTo(0,0),A.closePath())}else if(I.type==="Triangle")A.moveTo(0,-g/2),A.lineTo(C/2,g/2),A.lineTo(-C/2,g/2),A.closePath();else if(I.type==="Polygon"){const B=I.sides||3,i=I.radius||Math.min(C,g)/2;for(let D=0;D<B;D++){const o=D*2*Math.PI/B-Math.PI/2,w=i*Math.cos(o),s=i*Math.sin(o);D===0?A.moveTo(w,s):A.lineTo(w,s)}A.closePath()}else if(I.type==="Star"){const B=I.inner_radius||20,i=I.outer_radius||50,D=I.points||5;for(let o=0;o<D*2;o++){const w=o*Math.PI/D-Math.PI/2,s=o%2===0?i:B,h=s*Math.cos(w),t=s*Math.sin(w);o===0?A.moveTo(h,t):A.lineTo(h,t)}A.closePath()}else if((I.type==="Path"||I.type==="Subtract"||I.type==="Union"||I.type==="Intersect"||I.type==="Exclude"||I.type==="BooleanOperation")&&I.points){this.frameCount%10===0&&console.log("[Engine] Tracing Path:",I.points.length,"points");let B=1/0,i=-1/0,D=1/0,o=-1/0;if(I.points.forEach(h=>{typeof h.x=="number"&&typeof h.y=="number"&&(B=Math.min(B,h.x),i=Math.max(i,h.x),D=Math.min(D,h.y),o=Math.max(o,h.y),h.out_x!==void 0&&(B=Math.min(B,h.out_x),i=Math.max(i,h.out_x)),h.out_y!==void 0&&(D=Math.min(D,h.out_y),o=Math.max(o,h.out_y)),h.in_x!==void 0&&(B=Math.min(B,h.in_x),i=Math.max(i,h.in_x)),h.in_y!==void 0&&(D=Math.min(D,h.in_y),o=Math.max(o,h.in_y)))}),B===1/0)return;const w=(B+i)/2,s=(D+o)/2;if(isNaN(w)||isNaN(s)){console.warn("[Engine] Invalid path center:",w,s);return}I.points.forEach((h,t)=>{if(t===0||h.moveTo)A.moveTo(h.x-w,h.y-s);else{const G=I.points[t-1];if(!G)return;const S=(G.out_x??G.x)-w,y=(G.out_y??G.y)-s,K=(h.in_x??h.x)-w,e=(h.in_y??h.y)-s;isNaN(S)||isNaN(K)||isNaN(h.x)?A.lineTo(h.x-w,h.y-s):A.bezierCurveTo(S,y,K,e,h.x-w,h.y-s)}if(h.closePath||t===I.points.length-1&&(I.is_closed||I.isClosed)){const G=[...I.points.slice(0,t+1)].reverse().find(S=>S.moveTo)||I.points[0];G&&(h.out_x!==void 0||G.in_x!==void 0)&&A.bezierCurveTo((h.out_x??h.x)-w,(h.out_y??h.y)-s,(G.in_x??G.x)-w,(G.in_y??G.y)-s,G.x-w,G.y-s),A.closePath()}})}else if(I.points&&Array.isArray(I.points)){let B=1/0,i=-1/0,D=1/0,o=-1/0;I.points.forEach(h=>{B=Math.min(B,h.x),i=Math.max(i,h.x),D=Math.min(D,h.y),o=Math.max(o,h.y)});const w=(B+i)/2,s=(D+o)/2;I.points.forEach((h,t)=>{if(t===0)A.moveTo(h.x-w,h.y-s);else{const G=I.points[t-1];G.out_x!==void 0||h.in_x!==void 0?A.bezierCurveTo((G.out_x??G.x)-w,(G.out_y??G.y)-s,(h.in_x??h.x)-w,(h.in_y??h.y)-s,h.x-w,h.y-s):A.lineTo(h.x-w,h.y-s)}(h.closePath||t===I.points.length-1&&(I.is_closed||I.isClosed))&&A.closePath()})}}}renderInputBox(A,I){var tA,b;const C=this.objectStates.get(I.id),g=(C==null?void 0:C.options)||I.options||{},Q=((tA=I.geometry)==null?void 0:tA.width)||250,B=((b=I.geometry)==null?void 0:b.height)||45,i=this.focusedId===I.id,D=this.lastHoveredObjectId===I.id,o=g.previewState||"default",w=o!=="default"?o:i?"focused":D?"hovered":"default",s=g.label||{visible:!0,text:"Label"},h=g.helperText||{visible:!1,text:"Helper text"},t=g.leftIcon||{visible:!1},G=g.rightIcon||{visible:!1},S=g.multiline===!0,y=g.corner_radius??8,K=g.corners||{tl:y,tr:y,bl:y,br:y},e=[K.tl,K.tr,K.br,K.bl];let N=g.backgroundColor||"rgba(31, 41, 55, 1)",k=g.borderColor||"rgba(55, 65, 81, 1)",F=g.borderWidth??1.5,c=g.color||"#ffffff",R=g.placeholderColor||"rgba(156, 163, 175, 1)",J=g.fontSize||14;const L=`${w}Style`,l=g[L];if(l?(l.backgroundColor!==void 0&&(N=l.backgroundColor),l.borderColor!==void 0&&(k=l.borderColor),l.borderWidth!==void 0&&(F=l.borderWidth),l.color!==void 0&&(c=l.color),l.placeholderColor!==void 0&&(R=l.placeholderColor),l.fontSize!==void 0&&(J=l.fontSize)):w==="focused"?(k=g.focusBorderColor||"rgba(59, 130, 246, 1)",F=Math.max(F,2)):w==="hovered"||w==="hover"?(k=g.hoverBorderColor||k,N=g.hoverBackgroundColor||N):w==="disabled"?(N=g.disabledBackgroundColor||"rgba(31, 41, 55, 0.6)",k=g.disabledBorderColor||"rgba(55, 65, 81, 0.4)"):w==="error"&&(k="rgba(239, 68, 68, 1)",F=Math.max(F,2)),A.beginPath(),this.drawRoundRect(A,-Q/2,-B/2,Q,B,e),A.fillStyle=N,A.fill(),F>0&&(A.strokeStyle=k,A.lineWidth=F,A.stroke(),w==="focused"||w==="focus")){A.save(),A.beginPath();const $=e.map(iA=>iA+2);this.drawRoundRect(A,-Q/2-2,-B/2-2,Q+4,B+4,$),A.strokeStyle="rgba(59, 130, 246, 0.3)",A.lineWidth=2,A.stroke(),A.restore()}const Y=($,iA)=>{if(!$.visible||!$.svgPath)return;const BA=$.size||14,aA=$.offset??16,MA=$.color||"#ffffff",YA=iA?-(Q/2)+aA:Q/2-aA,HA=$.svgPath;if(A.save(),A.translate(YA,0),!HA.startsWith("<svg")){const WA=new Path2D(HA),P=BA/24;A.scale(P,P),A.translate(-12,-12),A.fillStyle=MA,A.fill(WA)}A.restore()};Y(t,!0),Y(G,!1);const v=g.text||"",wA=g.placeholder||"Enter text...",QA=!v,W=v||wA,m=QA?R:c,T=J,u=g.fontFamily||"Inter",d=g.fontWeight||400;A.font=`${d} ${T}px "${u}", sans-serif`,A.fillStyle=m,A.textAlign="left",A.textBaseline=S?"top":"middle";const f=g.inputPadding??16,O=t.visible?(t.offset??16)+(t.size||14)/2+8:f,j=G.visible?(G.offset??16)+(G.size||14)/2+8:f,q=-(Q/2)+O,X=Q-O-j,sA=g.inputType==="password"?"•".repeat(W.length):W;if(A.save(),A.beginPath(),A.rect(q-2,-B/2+4,X+4,B-8),A.clip(),S){const $=sA.split(`
|
|
34
|
-
`);let iA=-B/2+f;const BA=T*1.2;let aA=0;$.forEach((MA,YA)=>{const HA=MA.split(" ");let WA="";for(let P=0;P<HA.length;P++){const oA=WA+HA[P]+" ";A.measureText(oA).width>X&&P>0?(A.fillText(WA,q,iA),WA=HA[P]+" ",iA+=BA):WA=oA}A.fillText(WA,q,iA),aA=A.measureText(WA).width,YA<$.length-1&&(iA+=BA,aA=0)}),i&&!QA&&Math.floor(performance.now()/500)%2===0&&A.fillRect(q+aA,iA,1.5,T)}else{const iA=A.measureText(sA).width;let BA=0;if(iA>X&&(BA=iA-X),A.fillText(sA,q-BA,0),i&&!QA&&Math.floor(performance.now()/500)%2===0){const MA=q+iA-BA;A.fillRect(MA,-(T/2),1.5,T)}}if(A.restore(),s.visible!==!1){const $=s.text||"Label",iA=s.fontSize||12,BA=s.color||"rgba(156, 163, 175, 1)",aA=s.offset??8;A.font=`600 ${iA}px "${u}", sans-serif`,A.fillStyle=BA,A.textAlign="left",A.textBaseline="bottom";const MA=-(Q/2),YA=-(B/2)-aA;A.fillText($,MA,YA)}if(h.visible===!0){const $=h.text||"Helper text",iA=h.fontSize||11,BA=w==="error"?"rgba(239, 68, 68, 1)":h.color||"rgba(156, 163, 175, 1)",aA=h.offset??6;A.font=`400 ${iA}px "${u}", sans-serif`,A.fillStyle=BA,A.textAlign="left",A.textBaseline="top";const MA=-(Q/2),YA=B/2+aA;A.fillText($,MA,YA)}}renderSlider(A,I){const C=this.objectStates.get(I.id),g=(C==null?void 0:C.geometry)||I.geometry,Q=(C==null?void 0:C.options)||I.options||{},B=g.width||200,i=Q.value??50,D=Q.min??0,w=(Q.max??100)-D,s=w===0?0:(i-D)/w,h=Q.trackHeight||4,t=Q.trackRoundedness??2,G=Q.trackShape??"Rectangle",S=Q.trackPath||"",y=Q.activeColor||"#3b82f6",K=Q.inactiveColor||"#374151",e=Q.thumbShape||"Ellipse",N=Q.thumbWidth??16,k=Q.thumbHeight??16,F=Q.thumbRoundedness??0,c=Q.thumbColor||"#ffffff",R=Q.thumbPath||"",J=Q.thumbIcon||"",L=Q.showValueTooltip??!1,l=Q.tooltipBgColor||"#333333",Y=Q.tooltipColor||"#ffffff",v=Q.tooltipOffsetX??0,wA=Q.tooltipOffsetY??-25,QA=(q,X,sA,tA,b,$,iA)=>{if((q==="Custom"||q==="Icon")&&iA)try{const BA=new Path2D(iA);if(A.save(),A.translate(X,sA),q==="Icon"){const aA=Math.min(tA,b)/24;A.scale(aA,aA),A.translate(-12,-12)}A.fill(BA),A.restore();return}catch(BA){console.error("Error drawing slider shape in engine:",BA)}if(A.beginPath(),q==="Ellipse")A.ellipse(X,sA,tA/2,b/2,0,0,Math.PI*2);else if(q==="Rectangle")this.drawRoundRect(A,X-tA/2,sA-b/2,tA,b,$);else if(q==="Triangle")A.moveTo(X,sA-b/2),A.lineTo(X+tA/2,sA+b/2),A.lineTo(X-tA/2,sA+b/2),A.closePath();else if(q==="Diamond")A.moveTo(X,sA-b/2),A.lineTo(X+tA/2,sA),A.lineTo(X,sA+b/2),A.lineTo(X-tA/2,sA),A.closePath();else if(q==="Polygon"){const BA=I.geometry.sides||3,aA=I.geometry.radius||Math.min(tA,b)/2;for(let MA=0;MA<BA;MA++){const YA=MA*2*Math.PI/BA-Math.PI/2,HA=X+aA*Math.cos(YA),WA=sA+aA*Math.sin(YA);MA===0?A.moveTo(HA,WA):A.lineTo(HA,WA)}A.closePath()}else if(q==="Star"){const aA=Math.min(tA,b)/2,MA=aA/2;for(let YA=0;YA<5*2;YA++){const HA=YA%2===0?aA:MA,WA=YA*Math.PI/5-Math.PI/2;A.lineTo(X+HA*Math.cos(WA),sA+HA*Math.sin(WA))}A.closePath()}else q==="Line"&&(A.moveTo(X-tA/2,sA),A.lineTo(X+tA/2,sA));A.fill()};A.fillStyle=K,G==="Line"?(A.strokeStyle=K,A.lineWidth=h,A.beginPath(),A.moveTo(-B/2,0),A.lineTo(B/2,0),A.stroke()):QA(G,0,0,B,h,t,S);const W=B-N,m=-B/2+N/2+s*W,T=m- -B/2;T>0&&(A.fillStyle=y,G==="Line"?(A.strokeStyle=y,A.lineWidth=h,A.beginPath(),A.moveTo(-B/2,0),A.lineTo(m,0),A.stroke()):G==="Rectangle"&&(A.beginPath(),this.drawRoundRect(A,-B/2,-h/2,T,h,t),A.fill())),A.save(),A.translate(m,0);const u=A.getTransform(),d=Math.sqrt(u.a*u.a+u.b*u.b)||1;if(A.shadowColor="rgba(0,0,0,0.2)",A.shadowBlur=4*d,A.shadowOffsetY=1*d,A.fillStyle=c,QA(e,0,0,N,k,F,e==="Icon"?J:R),A.restore(),L){A.save(),A.translate(m+v,wA);const q=Math.round(i).toString();A.font="10px Inter, sans-serif";const X=A.measureText(q),sA=6,tA=4,b=X.width+sA*2,$=14+tA;A.beginPath(),this.drawRoundRect(A,-b/2,-$/2,b,$,4),A.fillStyle=l,A.fill(),A.fillStyle=Y,A.textAlign="center",A.textBaseline="middle",A.fillText(q,0,0),A.restore()}const f=Q.label||{},O=Q.helperText||{},j=Q.fontFamily||"Inter";if(f.visible!==!1){const q=f.text||"Label",X=f.fontSize||12,sA=f.color||"rgba(156, 163, 175, 1)",tA=f.offset??8;A.font=`600 ${X}px "${j}", sans-serif`,A.fillStyle=sA,A.textAlign="left",A.textBaseline="bottom";const b=-(B/2),$=-(h/2)-tA;A.fillText(q,b,$)}if(O.visible===!0){const q=O.text||"Helper text",X=O.fontSize||11,sA=O.color||"rgba(156, 163, 175, 1)",tA=O.offset??6;A.font=`400 ${X}px "${j}", sans-serif`,A.fillStyle=sA,A.textAlign="left",A.textBaseline="top";const b=-(B/2),$=h/2+tA;A.fillText(q,b,$)}}renderDropdown(A,I){var wA;const C=this.objectStates.get(I.id);if(!C)return;const g=C.options||I.options||{},Q=I.geometry.width||160,B=I.geometry.height||40,i=-Q/2,D=-B/2,o=g.corner_radius??6,w=g.disabled||g.previewState==="disabled",s=this.lastHoveredObjectId===I.id||g.previewState==="hover",h=(g.isOpen||g.previewState==="active")&&!w;let t=g.backgroundColor,G=g.borderColor,S=g.color||"#333333";w?(t=g.disabledBackgroundColor||"#f3f4f6",G=g.disabledBorderColor||"#e5e7eb",S=g.disabledColor||"#9ca3af"):h?(t=g.activeBackgroundColor||t,G=g.activeBorderColor||G,S=g.activeColor||S):s&&(t=g.hoverBackgroundColor||t,G=g.hoverBorderColor||G,S=g.hoverColor||S),t||(t="#ffffff"),G||(G="#e5e7eb");const y=A.globalAlpha;A.globalAlpha=y*(g.opacity??1),this.drawRoundRect(A,i,D,Q,B,o),A.fillStyle=this.createCanvasFill(A,typeof t=="string"?{type:"Solid",color:t}:t,Q,B)||"#ffffff",A.fill();const K=g.borderWidth??1;K>0&&(A.strokeStyle=this.createCanvasFill(A,typeof G=="string"?{type:"Solid",color:G}:G,Q,B)||"#e5e7eb",A.lineWidth=K,A.stroke());const e=12,N=g.chevronType||"chevron",k=g.chevronSize||16,F=(h?g.openIconColor:g.closedIconColor)||g.chevronColor||"#6b7280";if(N!=="none"){const QA=i+Q-e-k/2;A.save(),A.translate(QA,0);const W=h?g.openIconAngle??180:g.closedIconAngle??0;if(A.rotate(W*Math.PI/180),A.strokeStyle=F,A.fillStyle=F,A.lineWidth=1.5,A.lineCap="round",A.lineJoin="round",N==="chevron")A.beginPath(),A.moveTo(-k/2,-k*.2),A.lineTo(0,k*.2),A.lineTo(k/2,-k*.2),A.stroke();else if(N==="custom"||N==="path"){const m=h&&g.openIconPath||g.closedIconPath;if(m){const T=new Path2D(m);A.save();const u=k/24;A.scale(u,u),A.translate(-12,-12),A.fill(T),A.restore()}}A.restore()}const c=g.selectedOption||g.placeholder||"Select...",R=g.fontSize||14,J=g.fontWeight||400,L=g.fontFamily||"Inter, sans-serif";A.font=`${J} ${R}px ${L}`;const l=w?g.disabledColor||"#9ca3af":!g.selectedOption&&g.placeholder?"#9ca3af":S;A.fillStyle=this.createCanvasFill(A,typeof l=="string"?{type:"Solid",color:l}:l,Q,B)||"#333333",A.textAlign="left",A.textBaseline="middle";const Y=N==="none"?0:k+8,v=Q-e*2-Y;if(A.save(),A.beginPath(),A.rect(i+e,D,v,B),A.clip(),A.fillText(c,i+e,0),A.restore(),h&&!w){const QA=D+B+4,W=g.optionsList||[],m=g.itemHeight||32,T=g.listPadding??4,u=W.length*m+T*2,d=g.listCornerRadius??o;A.save();const f=g.listShadow||{},O=A.getTransform(),j=Math.sqrt(O.a*O.a+O.b*O.b)||1;A.shadowColor=typeof f.color=="string"?f.color:((wA=f.color)==null?void 0:wA.color)||"rgba(0,0,0,0.15)",A.shadowBlur=(f.blur??12)*j,A.shadowOffsetY=(f.offsetY??6)*j,A.shadowOffsetX=(f.offsetX??0)*j,A.beginPath(),this.drawRoundRect(A,i,QA,Q,u,d),A.fillStyle=this.createCanvasFill(A,typeof g.listBackgroundColor=="string"?{type:"Solid",color:g.listBackgroundColor}:g.listBackgroundColor||{type:"Solid",color:"#ffffff"},Q,u)||"#ffffff",A.fill();const q=g.listBorderWidth??1;q>0&&(A.shadowColor="transparent",A.strokeStyle=this.createCanvasFill(A,typeof g.listBorderColor=="string"?{type:"Solid",color:g.listBorderColor}:g.listBorderColor||{type:"Solid",color:G},Q,u)||"#e5e7eb",A.lineWidth=q,A.stroke()),A.restore();const X=g.itemFontSize||R,sA=g.itemFontFamily||L;A.font=`${J} ${X}px ${sA}`,W.forEach((tA,b)=>{const $=QA+T+b*m;if(tA===g.selectedOption)A.fillStyle=this.createCanvasFill(A,typeof g.itemSelectedBackgroundColor=="string"?{type:"Solid",color:g.itemSelectedBackgroundColor}:g.itemSelectedBackgroundColor||{type:"Solid",color:"#f3f4f6"},Q,m)||"#f3f4f6",A.fillRect(i+q,$,Q-q*2,m),A.fillStyle=g.itemSelectedColor||g.activeColor||S||"#374151";else if(A.fillStyle=g.listTextColor||S||"#333333",this.activeDropdownId===I.id&&this._lastPointerPos){const BA=this._lastPointerPos.y-(QA+T),aA=Math.floor(BA/m);b===aA&&(A.fillStyle=this.createCanvasFill(A,typeof g.itemHoverBackgroundColor=="string"?{type:"Solid",color:g.itemHoverBackgroundColor}:g.itemHoverBackgroundColor||{type:"Solid",color:"#f9fafb"},Q,m)||"#f9fafb",A.fillRect(i+q,$,Q-q*2,m),A.fillStyle=g.itemHoverColor||S)}A.fillText(tA,i+e,$+m/2)})}A.globalAlpha=y}renderButton(A,I){var N,k,F,c;const C=this.objectStates.get(I.id),g=(C==null?void 0:C.options)||I.options||{},Q=((N=I.geometry)==null?void 0:N.width)||120,B=((k=I.geometry)==null?void 0:k.height)||40,i=-Q/2,D=-B/2,o=this.lastHoveredObjectId===I.id,w=g.corner_radius??8,s=g.bgShape||"Rectangle",h=o?((F=g.hoverStyle)==null?void 0:F.backgroundColor)||g.buttonBgColor||"#3b82f6":g.buttonBgColor||"#3b82f6",t=g.label||{},G=o?((c=g.hoverStyle)==null?void 0:c.textColor)||t.color||"#ffffff":t.color||"#ffffff",S=g.icon||{enabled:!1};A.save(),A.beginPath(),s==="Rectangle"?this.drawRoundRect(A,i,D,Q,B,w):s==="Ellipse"||s==="Circle"?A.ellipse(0,0,Q/2,B/2,0,0,Math.PI*2):s==="Pill"&&this.drawRoundRect(A,i,D,Q,B,B/2),A.fillStyle=h,A.fill();const y=t.fontSize||14,K=t.fontFamily||"Inter";A.font=`${t.fontWeight||400} ${y}px "${K}", sans-serif`,A.fillStyle=G,A.textAlign="center",A.textBaseline="middle";let e=0;if(S.enabled&&S.svgPath){const R=S.size||16,J=S.gap||8,L=S.position==="left"?-(A.measureText(t.text||"").width/2+R/2+J/2):A.measureText(t.text||"").width/2+R/2+J/2;A.save(),A.translate(L,0);const l=new Path2D(S.svgPath),Y=R/24;A.scale(Y,Y),A.translate(-12,-12),A.fillStyle=S.color||G,A.fill(l),A.restore(),e=S.position==="left"?R/2+J/2:-(R/2+J/2)}A.fillText(t.text||"Button",e,0),A.restore()}renderToggleButton(A,I){var y,K;const C=this.objectStates.get(I.id),g=(C==null?void 0:C.options)||I.options||{},Q=g.checked??!1,B=((y=I.geometry)==null?void 0:y.width)||120,i=((K=I.geometry)==null?void 0:K.height)||40,D=-B/2,o=-i/2,w=g.corner_radius??8,s=g.label||{},h=Q?g.activeColor||"#3b82f6":g.inactiveColor||"#374151",t=Q?g.activeTextColor||"#ffffff":g.inactiveTextColor||"#9ca3af";A.save(),A.beginPath(),this.drawRoundRect(A,D,o,B,i,w),A.fillStyle=h,A.fill();const G=s.fontSize||14,S=s.fontFamily||"Inter";A.font=`${s.fontWeight||600} ${G}px "${S}", sans-serif`,A.fillStyle=t,A.textAlign="center",A.textBaseline="middle",A.fillText(s.text||"Toggle",0,0),A.restore()}renderToggle(A,I){var e,N;const C=this.objectStates.get(I.id),g=(C==null?void 0:C.options)||I.options||{},Q=((e=I.geometry)==null?void 0:e.width)||52,B=((N=I.geometry)==null?void 0:N.height)||30,i=-Q/2,D=-B/2,o=g.checked??!1,w=g.corner_radius??B/2;A.beginPath(),this.drawRoundRect(A,i,D,Q,B,w),A.fillStyle=o?g.activeColor||"#10b981":g.inactiveColor||"#374151",g.disabled&&(A.globalAlpha*=.5),A.fill();const s=3,h=B-s*2,t=h/2,G=i+s,S=i+Q-s-h,y=o?S:G,K=D+s;if(A.beginPath(),A.arc(y+t,K+t,t,0,Math.PI*2),A.fillStyle=g.knobColor||"#ffffff",A.fill(),g.disabled&&(A.globalAlpha*=2),g.label&&g.label.text){const k=g.label,F=k.fontSize||14,c=k.fontWeight||400,R=k.fontFamily||"Inter";A.font=`${c} ${F}px "${R}", sans-serif`,A.fillStyle=k.color||"#f3f4f6",A.textBaseline="middle";const J=k.gap||10;let L=0,l=0;k.position==="left"?(A.textAlign="right",L=i-J,l=0):k.position==="right"?(A.textAlign="left",L=i+Q+J,l=0):k.position==="top"?(A.textAlign="center",L=0,l=D-J,A.textBaseline="bottom"):k.position==="bottom"?(A.textAlign="center",L=0,l=D+B+J,A.textBaseline="top"):(A.textAlign="left",L=i+Q+J,l=0),A.fillText(k.text,L,l)}}renderLineGraph(A,I,C,g){let Q=I.datasets||[];if((!Q||Q.length===0)&&(I.data||I.graphData)&&(Q=[{id:"line-1",label:"Series 1",data:I.data||I.graphData||[],lineColor:I.lineColor||"#3b82f6",lineWidth:I.lineWidth||2,showArea:I.showArea||!1,areaColor:I.areaColor||"rgba(139, 92, 246, 0.3)",smoothing:I.smoothing||!1,showPoints:I.showPoints!==void 0?I.showPoints:!0,pointSize:I.pointSize||6,pointFill:I.pointFill||"#ffffff",pointStrokeColor:I.pointStrokeColor||I.lineColor||"#3b82f6",pointStrokeWidth:I.pointStrokeWidth||2}]),!Q||Q.length===0||!Q.some(S=>S.data&&S.data.length>=2)){A.save(),A.fillStyle="#6366f1",A.font="12px Inter, system-ui, sans-serif",A.textAlign="center",A.textBaseline="middle",A.fillText("NO DATA",0,0),A.restore();return}let B=1/0,i=-1/0,D=0;if(Q.forEach(S=>{let y=S.data;if(S.isVarEnabled&&S.inputId){let K=this.inputs.get(S.inputId);if(K===void 0){const e=this.inputNameMap.get(S.inputId);e&&e.length>0&&(K=this.inputs.get(e[0]))}K&&Array.isArray(K)&&(y=K)}if(y&&y.length>0){const K=y.filter(e=>typeof e=="number"&&!isNaN(e));K.length>0&&(B=Math.min(B,...K),i=Math.max(i,...K),D=Math.max(D,y.length))}S._resolvedData=y}),D<2)return;const o=i-B,w=C/(D-1),s=S=>{const y=o===0?.5:(S-B)/o;return g/2-y*g},h=S=>S*w-C/2,t=I.axisColor||"#333333";if(I.showXAxis&&(A.beginPath(),A.strokeStyle=I.xAxisColor||t,A.lineWidth=1,A.moveTo(-C/2,g/2),A.lineTo(C/2,g/2),A.stroke()),I.showYAxis&&(A.beginPath(),A.strokeStyle=I.yAxisColor||t,A.lineWidth=1,A.moveTo(-C/2,-g/2),A.lineTo(-C/2,g/2),A.stroke()),A.fillStyle=I.axisLabelColor||"#333333",A.font=`${I.axisLabelFontSize||10}px Inter, sans-serif`,I.showXLabels){A.textAlign="center",A.textBaseline="top";for(let S=0;S<D;S++){const y=h(S);A.fillText(`${S+1}`,y,g/2+5)}}if(I.showYLabels){A.textAlign="right",A.textBaseline="middle";const S=-C/2-5,y=(i+B)/2;A.fillText(i.toFixed(1),S,s(i)),A.fillText(y.toFixed(1),S,s(y)),A.fillText(B.toFixed(1),S,s(B))}const G=10;if(Q.forEach(S=>{const y=S._resolvedData;if(!(!y||y.length<2)){if(S.showArea){if(A.beginPath(),A.moveTo(h(0),g/2),A.lineTo(h(0),s(y[0])),S.smoothing&&y.length>2)for(let e=0;e<y.length-1;e++){const N=y[e===0?e:e-1],k=y[e],F=y[e+1],c=y[e+1===y.length-1?e+1:e+2];for(let R=1;R<=G;R++){const J=R/G,L=this._catmullRom(N,k,F,c,J);A.lineTo(h(e+J),s(L))}}else for(let e=1;e<y.length;e++)A.lineTo(h(e),s(y[e]));A.lineTo(h(y.length-1),g/2),A.closePath();const K=A.globalAlpha;A.globalAlpha=K*(I.areaOpacity??.3),A.fillStyle=S.areaColor||"rgba(139, 92, 246, 0.2)",A.fill(),A.globalAlpha=K}if(A.beginPath(),A.strokeStyle=S.lineColor||"#3b82f6",A.lineWidth=S.lineWidth||2,A.lineJoin="round",A.lineCap="round",A.moveTo(h(0),s(y[0])),S.smoothing&&y.length>2)for(let K=0;K<y.length-1;K++){const e=y[K===0?K:K-1],N=y[K],k=y[K+1],F=y[K+1===y.length-1?K+1:K+2];for(let c=1;c<=G;c++){const R=c/G,J=this._catmullRom(e,N,k,F,R);A.lineTo(h(K+R),s(J))}}else for(let K=1;K<y.length;K++)A.lineTo(h(K),s(y[K]));A.stroke(),S.showPoints&&y.forEach((K,e)=>{const N=h(e),k=s(K);A.beginPath(),A.arc(N,k,(S.pointSize||6)/2,0,Math.PI*2),A.fillStyle=S.pointFill||"#ffffff",A.fill(),A.strokeStyle=S.pointStrokeColor||S.lineColor||"#3b82f6",A.lineWidth=S.pointStrokeWidth||1,A.stroke()})}}),I.showLegend&&Q.length>0){const S=C/2-10;let y=-g/2+15;const K=I.legendFontSize||10,e=K+5;A.font=`${K}px Inter, sans-serif`,A.textAlign="right",A.textBaseline="alphabetic",Q.forEach(N=>{const F=N.label||"Series",c=A.measureText(F).width;A.beginPath(),A.rect(S-c-8-5,y-(8/2+2),8,8),A.fillStyle=N.lineColor||"#3b82f6",A.fill(),A.fillStyle=I.legendColor||"#333333",A.fillText(F,S,y),y+=e})}}_catmullRom(A,I,C,g,Q){const B=(C-A)*.5,i=(g-I)*.5,D=Q*Q,o=Q*D;return(2*I-2*C+B+i)*o+(-3*I+3*C-2*B-i)*D+B*Q+I}normalizeOpacity(A){const I=typeof A=="number"?A:parseFloat(String(A));return isNaN(I)?1:I>1?Math.min(1,I/100):Math.max(0,Math.min(1,I))}createCanvasFill(A,I,C,g){var Q,B,i;if(!I||I.type==="None")return null;if(typeof I=="string")return I;if(I.type==="Solid"&&I.color){const D=I.color,w=(((B=(Q=this.artboard)==null?void 0:Q.tokens)==null?void 0:B.colors)||{})[D]||D;return A.fillStyle=w,w}if((I.type==="LinearGradient"||I.type==="RadialGradient"||I.type==="AngularGradient"||I.type==="DiamondGradient")&&I.stops){const D=(o,w=100)=>{var k,F;const h=(((F=(k=this.artboard)==null?void 0:k.tokens)==null?void 0:F.colors)||{})[o]||o,t=this.normalizeOpacity(I.opacity??100),S=this.normalizeOpacity(w)*t;if(S>=1&&h.startsWith("#"))return h;const y=h.startsWith("#")?h.replace("#",""):"ffffff",K=parseInt(y.substring(0,2),16),e=parseInt(y.substring(2,4),16),N=parseInt(y.substring(4,6),16);return`rgba(${K}, ${e}, ${N}, ${S})`};if(I.type==="LinearGradient"){const o=(S,y,K)=>Array.isArray(S)?S[y]??(y===0?0:1):S&&typeof S=="object"?S[K]??(y===0?0:1):y===0?0:1,w=o(I.start,0,"x")*C-C/2,s=o(I.start,1,"y")*g-g/2,h=o(I.end,0,"x")*C-C/2,t=o(I.end,1,"y")*g-g/2,G=A.createLinearGradient(w,s,h,t);if(I.stops.forEach(S=>{const y=S.offset!==void 0?S.offset:S.pos!==void 0?S.pos:S.position!==void 0?S.position:0,K=D(S.color||"#000000",S.opacity??100);G.addColorStop(Math.max(0,Math.min(1,y)),K)}),I.gradientTransform&&G.setTransform){const[S,y,K,e,N,k]=I.gradientTransform;G.setTransform({a:S,b:y,c:K,d:e,e:N,f:k})}return G}else if(I.type==="RadialGradient"){const o=(G,S,y)=>Array.isArray(G)?G[S]??.5:G&&typeof G=="object"?G[y]??.5:.5,w=o(I.center,0,"x")*C-C/2,s=o(I.center,1,"y")*g-g/2,h=(I.radius??.5)*Math.max(C,g),t=A.createRadialGradient(w,s,0,w,s,h);if(I.stops.forEach(G=>{const S=G.offset!==void 0?G.offset:G.pos!==void 0?G.pos:G.position!==void 0?G.position:0,y=D(G.color||"#000000",G.opacity??100);t.addColorStop(Math.max(0,Math.min(1,S)),y)}),I.gradientTransform&&t.setTransform){const[G,S,y,K,e,N]=I.gradientTransform;t.setTransform({a:G,b:S,c:y,d:K,e,f:N})}return t}else if(I.type==="AngularGradient"){const o=(G,S,y)=>Array.isArray(G)?G[S]??.5:G&&typeof G=="object"?G[y]??.5:.5,w=o(I.center||[.5,.5],0,"x")*C-C/2,s=o(I.center||[.5,.5],1,"y")*g-g/2,h=(I.degree||I.angle||0)*(Math.PI/180),t=(i=A.createConicGradient)==null?void 0:i.call(A,h,w,s);if(t){if(I.stops.forEach(G=>{const S=G.offset!==void 0?G.offset:G.pos!==void 0?G.pos:G.position!==void 0?G.position:0,y=D(G.color||"#000000",G.opacity??100);t.addColorStop(Math.max(0,Math.min(1,S)),y)}),I.gradientTransform&&t.setTransform){const[G,S,y,K,e,N]=I.gradientTransform;t.setTransform({a:G,b:S,c:y,d:K,e,f:N})}return t}}else if(I.type==="DiamondGradient"){const o=(G,S,y)=>Array.isArray(G)?G[S]??.5:G&&typeof G=="object"?G[y]??.5:.5,w=o(I.center||[.5,.5],0,"x")*C-C/2,s=o(I.center||[.5,.5],1,"y")*g-g/2,h=(I.radius??.5)*Math.max(C,g);A.save(),A.translate(w,s),A.rotate(Math.PI/4);const t=A.createRadialGradient(0,0,0,0,0,h);if(I.stops.forEach(G=>{const S=G.offset!==void 0?G.offset:G.pos!==void 0?G.pos:G.position!==void 0?G.position:0,y=D(G.color||"#000000",G.opacity??100);t.addColorStop(Math.max(0,Math.min(1,S)),y)}),I.gradientTransform&&t.setTransform){const[G,S,y,K,e,N]=I.gradientTransform;t.setTransform({a:G,b:S,c:y,d:K,e,f:N})}return A.scale(1/Math.SQRT2,1/Math.SQRT2),A.fillStyle=t,A.restore(),t}}if(I.type==="Pattern"&&I.url){let D=this.imageCache.get(I.url);if(D||(D=new Image,D.src=I.url,this.imageCache.set(I.url,D)),D.complete&&D.naturalWidth>0){const o=A.createPattern(D,"repeat");if(o&&(I.scaleX!==void 0||I.offsetX!==void 0)){const w=new DOMMatrix,s=I.scaleX??1,h=I.scaleY??1,t=I.offsetX??0,G=I.offsetY??0,S=I.rotation??0;w.translateSelf(t,G),w.rotateSelf(S),w.scaleSelf(s,h),o.setTransform(w)}return o}}return I.color||null}drawRoundRect(A,I,C,g,Q,B){if(B===0||B===void 0||B===null){A.rect(I,C,g,Q);return}let i=B;if(typeof i=="string")try{i=JSON.parse(i)}catch{i=parseFloat(i)||0}let D=0,o=0,w=0,s=0;typeof i=="number"?D=o=w=s=i:Array.isArray(i)?i.length===1?D=o=w=s=i[0]:i.length===2?(D=w=i[0],o=s=i[1]):i.length===3?(D=i[0],o=s=i[1],w=i[2]):i.length>=4&&(D=i[0],o=i[1],w=i[2],s=i[3]):i&&typeof i=="object"&&(D=i.tl??i.corner_radius??i.cornerRadius??0,o=i.tr??i.corner_radius??i.cornerRadius??0,w=i.br??i.corner_radius??i.cornerRadius??0,s=i.bl??i.corner_radius??i.cornerRadius??0);const h=Math.min(Math.abs(g)/2,Math.abs(Q)/2);if(D=Math.min(Math.max(0,D),h),o=Math.min(Math.max(0,o),h),w=Math.min(Math.max(0,w),h),s=Math.min(Math.max(0,s),h),A.roundRect){A.roundRect(I,C,g,Q,[D,o,w,s]);return}A.moveTo(I+D,C),A.lineTo(I+g-o,C),A.arcTo(I+g,C,I+g,C+o,o),A.lineTo(I+g,C+Q-w),A.arcTo(I+g,C+Q,I+g-w,C+Q,w),A.lineTo(I+s,C+Q),A.arcTo(I,C+Q,I,C+Q-s,s),A.lineTo(I,C+D),A.arcTo(I,C,I+D,C,D),A.closePath()}renderListView(A,I){var QA,W,m,T;const C=this.objectStates.get(I.id)||{},g=C.options||I.options||{},Q=C.width!==void 0?C.width:((QA=I.geometry)==null?void 0:QA.width)||200,B=C.height!==void 0?C.height:((W=I.geometry)==null?void 0:W.height)||300,i=-Q/2,D=-B/2,o=C.corner_radius!==void 0?C.corner_radius:g.corner_radius??0,w=g.orientation||"vertical",s=g.items||[],h=g.itemGap??10,t=g.itemHeight??50,G=g.itemWidth??200,S=g.scrollOffset??0,y=g.padding??0,K=g.glassEffect!==!1,e=g.accentColor||"#3b82f6",N=g.itemTextColor||"#333333",k=g.itemBackgroundColor||"#ffffff",F=g.hoveredIndex??null,c=g.activeItemIndex??null,R=g.glowIntensity??0,J=g.glowColor||"#3b82f6",L=typeof J=="string"?J:J.color||((T=(m=J.stops)==null?void 0:m[0])==null?void 0:T.color)||"#3b82f6",l=g.opacity!==void 0?g.opacity:I.opacity!==void 0?I.opacity:1;if(A.save(),A.globalAlpha*=l,R>0){const u=A.getTransform(),d=Math.sqrt(u.a*u.a+u.b*u.b)||1;A.shadowColor=L,A.shadowBlur=R*2*d,A.shadowOffsetX=0,A.shadowOffsetY=0}if(K){const u=g.listBackgroundColor||"rgba(31, 41, 55, 0.4)",d=this.createCanvasFill(A,u,Q,B);A.fillStyle=d||"rgba(31, 41, 55, 0.4)",this.drawListViewRect(A,i,D,Q,B,o),A.fill();const f=A.createLinearGradient(i,D,i+Q,D+B);f.addColorStop(0,"rgba(255, 255, 255, 0.15)"),f.addColorStop(.5,"rgba(255, 255, 255, 0.08)"),f.addColorStop(1,"rgba(255, 255, 255, 0.03)"),A.fillStyle=f,this.drawListViewRect(A,i,D,Q,B,o),A.fill(),A.strokeStyle="rgba(255, 255, 255, 0.25)",A.lineWidth=1,this.drawListViewRect(A,i,D,Q,B,o),A.stroke()}else{const u=g.listBackgroundColor||"transparent",d=this.createCanvasFill(A,u,Q,B);d&&(A.fillStyle=d,this.drawListViewRect(A,i,D,Q,B,o),A.fill());const f=g.borderWidth??0;f>0&&(A.strokeStyle=g.borderColor||"#cccccc",A.lineWidth=f,this.drawListViewRect(A,i,D,Q,B,o),A.stroke())}A.shadowBlur=0,A.save(),this.drawListViewRect(A,i,D,Q,B,o),A.clip();const Y=typeof y=="number"?y:w==="vertical"?y[0]:y[3];let v=(w==="vertical"?D:i)+S+Y;if(A.textBaseline="middle",s.forEach((u,d)=>{const f=w==="vertical"?Q:G,O=w==="vertical"?t:B,j=w==="vertical"?i:v,q=w==="vertical"?v:D,X=F===d,sA=c===d;if(sA){const BA=this.createCanvasFill(A,e,f,O);A.fillStyle=BA||e;const aA=A.globalAlpha;A.globalAlpha=aA*.8,A.fillRect(j,q,f,O),A.globalAlpha=aA}else if(X)A.fillStyle=K?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.05)",A.fillRect(j,q,f,O);else if(k!=="transparent"){const BA=this.createCanvasFill(A,k,f,O);A.fillStyle=BA||k,A.fillRect(j,q,f,O)}if(sA||X){const BA=this.createCanvasFill(A,e,w==="vertical"?3:f,w==="vertical"?O:3);A.fillStyle=BA||e,w==="vertical"?A.fillRect(j,q,3,O):A.fillRect(j,q+O-3,f,3)}const tA=sA?"#ffffff":K?"rgba(255, 255, 255, 0.9)":N;A.fillStyle=tA,A.font=sA||X?"600 14px Inter, sans-serif":"400 14px Inter, sans-serif";const b=typeof u=="string"?u:(u==null?void 0:u.label)||`Item ${d+1}`,$=j+(w==="vertical"?16:f/2),iA=q+O/2;w==="horizontal"?A.textAlign="center":A.textAlign="left",A.fillText(b,$,iA),v+=(w==="vertical"?t:G)+h}),A.restore(),g.showScrollbar!==!1){const u=(s.length||0)*(w==="vertical"?t:G)+((s.length||0)-1)*h,d=w==="vertical"?B:Q;if(u>d){const f=d/u,O=d*f,j=-S/u*d,q=g.scrollbarColor||"rgba(255,255,255,0.3)",X=g.scrollbarWidth||4;A.fillStyle=q,w==="vertical"?A.fillRect(i+Q-X-2,D+j,X,O):A.fillRect(i+j,D+B-X-2,O,X)}}A.restore()}updateListViewScrollFromPointer(A){var y,K;if(!this._lastPointerPos||!this._prevPointerPos)return;const I=A.options||{},C=I.orientation||"vertical",g=this._lastPointerPos.x-this._prevPointerPos.x,Q=this._lastPointerPos.y-this._prevPointerPos.y;C==="vertical"?I.scrollOffset=(I.scrollOffset||0)+Q:I.scrollOffset=(I.scrollOffset||0)+g;const B=this.objectStates.get(A.id)||{},i=I.items||[],D=I.itemGap??10,o=I.itemHeight??50,w=I.itemWidth??200,s=B.width!==void 0?B.width:((y=A.geometry)==null?void 0:y.width)||200,h=B.height!==void 0?B.height:((K=A.geometry)==null?void 0:K.height)||300,t=(i.length||0)*(C==="vertical"?o:w)+((i.length||0)-1)*D,S=Math.max(0,t-(C==="vertical"?h:s)+(I.padding*2||0));I.scrollOffset>0&&(I.scrollOffset=0),I.scrollOffset<-S&&(I.scrollOffset=-S)}updateListViewHoverFromPointer(A,I,C){const g=this.getListViewItemIndexAtPointer(A,I,C),Q=A.options||{};Q.hoveredIndex!==g&&(Q.hoveredIndex=g)}getListViewItemIndexAtPointer(A,I,C){var Y,v;const g=A.options||{},Q=this.objectStates.get(A.id)||{},B=g.items||[];if(B.length===0)return null;const i=Q.width!==void 0?Q.width:((Y=A.geometry)==null?void 0:Y.width)||200,D=Q.height!==void 0?Q.height:((v=A.geometry)==null?void 0:v.height)||300,o=g.orientation||"vertical",w=g.itemGap??10,s=g.itemHeight??50,h=g.itemWidth??200,t=g.scrollOffset??0,G=g.padding??0,S=this.getWorldTransform(A.id),y=I-S.x,K=C-S.y,e=-S.rotation*(Math.PI/180),N=Math.cos(e),k=Math.sin(e),F=y*N-K*k,c=y*k+K*N,R=-i/2,J=-D/2,L=typeof G=="number"?G:o==="vertical"?G[0]:G[3];let l=(o==="vertical"?J:R)+t+L;for(let wA=0;wA<B.length;wA++){const QA=o==="vertical"?i:h,W=o==="vertical"?s:D,m=o==="vertical"?R:l,T=o==="vertical"?l:J;if(F>=m&&F<=m+QA&&c>=T&&c<=T+W)return wA;l+=(o==="vertical"?s:h)+w}return null}drawListViewRect(A,I,C,g,Q,B){A.beginPath(),this.drawRoundRect(A,I,C,g,Q,B),A.fill()}solveBehaviors(A){if(!this.artboard)return;if(!this._lastPointerPos){this.frameCount%60;return}const{x:I,y:C}=this._lastPointerPos;this.artboard.objects.forEach(g=>{if(!g.behaviors||g.behaviors.length===0)return;const Q=this.objectStates.get(g.id);Q&&g.behaviors.forEach(B=>{var h,t,G,S,y,K,e,N,k,F,c,R,J,L,l,Y,v,wA,QA,W,m,T,u,d,f,O,j,q,X,sA,tA,b,$,iA,BA,aA,MA,YA,HA,WA,P,oA,x,p,z,EA,fA,nA,UA,FA,yA,n,bA,_A,VA,xA,DA,eA,uA,RA,hA,pA,IA,_,CA,NA,H,GA,kA,wI,yI,kI,rI,tI,sI,GI,NI;if(!B.enabled)return;const i=B.startTime||0,D=B.endTime||1/0;if(this.currentTime<i||this.currentTime>D)return;const o=Q.x-I,w=Q.y-C,s=Math.sqrt(o*o+w*w);if(this.frameCount%240===0&&Math.random()<.1&&console.log(`[ExodeUI] Executing ${B.type} on ${g.name}`),B.type===Z.Proximity){const V=((h=B.settings)==null?void 0:h.radius)||300,AA=((t=B.settings)==null?void 0:t.falloff)||"smooth";let gA=0;s<V&&(AA==="linear"?gA=1-s/V:gA=Math.pow(1-s/V,2)),gA>0&&B.sensors.forEach(dA=>{this.applyBehaviorSensor(Q,dA,gA,A,B.settings,g)})}else if(B.type===Z.Magnetic){const V=((G=B.settings)==null?void 0:G.radius)||400,AA=((S=B.settings)==null?void 0:S.strength)||.5;if(s<V&&s>5){const gA=1-s/V,dA=o*gA*AA,aI=w*gA*AA;Q.x-=dA*A*10,Q.y-=aI*A*10}}else if(B.type===Z.Repel){const V=((y=B.settings)==null?void 0:y.radius)||300,AA=((K=B.settings)==null?void 0:K.strength)||1;if(s<V){const gA=Math.pow(1-s/V,2);Q.x+=o/(s||1)*gA*60*AA*A*5,Q.y+=w/(s||1)*gA*60*AA*A*5}}else if(B.type===Z.Orbit){const V=((e=B.settings)==null?void 0:e.speed)||1,AA=((N=B.settings)==null?void 0:N.radius)||30,gA=this.currentTime*V*Math.PI*2;Q.x+=Math.cos(gA)*AA*A*5,Q.y+=Math.sin(gA)*AA*A*5,Q.rotation+=2*A*5}else if(B.type===Z.Vortex){const V=((k=B.settings)==null?void 0:k.radius)||400,AA=((F=B.settings)==null?void 0:F.speed)||2,gA=((c=B.settings)==null?void 0:c.strength)||1;if(s<V){const dA=Math.pow(1-s/V,1.5),aI=this.currentTime*AA*Math.PI*2,rC=Math.cos(aI)*30-o*.4,nC=Math.sin(aI)*30-w*.4;Q.x+=rC*dA*gA*A*5,Q.y+=nC*dA*gA*A*5,Q.rotation+=5*dA*gA*A*5,Q.scale_x*=1-dA*.1*gA*A,Q.scale_y*=1-dA*.1*gA*A}}else if(B.type===Z.Fluid){const V=((R=B.settings)==null?void 0:R.radius)||300,AA=((J=B.settings)==null?void 0:J.strength)||1;if(s<V){const gA=Math.pow(1-s/V,1.2),dA=o/(s||1)*gA*1.2*AA,aI=w/(s||1)*gA*1.2*AA;Q.x+=dA*10*A*5,Q.y+=aI*10*A*5,Q.scale_x*=1+gA*.3*AA*A,Q.scale_y*=1+gA*.3*AA*A}}else if(B.type===Z.Elastic){const V=((L=B.settings)==null?void 0:L.radius)||300,AA=((l=B.settings)==null?void 0:l.strength)||1;if(s<V){const gA=1-s/V;Q.scale_x*=1+gA*.4*AA*A,Q.scale_y*=1+gA*.4*AA*A}}else if(B.type===Z.Holographic){const V=Q.x-this.canvasWidth/2,AA=Q.y-this.canvasHeight/2,gA=((Y=B.settings)==null?void 0:Y.factor)||25;if(Q.x-=V/1e3*gA*A*5,Q.y-=AA/1e3*gA*A*5,Q.style){const dA=1-Math.min(1,s/400);Q.style.exposure=(Q.style.exposure||1)+dA*.5*A}}else if(B.type===Z.Sticky){const V=((v=B.settings)==null?void 0:v.radius)||80,AA=((wA=B.settings)==null?void 0:wA.strength)||1;if(s<V){const gA=Math.pow(1-s/V,2);Q.x-=o*gA*AA*A*10,Q.y-=w*gA*AA*A*10,Q.scale_x*=1-gA*.1*AA*A,Q.scale_y*=1-gA*.1*AA*A}}else if(B.type===Z.Dilation){const V=((QA=B.settings)==null?void 0:QA.size)||120,AA=((W=B.settings)==null?void 0:W.strength)||1;if(s<V){const gA=1-s/V;Q.scale_x*=1+gA*.5*AA*A,Q.scale_y*=1+gA*.5*AA*A}}else if(B.type===Z.Parallax){const V=((m=B.settings)==null?void 0:m.factor)||.05,AA=this.canvasHeight/2,gA=(this._lastPointerPos.y-AA)*V;Q.y+=gA*A*10}else if(B.type===Z.Squash){const V=((T=B.settings)==null?void 0:T.strength)||.8;s<(g.width||100)&&this.isMouseDown?(Q.scale_y=this.lerp(Q.scale_y??1,(((u=g.transform)==null?void 0:u.scale_y)??1)*V,.3),Q.scale_x=this.lerp(Q.scale_x??1,(((d=g.transform)==null?void 0:d.scale_x)??1)*(1+(1-V)*.4),.3)):(Q.scale_y=this.lerp(Q.scale_y??1,((f=g.transform)==null?void 0:f.scale_y)??1,.2),Q.scale_x=this.lerp(Q.scale_x??1,((O=g.transform)==null?void 0:O.scale_x)??1,.2))}else if(B.type===Z.TextCounter){const V=((j=B.settings)==null?void 0:j.duration)||2,AA=((q=B.settings)==null?void 0:q.from)||0,gA=((X=B.settings)==null?void 0:X.to)||100;B._runtimeStart===void 0&&(B._runtimeStart=this.currentTime);const dA=this.currentTime-B._runtimeStart,aI=Math.min(1,dA/V),rC=Math.floor(AA+(gA-AA)*aI);if(((sA=g.geometry)==null?void 0:sA.type)==="Text"){const nC=((tA=B.settings)==null?void 0:tA.prefix)||"",ki=((b=B.settings)==null?void 0:b.suffix)||"";Q.geometry||(Q.geometry={...g.geometry}),Q.geometry.text=`${nC}${rC}${ki}`}}else if(B.type===Z.Spotlight){const V=(($=B.settings)==null?void 0:$.radius)||250,AA=((iA=B.settings)==null?void 0:iA.strength)||1.5;if(s<V){const gA=Math.pow(1-s/V,2);Q.style||(Q.style={...g.style}),Q.style.adjustments||(Q.style.adjustments={...(BA=g.style)==null?void 0:BA.adjustments}),Q.style.adjustments.exposure=(((MA=(aA=g.style)==null?void 0:aA.adjustments)==null?void 0:MA.exposure)||0)+gA*AA*50}else(YA=Q.style)!=null&&YA.adjustments&&(Q.style.adjustments.exposure=this.lerp(Q.style.adjustments.exposure||0,((WA=(HA=g.style)==null?void 0:HA.adjustments)==null?void 0:WA.exposure)||0,.1))}else if(B.type===Z.Noise||B.type===Z.Float){const V=(((P=B.settings)==null?void 0:P.frequency)||((oA=B.settings)==null?void 0:oA.speed)||1)*.002,AA=(((x=B.settings)==null?void 0:x.amplitude)||((p=B.settings)==null?void 0:p.range)||50)*(((z=B.settings)==null?void 0:z.strength)||1),gA=Date.now();Q.x+=Math.sin(gA*V)*AA*A,Q.y+=Math.cos(gA*V*.8)*AA*A,Q.rotation+=Math.sin(gA*V*.5)*5*A}else if(B.type===Z.Pulse){const V=(((EA=B.settings)==null?void 0:EA.speed)||1)*.005,AA=(((fA=B.settings)==null?void 0:fA.scale)||1.2)-1,gA=Math.sin(Date.now()*V),dA=((nA=B.settings)==null?void 0:nA.strength)||1;Q.scale_x*=1+gA*AA*dA*A,Q.scale_y*=1+gA*AA*dA*A,Q.style&&(Q.style.exposure=(Q.style.exposure||1)+Math.max(0,gA)*.1*dA*A)}else if(B.type===Z.Draggable){const V=((UA=B.settings)==null?void 0:UA.radius)||150,AA=this.draggingBehaviors.has(g.id);if(s<V||AA){const gA=((FA=B.settings)==null?void 0:FA.strength)||1,dA=AA?1:Math.max(0,1-s/V);this.applyBehaviorSensor(Q,II.PositionX,dA*gA,A,B.settings),this.applyBehaviorSensor(Q,II.PositionY,dA*gA,A,B.settings)}}else if(B.type===Z.Scroll){const V=((yA=B.settings)==null?void 0:yA.axis)||"vertical",AA=((n=B.settings)==null?void 0:n.factor)||.5,gA=((bA=B.settings)==null?void 0:bA.strength)||1,dA=((_A=B.settings)==null?void 0:_A.scaleFactor)||0;(V==="vertical"||V==="both")&&(Q.y+=this.scrollOffset.y*AA*gA*A),(V==="horizontal"||V==="both")&&(Q.x+=this.scrollOffset.x*AA*gA*A),dA!==0&&(Q.scale_x*=1+this.scrollOffset.y*dA*A,Q.scale_y*=1+this.scrollOffset.y*dA*A)}else if(B.type===Z.LookAt){const V=((VA=B.settings)==null?void 0:VA.factor)||1,AA=((xA=B.settings)==null?void 0:xA.strength)||1,gA=Math.atan2(-w,-o)*(180/Math.PI),dA=Q.rotation,aI=(gA-dA+180)%360-180;Q.rotation+=aI*V*AA*A*10}else if(B.type===Z.Glint||B.type===Z.Scan){const V=(((DA=B.settings)==null?void 0:DA.speed)||1)*.004,AA=((eA=B.settings)==null?void 0:eA.strength)||1,gA=(Math.sin(Date.now()*V)+1)/2;Q.style&&(Q.style.exposure=(Q.style.exposure||1)+gA*AA*A*5),Q.x+=(gA-.5)*20*AA*A}else if(B.type===Z.Ratchet){const V=((uA=B.settings)==null?void 0:uA.steps)||12,AA=(((RA=B.settings)==null?void 0:RA.speed)||1)*30,gA=Math.floor(Q.rotation/(360/V))*(360/V);Q.rotation=this.lerp(Q.rotation,gA+AA*A,.1)}else if(B.type===Z.Jitter&&s<300){const V=((hA=B.settings)==null?void 0:hA.strength)||1,AA=(((pA=B.settings)==null?void 0:pA.intensity)||5)*V;Q.x+=(Math.random()-.5)*AA*A*60,Q.y+=(Math.random()-.5)*AA*A*60,Q.rotation+=(Math.random()-.5)*AA*A*120}else if(B.type===Z.Follower){const V=(IA=B.settings)==null?void 0:IA.targetId;if(V){const AA=this.objectStates.get(V);if(AA){const gA=((_=B.settings)==null?void 0:_.stiffness)||.1,dA=AA.x-Q.x,aI=AA.y-Q.y;Q.x+=dA*gA*A*60,Q.y+=aI*gA*A*60}}}else if(B.type===Z.Wrap)Q.x<0?Q.x=this.canvasWidth:Q.x>this.canvasWidth&&(Q.x=0),Q.y<0?Q.y=this.canvasHeight:Q.y>this.canvasHeight&&(Q.y=0);else if(B.type===Z.Gravity){const V=((CA=B.settings)==null?void 0:CA.strength)||9.8;Q.y+=V*A*10}else if(B.type===Z.Velocity){const V=((NA=B.settings)==null?void 0:NA.vx)||0,AA=((H=B.settings)==null?void 0:H.vy)||0;Q.x+=V*A*10,Q.y+=AA*A*10}else if(B.type===Z.Shear){const V=((GA=B.settings)==null?void 0:GA.strength)||1,AA=((kA=B.settings)==null?void 0:kA.radius)||300;if(s<AA){const gA=1-s/AA;Q.skew_x=this.lerp(Q.skew_x||0,(((wI=g.transform)==null?void 0:wI.skew_x)||0)+gA*V*30,.1)}else Q.skew_x=this.lerp(Q.skew_x||0,((yI=g.transform)==null?void 0:yI.skew_x)||0,.05)}else if(B.type===Z.Lens){const V=((kI=B.settings)==null?void 0:kI.radius)||200,AA=((rI=B.settings)==null?void 0:rI.strength)||.5;if(s<V){const gA=Math.pow(1-s/V,2);Q.scale_x=this.lerp(Q.scale_x??1,(((tI=g.transform)==null?void 0:tI.scale_x)??1)*(1+gA*AA),.2),Q.scale_y=this.lerp(Q.scale_y??1,(((sI=g.transform)==null?void 0:sI.scale_y)??1)*(1+gA*AA),.2)}else Q.scale_x=this.lerp(Q.scale_x??1,((GI=g.transform)==null?void 0:GI.scale_x)??1,.1),Q.scale_y=this.lerp(Q.scale_y??1,((NI=g.transform)==null?void 0:NI.scale_y)??1,.1)}})})}applyBehaviorSensor(A,I,C,g,Q,B){var o,w,s,h,t,G,S,y,K;const i=(Q==null?void 0:Q.intensity)||(Q==null?void 0:Q.strength)||1,D=C*i*g;switch(I){case II.Scale:A.scale_x*=1+D*.5,A.scale_y*=1+D*.5;break;case II.Opacity:A.opacity=Math.max(0,Math.min(100,A.opacity-D*100));break;case II.RotateZ:A.rotation+=D*180;break;case II.RotateX:A.rotate_x=(A.rotate_x||0)+D*180;break;case II.RotateY:A.rotate_y=(A.rotate_y||0)+D*180;break;case II.PositionX:A.x+=D*300;break;case II.PositionY:A.y+=D*300;break;case II.SkewX:A.skew_x=(A.skew_x||0)+D*45;break;case II.Blur:A.style||(A.style={...B.style}),A.style.blur||(A.style.blur={...(o=B.style)==null?void 0:o.blur}),A.style.blur.amount=(((s=(w=B.style)==null?void 0:w.blur)==null?void 0:s.amount)||0)+C*((Q==null?void 0:Q.blur)||50)*i;break;case II.Exposure:A.style||(A.style={...B.style}),A.style.adjustments||(A.style.adjustments={...(h=B.style)==null?void 0:h.adjustments}),A.style.adjustments.exposure=(((G=(t=B.style)==null?void 0:t.adjustments)==null?void 0:G.exposure)||0)+C*((Q==null?void 0:Q.exposure)||50)*i;break;case II.HueShift:A.style||(A.style={...B.style}),A.style.adjustments||(A.style.adjustments={...(S=B.style)==null?void 0:S.adjustments}),A.style.adjustments.hue=(((K=(y=B.style)==null?void 0:y.adjustments)==null?void 0:K.hue)||0)+C*((Q==null?void 0:Q.hue)||180)*i;break;case II.CornerRadius:A.corner_radius=Math.min(200,(A.corner_radius||0)+D*100);break;case II.LetterSpacing:A.geometry||(A.geometry={}),A.geometry.letterSpacing=(A.geometry.letterSpacing||0)+D*10;break}}lerp(A,I,C){return A*(1-C)+I*C}deepMerge(A,I){if(!A)return I;if(!I)return A;if(typeof A!="object"||typeof I!="object"||A===null||I===null)return I;const C={...A};for(const g in I)Object.prototype.hasOwnProperty.call(I,g)&&(I[g]&&typeof I[g]=="object"&&!Array.isArray(I[g])?C[g]=this.deepMerge(A[g],I[g]):C[g]=I[g]);return C}renderFittedImage(A,I,C,g,Q,B,i="cover"){const D=I.naturalWidth,o=I.naturalHeight,w=D/o,s=Q/B;let h=Q,t=B,G=C,S=g;i==="cover"?w>s?(h=B*w,G=C-(h-Q)/2):(t=Q/w,S=g-(t-B)/2):i==="contain"&&(w>s?(t=Q/w,S=g+(B-t)/2):(h=B*w,G=C+(Q-h)/2)),A.drawImage(I,G,S,h,t)}}const iB=({artboard:E,config:A})=>{const I={...E.seo,...A},C=I.enableSmartExtraction!==!1;rA.useEffect(()=>{const i=I.title||E.name;i&&(document.title=i);let D=I.description;if(!D&&C){const s=E.objects.filter(h=>h.geometry.type==="Text").sort((h,t)=>{var G,S;return(((G=t.geometry.text)==null?void 0:G.length)||0)-(((S=h.geometry.text)==null?void 0:S.length)||0)});s.length>0&&(D=s[0].geometry.text)}D&&(g("name","description",D),g("property","og:description",D)),I.keywords&&I.keywords.length>0&&g("name","keywords",I.keywords.join(", "));const o=I.ogImage||E.backgroundImage;o&&g("property","og:image",o),i&&g("property","og:title",i),g("property","og:type","website")},[I,E,C]);const g=(i,D,o)=>{let w=document.querySelector(`meta[${i}="${D}"]`);w||(w=document.createElement("meta"),w.setAttribute(i,D),document.head.appendChild(w)),w.setAttribute("content",o)},Q=()=>{const i=[];return i.push(vA.jsx("h1",{children:I.title||E.name},"artboard-title")),E.objects.forEach((o,w)=>{if(!(!o.visible&&o.isVisible!==!0))if(o.geometry.type==="Text"){const s=o.geometry.text;s&&(o.geometry.fontSize>24?i.push(vA.jsx("h2",{children:s},o.id||w)):i.push(vA.jsx("p",{children:s},o.id||w)))}else if(o.geometry.type==="Image"){const s=o.geometry.src,h=o.altText||o.name||"Illustration";i.push(vA.jsx("img",{src:s,alt:h},o.id||w))}else o.type==="Button"&&i.push(vA.jsx("button",{children:o.name||"Button"},o.id||w))}),i},B=I.jsonLd||{"@context":"https://schema.org","@type":"VisualArtwork",name:I.title||E.name,description:I.description,image:I.ogImage||E.backgroundImage,abstract:"Animated interface created with ExodeUI"};return vA.jsxs("div",{id:`exode-seo-${E.id||"default"}`,"aria-hidden":"false",style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0",zIndex:-1},children:[Q(),vA.jsx("script",{type:"application/ld+json",children:JSON.stringify(B)})]})},Si=rA.forwardRef(({artboard:E,src:A,className:I,style:C,autoPlay:g=!0,fit:Q="Contain",alignment:B="Center",enableSEO:i=!0,seo:D,onReady:o,onTrigger:w,onInputUpdate:s,onComponentChange:h,onToggle:t,onInputChange:G,onInputFocus:S,onInputBlur:y,onLog:K,onLogicUpdate:e,currentTime:N,revision:k=0,scrollY:F,scrollX:c,mouseX:R,mouseY:J,isMouseDown:L,inputs:l,interactive:Y=!0},v)=>{const wA=rA.useRef(null),QA=rA.useRef(new EB),W=rA.useRef(),m=rA.useRef(0),T=rA.useRef(null),u=rA.useRef(k),[d,f]=rA.useState(E||null);rA.useImperativeHandle(v,()=>wA.current),rA.useEffect(()=>{console.log("[ExodeUI] Layout Effect - Component Updated/Mounted"),QA.current.setLayout(Q,B)},[Q,B]),rA.useEffect(()=>{w&&QA.current.setTriggerCallback(w)},[w]),rA.useEffect(()=>{s&&QA.current.setInputUpdateCallback(s)},[s]),rA.useEffect(()=>{h&&QA.current.setComponentChangeCallback(h)},[h]),rA.useEffect(()=>{t&&QA.current.setToggleCallback(t)},[t]),rA.useEffect(()=>{G&&QA.current.setInputChangeCallback(G)},[G]),rA.useEffect(()=>{S&&QA.current.setInputFocusCallback(S)},[S]),rA.useEffect(()=>{y&&QA.current.setInputBlurCallback(y)},[y]),rA.useEffect(()=>{e&&QA.current.setLogicUpdateCallback(e)},[e]),rA.useEffect(()=>{(async()=>{let q=E;if(!q&&A)try{const sA=await(await fetch(A)).text();if(!sA.trim().startsWith("{")&&!sA.trim().startsWith("["))try{const tA=BB.decompressFromBase64(sA.trim());tA&&(q=JSON.parse(tA))}catch{console.warn("[ExodeUI] File is not standard JSON, and decompression failed.")}if(!q&&sA)try{q=JSON.parse(sA)}catch(tA){console.error("[ExodeUI] Failed to parse JSON content:",tA)}}catch(X){console.error("Failed to load ExodeUI animation:",X);return}if(q){const X=QA.current,sA=q.id||q.name||"default";(T.current!==sA||u.current!==k)&&(X.load(q),T.current=sA,u.current=k,f(q),m.current=0,X.advance(0)),o&&o(X)}})()},[E,A,k]),rA.useEffect(()=>{N!==void 0&&QA.current.seek(N)},[N]),rA.useEffect(()=>{const j=QA.current;F!==void 0&&j.updateInput("scrollY",F),c!==void 0&&j.updateInput("scrollX",c),R!==void 0&&j.updateInput("mouseX",R),J!==void 0&&j.updateInput("mouseY",J),L!==void 0&&j.updateInput("isMouseDown",L),l&&Object.entries(l).forEach(([q,X])=>{j.updateInput(q,X)})},[F,c,R,J,L,l]),rA.useEffect(()=>{const j=QA.current,q=wA.current;if(!q)return;m.current=0;const X=q.getContext("2d");if(!X)return;X.imageSmoothingEnabled=!0,X.imageSmoothingQuality="high",K&&j.setOnLogCallback(K);const sA=b=>{m.current||(m.current=b);const $=(b-m.current)/1e3;m.current=b,g&&j.advance($);const iA=window.devicePixelRatio||1,BA=q.getBoundingClientRect(),aA=Math.floor(BA.width*iA),MA=Math.floor(BA.height*iA);(q.width!==aA||q.height!==MA)&&(q.width=aA,q.height=MA),j.render(X,aA,MA),W.current=requestAnimationFrame(sA)};W.current=requestAnimationFrame(sA);const tA=()=>{j.handleScroll(window.scrollX,window.scrollY)};return window.addEventListener("scroll",tA,{passive:!0}),()=>{W.current&&cancelAnimationFrame(W.current),window.removeEventListener("scroll",tA)}},[g]);const O=(j,q)=>{const X=j.currentTarget.getBoundingClientRect(),sA=j.clientX-X.left,tA=j.clientY-X.top,b=X.width,$=X.height;Y&&QA.current.handlePointerInput(q,sA,tA,b,$)};return vA.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",...C},className:I,children:[vA.jsx("canvas",{ref:wA,style:{width:"100%",height:"100%",outline:"none"},tabIndex:0,onPointerDown:j=>{var q;O(j,"down"),(q=wA.current)==null||q.focus()},onPointerUp:j=>O(j,"up"),onPointerMove:j=>O(j,"move"),onPointerLeave:j=>O(j,"blur"),onClick:j=>O(j,"click"),onKeyDown:j=>{j.key==="Backspace"||j.key==="Enter"||j.key,QA.current.handleKeyDown(j.nativeEvent)},onWheel:j=>{Y&&QA.current.handleWheel(j.deltaX,j.deltaY)}}),i&&d&&vA.jsx(iB,{artboard:d,config:D})]})});function Ki(){const[E,A]=rA.useState(null),I=rA.useCallback((s,h)=>{E==null||E.setInputBool(s,h)},[E]),C=rA.useCallback((s,h)=>{E==null||E.setInputNumber(s,h)},[E]),g=rA.useCallback(s=>{E==null||E.fireTrigger(s)},[E]),Q=rA.useCallback((s,h)=>{E==null||E.setInputText(s,h)},[E]),B=rA.useCallback((s,h)=>{E==null||E.setInputNumberArray(s,h)},[E]),i=rA.useCallback((s,h)=>{E==null||E.setInputStringArray(s,h)},[E]),D=rA.useCallback((s,h)=>{E==null||E.updateObjectOptions(s,h)},[E]),o=rA.useCallback((s,h,t)=>{E==null||E.updateConstraint(s,h,t)},[E]),w=rA.useCallback((s,h)=>{E==null||E.updateGraphData(s,h)},[E]);return{setEngine:A,engine:E,setInputBool:I,setInputNumber:C,fireTrigger:g,setInputText:Q,setInputNumberArray:B,setInputStringArray:i,updateConstraint:o,updateGraphData:w,updateObjectOptions:D}}const yi={version:"6.2.9"}.version;XA.BehaviorSensor=II,XA.BehaviorType=Z,XA.ConditionOp=lC,XA.ExodeSEO=iB,XA.ExodeUICanvas=Si,XA.ExodeUIEngine=EB,XA.LogicOp=JA,XA.VERSION=yi,XA.useExodeUI=Ki,Object.defineProperty(XA,Symbol.toStringTag,{value:"Module"})});
|
|
34
|
+
`);let iA=-B/2+f;const BA=T*1.2;let aA=0;$.forEach((MA,YA)=>{const HA=MA.split(" ");let WA="";for(let P=0;P<HA.length;P++){const oA=WA+HA[P]+" ";A.measureText(oA).width>X&&P>0?(A.fillText(WA,q,iA),WA=HA[P]+" ",iA+=BA):WA=oA}A.fillText(WA,q,iA),aA=A.measureText(WA).width,YA<$.length-1&&(iA+=BA,aA=0)}),i&&!QA&&Math.floor(performance.now()/500)%2===0&&A.fillRect(q+aA,iA,1.5,T)}else{const iA=A.measureText(sA).width;let BA=0;if(iA>X&&(BA=iA-X),A.fillText(sA,q-BA,0),i&&!QA&&Math.floor(performance.now()/500)%2===0){const MA=q+iA-BA;A.fillRect(MA,-(T/2),1.5,T)}}if(A.restore(),s.visible!==!1){const $=s.text||"Label",iA=s.fontSize||12,BA=s.color||"rgba(156, 163, 175, 1)",aA=s.offset??8;A.font=`600 ${iA}px "${u}", sans-serif`,A.fillStyle=BA,A.textAlign="left",A.textBaseline="bottom";const MA=-(Q/2),YA=-(B/2)-aA;A.fillText($,MA,YA)}if(h.visible===!0){const $=h.text||"Helper text",iA=h.fontSize||11,BA=w==="error"?"rgba(239, 68, 68, 1)":h.color||"rgba(156, 163, 175, 1)",aA=h.offset??6;A.font=`400 ${iA}px "${u}", sans-serif`,A.fillStyle=BA,A.textAlign="left",A.textBaseline="top";const MA=-(Q/2),YA=B/2+aA;A.fillText($,MA,YA)}}renderSlider(A,I){const C=this.objectStates.get(I.id),g=(C==null?void 0:C.geometry)||I.geometry,Q=(C==null?void 0:C.options)||I.options||{},B=g.width||200,i=Q.value??50,D=Q.min??0,w=(Q.max??100)-D,s=w===0?0:(i-D)/w,h=Q.trackHeight||4,t=Q.trackRoundedness??2,G=Q.trackShape??"Rectangle",S=Q.trackPath||"",y=Q.activeColor||"#3b82f6",K=Q.inactiveColor||"#374151",e=Q.thumbShape||"Ellipse",N=Q.thumbWidth??16,k=Q.thumbHeight??16,F=Q.thumbRoundedness??0,c=Q.thumbColor||"#ffffff",R=Q.thumbPath||"",J=Q.thumbIcon||"",L=Q.showValueTooltip??!1,l=Q.tooltipBgColor||"#333333",Y=Q.tooltipColor||"#ffffff",v=Q.tooltipOffsetX??0,wA=Q.tooltipOffsetY??-25,QA=(q,X,sA,tA,b,$,iA)=>{if((q==="Custom"||q==="Icon")&&iA)try{const BA=new Path2D(iA);if(A.save(),A.translate(X,sA),q==="Icon"){const aA=Math.min(tA,b)/24;A.scale(aA,aA),A.translate(-12,-12)}A.fill(BA),A.restore();return}catch(BA){console.error("Error drawing slider shape in engine:",BA)}if(A.beginPath(),q==="Ellipse")A.ellipse(X,sA,tA/2,b/2,0,0,Math.PI*2);else if(q==="Rectangle")this.drawRoundRect(A,X-tA/2,sA-b/2,tA,b,$);else if(q==="Triangle")A.moveTo(X,sA-b/2),A.lineTo(X+tA/2,sA+b/2),A.lineTo(X-tA/2,sA+b/2),A.closePath();else if(q==="Diamond")A.moveTo(X,sA-b/2),A.lineTo(X+tA/2,sA),A.lineTo(X,sA+b/2),A.lineTo(X-tA/2,sA),A.closePath();else if(q==="Polygon"){const BA=I.geometry.sides||3,aA=I.geometry.radius||Math.min(tA,b)/2;for(let MA=0;MA<BA;MA++){const YA=MA*2*Math.PI/BA-Math.PI/2,HA=X+aA*Math.cos(YA),WA=sA+aA*Math.sin(YA);MA===0?A.moveTo(HA,WA):A.lineTo(HA,WA)}A.closePath()}else if(q==="Star"){const aA=Math.min(tA,b)/2,MA=aA/2;for(let YA=0;YA<5*2;YA++){const HA=YA%2===0?aA:MA,WA=YA*Math.PI/5-Math.PI/2;A.lineTo(X+HA*Math.cos(WA),sA+HA*Math.sin(WA))}A.closePath()}else q==="Line"&&(A.moveTo(X-tA/2,sA),A.lineTo(X+tA/2,sA));A.fill()};A.fillStyle=K,G==="Line"?(A.strokeStyle=K,A.lineWidth=h,A.beginPath(),A.moveTo(-B/2,0),A.lineTo(B/2,0),A.stroke()):QA(G,0,0,B,h,t,S);const W=B-N,m=-B/2+N/2+s*W,T=m- -B/2;T>0&&(A.fillStyle=y,G==="Line"?(A.strokeStyle=y,A.lineWidth=h,A.beginPath(),A.moveTo(-B/2,0),A.lineTo(m,0),A.stroke()):G==="Rectangle"&&(A.beginPath(),this.drawRoundRect(A,-B/2,-h/2,T,h,t),A.fill())),A.save(),A.translate(m,0);const u=A.getTransform(),d=Math.sqrt(u.a*u.a+u.b*u.b)||1;if(A.shadowColor="rgba(0,0,0,0.2)",A.shadowBlur=4*d,A.shadowOffsetY=1*d,A.fillStyle=c,QA(e,0,0,N,k,F,e==="Icon"?J:R),A.restore(),L){A.save(),A.translate(m+v,wA);const q=Math.round(i).toString();A.font="10px Inter, sans-serif";const X=A.measureText(q),sA=6,tA=4,b=X.width+sA*2,$=14+tA;A.beginPath(),this.drawRoundRect(A,-b/2,-$/2,b,$,4),A.fillStyle=l,A.fill(),A.fillStyle=Y,A.textAlign="center",A.textBaseline="middle",A.fillText(q,0,0),A.restore()}const f=Q.label||{},O=Q.helperText||{},j=Q.fontFamily||"Inter";if(f.visible!==!1){const q=f.text||"Label",X=f.fontSize||12,sA=f.color||"rgba(156, 163, 175, 1)",tA=f.offset??8;A.font=`600 ${X}px "${j}", sans-serif`,A.fillStyle=sA,A.textAlign="left",A.textBaseline="bottom";const b=-(B/2),$=-(h/2)-tA;A.fillText(q,b,$)}if(O.visible===!0){const q=O.text||"Helper text",X=O.fontSize||11,sA=O.color||"rgba(156, 163, 175, 1)",tA=O.offset??6;A.font=`400 ${X}px "${j}", sans-serif`,A.fillStyle=sA,A.textAlign="left",A.textBaseline="top";const b=-(B/2),$=h/2+tA;A.fillText(q,b,$)}}renderDropdown(A,I){var wA;const C=this.objectStates.get(I.id);if(!C)return;const g=C.options||I.options||{},Q=I.geometry.width||160,B=I.geometry.height||40,i=-Q/2,D=-B/2,o=g.corner_radius??6,w=g.disabled||g.previewState==="disabled",s=this.lastHoveredObjectId===I.id||g.previewState==="hover",h=(g.isOpen||g.previewState==="active")&&!w;let t=g.backgroundColor,G=g.borderColor,S=g.color||"#333333";w?(t=g.disabledBackgroundColor||"#f3f4f6",G=g.disabledBorderColor||"#e5e7eb",S=g.disabledColor||"#9ca3af"):h?(t=g.activeBackgroundColor||t,G=g.activeBorderColor||G,S=g.activeColor||S):s&&(t=g.hoverBackgroundColor||t,G=g.hoverBorderColor||G,S=g.hoverColor||S),t||(t="#ffffff"),G||(G="#e5e7eb");const y=A.globalAlpha;A.globalAlpha=y*(g.opacity??1),this.drawRoundRect(A,i,D,Q,B,o),A.fillStyle=this.createCanvasFill(A,typeof t=="string"?{type:"Solid",color:t}:t,Q,B)||"#ffffff",A.fill();const K=g.borderWidth??1;K>0&&(A.strokeStyle=this.createCanvasFill(A,typeof G=="string"?{type:"Solid",color:G}:G,Q,B)||"#e5e7eb",A.lineWidth=K,A.stroke());const e=12,N=g.chevronType||"chevron",k=g.chevronSize||16,F=(h?g.openIconColor:g.closedIconColor)||g.chevronColor||"#6b7280";if(N!=="none"){const QA=i+Q-e-k/2;A.save(),A.translate(QA,0);const W=h?g.openIconAngle??180:g.closedIconAngle??0;if(A.rotate(W*Math.PI/180),A.strokeStyle=F,A.fillStyle=F,A.lineWidth=1.5,A.lineCap="round",A.lineJoin="round",N==="chevron")A.beginPath(),A.moveTo(-k/2,-k*.2),A.lineTo(0,k*.2),A.lineTo(k/2,-k*.2),A.stroke();else if(N==="custom"||N==="path"){const m=h&&g.openIconPath||g.closedIconPath;if(m){const T=new Path2D(m);A.save();const u=k/24;A.scale(u,u),A.translate(-12,-12),A.fill(T),A.restore()}}A.restore()}const c=g.selectedOption||g.placeholder||"Select...",R=g.fontSize||14,J=g.fontWeight||400,L=g.fontFamily||"Inter, sans-serif";A.font=`${J} ${R}px ${L}`;const l=w?g.disabledColor||"#9ca3af":!g.selectedOption&&g.placeholder?"#9ca3af":S;A.fillStyle=this.createCanvasFill(A,typeof l=="string"?{type:"Solid",color:l}:l,Q,B)||"#333333",A.textAlign="left",A.textBaseline="middle";const Y=N==="none"?0:k+8,v=Q-e*2-Y;if(A.save(),A.beginPath(),A.rect(i+e,D,v,B),A.clip(),A.fillText(c,i+e,0),A.restore(),h&&!w){const QA=D+B+4,W=g.optionsList||[],m=g.itemHeight||32,T=g.listPadding??4,u=W.length*m+T*2,d=g.listCornerRadius??o;A.save();const f=g.listShadow||{},O=A.getTransform(),j=Math.sqrt(O.a*O.a+O.b*O.b)||1;A.shadowColor=typeof f.color=="string"?f.color:((wA=f.color)==null?void 0:wA.color)||"rgba(0,0,0,0.15)",A.shadowBlur=(f.blur??12)*j,A.shadowOffsetY=(f.offsetY??6)*j,A.shadowOffsetX=(f.offsetX??0)*j,A.beginPath(),this.drawRoundRect(A,i,QA,Q,u,d),A.fillStyle=this.createCanvasFill(A,typeof g.listBackgroundColor=="string"?{type:"Solid",color:g.listBackgroundColor}:g.listBackgroundColor||{type:"Solid",color:"#ffffff"},Q,u)||"#ffffff",A.fill();const q=g.listBorderWidth??1;q>0&&(A.shadowColor="transparent",A.strokeStyle=this.createCanvasFill(A,typeof g.listBorderColor=="string"?{type:"Solid",color:g.listBorderColor}:g.listBorderColor||{type:"Solid",color:G},Q,u)||"#e5e7eb",A.lineWidth=q,A.stroke()),A.restore();const X=g.itemFontSize||R,sA=g.itemFontFamily||L;A.font=`${J} ${X}px ${sA}`,W.forEach((tA,b)=>{const $=QA+T+b*m;if(tA===g.selectedOption)A.fillStyle=this.createCanvasFill(A,typeof g.itemSelectedBackgroundColor=="string"?{type:"Solid",color:g.itemSelectedBackgroundColor}:g.itemSelectedBackgroundColor||{type:"Solid",color:"#f3f4f6"},Q,m)||"#f3f4f6",A.fillRect(i+q,$,Q-q*2,m),A.fillStyle=g.itemSelectedColor||g.activeColor||S||"#374151";else if(A.fillStyle=g.listTextColor||S||"#333333",this.activeDropdownId===I.id&&this._lastPointerPos){const BA=this._lastPointerPos.y-(QA+T),aA=Math.floor(BA/m);b===aA&&(A.fillStyle=this.createCanvasFill(A,typeof g.itemHoverBackgroundColor=="string"?{type:"Solid",color:g.itemHoverBackgroundColor}:g.itemHoverBackgroundColor||{type:"Solid",color:"#f9fafb"},Q,m)||"#f9fafb",A.fillRect(i+q,$,Q-q*2,m),A.fillStyle=g.itemHoverColor||S)}A.fillText(tA,i+e,$+m/2)})}A.globalAlpha=y}renderButton(A,I){var N,k,F,c;const C=this.objectStates.get(I.id),g=(C==null?void 0:C.options)||I.options||{},Q=((N=I.geometry)==null?void 0:N.width)||120,B=((k=I.geometry)==null?void 0:k.height)||40,i=-Q/2,D=-B/2,o=this.lastHoveredObjectId===I.id,w=g.corner_radius??8,s=g.bgShape||"Rectangle",h=o?((F=g.hoverStyle)==null?void 0:F.backgroundColor)||g.buttonBgColor||"#3b82f6":g.buttonBgColor||"#3b82f6",t=g.label||{},G=o?((c=g.hoverStyle)==null?void 0:c.textColor)||t.color||"#ffffff":t.color||"#ffffff",S=g.icon||{enabled:!1};A.save(),A.beginPath(),s==="Rectangle"?this.drawRoundRect(A,i,D,Q,B,w):s==="Ellipse"||s==="Circle"?A.ellipse(0,0,Q/2,B/2,0,0,Math.PI*2):s==="Pill"&&this.drawRoundRect(A,i,D,Q,B,B/2),A.fillStyle=h,A.fill();const y=t.fontSize||14,K=t.fontFamily||"Inter";A.font=`${t.fontWeight||400} ${y}px "${K}", sans-serif`,A.fillStyle=G,A.textAlign="center",A.textBaseline="middle";let e=0;if(S.enabled&&S.svgPath){const R=S.size||16,J=S.gap||8,L=S.position==="left"?-(A.measureText(t.text||"").width/2+R/2+J/2):A.measureText(t.text||"").width/2+R/2+J/2;A.save(),A.translate(L,0);const l=new Path2D(S.svgPath),Y=R/24;A.scale(Y,Y),A.translate(-12,-12),A.fillStyle=S.color||G,A.fill(l),A.restore(),e=S.position==="left"?R/2+J/2:-(R/2+J/2)}A.fillText(t.text||"Button",e,0),A.restore()}renderToggleButton(A,I){var y,K;const C=this.objectStates.get(I.id),g=(C==null?void 0:C.options)||I.options||{},Q=g.checked??!1,B=((y=I.geometry)==null?void 0:y.width)||120,i=((K=I.geometry)==null?void 0:K.height)||40,D=-B/2,o=-i/2,w=g.corner_radius??8,s=g.label||{},h=Q?g.activeColor||"#3b82f6":g.inactiveColor||"#374151",t=Q?g.activeTextColor||"#ffffff":g.inactiveTextColor||"#9ca3af";A.save(),A.beginPath(),this.drawRoundRect(A,D,o,B,i,w),A.fillStyle=h,A.fill();const G=s.fontSize||14,S=s.fontFamily||"Inter";A.font=`${s.fontWeight||600} ${G}px "${S}", sans-serif`,A.fillStyle=t,A.textAlign="center",A.textBaseline="middle",A.fillText(s.text||"Toggle",0,0),A.restore()}renderToggle(A,I){var e,N;const C=this.objectStates.get(I.id),g=(C==null?void 0:C.options)||I.options||{},Q=((e=I.geometry)==null?void 0:e.width)||52,B=((N=I.geometry)==null?void 0:N.height)||30,i=-Q/2,D=-B/2,o=g.checked??!1,w=g.corner_radius??B/2;A.beginPath(),this.drawRoundRect(A,i,D,Q,B,w),A.fillStyle=o?g.activeColor||"#10b981":g.inactiveColor||"#374151",g.disabled&&(A.globalAlpha*=.5),A.fill();const s=3,h=B-s*2,t=h/2,G=i+s,S=i+Q-s-h,y=o?S:G,K=D+s;if(A.beginPath(),A.arc(y+t,K+t,t,0,Math.PI*2),A.fillStyle=g.knobColor||"#ffffff",A.fill(),g.disabled&&(A.globalAlpha*=2),g.label&&g.label.text){const k=g.label,F=k.fontSize||14,c=k.fontWeight||400,R=k.fontFamily||"Inter";A.font=`${c} ${F}px "${R}", sans-serif`,A.fillStyle=k.color||"#f3f4f6",A.textBaseline="middle";const J=k.gap||10;let L=0,l=0;k.position==="left"?(A.textAlign="right",L=i-J,l=0):k.position==="right"?(A.textAlign="left",L=i+Q+J,l=0):k.position==="top"?(A.textAlign="center",L=0,l=D-J,A.textBaseline="bottom"):k.position==="bottom"?(A.textAlign="center",L=0,l=D+B+J,A.textBaseline="top"):(A.textAlign="left",L=i+Q+J,l=0),A.fillText(k.text,L,l)}}renderLineGraph(A,I,C,g){let Q=I.datasets||[];if((!Q||Q.length===0)&&(I.data||I.graphData)&&(Q=[{id:"line-1",label:"Series 1",data:I.data||I.graphData||[],lineColor:I.lineColor||"#3b82f6",lineWidth:I.lineWidth||2,showArea:I.showArea||!1,areaColor:I.areaColor||"rgba(139, 92, 246, 0.3)",smoothing:I.smoothing||!1,showPoints:I.showPoints!==void 0?I.showPoints:!0,pointSize:I.pointSize||6,pointFill:I.pointFill||"#ffffff",pointStrokeColor:I.pointStrokeColor||I.lineColor||"#3b82f6",pointStrokeWidth:I.pointStrokeWidth||2}]),!Q||Q.length===0||!Q.some(S=>S.data&&S.data.length>=2)){A.save(),A.fillStyle="#6366f1",A.font="12px Inter, system-ui, sans-serif",A.textAlign="center",A.textBaseline="middle",A.fillText("NO DATA",0,0),A.restore();return}let B=1/0,i=-1/0,D=0;if(Q.forEach(S=>{let y=S.data;if(S.isVarEnabled&&S.inputId){let K=this.inputs.get(S.inputId);if(K===void 0){const e=this.inputNameMap.get(S.inputId);e&&e.length>0&&(K=this.inputs.get(e[0]))}K&&Array.isArray(K)&&(y=K)}if(y&&y.length>0){const K=y.filter(e=>typeof e=="number"&&!isNaN(e));K.length>0&&(B=Math.min(B,...K),i=Math.max(i,...K),D=Math.max(D,y.length))}S._resolvedData=y}),D<2)return;const o=i-B,w=C/(D-1),s=S=>{const y=o===0?.5:(S-B)/o;return g/2-y*g},h=S=>S*w-C/2,t=I.axisColor||"#333333";if(I.showXAxis&&(A.beginPath(),A.strokeStyle=I.xAxisColor||t,A.lineWidth=1,A.moveTo(-C/2,g/2),A.lineTo(C/2,g/2),A.stroke()),I.showYAxis&&(A.beginPath(),A.strokeStyle=I.yAxisColor||t,A.lineWidth=1,A.moveTo(-C/2,-g/2),A.lineTo(-C/2,g/2),A.stroke()),A.fillStyle=I.axisLabelColor||"#333333",A.font=`${I.axisLabelFontSize||10}px Inter, sans-serif`,I.showXLabels){A.textAlign="center",A.textBaseline="top";for(let S=0;S<D;S++){const y=h(S);A.fillText(`${S+1}`,y,g/2+5)}}if(I.showYLabels){A.textAlign="right",A.textBaseline="middle";const S=-C/2-5,y=(i+B)/2;A.fillText(i.toFixed(1),S,s(i)),A.fillText(y.toFixed(1),S,s(y)),A.fillText(B.toFixed(1),S,s(B))}const G=10;if(Q.forEach(S=>{const y=S._resolvedData;if(!(!y||y.length<2)){if(S.showArea){if(A.beginPath(),A.moveTo(h(0),g/2),A.lineTo(h(0),s(y[0])),S.smoothing&&y.length>2)for(let e=0;e<y.length-1;e++){const N=y[e===0?e:e-1],k=y[e],F=y[e+1],c=y[e+1===y.length-1?e+1:e+2];for(let R=1;R<=G;R++){const J=R/G,L=this._catmullRom(N,k,F,c,J);A.lineTo(h(e+J),s(L))}}else for(let e=1;e<y.length;e++)A.lineTo(h(e),s(y[e]));A.lineTo(h(y.length-1),g/2),A.closePath();const K=A.globalAlpha;A.globalAlpha=K*(I.areaOpacity??.3),A.fillStyle=S.areaColor||"rgba(139, 92, 246, 0.2)",A.fill(),A.globalAlpha=K}if(A.beginPath(),A.strokeStyle=S.lineColor||"#3b82f6",A.lineWidth=S.lineWidth||2,A.lineJoin="round",A.lineCap="round",A.moveTo(h(0),s(y[0])),S.smoothing&&y.length>2)for(let K=0;K<y.length-1;K++){const e=y[K===0?K:K-1],N=y[K],k=y[K+1],F=y[K+1===y.length-1?K+1:K+2];for(let c=1;c<=G;c++){const R=c/G,J=this._catmullRom(e,N,k,F,R);A.lineTo(h(K+R),s(J))}}else for(let K=1;K<y.length;K++)A.lineTo(h(K),s(y[K]));A.stroke(),S.showPoints&&y.forEach((K,e)=>{const N=h(e),k=s(K);A.beginPath(),A.arc(N,k,(S.pointSize||6)/2,0,Math.PI*2),A.fillStyle=S.pointFill||"#ffffff",A.fill(),A.strokeStyle=S.pointStrokeColor||S.lineColor||"#3b82f6",A.lineWidth=S.pointStrokeWidth||1,A.stroke()})}}),I.showLegend&&Q.length>0){const S=C/2-10;let y=-g/2+15;const K=I.legendFontSize||10,e=K+5;A.font=`${K}px Inter, sans-serif`,A.textAlign="right",A.textBaseline="alphabetic",Q.forEach(N=>{const F=N.label||"Series",c=A.measureText(F).width;A.beginPath(),A.rect(S-c-8-5,y-(8/2+2),8,8),A.fillStyle=N.lineColor||"#3b82f6",A.fill(),A.fillStyle=I.legendColor||"#333333",A.fillText(F,S,y),y+=e})}}_catmullRom(A,I,C,g,Q){const B=(C-A)*.5,i=(g-I)*.5,D=Q*Q,o=Q*D;return(2*I-2*C+B+i)*o+(-3*I+3*C-2*B-i)*D+B*Q+I}normalizeOpacity(A){const I=typeof A=="number"?A:parseFloat(String(A));return isNaN(I)?1:I>1?Math.min(1,I/100):Math.max(0,Math.min(1,I))}createCanvasFill(A,I,C,g){var Q,B,i;if(!I||I.type==="None")return null;if(typeof I=="string")return I;if(I.type==="Solid"&&I.color){const D=I.color,w=(((B=(Q=this.artboard)==null?void 0:Q.tokens)==null?void 0:B.colors)||{})[D]||D;return A.fillStyle=w,w}if((I.type==="LinearGradient"||I.type==="RadialGradient"||I.type==="AngularGradient"||I.type==="DiamondGradient")&&I.stops){const D=(o,w=100)=>{var k,F;const h=(((F=(k=this.artboard)==null?void 0:k.tokens)==null?void 0:F.colors)||{})[o]||o,t=this.normalizeOpacity(I.opacity??100),S=this.normalizeOpacity(w)*t;if(S>=1&&h.startsWith("#"))return h;const y=h.startsWith("#")?h.replace("#",""):"ffffff",K=parseInt(y.substring(0,2),16),e=parseInt(y.substring(2,4),16),N=parseInt(y.substring(4,6),16);return`rgba(${K}, ${e}, ${N}, ${S})`};if(I.type==="LinearGradient"){const o=(S,y,K)=>Array.isArray(S)?S[y]??(y===0?0:1):S&&typeof S=="object"?S[K]??(y===0?0:1):y===0?0:1,w=o(I.start,0,"x")*C-C/2,s=o(I.start,1,"y")*g-g/2,h=o(I.end,0,"x")*C-C/2,t=o(I.end,1,"y")*g-g/2,G=A.createLinearGradient(w,s,h,t);if(I.stops.forEach(S=>{const y=S.offset!==void 0?S.offset:S.pos!==void 0?S.pos:S.position!==void 0?S.position:0,K=D(S.color||"#000000",S.opacity??100);G.addColorStop(Math.max(0,Math.min(1,y)),K)}),I.gradientTransform&&G.setTransform){const[S,y,K,e,N,k]=I.gradientTransform;G.setTransform({a:S,b:y,c:K,d:e,e:N,f:k})}return G}else if(I.type==="RadialGradient"){const o=(G,S,y)=>Array.isArray(G)?G[S]??.5:G&&typeof G=="object"?G[y]??.5:.5,w=o(I.center,0,"x")*C-C/2,s=o(I.center,1,"y")*g-g/2,h=(I.radius??.5)*Math.max(C,g),t=A.createRadialGradient(w,s,0,w,s,h);if(I.stops.forEach(G=>{const S=G.offset!==void 0?G.offset:G.pos!==void 0?G.pos:G.position!==void 0?G.position:0,y=D(G.color||"#000000",G.opacity??100);t.addColorStop(Math.max(0,Math.min(1,S)),y)}),I.gradientTransform&&t.setTransform){const[G,S,y,K,e,N]=I.gradientTransform;t.setTransform({a:G,b:S,c:y,d:K,e,f:N})}return t}else if(I.type==="AngularGradient"){const o=(G,S,y)=>Array.isArray(G)?G[S]??.5:G&&typeof G=="object"?G[y]??.5:.5,w=o(I.center||[.5,.5],0,"x")*C-C/2,s=o(I.center||[.5,.5],1,"y")*g-g/2,h=(I.degree||I.angle||0)*(Math.PI/180),t=(i=A.createConicGradient)==null?void 0:i.call(A,h,w,s);if(t){if(I.stops.forEach(G=>{const S=G.offset!==void 0?G.offset:G.pos!==void 0?G.pos:G.position!==void 0?G.position:0,y=D(G.color||"#000000",G.opacity??100);t.addColorStop(Math.max(0,Math.min(1,S)),y)}),I.gradientTransform&&t.setTransform){const[G,S,y,K,e,N]=I.gradientTransform;t.setTransform({a:G,b:S,c:y,d:K,e,f:N})}return t}}else if(I.type==="DiamondGradient"){const o=(G,S,y)=>Array.isArray(G)?G[S]??.5:G&&typeof G=="object"?G[y]??.5:.5,w=o(I.center||[.5,.5],0,"x")*C-C/2,s=o(I.center||[.5,.5],1,"y")*g-g/2,h=(I.radius??.5)*Math.max(C,g);A.save(),A.translate(w,s),A.rotate(Math.PI/4);const t=A.createRadialGradient(0,0,0,0,0,h);if(I.stops.forEach(G=>{const S=G.offset!==void 0?G.offset:G.pos!==void 0?G.pos:G.position!==void 0?G.position:0,y=D(G.color||"#000000",G.opacity??100);t.addColorStop(Math.max(0,Math.min(1,S)),y)}),I.gradientTransform&&t.setTransform){const[G,S,y,K,e,N]=I.gradientTransform;t.setTransform({a:G,b:S,c:y,d:K,e,f:N})}return A.scale(1/Math.SQRT2,1/Math.SQRT2),A.fillStyle=t,A.restore(),t}}if(I.type==="Pattern"&&I.url){let D=this.imageCache.get(I.url);if(D||(D=new Image,D.src=I.url,this.imageCache.set(I.url,D)),D.complete&&D.naturalWidth>0){const o=A.createPattern(D,"repeat");if(o&&(I.scaleX!==void 0||I.offsetX!==void 0)){const w=new DOMMatrix,s=I.scaleX??1,h=I.scaleY??1,t=I.offsetX??0,G=I.offsetY??0,S=I.rotation??0;w.translateSelf(t,G),w.rotateSelf(S),w.scaleSelf(s,h),o.setTransform(w)}return o}}return I.color||null}drawRoundRect(A,I,C,g,Q,B){if(B===0||B===void 0||B===null){A.rect(I,C,g,Q);return}let i=B;if(typeof i=="string")try{i=JSON.parse(i)}catch{i=parseFloat(i)||0}let D=0,o=0,w=0,s=0;typeof i=="number"?D=o=w=s=i:Array.isArray(i)?i.length===1?D=o=w=s=i[0]:i.length===2?(D=w=i[0],o=s=i[1]):i.length===3?(D=i[0],o=s=i[1],w=i[2]):i.length>=4&&(D=i[0],o=i[1],w=i[2],s=i[3]):i&&typeof i=="object"&&(D=i.tl??i.corner_radius??i.cornerRadius??0,o=i.tr??i.corner_radius??i.cornerRadius??0,w=i.br??i.corner_radius??i.cornerRadius??0,s=i.bl??i.corner_radius??i.cornerRadius??0);const h=Math.min(Math.abs(g)/2,Math.abs(Q)/2);if(D=Math.min(Math.max(0,D),h),o=Math.min(Math.max(0,o),h),w=Math.min(Math.max(0,w),h),s=Math.min(Math.max(0,s),h),A.roundRect){A.roundRect(I,C,g,Q,[D,o,w,s]);return}A.moveTo(I+D,C),A.lineTo(I+g-o,C),A.arcTo(I+g,C,I+g,C+o,o),A.lineTo(I+g,C+Q-w),A.arcTo(I+g,C+Q,I+g-w,C+Q,w),A.lineTo(I+s,C+Q),A.arcTo(I,C+Q,I,C+Q-s,s),A.lineTo(I,C+D),A.arcTo(I,C,I+D,C,D),A.closePath()}renderListView(A,I){var QA,W,m,T;const C=this.objectStates.get(I.id)||{},g=C.options||I.options||{},Q=C.width!==void 0?C.width:((QA=I.geometry)==null?void 0:QA.width)||200,B=C.height!==void 0?C.height:((W=I.geometry)==null?void 0:W.height)||300,i=-Q/2,D=-B/2,o=C.corner_radius!==void 0?C.corner_radius:g.corner_radius??0,w=g.orientation||"vertical",s=g.items||[],h=g.itemGap??10,t=g.itemHeight??50,G=g.itemWidth??200,S=g.scrollOffset??0,y=g.padding??0,K=g.glassEffect!==!1,e=g.accentColor||"#3b82f6",N=g.itemTextColor||"#333333",k=g.itemBackgroundColor||"#ffffff",F=g.hoveredIndex??null,c=g.activeItemIndex??null,R=g.glowIntensity??0,J=g.glowColor||"#3b82f6",L=typeof J=="string"?J:J.color||((T=(m=J.stops)==null?void 0:m[0])==null?void 0:T.color)||"#3b82f6",l=g.opacity!==void 0?g.opacity:I.opacity!==void 0?I.opacity:1;if(A.save(),A.globalAlpha*=l,R>0){const u=A.getTransform(),d=Math.sqrt(u.a*u.a+u.b*u.b)||1;A.shadowColor=L,A.shadowBlur=R*2*d,A.shadowOffsetX=0,A.shadowOffsetY=0}if(K){const u=g.listBackgroundColor||"rgba(31, 41, 55, 0.4)",d=this.createCanvasFill(A,u,Q,B);A.fillStyle=d||"rgba(31, 41, 55, 0.4)",this.drawListViewRect(A,i,D,Q,B,o),A.fill();const f=A.createLinearGradient(i,D,i+Q,D+B);f.addColorStop(0,"rgba(255, 255, 255, 0.15)"),f.addColorStop(.5,"rgba(255, 255, 255, 0.08)"),f.addColorStop(1,"rgba(255, 255, 255, 0.03)"),A.fillStyle=f,this.drawListViewRect(A,i,D,Q,B,o),A.fill(),A.strokeStyle="rgba(255, 255, 255, 0.25)",A.lineWidth=1,this.drawListViewRect(A,i,D,Q,B,o),A.stroke()}else{const u=g.listBackgroundColor||"transparent",d=this.createCanvasFill(A,u,Q,B);d&&(A.fillStyle=d,this.drawListViewRect(A,i,D,Q,B,o),A.fill());const f=g.borderWidth??0;f>0&&(A.strokeStyle=g.borderColor||"#cccccc",A.lineWidth=f,this.drawListViewRect(A,i,D,Q,B,o),A.stroke())}A.shadowBlur=0,A.save(),this.drawListViewRect(A,i,D,Q,B,o),A.clip();const Y=typeof y=="number"?y:w==="vertical"?y[0]:y[3];let v=(w==="vertical"?D:i)+S+Y;if(A.textBaseline="middle",s.forEach((u,d)=>{const f=w==="vertical"?Q:G,O=w==="vertical"?t:B,j=w==="vertical"?i:v,q=w==="vertical"?v:D,X=F===d,sA=c===d;if(sA){const BA=this.createCanvasFill(A,e,f,O);A.fillStyle=BA||e;const aA=A.globalAlpha;A.globalAlpha=aA*.8,A.fillRect(j,q,f,O),A.globalAlpha=aA}else if(X)A.fillStyle=K?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.05)",A.fillRect(j,q,f,O);else if(k!=="transparent"){const BA=this.createCanvasFill(A,k,f,O);A.fillStyle=BA||k,A.fillRect(j,q,f,O)}if(sA||X){const BA=this.createCanvasFill(A,e,w==="vertical"?3:f,w==="vertical"?O:3);A.fillStyle=BA||e,w==="vertical"?A.fillRect(j,q,3,O):A.fillRect(j,q+O-3,f,3)}const tA=sA?"#ffffff":K?"rgba(255, 255, 255, 0.9)":N;A.fillStyle=tA,A.font=sA||X?"600 14px Inter, sans-serif":"400 14px Inter, sans-serif";const b=typeof u=="string"?u:(u==null?void 0:u.label)||`Item ${d+1}`,$=j+(w==="vertical"?16:f/2),iA=q+O/2;w==="horizontal"?A.textAlign="center":A.textAlign="left",A.fillText(b,$,iA),v+=(w==="vertical"?t:G)+h}),A.restore(),g.showScrollbar!==!1){const u=(s.length||0)*(w==="vertical"?t:G)+((s.length||0)-1)*h,d=w==="vertical"?B:Q;if(u>d){const f=d/u,O=d*f,j=-S/u*d,q=g.scrollbarColor||"rgba(255,255,255,0.3)",X=g.scrollbarWidth||4;A.fillStyle=q,w==="vertical"?A.fillRect(i+Q-X-2,D+j,X,O):A.fillRect(i+j,D+B-X-2,O,X)}}A.restore()}updateListViewScrollFromPointer(A){var y,K;if(!this._lastPointerPos||!this._prevPointerPos)return;const I=A.options||{},C=I.orientation||"vertical",g=this._lastPointerPos.x-this._prevPointerPos.x,Q=this._lastPointerPos.y-this._prevPointerPos.y;C==="vertical"?I.scrollOffset=(I.scrollOffset||0)+Q:I.scrollOffset=(I.scrollOffset||0)+g;const B=this.objectStates.get(A.id)||{},i=I.items||[],D=I.itemGap??10,o=I.itemHeight??50,w=I.itemWidth??200,s=B.width!==void 0?B.width:((y=A.geometry)==null?void 0:y.width)||200,h=B.height!==void 0?B.height:((K=A.geometry)==null?void 0:K.height)||300,t=(i.length||0)*(C==="vertical"?o:w)+((i.length||0)-1)*D,S=Math.max(0,t-(C==="vertical"?h:s)+(I.padding*2||0));I.scrollOffset>0&&(I.scrollOffset=0),I.scrollOffset<-S&&(I.scrollOffset=-S)}updateListViewHoverFromPointer(A,I,C){const g=this.getListViewItemIndexAtPointer(A,I,C),Q=A.options||{};Q.hoveredIndex!==g&&(Q.hoveredIndex=g)}getListViewItemIndexAtPointer(A,I,C){var Y,v;const g=A.options||{},Q=this.objectStates.get(A.id)||{},B=g.items||[];if(B.length===0)return null;const i=Q.width!==void 0?Q.width:((Y=A.geometry)==null?void 0:Y.width)||200,D=Q.height!==void 0?Q.height:((v=A.geometry)==null?void 0:v.height)||300,o=g.orientation||"vertical",w=g.itemGap??10,s=g.itemHeight??50,h=g.itemWidth??200,t=g.scrollOffset??0,G=g.padding??0,S=this.getWorldTransform(A.id),y=I-S.x,K=C-S.y,e=-S.rotation*(Math.PI/180),N=Math.cos(e),k=Math.sin(e),F=y*N-K*k,c=y*k+K*N,R=-i/2,J=-D/2,L=typeof G=="number"?G:o==="vertical"?G[0]:G[3];let l=(o==="vertical"?J:R)+t+L;for(let wA=0;wA<B.length;wA++){const QA=o==="vertical"?i:h,W=o==="vertical"?s:D,m=o==="vertical"?R:l,T=o==="vertical"?l:J;if(F>=m&&F<=m+QA&&c>=T&&c<=T+W)return wA;l+=(o==="vertical"?s:h)+w}return null}drawListViewRect(A,I,C,g,Q,B){A.beginPath(),this.drawRoundRect(A,I,C,g,Q,B),A.fill()}solveBehaviors(A){if(!this.artboard)return;if(!this._lastPointerPos){this.frameCount%60;return}const{x:I,y:C}=this._lastPointerPos;this.artboard.objects.forEach(g=>{if(!g.behaviors||g.behaviors.length===0)return;const Q=this.objectStates.get(g.id);Q&&g.behaviors.forEach(B=>{var h,t,G,S,y,K,e,N,k,F,c,R,J,L,l,Y,v,wA,QA,W,m,T,u,d,f,O,j,q,X,sA,tA,b,$,iA,BA,aA,MA,YA,HA,WA,P,oA,x,p,z,EA,fA,nA,UA,FA,yA,n,bA,_A,VA,xA,DA,eA,uA,RA,hA,pA,IA,_,CA,NA,H,GA,kA,wI,yI,kI,rI,tI,sI,GI,NI;if(!B.enabled)return;const i=B.startTime||0,D=B.endTime||1/0;if(this.currentTime<i||this.currentTime>D)return;const o=Q.x-I,w=Q.y-C,s=Math.sqrt(o*o+w*w);if(this.frameCount%240===0&&Math.random()<.1&&console.log(`[ExodeUI] Executing ${B.type} on ${g.name}`),B.type===Z.Proximity){const V=((h=B.settings)==null?void 0:h.radius)||300,AA=((t=B.settings)==null?void 0:t.falloff)||"smooth";let gA=0;s<V&&(AA==="linear"?gA=1-s/V:gA=Math.pow(1-s/V,2)),gA>0&&B.sensors.forEach(dA=>{this.applyBehaviorSensor(Q,dA,gA,A,B.settings,g)})}else if(B.type===Z.Magnetic){const V=((G=B.settings)==null?void 0:G.radius)||400,AA=((S=B.settings)==null?void 0:S.strength)||.5;if(s<V&&s>5){const gA=1-s/V,dA=o*gA*AA,aI=w*gA*AA;Q.x-=dA*A*10,Q.y-=aI*A*10}}else if(B.type===Z.Repel){const V=((y=B.settings)==null?void 0:y.radius)||300,AA=((K=B.settings)==null?void 0:K.strength)||1;if(s<V){const gA=Math.pow(1-s/V,2);Q.x+=o/(s||1)*gA*60*AA*A*5,Q.y+=w/(s||1)*gA*60*AA*A*5}}else if(B.type===Z.Orbit){const V=((e=B.settings)==null?void 0:e.speed)||1,AA=((N=B.settings)==null?void 0:N.radius)||30,gA=this.currentTime*V*Math.PI*2;Q.x+=Math.cos(gA)*AA*A*5,Q.y+=Math.sin(gA)*AA*A*5,Q.rotation+=2*A*5}else if(B.type===Z.Vortex){const V=((k=B.settings)==null?void 0:k.radius)||400,AA=((F=B.settings)==null?void 0:F.speed)||2,gA=((c=B.settings)==null?void 0:c.strength)||1;if(s<V){const dA=Math.pow(1-s/V,1.5),aI=this.currentTime*AA*Math.PI*2,rC=Math.cos(aI)*30-o*.4,nC=Math.sin(aI)*30-w*.4;Q.x+=rC*dA*gA*A*5,Q.y+=nC*dA*gA*A*5,Q.rotation+=5*dA*gA*A*5,Q.scale_x*=1-dA*.1*gA*A,Q.scale_y*=1-dA*.1*gA*A}}else if(B.type===Z.Fluid){const V=((R=B.settings)==null?void 0:R.radius)||300,AA=((J=B.settings)==null?void 0:J.strength)||1;if(s<V){const gA=Math.pow(1-s/V,1.2),dA=o/(s||1)*gA*1.2*AA,aI=w/(s||1)*gA*1.2*AA;Q.x+=dA*10*A*5,Q.y+=aI*10*A*5,Q.scale_x*=1+gA*.3*AA*A,Q.scale_y*=1+gA*.3*AA*A}}else if(B.type===Z.Elastic){const V=((L=B.settings)==null?void 0:L.radius)||300,AA=((l=B.settings)==null?void 0:l.strength)||1;if(s<V){const gA=1-s/V;Q.scale_x*=1+gA*.4*AA*A,Q.scale_y*=1+gA*.4*AA*A}}else if(B.type===Z.Holographic){const V=Q.x-this.canvasWidth/2,AA=Q.y-this.canvasHeight/2,gA=((Y=B.settings)==null?void 0:Y.factor)||25;if(Q.x-=V/1e3*gA*A*5,Q.y-=AA/1e3*gA*A*5,Q.style){const dA=1-Math.min(1,s/400);Q.style.exposure=(Q.style.exposure||1)+dA*.5*A}}else if(B.type===Z.Sticky){const V=((v=B.settings)==null?void 0:v.radius)||80,AA=((wA=B.settings)==null?void 0:wA.strength)||1;if(s<V){const gA=Math.pow(1-s/V,2);Q.x-=o*gA*AA*A*10,Q.y-=w*gA*AA*A*10,Q.scale_x*=1-gA*.1*AA*A,Q.scale_y*=1-gA*.1*AA*A}}else if(B.type===Z.Dilation){const V=((QA=B.settings)==null?void 0:QA.size)||120,AA=((W=B.settings)==null?void 0:W.strength)||1;if(s<V){const gA=1-s/V;Q.scale_x*=1+gA*.5*AA*A,Q.scale_y*=1+gA*.5*AA*A}}else if(B.type===Z.Parallax){const V=((m=B.settings)==null?void 0:m.factor)||.05,AA=this.canvasHeight/2,gA=(this._lastPointerPos.y-AA)*V;Q.y+=gA*A*10}else if(B.type===Z.Squash){const V=((T=B.settings)==null?void 0:T.strength)||.8;s<(g.width||100)&&this.isMouseDown?(Q.scale_y=this.lerp(Q.scale_y??1,(((u=g.transform)==null?void 0:u.scale_y)??1)*V,.3),Q.scale_x=this.lerp(Q.scale_x??1,(((d=g.transform)==null?void 0:d.scale_x)??1)*(1+(1-V)*.4),.3)):(Q.scale_y=this.lerp(Q.scale_y??1,((f=g.transform)==null?void 0:f.scale_y)??1,.2),Q.scale_x=this.lerp(Q.scale_x??1,((O=g.transform)==null?void 0:O.scale_x)??1,.2))}else if(B.type===Z.TextCounter){const V=((j=B.settings)==null?void 0:j.duration)||2,AA=((q=B.settings)==null?void 0:q.from)||0,gA=((X=B.settings)==null?void 0:X.to)||100;B._runtimeStart===void 0&&(B._runtimeStart=this.currentTime);const dA=this.currentTime-B._runtimeStart,aI=Math.min(1,dA/V),rC=Math.floor(AA+(gA-AA)*aI);if(((sA=g.geometry)==null?void 0:sA.type)==="Text"){const nC=((tA=B.settings)==null?void 0:tA.prefix)||"",ki=((b=B.settings)==null?void 0:b.suffix)||"";Q.geometry||(Q.geometry={...g.geometry}),Q.geometry.text=`${nC}${rC}${ki}`}}else if(B.type===Z.Spotlight){const V=(($=B.settings)==null?void 0:$.radius)||250,AA=((iA=B.settings)==null?void 0:iA.strength)||1.5;if(s<V){const gA=Math.pow(1-s/V,2);Q.style||(Q.style={...g.style}),Q.style.adjustments||(Q.style.adjustments={...(BA=g.style)==null?void 0:BA.adjustments}),Q.style.adjustments.exposure=(((MA=(aA=g.style)==null?void 0:aA.adjustments)==null?void 0:MA.exposure)||0)+gA*AA*50}else(YA=Q.style)!=null&&YA.adjustments&&(Q.style.adjustments.exposure=this.lerp(Q.style.adjustments.exposure||0,((WA=(HA=g.style)==null?void 0:HA.adjustments)==null?void 0:WA.exposure)||0,.1))}else if(B.type===Z.Noise||B.type===Z.Float){const V=(((P=B.settings)==null?void 0:P.frequency)||((oA=B.settings)==null?void 0:oA.speed)||1)*.002,AA=(((x=B.settings)==null?void 0:x.amplitude)||((p=B.settings)==null?void 0:p.range)||50)*(((z=B.settings)==null?void 0:z.strength)||1),gA=Date.now();Q.x+=Math.sin(gA*V)*AA*A,Q.y+=Math.cos(gA*V*.8)*AA*A,Q.rotation+=Math.sin(gA*V*.5)*5*A}else if(B.type===Z.Pulse){const V=(((EA=B.settings)==null?void 0:EA.speed)||1)*.005,AA=(((fA=B.settings)==null?void 0:fA.scale)||1.2)-1,gA=Math.sin(Date.now()*V),dA=((nA=B.settings)==null?void 0:nA.strength)||1;Q.scale_x*=1+gA*AA*dA*A,Q.scale_y*=1+gA*AA*dA*A,Q.style&&(Q.style.exposure=(Q.style.exposure||1)+Math.max(0,gA)*.1*dA*A)}else if(B.type===Z.Draggable){const V=((UA=B.settings)==null?void 0:UA.radius)||150,AA=this.draggingBehaviors.has(g.id);if(s<V||AA){const gA=((FA=B.settings)==null?void 0:FA.strength)||1,dA=AA?1:Math.max(0,1-s/V);this.applyBehaviorSensor(Q,II.PositionX,dA*gA,A,B.settings),this.applyBehaviorSensor(Q,II.PositionY,dA*gA,A,B.settings)}}else if(B.type===Z.Scroll){const V=((yA=B.settings)==null?void 0:yA.axis)||"vertical",AA=((n=B.settings)==null?void 0:n.factor)||.5,gA=((bA=B.settings)==null?void 0:bA.strength)||1,dA=((_A=B.settings)==null?void 0:_A.scaleFactor)||0;(V==="vertical"||V==="both")&&(Q.y+=this.scrollOffset.y*AA*gA*A),(V==="horizontal"||V==="both")&&(Q.x+=this.scrollOffset.x*AA*gA*A),dA!==0&&(Q.scale_x*=1+this.scrollOffset.y*dA*A,Q.scale_y*=1+this.scrollOffset.y*dA*A)}else if(B.type===Z.LookAt){const V=((VA=B.settings)==null?void 0:VA.factor)||1,AA=((xA=B.settings)==null?void 0:xA.strength)||1,gA=Math.atan2(-w,-o)*(180/Math.PI),dA=Q.rotation,aI=(gA-dA+180)%360-180;Q.rotation+=aI*V*AA*A*10}else if(B.type===Z.Glint||B.type===Z.Scan){const V=(((DA=B.settings)==null?void 0:DA.speed)||1)*.004,AA=((eA=B.settings)==null?void 0:eA.strength)||1,gA=(Math.sin(Date.now()*V)+1)/2;Q.style&&(Q.style.exposure=(Q.style.exposure||1)+gA*AA*A*5),Q.x+=(gA-.5)*20*AA*A}else if(B.type===Z.Ratchet){const V=((uA=B.settings)==null?void 0:uA.steps)||12,AA=(((RA=B.settings)==null?void 0:RA.speed)||1)*30,gA=Math.floor(Q.rotation/(360/V))*(360/V);Q.rotation=this.lerp(Q.rotation,gA+AA*A,.1)}else if(B.type===Z.Jitter&&s<300){const V=((hA=B.settings)==null?void 0:hA.strength)||1,AA=(((pA=B.settings)==null?void 0:pA.intensity)||5)*V;Q.x+=(Math.random()-.5)*AA*A*60,Q.y+=(Math.random()-.5)*AA*A*60,Q.rotation+=(Math.random()-.5)*AA*A*120}else if(B.type===Z.Follower){const V=(IA=B.settings)==null?void 0:IA.targetId;if(V){const AA=this.objectStates.get(V);if(AA){const gA=((_=B.settings)==null?void 0:_.stiffness)||.1,dA=AA.x-Q.x,aI=AA.y-Q.y;Q.x+=dA*gA*A*60,Q.y+=aI*gA*A*60}}}else if(B.type===Z.Wrap)Q.x<0?Q.x=this.canvasWidth:Q.x>this.canvasWidth&&(Q.x=0),Q.y<0?Q.y=this.canvasHeight:Q.y>this.canvasHeight&&(Q.y=0);else if(B.type===Z.Gravity){const V=((CA=B.settings)==null?void 0:CA.strength)||9.8;Q.y+=V*A*10}else if(B.type===Z.Velocity){const V=((NA=B.settings)==null?void 0:NA.vx)||0,AA=((H=B.settings)==null?void 0:H.vy)||0;Q.x+=V*A*10,Q.y+=AA*A*10}else if(B.type===Z.Shear){const V=((GA=B.settings)==null?void 0:GA.strength)||1,AA=((kA=B.settings)==null?void 0:kA.radius)||300;if(s<AA){const gA=1-s/AA;Q.skew_x=this.lerp(Q.skew_x||0,(((wI=g.transform)==null?void 0:wI.skew_x)||0)+gA*V*30,.1)}else Q.skew_x=this.lerp(Q.skew_x||0,((yI=g.transform)==null?void 0:yI.skew_x)||0,.05)}else if(B.type===Z.Lens){const V=((kI=B.settings)==null?void 0:kI.radius)||200,AA=((rI=B.settings)==null?void 0:rI.strength)||.5;if(s<V){const gA=Math.pow(1-s/V,2);Q.scale_x=this.lerp(Q.scale_x??1,(((tI=g.transform)==null?void 0:tI.scale_x)??1)*(1+gA*AA),.2),Q.scale_y=this.lerp(Q.scale_y??1,(((sI=g.transform)==null?void 0:sI.scale_y)??1)*(1+gA*AA),.2)}else Q.scale_x=this.lerp(Q.scale_x??1,((GI=g.transform)==null?void 0:GI.scale_x)??1,.1),Q.scale_y=this.lerp(Q.scale_y??1,((NI=g.transform)==null?void 0:NI.scale_y)??1,.1)}})})}applyBehaviorSensor(A,I,C,g,Q,B){var o,w,s,h,t,G,S,y,K;const i=(Q==null?void 0:Q.intensity)||(Q==null?void 0:Q.strength)||1,D=C*i*g;switch(I){case II.Scale:A.scale_x*=1+D*.5,A.scale_y*=1+D*.5;break;case II.Opacity:A.opacity=Math.max(0,Math.min(100,A.opacity-D*100));break;case II.RotateZ:A.rotation+=D*180;break;case II.RotateX:A.rotate_x=(A.rotate_x||0)+D*180;break;case II.RotateY:A.rotate_y=(A.rotate_y||0)+D*180;break;case II.PositionX:A.x+=D*300;break;case II.PositionY:A.y+=D*300;break;case II.SkewX:A.skew_x=(A.skew_x||0)+D*45;break;case II.Blur:A.style||(A.style={...B.style}),A.style.blur||(A.style.blur={...(o=B.style)==null?void 0:o.blur}),A.style.blur.amount=(((s=(w=B.style)==null?void 0:w.blur)==null?void 0:s.amount)||0)+C*((Q==null?void 0:Q.blur)||50)*i;break;case II.Exposure:A.style||(A.style={...B.style}),A.style.adjustments||(A.style.adjustments={...(h=B.style)==null?void 0:h.adjustments}),A.style.adjustments.exposure=(((G=(t=B.style)==null?void 0:t.adjustments)==null?void 0:G.exposure)||0)+C*((Q==null?void 0:Q.exposure)||50)*i;break;case II.HueShift:A.style||(A.style={...B.style}),A.style.adjustments||(A.style.adjustments={...(S=B.style)==null?void 0:S.adjustments}),A.style.adjustments.hue=(((K=(y=B.style)==null?void 0:y.adjustments)==null?void 0:K.hue)||0)+C*((Q==null?void 0:Q.hue)||180)*i;break;case II.CornerRadius:A.corner_radius=Math.min(200,(A.corner_radius||0)+D*100);break;case II.LetterSpacing:A.geometry||(A.geometry={}),A.geometry.letterSpacing=(A.geometry.letterSpacing||0)+D*10;break}}lerp(A,I,C){return A*(1-C)+I*C}deepMerge(A,I){if(!A)return I;if(!I)return A;if(typeof A!="object"||typeof I!="object"||A===null||I===null)return I;const C={...A};for(const g in I)Object.prototype.hasOwnProperty.call(I,g)&&(I[g]&&typeof I[g]=="object"&&!Array.isArray(I[g])?C[g]=this.deepMerge(A[g],I[g]):C[g]=I[g]);return C}renderFittedImage(A,I,C,g,Q,B,i="cover"){const D=I.naturalWidth,o=I.naturalHeight,w=D/o,s=Q/B;let h=Q,t=B,G=C,S=g;i==="cover"?w>s?(h=B*w,G=C-(h-Q)/2):(t=Q/w,S=g-(t-B)/2):i==="contain"&&(w>s?(t=Q/w,S=g+(B-t)/2):(h=B*w,G=C+(Q-h)/2)),A.drawImage(I,G,S,h,t)}}const iB=({artboard:E,config:A})=>{const I={...E.seo,...A},C=I.enableSmartExtraction!==!1;rA.useEffect(()=>{const i=I.title||E.name;i&&(document.title=i);let D=I.description;if(!D&&C){const s=E.objects.filter(h=>h.geometry.type==="Text").sort((h,t)=>{var G,S;return(((G=t.geometry.text)==null?void 0:G.length)||0)-(((S=h.geometry.text)==null?void 0:S.length)||0)});s.length>0&&(D=s[0].geometry.text)}D&&(g("name","description",D),g("property","og:description",D)),I.keywords&&I.keywords.length>0&&g("name","keywords",I.keywords.join(", "));const o=I.ogImage||E.backgroundImage;o&&g("property","og:image",o),i&&g("property","og:title",i),g("property","og:type","website")},[I,E,C]);const g=(i,D,o)=>{let w=document.querySelector(`meta[${i}="${D}"]`);w||(w=document.createElement("meta"),w.setAttribute(i,D),document.head.appendChild(w)),w.setAttribute("content",o)},Q=()=>{const i=[];return i.push(vA.jsx("h1",{children:I.title||E.name},"artboard-title")),E.objects.forEach((o,w)=>{if(!(!o.visible&&o.isVisible!==!0))if(o.geometry.type==="Text"){const s=o.geometry.text;s&&(o.geometry.fontSize>24?i.push(vA.jsx("h2",{children:s},o.id||w)):i.push(vA.jsx("p",{children:s},o.id||w)))}else if(o.geometry.type==="Image"){const s=o.geometry.src,h=o.altText||o.name||"Illustration";i.push(vA.jsx("img",{src:s,alt:h},o.id||w))}else o.type==="Button"&&i.push(vA.jsx("button",{children:o.name||"Button"},o.id||w))}),i},B=I.jsonLd||{"@context":"https://schema.org","@type":"VisualArtwork",name:I.title||E.name,description:I.description,image:I.ogImage||E.backgroundImage,abstract:"Animated interface created with ExodeUI"};return vA.jsxs("div",{id:`exode-seo-${E.id||"default"}`,"aria-hidden":"false",style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0",zIndex:-1},children:[Q(),vA.jsx("script",{type:"application/ld+json",children:JSON.stringify(B)})]})},Si=rA.forwardRef(({artboard:E,src:A,className:I,style:C,autoPlay:g=!0,fit:Q="Contain",alignment:B="Center",enableSEO:i=!0,seo:D,onReady:o,onTrigger:w,onInputUpdate:s,onComponentChange:h,onToggle:t,onInputChange:G,onInputFocus:S,onInputBlur:y,onLog:K,onLogicUpdate:e,currentTime:N,revision:k=0,scrollY:F,scrollX:c,mouseX:R,mouseY:J,isMouseDown:L,inputs:l,interactive:Y=!0},v)=>{const wA=rA.useRef(null),QA=rA.useRef(new EB),W=rA.useRef(),m=rA.useRef(0),T=rA.useRef(null),u=rA.useRef(k),[d,f]=rA.useState(E||null);rA.useImperativeHandle(v,()=>wA.current),rA.useEffect(()=>{console.log("[ExodeUI] Layout Effect - Component Updated/Mounted"),QA.current.setLayout(Q,B)},[Q,B]),rA.useEffect(()=>{w&&QA.current.setTriggerCallback(w)},[w]),rA.useEffect(()=>{s&&QA.current.setInputUpdateCallback(s)},[s]),rA.useEffect(()=>{h&&QA.current.setComponentChangeCallback(h)},[h]),rA.useEffect(()=>{t&&QA.current.setToggleCallback(t)},[t]),rA.useEffect(()=>{G&&QA.current.setInputChangeCallback(G)},[G]),rA.useEffect(()=>{S&&QA.current.setInputFocusCallback(S)},[S]),rA.useEffect(()=>{y&&QA.current.setInputBlurCallback(y)},[y]),rA.useEffect(()=>{e&&QA.current.setLogicUpdateCallback(e)},[e]),rA.useEffect(()=>{(async()=>{let q=E;if(!q&&A)try{const sA=await(await fetch(A)).text();if(!sA.trim().startsWith("{")&&!sA.trim().startsWith("["))try{const tA=BB.decompressFromBase64(sA.trim());tA&&(q=JSON.parse(tA))}catch{console.warn("[ExodeUI] File is not standard JSON, and decompression failed.")}if(!q&&sA)try{q=JSON.parse(sA)}catch(tA){console.error("[ExodeUI] Failed to parse JSON content:",tA)}}catch(X){console.error("Failed to load ExodeUI animation:",X);return}if(q){const X=QA.current,sA=q.id||q.name||"default";(T.current!==sA||u.current!==k)&&(X.load(q),T.current=sA,u.current=k,f(q),m.current=0,X.advance(0)),o&&o(X)}})()},[E,A,k]),rA.useEffect(()=>{N!==void 0&&QA.current.seek(N)},[N]),rA.useEffect(()=>{const j=QA.current;F!==void 0&&j.updateInput("scrollY",F),c!==void 0&&j.updateInput("scrollX",c),R!==void 0&&j.updateInput("mouseX",R),J!==void 0&&j.updateInput("mouseY",J),L!==void 0&&j.updateInput("isMouseDown",L),l&&Object.entries(l).forEach(([q,X])=>{j.updateInput(q,X)})},[F,c,R,J,L,l]),rA.useEffect(()=>{const j=QA.current,q=wA.current;if(!q)return;m.current=0;const X=q.getContext("2d");if(!X)return;X.imageSmoothingEnabled=!0,X.imageSmoothingQuality="high",K&&j.setOnLogCallback(K);const sA=b=>{m.current||(m.current=b);const $=(b-m.current)/1e3;m.current=b,g&&j.advance($);const iA=window.devicePixelRatio||1,BA=q.getBoundingClientRect(),aA=Math.floor(BA.width*iA),MA=Math.floor(BA.height*iA);(q.width!==aA||q.height!==MA)&&(q.width=aA,q.height=MA),j.render(X,aA,MA),W.current=requestAnimationFrame(sA)};W.current=requestAnimationFrame(sA);const tA=()=>{j.handleScroll(window.scrollX,window.scrollY)};return window.addEventListener("scroll",tA,{passive:!0}),()=>{W.current&&cancelAnimationFrame(W.current),window.removeEventListener("scroll",tA)}},[g]);const O=(j,q)=>{const X=j.currentTarget.getBoundingClientRect(),sA=j.clientX-X.left,tA=j.clientY-X.top,b=X.width,$=X.height;Y&&QA.current.handlePointerInput(q,sA,tA,b,$)};return vA.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",...C},className:I,children:[vA.jsx("canvas",{ref:wA,style:{width:"100%",height:"100%",outline:"none"},tabIndex:0,onPointerDown:j=>{var q;O(j,"down"),(q=wA.current)==null||q.focus()},onPointerUp:j=>O(j,"up"),onPointerMove:j=>O(j,"move"),onPointerLeave:j=>O(j,"blur"),onClick:j=>O(j,"click"),onKeyDown:j=>{j.key==="Backspace"||j.key==="Enter"||j.key,QA.current.handleKeyDown(j.nativeEvent)},onWheel:j=>{Y&&QA.current.handleWheel(j.deltaX,j.deltaY)}}),i&&d&&vA.jsx(iB,{artboard:d,config:D})]})});function Ki(){const[E,A]=rA.useState(null),I=rA.useCallback((s,h)=>{E==null||E.setInputBool(s,h)},[E]),C=rA.useCallback((s,h)=>{E==null||E.setInputNumber(s,h)},[E]),g=rA.useCallback(s=>{E==null||E.fireTrigger(s)},[E]),Q=rA.useCallback((s,h)=>{E==null||E.setInputText(s,h)},[E]),B=rA.useCallback((s,h)=>{E==null||E.setInputNumberArray(s,h)},[E]),i=rA.useCallback((s,h)=>{E==null||E.setInputStringArray(s,h)},[E]),D=rA.useCallback((s,h)=>{E==null||E.updateObjectOptions(s,h)},[E]),o=rA.useCallback((s,h,t)=>{E==null||E.updateConstraint(s,h,t)},[E]),w=rA.useCallback((s,h)=>{E==null||E.updateGraphData(s,h)},[E]);return{setEngine:A,engine:E,setInputBool:I,setInputNumber:C,fireTrigger:g,setInputText:Q,setInputNumberArray:B,setInputStringArray:i,updateConstraint:o,updateGraphData:w,updateObjectOptions:D}}const yi={version:"6.2.10"}.version;XA.BehaviorSensor=II,XA.BehaviorType=Z,XA.ConditionOp=lC,XA.ExodeSEO=iB,XA.ExodeUICanvas=Si,XA.ExodeUIEngine=EB,XA.LogicOp=JA,XA.VERSION=yi,XA.useExodeUI=Ki,Object.defineProperty(XA,Symbol.toStringTag,{value:"Module"})});
|
package/dist/index.mjs
CHANGED
|
@@ -10512,7 +10512,7 @@ function li() {
|
|
|
10512
10512
|
updateObjectOptions: D
|
|
10513
10513
|
};
|
|
10514
10514
|
}
|
|
10515
|
-
const Mi = "6.2.
|
|
10515
|
+
const Mi = "6.2.10", Ji = {
|
|
10516
10516
|
version: Mi
|
|
10517
10517
|
}, Yi = Ji.version;
|
|
10518
10518
|
export {
|