{
  "version": 3,
  "sources": ["stepper.js"],
  "sourcesContent": ["// components/stepper.html: a clamped number moved by two buttons. Every change is\n// announced as `stepper-change` ({name, value}), so a form can show what the number\n// means (a price, a ball count) without reaching into this component.\ndocument.addEventListener(\"alpine:init\", () => {\n  window.Alpine.data(\"stepper\", ({ name, value, min, max, by = 1, others = 0 }) => ({\n    value,\n    min,\n    max,\n    others,\n\n    init() {\n      this.$watch(\"value\", (value) => this.$dispatch(\"stepper-change\", { name, value }));\n    },\n\n    step(direction) {\n      this.value = Math.min(this.max, Math.max(this.min, this.value + direction * by));\n    },\n\n    clamp() {\n      this.value = Math.min(this.max, Math.max(this.min, Math.round(this.value) || this.min));\n    },\n  }));\n});\n"],
  "mappings": "AAGA,SAAS,iBAAiB,cAAe,IAAM,CAC7C,OAAO,OAAO,KAAK,UAAW,CAAC,CAAE,KAAAA,EAAM,MAAAC,EAAO,IAAAC,EAAK,IAAAC,EAAK,GAAAC,EAAK,EAAG,OAAAC,EAAS,CAAE,KAAO,CAChF,MAAAJ,EACA,IAAAC,EACA,IAAAC,EACA,OAAAE,EAEA,MAAO,CACL,KAAK,OAAO,QAAUJ,GAAU,KAAK,UAAU,iBAAkB,CAAE,KAAAD,EAAM,MAAAC,CAAM,CAAC,CAAC,CACnF,EAEA,KAAKK,EAAW,CACd,KAAK,MAAQ,KAAK,IAAI,KAAK,IAAK,KAAK,IAAI,KAAK,IAAK,KAAK,MAAQA,EAAYF,CAAE,CAAC,CACjF,EAEA,OAAQ,CACN,KAAK,MAAQ,KAAK,IAAI,KAAK,IAAK,KAAK,IAAI,KAAK,IAAK,KAAK,MAAM,KAAK,KAAK,GAAK,KAAK,GAAG,CAAC,CACxF,CACF,EAAE,CACJ,CAAC",
  "names": ["name", "value", "min", "max", "by", "others", "direction"]
}
