{"version":3,"file":"edsis-component-aspect-ratio.mjs","sources":["../../../library/component/aspect-ratio/aspect-ratio.component.ts","../../../library/component/aspect-ratio/edsis-component-aspect-ratio.ts"],"sourcesContent":["import { Component, computed, input } from '@angular/core';\nimport { cn } from '@edsis/component/class';\n\n@Component({\n  selector: 'AspectRatio',\n  host: {\n    '[class]': 'classes()',\n  },\n  template:\n    '<div [style.padding-bottom]=\"paddingBottom()\" class=\"block w-full\"></div><div class=\"absolute inset-0\"><ng-content /></div>',\n})\nexport class AspectRatioComponent {\n  readonly ratio = input.required<number>();\n  readonly class = input<string>('');\n\n  protected readonly classes = computed(() => cn('relative block w-full', this.class()));\n\n  protected readonly paddingBottom = computed(() => {\n    const ratio = this.ratio();\n\n    return Number.isFinite(ratio) && ratio > 0 ? `${100 / ratio}%` : '100%';\n  });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAWa,oBAAoB,CAAA;IACtB,KAAK,GAAG,KAAK,CAAC,QAAQ;8EAAU;IAChC,KAAK,GAAG,KAAK,CAAS,EAAE;8EAAC;AAEf,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,uBAAuB,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;gFAAC;AAEnE,IAAA,aAAa,GAAG,QAAQ,CAAC,MAAK;AAC/C,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE;QAE1B,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,GAAG,CAAA,EAAG,GAAG,GAAG,KAAK,GAAG,GAAG,MAAM;IACzE,CAAC;sFAAC;uGAVS,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAApB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,oBAAoB,kXAF7B,6HAA6H,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEpH,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBARhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,IAAI,EAAE;AACJ,wBAAA,SAAS,EAAE,WAAW;AACvB,qBAAA;AACD,oBAAA,QAAQ,EACN,6HAA6H;AAChI,iBAAA;;;ACVD;;AAEG;;;;"}