[["playground","Playground",0,[["Playground.zx","pub fn Playground(ctx: *zx.ComponentContext) zx.Component {\n    return (\n        <div @allocator={ctx.allocator}>\n            <style>{@embedFile(\"style.css\")}</style>\n\n            <h1>Ziex Playground</h1>\n            <p>Welcome to the minimal Ziex Playground demo.</p>\n            <p>Edit files and run your code!</p>\n\n            {for (\"Ziex\") |c| (<i>{c}</i>)}\n        </div>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false],["style.css","body {\n    background: #111;\n    color: #fff;\n    display: grid;\n    place-items: center;\n    height: 90vh;\n}",false]]],["app","App",1,[["app/pages/layout.zx","pub fn Layout(ctx: zx.LayoutContext, children: zx.Component) zx.Component {\n    return (\n        <html @allocator={ctx.arena} lang=\"en-US\">\n            <head>\n                <meta charset=\"UTF-8\" />\n                <title>Counter</title>\n            </head>\n            <body>\n                <nav>\n                    <a href=\"/\">Home</a>{\" · \"}\n                    <a href=\"/about\">About</a>{\" · \"}\n                    <a href=\"/api\">API</a>\n                </nav>\n                {children}\n            </body>\n        </html>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false],["app/pages/page.zx","pub fn Page(ctx: zx.PageContext) !zx.Component {\n    return (\n        <main @allocator={ctx.arena}>\n            <h2>Home</h2>\n            <Counter @client initial={0} />\n        </main>\n    );\n}\n\npub fn Counter(ctx: *zx.ComponentCtx(struct { initial: i32 })) ?zx.Component {\n    const count = ctx.state(i32, ctx.props.initial);\n    return (\n        <div @allocator={ctx.allocator}>\n            <button onclick={count.bind(increment)}>Count: {count}</button>\n        </div>\n    );\n}\n\nfn increment(x: i32) i32 {\n    return x + 1;\n}\n\nconst zx = @import(\"zx\");\n",false],["app/pages/about/page.zx","pub fn Page(ctx: zx.PageContext) !zx.Component {\n    return (\n        <main @allocator={ctx.arena}>\n            <h2>About</h2>\n            <p>This is the about page.</p>\n        </main>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false],["app/routes/api/route.zig","pub fn GET(ctx: zx.RouteContext) !void {\n    try ctx.response.json(.{ .status = \"ok\" }, .{});\n}\n\nconst zx = @import(\"zx\");\n",false]]],["app-events","App events",1,[["app/pages/layout.zx","pub fn Layout(ctx: zx.LayoutContext, children: zx.Component) zx.Component {\n    return (\n        <html @allocator={ctx.arena} lang=\"en-US\">\n            <head>\n                <meta charset=\"UTF-8\" />\n                <title>Events</title>\n            </head>\n            <body>\n                <h1>Client events</h1>\n                {children}\n            </body>\n        </html>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false],["app/pages/page.zx","pub fn Page(ctx: zx.PageContext) !zx.Component {\n    return (\n        <main @allocator={ctx.arena}>\n            <p>Click and type;  open the console to see logs.</p>\n            <EventDemo @client />\n        </main>\n    );\n}\n\npub fn EventDemo(ctx: *zx.ComponentContext) zx.Component {\n    const clicks = ctx.state(i32, 0);\n    return (\n        <div @allocator={ctx.allocator}>\n            <button onclick={ctx.bind(onClick)}>Clicked {clicks}</button>\n            <input oninput={onInput} />\n            <form action={onSubmit}>\n                <input name=\"msg\"/>\n                <button type=\"submit\">Send</button>\n            </form>\n        </div>\n    );\n}\n\nfn onClick(e: *zx.client.Event.Stateful) void {\n    const c = e.state(i32);\n    c.set(c.get() + 1);\n    const pe = e.as(zx.client.events.PointerEvent, zx.allocator);\n    zx.log.info(\"click ({d},{d})\", .{ pe.client_x, pe.client_y });\n}\n\nfn onInput(e: zx.client.Event) void {\n    const v = e.value() orelse \"\";\n    zx.log.info(\"input: {s}\", .{v});\n}\n\nfn onSubmit(a: zx.client.Action) void {\n    const data = a.data(struct { msg: []const u8 });\n    zx.log.info(\"submit message: {s}\", .{data.msg});\n}\n\nconst zx = @import(\"zx\");\n",false]]],["greeting","Greeting",0,[["Playground.zx","pub fn HelloWorld(allocator: zx.Allocator) zx.Component {\n    return (\n        <main @allocator={allocator}>\n            <h1>Welcome to my app</h1>\n            <Greeting />\n        </main>\n    );\n}\n\nfn Greeting(allocator: zx.Allocator) zx.Component {\n    return (<p @allocator={allocator}>Hello, World!</p>);\n}\n\nconst zx = @import(\"zx\");\n",false]]],["markup","Markup",0,[["Playground.zx","pub fn AboutSection(allocator: zx.Allocator) zx.Component {\n    return (\n        <main @allocator={allocator}>\n            <h1>About</h1>\n            <p>Hello there.<br />How are you?</p>\n            <AboutCard />\n        </main>\n    );\n}\n\nfn AboutCard(allocator: zx.Allocator) zx.Component {\n    return (\n        <div @allocator={allocator} class=\"card\">\n            <h2>User Profile</h2>\n            <p>Welcome to the card component!</p>\n        </div>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false]]],["text-expr","Text expression",0,[["Playground.zx","pub fn UserGreeting(allocator: zx.Allocator) zx.Component {\n    const user_name = \"Alice\";\n    const greeting = \"Welcome back\";\n    return (\n        <main @allocator={allocator}>\n            <h1>{greeting}, {user_name}!</h1>\n            <p>Your profile is ready.</p>\n        </main>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false]]],["format-expr","Format expression",0,[["Playground.zx","pub fn ProductInfo(allocator: zx.Allocator) zx.Component {\n    const price: f32 = 19.99;\n    const quantity: u32 = 3;\n    const is_available = true;\n    return (\n        <main @allocator={allocator}>\n            <p>Price: ${price}</p>\n            <p>Quantity: {quantity}</p>\n            <p>Available: {is_available}</p>\n        </main>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false]]],["conditional","Conditional",0,[["Playground.zx","pub fn UserStatus(allocator: zx.Allocator) zx.Component {\n    const is_logged_in = true;\n    const is_admin = false;\n    return (\n        <main @allocator={allocator}>\n            {if (is_logged_in) (<p>Welcome back!</p>) else (<p>Please log in.</p>)}\n            {if (is_admin) (<button>Admin Panel</button>)}\n        </main>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false]]],["switch","Switch",0,[["Playground.zx","const Role = enum { admin, member, guest };\npub fn RoleBadge(allocator: zx.Allocator) zx.Component {\n    const role: Role = .admin;\n    return (\n        <main @allocator={allocator}>\n            <span class=\"badge\">\n                {switch (role) {\n                    .admin => (<strong>Admin</strong>),\n                    .member => (\"Member\"),\n                    .guest => (\"Guest\"),\n                }}\n            </span>\n        </main>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false]]],["list","List",0,[["Playground.zx","pub fn ProductList(allocator: zx.Allocator) zx.Component {\n    const products = [_][]const u8{ \"Apple\", \"Banana\", \"Orange\" };\n    return (\n        <main @allocator={allocator}>\n            <h2>Products</h2>\n            <ul>{for (products) |product| (<li>{product}</li>)}</ul>\n        </main>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false]]],["props","Props",0,[["Playground.zx","const ButtonProps = struct {\n    title: []const u8 = \"Click Me\",\n    class: []const u8 = \"btn\",\n};\npub fn ButtonDemo(allocator: zx.Allocator) zx.Component {\n    return (\n        <main @allocator={allocator}>\n            <Button title=\"Submit\" class=\"primary\" />\n            <Button title=\"Cancel\" />\n            <Button />\n        </main>\n    );\n}\n\nfn Button(allocator: zx.Allocator, props: ButtonProps) zx.Component {\n    return (<button @allocator={allocator} class={props.class}>{props.title}</button>);\n}\n\nconst zx = @import(\"zx\");\n",false]]],["fragment","Fragment",0,[["Playground.zx","pub fn FragmentDemo(allocator: zx.Allocator) zx.Component {\n    return (\n        <main @allocator={allocator}>\n            <>\n                <h1>Welcome</h1>\n                <p>Multiple elements without a wrapper</p>\n            </>\n        </main>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false]]],["children","Children",0,[["Playground.zx","const CardProps = struct { title: []const u8, children: zx.Component };\npub fn CardDemo(allocator: zx.Allocator) zx.Component {\n    return (\n        <main @allocator={allocator}>\n            <Card title=\"Welcome\">\n                <p>This content is passed as children.</p>\n                <button>Click me</button>\n            </Card>\n        </main>\n    );\n}\n\nfn Card(allocator: zx.Allocator, props: CardProps) zx.Component {\n    return (\n        <div @allocator={allocator} class=\"card\">\n            <h2>{props.title}</h2>\n            <div class=\"card-body\">{props.children}</div>\n        </div>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false]]],["dyn-attrs","Dynamic attributes",0,[["Playground.zx","pub fn DynamicAttrs(allocator: zx.Allocator) zx.Component {\n    const class_name = \"primary-btn\";\n    const user_id = \"user-123\";\n    const is_active = true;\n    return (\n        <main @allocator={allocator}>\n            <button class={class_name} id={user_id}>Submit</button>\n            <div class={if (is_active) \"active\" else \"inactive\"}>Dynamic class</div>\n        </main>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false]]],["expressions","Expressions",0,[["Playground.zx","pub fn Expressions(allocator: zx.Allocator) zx.Component {\n    const name = \"Alice\";\n    const count: u32 = 42;\n    const price: f32 = 19.99;\n    const active = true;\n    return (\n        <main @allocator={allocator}>\n            <p>{name}</p>\n            <p>{count}</p>\n            <p>${price}</p>\n            <p>{active}</p>\n        </main>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false]]],["component-fragment","Component fragment",0,[["Playground.zx","pub fn Fragment(\n    allocator: zx.Allocator,\n) zx.Component {\n    return (\n        <fragment @{allocator}>\n            <span>One</span>\n            <>\n                <p>Two</p><p>Three</p>\n            </>\n        </fragment>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false]]],["dyn-attr","Dynamic attr",0,[["Playground.zx","pub fn DynamicAttr(\n    allocator: zx.Allocator,\n) zx.Component {\n    const is_active = true;\n    const class = if (is_active) \"active\" else \"idle\";\n    const color = if (is_active) \"green\" else \"red\";\n    return (\n        <section @{allocator}>\n            <button class={class}>Go</button>\n            <button style=`color: {color};`>\n                Template String\n            </button>\n        </section>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false]]],["escaping","Escaping",0,[["Playground.zx","pub fn RawHtml(allocator: zx.Allocator) zx.Component {\n    const trusted = \"<strong>Trusted HTML</strong>\";\n    return (\n        <main @allocator={allocator}>\n            <div>{trusted}</div>\n            <div @escaping={.none}>{trusted}</div>\n        </main>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false]]],["fs-routing","File system routing",1,[["app/pages/layout.zx","pub fn Layout(\n    ctx: zx.LayoutContext,\n    children: zx.Component,\n) zx.Component {\n    return (\n        <html @allocator={ctx.arena}>\n            <body>\n                {children}\n            </body>\n        </html>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false],["app/pages/page.zx","pub fn Page(\n    ctx: zx.PageContext,\n) zx.Component {\n    return (\n        <div @allocator={ctx.arena}>\n            <h1>Home</h1>\n        </div>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false]]],["learn-page","Page + layout",1,[["app/pages/layout.zx","pub fn Layout(ctx: zx.LayoutContext, children: zx.Component) zx.Component {\n    return (\n        <html @allocator={ctx.arena}>\n            <head><title>My App</title></head>\n            <body>\n                <nav><a href=\"/\">Home</a> <a href=\"/about\">About</a></nav>\n                <main>{children}</main>\n                <footer>© My App</footer>\n            </body>\n        </html>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false],["app/pages/page.zx","pub fn Page(ctx: zx.PageContext) zx.Component {\n    return (\n        <main @allocator={ctx.arena}>\n            <h1>About Us</h1>\n            <p>Welcome to our website!</p>\n            <p>Path: {ctx.request.pathname}</p>\n        </main>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false]]],["csr","Client-side rendering",1,[["app/pages/layout.zx","pub fn Layout(ctx: zx.LayoutContext, children: zx.Component) zx.Component {\n    return (\n        <html @allocator={ctx.arena} lang=\"en-US\">\n            <head>\n                <meta charset=\"UTF-8\" />\n                <title>Playground</title>\n            </head>\n            <body>\n                {children}\n            </body>\n        </html>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false],["app/pages/page.zx","pub fn Page(ctx: zx.PageContext) !zx.Component {\n    return (\n        <main @allocator={ctx.arena}>\n            <Counter @client />\n        </main>\n    );\n}\npub fn Counter(ctx: *zx.ComponentCtx(void)) zx.Component {\n    const count = ctx.state(i32, 0);\n    return (\n        <div @allocator={ctx.allocator} class=\"counter\">\n            <button onclick={ctx.bind(increment)}>\n                Click Me: {count}\n            </button>\n        </div>\n    );\n}\nfn increment(e: *zx.client.Event.Stateful) void {\n    const count = e.state(i32);\n    count.set(count.get() + 1);\n}\n\nconst zx = @import(\"zx\");\n",false]]],["api-route","API route",1,[["app/pages/layout.zx","pub fn Layout(ctx: zx.LayoutContext, children: zx.Component) zx.Component {\n    return (\n        <html @allocator={ctx.arena}>\n            <head><title>My App</title></head>\n            <body>\n                <nav><a href=\"/\">Home</a> <a href=\"/about\">About</a></nav>\n                <main>{children}</main>\n                <footer>© My App</footer>\n            </body>\n        </html>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false],["app/pages/page.zx","pub fn Page(ctx: zx.PageContext) zx.Component {\n    return (\n        <main @allocator={ctx.arena}>\n            <h1>About Us</h1>\n            <p>Welcome to our website!</p>\n            <p>Path: {ctx.request.pathname}</p>\n        </main>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false],["app/routes/api/route.zig","pub fn GET(ctx: zx.RouteContext) !void {\n    try ctx.response.json(.{ .message = \"Hello World!\" }, .{});\n}\n\nconst zx = @import(\"zx\");\n",false]]],["onclick","Onclick",1,[["app/pages/layout.zx","pub fn Layout(ctx: zx.LayoutContext, children: zx.Component) zx.Component {\n    return (\n        <html @allocator={ctx.arena} lang=\"en-US\">\n            <head>\n                <meta charset=\"UTF-8\" />\n                <title>Playground</title>\n            </head>\n            <body>\n                {children}\n            </body>\n        </html>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false],["app/pages/page.zx","pub fn Page(ctx: zx.PageContext) !zx.Component {\n    return (<EventHandling @allocator={ctx.arena} @client />);\n}\npub fn Interactivity(allocator: zx.Allocator) zx.Component {\n    return (<EventHandling @{allocator} @client />);\n}\npub fn EventHandling(allocator: zx.Allocator) zx.Component {\n    return (\n        <main @allocator={allocator}>\n            <button onclick={handleClick}>Click me</button>\n            <input oninput={handleInput} />\n        </main>\n    );\n}\n\nfn handleClick(_: zx.client.Event) void {\n    zx.log.info(\"Clicked!\", .{});\n}\n\nfn handleInput(event: zx.client.Event) void {\n    const v = event.value() orelse \"\";\n    zx.log.info(\"Input: {s}\", .{v});\n}\n\nconst zx = @import(\"zx\");\n",false]]],["state","State management",1,[["app/pages/layout.zx","pub fn Layout(ctx: zx.LayoutContext, children: zx.Component) zx.Component {\n    return (\n        <html @allocator={ctx.arena} lang=\"en-US\">\n            <head>\n                <meta charset=\"UTF-8\" />\n                <title>Playground</title>\n            </head>\n            <body>\n                {children}\n            </body>\n        </html>\n    );\n}\n\nconst zx = @import(\"zx\");\n",false],["app/pages/page.zx","pub fn Page(ctx: zx.PageContext) !zx.Component {\n    return (<StatePanel @allocator={ctx.arena} @client />);\n}\npub fn StateDemo(allocator: zx.Allocator) zx.Component {\n    return (<StatePanel @allocator={allocator} @client />);\n}\n\npub fn StatePanel(ctx: *zx.ComponentCtx(void)) zx.Component {\n    const count = ctx.state(i32, 0);\n    const title = ctx.state([]const u8, \"Hello\");\n    return (\n        <div @allocator={ctx.allocator}>\n            <h1>App State: {title.get()}</h1>\n            <p>Count: {count.get()}</p>\n            <button onclick={count.bind(incrementCount)}>Increment Count</button>\n        </div>\n    );\n}\n\nfn incrementCount(value: i32) i32 {\n    return value + 1;\n}\n\nconst zx = @import(\"zx\");\n",false]]]]