@vincentt-xr/sdk 2.0.0-alpha.14 → 2.0.0-alpha.16
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/GROUNDING.md +12 -4
- package/dist/audio/AudioPlayer.d.ts +2 -0
- package/dist/components/MeshRenderer/index.d.ts +7 -1
- package/dist/components/ScreenImage/components/ImageLoadFallback.d.ts +24 -0
- package/dist/components/ScreenImage/components/ScreenImageBody.d.ts +2 -1
- package/dist/debug-ui.cjs +1 -1
- package/dist/debug-ui.js +1 -1
- package/dist/{index-CD_JFx3g.js → index-DJkmBF-0.js} +412 -367
- package/dist/index-jkUdoklh.cjs +46 -0
- package/dist/main.cjs +1 -1
- package/dist/main.js +2 -2
- package/package.json +1 -1
- package/settings.json +9 -1
- package/dist/index-BG4xgyTm.cjs +0 -46
package/GROUNDING.md
CHANGED
|
@@ -133,18 +133,20 @@ nothing to an app bundle.
|
|
|
133
133
|
- A `text` setting is words shown on screen: `maxLength` is the most code points
|
|
134
134
|
the editor accepts (at most 500), and `multiline: true` allows line breaks.
|
|
135
135
|
- An `asset` setting is a file reference; `accept` lists the kinds of file it
|
|
136
|
-
takes (
|
|
136
|
+
takes: `"image"`, `"model"` (a `.glb`) or `"audio"` (an `.mp3` or `.m4a`).
|
|
137
137
|
- `overriddenBy` lists other props of the component that, when written, make the
|
|
138
138
|
setting ignored at run time. The editor hides the setting on an element that
|
|
139
139
|
has one of them (`ScreenImage.src` is `overriddenBy: ["source"]`).
|
|
140
140
|
- `element` puts a component on the editor's **supported list** as one list kind
|
|
141
|
-
(`screenText`, `screenImage`, `screenShape`), and `supported: true` marks the
|
|
141
|
+
(`screenText`, `screenImage`, `screenShape`, `model`, `sound`), and `supported: true` marks the
|
|
142
142
|
settings the editor shows for it. The editor shows only supported settings on
|
|
143
143
|
listed components; a component without `element` is "made by code" there.
|
|
144
144
|
Declared settings without `supported` stay in the file for other tools.
|
|
145
145
|
|
|
146
146
|
Declared today: `ScreenText`, `TextLabel`, `ScreenSpaceUI` (`depth`),
|
|
147
|
-
`ScreenImage`, `ScreenShape`, `PersonCutout`,
|
|
147
|
+
`ScreenImage`, `ScreenShape`, `PersonCutout`, `MeshRenderer` (`value.assetUrl`,
|
|
148
|
+
a `model` asset: the editor swaps it only when it is a literal in the `value`
|
|
149
|
+
object) and `AudioPlayer` (`src`, a `sound` asset), and the instruction components'
|
|
148
150
|
text-style props, plus the `ScreenTransform2DSettings` fields under each
|
|
149
151
|
component's `screenTransform` / `transform`.
|
|
150
152
|
|
|
@@ -170,7 +172,7 @@ that reaches it.
|
|
|
170
172
|
|
|
171
173
|
`text` and `asset` are always named, on a string prop. `maxLength=` (a whole
|
|
172
174
|
number from 1 to 500) and `multiline=true|false` apply to `text`; `accept=`
|
|
173
|
-
(comma-separated, `image`) is required on `asset`; `overriddenBy=` takes
|
|
175
|
+
(comma-separated, `image`, `model` or `audio`) is required on `asset`; `overriddenBy=` takes
|
|
174
176
|
comma-separated top-level prop names of the component and applies to any type.
|
|
175
177
|
|
|
176
178
|
```ts
|
|
@@ -524,6 +526,12 @@ operate on the same mounted object state:
|
|
|
524
526
|
- Respect capability-gated controls: static images expose image/material
|
|
525
527
|
controls only; animated providers expose only controls they support. Loading,
|
|
526
528
|
error, retry, pause, ended, and cleanup state must be visible to diagnostics.
|
|
529
|
+
- An image file that fails to load (a missing `src` path, a broken URL) does not
|
|
530
|
+
throw: that `ScreenImage` shows its default picture and logs a
|
|
531
|
+
`[xr-sdk] ScreenImage could not load "<src>"` warning, and the rest of the scene
|
|
532
|
+
keeps running. A new `src` is tried again. Check the console for that warning
|
|
533
|
+
when an image shows the default picture unexpectedly; do not add your own error
|
|
534
|
+
boundary around `ScreenImage` for this.
|
|
527
535
|
- `visible`, `overlay`, `renderOrder`, `transparent`, `alphaTest`, blend mode,
|
|
528
536
|
opacity, tint, flips, pivot, rotation, size, and position are all part of the
|
|
529
537
|
live object contract and must remain synchronized from SDK or client entry
|
|
@@ -6,6 +6,7 @@ export interface AudioPlayerHandle {
|
|
|
6
6
|
readonly current: HTMLAudioElement | null;
|
|
7
7
|
}
|
|
8
8
|
export interface AudioPlayerProps {
|
|
9
|
+
/** @tweak asset accept=audio */
|
|
9
10
|
src: string;
|
|
10
11
|
playMode?: AudioPlayMode;
|
|
11
12
|
/** Total number of plays in `loop` mode. Values below 1 become 1. */
|
|
@@ -25,5 +26,6 @@ export interface AudioPlayerProps {
|
|
|
25
26
|
* Headless, declarative audio player with timeline-friendly playback
|
|
26
27
|
* properties. It renders only a hidden HTML audio element; build any visible
|
|
27
28
|
* controls with the imperative ref or application state.
|
|
29
|
+
* @editorElement sound src
|
|
28
30
|
*/
|
|
29
31
|
export declare const AudioPlayer: import('react').ForwardRefExoticComponent<AudioPlayerProps & import('react').RefAttributes<AudioPlayerHandle>>;
|
|
@@ -27,7 +27,10 @@ export type MeshRendererRenderState = {
|
|
|
27
27
|
export type MeshRendererSettings = {
|
|
28
28
|
enabled: boolean;
|
|
29
29
|
mesh: MeshRendererMesh;
|
|
30
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Optional GLTF/GLB asset URL. When set, renders the imported asset instead of a primitive.
|
|
32
|
+
* @tweak asset accept=model
|
|
33
|
+
*/
|
|
31
34
|
assetUrl?: string;
|
|
32
35
|
assetNodeName?: string;
|
|
33
36
|
assetAnimation?: ("all" & {}) | (string & {});
|
|
@@ -56,4 +59,7 @@ export declare const normalizeMeshRendererRenderState: (renderState?: MeshRender
|
|
|
56
59
|
export declare const getThreeDepthFunction: (depthFunc: MeshRendererDepthFunction) => DepthModes;
|
|
57
60
|
export declare const getThreeSide: (cullMode: MeshRendererCullMode) => Side;
|
|
58
61
|
export declare const getThreeBlending: (blendMode: MeshRendererBlendMode) => Blending;
|
|
62
|
+
/**
|
|
63
|
+
* @editorElement model value.assetUrl
|
|
64
|
+
*/
|
|
59
65
|
export declare const MeshRenderer: ({ renderOrder, value }: MeshRendererProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Component, ReactNode } from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
/** What the image is loading; a new value tries it again. */
|
|
4
|
+
loadKey: string;
|
|
5
|
+
/** The image, told whether to draw its default picture instead. */
|
|
6
|
+
children: (fallback: boolean) => ReactNode;
|
|
7
|
+
};
|
|
8
|
+
type State = {
|
|
9
|
+
failedKey: string | null;
|
|
10
|
+
caught: boolean;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* A ScreenImage whose file cannot be loaded (a missing path, a broken URL) shows the default
|
|
14
|
+
* picture and warns, instead of throwing: the texture loader throws on a failed load, and an
|
|
15
|
+
* uncaught throw in a Canvas takes the whole view down.
|
|
16
|
+
*/
|
|
17
|
+
export declare class ImageLoadFallback extends Component<Props, State> {
|
|
18
|
+
state: State;
|
|
19
|
+
static getDerivedStateFromError(): Partial<State>;
|
|
20
|
+
static getDerivedStateFromProps(props: Props, state: State): Partial<State> | null;
|
|
21
|
+
componentDidCatch(error: unknown): void;
|
|
22
|
+
render(): ReactNode;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -5,5 +5,6 @@ type ScreenImageBodyProps = Omit<ScreenImageProps, "anchors" | "coordinateSpace"
|
|
|
5
5
|
height: number;
|
|
6
6
|
};
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
/** The image, drawing its default picture in place of a file that will not load (auro#423). */
|
|
9
|
+
export declare function ScreenImageBody(props: ScreenImageBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
package/dist/debug-ui.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Oe=require("./session-3aCMNb8W.cjs"),Hs=require("./debug-ui/default-setting.cjs"),e=require("react/jsx-runtime"),y=require("react"),Le=require("./renderGroups-B0N58SIA.cjs"),K=require("./index-nRQNXOVk.cjs"),Ae=require("react-dom"),$e=require("./index-J3Qy6hi3.cjs"),Gs=require("three"),J=require("./renderPasses-Bt8k0dkm.cjs"),Ne=require("./settings-C63FMBlF.cjs"),N=require("./FaceRetouch-DHhn1nSV.cjs"),It=require("./landmarkMask-CvN-L5NT.cjs"),_s=require("./index-DzdKBXGE.cjs"),Us=require("./index-LC2Xs08E.cjs"),Zt=require("@react-three/drei"),Xs=require("@react-three/fiber"),Yt=require("./index-BG4xgyTm.cjs"),Zs=require("./contexts-CSz9stBV.cjs"),Ys=require("./selectors-Bq6tSgOY.cjs"),qs={position:"fixed",zIndex:2e4,pointerEvents:"none"},kt={width:"100%",maxHeight:"none",border:"none",borderRadius:0,background:"transparent",boxShadow:"none",backdropFilter:"none",WebkitBackdropFilter:"none",overflow:"visible"},js=({docked:t=!1,initialPosition:s,position:l,onPositionChange:n})=>{const[a,d]=y.useState(s),r=l??a,o=y.useRef(null),h=y.useRef(n);return h.current=n,y.useEffect(()=>{if(t)return;const p=g=>{var j;const i=o.current;if(!i)return;const u={x:Math.max(8,g.clientX-i.x),y:Math.max(8,g.clientY-i.y)};d(u),(j=h.current)==null||j.call(h,u)},f=()=>{const g=o.current;g&&(o.current=null,g.selectNone&&document.body.classList.remove("select-none"))};return window.addEventListener("pointermove",p),window.addEventListener("pointerup",f),()=>{window.removeEventListener("pointermove",p),window.removeEventListener("pointerup",f)}},[t]),{docked:t,position:r,startDrag:(p,{capture:f=!0,selectNone:g=!0}={})=>{if(t)return;const i=p.currentTarget.getBoundingClientRect();o.current={x:p.clientX-i.left,y:p.clientY-i.top,selectNone:g},g&&document.body.classList.add("select-none"),f&&p.currentTarget.setPointerCapture(p.pointerId)},place:p=>t?p:typeof document>"u"?null:Ae.createPortal(e.jsx("div",{style:{...qs,left:r.x,top:r.y},children:p}),document.body)}},qt={pointerEvents:"auto",width:306,maxHeight:"calc(100vh - 124px)",borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflow:"hidden"},Js=306,Qs=()=>({x:typeof window>"u"?14:window.innerWidth-(Js+20),y:30}),en={display:"grid",gap:7,padding:"7px 8px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)"},ms={display:"grid",gridTemplateColumns:"16px 22px minmax(0, 1fr) 28px",alignItems:"center",gap:7},tn={...ms,gridTemplateColumns:"22px minmax(0, 1fr) 28px"},sn={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:11,fontWeight:700},nn={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(125,211,252,0.46)",background:"rgba(15,23,42,0.82)",color:"#f8fafc",fontSize:11,fontWeight:700,outline:"none",padding:"0 7px",boxSizing:"border-box"},ln={display:"flex",width:20,height:20,alignItems:"center",justifyContent:"center",borderRadius:7,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0"},on={width:16,height:18,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)"},Jt={display:"grid",gap:8,padding:8,overflowY:"auto",maxHeight:"calc(100vh - 215px)"},rn={display:"grid",gridTemplateColumns:"minmax(0, 1fr) 30px",gap:6},an={width:"100%",height:26,borderRadius:8,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(56,189,248,0.16)",color:"#e0f2fe",fontSize:10.5,fontWeight:700,cursor:"pointer"},dn=t=>({display:"inline-flex",alignItems:"center",justifyContent:"center",width:30,height:26,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",color:t?"#e0f2fe":"rgba(148,163,184,0.72)",background:t?"rgba(56,189,248,0.16)":"rgba(255,255,255,0.04)",cursor:"pointer",padding:0}),cn={display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0},pn={width:"fit-content",maxWidth:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.07)",color:"#e2e8f0",fontSize:10,padding:"0 8px"},hn=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),xn=()=>e.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"m12 2 8 4.6v10.8L12 22l-8-4.6V6.6L12 2zm0 2.3L6.3 7.6 12 10.9l5.7-3.3L12 4.3zM6 9.3v6.9l5 2.9v-6.9L6 9.3zm12 0-5 2.9v6.9l5-2.9V9.3z"})}),un=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5c5 0 8.7 4.2 10 7-1.3 2.8-5 7-10 7s-8.7-4.2-10-7c1.3-2.8 5-7 10-7zm0 2c-3.6 0-6.4 2.7-7.7 5 1.3 2.3 4.1 5 7.7 5s6.4-2.7 7.7-5C18.4 9.7 15.6 7 12 7zm0 2.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"})}),gn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M3.3 2 22 20.7 20.7 22l-3.1-3.1A10.5 10.5 0 0 1 12 20c-5 0-8.7-4.2-10-7a16.4 16.4 0 0 1 4-4.9L2 3.3 3.3 2zm4.1 7.5A14.4 14.4 0 0 0 4.3 13c1.3 2.3 4.1 5 7.7 5 1.5 0 2.8-.5 4-1.2l-2.1-2.1A2.5 2.5 0 0 1 9.3 10L7.4 9.5zM12 4c5 0 8.7 4.2 10 7a15 15 0 0 1-3.2 4.2l-1.4-1.4A13 13 0 0 0 19.7 11C18.4 8.7 15.6 6 12 6c-.9 0-1.8.2-2.6.5L7.8 4.9C9.1 4.3 10.5 4 12 4z"})}),yn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2z"})}),bn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6V5z"})}),fn=async t=>{var l;if((l=navigator.clipboard)!=null&&l.writeText){await navigator.clipboard.writeText(t);return}const s=document.createElement("textarea");s.value=t,s.setAttribute("readonly",""),s.style.position="fixed",s.style.left="-9999px",document.body.appendChild(s),s.select(),document.execCommand("copy"),document.body.removeChild(s)},Ct=({children:t,copyConfig:s,docked:l=!1,initialPosition:n,layer:a="Default Layer",objectId:d,objectName:r,onObjectNameChange:o,onPositionChange:h,onVisibleChange:x,position:c,title:p,visible:f})=>{const{startDrag:g,place:i}=js({docked:l,initialPosition:n??Qs,position:c,onPositionChange:h}),[u,j]=y.useState(!1),[w,v]=y.useState(!0),M=r??p??d??"Scene Object",[U,b]=y.useState(!1),[F,E]=y.useState(M);y.useEffect(()=>{U||E(M)},[M,U]);const P=async()=>{try{await fn(JSON.stringify(s,null,2)),j(!0),window.setTimeout(()=>j(!1),1200)}catch{j(!1)}},le=()=>{const L=F.trim();if(b(!1),!o||!L||L===M){E(M);return}o(L)},ae=()=>{E(M),b(!1)};return i(e.jsxs("div",{style:l?{...qt,...kt}:qt,children:[e.jsxs("div",{style:en,children:[e.jsxs("div",{style:l?tn:ms,children:[!l&&e.jsx("div",{onPointerDown:g,style:on,children:e.jsx(hn,{})}),e.jsx("span",{style:ln,children:e.jsx(xn,{})}),U?e.jsx("input",{autoFocus:!0,"aria-label":"Object Name",style:nn,value:F,onBlur:le,onChange:L=>E(L.currentTarget.value),onKeyDown:L=>{L.key==="Enter"&&le(),L.key==="Escape"&&ae()}}):e.jsx("button",{type:"button",style:{...sn,padding:0,border:0,background:"transparent",color:"inherit",cursor:o?"text":"default",textAlign:"left"},onDoubleClick:()=>{o&&b(!0)},children:M}),e.jsx("button",{type:"button","aria-label":w?"Fold Inspector":"Expand Inspector",title:w?"Fold Inspector":"Expand Inspector",style:cn,onClick:()=>v(L=>!L),children:w?e.jsx(yn,{}):e.jsx(bn,{})})]}),w?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",style:pn,children:a}),e.jsxs("div",{style:rn,children:[e.jsx("button",{type:"button",style:an,onClick:P,children:u?"Copied Config":"Copy Config"}),e.jsx("button",{type:"button",style:dn(f),onClick:()=>x(!f),children:f?e.jsx(un,{}):e.jsx(gn,{})})]})]}):null]}),w?e.jsx("div",{style:l?{...Jt,maxHeight:"none"}:Jt,children:t}):null]}))},jn={clean:{fontWeight:400,strokeLayers:[],shadowLayers:[]},sticker:{color:"#101828",fontWeight:800,strokeLayers:[{color:"#ffffff",width:26,opacity:1},{color:"#101828",width:10,opacity:1}],shadowLayers:[]},"shadow-pop":{color:"#fff8df",fontWeight:800,strokeLayers:[{color:"#101828",width:12,opacity:1}],shadowLayers:[{color:"#0f172a",blur:0,offsetX:18,offsetY:18,opacity:.9},{color:"#0f172a",blur:10,offsetX:10,offsetY:10,opacity:.35}]},neon:{color:"#ffffff",fontWeight:700,strokeLayers:[{color:"#9be7ff",width:8,opacity:.9}],shadowLayers:[{color:"#38bdf8",blur:18,opacity:.8},{color:"#0ea5e9",blur:40,opacity:.7},{color:"#7c3aed",blur:70,opacity:.5}]},editorial:{color:"#f8fafc",fontWeight:500,strokeLayers:[{color:"#0f172a",width:4,opacity:.5}],shadowLayers:[]},"comic-burst":{color:"#fff06a",fontWeight:900,strokeLayers:[{color:"#ef4444",width:28,opacity:1},{color:"#111827",width:12,opacity:1}],shadowLayers:[{color:"#111827",blur:0,offsetX:12,offsetY:12,opacity:.65}]},"ice-outline":{color:"#eff8ff",fontWeight:800,strokeLayers:[{color:"#dbeafe",width:16,opacity:1},{color:"#1d4ed8",width:6,opacity:.95}],shadowLayers:[{color:"#38bdf8",blur:24,opacity:.32}]},"sunset-glow":{color:"#fff7ed",fontWeight:800,strokeLayers:[{color:"#fb7185",width:8,opacity:.95}],shadowLayers:[{color:"#fb7185",blur:18,opacity:.7},{color:"#f97316",blur:42,opacity:.55},{color:"#facc15",blur:70,opacity:.28}]},cutout:{color:"#fffaf0",fontWeight:800,strokeLayers:[{color:"#0f172a",width:6,opacity:.9}],shadowLayers:[{color:"#0f172a",blur:0,offsetX:8,offsetY:8,opacity:.95},{color:"#0f172a",blur:0,offsetX:16,offsetY:16,opacity:.4}]},"badge-arc":{color:"#ffffff",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!1,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"arc",strength:100},strokeLayers:[{color:"#0b1020",width:24,opacity:1},{color:"#ffffff",width:8,opacity:1}],shadowLayers:[{color:"#020617",blur:8,offset:10,angle:-45,feather:.2,opacity:.65}]},"chrome-bulge":{color:"#f8fafc",fontWeight:900,outlineEnabled:!0,shadowEnabled:!1,glowEnabled:!0,innerShadowEnabled:!0,bendEnabled:!0,bend:{preset:"bulge",strength:100},glow:{color:"#dbeafe",style:"contoured",intensity:.55,range:.35,horizontalAngle:0,verticalAngle:0},innerShadow:{color:"#64748b",opacity:.9,offset:16,angle:-45,feather:.25},strokeLayers:[{color:"#0f172a",width:5,opacity:.9}],shadowLayers:[]},"retro-wave":{color:"#fffbeb",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!0,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"wave",strength:100},glow:{color:"#fb7185",style:"outward",intensity:.65,range:.55,horizontalAngle:0,verticalAngle:0},strokeLayers:[{color:"#fb7185",width:12,opacity:1},{color:"#7c2d12",width:5,opacity:.9}],shadowLayers:[{color:"#7c2d12",blur:4,offset:14,angle:45,feather:.1,opacity:.75}]},"flag-pop":{color:"#ffffff",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!0,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"flag",strength:100},glow:{color:"#38bdf8",style:"outward",intensity:.5,range:.45,horizontalAngle:.15,verticalAngle:-.1},strokeLayers:[{color:"#fde047",width:18,opacity:1},{color:"#111827",width:7,opacity:1}],shadowLayers:[{color:"#111827",blur:0,offset:14,angle:35,feather:0,opacity:.75}]},"fisheye-poster":{color:"#fff7ed",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!1,innerShadowEnabled:!0,bendEnabled:!0,bend:{preset:"fisheye",strength:100},innerShadow:{color:"#92400e",opacity:.55,offset:10,angle:-45,feather:.15},strokeLayers:[{color:"#020617",width:24,opacity:1},{color:"#f97316",width:8,opacity:.9}],shadowLayers:[{color:"#020617",blur:0,offset:12,angle:40,feather:0,opacity:.8}]}},mn=[{label:"Space Grotesk",value:'"Space Grotesk", sans-serif'},{label:"Bebas Neue",value:'"Bebas Neue", sans-serif'},{label:"DM Serif Display",value:'"DM Serif Display", serif'},{label:"Caveat",value:'"Caveat", cursive'}],Sn=["clean","sticker","shadow-pop","neon","editorial","comic-burst","ice-outline","sunset-glow","cutout","badge-arc","chrome-bulge","retro-wave","flag-pop","fisheye-poster"],vn={clean:"NONE",sticker:"sticker","shadow-pop":"shadow-pop",neon:"neon",editorial:"editorial","comic-burst":"comic-burst","ice-outline":"ice-outline","sunset-glow":"sunset-glow",cutout:"cutout","badge-arc":"badge-arc","chrome-bulge":"chrome-bulge","retro-wave":"retro-wave","flag-pop":"flag-pop","fisheye-poster":"fisheye-poster"},wn=()=>({color:"#000000",opacity:1,width:30}),Bt=()=>({color:"#000000",opacity:1,offset:10,angle:-45,feather:0,blur:0,offsetX:7.071,offsetY:-7.071}),Ss=()=>({color:"#ffffff",style:"outward",intensity:.5,range:.5,horizontalAngle:0,verticalAngle:0}),vs=()=>({preset:"arc",strength:100}),kn=[{label:"Arc",value:"arc"},{label:"Arc Lower",value:"arc-lower"},{label:"Arc Upper",value:"arc-upper"},{label:"Arch",value:"arch"},{label:"Bulge",value:"bulge"},{label:"Shell Lower",value:"shell-lower"},{label:"Shell Upper",value:"shell-upper"},{label:"Flag",value:"flag"},{label:"Wave",value:"wave"},{label:"Fish",value:"fish"},{label:"Rise",value:"rise"},{label:"Fisheye",value:"fisheye"},{label:"Inflate",value:"inflate"},{label:"Squeeze",value:"squeeze"},{label:"Twist",value:"twist"}],Cn=(t,s)=>{const l=jn[s],n=l.strokeLayers??t.style.strokeLayers,a=l.shadowLayers??t.style.shadowLayers;return{...t,textArtPreset:s,style:{...t.style,...l,fontWeight:t.style.bold?"bold":l.fontWeight??t.style.fontWeight,background:{...t.style.background,...l.background},outlineEnabled:l.strokeLayers?l.strokeLayers.length>0:t.style.outlineEnabled,shadowEnabled:l.shadowLayers?l.shadowLayers.length>0:t.style.shadowEnabled,strokeLayers:n,shadowLayers:a}}},ws=(t,s)=>({enabled:(s==null?void 0:s.enabled)??t.enabled,showGuides:(s==null?void 0:s.showTransformGuides)??t.showTransformGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:(s==null?void 0:s.position)??t.position,size:(s==null?void 0:s.size)??t.size,rotation:(s==null?void 0:s.rotation)??t.rotation,scale2D:s==null?void 0:s.scale2D,referencePixelsPerUnit:s==null?void 0:s.referencePixelsPerUnit,pivot:(s==null?void 0:s.pivot)??t.pivot,renderOrder:(s==null?void 0:s.renderOrder)??t.renderOrder,overlay:(s==null?void 0:s.overlay)??t.overlay,visible:(s==null?void 0:s.visible)??t.visible}),Rn=(t,s)=>({...s,enabled:t.enabled,showTransformGuides:t.showGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:t.position,size:t.size,rotation:t.rotation,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),ks=(t,s)=>({...$e.DEFAULT_SCREEN_TRANSFORM_2D,...s,enabled:t.enabled,showTransformGuides:t.showGuides,position:t.position,size:t.size,rotation:t.rotation,scale2D:t.scale2D??(s==null?void 0:s.scale2D)??$e.DEFAULT_SCREEN_TRANSFORM_2D.scale2D,referencePixelsPerUnit:t.referencePixelsPerUnit??(s==null?void 0:s.referencePixelsPerUnit)??$e.DEFAULT_SCREEN_TRANSFORM_2D.referencePixelsPerUnit,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),In={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},En={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Tn={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},zn={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Mn={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Fn=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),Wn={display:"grid",gap:7,padding:"0 7px 7px"},me={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},k={display:"flex",flexDirection:"column",gap:4},ee={...k,gridColumn:"1 / -1"},Ln={gridColumn:"1 / -1",display:"grid",gap:6,padding:"8px 8px 2px 12px",marginTop:-2,borderLeft:"1px solid rgba(255,255,255,0.10)"},$n={display:"flex",alignItems:"center",justifyContent:"space-between",gap:6,width:"100%",padding:0,border:0,background:"transparent",fontSize:9,color:"rgba(226,232,240,0.64)",textTransform:"uppercase",cursor:"pointer"},Nn={display:"flex",alignItems:"center",gap:6,minWidth:0},On={width:16,height:16,borderRadius:999,display:"inline-flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.06)",color:"rgba(226,232,240,0.72)",flex:"0 0 auto"},S={fontSize:9,color:"rgba(226,232,240,0.72)"},Kt={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},An={...Kt,height:72,padding:"7px",resize:"vertical",lineHeight:1.35,fontFamily:"inherit"},je={...Kt,padding:2,cursor:"pointer"},xe={...Kt,appearance:"none"},Pn={opacity:.45,cursor:"not-allowed"},ue={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},gt={width:16,height:16},Dn={display:"grid",gridTemplateColumns:"1.25fr repeat(4, 1fr)",gap:4,width:"100%"},Je=t=>({height:26,borderRadius:8,border:t?"1px solid rgba(125,211,252,0.72)":"1px solid rgba(255,255,255,0.10)",background:t?"rgba(56,189,248,0.20)":"rgba(255,255,255,0.05)",color:t?"#f0f9ff":"#e2e8f0",fontSize:10.5,fontWeight:700,cursor:"pointer",padding:"0 6px"}),wt={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"};function Bn({label:t,icon:s,open:l,onToggle:n,children:a}){return e.jsxs("div",{style:En,children:[e.jsxs("div",{style:Tn,children:[e.jsx("button",{type:"button",onClick:n,style:Mn,children:e.jsx("div",{style:Fn(l)})}),e.jsxs("div",{style:zn,children:[e.jsx("span",{style:In,children:s}),e.jsx("span",{children:t})]})]}),l?e.jsx("div",{style:Wn,children:a}):null]})}const Qt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M4 6V4h16v2h-7v14h-2V6H4z"})}),es=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 3a9 9 0 1 0 0 18h1.2a2.8 2.8 0 0 0 0-5.6h-.4a1.8 1.8 0 0 1 0-3.6H16a5 5 0 0 0 0-10h-4zm-4 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm1 5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm6-7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z"})}),Vn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M4 4h6v2H7.4l3.3 3.3-1.4 1.4L6 7.4V10H4V4zm10 0h6v6h-2V7.4l-3.3 3.3-1.4-1.4L16.6 6H14V4zM9.3 13.3l1.4 1.4L7.4 18H10v2H4v-6h2v2.6l3.3-3.3zm5.4 0 3.3 3.3V14h2v6h-6v-2h2.6l-3.3-3.3 1.4-1.4z"})}),Kn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 5h10v2H9v6h8v2H7V5zm4 8h6v6h-6v-2h4v-2h-4v-2z"})});function Hn({value:t,onChange:s}){return e.jsxs("div",{style:me,children:[e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Text"}),e.jsx("textarea",{style:An,value:t.content.text,onChange:l=>s(n=>({...n,content:{...n.content,text:l.target.value}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Text Art"}),e.jsx("select",{style:xe,value:t.textArtPreset,onChange:l=>s(n=>Cn(n,l.target.value)),children:Sn.map(l=>e.jsx("option",{value:l,children:vn[l]},l))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Font"}),e.jsx("select",{style:xe,value:t.style.fontFamily,onChange:l=>s(n=>({...n,style:{...n.style,fontFamily:l.target.value}})),children:mn.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value))})]})]})}const Gn={width:"100%",boxSizing:"border-box",border:"1px solid rgba(148,163,184,0.22)",borderRadius:8,background:"rgba(15,23,42,0.8)",color:"#e2e8f0",padding:"7px 9px"},_n=t=>/^-?\d*(\.\d*)?$/.test(t),z=({value:t,onChange:s,step:l=1,min:n,max:a,disabled:d=!1})=>{const[r,o]=y.useState(String(t));y.useEffect(()=>o(String(t)),[t]);const h=x=>Math.min(typeof a=="number"?a:1/0,Math.max(typeof n=="number"?n:-1/0,x));return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:{...Gn,...d?{cursor:"not-allowed",opacity:.45}:{}},value:r,disabled:d,onChange:x=>{if(d)return;const c=x.target.value;if(!_n(c)||(o(c),["","-",".","-."].includes(c)))return;const p=Number(c);Number.isNaN(p)||s(h(p))},onBlur:()=>{if(d)return;const x=Number(r);if(Number.isNaN(x))return o(String(t));const c=h(x);o(String(c)),s(c)},onKeyDown:x=>{if(d||x.key!=="ArrowUp"&&x.key!=="ArrowDown")return;x.preventDefault();const c=x.shiftKey?l*10:x.altKey?l/10:l,p=x.key==="ArrowUp"?t+c:t-c;s(h(Number.isInteger(p)?p:Number(p.toFixed(6))))}})};function Un({background:t,onChange:s}){return e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Fill Mode"}),e.jsxs("select",{style:xe,value:t.fillMode,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,fillMode:l.target.value}}})),children:[e.jsx("option",{value:"solid",children:"solid"}),e.jsx("option",{value:"gradient",children:"gradient"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Fill Area"}),e.jsxs("select",{style:xe,value:t.fit,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,fit:l.target.value}}})),children:[e.jsx("option",{value:"text",children:"text"}),e.jsx("option",{value:"full",children:"full"})]})]}),t.fillMode==="solid"?e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Background Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,color:l.target.value}}}))})]}):e.jsx("div",{style:{gridColumn:"1 / -1",display:"grid",gap:6},children:t.gradientStops.slice(0,3).map((l,n)=>e.jsxs("label",{style:k,children:[e.jsxs("span",{style:S,children:["Gradient ",n+1]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 60px",gap:4},children:[e.jsx("input",{style:je,type:"color",value:l.color,onChange:a=>s(d=>{const r=[...d.style.background.gradientStops];return r[n]={...r[n],color:a.target.value},{...d,style:{...d.style,background:{...d.style.background,gradientStops:r}}}})}),e.jsx(z,{value:l.position,min:0,max:1,step:.05,onChange:a=>s(d=>{const r=[...d.style.background.gradientStops];return r[n]={...r[n],position:a},{...d,style:{...d.style,background:{...d.style.background,gradientStops:r}}}})})]})]},n))}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Background Opacity"}),e.jsx(z,{value:t.opacity,min:0,max:1,step:.05,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,opacity:l}}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Corner Radius"}),e.jsx(z,{value:t.borderRadius,min:0,max:200,step:2,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,borderRadius:l}}}))})]})]})}function Xn({background:t,onChange:s}){return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:"Auto Width / Height"}),e.jsx("input",{type:"checkbox",style:gt,checked:t.autoSize,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,autoSize:l.target.checked}}}))})]})}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Width"}),e.jsx(z,{value:t.width,min:32,max:1024,step:8,disabled:t.autoSize,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,width:l}}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Height"}),e.jsx(z,{value:t.height,min:32,max:1024,step:8,disabled:t.autoSize,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,height:l}}}))})]})]})}function Zn({background:t,onChange:s}){return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:"Background Stroke"}),e.jsx("input",{type:"checkbox",style:gt,checked:t.borderEnabled,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,borderEnabled:l.target.checked,borderColor:l.target.checked&&n.style.background.borderColor==="transparent"?"#ffffff":n.style.background.borderColor,borderWidth:l.target.checked?Math.max(n.style.background.borderWidth,2):n.style.background.borderWidth}}}))})]})}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Stroke Color"}),e.jsx("input",{style:{...je,...t.borderEnabled?{}:Pn},type:"color",value:t.borderColor,disabled:!t.borderEnabled,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,borderColor:l.target.value}}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Stroke Width"}),e.jsx(z,{value:t.borderWidth,min:0,max:64,step:1,disabled:!t.borderEnabled,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,borderWidth:l}}}))})]})]})}const Cs={gridColumn:"1 / -1",display:"grid",gap:6,padding:"8px",borderRadius:10,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)"};function yt({checked:t,label:s,onChange:l}){return e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:s}),e.jsx("input",{type:"checkbox",style:gt,checked:t,onChange:n=>l(n.target.checked)})]})})}function Xe({children:t,label:s,open:l,setOpen:n}){return e.jsxs("div",{style:Ln,children:[e.jsxs("button",{type:"button",style:$n,onClick:()=>n(a=>!a),children:[e.jsxs("span",{style:Nn,children:[e.jsx(Kn,{}),e.jsx("span",{children:s})]}),e.jsx("span",{style:On,children:l?"−":"+"})]}),l?t:null]})}function Yn({value:t,onChange:s,open:l,setOpen:n}){const a=t.style.background;return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:"Background Enabled"}),e.jsx("input",{type:"checkbox",style:gt,checked:a.enabled,onChange:d=>s(r=>({...r,style:{...r.style,background:{...r.style.background,enabled:d.target.checked}}}))})]})}),a.enabled?e.jsx(Xe,{label:"Background Settings",open:l,setOpen:n,children:e.jsxs(e.Fragment,{children:[e.jsx(Un,{background:a,onChange:s}),e.jsx(Zn,{background:a,onChange:s}),e.jsx(Xn,{background:a,onChange:s})]})}):null]})}function qn({bend:t,open:s,onChange:l,setOpen:n,value:a}){const d=r=>l(o=>({...o,style:{...o.style,bend:{...o.style.bend??t,...r}}}));return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Bend",checked:a.style.bendEnabled===!0,onChange:r=>l(o=>({...o,style:{...o.style,bendEnabled:r,bend:o.style.bend??vs()}}))}),a.style.bendEnabled===!0?e.jsx(Xe,{label:"Bend",open:s,setOpen:n,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Bend Preset"}),e.jsx("select",{style:xe,value:t.preset,onChange:r=>d({preset:r.target.value}),children:kn.map(r=>e.jsx("option",{value:r.value,children:r.label},r.value))})]}),e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Bend Strength"}),e.jsx(z,{value:t.strength,min:-100,max:100,step:1,onChange:r=>d({strength:r})})]})]})}):null]})}function Jn({glow:t,open:s,onChange:l,setOpen:n,value:a}){const d=r=>l(o=>({...o,style:{...o.style,glow:{...o.style.glow??t,...r}}}));return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Glow",checked:a.style.glowEnabled===!0,onChange:r=>l(o=>({...o,style:{...o.style,glowEnabled:r,glow:o.style.glow??Ss()}}))}),a.style.glowEnabled===!0?e.jsx(Xe,{label:"Glow",open:s,setOpen:n,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:r=>d({color:r.target.value})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Style"}),e.jsxs("select",{style:xe,value:t.style,onChange:r=>d({style:r.target.value}),children:[e.jsx("option",{value:"outward",children:"Outward"}),e.jsx("option",{value:"contoured",children:"Contoured"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Intensity"}),e.jsx(z,{value:t.intensity??.5,min:0,max:1,step:.05,onChange:r=>d({intensity:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Range"}),e.jsx(z,{value:t.range??.5,min:0,max:1,step:.05,onChange:r=>d({range:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Horizontal Angle"}),e.jsx(z,{value:t.horizontalAngle??0,min:-.5,max:.5,step:.05,onChange:r=>d({horizontalAngle:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Vertical Angle"}),e.jsx(z,{value:t.verticalAngle??0,min:-.5,max:.5,step:.05,onChange:r=>d({verticalAngle:r})})]})]})}):null]})}const Qn={color:"#000000",opacity:1,offset:10,angle:-45,feather:0};function el({innerShadow:t,open:s,onChange:l,setOpen:n,value:a}){const d=r=>l(o=>({...o,style:{...o.style,innerShadow:{...o.style.innerShadow??t,...r}}}));return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Inner Shadow",checked:a.style.innerShadowEnabled===!0,onChange:r=>l(o=>({...o,style:{...o.style,innerShadowEnabled:r,innerShadow:o.style.innerShadow??Qn}}))}),a.style.innerShadowEnabled===!0?e.jsx(Xe,{label:"Inner Shadow",open:s,setOpen:n,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:r=>d({color:r.target.value})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Opacity"}),e.jsx(z,{value:t.opacity??1,min:0,max:1,step:.05,onChange:r=>d({opacity:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Offset"}),e.jsx(z,{value:t.offset??10,min:0,max:100,step:1,onChange:r=>d({offset:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Angle"}),e.jsx(z,{value:t.angle??-45,min:-180,max:180,step:1,onChange:r=>d({angle:r})})]}),e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Shadow Feather"}),e.jsx(z,{value:t.feather??0,min:0,max:1,step:.05,onChange:r=>d({feather:r})})]})]})}):null]})}function tl({layers:t,open:s,onChange:l,setOpen:n,value:a}){const d=(r,o)=>l(h=>{const x=[...h.style.strokeLayers??[]];return x[r]={...x[r],...o},{...h,style:{...h.style,strokeLayers:x}}});return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Outline",checked:a.style.outlineEnabled!==!1,onChange:r=>l(o=>({...o,style:{...o.style,outlineEnabled:r}}))}),a.style.outlineEnabled!==!1?e.jsx(Xe,{label:"Outline Editor",open:s,setOpen:n,children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{...ue,gridColumn:"1 / -1"},children:[e.jsxs("span",{style:S,children:["Layers: ",t.length]}),e.jsx("button",{type:"button",style:wt,onClick:()=>l(r=>({...r,style:{...r.style,strokeLayers:[...r.style.strokeLayers??[],wn()]}})),children:"+"})]}),t.length>0?t.map((r,o)=>e.jsxs("div",{style:Cs,children:[e.jsxs("div",{style:ue,children:[e.jsxs("span",{style:S,children:["Outline ",o+1]}),e.jsx("button",{type:"button",style:wt,onClick:()=>l(h=>({...h,style:{...h.style,strokeLayers:(h.style.strokeLayers??[]).filter((x,c)=>c!==o)}})),children:"×"})]}),e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Outline Color"}),e.jsx("input",{style:je,type:"color",value:r.color,onChange:h=>d(o,{color:h.target.value})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Outline Opacity"}),e.jsx(z,{value:r.opacity??1,min:0,max:1,step:.05,onChange:h=>d(o,{opacity:h})})]}),e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Outline Size"}),e.jsx(z,{value:r.width,min:0,max:100,step:1,onChange:h=>d(o,{width:h})})]})]})]},o)):e.jsx("div",{style:{...S,gridColumn:"1 / -1"},children:"No outlines. Use `+` to add one."})]})}):null]})}function sl({layers:t,open:s,onChange:l,setOpen:n,value:a}){const d=(r,o)=>l(h=>{const x=[...h.style.shadowLayers??[]];return x[r]={...x[r],...o},{...h,style:{...h.style,shadowLayers:x}}});return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Outer Shadow",checked:a.style.shadowEnabled!==!1,onChange:r=>l(o=>{var h;return{...o,style:{...o.style,shadowEnabled:r,shadowLayers:r&&(((h=o.style.shadowLayers)==null?void 0:h.length)??0)===0?[Bt()]:o.style.shadowLayers}}})}),a.style.shadowEnabled!==!1?e.jsx(Xe,{label:"Shadow Editor",open:s,setOpen:n,children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{...ue,gridColumn:"1 / -1"},children:[e.jsxs("span",{style:S,children:["Layers: ",t.length]}),e.jsx("button",{type:"button",style:wt,onClick:()=>l(r=>({...r,style:{...r.style,shadowLayers:[...r.style.shadowLayers??[],Bt()]}})),children:"+"})]}),t.length>0?t.map((r,o)=>e.jsxs("div",{style:Cs,children:[e.jsxs("div",{style:ue,children:[e.jsxs("span",{style:S,children:["Shadow ",o+1]}),e.jsx("button",{type:"button",style:wt,onClick:()=>l(h=>({...h,style:{...h.style,shadowLayers:(h.style.shadowLayers??[]).filter((x,c)=>c!==o)}})),children:"×"})]}),e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Color"}),e.jsx("input",{style:je,type:"color",value:r.color,onChange:h=>d(o,{color:h.target.value})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Opacity"}),e.jsx(z,{value:r.opacity??1,min:0,max:1,step:.05,onChange:h=>d(o,{opacity:h})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Offset"}),e.jsx(z,{value:r.offset??10,min:0,max:100,step:1,onChange:h=>d(o,{offset:h})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Angle"}),e.jsx(z,{value:r.angle??-45,min:-180,max:180,step:1,onChange:h=>d(o,{angle:h})})]}),e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Shadow Feather"}),e.jsx(z,{value:r.feather??0,min:0,max:1,step:.05,onChange:h=>d(o,{feather:h})})]})]})]},o)):e.jsx("div",{style:{...S,gridColumn:"1 / -1"},children:"No outer shadows. Use `+` to add one."})]})}):null]})}function nl({backgroundSettingsOpen:t,bend:s,bendSettingsOpen:l,glow:n,glowSettingsOpen:a,innerShadow:d,innerShadowSettingsOpen:r,onChange:o,outlineLayers:h,outlineSettingsOpen:x,setBackgroundSettingsOpen:c,setBendSettingsOpen:p,setGlowSettingsOpen:f,setInnerShadowSettingsOpen:g,setOutlineSettingsOpen:i,setShadowSettingsOpen:u,shadowLayers:j,shadowSettingsOpen:w,value:v}){return e.jsxs("div",{style:me,children:[e.jsx(tl,{value:v,onChange:o,layers:h,open:x,setOpen:i}),e.jsx(sl,{value:v,onChange:o,layers:j,open:w,setOpen:u}),e.jsx(el,{value:v,onChange:o,innerShadow:d,open:a,setOpen:f}),e.jsx(Jn,{value:v,onChange:o,glow:n,open:r,setOpen:g}),e.jsx(qn,{value:v,onChange:o,bend:s,open:l,setOpen:p}),e.jsx(Yn,{value:v,onChange:o,open:t,setOpen:c})]})}function ll({value:t,onChange:s}){const l=t.style.bold===!0||t.style.fontStyle==="italic"||t.style.underline===!0||t.style.strikethrough===!0;return e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Text Color"}),e.jsx("input",{style:je,type:"color",value:t.style.color,onChange:n=>s(a=>({...a,style:{...a.style,color:n.target.value}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Font Size"}),e.jsx(z,{value:t.style.fontSize,min:16,max:180,step:4,onChange:n=>s(a=>({...a,layout:{...a.layout,minFontSize:Math.min(a.layout.minFontSize??n,n)},style:{...a.style,fontSize:n}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Letter Spacing"}),e.jsx(z,{value:t.style.letterSpacing,min:0,max:1,step:.05,onChange:n=>s(a=>({...a,style:{...a.style,letterSpacing:n}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Line Spacing"}),e.jsx(z,{value:t.style.lineSpacing,min:0,max:1,step:.05,onChange:n=>s(a=>({...a,style:{...a.style,lineSpacing:n}}))})]}),e.jsxs("div",{style:ee,children:[e.jsx("span",{style:S,children:"Text Style"}),e.jsxs("div",{style:Dn,children:[e.jsx("button",{type:"button",style:Je(!l),onClick:()=>s(n=>({...n,style:{...n.style,bold:!1,fontWeight:n.style.fontWeight==="bold"?"normal":n.style.fontWeight,fontStyle:"normal",underline:!1,strikethrough:!1}})),children:"None"}),e.jsx("button",{type:"button",style:Je(t.style.bold===!0),onClick:()=>s(n=>({...n,style:{...n.style,bold:n.style.bold!==!0,fontWeight:n.style.bold!==!0?"bold":400}})),children:"B"}),e.jsx("button",{type:"button",style:Je(t.style.fontStyle==="italic"),onClick:()=>s(n=>({...n,style:{...n.style,fontStyle:n.style.fontStyle==="italic"?"normal":"italic"}})),children:"I"}),e.jsx("button",{type:"button",style:Je(t.style.underline===!0),onClick:()=>s(n=>({...n,style:{...n.style,underline:n.style.underline!==!0}})),children:"U"}),e.jsx("button",{type:"button",style:Je(t.style.strikethrough===!0),onClick:()=>s(n=>({...n,style:{...n.style,strikethrough:n.style.strikethrough!==!0}})),children:"S"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Horizontal Alignment"}),e.jsxs("select",{style:xe,value:t.layout.textAlign??"center",onChange:n=>s(a=>({...a,layout:{...a.layout,textAlign:n.target.value}})),children:[e.jsx("option",{value:"left",children:"left"}),e.jsx("option",{value:"center",children:"center"}),e.jsx("option",{value:"right",children:"right"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Vertical Alignment"}),e.jsxs("select",{style:xe,value:t.layout.verticalAlign??"center",onChange:n=>s(a=>({...a,layout:{...a.layout,verticalAlign:n.target.value}})),children:[e.jsx("option",{value:"top",children:"top"}),e.jsx("option",{value:"center",children:"center"}),e.jsx("option",{value:"bottom",children:"bottom"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Overflow"}),e.jsxs("select",{style:xe,value:t.layout.overflow,onChange:n=>s(a=>({...a,layout:{...a.layout,overflow:n.target.value}})),children:[e.jsx("option",{value:"clip",children:"Clip text"}),e.jsx("option",{value:"ellipsis",children:"Show ellipsis"}),e.jsx("option",{value:"clamp",children:"Clamp"}),e.jsx("option",{value:"shrink",children:"Shrink"})]})]}),e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:"Resize To Fit"}),e.jsx("input",{type:"checkbox",style:gt,checked:t.layout.resizeToFit===!0,onChange:n=>s(a=>({...a,layout:{...a.layout,resizeToFit:n.target.checked}}))})]})})]})}const il={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},re={display:"flex",flexDirection:"column",gap:4},Et={...re,gridColumn:"1 / -1"},Y={fontSize:9,color:"rgba(226,232,240,0.72)"},ol={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},rl={...ol,fontVariantNumeric:"tabular-nums"},al={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},dl={width:16,height:16},cl=t=>/^-?\d*(\.\d*)?$/.test(t),se=({value:t,onChange:s,step:l=1,min:n,max:a,disabled:d=!1})=>{const[r,o]=y.useState(String(t));y.useEffect(()=>o(String(t)),[t]);const h=x=>{let c=x;return typeof n=="number"&&(c=Math.max(n,c)),typeof a=="number"&&(c=Math.min(a,c)),c};return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:rl,value:r,disabled:d,onChange:x=>{const c=x.target.value;if(!cl(c)||(o(c),c===""||c==="-"||c==="."||c==="-."))return;const p=Number(c);Number.isNaN(p)||s(h(p))},onBlur:()=>{const x=Number(r);if(Number.isNaN(x)){o(String(t));return}const c=h(x);o(String(c)),s(c)},onKeyDown:x=>{if(x.key!=="ArrowUp"&&x.key!=="ArrowDown")return;x.preventDefault();const c=x.shiftKey?l*10:x.altKey?l/10:l,p=x.key==="ArrowUp"?t+c:t-c;s(h(Number.isInteger(p)?p:Number(p.toFixed(6))))}})},Ht=({value:t,onChange:s,guideLabel:l,showRenderOrder:n=!0})=>{var a,d;return e.jsxs("div",{style:il,children:[e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Position X"}),e.jsx(se,{value:t.position.x,min:-4096,max:4096,step:1,onChange:r=>s({...t,position:{...t.position,x:r}})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Position Y"}),e.jsx(se,{value:t.position.y,min:-4096,max:4096,step:1,onChange:r=>s({...t,position:{...t.position,y:r}})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Size X"}),e.jsx(se,{value:t.size.width,min:0,max:8192,step:1,onChange:r=>s({...t,size:{...t.size,width:r}})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Size Y"}),e.jsx(se,{value:t.size.height,min:0,max:8192,step:1,onChange:r=>s({...t,size:{...t.size,height:r}})})]}),e.jsxs("label",{style:Et,children:[e.jsx("span",{style:Y,children:"Rotation"}),e.jsx(se,{value:t.rotation,min:-360,max:360,step:1,onChange:r=>s({...t,rotation:r})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Scale 2D X"}),e.jsx(se,{value:((a=t.scale2D)==null?void 0:a.x)??1,min:-10,max:10,step:.01,onChange:r=>{var o;return s({...t,scale2D:{x:r,y:((o=t.scale2D)==null?void 0:o.y)??1}})}})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Scale 2D Y"}),e.jsx(se,{value:((d=t.scale2D)==null?void 0:d.y)??1,min:-10,max:10,step:.01,onChange:r=>{var o;return s({...t,scale2D:{x:((o=t.scale2D)==null?void 0:o.x)??1,y:r}})}})]}),e.jsxs("label",{style:Et,children:[e.jsx("span",{style:Y,children:"Reference Pixels Per Unit"}),e.jsx(se,{value:t.referencePixelsPerUnit??32,min:1,max:512,step:1,onChange:r=>s({...t,referencePixelsPerUnit:r})})]}),n?e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Render Order"}),e.jsx(se,{value:t.renderOrder,min:-9999,max:9999,step:1,onChange:r=>s({...t,renderOrder:r})})]}):null,e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Pivot X"}),e.jsx(se,{value:t.pivot[0],min:0,max:1,step:.01,onChange:r=>s({...t,pivot:[r,t.pivot[1]]})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Pivot Y"}),e.jsx(se,{value:t.pivot[1],min:0,max:1,step:.01,onChange:r=>s({...t,pivot:[t.pivot[0],r]})})]}),e.jsx("label",{style:Et,children:e.jsxs("div",{style:al,children:[e.jsx("span",{style:Y,children:l}),e.jsx("input",{type:"checkbox",style:dl,checked:t.showGuides,onChange:r=>s({...t,showGuides:r.target.checked})})]})})]})};function pl({value:t,onChange:s}){return e.jsx(Ht,{value:ws(t.transformation,t.screenTransform),guideLabel:"Transform Control On",showRenderOrder:!1,onChange:l=>s(n=>({...n,transformation:Rn(l,n.transformation),screenTransform:ks(l,n.screenTransform)}))})}const hl=({value:t,onChange:s,copyLabel:l,inspector:n,docked:a})=>{var Ze;const[d,r]=y.useState(()=>K.createSceneObject({name:l??"Screen Text",renderGroupId:Le.DEFAULT_RENDER_GROUP_IDS.screen2d})),[o]=y.useState(()=>{const $=d.id,Z=K.createDefaultComponent("ScreenTransform",$),m=K.createDefaultComponent("ScreenText",$),R=K.createDefaultComponent("Material",$),D=K.createDefaultComponent("Texture",$);return{screenTransform:Z,screenText:m,material:R,texture:D}}),[h,x]=y.useState(!0),[c,p]=y.useState(!0),[f,g]=y.useState(!0),[i,u]=y.useState(!0),[j,w]=y.useState(!0),[v,M]=y.useState(!0),[U,b]=y.useState({text2d:!0,content:!0,transformation:!0,style:!0,textEffect:!0}),F=ws(t.screenText.transformation,t.screenText.screenTransform),E={object:{...d,componentIds:[o.screenTransform.id,o.screenText.id,o.material.id,o.texture.id]},kind:"screenText",components:[{...o.screenTransform,settings:t.screenText.screenTransform??ks(F)},{...o.screenText,settings:t.screenText},{...o.material,settings:{...o.material.settings,color:t.screenText.style.color,opacity:t.screenText.style.opacity}},{...o.texture,settings:{...o.texture.settings,url:t.screenText.style.background.textureUrl,flipX:t.screenText.style.background.textureFlipX,flipY:t.screenText.style.background.textureFlipY}}],scene:{screenSpaceUI:t.screenSpaceUI}},P=$=>{s({...t,screenText:$(t.screenText)})},le=t.screenText.style.strokeLayers??[],ae=t.screenText.style.shadowEnabled!==!1&&(((Ze=t.screenText.style.shadowLayers)==null?void 0:Ze.length)??0)===0?[Bt()]:t.screenText.style.shadowLayers??[],L=t.screenText.style.innerShadow??{color:"#000000",opacity:1,offset:10,angle:-45,feather:0},Pe=t.screenText.style.glow??Ss(),De=t.screenText.style.bend??vs(),W=$=>b(Z=>({...Z,[$]:!Z[$]})),ve=($,Z,m,R)=>e.jsx(Bn,{label:Z,icon:m,open:U[$],onToggle:()=>W($),children:R},$);return e.jsxs(Ct,{objectId:(n==null?void 0:n.objectId)??d.id,objectName:(n==null?void 0:n.objectName)??d.name,onObjectNameChange:(n==null?void 0:n.onObjectNameChange)??($=>r(Z=>({...Z,name:$}))),layer:(n==null?void 0:n.layer)??"Default Layer",visible:(n==null?void 0:n.visible)??t.screenText.enabled,onVisibleChange:(n==null?void 0:n.onVisibleChange)??($=>P(Z=>({...Z,enabled:$}))),copyConfig:(n==null?void 0:n.copyConfig)??E,docked:a??(n==null?void 0:n.docked),initialPosition:n==null?void 0:n.initialPosition,position:n==null?void 0:n.position,onPositionChange:n==null?void 0:n.onPositionChange,title:n==null?void 0:n.title,children:[ve("transformation","Transformation",e.jsx(Vn,{}),e.jsx(pl,{value:t.screenText,onChange:P})),ve("text2d","2D Text",e.jsx(Qt,{}),e.jsxs(e.Fragment,{children:[ve("content","Content",e.jsx(Qt,{}),e.jsx(Hn,{value:t.screenText,onChange:P})),ve("style","Style",e.jsx(es,{}),e.jsx(ll,{value:t.screenText,onChange:P})),ve("textEffect","Text Effect",e.jsx(es,{}),e.jsx(nl,{value:t.screenText,onChange:P,outlineLayers:le,shadowLayers:ae,innerShadow:L,glow:Pe,bend:De,outlineSettingsOpen:h,setOutlineSettingsOpen:x,shadowSettingsOpen:c,setShadowSettingsOpen:p,innerShadowSettingsOpen:f,setInnerShadowSettingsOpen:g,glowSettingsOpen:i,setGlowSettingsOpen:u,bendSettingsOpen:j,setBendSettingsOpen:w,backgroundSettingsOpen:v,setBackgroundSettingsOpen:M}))]}))]})},xl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAUAAgMAAAAToI2uAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAlQTFRFqampbGxsAAAA/lGquwAAAAN0Uk5T//8A18oNQQAABPRJREFUeJztzssNQWEYQEG3CP1oQqJGsdCfBFs7j8X8+eRMBbPtBtpWB35RWimtlFZKK6WV0kppZWj6uLrwrceltFFaKa2UVkorpZXSSmlldPp2XT350P5Q2iitlFZKK6WV0kpppbRSWimtlFZKK3+RPq8OvXM/lTZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK3+THqG0UloprZRWSiulldJKaaW0UloprZRWSiuv6VFKK6WV0kpppbRSWimtlFbGpgcqrZRWSiulldJKaaW0MjL9BFWtRqVFuJpUAAAAAElFTkSuQmCC",ul={placeholder:"Placeholder","hero-image":"Hero Image","photo-frame":"Default Frame"},gl=Object.entries(ul).map(([t,s])=>({value:t,label:s})),yl={placeholder:{transformation:{showFitGuides:!1},image:{sourceKind:"default",stretchMode:"fit",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}},"hero-image":{transformation:{position:{x:0,y:.08},size:{width:.96,height:.62},rotation:0,pivot:[.5,.5],overlay:!0,visible:!0},image:{sourceKind:"image",stretchMode:"fillAndCut",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}},"photo-frame":{transformation:{position:{x:0,y:.01},size:{width:2,height:2},rotation:0,pivot:[.5,.5],overlay:!0,visible:!0},image:{sourceKind:"image",src:xl,stretchMode:"fill",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}}},bl=(t,s)=>{const l=yl[s];return{...t,preset:s,...l.enabled!==void 0?{enabled:l.enabled}:{},transformation:{...t.transformation,...l.transformation??{}},image:{...t.image,...l.image??{}}}},fl={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},ct={display:"flex",flexDirection:"column",gap:4},jl={...ct,gridColumn:"1 / -1"},Qe={fontSize:9,color:"rgba(226,232,240,0.72)"},Gt={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},ts={...Gt,appearance:"none"},ml={...Gt,fontVariantNumeric:"tabular-nums"},Sl={...Gt,padding:2,cursor:"pointer"},vl=t=>/^-?\d*(\.\d*)?$/.test(t),ss=({value:t,onChange:s,step:l=1,min:n,max:a})=>{const[d,r]=y.useState(String(t));y.useEffect(()=>r(String(t)),[t]);const o=h=>{let x=h;return typeof n=="number"&&(x=Math.max(n,x)),typeof a=="number"&&(x=Math.min(a,x)),x};return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:ml,value:d,onChange:h=>{const x=h.target.value;if(!vl(x)||(r(x),x===""||x==="-"||x==="."||x==="-."))return;const c=Number(x);Number.isNaN(c)||s(o(c))},onBlur:()=>{const h=Number(d);if(Number.isNaN(h)){r(String(t));return}const x=o(h);r(String(x)),s(x)},onKeyDown:h=>{if(h.key!=="ArrowUp"&&h.key!=="ArrowDown")return;h.preventDefault();const x=h.shiftKey?l*10:h.altKey?l/10:l,c=h.key==="ArrowUp"?t+x:t-x;s(o(Number.isInteger(c)?c:Number(c.toFixed(6))))}})},wl=({value:t,onChange:s})=>e.jsxs("div",{style:fl,children:[e.jsxs("label",{style:ct,children:[e.jsx("span",{style:Qe,children:"Material Type"}),e.jsxs("select",{style:ts,value:t.materialType,onChange:l=>s({...t,materialType:l.target.value}),children:[e.jsx("option",{value:"unlit",children:"Unlit"}),e.jsx("option",{value:"standardPBR",children:"Standard PBR"}),e.jsx("option",{value:"matcap",children:"Matcap"})]})]}),e.jsxs("label",{style:ct,children:[e.jsx("span",{style:Qe,children:"Blend Mode"}),e.jsxs("select",{style:ts,value:t.blendMode,onChange:l=>s({...t,blendMode:l.target.value}),children:[e.jsx("option",{value:"normal",children:"Normal"}),e.jsx("option",{value:"add",children:"Add"}),e.jsx("option",{value:"subtract",children:"Subtract"}),e.jsx("option",{value:"multiply",children:"Multiply"}),e.jsx("option",{value:"screen",children:"Screen"}),e.jsx("option",{value:"lighten",children:"Lighten"}),e.jsx("option",{value:"darken",children:"Darken"}),e.jsx("option",{value:"overlay",children:"Overlay"}),e.jsx("option",{value:"softLight",children:"Soft Light"}),e.jsx("option",{value:"hardLight",children:"Hard Light"}),e.jsx("option",{value:"difference",children:"Difference"}),e.jsx("option",{value:"exclusion",children:"Exclusion"})]})]}),e.jsxs("label",{style:ct,children:[e.jsx("span",{style:Qe,children:"Opacity"}),e.jsx(ss,{value:t.opacity,min:0,max:1,step:.01,onChange:l=>s({...t,opacity:l})})]}),e.jsxs("label",{style:ct,children:[e.jsx("span",{style:Qe,children:"Tint"}),e.jsx("input",{type:"color",style:Sl,value:t.color,onChange:l=>s({...t,color:l.target.value})})]}),e.jsxs("label",{style:jl,children:[e.jsx("span",{style:Qe,children:"Alpha Test"}),e.jsx(ss,{value:t.alphaTest,min:0,max:1,step:.01,onChange:l=>s({...t,alphaTest:l})})]})]}),kl={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},Cl={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Rl={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},Il={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},El={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Tl=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),zl={display:"grid",gap:7,padding:"0 7px 7px"},Ml={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},pt={display:"flex",flexDirection:"column",gap:4},Tt={...pt,gridColumn:"1 / -1"},we={fontSize:9,color:"rgba(226,232,240,0.72)"},Rs={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},zt={...Rs,appearance:"none"},Mt={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},Ft={width:16,height:16},Fl=[{value:"default",label:"Default"},{value:"image",label:"Image"},{value:"gif",label:"GIF"}],Wl=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zm0 2v8.76l4.5-4.5 3.2 3.2 2.8-2.8L19 14.16V6H5zm12 3a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),Ll=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2h2v4h3l-4 4-4-4h3V2zm0 20v-4H8l4-4 4 4h-3v4h-2zM2 11h4V8l4 4-4 4v-3H2v-2zm20 0v2h-4v3l-4-4 4-4v3h4z"})}),$l=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 2 3 7v10l9 5 9-5V7l-9-5zm0 2.3L17.9 7 12 9.7 6.1 7 12 4.3zM5 8.5l6 2.7v7.9l-6-3.3V8.5zm8 10.6v-7.9l6-2.7v7.3l-6 3.3z"})}),ns=(t,s)=>({enabled:(s==null?void 0:s.enabled)??t.enabled,showGuides:(s==null?void 0:s.showTransformGuides)??t.showFitGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:(s==null?void 0:s.position)??t.position,size:(s==null?void 0:s.size)??t.size,rotation:(s==null?void 0:s.rotation)??t.rotation,scale2D:s==null?void 0:s.scale2D,referencePixelsPerUnit:s==null?void 0:s.referencePixelsPerUnit,pivot:(s==null?void 0:s.pivot)??t.pivot,renderOrder:(s==null?void 0:s.renderOrder)??t.renderOrder,overlay:(s==null?void 0:s.overlay)??t.overlay,visible:(s==null?void 0:s.visible)??t.visible}),Nl=(t,s)=>({...s,enabled:t.enabled,showFitGuides:t.showGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:t.position,size:t.size,rotation:t.rotation,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),ls=(t,s)=>({...$e.DEFAULT_SCREEN_TRANSFORM_2D,...s,enabled:t.enabled,showTransformGuides:t.showGuides,position:t.position,size:t.size,rotation:t.rotation,scale2D:t.scale2D??(s==null?void 0:s.scale2D)??$e.DEFAULT_SCREEN_TRANSFORM_2D.scale2D,referencePixelsPerUnit:t.referencePixelsPerUnit??(s==null?void 0:s.referencePixelsPerUnit)??$e.DEFAULT_SCREEN_TRANSFORM_2D.referencePixelsPerUnit,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),Ol=({value:t,onChange:s,copyLabel:l,inspector:n,docked:a})=>{const[d,r]=y.useState(()=>K.createSceneObject({name:l??"Screen Image",renderGroupId:Le.DEFAULT_RENDER_GROUP_IDS.screen2d})),[o]=y.useState(()=>{const i=d.id,u=K.createDefaultComponent("ScreenTransform",i),j=K.createDefaultComponent("ScreenImage",i),w=K.createDefaultComponent("Material",i),v=K.createDefaultComponent("Texture",i);return{screenTransform:u,screenImage:j,material:w,texture:v}}),[h,x]=y.useState({transformation:!0,image:!0,material:!0}),c=ns(t.screenImage.transformation,t.screenImage.screenTransform),p={object:{...d,componentIds:[o.screenTransform.id,o.screenImage.id,o.material.id,o.texture.id]},kind:"screenImage",components:[{...o.screenTransform,settings:t.screenImage.screenTransform??ls(c)},{...o.screenImage,settings:t.screenImage},{...o.material,settings:{...o.material.settings,color:t.screenImage.image.color,opacity:t.screenImage.image.opacity}},{...o.texture,settings:{...o.texture.settings,url:t.screenImage.image.src||void 0,flipX:t.screenImage.image.flipX,flipY:t.screenImage.image.flipY}}],scene:{screenSpaceUI:t.screenSpaceUI}},f=i=>{s({...t,screenImage:i(t.screenImage)})},g=(i,u,j,w)=>e.jsxs("div",{style:Cl,children:[e.jsxs("div",{style:Rl,children:[e.jsx("button",{type:"button",onClick:()=>x(v=>({...v,[i]:!v[i]})),style:El,children:e.jsx("div",{style:Tl(h[i])})}),e.jsxs("div",{style:Il,children:[e.jsx("span",{style:kl,children:j}),e.jsx("span",{children:u})]})]}),h[i]?e.jsx("div",{style:zl,children:w}):null]},i);return e.jsxs(Ct,{objectId:(n==null?void 0:n.objectId)??d.id,objectName:(n==null?void 0:n.objectName)??d.name,onObjectNameChange:(n==null?void 0:n.onObjectNameChange)??(i=>r(u=>({...u,name:i}))),layer:(n==null?void 0:n.layer)??"Default Layer",visible:(n==null?void 0:n.visible)??t.screenImage.enabled,onVisibleChange:(n==null?void 0:n.onVisibleChange)??(i=>f(u=>({...u,enabled:i}))),copyConfig:(n==null?void 0:n.copyConfig)??p,docked:a??(n==null?void 0:n.docked),initialPosition:n==null?void 0:n.initialPosition,position:n==null?void 0:n.position,onPositionChange:n==null?void 0:n.onPositionChange,title:n==null?void 0:n.title,children:[g("transformation","Transformation",e.jsx(Ll,{}),e.jsx(Ht,{value:ns(t.screenImage.transformation,t.screenImage.screenTransform),guideLabel:"Transform Control On",showRenderOrder:!1,onChange:i=>f(u=>({...u,transformation:Nl(i,u.transformation),screenTransform:ls(i,u.screenTransform)}))})),g("image","Image",e.jsx(Wl,{}),e.jsxs("div",{style:{display:"grid",gap:6},children:[e.jsxs("label",{style:pt,children:[e.jsx("span",{style:we,children:"Preset"}),e.jsx("select",{style:zt,value:t.screenImage.preset,onChange:i=>f(u=>bl(u,i.target.value)),children:gl.map(i=>e.jsx("option",{value:i.value,children:i.label},i.value))})]}),e.jsxs("label",{style:pt,children:[e.jsx("span",{style:we,children:"Source Kind"}),e.jsx("select",{style:zt,value:t.screenImage.image.sourceKind,onChange:i=>f(u=>({...u,image:{...u.image,sourceKind:i.target.value}})),children:Fl.map(i=>e.jsx("option",{value:i.value,children:i.label},i.value))})]}),t.screenImage.image.sourceKind==="image"||t.screenImage.image.sourceKind==="gif"?e.jsxs("label",{style:pt,children:[e.jsx("span",{style:we,children:"Source URL"}),e.jsx("input",{style:Rs,value:t.screenImage.image.src,onChange:i=>f(u=>({...u,image:{...u.image,src:i.target.value}}))})]}):null,e.jsxs("label",{style:pt,children:[e.jsx("span",{style:we,children:"Stretch Mode"}),e.jsxs("select",{style:zt,value:t.screenImage.image.stretchMode,onChange:i=>f(u=>({...u,image:{...u.image,stretchMode:i.target.value}})),children:[e.jsx("option",{value:"fit",children:"Fit"}),e.jsx("option",{value:"fitWidth",children:"Fit Width"}),e.jsx("option",{value:"fitHeight",children:"Fit Height"}),e.jsx("option",{value:"center",children:"Center"}),e.jsx("option",{value:"stretch",children:"Stretch"}),e.jsx("option",{value:"fill",children:"Fill"}),e.jsx("option",{value:"fillAndCut",children:"Fill and Cut"})]})]}),e.jsx("label",{style:Tt,children:e.jsxs("div",{style:Mt,children:[e.jsx("span",{style:we,children:"Flip X"}),e.jsx("input",{type:"checkbox",style:Ft,checked:t.screenImage.image.flipX,onChange:i=>f(u=>({...u,image:{...u.image,flipX:i.target.checked}}))})]})}),e.jsx("label",{style:Tt,children:e.jsxs("div",{style:Mt,children:[e.jsx("span",{style:we,children:"Flip Y"}),e.jsx("input",{type:"checkbox",style:Ft,checked:t.screenImage.image.flipY,onChange:i=>f(u=>({...u,image:{...u.image,flipY:i.target.checked}}))})]})})]})),g("material","Material",e.jsx($l,{}),e.jsxs("div",{style:Ml,children:[e.jsx(wl,{value:t.screenImage.image,onChange:i=>f(u=>({...u,image:{...u.image,materialType:i.materialType,blendMode:i.blendMode,opacity:i.opacity,color:i.color,alphaTest:i.alphaTest}}))}),e.jsx("label",{style:Tt,children:e.jsxs("div",{style:Mt,children:[e.jsx("span",{style:we,children:"Transparent"}),e.jsx("input",{type:"checkbox",style:Ft,checked:t.screenImage.image.transparent,onChange:i=>f(u=>({...u,image:{...u.image,transparent:i.target.checked}}))})]})})]}))]})},_e={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},We={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},Al=({onChange:t,value:s})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[s.map((l,n)=>e.jsxs("div",{style:_e,children:[e.jsx("input",{"aria-label":`Gradient stop ${n+1} color`,type:"color",style:{...We,padding:2},value:l.color,onChange:a=>t(s.map((d,r)=>r===n?{...d,color:a.currentTarget.value}:d))}),e.jsxs("span",{style:{display:"grid",gridTemplateColumns:"1fr auto",gap:4},children:[e.jsx("input",{"aria-label":`Gradient stop ${n+1} position`,type:"number",min:0,max:1,step:.05,style:We,value:l.offset,onChange:a=>t(s.map((d,r)=>r===n?{...d,offset:Number(a.currentTarget.value)}:d))}),s.length>2?e.jsx("button",{type:"button",onClick:()=>t(s.filter((a,d)=>d!==n)),children:"−"}):null]})]},`${n}-${l.color}`)),s.length<J.MAX_SCREEN_GRADIENT_STOPS?e.jsx("button",{type:"button",onClick:()=>{var l;return t([...s,{offset:.5,color:((l=s[s.length-1])==null?void 0:l.color)??"#ffffff"}])},children:"Add stop"}):null]}),Is=({onChange:t,value:s})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Gradient"}),e.jsxs("select",{style:We,value:s.type,onChange:l=>t({...s,type:l.currentTarget.value}),children:[e.jsx("option",{value:"linear",children:"Linear"}),e.jsx("option",{value:"radial",children:"Radial"}),e.jsx("option",{value:"angular",children:"Conic / Angular"})]})]}),e.jsx(Al,{value:s.stops,onChange:l=>t({...s,stops:l})}),s.type!=="radial"?e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Angle"}),e.jsx("input",{type:"number",style:We,step:5,value:s.angle,onChange:l=>t({...s,angle:Number(l.currentTarget.value)})})]}):null,s.type!=="linear"?e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Center X"}),e.jsx("input",{type:"number",style:We,min:0,max:1,step:.05,value:s.center.x,onChange:l=>t({...s,center:{...s.center,x:Number(l.currentTarget.value)}})})]}),e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Center Y"}),e.jsx("input",{type:"number",style:We,min:0,max:1,step:.05,value:s.center.y,onChange:l=>t({...s,center:{...s.center,y:Number(l.currentTarget.value)}})})]})]}):null,s.type==="radial"?e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Radius"}),e.jsx("input",{type:"number",style:We,min:.01,step:.05,value:s.radius,onChange:l=>t({...s,radius:Number(l.currentTarget.value)})})]}):null]}),is={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},os={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},Es=({value:t,onChange:s})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[e.jsxs("label",{style:is,children:[e.jsx("span",{children:"Tint"}),e.jsx("input",{type:"color",style:{...os,padding:2},value:t.tint,onChange:l=>s({...t,tint:l.currentTarget.value})})]}),["opacity","frost","highlight"].map(l=>e.jsxs("label",{style:is,children:[e.jsx("span",{children:l[0].toUpperCase()+l.slice(1)}),e.jsx("input",{type:"number",style:os,min:0,max:1,step:.05,value:t[l],onChange:n=>s({...t,[l]:Number(n.currentTarget.value)})})]},l))]}),Pl={borderRadius:12,border:"1px solid rgba(255,255,255,.08)",background:"rgba(255,255,255,.03)",padding:8},Ue={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},ht={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},ie=({label:t,onValue:s,...l})=>e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:t}),e.jsx("input",{...l,type:"number",style:ht,onChange:n=>s(Number(n.currentTarget.value))})]}),Ts=({value:t,onChange:s})=>e.jsxs("section",{style:Pl,children:[e.jsx("div",{style:{fontSize:11,fontWeight:700,marginBottom:7},children:"Screen Shape"}),e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Shape"}),e.jsxs("select",{style:ht,value:t.kind,onChange:l=>s({...t,kind:l.currentTarget.value}),children:[e.jsx("option",{value:"circle",children:"Circle"}),e.jsx("option",{value:"ellipse",children:"Ellipse"}),e.jsx("option",{value:"rectangle",children:"Rectangle"}),e.jsx("option",{value:"roundedRectangle",children:"Rounded Rectangle"}),e.jsx("option",{value:"polygon",children:"Polygon"}),e.jsx("option",{value:"star",children:"Star"}),e.jsx("option",{value:"line",children:"Line"})]})]}),t.kind!=="line"?e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Fill"}),e.jsxs("select",{style:ht,value:t.fillMode,onChange:l=>s({...t,fillMode:l.currentTarget.value}),children:[e.jsx("option",{value:"solid",children:"Solid"}),e.jsx("option",{value:"gradient",children:"Gradient"}),e.jsx("option",{value:"glass",children:"Glass"})]})]}),t.fillMode==="gradient"?e.jsx(Is,{value:t.gradient,onChange:l=>s({...t,gradient:l})}):t.fillMode==="glass"?e.jsx(Es,{value:t.glass,onChange:l=>s({...t,glass:l})}):e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Color"}),e.jsx("input",{type:"color",style:{...ht,padding:2},value:t.fillColor,onChange:l=>s({...t,fillColor:l.currentTarget.value})})]}),e.jsx(ie,{label:"Fill Opacity",min:0,max:1,step:.05,value:t.fillOpacity,onValue:l=>s({...t,fillOpacity:l})})]}):null,e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Stroke"}),e.jsx("input",{type:"color",style:{...ht,padding:2},value:t.strokeColor,onChange:l=>s({...t,strokeColor:l.currentTarget.value})})]}),e.jsx(ie,{label:"Stroke Width",min:0,step:1,value:t.strokeWidth,onValue:l=>s({...t,strokeWidth:l})}),e.jsx(ie,{label:"Stroke Opacity",min:0,max:1,step:.05,value:t.strokeOpacity,onValue:l=>s({...t,strokeOpacity:l})}),e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Dashed"}),e.jsx("input",{type:"checkbox",checked:t.dashed,onChange:l=>s({...t,dashed:l.currentTarget.checked})})]}),t.kind==="roundedRectangle"?e.jsx(ie,{label:"Corner Radius",min:0,max:.5,step:.01,value:t.cornerRadius,onValue:l=>s({...t,cornerRadius:l})}):null,t.kind==="polygon"||t.kind==="star"?e.jsx(ie,{label:t.kind==="star"?"Points":"Sides",min:3,max:12,step:1,value:t.sides,onValue:l=>s({...t,sides:l})}):null,t.kind==="star"?e.jsx(ie,{label:"Inner Radius",min:.05,max:.95,step:.05,value:t.innerRadiusRatio,onValue:l=>s({...t,innerRadiusRatio:l})}):null,t.kind==="line"?e.jsxs(e.Fragment,{children:[e.jsx(ie,{label:"Start X",min:0,max:1,step:.05,value:t.lineStart.x,onValue:l=>s({...t,lineStart:{...t.lineStart,x:l}})}),e.jsx(ie,{label:"Start Y",min:0,max:1,step:.05,value:t.lineStart.y,onValue:l=>s({...t,lineStart:{...t.lineStart,y:l}})}),e.jsx(ie,{label:"End X",min:0,max:1,step:.05,value:t.lineEnd.x,onValue:l=>s({...t,lineEnd:{...t.lineEnd,x:l}})}),e.jsx(ie,{label:"End Y",min:0,max:1,step:.05,value:t.lineEnd.y,onValue:l=>s({...t,lineEnd:{...t.lineEnd,y:l}})})]}):null]}),Dl={enabled:!0,bothHands:!0,visualScale:1,opacity:.92,pointRadius:3,lineWidth:3,labelScale:1.2,smoothing:.35,color:"#22d3ee",showBoundingBox:!0,showLabels:!1,logToConsole:!1},Bl={position:"fixed",left:14,top:104,zIndex:2e4,pointerEvents:"none"},zs={pointerEvents:"auto",width:286,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},Vl={...zs,width:32,height:32,borderRadius:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},Kl={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},Hl={width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},Gl={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},rs={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},_l={display:"grid",gap:6,padding:7},Ul={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Xl={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},Zl={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Yl={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},ql=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),Jl={display:"grid",gap:7,padding:"0 7px 7px"},Ql={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},Fe={display:"flex",flexDirection:"column",gap:4},et={...Fe,gridColumn:"1 / -1"},ne={fontSize:9,color:"rgba(226,232,240,0.72)"},Ve={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},tt={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},st={width:16,height:16},as={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},ei=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2zm0-8h10v2H7V6z"})}),ti=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.3l6.3 6.29 6.29-6.3z"})}),si=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),Wt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2a1 1 0 0 1 1 1v6h1V3a1 1 0 1 1 2 0v6h1V4a1 1 0 1 1 2 0v7.3l1.6 2.4a5 5 0 0 1 .8 2.7V18a4 4 0 0 1-4 4H9a6 6 0 0 1-6-6v-3.5a2.5 2.5 0 0 1 5 0V15h1V3a1 1 0 0 1 1-1z"})}),ni=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5V2L7 7l5 5V9a4 4 0 1 1-4 4H6a6 6 0 1 0 6-8z"})}),li=({value:t,onChange:s})=>{const[l,n]=y.useState(!0),[a,d]=y.useState({x:14,y:104}),[r,o]=y.useState(typeof window>"u"?0:window.innerHeight),[h,x]=y.useState({overlay:!0,visibility:!1}),c=y.useRef(null),p=Math.max(240,r-a.y-16);y.useEffect(()=>{const i=j=>{c.current&&d({x:Math.max(8,j.clientX-c.current.x),y:Math.max(8,j.clientY-c.current.y)})},u=()=>{c.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",i),window.addEventListener("pointerup",u),()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",u)}},[]),y.useEffect(()=>{const i=()=>o(window.innerHeight);return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const f=i=>{const u=i.currentTarget.getBoundingClientRect();c.current={x:i.clientX-u.left,y:i.clientY-u.top},document.body.classList.add("select-none"),i.currentTarget.setPointerCapture(i.pointerId)},g=(i,u,j,w)=>e.jsxs("div",{style:Ul,children:[e.jsxs("div",{style:Xl,children:[e.jsx("button",{type:"button",onClick:()=>x(v=>({...v,[i]:!v[i]})),style:Yl,children:e.jsx("div",{style:ql(h[i])})}),e.jsxs("div",{style:Zl,children:[e.jsx("span",{style:rs,children:j}),e.jsx("span",{children:u})]})]}),h[i]?e.jsx("div",{style:Jl,children:w}):null]},i);return typeof document>"u"?null:Ae.createPortal(e.jsxs("div",{style:{...Bl,left:a.x,top:a.y},children:[e.jsx("style",{children:`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Oe=require("./session-3aCMNb8W.cjs"),Hs=require("./debug-ui/default-setting.cjs"),e=require("react/jsx-runtime"),y=require("react"),Le=require("./renderGroups-B0N58SIA.cjs"),K=require("./index-nRQNXOVk.cjs"),Ae=require("react-dom"),$e=require("./index-J3Qy6hi3.cjs"),Gs=require("three"),J=require("./renderPasses-Bt8k0dkm.cjs"),Ne=require("./settings-C63FMBlF.cjs"),N=require("./FaceRetouch-DHhn1nSV.cjs"),It=require("./landmarkMask-CvN-L5NT.cjs"),_s=require("./index-DzdKBXGE.cjs"),Us=require("./index-LC2Xs08E.cjs"),Zt=require("@react-three/drei"),Xs=require("@react-three/fiber"),Yt=require("./index-jkUdoklh.cjs"),Zs=require("./contexts-CSz9stBV.cjs"),Ys=require("./selectors-Bq6tSgOY.cjs"),qs={position:"fixed",zIndex:2e4,pointerEvents:"none"},kt={width:"100%",maxHeight:"none",border:"none",borderRadius:0,background:"transparent",boxShadow:"none",backdropFilter:"none",WebkitBackdropFilter:"none",overflow:"visible"},js=({docked:t=!1,initialPosition:s,position:l,onPositionChange:n})=>{const[a,d]=y.useState(s),r=l??a,o=y.useRef(null),h=y.useRef(n);return h.current=n,y.useEffect(()=>{if(t)return;const p=g=>{var j;const i=o.current;if(!i)return;const u={x:Math.max(8,g.clientX-i.x),y:Math.max(8,g.clientY-i.y)};d(u),(j=h.current)==null||j.call(h,u)},f=()=>{const g=o.current;g&&(o.current=null,g.selectNone&&document.body.classList.remove("select-none"))};return window.addEventListener("pointermove",p),window.addEventListener("pointerup",f),()=>{window.removeEventListener("pointermove",p),window.removeEventListener("pointerup",f)}},[t]),{docked:t,position:r,startDrag:(p,{capture:f=!0,selectNone:g=!0}={})=>{if(t)return;const i=p.currentTarget.getBoundingClientRect();o.current={x:p.clientX-i.left,y:p.clientY-i.top,selectNone:g},g&&document.body.classList.add("select-none"),f&&p.currentTarget.setPointerCapture(p.pointerId)},place:p=>t?p:typeof document>"u"?null:Ae.createPortal(e.jsx("div",{style:{...qs,left:r.x,top:r.y},children:p}),document.body)}},qt={pointerEvents:"auto",width:306,maxHeight:"calc(100vh - 124px)",borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflow:"hidden"},Js=306,Qs=()=>({x:typeof window>"u"?14:window.innerWidth-(Js+20),y:30}),en={display:"grid",gap:7,padding:"7px 8px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)"},ms={display:"grid",gridTemplateColumns:"16px 22px minmax(0, 1fr) 28px",alignItems:"center",gap:7},tn={...ms,gridTemplateColumns:"22px minmax(0, 1fr) 28px"},sn={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:11,fontWeight:700},nn={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(125,211,252,0.46)",background:"rgba(15,23,42,0.82)",color:"#f8fafc",fontSize:11,fontWeight:700,outline:"none",padding:"0 7px",boxSizing:"border-box"},ln={display:"flex",width:20,height:20,alignItems:"center",justifyContent:"center",borderRadius:7,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0"},on={width:16,height:18,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)"},Jt={display:"grid",gap:8,padding:8,overflowY:"auto",maxHeight:"calc(100vh - 215px)"},rn={display:"grid",gridTemplateColumns:"minmax(0, 1fr) 30px",gap:6},an={width:"100%",height:26,borderRadius:8,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(56,189,248,0.16)",color:"#e0f2fe",fontSize:10.5,fontWeight:700,cursor:"pointer"},dn=t=>({display:"inline-flex",alignItems:"center",justifyContent:"center",width:30,height:26,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",color:t?"#e0f2fe":"rgba(148,163,184,0.72)",background:t?"rgba(56,189,248,0.16)":"rgba(255,255,255,0.04)",cursor:"pointer",padding:0}),cn={display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0},pn={width:"fit-content",maxWidth:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.07)",color:"#e2e8f0",fontSize:10,padding:"0 8px"},hn=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),xn=()=>e.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"m12 2 8 4.6v10.8L12 22l-8-4.6V6.6L12 2zm0 2.3L6.3 7.6 12 10.9l5.7-3.3L12 4.3zM6 9.3v6.9l5 2.9v-6.9L6 9.3zm12 0-5 2.9v6.9l5-2.9V9.3z"})}),un=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5c5 0 8.7 4.2 10 7-1.3 2.8-5 7-10 7s-8.7-4.2-10-7c1.3-2.8 5-7 10-7zm0 2c-3.6 0-6.4 2.7-7.7 5 1.3 2.3 4.1 5 7.7 5s6.4-2.7 7.7-5C18.4 9.7 15.6 7 12 7zm0 2.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"})}),gn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M3.3 2 22 20.7 20.7 22l-3.1-3.1A10.5 10.5 0 0 1 12 20c-5 0-8.7-4.2-10-7a16.4 16.4 0 0 1 4-4.9L2 3.3 3.3 2zm4.1 7.5A14.4 14.4 0 0 0 4.3 13c1.3 2.3 4.1 5 7.7 5 1.5 0 2.8-.5 4-1.2l-2.1-2.1A2.5 2.5 0 0 1 9.3 10L7.4 9.5zM12 4c5 0 8.7 4.2 10 7a15 15 0 0 1-3.2 4.2l-1.4-1.4A13 13 0 0 0 19.7 11C18.4 8.7 15.6 6 12 6c-.9 0-1.8.2-2.6.5L7.8 4.9C9.1 4.3 10.5 4 12 4z"})}),yn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2z"})}),bn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6V5z"})}),fn=async t=>{var l;if((l=navigator.clipboard)!=null&&l.writeText){await navigator.clipboard.writeText(t);return}const s=document.createElement("textarea");s.value=t,s.setAttribute("readonly",""),s.style.position="fixed",s.style.left="-9999px",document.body.appendChild(s),s.select(),document.execCommand("copy"),document.body.removeChild(s)},Ct=({children:t,copyConfig:s,docked:l=!1,initialPosition:n,layer:a="Default Layer",objectId:d,objectName:r,onObjectNameChange:o,onPositionChange:h,onVisibleChange:x,position:c,title:p,visible:f})=>{const{startDrag:g,place:i}=js({docked:l,initialPosition:n??Qs,position:c,onPositionChange:h}),[u,j]=y.useState(!1),[w,v]=y.useState(!0),M=r??p??d??"Scene Object",[U,b]=y.useState(!1),[F,E]=y.useState(M);y.useEffect(()=>{U||E(M)},[M,U]);const P=async()=>{try{await fn(JSON.stringify(s,null,2)),j(!0),window.setTimeout(()=>j(!1),1200)}catch{j(!1)}},le=()=>{const L=F.trim();if(b(!1),!o||!L||L===M){E(M);return}o(L)},ae=()=>{E(M),b(!1)};return i(e.jsxs("div",{style:l?{...qt,...kt}:qt,children:[e.jsxs("div",{style:en,children:[e.jsxs("div",{style:l?tn:ms,children:[!l&&e.jsx("div",{onPointerDown:g,style:on,children:e.jsx(hn,{})}),e.jsx("span",{style:ln,children:e.jsx(xn,{})}),U?e.jsx("input",{autoFocus:!0,"aria-label":"Object Name",style:nn,value:F,onBlur:le,onChange:L=>E(L.currentTarget.value),onKeyDown:L=>{L.key==="Enter"&&le(),L.key==="Escape"&&ae()}}):e.jsx("button",{type:"button",style:{...sn,padding:0,border:0,background:"transparent",color:"inherit",cursor:o?"text":"default",textAlign:"left"},onDoubleClick:()=>{o&&b(!0)},children:M}),e.jsx("button",{type:"button","aria-label":w?"Fold Inspector":"Expand Inspector",title:w?"Fold Inspector":"Expand Inspector",style:cn,onClick:()=>v(L=>!L),children:w?e.jsx(yn,{}):e.jsx(bn,{})})]}),w?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",style:pn,children:a}),e.jsxs("div",{style:rn,children:[e.jsx("button",{type:"button",style:an,onClick:P,children:u?"Copied Config":"Copy Config"}),e.jsx("button",{type:"button",style:dn(f),onClick:()=>x(!f),children:f?e.jsx(un,{}):e.jsx(gn,{})})]})]}):null]}),w?e.jsx("div",{style:l?{...Jt,maxHeight:"none"}:Jt,children:t}):null]}))},jn={clean:{fontWeight:400,strokeLayers:[],shadowLayers:[]},sticker:{color:"#101828",fontWeight:800,strokeLayers:[{color:"#ffffff",width:26,opacity:1},{color:"#101828",width:10,opacity:1}],shadowLayers:[]},"shadow-pop":{color:"#fff8df",fontWeight:800,strokeLayers:[{color:"#101828",width:12,opacity:1}],shadowLayers:[{color:"#0f172a",blur:0,offsetX:18,offsetY:18,opacity:.9},{color:"#0f172a",blur:10,offsetX:10,offsetY:10,opacity:.35}]},neon:{color:"#ffffff",fontWeight:700,strokeLayers:[{color:"#9be7ff",width:8,opacity:.9}],shadowLayers:[{color:"#38bdf8",blur:18,opacity:.8},{color:"#0ea5e9",blur:40,opacity:.7},{color:"#7c3aed",blur:70,opacity:.5}]},editorial:{color:"#f8fafc",fontWeight:500,strokeLayers:[{color:"#0f172a",width:4,opacity:.5}],shadowLayers:[]},"comic-burst":{color:"#fff06a",fontWeight:900,strokeLayers:[{color:"#ef4444",width:28,opacity:1},{color:"#111827",width:12,opacity:1}],shadowLayers:[{color:"#111827",blur:0,offsetX:12,offsetY:12,opacity:.65}]},"ice-outline":{color:"#eff8ff",fontWeight:800,strokeLayers:[{color:"#dbeafe",width:16,opacity:1},{color:"#1d4ed8",width:6,opacity:.95}],shadowLayers:[{color:"#38bdf8",blur:24,opacity:.32}]},"sunset-glow":{color:"#fff7ed",fontWeight:800,strokeLayers:[{color:"#fb7185",width:8,opacity:.95}],shadowLayers:[{color:"#fb7185",blur:18,opacity:.7},{color:"#f97316",blur:42,opacity:.55},{color:"#facc15",blur:70,opacity:.28}]},cutout:{color:"#fffaf0",fontWeight:800,strokeLayers:[{color:"#0f172a",width:6,opacity:.9}],shadowLayers:[{color:"#0f172a",blur:0,offsetX:8,offsetY:8,opacity:.95},{color:"#0f172a",blur:0,offsetX:16,offsetY:16,opacity:.4}]},"badge-arc":{color:"#ffffff",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!1,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"arc",strength:100},strokeLayers:[{color:"#0b1020",width:24,opacity:1},{color:"#ffffff",width:8,opacity:1}],shadowLayers:[{color:"#020617",blur:8,offset:10,angle:-45,feather:.2,opacity:.65}]},"chrome-bulge":{color:"#f8fafc",fontWeight:900,outlineEnabled:!0,shadowEnabled:!1,glowEnabled:!0,innerShadowEnabled:!0,bendEnabled:!0,bend:{preset:"bulge",strength:100},glow:{color:"#dbeafe",style:"contoured",intensity:.55,range:.35,horizontalAngle:0,verticalAngle:0},innerShadow:{color:"#64748b",opacity:.9,offset:16,angle:-45,feather:.25},strokeLayers:[{color:"#0f172a",width:5,opacity:.9}],shadowLayers:[]},"retro-wave":{color:"#fffbeb",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!0,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"wave",strength:100},glow:{color:"#fb7185",style:"outward",intensity:.65,range:.55,horizontalAngle:0,verticalAngle:0},strokeLayers:[{color:"#fb7185",width:12,opacity:1},{color:"#7c2d12",width:5,opacity:.9}],shadowLayers:[{color:"#7c2d12",blur:4,offset:14,angle:45,feather:.1,opacity:.75}]},"flag-pop":{color:"#ffffff",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!0,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"flag",strength:100},glow:{color:"#38bdf8",style:"outward",intensity:.5,range:.45,horizontalAngle:.15,verticalAngle:-.1},strokeLayers:[{color:"#fde047",width:18,opacity:1},{color:"#111827",width:7,opacity:1}],shadowLayers:[{color:"#111827",blur:0,offset:14,angle:35,feather:0,opacity:.75}]},"fisheye-poster":{color:"#fff7ed",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!1,innerShadowEnabled:!0,bendEnabled:!0,bend:{preset:"fisheye",strength:100},innerShadow:{color:"#92400e",opacity:.55,offset:10,angle:-45,feather:.15},strokeLayers:[{color:"#020617",width:24,opacity:1},{color:"#f97316",width:8,opacity:.9}],shadowLayers:[{color:"#020617",blur:0,offset:12,angle:40,feather:0,opacity:.8}]}},mn=[{label:"Space Grotesk",value:'"Space Grotesk", sans-serif'},{label:"Bebas Neue",value:'"Bebas Neue", sans-serif'},{label:"DM Serif Display",value:'"DM Serif Display", serif'},{label:"Caveat",value:'"Caveat", cursive'}],Sn=["clean","sticker","shadow-pop","neon","editorial","comic-burst","ice-outline","sunset-glow","cutout","badge-arc","chrome-bulge","retro-wave","flag-pop","fisheye-poster"],vn={clean:"NONE",sticker:"sticker","shadow-pop":"shadow-pop",neon:"neon",editorial:"editorial","comic-burst":"comic-burst","ice-outline":"ice-outline","sunset-glow":"sunset-glow",cutout:"cutout","badge-arc":"badge-arc","chrome-bulge":"chrome-bulge","retro-wave":"retro-wave","flag-pop":"flag-pop","fisheye-poster":"fisheye-poster"},wn=()=>({color:"#000000",opacity:1,width:30}),Bt=()=>({color:"#000000",opacity:1,offset:10,angle:-45,feather:0,blur:0,offsetX:7.071,offsetY:-7.071}),Ss=()=>({color:"#ffffff",style:"outward",intensity:.5,range:.5,horizontalAngle:0,verticalAngle:0}),vs=()=>({preset:"arc",strength:100}),kn=[{label:"Arc",value:"arc"},{label:"Arc Lower",value:"arc-lower"},{label:"Arc Upper",value:"arc-upper"},{label:"Arch",value:"arch"},{label:"Bulge",value:"bulge"},{label:"Shell Lower",value:"shell-lower"},{label:"Shell Upper",value:"shell-upper"},{label:"Flag",value:"flag"},{label:"Wave",value:"wave"},{label:"Fish",value:"fish"},{label:"Rise",value:"rise"},{label:"Fisheye",value:"fisheye"},{label:"Inflate",value:"inflate"},{label:"Squeeze",value:"squeeze"},{label:"Twist",value:"twist"}],Cn=(t,s)=>{const l=jn[s],n=l.strokeLayers??t.style.strokeLayers,a=l.shadowLayers??t.style.shadowLayers;return{...t,textArtPreset:s,style:{...t.style,...l,fontWeight:t.style.bold?"bold":l.fontWeight??t.style.fontWeight,background:{...t.style.background,...l.background},outlineEnabled:l.strokeLayers?l.strokeLayers.length>0:t.style.outlineEnabled,shadowEnabled:l.shadowLayers?l.shadowLayers.length>0:t.style.shadowEnabled,strokeLayers:n,shadowLayers:a}}},ws=(t,s)=>({enabled:(s==null?void 0:s.enabled)??t.enabled,showGuides:(s==null?void 0:s.showTransformGuides)??t.showTransformGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:(s==null?void 0:s.position)??t.position,size:(s==null?void 0:s.size)??t.size,rotation:(s==null?void 0:s.rotation)??t.rotation,scale2D:s==null?void 0:s.scale2D,referencePixelsPerUnit:s==null?void 0:s.referencePixelsPerUnit,pivot:(s==null?void 0:s.pivot)??t.pivot,renderOrder:(s==null?void 0:s.renderOrder)??t.renderOrder,overlay:(s==null?void 0:s.overlay)??t.overlay,visible:(s==null?void 0:s.visible)??t.visible}),Rn=(t,s)=>({...s,enabled:t.enabled,showTransformGuides:t.showGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:t.position,size:t.size,rotation:t.rotation,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),ks=(t,s)=>({...$e.DEFAULT_SCREEN_TRANSFORM_2D,...s,enabled:t.enabled,showTransformGuides:t.showGuides,position:t.position,size:t.size,rotation:t.rotation,scale2D:t.scale2D??(s==null?void 0:s.scale2D)??$e.DEFAULT_SCREEN_TRANSFORM_2D.scale2D,referencePixelsPerUnit:t.referencePixelsPerUnit??(s==null?void 0:s.referencePixelsPerUnit)??$e.DEFAULT_SCREEN_TRANSFORM_2D.referencePixelsPerUnit,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),In={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},En={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Tn={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},zn={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Mn={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Fn=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),Wn={display:"grid",gap:7,padding:"0 7px 7px"},me={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},k={display:"flex",flexDirection:"column",gap:4},ee={...k,gridColumn:"1 / -1"},Ln={gridColumn:"1 / -1",display:"grid",gap:6,padding:"8px 8px 2px 12px",marginTop:-2,borderLeft:"1px solid rgba(255,255,255,0.10)"},$n={display:"flex",alignItems:"center",justifyContent:"space-between",gap:6,width:"100%",padding:0,border:0,background:"transparent",fontSize:9,color:"rgba(226,232,240,0.64)",textTransform:"uppercase",cursor:"pointer"},Nn={display:"flex",alignItems:"center",gap:6,minWidth:0},On={width:16,height:16,borderRadius:999,display:"inline-flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.06)",color:"rgba(226,232,240,0.72)",flex:"0 0 auto"},S={fontSize:9,color:"rgba(226,232,240,0.72)"},Kt={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},An={...Kt,height:72,padding:"7px",resize:"vertical",lineHeight:1.35,fontFamily:"inherit"},je={...Kt,padding:2,cursor:"pointer"},xe={...Kt,appearance:"none"},Pn={opacity:.45,cursor:"not-allowed"},ue={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},gt={width:16,height:16},Dn={display:"grid",gridTemplateColumns:"1.25fr repeat(4, 1fr)",gap:4,width:"100%"},Je=t=>({height:26,borderRadius:8,border:t?"1px solid rgba(125,211,252,0.72)":"1px solid rgba(255,255,255,0.10)",background:t?"rgba(56,189,248,0.20)":"rgba(255,255,255,0.05)",color:t?"#f0f9ff":"#e2e8f0",fontSize:10.5,fontWeight:700,cursor:"pointer",padding:"0 6px"}),wt={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"};function Bn({label:t,icon:s,open:l,onToggle:n,children:a}){return e.jsxs("div",{style:En,children:[e.jsxs("div",{style:Tn,children:[e.jsx("button",{type:"button",onClick:n,style:Mn,children:e.jsx("div",{style:Fn(l)})}),e.jsxs("div",{style:zn,children:[e.jsx("span",{style:In,children:s}),e.jsx("span",{children:t})]})]}),l?e.jsx("div",{style:Wn,children:a}):null]})}const Qt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M4 6V4h16v2h-7v14h-2V6H4z"})}),es=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 3a9 9 0 1 0 0 18h1.2a2.8 2.8 0 0 0 0-5.6h-.4a1.8 1.8 0 0 1 0-3.6H16a5 5 0 0 0 0-10h-4zm-4 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm1 5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm6-7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z"})}),Vn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M4 4h6v2H7.4l3.3 3.3-1.4 1.4L6 7.4V10H4V4zm10 0h6v6h-2V7.4l-3.3 3.3-1.4-1.4L16.6 6H14V4zM9.3 13.3l1.4 1.4L7.4 18H10v2H4v-6h2v2.6l3.3-3.3zm5.4 0 3.3 3.3V14h2v6h-6v-2h2.6l-3.3-3.3 1.4-1.4z"})}),Kn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 5h10v2H9v6h8v2H7V5zm4 8h6v6h-6v-2h4v-2h-4v-2z"})});function Hn({value:t,onChange:s}){return e.jsxs("div",{style:me,children:[e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Text"}),e.jsx("textarea",{style:An,value:t.content.text,onChange:l=>s(n=>({...n,content:{...n.content,text:l.target.value}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Text Art"}),e.jsx("select",{style:xe,value:t.textArtPreset,onChange:l=>s(n=>Cn(n,l.target.value)),children:Sn.map(l=>e.jsx("option",{value:l,children:vn[l]},l))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Font"}),e.jsx("select",{style:xe,value:t.style.fontFamily,onChange:l=>s(n=>({...n,style:{...n.style,fontFamily:l.target.value}})),children:mn.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value))})]})]})}const Gn={width:"100%",boxSizing:"border-box",border:"1px solid rgba(148,163,184,0.22)",borderRadius:8,background:"rgba(15,23,42,0.8)",color:"#e2e8f0",padding:"7px 9px"},_n=t=>/^-?\d*(\.\d*)?$/.test(t),z=({value:t,onChange:s,step:l=1,min:n,max:a,disabled:d=!1})=>{const[r,o]=y.useState(String(t));y.useEffect(()=>o(String(t)),[t]);const h=x=>Math.min(typeof a=="number"?a:1/0,Math.max(typeof n=="number"?n:-1/0,x));return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:{...Gn,...d?{cursor:"not-allowed",opacity:.45}:{}},value:r,disabled:d,onChange:x=>{if(d)return;const c=x.target.value;if(!_n(c)||(o(c),["","-",".","-."].includes(c)))return;const p=Number(c);Number.isNaN(p)||s(h(p))},onBlur:()=>{if(d)return;const x=Number(r);if(Number.isNaN(x))return o(String(t));const c=h(x);o(String(c)),s(c)},onKeyDown:x=>{if(d||x.key!=="ArrowUp"&&x.key!=="ArrowDown")return;x.preventDefault();const c=x.shiftKey?l*10:x.altKey?l/10:l,p=x.key==="ArrowUp"?t+c:t-c;s(h(Number.isInteger(p)?p:Number(p.toFixed(6))))}})};function Un({background:t,onChange:s}){return e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Fill Mode"}),e.jsxs("select",{style:xe,value:t.fillMode,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,fillMode:l.target.value}}})),children:[e.jsx("option",{value:"solid",children:"solid"}),e.jsx("option",{value:"gradient",children:"gradient"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Fill Area"}),e.jsxs("select",{style:xe,value:t.fit,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,fit:l.target.value}}})),children:[e.jsx("option",{value:"text",children:"text"}),e.jsx("option",{value:"full",children:"full"})]})]}),t.fillMode==="solid"?e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Background Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,color:l.target.value}}}))})]}):e.jsx("div",{style:{gridColumn:"1 / -1",display:"grid",gap:6},children:t.gradientStops.slice(0,3).map((l,n)=>e.jsxs("label",{style:k,children:[e.jsxs("span",{style:S,children:["Gradient ",n+1]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 60px",gap:4},children:[e.jsx("input",{style:je,type:"color",value:l.color,onChange:a=>s(d=>{const r=[...d.style.background.gradientStops];return r[n]={...r[n],color:a.target.value},{...d,style:{...d.style,background:{...d.style.background,gradientStops:r}}}})}),e.jsx(z,{value:l.position,min:0,max:1,step:.05,onChange:a=>s(d=>{const r=[...d.style.background.gradientStops];return r[n]={...r[n],position:a},{...d,style:{...d.style,background:{...d.style.background,gradientStops:r}}}})})]})]},n))}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Background Opacity"}),e.jsx(z,{value:t.opacity,min:0,max:1,step:.05,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,opacity:l}}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Corner Radius"}),e.jsx(z,{value:t.borderRadius,min:0,max:200,step:2,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,borderRadius:l}}}))})]})]})}function Xn({background:t,onChange:s}){return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:"Auto Width / Height"}),e.jsx("input",{type:"checkbox",style:gt,checked:t.autoSize,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,autoSize:l.target.checked}}}))})]})}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Width"}),e.jsx(z,{value:t.width,min:32,max:1024,step:8,disabled:t.autoSize,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,width:l}}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Height"}),e.jsx(z,{value:t.height,min:32,max:1024,step:8,disabled:t.autoSize,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,height:l}}}))})]})]})}function Zn({background:t,onChange:s}){return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:"Background Stroke"}),e.jsx("input",{type:"checkbox",style:gt,checked:t.borderEnabled,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,borderEnabled:l.target.checked,borderColor:l.target.checked&&n.style.background.borderColor==="transparent"?"#ffffff":n.style.background.borderColor,borderWidth:l.target.checked?Math.max(n.style.background.borderWidth,2):n.style.background.borderWidth}}}))})]})}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Stroke Color"}),e.jsx("input",{style:{...je,...t.borderEnabled?{}:Pn},type:"color",value:t.borderColor,disabled:!t.borderEnabled,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,borderColor:l.target.value}}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Stroke Width"}),e.jsx(z,{value:t.borderWidth,min:0,max:64,step:1,disabled:!t.borderEnabled,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,borderWidth:l}}}))})]})]})}const Cs={gridColumn:"1 / -1",display:"grid",gap:6,padding:"8px",borderRadius:10,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)"};function yt({checked:t,label:s,onChange:l}){return e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:s}),e.jsx("input",{type:"checkbox",style:gt,checked:t,onChange:n=>l(n.target.checked)})]})})}function Xe({children:t,label:s,open:l,setOpen:n}){return e.jsxs("div",{style:Ln,children:[e.jsxs("button",{type:"button",style:$n,onClick:()=>n(a=>!a),children:[e.jsxs("span",{style:Nn,children:[e.jsx(Kn,{}),e.jsx("span",{children:s})]}),e.jsx("span",{style:On,children:l?"−":"+"})]}),l?t:null]})}function Yn({value:t,onChange:s,open:l,setOpen:n}){const a=t.style.background;return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:"Background Enabled"}),e.jsx("input",{type:"checkbox",style:gt,checked:a.enabled,onChange:d=>s(r=>({...r,style:{...r.style,background:{...r.style.background,enabled:d.target.checked}}}))})]})}),a.enabled?e.jsx(Xe,{label:"Background Settings",open:l,setOpen:n,children:e.jsxs(e.Fragment,{children:[e.jsx(Un,{background:a,onChange:s}),e.jsx(Zn,{background:a,onChange:s}),e.jsx(Xn,{background:a,onChange:s})]})}):null]})}function qn({bend:t,open:s,onChange:l,setOpen:n,value:a}){const d=r=>l(o=>({...o,style:{...o.style,bend:{...o.style.bend??t,...r}}}));return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Bend",checked:a.style.bendEnabled===!0,onChange:r=>l(o=>({...o,style:{...o.style,bendEnabled:r,bend:o.style.bend??vs()}}))}),a.style.bendEnabled===!0?e.jsx(Xe,{label:"Bend",open:s,setOpen:n,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Bend Preset"}),e.jsx("select",{style:xe,value:t.preset,onChange:r=>d({preset:r.target.value}),children:kn.map(r=>e.jsx("option",{value:r.value,children:r.label},r.value))})]}),e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Bend Strength"}),e.jsx(z,{value:t.strength,min:-100,max:100,step:1,onChange:r=>d({strength:r})})]})]})}):null]})}function Jn({glow:t,open:s,onChange:l,setOpen:n,value:a}){const d=r=>l(o=>({...o,style:{...o.style,glow:{...o.style.glow??t,...r}}}));return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Glow",checked:a.style.glowEnabled===!0,onChange:r=>l(o=>({...o,style:{...o.style,glowEnabled:r,glow:o.style.glow??Ss()}}))}),a.style.glowEnabled===!0?e.jsx(Xe,{label:"Glow",open:s,setOpen:n,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:r=>d({color:r.target.value})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Style"}),e.jsxs("select",{style:xe,value:t.style,onChange:r=>d({style:r.target.value}),children:[e.jsx("option",{value:"outward",children:"Outward"}),e.jsx("option",{value:"contoured",children:"Contoured"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Intensity"}),e.jsx(z,{value:t.intensity??.5,min:0,max:1,step:.05,onChange:r=>d({intensity:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Range"}),e.jsx(z,{value:t.range??.5,min:0,max:1,step:.05,onChange:r=>d({range:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Horizontal Angle"}),e.jsx(z,{value:t.horizontalAngle??0,min:-.5,max:.5,step:.05,onChange:r=>d({horizontalAngle:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Vertical Angle"}),e.jsx(z,{value:t.verticalAngle??0,min:-.5,max:.5,step:.05,onChange:r=>d({verticalAngle:r})})]})]})}):null]})}const Qn={color:"#000000",opacity:1,offset:10,angle:-45,feather:0};function el({innerShadow:t,open:s,onChange:l,setOpen:n,value:a}){const d=r=>l(o=>({...o,style:{...o.style,innerShadow:{...o.style.innerShadow??t,...r}}}));return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Inner Shadow",checked:a.style.innerShadowEnabled===!0,onChange:r=>l(o=>({...o,style:{...o.style,innerShadowEnabled:r,innerShadow:o.style.innerShadow??Qn}}))}),a.style.innerShadowEnabled===!0?e.jsx(Xe,{label:"Inner Shadow",open:s,setOpen:n,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:r=>d({color:r.target.value})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Opacity"}),e.jsx(z,{value:t.opacity??1,min:0,max:1,step:.05,onChange:r=>d({opacity:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Offset"}),e.jsx(z,{value:t.offset??10,min:0,max:100,step:1,onChange:r=>d({offset:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Angle"}),e.jsx(z,{value:t.angle??-45,min:-180,max:180,step:1,onChange:r=>d({angle:r})})]}),e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Shadow Feather"}),e.jsx(z,{value:t.feather??0,min:0,max:1,step:.05,onChange:r=>d({feather:r})})]})]})}):null]})}function tl({layers:t,open:s,onChange:l,setOpen:n,value:a}){const d=(r,o)=>l(h=>{const x=[...h.style.strokeLayers??[]];return x[r]={...x[r],...o},{...h,style:{...h.style,strokeLayers:x}}});return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Outline",checked:a.style.outlineEnabled!==!1,onChange:r=>l(o=>({...o,style:{...o.style,outlineEnabled:r}}))}),a.style.outlineEnabled!==!1?e.jsx(Xe,{label:"Outline Editor",open:s,setOpen:n,children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{...ue,gridColumn:"1 / -1"},children:[e.jsxs("span",{style:S,children:["Layers: ",t.length]}),e.jsx("button",{type:"button",style:wt,onClick:()=>l(r=>({...r,style:{...r.style,strokeLayers:[...r.style.strokeLayers??[],wn()]}})),children:"+"})]}),t.length>0?t.map((r,o)=>e.jsxs("div",{style:Cs,children:[e.jsxs("div",{style:ue,children:[e.jsxs("span",{style:S,children:["Outline ",o+1]}),e.jsx("button",{type:"button",style:wt,onClick:()=>l(h=>({...h,style:{...h.style,strokeLayers:(h.style.strokeLayers??[]).filter((x,c)=>c!==o)}})),children:"×"})]}),e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Outline Color"}),e.jsx("input",{style:je,type:"color",value:r.color,onChange:h=>d(o,{color:h.target.value})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Outline Opacity"}),e.jsx(z,{value:r.opacity??1,min:0,max:1,step:.05,onChange:h=>d(o,{opacity:h})})]}),e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Outline Size"}),e.jsx(z,{value:r.width,min:0,max:100,step:1,onChange:h=>d(o,{width:h})})]})]})]},o)):e.jsx("div",{style:{...S,gridColumn:"1 / -1"},children:"No outlines. Use `+` to add one."})]})}):null]})}function sl({layers:t,open:s,onChange:l,setOpen:n,value:a}){const d=(r,o)=>l(h=>{const x=[...h.style.shadowLayers??[]];return x[r]={...x[r],...o},{...h,style:{...h.style,shadowLayers:x}}});return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Outer Shadow",checked:a.style.shadowEnabled!==!1,onChange:r=>l(o=>{var h;return{...o,style:{...o.style,shadowEnabled:r,shadowLayers:r&&(((h=o.style.shadowLayers)==null?void 0:h.length)??0)===0?[Bt()]:o.style.shadowLayers}}})}),a.style.shadowEnabled!==!1?e.jsx(Xe,{label:"Shadow Editor",open:s,setOpen:n,children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{...ue,gridColumn:"1 / -1"},children:[e.jsxs("span",{style:S,children:["Layers: ",t.length]}),e.jsx("button",{type:"button",style:wt,onClick:()=>l(r=>({...r,style:{...r.style,shadowLayers:[...r.style.shadowLayers??[],Bt()]}})),children:"+"})]}),t.length>0?t.map((r,o)=>e.jsxs("div",{style:Cs,children:[e.jsxs("div",{style:ue,children:[e.jsxs("span",{style:S,children:["Shadow ",o+1]}),e.jsx("button",{type:"button",style:wt,onClick:()=>l(h=>({...h,style:{...h.style,shadowLayers:(h.style.shadowLayers??[]).filter((x,c)=>c!==o)}})),children:"×"})]}),e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Color"}),e.jsx("input",{style:je,type:"color",value:r.color,onChange:h=>d(o,{color:h.target.value})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Opacity"}),e.jsx(z,{value:r.opacity??1,min:0,max:1,step:.05,onChange:h=>d(o,{opacity:h})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Offset"}),e.jsx(z,{value:r.offset??10,min:0,max:100,step:1,onChange:h=>d(o,{offset:h})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Angle"}),e.jsx(z,{value:r.angle??-45,min:-180,max:180,step:1,onChange:h=>d(o,{angle:h})})]}),e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Shadow Feather"}),e.jsx(z,{value:r.feather??0,min:0,max:1,step:.05,onChange:h=>d(o,{feather:h})})]})]})]},o)):e.jsx("div",{style:{...S,gridColumn:"1 / -1"},children:"No outer shadows. Use `+` to add one."})]})}):null]})}function nl({backgroundSettingsOpen:t,bend:s,bendSettingsOpen:l,glow:n,glowSettingsOpen:a,innerShadow:d,innerShadowSettingsOpen:r,onChange:o,outlineLayers:h,outlineSettingsOpen:x,setBackgroundSettingsOpen:c,setBendSettingsOpen:p,setGlowSettingsOpen:f,setInnerShadowSettingsOpen:g,setOutlineSettingsOpen:i,setShadowSettingsOpen:u,shadowLayers:j,shadowSettingsOpen:w,value:v}){return e.jsxs("div",{style:me,children:[e.jsx(tl,{value:v,onChange:o,layers:h,open:x,setOpen:i}),e.jsx(sl,{value:v,onChange:o,layers:j,open:w,setOpen:u}),e.jsx(el,{value:v,onChange:o,innerShadow:d,open:a,setOpen:f}),e.jsx(Jn,{value:v,onChange:o,glow:n,open:r,setOpen:g}),e.jsx(qn,{value:v,onChange:o,bend:s,open:l,setOpen:p}),e.jsx(Yn,{value:v,onChange:o,open:t,setOpen:c})]})}function ll({value:t,onChange:s}){const l=t.style.bold===!0||t.style.fontStyle==="italic"||t.style.underline===!0||t.style.strikethrough===!0;return e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Text Color"}),e.jsx("input",{style:je,type:"color",value:t.style.color,onChange:n=>s(a=>({...a,style:{...a.style,color:n.target.value}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Font Size"}),e.jsx(z,{value:t.style.fontSize,min:16,max:180,step:4,onChange:n=>s(a=>({...a,layout:{...a.layout,minFontSize:Math.min(a.layout.minFontSize??n,n)},style:{...a.style,fontSize:n}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Letter Spacing"}),e.jsx(z,{value:t.style.letterSpacing,min:0,max:1,step:.05,onChange:n=>s(a=>({...a,style:{...a.style,letterSpacing:n}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Line Spacing"}),e.jsx(z,{value:t.style.lineSpacing,min:0,max:1,step:.05,onChange:n=>s(a=>({...a,style:{...a.style,lineSpacing:n}}))})]}),e.jsxs("div",{style:ee,children:[e.jsx("span",{style:S,children:"Text Style"}),e.jsxs("div",{style:Dn,children:[e.jsx("button",{type:"button",style:Je(!l),onClick:()=>s(n=>({...n,style:{...n.style,bold:!1,fontWeight:n.style.fontWeight==="bold"?"normal":n.style.fontWeight,fontStyle:"normal",underline:!1,strikethrough:!1}})),children:"None"}),e.jsx("button",{type:"button",style:Je(t.style.bold===!0),onClick:()=>s(n=>({...n,style:{...n.style,bold:n.style.bold!==!0,fontWeight:n.style.bold!==!0?"bold":400}})),children:"B"}),e.jsx("button",{type:"button",style:Je(t.style.fontStyle==="italic"),onClick:()=>s(n=>({...n,style:{...n.style,fontStyle:n.style.fontStyle==="italic"?"normal":"italic"}})),children:"I"}),e.jsx("button",{type:"button",style:Je(t.style.underline===!0),onClick:()=>s(n=>({...n,style:{...n.style,underline:n.style.underline!==!0}})),children:"U"}),e.jsx("button",{type:"button",style:Je(t.style.strikethrough===!0),onClick:()=>s(n=>({...n,style:{...n.style,strikethrough:n.style.strikethrough!==!0}})),children:"S"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Horizontal Alignment"}),e.jsxs("select",{style:xe,value:t.layout.textAlign??"center",onChange:n=>s(a=>({...a,layout:{...a.layout,textAlign:n.target.value}})),children:[e.jsx("option",{value:"left",children:"left"}),e.jsx("option",{value:"center",children:"center"}),e.jsx("option",{value:"right",children:"right"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Vertical Alignment"}),e.jsxs("select",{style:xe,value:t.layout.verticalAlign??"center",onChange:n=>s(a=>({...a,layout:{...a.layout,verticalAlign:n.target.value}})),children:[e.jsx("option",{value:"top",children:"top"}),e.jsx("option",{value:"center",children:"center"}),e.jsx("option",{value:"bottom",children:"bottom"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Overflow"}),e.jsxs("select",{style:xe,value:t.layout.overflow,onChange:n=>s(a=>({...a,layout:{...a.layout,overflow:n.target.value}})),children:[e.jsx("option",{value:"clip",children:"Clip text"}),e.jsx("option",{value:"ellipsis",children:"Show ellipsis"}),e.jsx("option",{value:"clamp",children:"Clamp"}),e.jsx("option",{value:"shrink",children:"Shrink"})]})]}),e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:"Resize To Fit"}),e.jsx("input",{type:"checkbox",style:gt,checked:t.layout.resizeToFit===!0,onChange:n=>s(a=>({...a,layout:{...a.layout,resizeToFit:n.target.checked}}))})]})})]})}const il={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},re={display:"flex",flexDirection:"column",gap:4},Et={...re,gridColumn:"1 / -1"},Y={fontSize:9,color:"rgba(226,232,240,0.72)"},ol={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},rl={...ol,fontVariantNumeric:"tabular-nums"},al={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},dl={width:16,height:16},cl=t=>/^-?\d*(\.\d*)?$/.test(t),se=({value:t,onChange:s,step:l=1,min:n,max:a,disabled:d=!1})=>{const[r,o]=y.useState(String(t));y.useEffect(()=>o(String(t)),[t]);const h=x=>{let c=x;return typeof n=="number"&&(c=Math.max(n,c)),typeof a=="number"&&(c=Math.min(a,c)),c};return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:rl,value:r,disabled:d,onChange:x=>{const c=x.target.value;if(!cl(c)||(o(c),c===""||c==="-"||c==="."||c==="-."))return;const p=Number(c);Number.isNaN(p)||s(h(p))},onBlur:()=>{const x=Number(r);if(Number.isNaN(x)){o(String(t));return}const c=h(x);o(String(c)),s(c)},onKeyDown:x=>{if(x.key!=="ArrowUp"&&x.key!=="ArrowDown")return;x.preventDefault();const c=x.shiftKey?l*10:x.altKey?l/10:l,p=x.key==="ArrowUp"?t+c:t-c;s(h(Number.isInteger(p)?p:Number(p.toFixed(6))))}})},Ht=({value:t,onChange:s,guideLabel:l,showRenderOrder:n=!0})=>{var a,d;return e.jsxs("div",{style:il,children:[e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Position X"}),e.jsx(se,{value:t.position.x,min:-4096,max:4096,step:1,onChange:r=>s({...t,position:{...t.position,x:r}})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Position Y"}),e.jsx(se,{value:t.position.y,min:-4096,max:4096,step:1,onChange:r=>s({...t,position:{...t.position,y:r}})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Size X"}),e.jsx(se,{value:t.size.width,min:0,max:8192,step:1,onChange:r=>s({...t,size:{...t.size,width:r}})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Size Y"}),e.jsx(se,{value:t.size.height,min:0,max:8192,step:1,onChange:r=>s({...t,size:{...t.size,height:r}})})]}),e.jsxs("label",{style:Et,children:[e.jsx("span",{style:Y,children:"Rotation"}),e.jsx(se,{value:t.rotation,min:-360,max:360,step:1,onChange:r=>s({...t,rotation:r})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Scale 2D X"}),e.jsx(se,{value:((a=t.scale2D)==null?void 0:a.x)??1,min:-10,max:10,step:.01,onChange:r=>{var o;return s({...t,scale2D:{x:r,y:((o=t.scale2D)==null?void 0:o.y)??1}})}})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Scale 2D Y"}),e.jsx(se,{value:((d=t.scale2D)==null?void 0:d.y)??1,min:-10,max:10,step:.01,onChange:r=>{var o;return s({...t,scale2D:{x:((o=t.scale2D)==null?void 0:o.x)??1,y:r}})}})]}),e.jsxs("label",{style:Et,children:[e.jsx("span",{style:Y,children:"Reference Pixels Per Unit"}),e.jsx(se,{value:t.referencePixelsPerUnit??32,min:1,max:512,step:1,onChange:r=>s({...t,referencePixelsPerUnit:r})})]}),n?e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Render Order"}),e.jsx(se,{value:t.renderOrder,min:-9999,max:9999,step:1,onChange:r=>s({...t,renderOrder:r})})]}):null,e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Pivot X"}),e.jsx(se,{value:t.pivot[0],min:0,max:1,step:.01,onChange:r=>s({...t,pivot:[r,t.pivot[1]]})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Pivot Y"}),e.jsx(se,{value:t.pivot[1],min:0,max:1,step:.01,onChange:r=>s({...t,pivot:[t.pivot[0],r]})})]}),e.jsx("label",{style:Et,children:e.jsxs("div",{style:al,children:[e.jsx("span",{style:Y,children:l}),e.jsx("input",{type:"checkbox",style:dl,checked:t.showGuides,onChange:r=>s({...t,showGuides:r.target.checked})})]})})]})};function pl({value:t,onChange:s}){return e.jsx(Ht,{value:ws(t.transformation,t.screenTransform),guideLabel:"Transform Control On",showRenderOrder:!1,onChange:l=>s(n=>({...n,transformation:Rn(l,n.transformation),screenTransform:ks(l,n.screenTransform)}))})}const hl=({value:t,onChange:s,copyLabel:l,inspector:n,docked:a})=>{var Ze;const[d,r]=y.useState(()=>K.createSceneObject({name:l??"Screen Text",renderGroupId:Le.DEFAULT_RENDER_GROUP_IDS.screen2d})),[o]=y.useState(()=>{const $=d.id,Z=K.createDefaultComponent("ScreenTransform",$),m=K.createDefaultComponent("ScreenText",$),R=K.createDefaultComponent("Material",$),D=K.createDefaultComponent("Texture",$);return{screenTransform:Z,screenText:m,material:R,texture:D}}),[h,x]=y.useState(!0),[c,p]=y.useState(!0),[f,g]=y.useState(!0),[i,u]=y.useState(!0),[j,w]=y.useState(!0),[v,M]=y.useState(!0),[U,b]=y.useState({text2d:!0,content:!0,transformation:!0,style:!0,textEffect:!0}),F=ws(t.screenText.transformation,t.screenText.screenTransform),E={object:{...d,componentIds:[o.screenTransform.id,o.screenText.id,o.material.id,o.texture.id]},kind:"screenText",components:[{...o.screenTransform,settings:t.screenText.screenTransform??ks(F)},{...o.screenText,settings:t.screenText},{...o.material,settings:{...o.material.settings,color:t.screenText.style.color,opacity:t.screenText.style.opacity}},{...o.texture,settings:{...o.texture.settings,url:t.screenText.style.background.textureUrl,flipX:t.screenText.style.background.textureFlipX,flipY:t.screenText.style.background.textureFlipY}}],scene:{screenSpaceUI:t.screenSpaceUI}},P=$=>{s({...t,screenText:$(t.screenText)})},le=t.screenText.style.strokeLayers??[],ae=t.screenText.style.shadowEnabled!==!1&&(((Ze=t.screenText.style.shadowLayers)==null?void 0:Ze.length)??0)===0?[Bt()]:t.screenText.style.shadowLayers??[],L=t.screenText.style.innerShadow??{color:"#000000",opacity:1,offset:10,angle:-45,feather:0},Pe=t.screenText.style.glow??Ss(),De=t.screenText.style.bend??vs(),W=$=>b(Z=>({...Z,[$]:!Z[$]})),ve=($,Z,m,R)=>e.jsx(Bn,{label:Z,icon:m,open:U[$],onToggle:()=>W($),children:R},$);return e.jsxs(Ct,{objectId:(n==null?void 0:n.objectId)??d.id,objectName:(n==null?void 0:n.objectName)??d.name,onObjectNameChange:(n==null?void 0:n.onObjectNameChange)??($=>r(Z=>({...Z,name:$}))),layer:(n==null?void 0:n.layer)??"Default Layer",visible:(n==null?void 0:n.visible)??t.screenText.enabled,onVisibleChange:(n==null?void 0:n.onVisibleChange)??($=>P(Z=>({...Z,enabled:$}))),copyConfig:(n==null?void 0:n.copyConfig)??E,docked:a??(n==null?void 0:n.docked),initialPosition:n==null?void 0:n.initialPosition,position:n==null?void 0:n.position,onPositionChange:n==null?void 0:n.onPositionChange,title:n==null?void 0:n.title,children:[ve("transformation","Transformation",e.jsx(Vn,{}),e.jsx(pl,{value:t.screenText,onChange:P})),ve("text2d","2D Text",e.jsx(Qt,{}),e.jsxs(e.Fragment,{children:[ve("content","Content",e.jsx(Qt,{}),e.jsx(Hn,{value:t.screenText,onChange:P})),ve("style","Style",e.jsx(es,{}),e.jsx(ll,{value:t.screenText,onChange:P})),ve("textEffect","Text Effect",e.jsx(es,{}),e.jsx(nl,{value:t.screenText,onChange:P,outlineLayers:le,shadowLayers:ae,innerShadow:L,glow:Pe,bend:De,outlineSettingsOpen:h,setOutlineSettingsOpen:x,shadowSettingsOpen:c,setShadowSettingsOpen:p,innerShadowSettingsOpen:f,setInnerShadowSettingsOpen:g,glowSettingsOpen:i,setGlowSettingsOpen:u,bendSettingsOpen:j,setBendSettingsOpen:w,backgroundSettingsOpen:v,setBackgroundSettingsOpen:M}))]}))]})},xl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAUAAgMAAAAToI2uAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAlQTFRFqampbGxsAAAA/lGquwAAAAN0Uk5T//8A18oNQQAABPRJREFUeJztzssNQWEYQEG3CP1oQqJGsdCfBFs7j8X8+eRMBbPtBtpWB35RWimtlFZKK6WV0kppZWj6uLrwrceltFFaKa2UVkorpZXSSmlldPp2XT350P5Q2iitlFZKK6WV0kpppbRSWimtlFZKK3+RPq8OvXM/lTZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK3+THqG0UloprZRWSiulldJKaaW0UloprZRWSiuv6VFKK6WV0kpppbRSWimtlFbGpgcqrZRWSiulldJKaaW0MjL9BFWtRqVFuJpUAAAAAElFTkSuQmCC",ul={placeholder:"Placeholder","hero-image":"Hero Image","photo-frame":"Default Frame"},gl=Object.entries(ul).map(([t,s])=>({value:t,label:s})),yl={placeholder:{transformation:{showFitGuides:!1},image:{sourceKind:"default",stretchMode:"fit",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}},"hero-image":{transformation:{position:{x:0,y:.08},size:{width:.96,height:.62},rotation:0,pivot:[.5,.5],overlay:!0,visible:!0},image:{sourceKind:"image",stretchMode:"fillAndCut",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}},"photo-frame":{transformation:{position:{x:0,y:.01},size:{width:2,height:2},rotation:0,pivot:[.5,.5],overlay:!0,visible:!0},image:{sourceKind:"image",src:xl,stretchMode:"fill",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}}},bl=(t,s)=>{const l=yl[s];return{...t,preset:s,...l.enabled!==void 0?{enabled:l.enabled}:{},transformation:{...t.transformation,...l.transformation??{}},image:{...t.image,...l.image??{}}}},fl={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},ct={display:"flex",flexDirection:"column",gap:4},jl={...ct,gridColumn:"1 / -1"},Qe={fontSize:9,color:"rgba(226,232,240,0.72)"},Gt={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},ts={...Gt,appearance:"none"},ml={...Gt,fontVariantNumeric:"tabular-nums"},Sl={...Gt,padding:2,cursor:"pointer"},vl=t=>/^-?\d*(\.\d*)?$/.test(t),ss=({value:t,onChange:s,step:l=1,min:n,max:a})=>{const[d,r]=y.useState(String(t));y.useEffect(()=>r(String(t)),[t]);const o=h=>{let x=h;return typeof n=="number"&&(x=Math.max(n,x)),typeof a=="number"&&(x=Math.min(a,x)),x};return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:ml,value:d,onChange:h=>{const x=h.target.value;if(!vl(x)||(r(x),x===""||x==="-"||x==="."||x==="-."))return;const c=Number(x);Number.isNaN(c)||s(o(c))},onBlur:()=>{const h=Number(d);if(Number.isNaN(h)){r(String(t));return}const x=o(h);r(String(x)),s(x)},onKeyDown:h=>{if(h.key!=="ArrowUp"&&h.key!=="ArrowDown")return;h.preventDefault();const x=h.shiftKey?l*10:h.altKey?l/10:l,c=h.key==="ArrowUp"?t+x:t-x;s(o(Number.isInteger(c)?c:Number(c.toFixed(6))))}})},wl=({value:t,onChange:s})=>e.jsxs("div",{style:fl,children:[e.jsxs("label",{style:ct,children:[e.jsx("span",{style:Qe,children:"Material Type"}),e.jsxs("select",{style:ts,value:t.materialType,onChange:l=>s({...t,materialType:l.target.value}),children:[e.jsx("option",{value:"unlit",children:"Unlit"}),e.jsx("option",{value:"standardPBR",children:"Standard PBR"}),e.jsx("option",{value:"matcap",children:"Matcap"})]})]}),e.jsxs("label",{style:ct,children:[e.jsx("span",{style:Qe,children:"Blend Mode"}),e.jsxs("select",{style:ts,value:t.blendMode,onChange:l=>s({...t,blendMode:l.target.value}),children:[e.jsx("option",{value:"normal",children:"Normal"}),e.jsx("option",{value:"add",children:"Add"}),e.jsx("option",{value:"subtract",children:"Subtract"}),e.jsx("option",{value:"multiply",children:"Multiply"}),e.jsx("option",{value:"screen",children:"Screen"}),e.jsx("option",{value:"lighten",children:"Lighten"}),e.jsx("option",{value:"darken",children:"Darken"}),e.jsx("option",{value:"overlay",children:"Overlay"}),e.jsx("option",{value:"softLight",children:"Soft Light"}),e.jsx("option",{value:"hardLight",children:"Hard Light"}),e.jsx("option",{value:"difference",children:"Difference"}),e.jsx("option",{value:"exclusion",children:"Exclusion"})]})]}),e.jsxs("label",{style:ct,children:[e.jsx("span",{style:Qe,children:"Opacity"}),e.jsx(ss,{value:t.opacity,min:0,max:1,step:.01,onChange:l=>s({...t,opacity:l})})]}),e.jsxs("label",{style:ct,children:[e.jsx("span",{style:Qe,children:"Tint"}),e.jsx("input",{type:"color",style:Sl,value:t.color,onChange:l=>s({...t,color:l.target.value})})]}),e.jsxs("label",{style:jl,children:[e.jsx("span",{style:Qe,children:"Alpha Test"}),e.jsx(ss,{value:t.alphaTest,min:0,max:1,step:.01,onChange:l=>s({...t,alphaTest:l})})]})]}),kl={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},Cl={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Rl={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},Il={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},El={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Tl=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),zl={display:"grid",gap:7,padding:"0 7px 7px"},Ml={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},pt={display:"flex",flexDirection:"column",gap:4},Tt={...pt,gridColumn:"1 / -1"},we={fontSize:9,color:"rgba(226,232,240,0.72)"},Rs={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},zt={...Rs,appearance:"none"},Mt={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},Ft={width:16,height:16},Fl=[{value:"default",label:"Default"},{value:"image",label:"Image"},{value:"gif",label:"GIF"}],Wl=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zm0 2v8.76l4.5-4.5 3.2 3.2 2.8-2.8L19 14.16V6H5zm12 3a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),Ll=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2h2v4h3l-4 4-4-4h3V2zm0 20v-4H8l4-4 4 4h-3v4h-2zM2 11h4V8l4 4-4 4v-3H2v-2zm20 0v2h-4v3l-4-4 4-4v3h4z"})}),$l=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 2 3 7v10l9 5 9-5V7l-9-5zm0 2.3L17.9 7 12 9.7 6.1 7 12 4.3zM5 8.5l6 2.7v7.9l-6-3.3V8.5zm8 10.6v-7.9l6-2.7v7.3l-6 3.3z"})}),ns=(t,s)=>({enabled:(s==null?void 0:s.enabled)??t.enabled,showGuides:(s==null?void 0:s.showTransformGuides)??t.showFitGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:(s==null?void 0:s.position)??t.position,size:(s==null?void 0:s.size)??t.size,rotation:(s==null?void 0:s.rotation)??t.rotation,scale2D:s==null?void 0:s.scale2D,referencePixelsPerUnit:s==null?void 0:s.referencePixelsPerUnit,pivot:(s==null?void 0:s.pivot)??t.pivot,renderOrder:(s==null?void 0:s.renderOrder)??t.renderOrder,overlay:(s==null?void 0:s.overlay)??t.overlay,visible:(s==null?void 0:s.visible)??t.visible}),Nl=(t,s)=>({...s,enabled:t.enabled,showFitGuides:t.showGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:t.position,size:t.size,rotation:t.rotation,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),ls=(t,s)=>({...$e.DEFAULT_SCREEN_TRANSFORM_2D,...s,enabled:t.enabled,showTransformGuides:t.showGuides,position:t.position,size:t.size,rotation:t.rotation,scale2D:t.scale2D??(s==null?void 0:s.scale2D)??$e.DEFAULT_SCREEN_TRANSFORM_2D.scale2D,referencePixelsPerUnit:t.referencePixelsPerUnit??(s==null?void 0:s.referencePixelsPerUnit)??$e.DEFAULT_SCREEN_TRANSFORM_2D.referencePixelsPerUnit,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),Ol=({value:t,onChange:s,copyLabel:l,inspector:n,docked:a})=>{const[d,r]=y.useState(()=>K.createSceneObject({name:l??"Screen Image",renderGroupId:Le.DEFAULT_RENDER_GROUP_IDS.screen2d})),[o]=y.useState(()=>{const i=d.id,u=K.createDefaultComponent("ScreenTransform",i),j=K.createDefaultComponent("ScreenImage",i),w=K.createDefaultComponent("Material",i),v=K.createDefaultComponent("Texture",i);return{screenTransform:u,screenImage:j,material:w,texture:v}}),[h,x]=y.useState({transformation:!0,image:!0,material:!0}),c=ns(t.screenImage.transformation,t.screenImage.screenTransform),p={object:{...d,componentIds:[o.screenTransform.id,o.screenImage.id,o.material.id,o.texture.id]},kind:"screenImage",components:[{...o.screenTransform,settings:t.screenImage.screenTransform??ls(c)},{...o.screenImage,settings:t.screenImage},{...o.material,settings:{...o.material.settings,color:t.screenImage.image.color,opacity:t.screenImage.image.opacity}},{...o.texture,settings:{...o.texture.settings,url:t.screenImage.image.src||void 0,flipX:t.screenImage.image.flipX,flipY:t.screenImage.image.flipY}}],scene:{screenSpaceUI:t.screenSpaceUI}},f=i=>{s({...t,screenImage:i(t.screenImage)})},g=(i,u,j,w)=>e.jsxs("div",{style:Cl,children:[e.jsxs("div",{style:Rl,children:[e.jsx("button",{type:"button",onClick:()=>x(v=>({...v,[i]:!v[i]})),style:El,children:e.jsx("div",{style:Tl(h[i])})}),e.jsxs("div",{style:Il,children:[e.jsx("span",{style:kl,children:j}),e.jsx("span",{children:u})]})]}),h[i]?e.jsx("div",{style:zl,children:w}):null]},i);return e.jsxs(Ct,{objectId:(n==null?void 0:n.objectId)??d.id,objectName:(n==null?void 0:n.objectName)??d.name,onObjectNameChange:(n==null?void 0:n.onObjectNameChange)??(i=>r(u=>({...u,name:i}))),layer:(n==null?void 0:n.layer)??"Default Layer",visible:(n==null?void 0:n.visible)??t.screenImage.enabled,onVisibleChange:(n==null?void 0:n.onVisibleChange)??(i=>f(u=>({...u,enabled:i}))),copyConfig:(n==null?void 0:n.copyConfig)??p,docked:a??(n==null?void 0:n.docked),initialPosition:n==null?void 0:n.initialPosition,position:n==null?void 0:n.position,onPositionChange:n==null?void 0:n.onPositionChange,title:n==null?void 0:n.title,children:[g("transformation","Transformation",e.jsx(Ll,{}),e.jsx(Ht,{value:ns(t.screenImage.transformation,t.screenImage.screenTransform),guideLabel:"Transform Control On",showRenderOrder:!1,onChange:i=>f(u=>({...u,transformation:Nl(i,u.transformation),screenTransform:ls(i,u.screenTransform)}))})),g("image","Image",e.jsx(Wl,{}),e.jsxs("div",{style:{display:"grid",gap:6},children:[e.jsxs("label",{style:pt,children:[e.jsx("span",{style:we,children:"Preset"}),e.jsx("select",{style:zt,value:t.screenImage.preset,onChange:i=>f(u=>bl(u,i.target.value)),children:gl.map(i=>e.jsx("option",{value:i.value,children:i.label},i.value))})]}),e.jsxs("label",{style:pt,children:[e.jsx("span",{style:we,children:"Source Kind"}),e.jsx("select",{style:zt,value:t.screenImage.image.sourceKind,onChange:i=>f(u=>({...u,image:{...u.image,sourceKind:i.target.value}})),children:Fl.map(i=>e.jsx("option",{value:i.value,children:i.label},i.value))})]}),t.screenImage.image.sourceKind==="image"||t.screenImage.image.sourceKind==="gif"?e.jsxs("label",{style:pt,children:[e.jsx("span",{style:we,children:"Source URL"}),e.jsx("input",{style:Rs,value:t.screenImage.image.src,onChange:i=>f(u=>({...u,image:{...u.image,src:i.target.value}}))})]}):null,e.jsxs("label",{style:pt,children:[e.jsx("span",{style:we,children:"Stretch Mode"}),e.jsxs("select",{style:zt,value:t.screenImage.image.stretchMode,onChange:i=>f(u=>({...u,image:{...u.image,stretchMode:i.target.value}})),children:[e.jsx("option",{value:"fit",children:"Fit"}),e.jsx("option",{value:"fitWidth",children:"Fit Width"}),e.jsx("option",{value:"fitHeight",children:"Fit Height"}),e.jsx("option",{value:"center",children:"Center"}),e.jsx("option",{value:"stretch",children:"Stretch"}),e.jsx("option",{value:"fill",children:"Fill"}),e.jsx("option",{value:"fillAndCut",children:"Fill and Cut"})]})]}),e.jsx("label",{style:Tt,children:e.jsxs("div",{style:Mt,children:[e.jsx("span",{style:we,children:"Flip X"}),e.jsx("input",{type:"checkbox",style:Ft,checked:t.screenImage.image.flipX,onChange:i=>f(u=>({...u,image:{...u.image,flipX:i.target.checked}}))})]})}),e.jsx("label",{style:Tt,children:e.jsxs("div",{style:Mt,children:[e.jsx("span",{style:we,children:"Flip Y"}),e.jsx("input",{type:"checkbox",style:Ft,checked:t.screenImage.image.flipY,onChange:i=>f(u=>({...u,image:{...u.image,flipY:i.target.checked}}))})]})})]})),g("material","Material",e.jsx($l,{}),e.jsxs("div",{style:Ml,children:[e.jsx(wl,{value:t.screenImage.image,onChange:i=>f(u=>({...u,image:{...u.image,materialType:i.materialType,blendMode:i.blendMode,opacity:i.opacity,color:i.color,alphaTest:i.alphaTest}}))}),e.jsx("label",{style:Tt,children:e.jsxs("div",{style:Mt,children:[e.jsx("span",{style:we,children:"Transparent"}),e.jsx("input",{type:"checkbox",style:Ft,checked:t.screenImage.image.transparent,onChange:i=>f(u=>({...u,image:{...u.image,transparent:i.target.checked}}))})]})})]}))]})},_e={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},We={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},Al=({onChange:t,value:s})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[s.map((l,n)=>e.jsxs("div",{style:_e,children:[e.jsx("input",{"aria-label":`Gradient stop ${n+1} color`,type:"color",style:{...We,padding:2},value:l.color,onChange:a=>t(s.map((d,r)=>r===n?{...d,color:a.currentTarget.value}:d))}),e.jsxs("span",{style:{display:"grid",gridTemplateColumns:"1fr auto",gap:4},children:[e.jsx("input",{"aria-label":`Gradient stop ${n+1} position`,type:"number",min:0,max:1,step:.05,style:We,value:l.offset,onChange:a=>t(s.map((d,r)=>r===n?{...d,offset:Number(a.currentTarget.value)}:d))}),s.length>2?e.jsx("button",{type:"button",onClick:()=>t(s.filter((a,d)=>d!==n)),children:"−"}):null]})]},`${n}-${l.color}`)),s.length<J.MAX_SCREEN_GRADIENT_STOPS?e.jsx("button",{type:"button",onClick:()=>{var l;return t([...s,{offset:.5,color:((l=s[s.length-1])==null?void 0:l.color)??"#ffffff"}])},children:"Add stop"}):null]}),Is=({onChange:t,value:s})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Gradient"}),e.jsxs("select",{style:We,value:s.type,onChange:l=>t({...s,type:l.currentTarget.value}),children:[e.jsx("option",{value:"linear",children:"Linear"}),e.jsx("option",{value:"radial",children:"Radial"}),e.jsx("option",{value:"angular",children:"Conic / Angular"})]})]}),e.jsx(Al,{value:s.stops,onChange:l=>t({...s,stops:l})}),s.type!=="radial"?e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Angle"}),e.jsx("input",{type:"number",style:We,step:5,value:s.angle,onChange:l=>t({...s,angle:Number(l.currentTarget.value)})})]}):null,s.type!=="linear"?e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Center X"}),e.jsx("input",{type:"number",style:We,min:0,max:1,step:.05,value:s.center.x,onChange:l=>t({...s,center:{...s.center,x:Number(l.currentTarget.value)}})})]}),e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Center Y"}),e.jsx("input",{type:"number",style:We,min:0,max:1,step:.05,value:s.center.y,onChange:l=>t({...s,center:{...s.center,y:Number(l.currentTarget.value)}})})]})]}):null,s.type==="radial"?e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Radius"}),e.jsx("input",{type:"number",style:We,min:.01,step:.05,value:s.radius,onChange:l=>t({...s,radius:Number(l.currentTarget.value)})})]}):null]}),is={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},os={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},Es=({value:t,onChange:s})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[e.jsxs("label",{style:is,children:[e.jsx("span",{children:"Tint"}),e.jsx("input",{type:"color",style:{...os,padding:2},value:t.tint,onChange:l=>s({...t,tint:l.currentTarget.value})})]}),["opacity","frost","highlight"].map(l=>e.jsxs("label",{style:is,children:[e.jsx("span",{children:l[0].toUpperCase()+l.slice(1)}),e.jsx("input",{type:"number",style:os,min:0,max:1,step:.05,value:t[l],onChange:n=>s({...t,[l]:Number(n.currentTarget.value)})})]},l))]}),Pl={borderRadius:12,border:"1px solid rgba(255,255,255,.08)",background:"rgba(255,255,255,.03)",padding:8},Ue={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},ht={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},ie=({label:t,onValue:s,...l})=>e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:t}),e.jsx("input",{...l,type:"number",style:ht,onChange:n=>s(Number(n.currentTarget.value))})]}),Ts=({value:t,onChange:s})=>e.jsxs("section",{style:Pl,children:[e.jsx("div",{style:{fontSize:11,fontWeight:700,marginBottom:7},children:"Screen Shape"}),e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Shape"}),e.jsxs("select",{style:ht,value:t.kind,onChange:l=>s({...t,kind:l.currentTarget.value}),children:[e.jsx("option",{value:"circle",children:"Circle"}),e.jsx("option",{value:"ellipse",children:"Ellipse"}),e.jsx("option",{value:"rectangle",children:"Rectangle"}),e.jsx("option",{value:"roundedRectangle",children:"Rounded Rectangle"}),e.jsx("option",{value:"polygon",children:"Polygon"}),e.jsx("option",{value:"star",children:"Star"}),e.jsx("option",{value:"line",children:"Line"})]})]}),t.kind!=="line"?e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Fill"}),e.jsxs("select",{style:ht,value:t.fillMode,onChange:l=>s({...t,fillMode:l.currentTarget.value}),children:[e.jsx("option",{value:"solid",children:"Solid"}),e.jsx("option",{value:"gradient",children:"Gradient"}),e.jsx("option",{value:"glass",children:"Glass"})]})]}),t.fillMode==="gradient"?e.jsx(Is,{value:t.gradient,onChange:l=>s({...t,gradient:l})}):t.fillMode==="glass"?e.jsx(Es,{value:t.glass,onChange:l=>s({...t,glass:l})}):e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Color"}),e.jsx("input",{type:"color",style:{...ht,padding:2},value:t.fillColor,onChange:l=>s({...t,fillColor:l.currentTarget.value})})]}),e.jsx(ie,{label:"Fill Opacity",min:0,max:1,step:.05,value:t.fillOpacity,onValue:l=>s({...t,fillOpacity:l})})]}):null,e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Stroke"}),e.jsx("input",{type:"color",style:{...ht,padding:2},value:t.strokeColor,onChange:l=>s({...t,strokeColor:l.currentTarget.value})})]}),e.jsx(ie,{label:"Stroke Width",min:0,step:1,value:t.strokeWidth,onValue:l=>s({...t,strokeWidth:l})}),e.jsx(ie,{label:"Stroke Opacity",min:0,max:1,step:.05,value:t.strokeOpacity,onValue:l=>s({...t,strokeOpacity:l})}),e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Dashed"}),e.jsx("input",{type:"checkbox",checked:t.dashed,onChange:l=>s({...t,dashed:l.currentTarget.checked})})]}),t.kind==="roundedRectangle"?e.jsx(ie,{label:"Corner Radius",min:0,max:.5,step:.01,value:t.cornerRadius,onValue:l=>s({...t,cornerRadius:l})}):null,t.kind==="polygon"||t.kind==="star"?e.jsx(ie,{label:t.kind==="star"?"Points":"Sides",min:3,max:12,step:1,value:t.sides,onValue:l=>s({...t,sides:l})}):null,t.kind==="star"?e.jsx(ie,{label:"Inner Radius",min:.05,max:.95,step:.05,value:t.innerRadiusRatio,onValue:l=>s({...t,innerRadiusRatio:l})}):null,t.kind==="line"?e.jsxs(e.Fragment,{children:[e.jsx(ie,{label:"Start X",min:0,max:1,step:.05,value:t.lineStart.x,onValue:l=>s({...t,lineStart:{...t.lineStart,x:l}})}),e.jsx(ie,{label:"Start Y",min:0,max:1,step:.05,value:t.lineStart.y,onValue:l=>s({...t,lineStart:{...t.lineStart,y:l}})}),e.jsx(ie,{label:"End X",min:0,max:1,step:.05,value:t.lineEnd.x,onValue:l=>s({...t,lineEnd:{...t.lineEnd,x:l}})}),e.jsx(ie,{label:"End Y",min:0,max:1,step:.05,value:t.lineEnd.y,onValue:l=>s({...t,lineEnd:{...t.lineEnd,y:l}})})]}):null]}),Dl={enabled:!0,bothHands:!0,visualScale:1,opacity:.92,pointRadius:3,lineWidth:3,labelScale:1.2,smoothing:.35,color:"#22d3ee",showBoundingBox:!0,showLabels:!1,logToConsole:!1},Bl={position:"fixed",left:14,top:104,zIndex:2e4,pointerEvents:"none"},zs={pointerEvents:"auto",width:286,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},Vl={...zs,width:32,height:32,borderRadius:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},Kl={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},Hl={width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},Gl={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},rs={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},_l={display:"grid",gap:6,padding:7},Ul={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Xl={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},Zl={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Yl={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},ql=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),Jl={display:"grid",gap:7,padding:"0 7px 7px"},Ql={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},Fe={display:"flex",flexDirection:"column",gap:4},et={...Fe,gridColumn:"1 / -1"},ne={fontSize:9,color:"rgba(226,232,240,0.72)"},Ve={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},tt={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},st={width:16,height:16},as={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},ei=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2zm0-8h10v2H7V6z"})}),ti=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.3l6.3 6.29 6.29-6.3z"})}),si=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),Wt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2a1 1 0 0 1 1 1v6h1V3a1 1 0 1 1 2 0v6h1V4a1 1 0 1 1 2 0v7.3l1.6 2.4a5 5 0 0 1 .8 2.7V18a4 4 0 0 1-4 4H9a6 6 0 0 1-6-6v-3.5a2.5 2.5 0 0 1 5 0V15h1V3a1 1 0 0 1 1-1z"})}),ni=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5V2L7 7l5 5V9a4 4 0 1 1-4 4H6a6 6 0 1 0 6-8z"})}),li=({value:t,onChange:s})=>{const[l,n]=y.useState(!0),[a,d]=y.useState({x:14,y:104}),[r,o]=y.useState(typeof window>"u"?0:window.innerHeight),[h,x]=y.useState({overlay:!0,visibility:!1}),c=y.useRef(null),p=Math.max(240,r-a.y-16);y.useEffect(()=>{const i=j=>{c.current&&d({x:Math.max(8,j.clientX-c.current.x),y:Math.max(8,j.clientY-c.current.y)})},u=()=>{c.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",i),window.addEventListener("pointerup",u),()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",u)}},[]),y.useEffect(()=>{const i=()=>o(window.innerHeight);return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const f=i=>{const u=i.currentTarget.getBoundingClientRect();c.current={x:i.clientX-u.left,y:i.clientY-u.top},document.body.classList.add("select-none"),i.currentTarget.setPointerCapture(i.pointerId)},g=(i,u,j,w)=>e.jsxs("div",{style:Ul,children:[e.jsxs("div",{style:Xl,children:[e.jsx("button",{type:"button",onClick:()=>x(v=>({...v,[i]:!v[i]})),style:Yl,children:e.jsx("div",{style:ql(h[i])})}),e.jsxs("div",{style:Zl,children:[e.jsx("span",{style:rs,children:j}),e.jsx("span",{children:u})]})]}),h[i]?e.jsx("div",{style:Jl,children:w}):null]},i);return typeof document>"u"?null:Ae.createPortal(e.jsxs("div",{style:{...Bl,left:a.x,top:a.y},children:[e.jsx("style",{children:`
|
|
2
2
|
.xr-hand-tracking-2d-scroll::-webkit-scrollbar { width: 10px; }
|
|
3
3
|
.xr-hand-tracking-2d-scroll::-webkit-scrollbar-track { background: rgba(255,255,255,0.06); border-radius: 999px; }
|
|
4
4
|
.xr-hand-tracking-2d-scroll::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.55); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
|
package/dist/debug-ui.js
CHANGED
|
@@ -15,7 +15,7 @@ import { n as Ml } from "./index-DlP4xxaT.js";
|
|
|
15
15
|
import { F as Ll } from "./index-CNt8esFO.js";
|
|
16
16
|
import { PerspectiveCamera as Fl, OrbitControls as $l } from "@react-three/drei";
|
|
17
17
|
import { useThree as Nl } from "@react-three/fiber";
|
|
18
|
-
import { e as Ol, f as Al } from "./index-
|
|
18
|
+
import { e as Ol, f as Al } from "./index-DJkmBF-0.js";
|
|
19
19
|
import { X as Bl } from "./contexts-B5GODwuV.js";
|
|
20
20
|
import { c as Vl } from "./selectors-K5JKCWxw.js";
|
|
21
21
|
const Kl = {
|