module.exports=[69147,a=>{"use strict";var b=a.i(87924);function c({title:a,description:c,controls:d,output:e}){return(0,b.jsxs)("div",{className:"container mx-auto px-4 py-8 max-w-7xl",children:[(0,b.jsxs)("div",{className:"mb-8",children:[(0,b.jsx)("h1",{className:"text-3xl font-bold tracking-tight text-foreground mb-2",children:a}),(0,b.jsx)("p",{className:"text-muted-foreground",children:c})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 items-start",children:[(0,b.jsx)("div",{className:"space-y-6",children:(0,b.jsx)("div",{className:"bg-card rounded-2xl border border-border p-6 shadow-sm",children:d})}),(0,b.jsx)("div",{className:"lg:sticky lg:top-24",children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wider px-1",children:"Generated Output"}),e]})})]})]})}a.s(["ToolLayout",()=>c])},5151,a=>{"use strict";let b=(0,a.i(70106).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);a.s(["Copy",()=>b],5151)},33441,a=>{"use strict";let b=(0,a.i(70106).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);a.s(["Check",()=>b],33441)},25451,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(69147),e=a.i(62258);function f(a,b,c){let{useNum:d=!1}=c;return null===b?"dynamic":"string"==typeof b?"String":"number"==typeof b?d?"num":b%1==0?"int":"double":"boolean"==typeof b?"bool":Array.isArray(b)?b.length>0?`List<${f(a,b[0],c)}>`:"List<dynamic>":"object"==typeof b?h(a):"dynamic"}function g(a){return a.replace(/([-_][a-z])/gi,a=>a.toUpperCase().replace("-","").replace("_","")).replace(/^[A-Z]/,a=>a.toLowerCase())}function h(a){let b=g(a);return b.charAt(0).toUpperCase()+b.slice(1)}let i=`{
  "id": 1,
  "name": "Leanne Graham",
  "username": "Bret",
  "email": "Sincere@april.biz",
  "address": {
    "street": "Kulas Light",
    "suite": "Apt. 556",
    "city": "Gwenborough",
    "zipcode": "92998-3874"
  },
  "tags": ["work", "important"]
}`;function j(){let[a,j]=(0,c.useState)(i),[l,m]=(0,c.useState)("UserResponse"),[n,o]=(0,c.useState)({className:"UserResponse",nullable:!0,useNum:!1,generateCopyWith:!0,generateToString:!1,generateEqHashCode:!1,useFreezed:!1,useEquatable:!1}),[p,q]=(0,c.useState)("");(0,c.useEffect)(()=>{q(function(a,b={}){let{className:c="Autogenerated",useFreezed:d}=b;try{let e=JSON.parse(a);if(d)return function a(b,c,d){let e=[],i=[],{nullable:j=!0}=d;for(let b of Object.keys(c)){let k=c[b],l=f(b,k,d),m=g(b),n=j?`${l}?`:l;if(e.push(`    ${n} ${m},`),"object"==typeof k&&null!==k&&!Array.isArray(k)){let c=h(b);i.push(a(c,k,d))}}let k=`import 'package:freezed_annotation/freezed_annotation.dart';

part '${b.toLowerCase()}.freezed.dart';
part '${b.toLowerCase()}.g.dart';

@freezed
class ${b} with _$${b} {
  const factory ${b}({
${e.join("\n")}
  }) = _${b};

  factory ${b}.fromJson(Map<String, dynamic> json) =>
      _$${b}FromJson(json);
}
`;return i.length>0&&(k+="\n"+i.join("\n")),k}(c,e,b);return function a(b,c,d){let e=[],i=[],j=[],k=[],l=[],m=[],{nullable:n=!0,generateCopyWith:o,generateToString:p,generateEqHashCode:q}=d;for(let b of Object.keys(c)){let o=c[b],p=f(b,o,d),q=g(b);m.push({camel:q,type:p});let r=n?`${p}?`:p;if(e.push(`  final ${r} ${q};`),n?i.push(`    this.${q},`):i.push(`    required this.${q},`),"object"!=typeof o||null===o||Array.isArray(o))j.push(`      ${q}: json['${b}'],`);else{let c=h(b),e=n?`json['${b}'] != null ? ${c}.fromJson(json['${b}']) : null`:`${c}.fromJson(json['${b}'])`;j.push(`      ${q}: ${e},`),l.push(a(c,o,d))}if("object"!=typeof o||null===o||Array.isArray(o))k.push(`    data['${b}'] = ${q};`);else{let a=n?`${q}?.toJson()`:`${q}.toJson()`;k.push(`    data['${b}'] = ${a};`)}}let{useEquatable:r}=d,s=r?`class ${b} extends Equatable {`:`class ${b} {`,t=`${s}
${e.join("\n")}

  ${b}({
${i.join("\n")}
  });

  factory ${b}.fromJson(Map<String, dynamic> json) {
    return ${b}(
${j.join("\n")}
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
${k.join("\n")}
    return data;
  }
`;if(r){let a=m.map(a=>a.camel).join(", ");t+=`
  @override
  List<Object?> get props => [${a}];
`}if(o){let a=m.map(a=>`    ${a.type}? ${a.camel},`).join("\n"),c=m.map(a=>`      ${a.camel}: ${a.camel} ?? this.${a.camel},`).join("\n");t+=`
  ${b} copyWith({
${a}
  }) {
    return ${b}(
${c}
    );
  }
`}if(p){let a=m.map(a=>`${a.camel}: $${a.camel}`).join(", ");t+=`
  @override
  String toString() {
    return '${b}(${a})';
  }
`}if(q){let a=m.map(a=>`other.${a.camel} == ${a.camel}`).join(" && "),c=m.map(a=>`${a.camel}.hashCode`).join(" ^ ");t+=`
  @override
  bool operator ==(Object other) {
    if (identical(this, other)) return true;
    return other is ${b} && ${a};
  }

  @override
  int get hashCode => ${c};
`}return t+="}\n",l.length>0&&(t+="\n"+l.join("\n")),t}(c,e,b)}catch(a){return`// Error parsing JSON: ${a.message}`}}(a,{...n,className:l}))},[a,l,n]);let r=a=>{o(b=>{let c={...b,[a]:!b[a]};return"useFreezed"===a&&c.useFreezed&&(c.useEquatable=!1),"useEquatable"===a&&c.useEquatable&&(c.useFreezed=!1),c})};return(0,b.jsx)(d.ToolLayout,{title:"JSON to Dart Model",description:"Advanced model generator with support for Standard Dart, Freezed, and Equatable.",controls:(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-xs font-black uppercase tracking-widest mb-2 text-muted-foreground/70",children:"Class Name"}),(0,b.jsx)("input",{type:"text",value:l,onChange:a=>m(a.target.value),className:"w-full px-4 py-3 bg-secondary/30 border border-border/50 rounded-2xl focus:ring-2 focus:ring-primary/50 outline-none transition-all font-bold text-sm",placeholder:"e.g. UserResponse"})]}),(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("label",{className:"block text-[10px] font-black uppercase tracking-[0.2em] text-muted-foreground/50",children:"Core Options"}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsx)(k,{label:"Null Safety",active:n.nullable,onClick:()=>r("nullable")}),(0,b.jsx)(k,{label:"Use num",active:n.useNum,onClick:()=>r("useNum")})]})]}),(0,b.jsxs)("div",{className:"space-y-3 pt-2",children:[(0,b.jsx)("label",{className:"block text-[10px] font-black uppercase tracking-[0.2em] text-muted-foreground/50",children:"Pro Features"}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsx)(k,{label:"Freezed",active:n.useFreezed,onClick:()=>r("useFreezed"),highlight:!0}),(0,b.jsx)(k,{label:"Equatable",active:n.useEquatable,onClick:()=>r("useEquatable"),highlight:!0})]})]}),!n.useFreezed&&(0,b.jsxs)("div",{className:"space-y-3 pt-2 animate-in fade-in slide-in-from-top-2 duration-300",children:[(0,b.jsx)("label",{className:"block text-[10px] font-black uppercase tracking-[0.2em] text-muted-foreground/50",children:"Boilerplate Generation"}),(0,b.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,b.jsx)(k,{label:"copyWith",active:n.generateCopyWith,onClick:()=>r("generateCopyWith"),small:!0}),(0,b.jsx)(k,{label:"toString",active:n.generateToString,onClick:()=>r("generateToString"),small:!0}),!n.useEquatable&&(0,b.jsx)(k,{label:"Equality",active:n.generateEqHashCode,onClick:()=>r("generateEqHashCode"),small:!0})]})]})]}),(0,b.jsxs)("div",{className:"pt-4 border-t border-border/50",children:[(0,b.jsx)("label",{className:"block text-xs font-black uppercase tracking-widest mb-3 text-muted-foreground/70",children:"JSON Input"}),(0,b.jsx)("textarea",{value:a,onChange:a=>j(a.target.value),className:"w-full h-[350px] px-4 py-4 bg-secondary/20 border border-border/40 rounded-3xl font-mono text-[11px] focus:ring-2 focus:ring-primary/30 outline-none transition-all resize-none custom-scrollbar",placeholder:'{"key": "value"}'})]})]}),output:(0,b.jsx)(e.CodeOutput,{code:p,language:"dart"})})}function k({label:a,active:c,onClick:d,highlight:e=!1,small:f=!1}){return(0,b.jsx)("button",{onClick:d,className:`
        flex items-center justify-center gap-2 px-3 py-2 rounded-xl text-[11px] font-bold transition-all duration-300 border
        ${c?e?"bg-primary text-primary-foreground border-primary shadow-lg shadow-primary/20":"bg-primary/10 text-primary border-primary/50":"bg-secondary/20 text-muted-foreground border-border/50 hover:border-border hover:bg-secondary/40"}
        ${f?"py-1.5 text-[10px]":"py-2.5"}
      `,children:a})}a.s(["default",()=>j],25451)}];

//# sourceMappingURL=_81fc01a1._.js.map