import { css, LitElement, html } from "lit";
import { property } from "lit/decorators.js";
import { LineMedium, LineType, lineColor, lineWidth } from "../index.js";
import { customElement } from "../../decorator.js";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __decorateClass = (decorators, target, key, kind) => {
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
    if (decorator = decorators[i])
      result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  if (kind && result) __defProp(target, key, result);
  return result;
};
let ObcLineOverlap = class extends LitElement {
  constructor() {
    super(...arguments);
    this.medium = LineMedium.normal;
    this.lineType = LineType.fluid;
  }
  render() {
    if (this.lineType === LineType.connector) {
      throw new Error("Connector line type not supported for line overlap");
    }
    const color = lineColor(this.medium);
    const width = lineWidth(this.lineType) + 1;
    const h = width / 2;
    return html`
      <svg
        class="line"
        width="24"
        height="24"
        viewBox="0 0 24 24"
        fill="none"
        xmlns="http://www.w3.org/2000/svg"
      >
        <path
          mask="url(#clip)"
          d="M${12 - h} -1V25h${width}V-1z"
          fill="var(${color.inner})"
          stroke="var(${color.outer})"
        />

        <path
          d="M-1 ${12 - h}H25v${width}H-1z"
          fill="var(${color.inner})"
          stroke="var(${color.outer})"
        />

        <defs>
          <mask id="clip">
            <rect x="0" y="0" width="24" height="24" fill="white" />
            <rect
              x="0"
              y="${12 - 2 - h}"
              width="24"
              height="${width + 4}"
              fill="black"
            />
          </mask>
        </defs>
      </svg>
    `;
  }
};
ObcLineOverlap.styles = css`
    :host {
      display: block;
      line-height: 0;
    }

    svg {
      position: relative;
      left: -12px;
      top: -12px;
    }
  `;
__decorateClass([
  property({ type: String })
], ObcLineOverlap.prototype, "medium", 2);
__decorateClass([
  property({ type: String })
], ObcLineOverlap.prototype, "lineType", 2);
ObcLineOverlap = __decorateClass([
  customElement("obc-line-overlap")
], ObcLineOverlap);
export {
  ObcLineOverlap
};
//# sourceMappingURL=line-overlap.js.map
