{"version":3,"file":"jsxRuntime.mjs","sources":["../src/index.ts"],"sourcesContent":["import { h, Fragment } from 'lithent';\nimport type {\n  Props,\n  TagFunction,\n  FragmentFunction,\n  MiddleStateWDomChildren,\n} from 'lithent';\n\nfunction createWNode(\n  type: TagFunction | FragmentFunction | string,\n  orgProps: Props,\n  key: unknown,\n  isStaticChildren: boolean,\n  _source: unknown,\n  _self: unknown\n) {\n  const { children, ...props } = orgProps;\n  if (children !== null && children !== undefined) {\n    // A dynamic array is one keyed loop child of h(). Only jsxs/JSXDEV's\n    // static siblings may be spread; flattening a loop loses key matching.\n    const newChildren: MiddleStateWDomChildren =\n      isStaticChildren && Array.isArray(children) ? children : [children];\n\n    return h(type, { ...props, key } as Props, ...newChildren);\n  }\n\n  return h(type, { ...props, key } as Props);\n}\n\nfunction createStaticWNode(\n  type: TagFunction | FragmentFunction | string,\n  orgProps: Props,\n  key: unknown,\n  _isStaticChildren?: boolean,\n  _source?: unknown,\n  _self?: unknown\n) {\n  return createWNode(type, orgProps, key, true, undefined, undefined);\n}\n\nexport {\n  createWNode as jsx,\n  createStaticWNode as jsxs,\n  createWNode as jsxDEV,\n  Fragment,\n};\n"],"names":["createWNode","type","orgProps","key","isStaticChildren","_source","_self","children","props","newChildren","h","createStaticWNode","_isStaticChildren"],"mappings":";;AAQA,SAASA,EACPC,GACAC,GACAC,GACAC,GACAC,GACAC,GACA;AACA,QAAM,EAAE,UAAAC,GAAU,GAAGC,EAAA,IAAUN;AAC3B,MAAAK,KAAa,MAAgC;AAGzC,UAAAE,IACJL,KAAoB,MAAM,QAAQG,CAAQ,IAAIA,IAAW,CAACA,CAAQ;AAE7D,WAAAG,EAAET,GAAM,EAAE,GAAGO,GAAO,KAAAL,EAAI,GAAY,GAAGM,CAAW;AAAA,EAC3D;AAEA,SAAOC,EAAET,GAAM,EAAE,GAAGO,GAAO,KAAAL,EAAc,CAAA;AAC3C;AAEA,SAASQ,EACPV,GACAC,GACAC,GACAS,GACAP,GACAC,GACA;AACA,SAAON,EAAYC,GAAMC,GAAUC,GAAK,EAA0B;AACpE;"}