{"version":3,"file":"seo-link-QizFM6Tt.js","sources":["../../src/atoms/seo/seo-link.ts"],"sourcesContent":["import { css, html, LitElement } from \"lit\";\nimport { customElement } from \"lit/decorators/custom-element.js\";\nimport { property } from \"lit/decorators/property.js\";\nimport { query } from \"lit/decorators/query.js\";\nimport { pushState } from \"../../util/route-util\";\nimport { stopEvent } from \"../../util/util\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\n\n@customElement(\"bs-seo-link\")\nexport class BsSEOLink extends LitElement {\n\t@property({ type: String }) href!: string;\n\t@property({ type: String }) target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\" | \"framename\";\n\t@property({ type: Boolean, attribute: \"no-routing\" }) noRouting: boolean = false;\n\t@query(\"#anchor\") anchor!: HTMLAnchorElement;\n\n\tstatic get styles() {\n\t\treturn [\n\t\t\tcss`\n\t\t\t\ta {\n\t\t\t\t\tall: unset;\n\t\t\t\t\tdisplay: contents;\n\t\t\t\t}\n\t\t\t`\n\t\t];\n\t}\n\n\thandleClick(e: Event) {\n\t\t// If the link is inactive, do nothing.\n\t\t// Then it is just for SEO and the routing will be handled at another place.\n\t\tif (this.noRouting) {\n\t\t\tstopEvent(e);\n\t\t\treturn;\n\t\t}\n\n\t\tconst href = this.anchor.href;\n\n\t\t// If it is a relative link, use webapp routing instead\n\t\tif (href.startsWith(location.origin) && this.anchor.target !== \"_blank\") {\n\t\t\tpushState(href);\n\t\t\tstopEvent(e);\n\t\t}\n\t}\n\n\trender() {\n\t\treturn html``;\n\t}\n}\n"],"names":["BsSEOLink","LitElement","css","e","stopEvent","href","pushState","html","ifDefined","__decorateClass","property","query","customElement"],"mappings":"6TASa,IAAAA,EAAN,cAAwBC,CAAW,CAAnC,aAAA,CAAA,MAAA,GAAA,SAAA,EAGqE,KAAA,UAAA,EAAA,CAG3E,WAAW,QAAS,CACZ,MAAA,CACNC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,IAAA,CAOF,CAEA,YAAYC,EAAU,CAGrB,GAAI,KAAK,UAAW,CACnBC,EAAUD,CAAC,EACX,MACD,CAEM,MAAAE,EAAO,KAAK,OAAO,KAGrBA,EAAK,WAAW,SAAS,MAAM,GAAK,KAAK,OAAO,SAAW,WAC9DC,EAAUD,CAAI,EACdD,EAAUD,CAAC,EAEb,CAEA,QAAS,CACD,OAAAI,2BAA8BC,EAAU,KAAK,MAAM,CAAC,WAAW,KAAK,IAAI,aAAa,KAAK,WAAW;AAAA;AAAA,QAG7G,CACD,EAtC6BC,EAAA,CAA3BC,EAAS,CAAE,KAAM,OAAQ,CAAA,EADdV,EACgB,UAAA,OAAA,CAAA,EACAS,EAAA,CAA3BC,EAAS,CAAE,KAAM,OAAQ,CAAA,EAFdV,EAEgB,UAAA,SAAA,CAAA,EAC0BS,EAAA,CAArDC,EAAS,CAAE,KAAM,QAAS,UAAW,aAAc,CAAA,EAHxCV,EAG0C,UAAA,YAAA,CAAA,EACpCS,EAAA,CAAjBE,EAAM,SAAS,CAAA,EAJJX,EAIM,UAAA,SAAA,CAAA,EAJNA,EAANS,EAAA,CADNG,EAAc,aAAa,CAAA,EACfZ,CAAA"}