PageSourceSearch

https://boombam.app/assets/design-hub-JxVN5Exa.js

js boombam.app collected 2026-10-04 13:34:03 UTC 91,266 bytes, 154 lines download raw bytes

1import{K as y,aM as te,_ as ca,N as oa,r as x,a as da,a6 as Re,c6 as T,j as e,P as Yt,ak as Je,cb as Zt,B as o,al as et,am as tt,an as st,ao as at,ab as m,aF as B,cn as ha,f as xa,aq as it,a4 as De,aD as Ee,aH as ma,$ as rt,a0 as nt,a1 as lt,a2 as ct,a3 as Y,C as L,e as H,au as Jt,s as ga,b as ot,d as dt,b7 as A,cD as hs,p as ua,D as pa,H as es,w as fa,bi as ja,bj as ht,bB as ya,aK as va,cr as xs,cZ as ms,F as Fe,b_ as ba,bS as ts,a7 as Te,bG as Be}from"./index-CuSEeJFb.js";import{T as Na,a as wa,b as xt,c as mt}from"./tabs-CcPOXtvT.js";import{S as I}from"./slider-1BwPyzha.js";import{U as ss}from"./upload-rep3KVPL.js";import{R as ka}from"./ruler-CW1eoJlB.js";import{S as gt}from"./square-pen-Wwme7SiP.js";import{G as yt}from"./grid-3x3-CB6J-yDX.js";import{I as ut}from"./image-fQC3p4ps.js";import{T as as}from"./type-u6mf0Lzd.js";import{S as Ca}from"./square-CbouAjGs.js";import{M as Sa}from"./minus-LVFLuFlS.js";import{C as Aa}from"./copy-Ctw93tQ7.js";import{L as Oa}from"./lock-open-DnE3EQnb.js";import{A as za}from"./arrow-up-down-BYBJwSGI.js";import{M as Ma}from"./mail-Dl1RGATy.js";import{G as Pa}from"./grip-vertical-DtmmqDbO.js";import{S as Ra}from"./settings-2-CoNUPE_Y.js";import{S as Da}from"./save-DMqvNvzo.js";import{A as Ea,a as Fa,b as Ta}from"./align-right-8o2vFXTu.js";/**
2 * @license lucide-react v0.453.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Ba=y("AlignCenterHorizontal",[["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"M10 16v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-4",key:"11f1s0"}],["path",{d:"M10 8V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v4",key:"t14dx9"}],["path",{d:"M20 16v1a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-1",key:"1w07xs"}],["path",{d:"M14 8V7c0-1.1.9-2 2-2h2a2 2 0 0 1 2 2v1",key:"1apec2"}]]);/**
7 * @license lucide-react v0.453.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const La=y("AlignCenterVertical",[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4",key:"14d6g8"}],["path",{d:"M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4",key:"1e2lrw"}],["path",{d:"M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1",key:"1fkdwx"}],["path",{d:"M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1",key:"1euafb"}]]);/**
12 * @license lucide-react v0.453.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const Ha=y("AlignEndHorizontal",[["rect",{width:"6",height:"16",x:"4",y:"2",rx:"2",key:"z5wdxg"}],["rect",{width:"6",height:"9",x:"14",y:"9",rx:"2",key:"um7a8w"}],["path",{d:"M22 22H2",key:"19qnx5"}]]);/**
17 * @license lucide-react v0.453.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */const Ia=y("AlignEndVertical",[["rect",{width:"16",height:"6",x:"2",y:"4",rx:"2",key:"10wcwx"}],["rect",{width:"9",height:"6",x:"9",y:"14",rx:"2",key:"4p5bwg"}],["path",{d:"M22 22V2",key:"12ipfv"}]]);/**
22 * @license lucide-react v0.453.0 - ISC
23 *
24 * This source code is licensed under the ISC license.
25 * See the LICENSE file in the root directory of this source tree.
26 */const _a=y("AlignHorizontalSpaceAround",[["rect",{width:"6",height:"10",x:"9",y:"7",rx:"2",key:"yn7j0q"}],["path",{d:"M4 22V2",key:"tsjzd3"}],["path",{d:"M20 22V2",key:"1bnhr8"}]]);/**
27 * @license lucide-react v0.453.0 - ISC
28 *
29 * This source code is licensed under the ISC license.
30 * See the LICENSE file in the root directory of this source tree.
31 */const Va=y("AlignStartHorizontal",[["rect",{width:"6",height:"16",x:"4",y:"6",rx:"2",key:"1n4dg1"}],["rect",{width:"6",height:"9",x:"14",y:"6",rx:"2",key:"17khns"}],["path",{d:"M22 2H2",key:"fhrpnj"}]]);/**
32 * @license lucide-react v0.453.0 - ISC
33 *
34 * This source code is licensed under the ISC license.
35 * See the LICENSE file in the root directory of this source tree.
36 */const Ga=y("AlignStartVertical",[["rect",{width:"9",height:"6",x:"6",y:"14",rx:"2",key:"lpm2y7"}],["rect",{width:"16",height:"6",x:"6",y:"4",rx:"2",key:"rdj6ps"}],["path",{d:"M2 2v20",key:"1ivd8o"}
36]]);/**
37 * @license lucide-react v0.453.0 - ISC
38 *
39 * This source code is licensed under the ISC license.
40 * See the LICENSE file in the root directory of this source tree.
41 */const Ua=y("AlignVerticalSpaceAround",[["rect",{width:"10",height:"6",x:"7",y:"9",rx:"2",key:"b1zbii"}],["path",{d:"M22 20H2",key:"1p1f7z"}],["path",{d:"M22 4H2",key:"1b7qnq"}]]);/**
42 * @license lucide-react v0.453.0 - ISC
43 *
44 * This source code is licensed under the ISC license.
45 * See the LICENSE file in the root directory of this source tree.
46 */const Le=y("ArrowLeftRight",[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]]);/**
47 * @license lucide-react v0.453.0 - ISC
48 *
49 * This source code is licensed under the ISC license.
50 * See the LICENSE file in the root directory of this source tree.
51 */const $a=y("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/**
52 * @license lucide-react v0.453.0 - ISC
53 *
54 * This source code is licensed under the ISC license.
55 * See the LICENSE file in the root directory of this source tree.
56 */const qa=y("DoorOpen",[["path",{d:"M13 4h3a2 2 0 0 1 2 2v14",key:"hrm0s9"}],["path",{d:"M2 20h3",key:"1gaodv"}],["path",{d:"M13 20h9",key:"s90cdi"}],["path",{d:"M10 12v.01",key:"vx6srw"}],["path",{d:"M13 4.562v16.157a1 1 0 0 1-1.242.97L5 20V5.562a2 2 0 0 1 1.515-1.94l4-1A2 2 0 0 1 13 4.561Z",key:"199qr4"}]]);/**
57 * @license lucide-react v0.453.0 - ISC
58 *
59 * This source code is licensed under the ISC license.
60 * See the LICENSE file in the root directory of this source tree.
61 */const Wa=y("Droplet",[["path",{d:"M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z",key:"c7niix"}]]);/**
62 * @license lucide-react v0.453.0 - ISC
63 *
64 * This source code is licensed under the ISC license.
65 * See the LICENSE file in the root directory of this source tree.
66 */const Xa=y("Group",[["path",{d:"M3 7V5c0-1.1.9-2 2-2h2",key:"adw53z"}],["path",{d:"M17 3h2c1.1 0 2 .9 2 2v2",key:"an4l38"}],["path",{d:"M21 17v2c0 1.1-.9 2-2 2h-2",key:"144t0e"}],["path",{d:"M7 21H5c-1.1 0-2-.9-2-2v-2",key:"rtnfgi"}],["rect",{width:"7",height:"5",x:"7",y:"7",rx:"1",key:"1eyiv7"}],["rect",{width:"7",height:"5",x:"10",y:"12",rx:"1",key:"1qlmkx"}]]);/**
67 * @license lucide-react v0.453.0 - ISC
68 *
69 * This source code is licensed under the ISC license.
70 * See the LICENSE file in the root directory of this source tree.
71 */const Ka=y("Hexagon",[["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}]]);/**
72 * @license lucide-react v0.453.0 - ISC
73 *
74 * This source code is licensed under the ISC license.
75 * See the LICENSE file in the root directory of this source tree.
76 */const Qa=y("ImagePlus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);/**
77 * @license lucide-react v0.453.0 - ISC
78 *
79 * This source code is licensed under the ISC license.
80 * See the LICENSE file in the root directory of this source tree.
81 */const Ya=y("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);/**
82 * @license lucide-react v0.453.0 - ISC
83 *
84 * This source code is licensed under the ISC license.
85 * See the LICENSE file in the root directory of this source tree.
86 */const is=y("LayoutTemplate",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);/**
87 * @license lucide-react v0.453.0 - ISC
88 *
89 * This source code is licensed under the ISC license.
90 * See the LICENSE file in the root directory of this source tree.
91 */const Za=y("PaintBucket",[["path",{d:"m19 11-8-8-8.6 8.6a2 2 0 0 0 0 2.8l5.2 5.2c.8.8 2 .8 2.8 0L19 11Z",key:"irua1i"}],["path",{d:"m5 2 5 5",key:"1lls2c"}],["path",{d:"M2 13h15",key:"1hkzvu"}],["path",{d:"M22 20a2 2 0 1 1-4 0c0-1.6 1.7-2.4 2-4 .3 1.6 2 2.4 2 4Z",key:"xk76lq"}]]);/**
92 * @license lucide-react v0.453.0 - ISC
93 *
94 * This source code is licensed under the ISC license.
95 * See the LICENSE file in the root directory of this source tree.
96 */const rs=y("Paintbrush",[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",ke
96y:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]]);/**
97 * @license lucide-react v0.453.0 - ISC
98 *
99 * This source code is licensed under the ISC license.
100 * See the LICENSE file in the root directory of this source tree.
101 */const Ja=y("Pentagon",[["path",{d:"M10.83 2.38a2 2 0 0 1 2.34 0l8 5.74a2 2 0 0 1 .73 2.25l-3.04 9.26a2 2 0 0 1-1.9 1.37H7.04a2 2 0 0 1-1.9-1.37L2.1 10.37a2 2 0 0 1 .73-2.25z",key:"2hea0t"}]]);/**
102 * @license lucide-react v0.453.0 - ISC
103 *
104 * This source code is licensed under the ISC license.
105 * See the LICENSE file in the root directory of this source tree.
106 */const pt=y("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);/**
107 * @license lucide-react v0.453.0 - ISC
108 *
109 * This source code is licensed under the ISC license.
110 * See the LICENSE file in the root directory of this source tree.
111 */const ei=y("Redo2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]);/**
112 * @license lucide-react v0.453.0 - ISC
113 *
114 * This source code is licensed under the ISC license.
115 * See the LICENSE file in the root directory of this source tree.
116 */const ti=y("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
117 * @license lucide-react v0.453.0 - ISC
118 *
119 * This source code is licensed under the ISC license.
120 * See the LICENSE file in the root directory of this source tree.
121 */const si=y("SquareSplitHorizontal",[["path",{d:"M8 19H5c-1 0-2-1-2-2V7c0-1 1-2 2-2h3",key:"lubmu8"}],["path",{d:"M16 5h3c1 0 2 1 2 2v10c0 1-1 2-2 2h-3",key:"1ag34g"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
122 * @license lucide-react v0.453.0 - ISC
123 *
124 * This source code is licensed under the ISC license.
125 * See the LICENSE file in the root directory of this source tree.
126 */const gs=y("Triangle",[["path",{d:"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"14u9p9"}]]);/**
127 * @license lucide-react v0.453.0 - ISC
128 *
129 * This source code is licensed under the ISC license.
130 * See the LICENSE file in the root directory of this source tree.
131 */const ai=y("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);/**
132 * @license lucide-react v0.453.0 - ISC
133 *
134 * This source code is licensed under the ISC license.
135 * See the LICENSE file in the root directory of this source tree.
136 */const ii=y("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
137 * @license lucide-react v0.453.0 - ISC
138 *
139 * This source code is licensed under the ISC license.
140 * See the LICENSE file in the root directory of this source tree.
141 */const ri=y("Ungroup",[["rect",{width:"8",height:"6",x:"5",y:"4",rx:"1",key:"nzclkv"}],["rect",{width:"8",height:"6",x:"11",y:"14",rx:"1",key:"4tytwb"}]]);/**
142 * @license lucide-react v0.453.0 - ISC
143 *
144 * This source code is licensed under the ISC license.
145 * See the LICENSE file in the root directory of this source tree.
146 */const ni=y("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);/**
147 * @license lucide-react v0.453.0 - ISC
148 *
149 * This source code is licensed under the ISC license.
150 * See the LICENSE file in the root directory of this source tree.
151 */const li=y("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);var us={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ns=te.createContext&&te.createContext(us),ci=["attr","size","title"];function oi(i,p){if(i==null)return{};var u=di(i,p),j,D;if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(i);for(D=0;D<_.length;D++)j=_[D],!(p.indexOf(j)>=0)&&Object.prototype.propertyIsEnumerable.call(i,j)&&(u[j]=i[j])}return u}function di(i,p){if(i==null)return{};var u={};for(var j in i)if(Object.prototype.hasOwnProperty.call(i,j)){if(p.indexOf(j)>=0)continue;u[j]=i[j]}return u}function He(){return He=Object.assign?Object.assign.bind():function(i){for(var p=1;p<arguments.length;p++){var u=arguments[p];for(var j in u)Object.prototype.hasOwnProperty.call(u,j)&&(i[j]=u[j])}return i},He.apply(this,arguments)}function ls(i,p){var u=Object.keys(i);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(i);p&&(j=j.filter(function(D){return Object.getOwnPropertyDescriptor(i,D).enumerable})),u.push.apply(u,j)}return u}function Ie(i){for(var p=1;p<arguments.length;p++){var u=arguments[p]!=null?arguments[p]:{};
vendor: 9,833 bytes, line 151
151p%2?ls(Object(u),!0).forEach(function(j){hi(i,j,u[j])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(u)):ls(Object(u)).forEach(function(j){Object.defineProperty(i,j,Object.getOwnPropertyDescriptor(u,j))})}return i}function hi(i,p,u){return p=xi(p),p in i?Object.defineProperty(i,p,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[p]=u,i}function xi(i){var p=mi(i,"string");return typeof p=="symbol"?p:p+""}function mi(i,p){if(typeof i!="object"||!i)return i;var u=i[Symbol.toPrimitive];if(u!==void 0){var j=u.call(i,p||"default");if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(i)}function ps(i){return i&&i.map((p,u)=>te.createElement(p.tag,Ie({key:u},p.attr),ps(p.child)))}function se(i){return p=>te.createElement(gi,He({attr:Ie({},i.attr)},p),ps(i.child))}function gi(i){var p=u=>{var{attr:j,size:D,title:_}=i,Z=oi(i,ci),V=D||u.size||"1em",d;return u.className&&(d=u.className),i.className&&(d=(d?d+" ":"")+i.className),te.createElement("svg",He({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},u.attr,j,Z,{className:d,style:Ie(Ie({color:i.color||u.color},u.style),i.style),height:V,width:V,xmlns:"http://www.w3.org/2000/svg"}),_&&te.createElement("title",null,_),i.children)};return ns!==void 0?te.createElement(ns.Consumer,null,u=>p(u)):p(us)}function cs(i){return se({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z"},child:[]}]})(i)}function os(i){return se({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z"},child:[]}]})(i)}function ft(i){return se({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M7.0301.084c-1.2768.0602-2.1487.264-2.911.5634-.7888.3075-1.4575.72-2.1228 1.3877-.6652.6677-1.075 1.3368-1.3802 2.127-.2954.7638-.4956 1.6365-.552 2.914-.0564 1.2775-.0689 1.6882-.0626 4.947.0062 3.2586.0206 3.6671.0825 4.9473.061 1.2765.264 2.1482.5635 2.9107.308.7889.72 1.4573 1.388 2.1228.6679.6655 1.3365 1.0743 2.1285 1.38.7632.295 1.6361.4961 2.9134.552 1.2773.056 1.6884.069 4.9462.0627 3.2578-.0062 3.668-.0207 4.9478-.0814 1.28-.0607 2.147-.2652 2.9098-.5633.7889-.3086 1.4578-.72 2.1228-1.3881.665-.6682 1.0745-1.3378 1.3795-2.1284.2957-.7632.4966-1.636.552-2.9124.056-1.2809.0692-1.6898.063-4.948-.0063-3.2583-.021-3.6668-.0817-4.9465-.0607-1.2797-.264-2.1487-.5633-2.9117-.3084-.7889-.72-1.4568-1.3876-2.1228C21.2982 1.33 20.628.9208 19.8378.6165 19.074.321 18.2017.1197 16.9244.0645 15.6471.0093 15.236-.005 11.977.0014 8.718.0076 8.31.0215 7.0301.0839m.1402 21.6932c-1.17-.0509-1.8053-.2453-2.2287-.408-.5606-.216-.96-.4771-1.3819-.895-.422-.4178-.6811-.8186-.9-1.378-.1644-.4234-.3624-1.058-.4171-2.228-.0595-1.2645-.072-1.6442-.079-4.848-.007-3.2037.0053-3.583.0607-4.848.05-1.169.2456-1.805.408-2.2282.216-.5613.4762-.96.895-1.3816.4188-.4217.8184-.6814 1.3783-.9003.423-.1651 1.0575-.3614 2.227-.4171 1.2655-.06 1.6447-.072 4.848-.079 3.2033-.007 3.5835.005 4.8495.0608 1.169.0508 1.8053.2445 2.228.408.5608.216.96.4754 1.3816.895.4217.4194.6816.8176.9005 1.3787.1653.4217.3617 1.056.4169 2.2263.0602 1.2655.0739 1.645.0796 4.848.0058 3.203-.0055 3.5834-.061 4.848-.051 1.17-.245 1.8055-.408 2.2294-.216.5604-.4763.96-.8954 1.3814-.419.4215-.8181.6811-1.3783.9-.4224.1649-1.0577.3617-2.2262.4174-1.2656.0595-1.6448.072-4.8493.079-3.2045.007-3.5825-.006-4.848-.0608M16.953 5.5864A1.44 1.44 0 1 0 18.39 4.144a1.44 1.44 0 0 0-1.437 1.4424M5.8385 12.012c.0067 3.4032 2.7706 6.1557 6.173 6.1493 3.4026-.0065 6.157-2.7701 6.1506-6.1733-.0065-3.4032-2.771-6.1565-6.174-6.1498-3.403.0067-6.156 2.771-6.1496 6.1738M8 12.0077a4 4 0 1 1 4.008 3.9921A3.9996 3.9996 0 0 1 8 12.0077"},child:[]}]})(i)}function ds(i){return se({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"},child:[]}]})(i)}function ui(i){return se({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12.017 0C5.396 0 .029 5.367.029 11.987c0 5.079 3.158 9.417 7.618 11.162-.105-.949-.199-2.403.041-3.439.219-.937 1.406-5.957 1.406-5.957s-.359-.72-.359-1.781c0-1.663.967-2.911 2.168-2.911 1.024 0 1.518.769 1.518 1.688 0 1.029-.653 2.567-.992 3.992-.285 1.193.6 2.165 1.775 2.165 2.128 0 3.768-2.245 3.768-5.487 0-2.861-2.063-4.869-5.008-4.869-3.41 0-5.409 2.562-5.409 5.199 0 1.033.394 2.143.889 2.741.099.12.112.225.085.345-.09.375-.293 1.199-.334 1.363-.053.225-.172.271-.401.165-1.495-.69-2.433-2.878-2.433-4.646 0-3.776 2.748-7.252 7.92-7.252 4.158 0 7.392 2.967 7.392 6.923 0 4.135-2.607 7.462-6.233 7.462-1.214 0-2.354-.629-2.758-1.379l-.749 2.848c-.269 1.045-1.004 2.352-1.498 3.146 1.123.345 2.306.535 3.55.535 6.607 0 11.985-5.365 11.985-11.987C23.97 5.39 18.592.026 11.985.026L12.017 0z"},child:[]}]})(i)}function pi(i){return se({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z"},child:[]}]})(i)}function fi(i){return se({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"},child:[]}]})(i)}const jt=[{id:"side-by-side",name:"Side by Side",layout:"side-by-side",icon:Le,description:"Classic horizontal comparison"},{id:"vertical",name:"Top & Bottom",layout:"vertical",icon:za,description:"Stacked vertical view"},{id:"slider",name:"Interactive Slider",layout:"slider",icon:ti,description:"Drag to reveal transformation"},{id:"diagonal",name:"Diagonal Split",layout:"diagonal",icon:gs,description:"Dynamic angled division"},{id:"split-screen",name:"Split Screen",layout:"split-screen",icon:si,description:"Centered vertical split"},{id:"framed",name:"Framed Collage",layout:"framed",icon:yt,description:"Both images in styled frames"},{id:"circle-reveal",name:"Circle Reveal",layout:"circle-reveal",icon:hs,description:"Circular before/after reveal"},{id:"corner-peek",name:"Corner Peek",layout:"corner-peek",icon:ms,description:"After peeling from corner"}],ce=[{id:"facebook-post",name:"Facebook Post",platform:"facebook",icon:cs,width:1200,height:630,description:"Standard feed post",category:"social"},{id:"facebook-story",name:"Facebook Story",platform:"facebook",icon:cs,width:1080,height:1920,description:"Full-screen story",category:"social"},{id:"instagram-post",name:"Instagram Post",platform:"instagram",icon:ft,width:1080,height:1080,description:"Square feed post",category:"social"},{id:"instagram-story",name:"Instagram Story",platform:"instagram",icon:ft,width:1080,height:1920,description:"Full-screen story",category:"social"},{id:"instagram-reel",name:"Instagram Reel Cover",platform:"instagram",icon:ft,width:1080,height:1920,description:"Reels cover image",category:"video"},{id:"linkedin-post",name:"LinkedIn Post",platform:"linkedin",icon:ds,width:1200,height:627,description:"Professional feed post",category:"social"},{id:"linkedin-banner",name:"LinkedIn Banner",platform:"linkedin",icon:ds,width:1584,height:396,description:"Profile cover image",category:"social"},{id:"twitter-post",name:"X (Twitter) Post",platform:"twitter",icon:pi,width:1200,height:675,description:"Tweet image",category:"social"},{id:"pinterest-pin",name:"Pinterest Pin",platform:"pinterest",icon:ui,width:1e3,height:1500,description:"Tall pin format",category:"social"},{id:"youtube-thumbnail",name:"YouTube Thumbnail",platform:"youtube",icon:fi,width:1280,height:720,description:"Video thumbnail",category:"video"},{id:"google-display",name:"Google Display Ad",platform:"google",icon:os,width:300,height:250,description:"Medium rectangle",category:"display"},{id:"google-banner",name:"Google Leaderboard",platform:"google",icon:os,width:728,height:90,description:"Horizontal banner",category:"display"},{id:"flyer-letter",name:"Flyer (Letter)",platform:"print",icon:Fe,width:2550,height:3300,description:'8.5" x 11" print-ready',category:"print"},{id:"flyer-half",name:"Flyer (Half Page)",platform:"print",icon:Fe,width:2550,height:1650,description:'8.5" x 5.5" half-sheet',category:"print"},{id:"flyer-a4",name:"Flyer (A4)",platform:"print",icon:Fe,width:2480,height:3508,description:"A4 international size",category:"print"}
151,{id:"postcard",name:"Postcard",platform:"print",icon:Ma,width:1875,height:1275,description:'6.25" x 4.25" mailer',category:"print"},{id:"door-hanger",name:"Door Hanger",platform:"print",icon:qa,width:1050,height:2775,description:'3.5" x 9.25" door hanger',category:"print"},{id:"business-card",name:"Business Card",platform:"print",icon:ba,width:1050,height:600,description:'3.5" x 2" standard',category:"print"},{id:"rack-card",name:"Rack Card",platform:"print",icon:Fe,width:1200,height:2550,description:'4" x 8.5" display card',category:"print"},{id:"poster-small",name:"Poster (11x17)",platform:"print",icon:xs,width:3300,height:5100,description:'11" x 17" tabloid poster',category:"print"}],ji=["Arial","Helvetica","Georgia","Times New Roman","Courier New","Verdana","Trebuchet MS","Impact","Comic Sans MS","Palatino"];function Li(){const{toast:i}=ca(),{activeCompanyId:p}=oa(),u=x.useRef(null),j=x.useRef(null),D=x.useRef(null),_=x.useRef(null),[Z,V]=x.useState("projects"),[d,_e]=x.useState(null),[me,ge]=x.useState(100),[Ve,fs]=x.useState(!1),[a,js]=x.useState(null),[ys,J]=x.useState(!1),[ue,vt]=x.useState(""),[f,G]=x.useState(null),[F,bt]=x.useState(!1),[U,ae]=x.useState(8.5),[$,ie]=x.useState(11),[M,re]=x.useState("in"),[q,pe]=x.useState(300),[vs,oe]=x.useState(!1),[E,Nt]=x.useState(jt[0]),[O,wt]=x.useState(null),[z,kt]=x.useState(null),[fe,Ct]=x.useState(""),[Ge,bs]=x.useState(50),[ne,Ns]=x.useState([]),[W,Ue]=x.useState(-1),[c,je]=x.useState(null),[b,St]=x.useState({fill:"#ff6b35",stroke:"#000000",strokeWidth:0,opacity:100,rx:0,ry:0,shadow:null,fontFamily:"Arial",fontSize:36,fontWeight:"normal",fontStyle:"normal",underline:!1,textAlign:"left",lineHeight:1.16,type:""}),[At,$e]=x.useState(!1),[ye,Ot]=x.useState(10),[ve,zt]=x.useState(5),[be,Mt]=x.useState(5),[Ne,Pt]=x.useState("#000000"),[P,ws]=x.useState(null),[we,ks]=x.useState(20),[ke,qe]=x.useState(!1),[Cs,Ce]=x.useState(!1),[ee,Rt]=x.useState(""),[k,Ss]=x.useState(200),[X,Dt]=x.useState("#000000"),[We,As]=x.useState(!0),[Et,Os]=x.useState([]),zs=["#ff6b35","#000000","#ffffff","#6b7280","#3b82f6","#22c55e"];x.useState(!1);const[de,Ft]=x.useState("linear"),[he,Ms]=x.useState("#ff6b35"),[Se,Ps]=x.useState("#ffffff"),[Xe,Rs]=x.useState(0),{data:Tt,isLoading:Ds}=da({queryKey:["/api/design-hub/projects",p]}),Bt=Array.isArray(Tt)?Tt:[],Ke=Re({mutationFn:async t=>await Te("/api/design-hub/projects",{method:"POST",body:JSON.stringify(t)}),onSuccess:t=>{Be.invalidateQueries({queryKey:["/api/design-hub/projects",p]}),_e(t),V("editor"),J(!1),vt(""),G(null),i({title:"Project created successfully!"})},onError:t=>{i({title:"Failed to create project",description:t.message,variant:"destructive"})}}),Qe=Re({mutationFn:async t=>await Te(`/api/design-hub/projects/${t.id}`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{Be.invalidateQueries({queryKey:["/api/design-hub/projects",p]}),i({title:"Project saved!"})},onError:t=>{i({title:"Failed to save project",description:t.message,variant:"destructive"})}}),Es=Re({mutationFn:async t=>await Te(`/api/design-hub/projects/${t}`,{method:"DELETE"}),onSuccess:()=>{Be.invalidateQueries({queryKey:["/api/design-hub/projects",p]}),d&&(_e(null),V("projects")),i({title:"Project deleted"})}}),Ye=Re({mutationFn:async t=>await Te("/api/design-hub/before-after",{method:"POST",body:JSON.stringify(t)}),onSuccess:t=>{Be.invalidateQueries({queryKey:["/api/design-hub/projects",p]}),oe(!1),wt(null),kt(null),Ct(""),i({title:"Before/After created successfully!"})},onError:t=>{i({title:"Failed to create Before/After",description:t.message,variant:"destructive"})}}),xe=x.useCallback(t=>{if(!t){je(null),qe(!1);return}je(t);const s=t.shadow;St({fill:t.fill||"#ff6b35",stroke:t.stroke||"#000000",strokeWidth:t.strokeWidth||0,opacity:Math.round((t.opacity||1)*100),rx:t.rx||0,ry:t.ry||0,shadow:s,fontFamily:t.fontFamily||"Arial",fontSize:t.fontSize||36,fontWeight:t.fontWeight||"normal",fontStyle:t.fontStyle||"normal",underline:t.underline||!1,textAlign:t.textAlign||"left",lineHeight:t.lineHeight||1.16,type:t.type||""}),qe(t.lockMovementX&&t.lockMovementY),s?($e(!0),Ot(s.blur||10),zt(s.offsetX||5),Mt(s.offsetY||5),Pt(s.color||"#000000")):$e(!1)},[]);x.useEffect(()=>{var t,s;if(Z==="editor"&&d&&u.current){Fs();const r=((s=(t=u.current.parentElement)==null?void 0:t.parentElement)==null?void 0:s.clientWidth)||800,l=500,g=(r-80)/d.width,n=(l-80)/d.height,h=Math.min(g,n,1)*100;ge(Math.max(25,Math.round(h)))}return()=>{a&&a.dispose()}},[Z,d]),x.useEffect(()=>{const t=s=>{if(!a)return;const r=s.target;if(r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable)return;const g=navigator.platform.toUpperCase().indexOf("MAC")>=0?s.metaKey:s.ctrlKey;if(s.key==="Delete"||s.key==="Backspace"){s.preventDefault(),_t();return}if(g&&s.key.toLowerCase()==="d"){s.preventDefault(),Vt();return}
151if(g&&s.key.toLowerCase()==="z"&&!s.shiftKey){s.preventDefault(),Lt();return}if(g&&(s.key.toLowerCase()==="y"||s.shiftKey&&s.key.toLowerCase()==="z")){s.preventDefault(),Ht();return}if(g&&s.key.toLowerCase()==="a"){s.preventDefault(),Js();return}if(g&&s.shiftKey&&s.key.toLowerCase()==="g"){s.preventDefault(),Ut();return}if(g&&s.key.toLowerCase()==="g"){s.preventDefault(),Gt();return}const n=s.shiftKey?10:1;switch(s.key){case"ArrowUp":s.preventDefault(),Ae("up",n);break;case"ArrowDown":s.preventDefault(),Ae("down",n);break;case"ArrowLeft":s.preventDefault(),Ae("left",n);break;case"ArrowRight":s.preventDefault(),Ae("right",n);break}};return Z==="editor"&&window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}},[Z,a,c,W,ne]);const Fs=async()=>{if(!(!u.current||!d))try{const{Canvas:t}=await T(async()=>{const{Canvas:g}=await import("./index.min-B_wkc3Zr.js");return{Canvas:g}},[]),s=u.current.querySelector("canvas");s&&s.remove();const r=document.createElement("canvas");r.id="design-canvas",u.current.appendChild(r);const l=new t("design-canvas",{width:d.width,height:d.height,backgroundColor:"#ffffff",selection:!0,preserveObjectStacking:!0});d.canvasData&&l.loadFromJSON(d.canvasData,()=>{l.renderAll()}),l.on("object:modified",()=>{C(l);const g=l.getActiveObject();g&&xe(g)}),l.on("object:added",()=>{C(l)}),l.on("selection:created",g=>{var h;const n=((h=g.selected)==null?void 0:h[0])||l.getActiveObject();xe(n)}),l.on("selection:updated",g=>{var h;const n=((h=g.selected)==null?void 0:h[0])||l.getActiveObject();xe(n)}),l.on("selection:cleared",()=>{je(null)}),js(l),C(l)}catch(t){console.error("Failed to initialize Fabric canvas:",t),i({title:"Failed to initialize canvas",variant:"destructive"})}},C=t=>{const s=t.toJSON(),r=ne.slice(0,W+1);r.push(s),Ns(r),Ue(r.length-1)},Lt=()=>{if(W>0&&a){const t=W-1;a.loadFromJSON(ne[t],()=>{a.renderAll(),Ue(t)})}},Ht=()=>{if(W<ne.length-1&&a){const t=W+1;a.loadFromJSON(ne[t],()=>{a.renderAll(),Ue(t)})}},Ts=()=>{a&&T(async()=>{const{IText:t}=await import("./index.min-B_wkc3Zr.js");return{IText:t}},[]).then(({IText:t})=>{const s=new t("Click to edit",{left:100,top:100,fontFamily:"Arial",fontSize:36,fill:"#000000"});a.add(s),a.setActiveObject(s),a.renderAll()})},K=t=>{a&&T(async()=>{const{Rect:s,Circle:r,Triangle:l,Line:g,Polygon:n}=await import("./index.min-B_wkc3Zr.js");return{Rect:s,Circle:r,Triangle:l,Line:g,Polygon:n}},[]).then(({Rect:s,Circle:r,Triangle:l,Line:g,Polygon:n})=>{let h;const v={left:100,top:100,fill:"#ff6b35",stroke:"#000000",strokeWidth:0};switch(t){case"rectangle":h=new s({...v,width:150,height:100});break;case"circle":h=new r({...v,radius:60});break;case"triangle":h=new l({...v,width:120,height:100});break;case"line":h=new g([50,50,200,50],{left:100,top:100,stroke:"#000000",strokeWidth:3});break;case"arrow":const w=[{x:0,y:20},{x:100,y:20},{x:100,y:0},{x:140,y:30},{x:100,y:60},{x:100,y:40},{x:0,y:40}];h=new n(w,{...v});break;case"star":const S=[],Ze=60,la=25;for(let R=0;R<10;R++){const Q=R%2===0?Ze:la,Qt=Math.PI/5*R-Math.PI/2;S.push({x:Math.cos(Qt)*Q+Ze,y:Math.sin(Qt)*Q+Ze})}h=new n(S,{...v});break;case"hexagon":const Xt=[];for(let R=0;R<6;R++){const Q=Math.PI/3*R-Math.PI/2;Xt.push({x:Math.cos(Q)*60+60,y:Math.sin(Q)*60+60})}h=new n(Xt,{...v});break;case"pentagon":const Kt=[];for(let R=0;R<5;R++){const Q=Math.PI*2/5*R-Math.PI/2;Kt.push({x:Math.cos(Q)*60+60,y:Math.sin(Q)*60+60})}h=new n(Kt,{...v});break;default:h=new s({...v,width:150,height:100})}a.add(h),a.setActiveObject(h),a.renderAll()})},It=t=>{a&&T(async()=>{const{FabricImage:s}=await import("./index.min-B_wkc3Zr.js");return{FabricImage:s}},[]).then(({FabricImage:s})=>{s.fromURL(t,{crossOrigin:"anonymous"}).then(r=>{const l=a.width*.8,g=a.height*.8,n=Math.min(l/r.width,g/r.height,1);
151r.scale(n),r.set({left:(a.width-r.width*n)/2,top:(a.height-r.height*n)/2}),a.add(r),a.setActiveObject(r),a.renderAll()})})},Bs=t=>{var l;const s=(l=t.target.files)==null?void 0:l[0];if(!s)return;const r=new FileReader;r.onload=g=>{var h;const n=(h=g.target)==null?void 0:h.result;It(n)},r.readAsDataURL(s)},Ls=t=>{var l;const s=(l=t.target.files)==null?void 0:l[0];if(!s)return;const r=new FileReader;r.onload=g=>{var n;return wt((n=g.target)==null?void 0:n.result)},r.readAsDataURL(s)},Hs=t=>{var l;const s=(l=t.target.files)==null?void 0:l[0];if(!s)return;const r=new FileReader;r.onload=g=>{var n;return kt((n=g.target)==null?void 0:n.result)},r.readAsDataURL(s)},_t=()=>{if(!a)return;a.getActiveObjects().forEach(s=>{a.remove(s)}),a.discardActiveObject(),a.renderAll(),je(null)},Vt=()=>{if(!a)return;const t=a.getActiveObject();t&&t.clone().then(s=>{s.set({left:t.left+20,top:t.top+20}),a.add(s),a.setActiveObject(s),a.renderAll()})},Is=()=>{if(!a)return;const t=a.getActiveObject();t&&(a.bringObjectToFront(t),a.renderAll())},_s=()=>
151{if(!a)return;const t=a.getActiveObject();t&&(a.sendObjectToBack(t),a.renderAll())},Vs=()=>{if(!a)return;const t=a.getActiveObject();t&&(t.set({left:0}),a.renderAll(),C(a))},Gs=()=>{if(!a)return;const t=a.getActiveObject();if(t){const s=t.getBoundingRect().width;t.set({left:(a.width-s)/2}),a.renderAll(),C(a)}},Us=()=>{if(!a)return;const t=a.getActiveObject();if(t){const s=t.getBoundingRect().width;t.set({left:a.width-s}),a.renderAll(),C(a)}},$s=()=>{if(!a)return;const t=a.getActiveObject();t&&(t.set({top:0}),a.renderAll(),C(a))},qs=()=>{if(!a)return;const t=a.getActiveObject();if(t){const s=t.getBoundingRect().height;t.set({top:(a.height-s)/2}),a.renderAll(),C(a)}},Ws=()=>{if(!a)return;const t=a.getActiveObject();if(t){const s=t.getBoundingRect().height;t.set({top:a.height-s}),a.renderAll(),C(a)}},Xs=()=>{if(!a)return;const t=a.getActiveObject();if(!t||t.type!=="activeSelection"){i({title:"Select multiple objects to distribute",variant:"destructive"});return}const s=t.getObjects();if(s.length<3){i({title:"Select at least 3 objects to distribute",variant:"destructive"});return}s.sort((h,v)=>{const w=h.left+h.getBoundingRect().width/2,S=v.left+v.getBoundingRect().width/2;return w-S});const r=s[0].left+s[0].getBoundingRect().width/2,n=(s[s.length-1].left+s[s.length-1].getBoundingRect().width/2-r)/(s.length-1);s.forEach((h,v)=>{if(v>0&&v<s.length-1){const w=r+n*v,S=h.getBoundingRect().width;h.set({left:w-S/2})}}),a.renderAll(),C(a),i({title:"Objects distributed horizontally"})},Ks=()=>{if(!a)return;const t=a.getActiveObject();if(!t||t.type!=="activeSelection"){i({title:"Select multiple objects to distribute",variant:"destructive"});return}const s=t.getObjects();if(s.length<3){i({title:"Select at least 3 objects to distribute",variant:"destructive"});return}s.sort((h,v)=>{const w=h.top+h.getBoundingRect().height/2,S=v.top+v.getBoundingRect().height/2;return w-S});const r=s[0].top+s[0].getBoundingRect().height/2,n=(s[s.length-1].top+s[s.length-1].getBoundingRect().height/2-r)/(s.length-1);s.forEach((h,v)=>{if(v>0&&v<s.length-1){const w=r+n*v,S=h.getBoundingRect().height;h.set({top:w-S/2})}}),a.renderAll(),C(a),i({title:"Objects distributed vertically"})},Gt=async()=>{if(!a)return;const t=a.getActiveObject();if(!t||t.type!=="activeSelection"){i({title:"Select multiple objects to group",variant:"destructive"});return}const{Group:s}=await T(async()=>{const{Group:g}=await import("./index.min-B_wkc3Zr.js");return{Group:g}},[]),r=t.getObjects();a.discardActiveObject();const l=new s(r,{left:t.left,top:t.top});r.forEach(g=>{a.remove(g)}),a.add(l),a.setActiveObject(l),a.renderAll(),C(a),i({title:"Objects grouped"})},Ut=async()=>{if(!a)return;const t=a.getActiveObject();if(!t||t.type!=="group"){i({title:"Select a group to ungroup",variant:"destructive"});return}const{ActiveSelection:s}=await T(async()=>{const{ActiveSelection:h}=await import("./index.min-B_wkc3Zr.js");return{ActiveSelection:h}},[]),r=t.getObjects(),l=t.left||0,g=t.top||0;a.remove(t),r.forEach(h=>{h.set({left:(h.left||0)+l,top:(h.top||0)+g}),a.add(h)});const n=new s(r,{canvas:a});a.setActiveObject(n),a.renderAll(),C(a),i({title:"Group ungrouped"})},Qs=()=>{if(!a||!c)return;const t=!ke;c.set({lockMovementX:t,lockMovementY:t,lockRotation:t,lockScalingX:t,lockScalingY:t,selectable:!t,evented:!t}),qe(t),a.renderAll(),i({title:t?"Object locked":"Object unlocked"})},Ys=()=>{if(!c){i({title:"Select an object to copy style",variant:"destructive"});return}ws({fill:c.fill,stroke:c.stroke,strokeWidth:c.strokeWidth,opacity:c.opacity,shadow:c.shadow}),i({title:"Style copied"})},Zs=()=>{if(!a||!c||!P){i({title:"No style to paste or no object selected",variant:"destructive"});return}P.fill&&c.set("fill",P.fill),P.stroke&&c.set("stroke",P.stroke),P.strokeWidth!==void 0&&c.set("strokeWidth",P.strokeWidth),P.opacity!==void 0&&c.set("opacity",P.opacity),P.shadow&&c.set("shadow",P.shadow),a.renderAll(),xe(c),C(a),i({title:"Style applied"})},Js=()=>{a&&T(async()=>{const{ActiveSelection:t}=await import("./index.min-B_wkc3Zr.js");return{ActiveSelection:t}},[]).then(({ActiveSelection:t})=>{const s=a.getObjects().filter(l=>l.selectable!==!1);if(s.length===0)return;a.discardActiveObject();const r=new t(s,{canvas:a});a.setActiveObject(r),a.renderAll()})},Ae=(t,s)=>{if(!(!a||!c)){switch(t){case"up":c.set("top",(c.top||0)-s);break;case"down":c.set("top",(c.top||0)+s);break;case"left":c.set("left",(c.left||0)-s);break;case"right":c.set("left",(c.left||0)+s);break}a.renderAll(),C(a)}},N=(t,s)=>{if(!(!a||!c)){if(t==="opacity")c.set("opacity",s/100);else if(t==="shadow"){s?T(async()=>{const{Shadow:r}=await import("./index.min-B_wkc3Zr.js");return{Shadow:r}},[]).then(({Shadow:r})=>{c.set("shadow",new r({color:Ne,blur:ye,offsetX:ve,offsetY:be})),a.renderAll()}):(c.set("shadow",null),a.renderAll());return}else if(t==="shadowBlur"||t==="shadowOffsetX"||t==="shadowOffsetY"||t==="shadowColor"){c.shadow&&T(async()=>{const{Shadow:r}=await import("./index.min-B_wkc3Zr.js");return{Shadow:r}},[]).then(({Shadow:r})=>{const l=t==="shadowBlur"?s:ye,g=t==="shadowOffsetX"?s:ve,n=t==="shadowOffsetY"?s:be,h=t==="shadowColor"?s:Ne;c.set("shadow",new r({color:h,blur:l,offsetX:g,offsetY:n})),a.renderAll()});return}else t==="fontWeight"?c.set("fontWeight",s?"bold":"normal"):t==="fontStyle"?c.set("fontStyle",s?"italic":"normal"):c.set(t,s);a.renderAll(),St(r=>({...r,[t]:s}))}},ea=async()=>
151{if(!a||!d)return;const t=a.toJSON(),s=a.toDataURL({format:"png",quality:.3,multiplier:.25});await Qe.mutateAsync({id:d.id,canvasData:t,thumbnail:s})},$t=t=>{if(!a)return;const s=a.toDataURL({format:t==="jpg"?"jpeg":"png",quality:1,multiplier:2}),r=document.createElement("a");r.download=`${(d==null?void 0:d.name)||"design"}.${t}`,r.href=s,document.body.appendChild(r),r.click(),document.body.removeChild(r),i({title:`Exported as ${t.toUpperCase()}`})},Oe=(t,s,r)=>{switch(s){case"in":return Math.round(t*r);case"cm":return Math.round(t*r/2.54);case"px":default:return Math.round(t)}},qt=()=>F?{width:Oe(U,M,q),height:Oe($,M,q)}:{width:(f==null?void 0:f.width)||1200,height:(f==null?void 0:f.height)||628},ta=()=>{if(!ue.trim()){i({title:"Please enter a project name",variant:"destructive"});return}if(F&&(U<=0||$<=0)){i({title:"Width and height must be greater than zero",variant:"destructive"});return}let t,s,r;F?(t=Oe(U,M,q),s=Oe($,M,q),r=M==="px"?"digital":"print"):(t=(f==null?void 0:f.width)||1200,s=(f==null?void 0:f.height)||628,r=f==null?void 0:f.platform),Ke.mutate({name:ue,width:t,height:s,platformType:r,projectType:"design"})},sa=()=>{if(!O||!z||!fe.trim()){i({title:"Please provide both images and a name",variant:"destructive"});return}Ye.mutate({name:fe,beforeImage:O,afterImage:z,layout:(E==null?void 0:E.layout)||"side-by-side"})},aa=()=>{if(!a||!ee.trim()){i({title:"Please enter text or URL for the QR code",variant:"destructive"});return}const t=document.createElement("canvas");t.width=k,t.height=k;const s=t.getContext("2d");if(s){s.fillStyle="#ffffff",s.fillRect(0,0,k,k),s.fillStyle=X,s.font=`${Math.max(12,k/15)}px Arial`,s.textAlign="center",s.textBaseline="middle";const l=20,n=(k-l*2)/21;s.fillRect(l,l,n*7,n*7),s.fillStyle="#ffffff",s.fillRect(l+n,l+n,n*5,n*5),s.fillStyle=X,s.fillRect(l+n*2,l+n*2,n*3,n*3),s.fillRect(k-l-n*7,l,n*7,n*7),s.fillStyle="#ffffff",s.fillRect(k-l-n*6,l+n,n*5,n*5),s.fillStyle=X,s.fillRect(k-l-n*5,l+n*2,n*3,n*3),s.fillRect(l,k-l-n*7,n*7,n*7),s.fillStyle="#ffffff",s.fillRect(l+n,k-l-n*6,n*5,n*5),s.fillStyle=X,s.fillRect(l+n*2,k-l-n*5,n*3,n*3),s.fillStyle=X;const h=ee.split("").reduce((w,S)=>(w<<5)-w+S.charCodeAt(0),0);for(let w=8;w<13;w++)for(let S=8;S<13;S++)(h+w*S)%2===0&&s.fillRect(l+w*n,l+S*n,n,n);s.fillStyle=X,s.font=`bold ${Math.max(10,k/18)}px Arial`;const v=ee.length>20?ee.substring(0,20)+"...":ee;s.fillText(`QR: ${v}`,k/2,k-8)}const r=t.toDataURL("image/png");It(r),Ce(!1),Rt(""),i({title:"QR Code added to canvas"})},ze=t=>{Os(s=>{const r=s.filter(l=>l.toLowerCase()!==t.toLowerCase());return[t,...r].slice(0,6)})},Me=ze,Wt=t=>{if(!a||!c){i({title:"Select an object to apply color",variant:"destructive"});return}c.type==="line"?c.set("stroke",t):c.set("fill",t),a.renderAll(),xe(c),C(a),ze(t),i({title:"Color applied"})},le=async()=>{if(!a||!c)return;const{Gradient:t}=await T(async()=>{const{Gradient:h}=await import("./index.min-B_wkc3Zr.js");return{Gradient:h}},[]),s=Xe*Math.PI/180,r=c.width||100,l=c.height||100;let g;if(de==="linear"){const h=r/2,v=l/2,w=Math.sqrt(r*r+l*l)/2;g={x1:h-Math.cos(s)*w,y1:v-Math.sin(s)*w,x2:h+Math.cos(s)*w,y2:v+Math.sin(s)*w}}else g={x1:r/2,y1:l/2,x2:r/2,y2:l/2,r1:0,r2:Math.max(r,l)/2};const n=new t({type:de,coords:g,colorStops:[{offset:0,color:he},{offset:1,color:Se}]});c.set("fill",n),a.renderAll(),C(a),ze(he),ze(Se)},Pe=(c==null?void 0:c.type)==="i-text"||(c==null?void 0:c.type)==="text"||(c==null?void 0:c.type)==="textbox",ia=(c==null?void 0:c.type)==="rect";c&&!Pe&&c.type!=="image"&&c.type;const ra=()=>{if(!O||!z||!E)return e.jsx("div",{className:"flex items-center justify-center h-64 bg-gray-100 dark:bg-gray-800 rounded-lg",children:e.jsx("p",{className:"text-gray-500",children:"Upload both images to see preview"})});switch(E.layout){case"side-by-side":return e.jsxs("div",{className:"relative h-64 rounded-lg overflow-hidden flex",children:[e.jsxs("div",{className:"w-1/2 relative",children:[e.jsx("img",{src:O,alt:"Before",className:"w-full h-full object-cover"}),e.jsx("div",{className:"absolute bottom-2 left-2 bg-black/70 text-white px-3 py-1 rounded-full text-sm font-medium",children:"BEFORE"})]}),e.jsxs("div",{className:"w-1/2 relative",children:[e.jsx("img",{src:z,alt:"After",className:"w-full h-full object-cover"}),e.jsx("div",{className:"absolute bottom-2 right-2 bg-orange-500 text-white px-3 py-1 rounded-full text-sm font-medium",children:"AFTER"})]})]});case"vertical":return e.jsxs("div",{className:"relative h-80 rounded-lg overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"h-1/2 relative",children:[e.jsx("img",{src:O,alt:"Before",className:"w-full h-full object-cover"}),e.jsx("div",{className:"absolute top-2 left-2 bg-black/70 text-white px-3 py-1 rounded-full text-sm font-medium",children:"BEFORE"})]}),e.jsxs("div",{className:"h-1/2 relative",children:[e.jsx("img",{src:z,alt:"After",className:"w-full h-full object-cover"}),e.jsx("div",{className:"absolute bottom-2 left-2 bg-orange-500 text-white px-3 py-1 rounded-full text-sm font-medium",children:"AFTER"})]})]});
151case"slider":return e.jsxs("div",{className:"relative h-64 rounded-lg overflow-hidden",children:[e.jsx("img",{src:z,alt:"After",className:"absolute inset-0 w-full h-full object-cover"}),e.jsx("div",{className:"absolute inset-y-0 left-0 overflow-hidden",style:{width:`${Ge}%`},children:e.jsx("img",{src:O,alt:"Before",className:"absolute inset-0 w-full h-full object-cover",style:{minWidth:"100%",objectPosition:"left"}})}),e.jsx("div",{className:"absolute inset-y-0 w-1 bg-white shadow-lg cursor-ew-resize flex items-center justify-center",style:{left:`${Ge}%`,transform:"translateX(-50%)"},children:e.jsx("div",{className:"w-8 h-8 bg-white rounded-full shadow-lg flex items-center justify-center",children:e.jsx(Pa,{className:"h-4 w-4 text-gray-600"})})}),e.jsx("div",{className:"absolute bottom-2 left-2 bg-black/70 text-white px-3 py-1 rounded-full text-sm font-medium",children:"BEFORE"}),e.jsx("div",{className:"absolute bottom-2 right-2 bg-orange-500 text-white px-3 py-1 rounded-full text-sm font-medium",children:"AFTER"}),e.jsx("input",{type:"range",min:"0",max:"100",value:Ge,onChange:s=>bs(Number(s.target.value)),className:"absolute inset-0 w-full h-full opacity-0 cursor-ew-resize"})]});case"diagonal":return e.jsxs("div",{className:"relative h-64 rounded-lg overflow-hidden",children:[e.jsx("img",{src:z,alt:"After",className:"absolute inset-0 w-full h-full object-cover"}),e.jsx("div",{className:"absolute inset-0",style:{clipPath:"polygon(0 0, 100% 0, 0 100%)"},children:e.jsx("img",{src:O,alt:"Before",className:"w-full h-full object-cover"})}),e.jsx("div",{className:"absolute top-2 left-2 bg-black/70 text-white px-3 py-1 rounded-full text-sm font-medium",children:"BEFORE"}),e.jsx("div",{className:"absolute bottom-2 right-2 bg-orange-500 text-white px-3 py-1 rounded-full text-sm font-medium",children:"AFTER"})]});case"framed":return e.jsxs("div",{className:"relative h-64 rounded-lg overflow-hidden bg-gray-900 p-4 flex gap-4",children:[e.jsxs("div",{className:"w-1/2 relative rounded-lg overflow-hidden border-4 border-white shadow-lg",children:[e.jsx("img",{src:O,alt:"Before",className:"w-full h-full object-cover"}),e.jsx("div",{className:"absolute bottom-2 left-2 bg-black/70 text-white px-2 py-0.5 rounded text-xs font-medium",children:"BEFORE"})]}),e.jsxs("div",{className:"w-1/2 relative rounded-lg overflow-hidden border-4 border-orange-500 shadow-lg",children:[e.jsx("img",{src:z,alt:"After",className:"w-full h-full object-cover"}),e.jsx("div",{className:"absolute bottom-2 right-2 bg-orange-500 text-white px-2 py-0.5 rounded text-xs font-medium",children:"AFTER"})]})]});case"circle-reveal":return e.jsxs("div",{className:"relative h-64 rounded-lg overflow-hidden",children:[e.jsx("img",{src:O,alt:"Before",className:"absolute inset-0 w-full h-full object-cover"}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",style:{clipPath:"circle(30% at 65% 50%)"},children:e.jsx("img",{src:z,alt:"After",className:"w-full h-full object-cover"})}),e.jsx("div",{className:"absolute top-2 left-2 bg-black/70 text-white px-3 py-1 rounded-full text-sm font-medium",children:"BEFORE"}),e.jsx("div",{className:"absolute top-2 right-2 bg-orange-500 text-white px-3 py-1 rounded-full text-sm font-medium",children:"AFTER"})]});default:return e.jsxs("div",{className:"relative h-64 rounded-lg overflow-hidden flex",children:[e.jsx("div",{className:"w-1/2 relative",children:e.jsx("img",{src:O,alt:"Before",className:"w-full h-full object-cover"})}),e.jsx("div",{className:"w-1/2 relative",children:e.jsx("img",{src:z,alt:"After",className:"w-full h-full object-cover"})})]})}},na=()=>e.jsxs(L,{className:"h-fit","data-testid":"properties-panel",children:[e.jsx(ot,{className:"pb-3",children:e.jsxs(dt,{className:"text-sm flex items-center gap-2",children:[e.jsx(Ra,{className:"h-4 w-4"}),c?"Properties":"Actions"]})}
151),e.jsxs(H,{className:"space-y-4",children:[e.jsxs(o,{className:"w-full gap-2 bg-orange-500 hover:bg-orange-600",onClick:ea,disabled:Qe.isPending,"data-testid":"action-save",children:[Qe.isPending?e.jsx(De,{className:"h-4 w-4 animate-spin"}):e.jsx(Da,{className:"h-4 w-4"}),"Save Project"]}),e.jsx(A,{}),e.jsxs("div",{children:[e.jsx(m,{className:"text-xs text-gray-500",children:"Export Design"}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsxs(o,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>$t("png"),"data-testid":"export-png",children:[e.jsx(ts,{className:"h-4 w-4 mr-1"}),"PNG"]}),e.jsxs(o,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>$t("jpg"),"data-testid":"export-jpg",children:[e.jsx(ts,{className:"h-4 w-4 mr-1"}),"JPG"]})]})]}),c&&e.jsxs(e.Fragment,{children:[e.jsx(A,{}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(rs,{className:"h-4 w-4 text-orange-500"}),e.jsx("span",{className:"text-sm font-medium",children:"Object Properties"})]}),!Pe&&c.type!=="line"&&e.jsxs("div",{children:[e.jsx(m,{className:"text-xs",children:"Fill Color"}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx("input",{type:"color",value:b.fill||"#ff6b35",onChange:t=>{N("fill",t.target.value),Me(t.target.value)},className:"w-8 h-8 rounded border cursor-pointer","data-testid":"prop-fill-color",disabled:useGradientFill}),e.jsx(B,{value:b.fill||"#ff6b35",onChange:t=>{N("fill",t.target.value),Me(t.target.value)},className:"flex-1 h-8 text-xs","data-testid":"prop-fill-input",disabled:useGradientFill})]})]}),!Pe&&c.type!=="line"&&e.jsxs("div",{className:"border rounded-lg p-3 bg-gray-50 dark:bg-gray-800",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Wa,{className:"h-4 w-4 text-orange-500"}),e.jsx(m,{className:"text-xs font-medium",children:"Use Gradient Fill"})]}),e.jsx(ht,{checked:useGradientFill,onCheckedChange:t=>{setUseGradientFill(t),!t&&c?N("fill",he):t&&le()},"data-testid":"gradient-toggle"})]}),useGradientFill&&e.jsxs("div",{className:"space-y-3 pt-2 border-t border-gray-200 dark:border-gray-700",children:[e.jsxs("div",{children:[e.jsx(m,{className:"text-xs",children:"Gradient Type"}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(o,{variant:de==="linear"?"default":"outline",size:"sm",className:"flex-1 text-xs",onClick:()=>{Ft("linear"),setTimeout(()=>le(),0)},"data-testid":"gradient-type-linear",children:"Linear"}),e.jsx(o,{variant:de==="radial"?"default":"outline",size:"sm",className:"flex-1 text-xs",onClick:()=>{Ft("radial"),setTimeout(()=>le(),0)},"data-testid":"gradient-type-radial",children:"Radial"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx(m,{className:"text-xs",children:"Start Color"}),e.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[e.jsx("input",{type:"color",value:he,onChange:t=>{Ms(t.target.value),Me(t.target.value),setTimeout(()=>le(),0)},className:"w-8 h-8 rounded border cursor-pointer","data-testid":"gradient-start-color"}),e.jsx("span",{className:"text-xs flex-1 truncate",children:he})]})]}),e.jsxs("div",{children:[e.jsx(m,{className:"text-xs",children:"End Color"}),e.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[e.jsx("input",{type:"color",value:Se,onChange:t=>{Ps(t.target.value),Me(t.target.value),setTimeout(()=>le(),0)},className:"w-8 h-8 rounded border cursor-pointer","data-testid":"gradient-end-color"}),e.jsx("span",{className:"text-xs flex-1 truncate",children:Se})]})]})]}),de==="linear"&&e.jsxs("div",{children:[e.jsxs(m,{className:"text-xs",children:["Angle: ",Xe,"°"]}),e.jsx(I,{value:[Xe],onValueChange:t=>{Rs(t[0]),setTimeout(()=>le(),0)},min:0,max:360,step:15,className:"mt-2","data-testid":"gradient-angle"})]})]})]}),e.jsxs("div",{children:[e.jsx(m,{className:"text-xs",children:"Stroke Color"}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx("input",{type:"color",value:b.stroke||"#000000",onChange:t=>N("stroke",t.target.value),className:"w-8 h-8 rounded border cursor-pointer","data-testid":"prop-stroke-color"}),e.jsx(B,{value:b.stroke||"#000000",onChange:t=>N("stroke",t.target.value),className:"flex-1 h-8 text-xs","data-testid":"prop-stroke-input"})]})]}),e.jsxs("div",{children:[e.jsxs(m,{className:"text-xs",children:["Stroke Width: ",b.strokeWidth,"px"]}),e.jsx(I,{value:[b.strokeWidth||0],onValueChange:t=>N("strokeWidth",t[0]),min:0,max:20,step:1,className:"mt-2","data-testid":"prop-stroke-width"})]}),e.jsxs("div",{children:[e.jsxs(m,{className:"text-xs",children:["Opacity: ",b.opacity,"%"]}),e.jsx(I,{value:[b.opacity||100],onValueChange:t=>N("opacity",t[0]),min:0,max:100,step:1,className:"mt-2","data-testid":"prop-opacity"})]}),ia&&e.jsxs("div",{children:[e.jsxs(m,{className:"text-xs",children:["Corner Radius: ",b.rx||0,"px"]}
151),e.jsx(I,{value:[b.rx||0],onValueChange:t=>{N("rx",t[0]),N("ry",t[0])},min:0,max:50,step:1,className:"mt-2","data-testid":"prop-corner-radius"})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(m,{className:"text-xs",children:"Drop Shadow"}),e.jsx(ht,{checked:At,onCheckedChange:t=>{$e(t),N("shadow",t)},"data-testid":"prop-shadow-toggle"})]}),At&&e.jsxs("div",{className:"space-y-3 mt-3 pl-2 border-l-2 border-gray-200 dark:border-gray-700",children:[e.jsxs("div",{children:[e.jsx(m,{className:"text-xs",children:"Shadow Color"}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx("input",{type:"color",value:Ne,onChange:t=>{Pt(t.target.value),N("shadowColor",t.target.value)},className:"w-6 h-6 rounded border cursor-pointer","data-testid":"prop-shadow-color"}),e.jsx("span",{className:"text-xs",children:Ne})]})]}),e.jsxs("div",{children:[e.jsxs(m,{className:"text-xs",children:["Blur: ",ye,"px"]}),e.jsx(I,{value:[ye],onValueChange:t=>{Ot(t[0]),N("shadowBlur",t[0])},min:0,max:50,step:1,className:"mt-1","data-testid":"prop-shadow-blur"})]}),e.jsxs("div",{children:[e.jsxs(m,{className:"text-xs",children:["Offset X: ",ve,"px"]}),e.jsx(I,{value:[ve],onValueChange:t=>{zt(t[0]),N("shadowOffsetX",t[0])},min:-50,max:50,step:1,className:"mt-1","data-testid":"prop-shadow-offset-x"})]}),e.jsxs("div",{children:[e.jsxs(m,{className:"text-xs",children:["Offset Y: ",be,"px"]}),e.jsx(I,{value:[be],onValueChange:t=>{Mt(t[0]),N("shadowOffsetY",t[0])},min:-50,max:50,step:1,className:"mt-1","data-testid":"prop-shadow-offset-y"})]})]})]})]}),Pe&&e.jsxs(e.Fragment,{children:[e.jsx(A,{}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(as,{className:"h-4 w-4 text-orange-500"}),e.jsx("span",{className:"text-sm font-medium",children:"Text Formatting"})]}),e.jsxs("div",{children:[e.jsx(m,{className:"text-xs",children:"Text Color"}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx("input",{type:"color",value:b.fill||"#000000",onChange:t=>N("fill",t.target.value),className:"w-8 h-8 rounded border cursor-pointer","data-testid":"prop-text-color"}),e.jsx(B,{value:b.fill||"#000000",onChange:t=>N("fill",t.target.value),className:"flex-1 h-8 text-xs","data-testid":"prop-text-color-input"})]})]}),e.jsxs("div",{children:[e.jsx(m,{className:"text-xs",children:"Font Family"}),e.jsxs(rt,{value:b.fontFamily||"Arial",onValueChange:t=>N("fontFamily",t),children:[e.jsx(nt,{className:"mt-1 h-8","data-testid":"prop-font-family",children:e.jsx(lt,{})}),e.jsx(ct,{children:ji.map(t=>e.jsx(Y,{value:t,style:{fontFamily:t},children:t},t))})]})]}),e.jsxs("div",{children:[e.jsx(m,{className:"text-xs",children:"Font Size"}),e.jsx(B,{type:"number",min:8,max:200,value:b.fontSize||36,onChange:t=>N("fontSize",parseInt(t.target.value)||36),className:"mt-1 h-8","data-testid":"prop-font-size"})]}),e.jsxs("div",{children:[e.jsx(m,{className:"text-xs",children:"Style"}),e.jsxs("div",{className:"flex gap-1 mt-1",children:[e.jsx(o,{variant:b.fontWeight==="bold"?"default":"outline",size:"sm",className:"flex-1",onClick:()=>N("fontWeight",b.fontWeight!=="bold"),"data-testid":"prop-bold",children:e.jsx($a,{className:"h-4 w-4"})}),e.jsx(o,{variant:b.fontStyle==="italic"?"default":"outline",size:"sm",className:"flex-1",onClick:()=>N("fontStyle",b.fontStyle!=="italic"),"data-testid":"prop-italic",children:e.jsx(Ya,{className:"h-4 w-4"})}),e.jsx(o,{variant:b.underline?"default":"outline",size:"sm",className:"flex-1",onClick:()=>N("underline",!b.underline),"data-testid":"prop-underline",children:e.jsx(ai,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{children:[e.jsx(m,{className:"text-xs",children:"Alignment"}),e.jsxs("div",{className:"flex gap-1 mt-1",children:[e.jsx(o,{variant:b.textAlign==="left"?"default":"outline",size:"sm",className:"flex-1",onClick:()=>N("textAlign","left"),"data-testid":"prop-align-left",children:e.jsx(Ea,{className:"h-4 w-4"})}),e.jsx(o,{variant:b.textAlign==="center"?"default":"outline",size:"sm",className:"flex-1",onClick:()=>N("textAlign","center"),"data-testid":"prop-align-center",children:e.jsx(Fa,{className:"h-4 w-4"})}),e.jsx(o,{variant:b.textAlign==="right"?"default":"outline",size:"sm",className:"flex-1",onClick:()=>N("textAlign","right"),"data-testid":"prop-align-right",children:e.jsx(Ta,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{children:[e.jsxs(m,{className:"text-xs",children:["Line Height: ",(b.lineHeight||1.16).toFixed(2)]}),e.jsx(I,{value:[(b.lineHeight||1.16)*100],onValueChange:t=>N("lineHeight",t[0]/100),min:100,max:300,step:5,className:"mt-2","data-testid":"prop-line-height"})]})]})]})]}),e.jsx(A,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs font-medium text-gray-700 dark:text-gray-300",children:"Canvas Information"}),e.jsxs("div",{className:"text-xs text-gray-500 space-y-1",children:[e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"Size:"})," ",d==null?void 0:d.width," x ",d==null?void 0:d.height,"px"]}),(d==null?void 0:d.platformType)&&e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"Platform:"})," ",d==null?void 0:d.platformType]}),(d==null?void 0:d.platformType)==="print"&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"Print Size (300 DPI):"})," ",(d.width/300).toFixed(2),'" x ',(d.height/300).toFixed(2),'"']}
151),e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"Print Size (72 DPI):"})," ",(d.width/72).toFixed(2),'" x ',(d.height/72).toFixed(2),'"']})]}),e.jsxs("p",{children:[e.jsx("span",{className:"font-medium",children:"Aspect Ratio:"})," ",d?(d.width/d.height).toFixed(2):"N/A"]})]}),e.jsxs(o,{variant:"outline",size:"sm",className:"w-full mt-2",onClick:()=>{var t,s;if(d&&u.current){const r=((s=(t=u.current.parentElement)==null?void 0:t.parentElement)==null?void 0:s.clientWidth)||800,l=500,g=(r-40)/d.width,n=(l-40)/d.height,h=Math.min(g,n,1)*100;ge(Math.max(25,Math.round(h)))}},"data-testid":"btn-fit-to-screen",children:[e.jsx(ms,{className:"h-3 w-3 mr-1"}),"Fit to Screen"]})]})]})]});return e.jsx("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-950",children:e.jsxs("div",{className:"p-4 md:p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl md:text-3xl font-bold text-gray-900 dark:text-white flex items-center gap-2",children:[e.jsx(Yt,{className:"h-7 w-7 text-orange-500"}),"Design Hub"]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mt-1",children:"Create stunning marketing visuals and before/after comparisons"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(Je,{open:vs,onOpenChange:oe,children:[e.jsx(Zt,{asChild:!0,children:e.jsxs(o,{variant:"outline",className:"gap-2","data-testid":"btn-before-after",children:[e.jsx(Le,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Before/After"})]})}),e.jsxs(et,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(tt,{children:[e.jsxs(st,{className:"flex items-center gap-2",children:[e.jsx(Le,{className:"h-5 w-5 text-orange-500"}),"Create Before/After Comparison"]}),e.jsx(at,{children:"Showcase project transformations with professional comparison layouts"})]}),e.jsxs("div",{className:"space-y-6 py-4",children:[e.jsxs("div",{children:[e.jsx(m,{children:"Project Name"}),e.jsx(B,{value:fe,onChange:t=>Ct(t.target.value),placeholder:"e.g., Kitchen Renovation - 123 Main St",className:"mt-1","data-testid":"input-ba-name"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs(m,{className:"flex items-center gap-2 mb-2",children:[e.jsx(ha,{className:"h-4 w-4 text-gray-500"}),"Before Image"]}),e.jsx("div",{className:"border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg p-4 text-center cursor-pointer hover:border-orange-400 transition-colors",onClick:()=>{var t;return(t=D.current)==null?void 0:t.click()},"data-testid":"upload-before",children:O?e.jsx("img",{src:O,alt:"Before",className:"w-full h-32 object-cover rounded"}):e.jsxs(e.Fragment,{children:[e.jsx(ss,{className:"h-8 w-8 text-gray-400 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-500",children:"Click to upload"})]})}),e.jsx("input",{ref:D,type:"file",accept:"image/*",className:"hidden",onChange:Ls})]}),e.jsxs("div",{children:[e.jsxs(m,{className:"flex items-center gap-2 mb-2",children:[e.jsx(xa,{className:"h-4 w-4 text-orange-500"}),"After Image"]}),e.jsx("div",{className:"border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg p-4 text-center cursor-pointer hover:border-orange-400 transition-colors",onClick:()=>{var t;return(t=_.current)==null?void 0:t.click()},"data-testid":"upload-after",children:z?e.jsx("img",{src:z,alt:"After",className:"w-full h-32 object-cover rounded"}):e.jsxs(e.Fragment,{children:[e.jsx(ss,{className:"h-8 w-8 text-gray-400 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-500",children:"Click to upload"})]})}),e.jsx("input",{ref:_,type:"file",accept:"image/*",className:"hidden",onChange:Hs})]})]}),e.jsxs("div",{children:[e.jsx(m,{className:"mb-3 block",children:"Choose Layout Template"}),e.jsx("div",{className:"grid grid-cols-4 gap-3",children:jt.map(t=>e.jsxs("div",{className:`p-3 border-2 rounded-lg cursor-pointer text-center transition-all ${(E==null?void 0:E.id)===t.id?"border-orange-500 bg-orange-50 dark:bg-orange-950":"border-gray-200 dark:border-gray-700 hover:border-orange-300"}`,onClick:()=>Nt(t),"data-testid":`template-${t.id}`,children:[e.jsx(t.icon,{className:`h-6 w-6 mx-auto mb-1 ${(E==null?void 0:E.id)===t.id?"text-orange-500":"text-gray-500"}`}),e.jsx("p",{className:"text-xs font-medium",children:t.name})]},t.id))})]}),e.jsxs("div",{children:[e.jsx(m,{className:"mb-3 block",children:"Preview"}),ra()]})]}),e.jsxs(it,{children:[e.jsx(o,{variant:"outline",onClick:()=>oe(!1),children:"Cancel"}),e.jsxs(o,{onClick:sa,disabled:!O||!z||!fe.trim()||Ye.isPending,className:"gap-2","data-testid":"btn-create-ba",children:[Ye.isPending?e.jsx(De,{className:"h-4 w-4 animate-spin"}):e.jsx(Ee,{className:"h-4 w-4"}),"Create Comparison"]})]})]})]}),e.jsx(Je,{open:Cs,onOpenChange:Ce,children:e.jsxs(et,{className:"max-w-md",children:[e.jsxs(tt,{children:[e.jsxs(st,{className:"flex items-center gap-2",children:[e.jsx(pt,{className:"h-5 w-5 text-orange-500"}),"Generate QR Code"]}),e.jsx(at,{children:"Create a QR code for your URL or text content"})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{children:[e.jsx(m,{children:"URL or Text Content"}),e.jsx(B,{value:ee,onChange:t=>Rt(t.target.value),placeholder:"https://example.com or any text",className:"mt-1","data-testid":"input-qr
151-text"})]}),e.jsxs("div",{children:[e.jsxs(m,{className:"text-xs",children:["Size: ",k,"px"]}),e.jsx(I,{value:[k],onValueChange:t=>Ss(t[0]),min:100,max:300,step:10,className:"mt-2","data-testid":"slider-qr-size"})]}),e.jsxs("div",{children:[e.jsx(m,{className:"text-xs",children:"Foreground Color"}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx("input",{type:"color",value:X,onChange:t=>Dt(t.target.value),className:"w-8 h-8 rounded border cursor-pointer","data-testid":"input-qr-color"}),e.jsx(B,{value:X,onChange:t=>Dt(t.target.value),className:"flex-1 h-8 text-xs","data-testid":"input-qr-color-text"})]})]}),e.jsxs("div",{className:"p-4 bg-gray-100 dark:bg-gray-800 rounded-lg text-center",children:[e.jsx("div",{className:"inline-block border-2 border-gray-300 p-2 bg-white",style:{width:Math.min(k,150),height:Math.min(k,150)},children:e.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-gray-500",children:"QR Preview"})}),e.jsxs("p",{className:"text-xs text-gray-500 mt-2",children:["Preview size: ",Math.min(k,150),"px (actual: ",k,"px)"]})]})]}),e.jsxs(it,{children:[e.jsx(o,{variant:"outline",onClick:()=>Ce(!1),children:"Cancel"}),e.jsxs(o,{onClick:aa,disabled:!ee.trim(),className:"gap-2","data-testid":"btn-generate-qr",children:[e.jsx(pt,{className:"h-4 w-4"}),"Generate QR Code"]})]})]})}),e.jsxs(Je,{open:ys,onOpenChange:J,children:[e.jsx(Zt,{asChild:!0,children:e.jsxs(o,{className:"gap-2 bg-orange-500 hover:bg-orange-600","data-testid":"btn-new-project",children:[e.jsx(Ee,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"New Design"})]})}),e.jsxs(et,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(tt,{children:[e.jsx(st,{children:"Create New Design"}),e.jsx(at,{children:"Choose a platform template or start with custom dimensions"})]}),e.jsxs("div",{className:"space-y-6 py-4",children:[e.jsxs("div",{children:[e.jsx(m,{children:"Project Name"}),e.jsx(B,{value:ue,onChange:t=>vt(t.target.value),placeholder:"My awesome design",className:"mt-1","data-testid":"input-project-name"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(o,{variant:F?"outline":"default",onClick:()=>bt(!1),className:`flex-1 gap-2 ${F?"":"bg-orange-500 hover:bg-orange-600"}`,"data-testid":"btn-templates-mode",children:[e.jsx(is,{className:"h-4 w-4"}),"Templates"]}),e.jsxs(o,{variant:F?"default":"outline",onClick:()=>{bt(!0),G(null)},className:`flex-1 gap-2 ${F?"bg-orange-500 hover:bg-orange-600":""}`,"data-testid":"btn-custom-size-mode",children:[e.jsx(ka,{className:"h-4 w-4"}),"Custom Size"]})]}),F?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(m,{children:"Width"}),e.jsx(B,{type:"number",value:U,onChange:t=>ae(parseFloat(t.target.value)||0),min:.1,step:M==="px"?1:.1,className:"mt-1","data-testid":"input-custom-width"})]}),e.jsxs("div",{children:[e.jsx(m,{children:"Height"}),e.jsx(B,{type:"number",value:$,onChange:t=>ie(parseFloat(t.target.value)||0),min:.1,step:M==="px"?1:.1,className:"mt-1","data-testid":"input-custom-height"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(m,{children:"Unit"}),e.jsxs(rt,{value:M,onValueChange:t=>re(t),children:[e.jsx(nt,{className:"mt-1","data-testid":"select-unit",children:e.jsx(lt,{})}),e.jsxs(ct,{children:[e.jsx(Y,{value:"px",children:"Pixels (px)"}),e.jsx(Y,{value:"in",children:"Inches (in)"}),e.jsx(Y,{value:"cm",children:"Centimeters (cm)"})]})]})]}),M!=="px"&&e.jsxs("div",{children:[e.jsx(m,{children:"DPI (Resolution)"}),e.jsxs(rt,{value:q.toString(),onValueChange:t=>pe(parseInt(t)),children:[e.jsx(nt,{className:"mt-1","data-testid":"select-dpi",children:e.jsx(lt,{})}),e.jsxs(ct,{children:[e.jsx(Y,{value:"72",children:"72 DPI (Web)"}),e.jsx(Y,{value:"150",children:"150 DPI (Draft)"}),e.jsx(Y,{value:"300",children:"300 DPI (Print)"}),e.jsx(Y,{value:"600",children:"600 DPI (High Quality)"})]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-[1fr,2fr] gap-4",children:[e.jsxs("div",{className:"flex flex-col items-center justify-center p-4 bg-gray-100 dark:bg-gray-800 rounded-lg",children:[e.jsx("div",{className:"bg-white dark:bg-gray-700 border-2 border-orange-500 flex items-center justify-center text-xs text-gray-500",style:{width:Math.min(100,100*(U/Math.max(U,$))),height:Math.min(100,100*($/Math.max(U,$)))},children:"Preview"}),e.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"Aspect Ratio"})]}),e.jsxs("div",{className:"p-4 bg-gray-50 dark:bg-gray-800 rounded-lg",children:[e.jsx("p",{className:"font-medium text-sm mb-2",children:"Size Information"}),e.jsxs("div",{className:"space-y-1 text-sm",children:[e.jsxs("p",{children:[e.jsx("span",{className:"text-gray-500",children:"Input:"})," ",U," x ",$," ",M]}),e.jsxs("p",{children:[e.jsx("span",{className:"text-gray-500",children:"Output:"})," ",qt().width," x ",qt().height," px"]}),M!=="px"&&e.jsxs("p",{children:[e.jsx("span",{className:"text-gray-500",children:"Resolution:"})," ",q," DPI"]}),e.jsx("p",{className:"text-xs text-gray-400 mt-2",children:M==="px"?"Best for web and digital use":q>=300?"High quality for professional printing":q>=150?"Good for draft prints":"Best for screen/web only"})]})]})]}),e.jsxs("div",{children:[e.jsx(m,{className:"text-xs text-gray-500",children:"Common Sizes"}),e.jsxs("div",{className:"flex flex-wrap gap-2 mt-2",children:[e.jsx(o,{type:"button",variant:"outline",size:"sm",onClick:()=>{ae(8.5),ie(11),re("in"),pe(300)},"data-testid":"preset-letter",children:'Letter (8.5" x 11")'}),e.jsx(o,{type:"button",variant:"outline",size:"sm",onClick:()=>{ae(3.5),ie(2),re("in"),pe(300)},"data-testid":"preset-business-card",children:'Business Card (3.5" x 2")'}),e.jsx(o,{type:"button",variant:"outline",size:"sm",onClick:()=>{ae(4),ie(6),re("in"),pe(300)},"data-testid":"preset-postcard",children:'Postcard (4" x 6")'}),e.jsx(o,{type:"button",variant:"outline",size:"sm",onClick:()=>{ae(1920),ie(1080),re("px")},"data-testid":"preset-1080p",children:"1080p HD"}),e.jsx(o,{type:"button",variant:"outline",size:"sm",onClick:()=>{ae(3840),ie(2160),re("px")},"data-testid":"preset-4k",children:"4K Ultra HD"})]})]})]}):e.jsxs("div",{children:[e.jsx(m,{className:"mb-3 block",children:"Platform Templates"}),e.jsx(ma,{className:"h-60",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2",children:"Social Media"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:ce.filter(t=>t.category==="social").map(t=>e.jsx("div",{className:`p-2.5 border-2 rounded-lg cursor-pointer transition-all ${(f==null?void 0:f.id)===t.id?"border-orange-500 bg-orange-50 dark:bg-orange-950":"border-gray-200 dark:border-gray-700 hover:border-orange-300"}`,onClick:()=>G(t),"data-testid":`platform-${t.id}`,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(t.icon,{className:`h-4 w-4 ${(f==null?void 0:f.id)===t.id?"text-orange-500":"text-gray-500"}`}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:t.name}),e.jsxs("p",{className:"text-xs text-gray-500",children:[t.width," x ",t.height]})]})]})},t.id))})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2",children:"Print & Flyers"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:ce.filter(t=>t.category==="print").map(t=>e.jsx("div",{className:`p-2.5 border-2 rounded-lg cursor-pointer transition-all ${(f==null?void 0:f.id)===t.id?"border-orange-500 bg-orange-50 dark:bg-orange-950":"border-gray-200 dark:border-gray-700 hover:border-orange-300"}`,onClick:()=>G(t),"data-testid":`platform-${t.id}`,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(t.icon,{className:`h-4 w-4 ${(f==null?void 0:f.id)===t.id?"text-orange-500":"text-gray-500"}`}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:t.name}),e.jsx("p",{className:"text-xs text-gray-500",children:t.description})]})]})},t.id))})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2",children:"Video & Display Ads"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:ce.filter(t=>t.category==="video"||t.category==="display").map(t=>e.jsx("div",{className:`p-2.5 border-2 rounded-lg cursor-pointer transition-all ${(f==null?void 0:f.id)===t.id?"border-orange-500 bg-orange-50 dark:bg-orange-950":"border-gray-200 dark:border-gray-700 hover:border-orange-300"}`,onClick:()=>G(t),"data-testid":`platform-${t.id}`,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(t.icon,{className:`h-4 w-4 ${(f==null?void 0:f.id)===t.id?"text-orange-500":"text-gray-500"}`}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:t.name}),e.jsxs("p",{className:"text-xs text-gray-500",children:[t.width," x ",t.height]})]})]})},t.id))})]})]})})]}),!F&&f&&e.jsxs("div",{className:"p-4 bg-orange-50 dark:bg-orange-950 rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(f.icon,{className:"h-5 w-5 text-orange-500"}),e.jsx("span",{className:"font-medium",children:f.name})]}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:f.description}),e.jsxs("p",{className:"text-sm mt-1",children:[e.jsx("span",{className:"font-medium",children:"Size:"})," ",f.width," x ",f.height,"px"]})]})]}),e.jsxs(it,{children:[e.jsx(o,{variant:"outline",onClick:()=>J(!1),children:"Cancel"}),e.jsxs(o,{onClick:ta,disabled:!ue.trim()||Ke.isPending||!F&&!f,className:"gap-2","data-testid":"btn-create-project",children:[Ke.isPending?e.jsx(De,{className:"h-4 w-4 animate-spin"}):e.jsx(Ee,{className:"h-4 w-4"}),"Create Design"]})]})]})]})]})]}),e.jsxs(Na,{value:Z,onValueChange:V,className:"space-y-4",children:[e.jsxs(wa,{children:[e.jsxs(xt,{value:"projects",className:"gap-2","data-testid":"tab-projects",children:[e.jsx(is,{className:"h-4 w-4"}),"My Projects"]}),e.jsxs(xt,{value:"editor",className:"gap-2",disabled:!d,"data-testid":"tab-editor",children:[e.jsx(gt,{className:"h-4 w-4"}),"Design Editor"]}),e.jsxs(xt,{value:"templates",className:"gap-2","data-testid":"tab-templates",children:[e.jsx(yt,{className:"h-4 w-4"}),"Templates"]})]}),e.jsx(mt,{value:"projects",className:"space-y-4",children:Ds?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(De,{className:"h-8 w-8 animate-spin text-orange-500"})}):Bt.length===0?e.jsx(L,{className:"border-dashed",children:e.jsxs(H,{
151className:"flex flex-col items-center justify-center py-12",children:[e.jsx(ut,{className:"h-16 w-16 text-gray-300 mb-4"}),e.jsx("h3",{className:"text-lg font-medium mb-2",children:"No designs yet"}),e.jsx("p",{className:"text-gray-500 text-center mb-4",children:"Create your first design or before/after comparison"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(o,{variant:"outline",onClick:()=>oe(!0),className:"gap-2",children:[e.jsx(Le,{className:"h-4 w-4"}),"Before/After"]}),e.jsxs(o,{onClick:()=>J(!0),className:"gap-2 bg-orange-500 hover:bg-orange-600",children:[e.jsx(Ee,{className:"h-4 w-4"}),"New Design"]})]})]})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:Bt.map(t=>e.jsxs(L,{className:"group cursor-pointer hover:border-orange-300 transition-colors overflow-hidden","data-testid":`project-card-${t.id}`,children:[e.jsxs("div",{className:"aspect-video bg-gray-100 dark:bg-gray-800 relative overflow-hidden",children:[t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name,className:"w-full h-full object-cover"}):e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx(ut,{className:"h-12 w-12 text-gray-300"})}),e.jsxs("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-2",children:[e.jsxs(o,{size:"sm",variant:"secondary",onClick:()=>{_e(t),V("editor")},"data-testid":`edit-project-${t.id}`,children:[e.jsx(gt,{className:"h-4 w-4 mr-1"}),"Edit"]}),e.jsx(o,{size:"sm",variant:"destructive",onClick:s=>{s.stopPropagation(),Es.mutate(t.id)},"data-testid":`delete-project-${t.id}`,children:e.jsx(Jt,{className:"h-4 w-4"})})]}),t.projectType==="before-after"&&e.jsx(ga,{className:"absolute top-2 left-2 bg-orange-500",children:"Before/After"})]}
151),e.jsxs(H,{className:"p-4",children:[e.jsx("h3",{className:"font-medium truncate",children:t.name}),e.jsxs("p",{className:"text-sm text-gray-500",children:[t.width," x ",t.height,"px"]})]})]},t.id))})}),e.jsx(mt,{value:"editor",className:"space-y-4",children:d?e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[250px_1fr_280px] gap-4",children:[e.jsxs(L,{className:"h-fit","data-testid":"tools-panel",children:[e.jsx(ot,{className:"pb-3",children:e.jsx(dt,{className:"text-sm",children:"Tools"})}),e.jsxs(H,{className:"space-y-2",children:[e.jsxs(o,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",onClick:Ts,"data-testid":"tool-text",children:[e.jsx(as,{className:"h-4 w-4"}),"Add Text"]}),e.jsx(A,{className:"my-3"}),e.jsx(m,{className:"text-xs text-gray-500",children:"Basic Shapes"}),e.jsxs(o,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",onClick:()=>K("rectangle"),"data-testid":"tool-rectangle",children:[e.jsx(Ca,{className:"h-4 w-4"}),"Rectangle"]}),e.jsxs(o,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",onClick:()=>K("circle"),"data-testid":"tool-circle",children:[e.jsx(hs,{className:"h-4 w-4"}),"Circle"]}),e.jsxs(o,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",onClick:()=>K("triangle"),"data-testid":"tool-triangle",children:[e.jsx(gs,{className:"h-4 w-4"}),"Triangle"]}),e.jsx(A,{className:"my-3"}),e.jsx(m,{className:"text-xs text-gray-500",children:"Lines & Arrows"}),e.jsxs(o,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",onClick:()=>K("line"),"data-testid":"tool-line",children:[e.jsx(Sa,{className:"h-4 w-4"}),"Line"]}),e.jsxs(o,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",onClick:()=>K("arrow"),"data-testid":"tool-arrow",children:[e.jsx(ua,{className:"h-4 w-4"}),"Arrow"]}),e.jsx(A,{className:"my-3"}),e.jsx(m,{className:"text-xs text-gray-500",children:"Complex Shapes"}),e.jsxs(o,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",onClick:()=>K("star"),"data-testid":"tool-star",children:[e.jsx(pa,{className:"h-4 w-4"}),"Star"]}),e.jsxs(o,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",onClick:()=>K("hexagon"),"data-testid":"tool-hexagon",children:[e.jsx(Ka,{className:"h-4 w-4"}),"Hexagon"]}),e.jsxs(o,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",onClick:()=>K("pentagon"),"data-testid":"tool-pentagon",children:[e.jsx(Ja,{className:"h-4 w-4"}),"Pentagon"]}),e.jsx(A,{className:"my-3"}),e.jsxs(o,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",onClick:()=>{var t;return(t=j.current)==null?void 0:t.click()},"data-testid":"tool-image",children:[e.jsx(Qa,{className:"h-4 w-4"}),"Add Image"]}),e.jsx("input",{ref:j,type:"file",accept:"image/*",className:"hidden",onChange:Bs}),e.jsxs(o,{variant:"outline",size:"sm",className:"w-full justify-start gap-2",onClick:()=>Ce(!0),"data-testid":"tool-qrcode",children:[e.jsx(pt,{className:"h-4 w-4"}),"QR Code"]}),e.jsx(A,{className:"my-3"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(o,{variant:"outline",size:"sm",onClick:Lt,disabled:W<=0,"data-testid":"tool-undo",children:e.jsx(ii,{className:"h-4 w-4"})}),e.jsx(o,{variant:"outline",size:"sm",onClick:Ht,disabled:W>=ne.length-1,"data-testid":"tool-redo",children:e.jsx(ei,{className:"h-4 w-4"})}),e.jsx(o,{variant:"outline",size:"sm",onClick:_t,"data-testid":"tool-delete",children:e.jsx(Jt,{className:"h-4 w-4"})}),e.jsx(o,{variant:"outline",size:"sm",onClick:Vt,"data-testid":"tool-duplicate",children:e.jsx(Aa,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsxs(o,{variant:"outline",size:"sm",onClick:Is,title:"Bring to Front","data-testid":"tool-front",children:[e.jsx(es,{className:"h-4 w-4"}),e.jsx(fa,{className:"h-3 w-3"})]}),e.jsxs(o,{variant:"outline",size:"sm",onClick:_s,title:"Send to Back","data-testid":"tool-back",children:[e.jsx(ja,{className:"h-3 w-3"}),e.jsx(es,{className:"h-4 w-4"})]})]}),e.jsx(A,{className:"my-3"}),e.jsx(m,{className:"text-xs text-gray-500",children:"Align to Canvas"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex gap-1",children:[e.jsx(o,{variant:"outline",size:"sm",onClick:Vs,title:"Align Left",disabled:!c,"data-testid":"align-left",children:e.jsx(Va,{className:"h-4 w-4"})}),e.jsx(o,{variant:"outline",size:"sm",onClick:Gs,title:"Align Center",disabled:!c,"data-testid":"align-center",children:e.jsx(Ba,{className:"h-4 w-4"})}),e.jsx(o,{variant:"outline",size:"sm",onClick:Us,title:"Align Right",disabled:!c,"data-testid":"align-right",children:e.jsx(Ha,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(o,{variant:"outline",size:"sm",onClick:$s,title:"Align Top",disabled:!c,"data-testid":"align-top",children:e.jsx(Ga,{className:"h-4 w-4"})}),e.jsx(o,{variant:"outline",size:"sm",onClick:qs,title:"Align Middle",disabled:!c,"data-testid":"align-middle",children:e.jsx(La,{className:"h-4 w-4"})}),e.jsx(o,{variant:"outline",size:"sm",onClick:Ws,title:"Align Bottom",disabled:!c,"data-testid":"align-bottom",children:e.jsx(Ia,{className:"h-4 w-4"})})]})]}),e.jsx(m,{className:"text-xs text-gray-500 mt-2",children:"Distribute Objects"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsxs(o,{variant:"outline",size:"sm",onClick:Xs,title:"Distribute Horizontally (select 3+ objects)",className:"flex-1","data-testid":"distribute-horizontal",children:[e.jsx(_a,{className:"h-4 w-4 mr-1"}),e.jsx("span",{className:"text-xs",children:"H"})]}),e.jsxs(o,{variant:"outline",size:"sm",onClick:Ks,title:"Distribute Vertically (select 3+ objects)",className:"flex-1","data-testid":"distribute-vertical",children:[e.jsx(Ua,{className:"h-4 w-4 mr-1"}),e.jsx("span",{className:"text-xs",children:"V"})]})]}),e.jsxs("div",{className:"flex items-center justify-between mt-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(yt,{className:"h-4 w-4 text-gray-500"}),e.jsx(m,{className:"text-xs",children:"Snap to Grid"})]}),e.jsx(ht,{checked:Ve,onCheckedChange:fs,"data-testid":"toggle-grid"})]}),Ve&&e.jsxs("div",{className:"mt-2",children:[e.jsxs(m,{className:"text-xs text-gray-500",children:["Grid Size: ",we,"px"]}),e.jsx(I,{value:[we],onValueChange:t=>ks(t[0]),min:10,max:50,step:5,className:"mt-1","data-testid":"grid-size-slider"})]}),e.jsx(A,{className:"my-3"}),e.jsx(m,{className:"text-xs text-gray-500",children:"Object Management"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(o,{variant:"outline",size:"sm",onClick:Gt,title:"Group (Ctrl+G)","data-testid":"tool-group",children:e.jsx(Xa,{className:"h-4 w-4"})}),e.jsx(o,{variant:"outline",size:"sm",onClick:Ut,title:"Ungroup (Ctrl+Shift+G)","data-testid":"tool-ungroup",children:e.jsx(ri,{className:"h-4 w-4"})}),e.jsx(o,{variant:ke?"default":"outline",size:"sm",onClick:Qs,title:ke?"Unlock Object":"Lock Object",disabled:!c,"data-testid":"tool-lock",children:ke?e.jsx(ya,{className:"h-4 w-4"}):e.jsx(Oa,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex gap-1 mt-1",children:[e.jsxs(o,{variant:"outline",size:"sm",onClick:Ys,title:"Copy Style",disabled:!c,className:"flex-1","data-testid":"tool-copy-style",children:[e.jsx(Za,{className:"h-4 w-4 mr-1"}),"Copy"]}),e.jsxs(o,{variant:"outline",size:"sm",onClick:Zs,title:"Paste Style",disabled:!c||!P,className:"flex-1","data-testid":"tool-paste-style",children:[e.jsx(rs,{className:"h-4 w-4 mr-1"}),"Paste"]})]}),e.jsx(A,{className:"my-3"}),e.jsxs("div",{className:"border rounded-lg overflow-hidden","data-testid":"brand-kit-panel",children:[e.jsxs("button",{className:"w-full flex items-center justify-between p-2 bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",onClick:()=>As(!We),"data-testid":"brand-kit-toggle",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Yt,{className:"h-4 w-4 text-orange-500"}),e.jsx("span",{className:"text-sm font-medium",children:"Brand Kit"})]}),e.jsx(va,{className:`h-4 w-4 transition-transform ${We?"rotate-180":""}`})]}),We&&e.jsxs("div",{className:"p-3 space-y-3",children:[e.jsxs("div",{children:[e.jsx(m,{className:"text-xs text-gray-500 mb-2 block",children:"Brand Colors"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:zs.map((t,s)=>e.jsx("button",{className:`w-7 h-7 rounded border-2 transition-all hover:scale-110 ${t==="#ffffff"?"border-gray-300":"border-transparent hover:border-orange-400"}`,style:{backgroundColor:t},onClick:()=>Wt(t),title:"Click to apply fill color","data-testid":`brand-color-${s}`},t))})]}),Et.length>0&&e.jsxs("div",{children:[e.jsx(m,{className:"text-xs text-gray-500 mb-2 block",children:"Recently Used"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:Et.map((t,s)=>e.jsx("button",{className:`w-7 h-7 rounded border-2 transition-all hover:scale-110 ${t.toLowerCase()==="#ffffff"?"border-gray-300":"border-transparent hover:border-orange-400"}`,style:{backgroundColor:t},onClick:()=>Wt(t),title:"Click to apply fill color","data-testid":`recent-color-${s}`},`${t}-${s}`))})]}),e.jsxs(o,{variant:"outline",size:"sm",className:"w-full justify-start gap-2 opacity-50 cursor-not-allowed",disabled:!0,"data-testid":"brand-logo-btn",children:[e.jsx(ut,{className:"h-4 w-4"}),"Brand Logo (Coming Soon)"]})]})]})]})]}),e.jsxs(L,{children:[e.jsx(ot,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(dt,{className:"text-sm",children:d.name}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(o,{variant:"outline",size:"sm",onClick:()=>ge(Math.max(25,me-25)),"data-testid":"zoom-out",children:e.jsx(li,{className:"h-4 w-4"})}),e.jsxs("span",{className:"text-sm w-12 text-center",children:[me,"%"]}),e.jsx(o,{variant:"outline",size:"sm",onClick:()=>ge(Math.min(200,me+25)),"data-testid":"zoom-in",children:e.jsx(ni,{className:"h-4 w-4"})})]})]})}),e.jsx(H,{children:e.jsx("div",{className:"border rounded-lg overflow-auto bg-gray-100 dark:bg-gray-900 flex items-center justify-center p-4",style:{minHeight:"500px"},children:e.jsxs("div",{className:"relative",style:{transform:`scale(${me/100})`,transformOrigin:"center"},children:[Ve&&d&&e.jsx("div",{className:"absolute inset-0 pointer-events-none z-10",style:{width:d.width,height:d.height,backgroundImage:`
152                                linear-gradient(to right, rgba(0, 0, 0, 0.1) 1px, transparent 1px),
153                                linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 1px, transparent 1px)
154                              `,backgroundSize:`${we}px ${we}px`},"data-testid":"grid-overlay"}),e.jsx("div",{ref:u,"data-testid":"canvas-container"})]})})})]}),na()]}
154):e.jsx(L,{children:e.jsxs(H,{className:"flex flex-col items-center justify-center py-12",children:[e.jsx(gt,{className:"h-16 w-16 text-gray-300 mb-4"}),e.jsx("h3",{className:"text-lg font-medium mb-2",children:"No Project Selected"}),e.jsx("p",{className:"text-gray-500 mb-4",children:"Select a project from My Projects or create a new one"}),e.jsx(o,{onClick:()=>V("projects"),variant:"outline",children:"View My Projects"})]})})}),e.jsxs(mt,{value:"templates",className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Before/After Templates"}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:jt.map(t=>e.jsx(L,{className:"cursor-pointer hover:border-orange-300 transition-colors",onClick:()=>{Nt(t),oe(!0)},"data-testid":`ba-template-${t.id}`,children:e.jsxs(H,{className:"p-4 text-center",children:[e.jsx(t.icon,{className:"h-10 w-10 text-orange-500 mx-auto mb-2"}),e.jsx("h4",{className:"font-medium",children:t.name}),e.jsx("p",{className:"text-xs text-gray-500",children:t.description})]})},t.id))})]}),e.jsx(A,{}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Social Media Templates"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:ce.filter(t=>t.category==="social").map(t=>e.jsx(L,{className:"cursor-pointer hover:border-orange-300 transition-colors",onClick:()=>{G(t),J(!0)},"data-testid":`size-template-${t.id}`,children:e.jsx(H,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(t.icon,{className:"h-8 w-8 text-gray-600"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium",children:t.name}),e.jsxs("p",{className:"text-sm text-gray-500",children:[t.width," x ",t.height,"px"]}),e.jsx("p",{className:"text-xs text-gray-400",children:t.description})]})]})})},t.id))})]}),e.jsx(A,{}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[e.jsx(xs,{className:"h-5 w-5 text-orange-500"}),"Print & Flyer Templates"]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:ce.filter(t=>t.category==="print").map(t=>e.jsx(L,{className:"cursor-pointer hover:border-orange-300 transition-colors",onClick:()=>{G(t),J(!0)},"data-testid":`size-template-${t.id}`,children:e.jsx(H,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(t.icon,{className:"h-8 w-8 text-orange-500"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium",children:t.name}),e.jsx("p",{className:"text-sm text-gray-500",children:t.description}),e.jsxs("p",{className:"text-xs text-gray-400",children:[t.width," x ",t.height,"px"]})]})]})})},t.id))})]}),e.jsx(A,{}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Video & Display Ads"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:ce.filter(t=>t.category==="video"||t.category==="display").map(t=>e.jsx(L,{className:"cursor-pointer hover:border-orange-300 transition-colors",onClick:()=>{G(t),J(!0)},"data-testid":`size-template-${t.id}`,children:e.jsx(H,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(t.icon,{className:"h-8 w-8 text-gray-600"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium",children:t.name}),e.jsxs("p",{className:"text-sm text-gray-500",children:[t.width," x ",t.height,"px"]}),e.jsx("p",{className:"text-xs text-gray-400",children:t.description})]})]})})},t.id))})]})]})]})]})]})})}export{Li as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.