import{r as registerInstance,h,H as Host,g as getElement}from"./index-55faf181.js";import{m as matchPath,i as isModifiedEvent}from"./dom-utils-796b2f82.js";import{A as ActiveRouter}from"./active-router-4c299649.js";import"./state-tunnel-04c0b67a.js";var devingenProductCardCss="devingen-product-card{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:calc(2 * var(--spacing-unit));color:var(--color-text);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}devingen-product-card .icon-container{padding:calc(1.5 * var(--spacing-unit));background:var(--color-background-primary);border-radius:calc(var(--corner-radius) / 3 * 2);margin-right:calc(2 * var(--spacing-unit))}devingen-product-card .icon-container.damga{background:var(--color-primary);color:white}";var productIcons={damga:"shield-check"};var DevingenHomePage=function(){function t(t){registerInstance(this,t)}t.prototype.render=function(){var t;var e=this.product;if(!e){return h(Host,null,h("div",{class:"icon-container"},h("dvn-icon",{iconName:"uil uil-plus",scale:"large"})),"Add new product")}return h(Host,null,h("div",{class:(t={"icon-container":true},t[e.type]=true,t)},h("dvn-icon",{iconName:"uil uil-"+(productIcons[e.type]||"question"),scale:"large"})),e.name)};return t}();DevingenHomePage.style=devingenProductCardCss;var getUrl=function(t,e){if(t.charAt(0)=="/"&&e.charAt(e.length-1)=="/"){return e.slice(0,e.length-1)+t}return e+t};var RouteLink=function(){function t(t){registerInstance(this,t);this.unsubscribe=function(){return};this.activeClass="link-active";this.exact=false;this.strict=true;this.custom="a";this.match=null}t.prototype.componentWillLoad=function(){this.computeMatch()};t.prototype.computeMatch=function(){if(this.location){this.match=matchPath(this.location.pathname,{path:this.urlMatch||this.url,exact:this.exact,strict:this.strict})}};t.prototype.handleClick=function(t){if(isModifiedEvent(t)||!this.history||!this.url||!this.root){return}t.preventDefault();return this.history.push(getUrl(this.url,this.root))};t.prototype.render=function(){var t;var e={class:(t={},t[this.activeClass]=this.match!==null,t),onClick:this.handleClick.bind(this)};if(this.anchorClass){e.class[this.anchorClass]=true}if(this.custom==="a"){e=Object.assign({},e,{href:this.url,title:this.anchorTitle,role:this.anchorRole,tabindex:this.anchorTabIndex,"aria-haspopup":this.ariaHaspopup,id:this.anchorId,"aria-posinset":this.ariaPosinset,"aria-setsize":this.ariaSetsize,"aria-label":this.ariaLabel})}return h(this.custom,Object.assign({},e),h("slot",null))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{location:["computeMatch"]}},enumerable:false,configurable:true});return t}();ActiveRouter.injectProps(RouteLink,["history","location","root"]);export{DevingenHomePage as devingen_product_card,RouteLink as stencil_route_link};