PageSourceSearch

https://pixeliro.com/_next/static/chunks/4585121555914785.js

js pixeliro.com collected 2026-10-02 01:39:49 UTC 30,598 bytes, 53 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="ed471177-dd92-9b72-4178-7e1050f0225f")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,716787,836804,e=>{"use strict";var t=e.i(843476),s=e.i(500932),r=e.i(271645),a=e.i(948148),i=e.i(951445),n=e.i(453136),l=e.i(826707),o=e.i(367240);let c=[{key:"desktop",label:"Desktop",width:"100%",Icon:i.Monitor},{key:"tablet",label:"Tablet",width:768,Icon:n.Tablet},{key:"mobile",label:"Mobile",width:375,Icon:l.Smartphone}];function d(e){let i,n,l,d,p,x,u,h,f,g,b,y,v,w,j,N,k,$,S,z,C,M,P,R,E=(0,s.c)(76),{children:L,url:F,iframeSrc:T,title:I,className:B,style:_,height:U,showRefresh:D,showNavButtons:A,theme:O,showDeviceSwitcher:H,defaultDevice:W,onDeviceChange:J}=e,V=void 0===F?"https://pixeliro.app":F,X=void 0===U?"100%":U,K=void 0===D||D,G=void 0===A||A,Y=void 0!==H&&H,q=(0,a.useTranslations)("MockBrowser"),Q="dark"===(void 0===O?"dark":O),[Z,ee]=(0,r.useState)(void 0===W?"desktop":W),[et,es]=(0,r.useState)(1200),[er,ea]=(0,r.useState)("1200"),[ei,en]=(0,r.useState)(!1),el=(0,r.useRef)(null),eo=(0,r.useRef)(null),ec=(0,r.useRef)(0),ed=(0,r.useRef)(0),em=e=>{if(ee(e),"custom"!==e){let t=c.find(t=>t.key===e);if(t&&"number"==typeof t.width)es(t.width),ea(String(t.width));else if(t&&"100%"===t.width&&el.current){let e=el.current.offsetWidth;es(e),ea(String(e))}}J?.(e)};E[0]===Symbol.for("react.memo_cache_sentinel")?(i=e=>{let t=e.target.value;ea(t);let s=parseInt(t,10);!isNaN(s)&&s>=280&&s<=2560&&(es(s),ee("custom"))},E[0]=i):i=E[0];let ep=i;E[1]!==er?(n=()=>{let e=parseInt(er,10);isNaN(e)||e<280?(ea("280"),es(280)):e>2560&&(ea("2560"),es(2560))},E[1]=er,E[2]=n):n=E[2];let ex=n;E[3]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{if(ee("desktop"),el.current){let e=el.current.offsetWidth;es(e),ea(String(e))}},E[3]=l):l=E[3];let eu=l;E[4]!==et?(d=(e,t)=>{e.preventDefault(),en(!0),ec.current=e.clientX,ed.current=et;let s=e=>{let s="right"===t?e.clientX-ec.current:ec.current-e.clientX,r=Math.max(280,Math.min(2560,ed.current+2*s));es(r),ea(String(Math.round(r))),ee("custom")},r=()=>{en(!1),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",r),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="ew-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",s),document.addEventListener("mouseup",r)},E[4]=et,E[5]=d):d=E[5];let eh=d;E[6]!==Z||E[7]!==et?(p=()=>{if("desktop"===Z)return"100%";if("custom"===Z)return`${et}px`;let e=c.find(e=>e.key===Z);return e?"number"==typeof e.width?`${e.width}px`:e.width:"100%"},E[6]=Z,E[7]=et,E[8]=p):p=E[8];let ef=p;E[9]!==Z?(x=()=>{if("desktop"===Z&&el.current){let e=new ResizeObserver(e=>{for(let t of e)ea(String(Math.round(t.contentRect.width)))});return e.observe(el.current),()=>e.disconnect()}},u=[Z],E[9]=Z,E[10]=x,E[11]=u):(x=E[10],u=E[11]),(0,r.useEffect)(x,u);let eg=`
3        rounded-xl overflow-hidden shadow-2xl
4        ${Q?"bg-zinc-900 border border-zinc-700/50":"bg-surface-base border border-gray-200"}
5        ${void 0===B?"":B}
6      `,eb=`
7          flex items-center gap-2 px-3 py-2
8          ${Q?"bg-zinc-800/80 border-b border-zinc-700/50":"bg-gray-100 border-b border-gray-200"}
9        `;E[12]===Symbol.for("react.memo_cache_sentinel")?(h=(0,t.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[(0,t.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-[#ff5f57] hover:bg-[#ff5f57]/80 transition-colors cursor-pointer"}),(0,t.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-[#febc2e] hover:bg-[#febc2e]/80 transition-colors cursor-pointer"}),(0,t.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-[#28c840] hover:bg-[#28c840]/80 transition-colors cursor-pointer"})]}),E[12]=h):h=E[12],E[13]!==Q||E[14]!==G?(f=G&&(0,t.jsxs)("div",{className:"hidden sm:flex items-center gap-1",children:[(0,t.jsx)("button",{className:`
10                p-1 rounded-md transition-colors
11                ${Q?"hover:bg-zinc-700 text-zinc-400":"hover:bg-gray-200 text-gray-500"}
12              `,children:(0,t.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),(0,t.jsx)("button",{className:`
13                p-1 rounded-md transition-colors
14                ${Q?"hover:bg-zinc-700 text-zinc-400":"hover:bg-gray-200 text-gray-500"}
15              `,children:(0,t.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]}),E[13]=Q,E[14]=G,E[15]=f):f=E[15];let ey=`
16            flex-1 min-w-0 flex items-center gap-1.5 px-2 py-1 rounded-md text-xs
17            ${Q?"bg-zinc-700/50 text-zinc-300":"bg-gray-200 text-gray-600"}
18          `;E[16]===Symbol.for("react.memo_cache_sentinel")?(g=(0,t.jsx)("svg",{className:"w-3 h-3 text-green-500 shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z",clipRule:"evenodd"})}),E[16]=g):g=E[16],E[17]!==V?(b=(0,t.jsx)("span",{className:"truncate",children:V}),E[17]=V,E[18]=b):b=E[18],E[19]!==ey||E[20]!==b?(y=(0,t.jsxs)("div",{className:ey,children:[g,b]}),E[19]=ey,E[20]=b,E[21]=y):y=E[21],E[22]!==Q||E[23]!==K?(v=K&&(0,t.jsx)("button",{className:`
19              hidden xs:block p-1 rounded-md transition-colors shrink-0
20              ${Q?"hover:bg-zinc-700 text-zinc-400":"hover:bg-gray-200 text-gray-500"}
21            `,children:(0,t.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),E[22]=Q,E[23]=K,E[24]=v):v=E[24];let ev=Y&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:`w-px h-5 ${Q?"bg-zinc-600":"bg-gray-300"}`}),(0,t.jsx)("div",{className:"flex items-center gap-0.5",children:c.map(e=>{let s=e.Icon;return(0,t.jsx)("button",{onClick:()=>em(e.key),className:`
22                      p-1.5 rounded-md transition-all
23                      ${Z===e.key?Q?"bg-zinc-700 text-primary-on":"bg-gray-300 text-gray-800":Q?"hover:bg-zinc-700/50 text-zinc-400":"hover:bg-gray-200 text-gray-500"}
24                    `,title:q(e.key),children:(0,t.jsx)(s,{className:"w-4 h-4"})},e.key)})})]});E[25]!==eb||E[26]!==f||E[27]!==y||E[28]!==v||E[29]!==ev?(w=(0,t.jsxs)("div",{className:eb,children:[h,f,y,v,ev]}),E[25]=eb,E[26]=f,E[27]=y,E[28]=v,E[29]=ev,E[30]=w):w=E[30];let ew=Y&&(0,t.jsxs)("div",{className:`
25            flex items-center justify-center gap-3 px-4 py-2
26            ${Q?"bg-zinc-800/50 border-b border-zinc-700/30":"bg-gray-50 border-b border-gray-200"}
27          `,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("input",{type:"text",value:er,onChange:ep,onBlur:ex,onKeyDown:m,className:`
28                  w-16 px-2 py-1 rounded text-xs font-mono text-center
29                  ${Q?"bg-zinc-700 text-zinc-200 border border-zinc-600 focus:border-blue-500":"bg-surface-base text-gray-700 border border-gray-300 focus:border-blue-500"}
30                  focus:outline-none focus:ring-1 focus:ring-blue-500/30
31                `}),(0,t.jsx)("span",{className:`text-xs ${Q?"text-zinc-500":"text-gray-400"}`,children:"×"}),(0,t.jsx)("span",{className:`text-xs font-mono ${Q?"text-zinc-400":"text-gray-500"}`,children:"100%"})]}),(0,t.jsx)("div",{className:`
32              px-2 py-0.5 rounded text-[10px] font-medium
33              ${"desktop"===Z?Q?"bg-green-500/20 text-green-400":"bg-green-100 text-green-700":"custom"===Z?Q?"bg-blue-500/20 text-blue-400":"bg-blue-100 text-blue-700":Q?"bg-zinc-700 text-zinc-400":"bg-gray-200 text-gray-600"}
34            `,children:"desktop"===Z?q("responsive"):"custom"===Z?q("custom"):q(Z)})]}),(0,t.jsx)("div",{className:`w-px h-4 ${Q?"bg-zinc-700":"bg-gray-300"}`}),(0,t.jsx)("div",{className:"flex items-center gap-1",children:c.map(e=>{let s=e.Icon,r="100%"===e.width?"100%":`${e.width}`;return(0,t.jsxs)("button",{onClick:()=>em(e.key),className:`
35                    flex items-center gap-1.5 px-2 py-1 rounded text-xs transition-all
36                    ${Z===e.key?Q?"bg-zinc-700 text-primary-on":"bg-gray-300 text-gray-800":Q?"hover:bg-zinc-700/50 text-zinc-400":"hover:bg-gray-200 text-gray-500"}
37                  `,title:`${q(e.key)} (${r})`,children:[(0,t.jsx)(s,{className:"w-3.5 h-3.5"}),(0,t.jsx)("span",{className:"hidden sm:inline font-mono",children:r})]},e.key)})}),(0,t.jsx)("div",{className:`w-px h-4 ${Q?"bg-zinc-700":"bg-gray-300"}`}),(0,t.jsx)("button",{onClick:eu,className:`
38              p-1.5 rounded transition-colors
39              ${Q?"hover:bg-zinc-700 text-zinc-400":"hover:bg-gray-200 text-gray-500"}
40            `,title:q("resetToResponsive"),children:(0,t.jsx)(o.RotateCcw,{className:"w-3.5 h-3.5"})})]}),ej=`relative flex justify-center ${Q?"bg-zinc-950":"bg-surface-base"} ${Y?"bg-[repeating-linear-gradient(45deg,transparent,transparent_10px,rgba(255,255,255,0.01)_10px,rgba(255,255,255,0.01)_20px)]":""}`,eN="number"==typeof X?`${X}px`:X;E[31]!==eN?(j={height:eN},E[31]=eN,E[32]=j):j=E[32],E[33]!==Z||E[34]!==eh||E[35]!==Q||E[36]!==ei||E[37]!==Y?(N=Y&&"desktop"!==Z&&(0,t.jsx)("div",{onMouseDown:e=>eh(e,"left"),className:"\n              absolute left-0 top-0 bottom-0 w-2 cursor-ew-resize z-10\n              flex items-center justify-center\n              group\n            ",children:(0,t.jsx)("div",{className:`
41              w-1 h-16 rounded-full transition-colors
42              ${ei?"bg-blue-500":Q?"bg-zinc-700 group-hover:bg-zinc-500":"bg-gray-300 group-hover:bg-gray-400"}
43            `})}),E[33]=Z,E[34]=eh,E[35]=Q,E[36]=ei,E[37]=Y,E[38]=N):N=E[38];let ek=`h-full transition-all ${ei?"duration-0":"duration-300"} ease-out relative`;return E[39]!==ef?(k=ef(),E[39]=ef,E[40]=k):k=E[40],E[41]!==k?($={width:k,maxWidth:"100%"},E[41]=k,E[42]=$):$=E[42],E[43]!==Z||E[44]!==Q||E[45]!==Y?(S=Y&&"desktop"!==Z&&(0,t.jsx)("div",{className:`absolute inset-0 pointer-events-none border-x ${Q?"border-zinc-700/50":"border-gray-300/50"}`}),E[43]=Z,E[44]=Q,E[45]=Y,E[46]=S):S=E[46],E[47]!==L||E[48]!==T||E[49]!==Q||E[50]!==q||E[51]!==I?(z=T?(0,t.jsx)("iframe",{src:T,title:I||"Browser Preview",className:"w-full h-full border-0",sandbox:"allow-scripts"}):L||(0,t.jsx)("div",{className:`
44                  flex items-center justify-center h-full
45                  ${Q?"text-zinc-500":"text-gray-400"}
46                `,children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("svg",{className:"w-12 h-12 mx-auto mb-3 opacity-50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"})}),(0,t.jsx)("p",{className:"text-sm",children:q("noContent")})]})}),E[47]=L,E[48]=T,E[49]=Q,E[50]=q,E[51]=I,E[52]=z):z=E[52],E[53]!==ek||E[54]!==$||E[55]!==S||E[56]!==z?(C=(0,t.jsxs)("div",{ref:eo,className:ek,style:$,children:[S,z]}),E[53]=ek,E[54]=$,E[55]=S,E[56]=z,E[57]=C):C=E[57],E[58]!==Z||E[59]!==eh||E[60]!==Q||E[61]!==ei||E[62]!==Y?(M=Y&&"desktop"!==Z&&(0,t.jsx)("div",{onMouseDown:e=>eh(e,"right"),className:"\n              absolute right-0 top-0 bottom-0 w-2 cursor-ew-resize z-10\n              flex items-center justify-center\n              group\n            ",children:(0,t.jsx)("div",{className:`
47              w-1 h-16 rounded-full transition-colors
48              ${ei?"bg-blue-500":Q?"bg-zinc-700 group-hover:bg-zinc-500":"bg-gray-300 group-hover:bg-gray-400"}
49            `})}),E[58]=Z,E[59]=eh,E[60]=Q,E[61]=ei,E[62]=Y,E[63]=M):M=E[63],E[64]!==ej||E[65]!==j||E[66]!==N||E[67]!==C||E[68]!==M?(P=(0,t.jsxs)("div",{ref:el,className:ej,style:j,children:[N,C,M]}),E[64]=ej,E[65]=j,E[66]=N,E[67]=C,E[68]=M,E[69]=P):P=E[69],E[70]!==_||E[71]!==eg||E[72]!==w||E[73]!==ew||E[74]!==P?(R=(0,t.jsxs)("div",{className:eg,style:_,children:[w,ew,P]}),E[70]=_,E[71]=eg,E[72]=w,E[73]=ew,E[74]=P,E[75]=R):R=E[75],R}function m(e){return"Enter"===e.key&&e.currentTarget.blur()}e.s(["BrowserSimulator",()=>d],836804),e.i(873124),e.s([],716787)},54955,e=>{"use strict";var t=e.i(16864);e.s(["cmsTemplates",0,{list:e=>t.api.get("/api/cms/templates",e),getById:e=>t.api.get(`/api/cms/templates/${e}`),upload:async(e,s,r)=>{let a=new FormData;return a.append("file",e),a.append("name",s.name),s.description&&a.append("description",s.description),s.category&&a.append("category",s.category),a.append("isPublic",String(s.isPublic??!0)),a.append("isPro",String(s.isPro??!1)),a.append("isSurfacePreview",String(s.isSurfacePreview??!1)),s.tags?.length&&a.append("tags",JSON.stringify(s.tags)),r&&a.append("thumbnail",r),
49(0,t.apiFetch)("/api/cms/templates",{method:"POST",body:a,headers:{}})},create:async e=>t.api.post("/api/cms/templates",e),update:(e,s)=>t.api.patch(`/api/cms/templates/${e}`,s),updateHtml:async(e,s)=>{let r=new FormData,a=new Blob([s],{type:"text/html"});return r.append("file",a,"template.html"),(0,t.apiFetch)(`/api/cms/templates/${e}/html`,{method:"PUT",body:r,headers:{}})},remove:e=>t.api.delete(`/api/cms/templates/${e}`),generate:e=>t.api.post("/api/templates/generate",e),generateGroup:e=>t.api.post("/api/templates/generate-group",e),generateLayout:e=>t.api.post("/api/templates/generate-layout",e),analyzeWebsite:e=>t.api.post("/api/templates/analyze-website",e),generateFeature:e=>t.api.post("/api/templates/generate-feature",e),createGroup:async e=>t.api.post("/api/cms/templates",{...e,type:"group"}),listFeatures:e=>t.api.get(`/api/cms/templates/${e}/features`),getFeature:(e,s)=>t.api.get(`/api/cms/templates/${e}/features/${s}`),addFeature:(e,s)=>t.api.post(`/api/cms/templates/${e}/features`,s),updateFeature:(e,s,r)=>t.api.patch(`/api/cms/templates/${e}/features/${s}`,r),removeFeature:(e,s)=>t.api.delete(`/api/cms/templates/${e}/features/${s}`),generateComponent:e=>t.api.post("/api/templates/generate-component",e),assemblePage:e=>t.api.post("/api/templates/assemble-page",e),listComponents:e=>t.api.get(`/api/cms/templates/${e}/components`),addComponent:(e,s)=>t.api.post(`/api/cms/templates/${e}/components`,s),updateComponent:(e,s,r)=>t.api.patch(`/api/cms/templates/${e}/components/${s}`,r),removeComponent:(e,s)=>t.api.delete(`/api/cms/templates/${e}/components/${s}`),listSections:(e,s)=>t.api.get(`/api/cms/templates/${e}/features/${s}/sections`),addSection:(e,s,r)=>t.api.post(`/api/cms/templates/${e}/features/${s}/sections`,r),updateSection:(e,s,r,a)=>t.api.patch(`/api/cms/templates/${e}/features/${s}/sections/${r}`,a),removeSection:(e,s,r)=>t.api.delete(`/api/cms/templates/${e}/features/${s}/sections/${r}`),reorderSections:(e,s,r)=>t.api.post(`/api/cms/templates/${e}/features/${s}/sections/reorder`,{sectionIds:r})},"templatesApi",0,{list:e=>t.api.get("/api/templates",e),library:async e=>{let s="pixeliro_templates_library";try{let t=localStorage.getItem(s);if(t){let s=JSON.parse(t);if(JSON.stringify(e??{})===JSON.stringify(s.params??{})&&Date.now()-s.ts<6e5)return s.data}}catch{}let r=await t.api.get("/api/templates/library",e);try{localStorage.setItem(s,JSON.stringify({ts:Date.now(),params:e??{},data:r}))}catch{}return r},fetchHtml:e=>fetch(`/api/templates/${encodeURIComponent(e)}/preview`).then(e=>e.ok?e.text():Promise.reject(Error("Not found"))),previewUrl:e=>`/api/templates/${encodeURIComponent(e)}/preview`,renderUrl:(e,t)=>
49{let s=encodeURIComponent(t);return`/api/templates/render?templateId=${encodeURIComponent(e)}&cssVariables=${s}`}},"workspaceTemplatesApi",0,{list:e=>t.api.get(`/api/workspaces/${e}/templates`),add:(e,s)=>t.api.post(`/api/workspaces/${e}/templates`,{templateId:s}),remove:(e,s)=>t.api.delete(`/api/workspaces/${e}/templates/${s}`),isAssigned:async(e,s)=>{try{return(await t.api.get(`/api/workspaces/${e}/templates`)).data.some(e=>e.id===s)}catch{return!1}}}])},753411,e=>{"use strict";var t=e.i(843476),s=e.i(271645),r=e.i(618566),a=e.i(398361),i=e.i(726336),n=e.i(37727),l=e.i(951445),o=e.i(826707),c=e.i(453136),d=e.i(531278),m=e.i(16715),p=e.i(664659),x=e.i(643531),u=e.i(90564),h=e.i(245439),f=e.i(54955);e.i(716787);var g=e.i(836804);let b={desktop:"100%",tablet:"768px",mobile:"375px"},y={all:"All Templates",brand:"Brand & Marketing",product:"Product UI",components:"Components",accessibility:"Accessibility",custom:"More"};function v({result:e,paletteId:v,initialTemplate:w,defaultThemeMode:j="light",directUri:N=!0}){let k=(0,r.useSearchParams)(),[$,S]=(0,s.useState)([]),[z,C]=(0,s.useState)(!0),[M,P]=(0,s.useState)(""),[R,E]=(0,s.useState)(w??""),[L,F]=(0,s.use
49State)("all"),[T,I]=(0,s.useState)("desktop"),[B,_]=(0,s.useState)(!1),[U,D]=(0,s.useState)(!1),A=(0,s.useRef)(null),O=(0,s.useRef)(null),H=(0,s.useRef)(null),W=k.get("theme")??j,J=(0,s.useMemo)(()=>(0,h.exportBrandSystemCSS)(e,{headingFont:"Inter, system-ui, sans-serif",bodyFont:"Inter, system-ui, sans-serif",mode:W}),[e,W]);(0,s.useEffect)(()=>{let e=!1;return C(!0),P(""),f.templatesApi.library({limit:50}).then(t=>{if(e)return;S(t.data);let s=t.data.find(e=>e.id===w)??t.data[0];s&&!R&&E(s.id)}).catch(()=>{e||P("Failed to load templates")}).finally(()=>{e||C(!1)}),()=>{e=!0}},[]),(0,s.useEffect)(()=>{if(!U)return;let e=e=>{A.current&&!A.current.contains(e.target)&&D(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[U]);let V=(0,s.useMemo)(()=>{let e=new Set(["all"]),t=["all"];for(let s of $)e.has(s.category)||(e.add(s.category),t.push(s.category));return t},[$]),X=(0,s.useMemo)(()=>"all"===L?$:$.filter(e=>e.category===L),[$,L]),K=(0,s.useMemo)(()=>$.find(e=>e.id===R)??null,[$,R]),[G,Y]=(0,s.useState)(""),[q,Q]=(0,s.useState)(!1),Z=(0,s.useMemo)(()=>R?f.templatesApi.previewUrl(R):"",[R]);(0,s.useEffect)(()=>{if(N)return;if(!K?.htmlUrl)return void Y("");let e=!1;return Q(!0),f.templatesApi.fetchHtml(R).then(t=>{e||Y(t)}).catch(()=>{e||Y("")}).finally(()=>{e||Q(!1)}),()=>{e=!0}},[K?.htmlUrl,R,N]);let ee=(0,s.useCallback)(e=>{if(e)try{let t=e.contentDocument;if(!t)return;let s=t.getElementById("pixeliro-variables");s||((s=t.createElement("style")).id="pixeliro-variables",(t.head||t.documentElement).appendChild(s)),s.textContent=J}catch{}},[J]);(0,s.useEffect)(()=>{N&&(ee(O.current),ee(H.current))},[N,J]);let et=(0,s.useMemo)(()=>{if(N||!G)return"";let e=`<style id="pixeliro-variables">${J}</style>`;return G.includes('id="pixeliro-variables"')?G.replace(/<style[^>]*id="pixeliro-variables"[^>]*>[\s\S]*?<\/style>/,e):G.includes("</head>")?G.replace("</head>",`${e}
50</head>`):e+G},[G,J,N]),es=(0,s.useCallback)(e=>{"Escape"===e.key&&B&&_(!1),"Escape"===e.key&&U&&D(!1)},[B,U]);return((0,s.useEffect)(()=>(document.addEventListener("keydown",es),()=>document.removeEventListener("keydown",es)),[]),(0,s.useEffect)(()=>(document.body.style.overflow=B?"hidden":"",()=>{document.body.style.overflow=""}),[B]),z)?(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 py-24 text-text-secondary",children:[(0,t.jsx)(d.Loader2,{className:"h-5 w-5 animate-spin"}),(0,t.jsx)("span",{className:"text-sm",children:"Loading templates…"})]}):M?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3 py-24 text-center",children:[(0,t.jsx)("p",{className:"text-sm text-text-secondary",children:M}),(0,t.jsxs)("button",{onClick:()=>window.location.reload(),className:"flex items-center gap-2 rounded-lg border border-border px-3 py-1.5 text-sm text-text-secondary hover:bg-surface-overlay",children:[(0,t.jsx)(m.RefreshCw,{className:"h-4 w-4"}),"Retry"]})]}):(console.log("Selected template:",K,N,Z),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"relative flex-1",ref:A,children:[(0,t.jsxs)("button",{onClick:()=>D(!U),className:"flex w-full items-center justify-between rounded-lg border border-border bg-surface-raised px-3 py-2 text-sm transition hover:bg-surface-overlay",children:[(0,t.jsx)("span",{className:"flex items-center gap-2 truncate",children:K?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"inline-flex h-5 w-5 items-center justify-center rounded bg-primary/10 text-[10px] font-bold text-primary",children:K.name.slice(0,2).toUpperCase()}),(0,t.jsx)("span",{className:"truncate text-text-primary",children:K.name}),K.isPro&&(0,t.jsx)("span",{className:"shrink-0 rounded bg-purple-500/10 px-1.5 py-0.5 text-[10px] font-medium text-purple-400",children:"PRO"}),K.isOwn&&(0,t.jsx)("span",{className:"shrink-0 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium text-primary",children:"MY"})]}):(0,t.jsx)("span",{className:"text-text-secondary",children:"Select template…"})}),(0,t.jsx)(p.ChevronDown,{className:(0,u.cn)("ml-2 h-4 w-4 shrink-0 text-text-secondary transition-transform",U&&"rotate-180")}
50)]}),U&&(0,t.jsxs)("div",{className:"absolute left-0 right-0 top-full z-30 mt-1 flex max-h-80 flex-col overflow-hidden rounded-xl border border-border bg-surface-raised shadow-xl",children:[V.length>1&&(0,t.jsx)("div",{className:"flex items-center gap-1 overflow-x-auto border-b border-border px-3 py-2",children:V.map(e=>(0,t.jsx)("button",{onClick:()=>F(e),className:(0,u.cn)("shrink-0 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",L===e?"bg-primary text-primary-on":"text-text-secondary hover:bg-surface-overlay hover:text-text-primary"),children:y[e]??e},e))}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto p-1.5",children:0===X.length?(0,t.jsx)("p",{className:"px-3 py-4 text-center text-xs text-text-secondary",children:"No templates in this category"}):X.map(e=>(0,t.jsxs)("button",{onClick:()=>{E(e.id),D(!1)},className:(0,u.cn)("flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-left text-sm transition-colors",R===e.id?"bg-primary/10 text-text-primary":"text-text-secondary hover:bg-surface-overlay hover:text-text-primary"),children:[(0,t.jsx)("span",{className:(0,u.cn)("flex h-6 w-6 shrink-0 items-center justify-center rounded text-[10px] font-bold",R===e.id?"bg-primary/20 text-primary":"bg-surface-sunken text-text-secondary"),children:e.name.slice(0,2).toUpperCase()}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"truncate font-medium",children:e.name}),e.isPro&&(0,t.jsx)("span",{className:"shrink-0 rounded bg-purple-500/10 px-1 py-0.5 text-[9px] font-medium text-purple-400",children:"PRO"}),e.isOwn&&(0,t.jsx)("span",{className:"shrink-0 rounded bg-primary/10 px-1 py-0.5 text-[9px] font-medium text-primary",children:"MY"})]}),e.description&&(0,t.jsx)("p",{className:"mt-0.5 truncate text-xs text-text-secondary",children:e.description})]}),R===e.id&&(0,t.jsx)(x.Check,{className:"h-4 w-4 shrink-0 text-primary"})]},e.id))})]})]}),(0,t.jsx)("button",{onClick:()=>_(!0),className:"rounded-lg border border-border p-2 text-text-secondary transition hover:bg-surface-overlay hover:text-text-primary",title:"Fullscreen",children:(0,t.jsx)(a.Maximize2,{className:"h-4 w-4"})})]}),(0,t.jsx)(g.BrowserSimulator,{url:K?.name||"preview.pixeliro.com",height:600,theme:W,showDeviceSwitcher:!0,showRefresh:!1,showNavButtons:!1,children:N&&Z?(0,t.jsx)("iframe",{ref:O,src:Z,sandbox:"allow-same-origin allow-scripts",className:"h-full w-full border-0",title:K?.name??"Template Preview",onLoad:()=>ee(O.current)}):et?(0,t.jsxs)(t.Fragment,{children:[q&&(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-surface-base",children:(0,t.jsx)(d.Loader2,{className:"h-6 w-6 animate-spin text-text-secondary"})}),(0,t.jsx)("iframe",{ref:O,srcDoc:et,sandbox:"allow-same-origin allow-scripts",className:"h-full w-full border-0",title:K?.name??"Template Preview"})]}):(0,t.jsx)("div",{className:"flex h-full items-center justify-center text-text-secondary",children:q?(0,t.jsx)(d.Loader2,{className:"h-6 w-6 animate-spin text-text-secondary"}):(0,t.jsx)("p",{className:"text-sm",children:"Select a template to preview"})})}),B&&(0,t.jsxs)("div",{className:"fixed inset-0 z-50 flex flex-col bg-black/90",children:[(0,t.jsxs)("div",{className:"z-10 flex shrink-0 items-center justify-between bg-linear-to-b from-black/80 to-transparent px-6 py-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"rounded px-2 py-0.5 text-xs font-bold",style:{backgroundColor:"var(--brand-primary-container)",color:"var(--on-brand-primary-container)"},children:K?.name?.slice(0,2).toUpperCase()??"–"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-semibold text-primary-on",children:K?.name??"Template"}),(0,t.jsx)("p",{className:"text-xs text-primary-on/60",children:K?.description})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"flex items-center gap-1 rounded-lg bg-white/10 p-1",children:["desktop","tablet","mobile"].map(e=>(0,t.jsxs)("button",{onClick:()=>I(e),className:(0,u.cn)("rounded-md p-1.5 text-primary-on transition-colors",T===e?"bg-white/20":"hover:bg-white/10"),children:["desktop"===e&&(0,t.jsx)(l.Monitor,{className:"h-4 w-4"}),"tablet"===e&&(0,t.jsx)(c.Tablet,{className:"h-4 w-4"}),"mobile"===e&&(0,t.jsx)(o.Smartphone,{className:"h-4 w-4"})]},e))}),(0,t.jsx)("button",{onClick:()=>_(!1),className:"rounded-lg bg-white/10 p-2 text-primary-on transition-colors hover:bg-white/20",title:"Exit Fullscreen (ESC)",children:(0,t.jsx)(i.Minimize2,{className:"h-5 w-5"})}),(0,t.jsx)("button",{onClick:()=>_(!1),className:"rounded-lg bg-white/10 p-2 text-primary-on transition-colors hover:bg-white/20",children:(0,t.jsx)(n.X,{className:"h-5 w-5"})})]})]}),(0,t.jsx)("div",{className:"flex flex-1 flex-col items-center justify-start overflow-hidden px-8 pb-24 pt-4",children:(0,t.jsx)("div",{className:"h-full w-full overflow-hidden rounded-xl shadow-2xl",style:{maxWidth:b[T]},children:N&&Z?(0,t.jsx)("iframe",{ref:H,src:Z,sandbox:"allow-same-origin allow-scripts",className:"h-full w-full border-0",title:K?.name??"Template Preview",onLoad:()=>ee(H.current)}):et&&(0,t.jsx)("iframe",{ref:H,srcDoc:et,sandbox:"allow-same-origin allow-scripts",className:"h-full w-full border-0",title:K?.name??"Template Preview"})})}),(0,t.jsx)("div",{className:"absolute bottom-0 left-0 right-0 shrink-0 bg-gradient-to-t from-black/80 to-transparent p-4",children:(0,t.jsx)("div",{className:"flex items-center justify-center gap-2 overflow-x-auto pb-1",children:$.map(e=>(0,t.jsxs)("button",{onClick:()=>E(e.id),className:(0,u.cn)("flex shrink-0 items-center gap-2 whitespace-nowrap rounded-lg px-3 py-2 text-sm transition-all",R===e.id?"bg-surface-base text-text-primary":"bg-white/10 text-primary-on hover:bg-white/20"),children:[(0,t.jsx)("span",{className:"text-xs font-bold opacity-60",children:e.name.slice(0,2).toUpperCase()}),e.name]},e.id))})})]})]}))}e.s(["SurfacePreviewSection",()=>v])},997625,e=>{"use strict";var t=e.i(990397);e.s(["Code2",()=>t.default])},123287,e=>{"use strict";let t=(0,e.i(475254).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["default",()=>t])},595468,e=>{"use strict";var t=e.i(123287);e.s(["CheckCircle2",()=>t.default])},489053,e=>{"use strict";let t=(0,e.i(475254).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["default",()=>t])},178583,e=>{"use strict";var t=e.i(489053);e.s(["FileText",()=>t.default])},990397,e=>{"use strict";let t=(0,e.i(475254).default)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);e.s(["default",()=>t])},663532,e=>{"use strict";var t=e.i(843476),s=e.i(500932),r=e.i(522016),a=e.i(283086),i=e.i(948148);e.i(265814);var n=e.i(983692);function l(e){let l,o,c,d,m,p,x,u,h,f=(0,s.c)(22),{children:g,message:b}=e,y=(0,i.useTranslations)("ProFeature"),{user:v,loading:w}=(0,n.useAuth)(),j=v?.plan==="pro"||v?.plan==="enterprise"||v?.role==="admin";if(w){let e;return f[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("div",{className:"flex items-center justify-center px-4 py-16",children:"Loading..."}),f[0]=e):e=f[0],e}if(j){let e;return f[1]!==g?(e=(0,t.jsx)(t.Fragment,{children:g}),f[1]=g,f[2]=e):e=f[2],e}return f[3]===Symbol.for("react.memo_cache_sentinel")?(l=(0,t.jsx)("div",{className:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-gradient-to-br from-violet-500/20 to-purple-500/20",children:(0,t.jsx)(a.Sparkles,{className:"h-7 w-7 text-violet-400"})}),f[3]=l):l=f[3],f[4]!==b||f[5]!==y?(o=b||y("title"),f[4]=b,f[5]=y,f[6]=o):o=f[6],f[7]!==o?(c=(0,t.jsx)("h3",{className:"mb-2 text-lg font-bold text-text-primary",children:o}),f[7]=o,f[8]=c):c=f[8],f[9]!==y?(d=y("description"),f[9]=y,f[10]=d):d=f[10],f[11]!==d?(m=(0,t.jsx)("p",{className:"mb-6 text-sm text-text-secondary",children:d}),f[11]=d,f[12]=m):m=f[12],f[13]===Symbol.for("react.memo_cache_sentinel")?(p=(0,t.jsx)(a.Sparkles,{className:"h-4 w-4"}),f[13]=p):p=f[13],f[14]!==y?(x=y("viewPlans"),f[14]=y,f[15]=x):x=f[15],f[16]!==x?(u=(0,t.jsxs)(r.default,{href:"/pricing",className:"inline-flex items-center gap-2 rounded-xl bg-gradient-to-r from-violet-500 to-purple-500 px-6 py-3 text-sm font-semibold text-primary-on transition hover:opacity-90",children:[p,x]}),f[16]=x,f[17]=u):u=f[17],f[18]!==c||f[19]!==m||f[20]!==u?(h=(0,t.jsx)("div",{className:"flex items-center justify-center px-4 py-16",children:(0,t.jsxs)("div",{className:"w-full max-w-md rounded-2xl border border-border bg-surface p-8 text-center",children:[l,c,m,u]})}),f[18]=c,f[19]=m,f[20]=u,f[21]=h):h=f[21],h}e.s(["ProFeature",()=>l])}]);
51
52//# debugId=ed471177-dd92-9b72-4178-7e1050f0225f
53//# sourceMappingURL=55d18348f549f48c.js.map

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.