{"version":3,"file":"image.mjs","sources":["../../../../src/image/image.ts"],"sourcesContent":["import { html, LitElement, unsafeCSS, CSSResult, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport styles from './image.scss?inline';\nimport slotStyles from './image.slot.scss?inline';\nimport { appendStylesheet } from '../core';\n\n@customElement('pips-v1-image')\nexport class Image extends LitElement {\n  static override styles: CSSResult = unsafeCSS(styles);\n\n  @property({ type: String }) src: string = '';\n  @property({ type: String }) alt: string = '';\n  @property({ type: String }) caption: string = '';\n  @property({ type: String }) aspectRatio: string = '';\n  @property({ type: String }) focusPositionVertical: string = '';\n  @property({ type: String }) focusPositionHorizontal: string = '';\n  @property({ type: Boolean, reflect: true }) round: boolean = false;\n  @property({ type: String }) actionCardIconMode: string = ''; // Icon mode specifically for the action card, translates position on y axis.\n  @property({ type: String }) semanticIconMode: string = ''; // Generic icon mode for semantic icons using standard size (48px) from the Pips Design System.\n\n  override connectedCallback() {\n    super.connectedCallback();\n    \n    // Apply styles to slotted elements\n    appendStylesheet({\n      target: this,\n      styles: slotStyles,\n      name: `${this.tagName.toLowerCase()}-slot`\n    }); \n  }\n\n  override render() {\n    return html`\n      <img\n        class=\"image\"\n        src=\"${this.src ? this.src : nothing}\"\n        alt=\"${this.alt ? this.alt : \"\"}\"\n      />\n    ${(this.caption && this.src) ? html`<span class=\"image-caption\">${this.caption}</span>` : nothing}\n    `;\n  }\n}"],"names":["Image","LitElement","constructor","super","arguments","this","src","alt","caption","aspectRatio","focusPositionVertical","focusPositionHorizontal","round","actionCardIconMode","semanticIconMode","connectedCallback","appendStylesheet","target","styles","name","tagName","toLowerCase","render","html","nothing","unsafeCSS","__decorateClass","property","type","String","prototype","Boolean","reflect","customElement"],"mappings":"upCAOO,IAAMA,EAAN,cAAoBC,CAAAA,CAApB,aAAAC,CAAAC,MAAAA,GAAAC,SAAAA,EAGuBC,KAAAC,IAAc,GACdD,KAAAE,IAAc,GACdF,KAAAG,QAAkB,GAClBH,KAAAI,YAA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