{"version":3,"file":"slider.cjs","names":["createLitComponent","SliderApi","uniqueId","LEAF_MARGIN","nothing"],"sources":["../../../../src/web-components/catalog/basic/slider.ts"],"sourcesContent":["import { html, nothing } from \"lit\";\nimport { styleMap } from \"lit/directives/style-map.js\";\nimport { SliderApi } from \"@a2ui/web_core/v0_9/basic_catalog\";\nimport { createLitComponent } from \"../../adapter\";\nimport { uniqueId } from \"./ids\";\nimport { LEAF_MARGIN } from \"./utils\";\n\nexport const Slider = createLitComponent(SliderApi, ({ props }) => {\n  const inputId = uniqueId(\"slider\");\n  return html`\n    <div\n      style=${styleMap({\n        display: \"flex\",\n        flexDirection: \"column\",\n        gap: \"4px\",\n        margin: LEAF_MARGIN,\n        width: \"100%\",\n      })}\n    >\n      <div style=\"display: flex; justify-content: space-between;\">\n        ${\n          props.label\n            ? html`<label\n              for=${inputId}\n              style=\"font-size: 14px; font-weight: bold;\"\n              >${props.label}</label\n            >`\n            : nothing\n        }\n        <span style=\"font-size: 12px; color: #666;\">${props.value}</span>\n      </div>\n      <input\n        id=${inputId}\n        type=\"range\"\n        min=${props.min ?? 0}\n        max=${props.max}\n        .value=${String(props.value ?? 0)}\n        @input=${(e: Event) =>\n          props.setValue(Number((e.target as HTMLInputElement).value))}\n        style=\"width: 100%; cursor: pointer;\"\n      />\n    </div>\n  `;\n});\n"],"mappings":";;;;;;;;AAOA,MAAa,SAASA,mCAAmBC,8CAAY,EAAE,YAAY;CACjE,MAAM,UAAUC,qBAAS,SAAS;AAClC,QAAO,QAAI;;wDAEU;EACf,SAAS;EACT,eAAe;EACf,KAAK;EACL,QAAQC;EACR,OAAO;EACR,CAAC,CAAC;;;UAIC,MAAM,QACF,QAAI;oBACE,QAAQ;;iBAEX,MAAM,MAAM;iBAEfC,YACL;sDAC6C,MAAM,MAAM;;;aAGrD,QAAQ;;cAEP,MAAM,OAAO,EAAE;cACf,MAAM,IAAI;iBACP,OAAO,MAAM,SAAS,EAAE,CAAC;kBACxB,MACR,MAAM,SAAS,OAAQ,EAAE,OAA4B,MAAM,CAAC,CAAC;;;;;EAKrE"}