@oslokommune/punkt-vue 12.4.3 → 12.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/{Alert-DBTgGUEd.cjs → Alert-B279aShs.cjs} +1 -1
- package/dist/{Alert-Ch2E8es4.js → Alert-trs3P4vL.js} +1 -1
- package/dist/{Button-CS1u9-BP.cjs → Button-DTexYyWR.cjs} +1 -1
- package/dist/{Button-CWezH85z.js → Button-HjeYh5Kr.js} +2 -2
- package/dist/{Helptext-DJ0K7o4h.js → Helptext-CzFnl9PC.js} +1 -1
- package/dist/{Helptext-CFcoLn_T.cjs → Helptext-qrHljck3.cjs} +1 -1
- package/dist/Icon-CRFNDFzs.cjs +43 -0
- package/dist/Icon-GlEtmPo3.js +979 -0
- package/dist/{InputWrapper-PnizBhWS.cjs → InputWrapper-Cf9IXORl.cjs} +1 -1
- package/dist/{InputWrapper-BrZv9Aan.js → InputWrapper-DQyCKwZ5.js} +2 -2
- package/dist/{Tag-CDG92YYT.js → Tag-BXfw0rIo.js} +1 -1
- package/dist/{Tag-D4aWq2mA.cjs → Tag-DWEVdX9_.cjs} +1 -1
- package/dist/punkt-vue-accordion.cjs +1 -1
- package/dist/punkt-vue-accordion.js +1 -1
- package/dist/punkt-vue-alert.cjs +1 -1
- package/dist/punkt-vue-alert.js +1 -1
- package/dist/punkt-vue-backlink.cjs +1 -1
- package/dist/punkt-vue-backlink.js +1 -1
- package/dist/punkt-vue-breadcrumbs.cjs +1 -1
- package/dist/punkt-vue-breadcrumbs.js +1 -1
- package/dist/punkt-vue-button.cjs +1 -1
- package/dist/punkt-vue-button.js +1 -1
- package/dist/punkt-vue-footer.cjs +1 -1
- package/dist/punkt-vue-footer.js +1 -1
- package/dist/punkt-vue-footersimple.cjs +1 -1
- package/dist/punkt-vue-footersimple.js +1 -1
- package/dist/punkt-vue-header.cjs +1 -1
- package/dist/punkt-vue-header.js +4 -4
- package/dist/punkt-vue-helptext.cjs +1 -1
- package/dist/punkt-vue-helptext.js +1 -1
- package/dist/punkt-vue-icon.cjs +1 -1
- package/dist/punkt-vue-icon.js +1 -1
- package/dist/punkt-vue-index.cjs +1 -1
- package/dist/punkt-vue-index.js +6 -6
- package/dist/punkt-vue-inputwrapper.cjs +1 -1
- package/dist/punkt-vue-inputwrapper.js +1 -1
- package/dist/punkt-vue-linkcard.cjs +1 -1
- package/dist/punkt-vue-linkcard.js +1 -1
- package/dist/punkt-vue-loader.cjs +1 -1
- package/dist/punkt-vue-loader.js +2 -2
- package/dist/punkt-vue-messagebox.cjs +1 -1
- package/dist/punkt-vue-messagebox.js +1 -1
- package/dist/punkt-vue-searchinput.cjs +1 -1
- package/dist/punkt-vue-searchinput.js +2 -2
- package/dist/punkt-vue-select.cjs +1 -1
- package/dist/punkt-vue-select.js +4 -4
- package/dist/punkt-vue-tabs.cjs +1 -1
- package/dist/punkt-vue-tabs.js +2 -2
- package/dist/punkt-vue-tag.cjs +1 -1
- package/dist/punkt-vue-tag.js +1 -1
- package/dist/punkt-vue-textarea.cjs +1 -1
- package/dist/punkt-vue-textarea.js +4 -4
- package/dist/punkt-vue-textinput.cjs +1 -1
- package/dist/punkt-vue-textinput.js +3 -3
- package/package.json +4 -3
- package/src/components/icon/Icon.vue +2 -66
- package/dist/Icon-BJ7hvALz.cjs +0 -1
- package/dist/Icon-DPY4YYRY.js +0 -58
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,24 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [12.5.0](https://github.com/oslokommune/punkt/compare/12.4.3...12.5.0) (2024-10-23)
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
Ingen
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
* Ny PktIcon og endelig dokumentasjon på komponenten (#1980).
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
Ingen
|
|
19
|
+
|
|
20
|
+
### Chores
|
|
21
|
+
Ingen
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
|
|
8
26
|
## [12.4.2](https://github.com/oslokommune/punkt/compare/12.4.1...12.4.2) (2024-10-23)
|
|
9
27
|
|
|
10
28
|
### ⚠ BREAKING CHANGES
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("./Icon-
|
|
1
|
+
"use strict";const s=require("./Icon-CRFNDFzs.cjs"),e=require("vue"),c=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),i={name:"PktAlert",components:{PktIcon:s.PktIcon},props:{skin:{type:String,default:"info",validator(o){return["error","success","warning","info"].includes(o)}},closeAlert:{type:Boolean,default:!1},title:{type:String,default:""},date:{type:String,default:""},ariaLive:{type:String,default:"polite",validator(o){return["off","polite","assertive"].includes(o)}},compact:{type:Boolean,default:!1}},data:()=>({closed:!1}),methods:{close(){this.closed=!0,this.$emit("on-close",this.closed)}},computed:{skinClass(){return[`pkt-alert--${this.skin}`]},open(){return!this.closed},iconName(){return this.skin==="info"?"alert-information":`alert-${this.skin}`}}},d=["aria-live"],k={key:0,class:"pkt-alert__close"},u={key:1,class:"pkt-alert__title"},m={class:"pkt-alert__text"},p={key:2,class:"pkt-alert__date"};function _(o,n,t,v,y,l){const r=e.resolveComponent("PktIcon");return e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({"pkt-alert":!0,[l.skinClass]:!0,"pkt-alert--compact":t.compact}),"aria-live":t.ariaLive},[e.createVNode(r,{name:l.iconName,class:"pkt-alert__icon"},null,8,["name"]),t.closeAlert?(e.openBlock(),e.createElementBlock("div",k,[e.createElementVNode("button",{class:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",type:"button",role:"button",tabindex:"0","aria-label":"close",onKeyup:n[0]||(n[0]=e.withKeys((...a)=>l.close&&l.close(...a),["enter"])),onClick:n[1]||(n[1]=(...a)=>l.close&&l.close(...a))},[e.createVNode(r,{class:"pkt-btn__icon",name:"close"})],32)])):e.createCommentVNode("",!0),t.title?(e.openBlock(),e.createElementBlock("div",u,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",m,[e.renderSlot(o.$slots,"default")]),t.date?(e.openBlock(),e.createElementBlock("div",p,"Sist oppdatert: "+e.toDisplayString(t.date),1)):e.createCommentVNode("",!0)],10,d)),[[e.vShow,l.open]])}const f=c._export_sfc(i,[["render",_]]);exports.PktAlert=f;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as u } from "./Icon-
|
|
1
|
+
import { P as u } from "./Icon-GlEtmPo3.js";
|
|
2
2
|
import { resolveComponent as m, withDirectives as _, openBlock as s, createElementBlock as o, normalizeClass as p, createVNode as c, createElementVNode as d, withKeys as f, createCommentVNode as r, toDisplayString as k, renderSlot as v, vShow as y } from "vue";
|
|
3
3
|
import { _ as h } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
4
|
const b = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("./Icon-
|
|
1
|
+
"use strict";const o=require("./Icon-CRFNDFzs.cjs"),e=require("vue"),r=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),u={name:"PktButton",components:{PktIcon:o.PktIcon},props:{disabled:{type:Boolean,required:!1,default:!1},iconName:{type:String,required:!1,default:"user"},secondIconName:{type:String,required:!1,default:"user"},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},skin:{type:String,default:"primary",validator:t=>["primary","secondary","tertiary"].includes(t)},color:{type:String,validator:t=>["blue","blue-outline","green","green-outline","green-dark","green-dark-outline","beige-light","beige-dark-outline","yellow","yellow-outline","red","red-outline"].includes(t)},text:{type:String,required:!1,default:"Trykk her"},variant:{type:String,default:"label-only",validator:t=>["label-only","icon-left","icon-right","icon-only","icons-right-and-left"].includes(t)},state:{type:String,required:!1,validator:t=>["normal","focus","hover","active"].includes(t)},type:{type:String,default:"button",validator:t=>["button","submit","reset"].includes(t)},isLoading:{type:Boolean,default:!1}},computed:{classes(){return["pkt-btn",this.sizeClass,this.skinClass,this.variantClass,this.colorClass,this.isLoadingClass,this.stateClass]},sizeClass(){return this.size!=="medium"?`pkt-btn--${this.size}`:""},skinClass(){return this.skin!=="primary"?`pkt-btn--${this.skin}`:""},colorClass(){return this.color?`pkt-btn--${this.color}`:""},stateClass(){return this.state?`pkt-btn--${this.state}`:""},variantClass(){return this.variant!=="label-only"?`pkt-btn--${this.variant}`:""},isLoadingClass(){return this.isLoading===!0?"pkt-btn--active":""}}},c=["type","disabled"],d={class:"pkt-btn__text"};function k(t,s,n,p,y,a){const i=e.resolveComponent("PktIcon");return e.openBlock(),e.createElementBlock("button",e.mergeProps(t.$attrs,{type:n.type,class:a.classes,onClick:s[0]||(s[0]=l=>t.$emit("onClick")),onKeyup:s[1]||(s[1]=e.withKeys(l=>t.$emit("onClick"),["enter"])),disabled:n.disabled}),[n.isLoading===!0?(e.openBlock(),e.createBlock(i,{key:0,class:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:"https://punkt-cdn.oslo.kommune.no/12.5/animations/"})):e.createCommentVNode("",!0),n.variant!=="label-only"?(e.openBlock(),e.createBlock(i,{key:1,class:"pkt-btn__icon",name:n.iconName},null,8,["name"])):e.createCommentVNode("",!0),e.createElementVNode("span",d,[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.text),1)])]),n.variant==="icons-right-and-left"?(e.openBlock(),e.createBlock(i,{key:2,class:"pkt-btn__icon",name:n.secondIconName},null,8,["name"])):e.createCommentVNode("",!0)],16,c)}const m=r._export_sfc(u,[["render",k]]);exports.PktButton=m;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as d } from "./Icon-
|
|
1
|
+
import { P as d } from "./Icon-GlEtmPo3.js";
|
|
2
2
|
import { resolveComponent as u, openBlock as s, createElementBlock as c, mergeProps as m, withKeys as k, createBlock as a, createCommentVNode as l, createElementVNode as p, renderSlot as y, createTextVNode as b, toDisplayString as f } from "vue";
|
|
3
3
|
import { _ as g } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
4
|
const h = {
|
|
@@ -120,7 +120,7 @@ function _(t, n, e, S, P, r) {
|
|
|
120
120
|
key: 0,
|
|
121
121
|
class: "pkt-btn__icon pkt-btn__spinner",
|
|
122
122
|
name: "spinner-blue",
|
|
123
|
-
path: "https://punkt-cdn.oslo.kommune.no/12.
|
|
123
|
+
path: "https://punkt-cdn.oslo.kommune.no/12.5/animations/"
|
|
124
124
|
})) : l("", !0),
|
|
125
125
|
e.variant !== "label-only" ? (s(), a(i, {
|
|
126
126
|
key: 1,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as a } from "./Button-
|
|
1
|
+
import { P as a } from "./Button-HjeYh5Kr.js";
|
|
2
2
|
import { resolveComponent as d, openBlock as p, createElementBlock as o, createCommentVNode as l, createVNode as h, withCtx as c, createElementVNode as r, normalizeClass as u, renderSlot as x } from "vue";
|
|
3
3
|
import { _ } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
4
|
const m = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const l=require("./Button-
|
|
1
|
+
"use strict";const l=require("./Button-DTexYyWR.cjs"),e=require("vue"),i=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),s={name:"pktHelptext",components:{PktButton:l.PktButton},emits:["toggleHelpText"],props:{forId:{type:String,required:!0},helptext:{type:String,required:!1},helptextDropdown:{type:String,required:!1},helptextDropdownButton:{type:String,required:!1}},data(){return{isHelpTextOpen:!1}},methods:{toggleHelpText(){this.isHelpTextOpen=!this.isHelpTextOpen,this.$emit("toggleHelpText",this.isHelpTextOpen)}},computed:{hasDropDown(){return!!this.helptextDropdown&&this.helptextDropdown!==""},dropdownButton(){return this.helptextDropdownButton||'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}}},c=["id","innerHTML"],a={key:1,class:"pkt-inputwrapper__helptext-expandable"},d=["innerHTML"],u=["innerHTML"];function h(o,_,t,k,n,p){const r=e.resolveComponent("PktButton");return e.openBlock(),e.createElementBlock("div",null,[t.helptext?(e.openBlock(),e.createElementBlock("div",{key:0,class:"pkt-inputwrapper__helptext",id:`${t.forId}-helptext`,innerHTML:t.helptext},null,8,c)):e.createCommentVNode("",!0),p.hasDropDown?(e.openBlock(),e.createElementBlock("div",a,[e.createVNode(r,{skin:"tertiary",size:"small",variant:"icon-right","icon-name":n.isHelpTextOpen?"chevron-thin-up":"chevron-thin-down",class:"pkt-link pkt-link--icon-right",onOnClick:p.toggleHelpText},{default:e.withCtx(()=>[e.createElementVNode("span",{innerHTML:p.dropdownButton},null,8,d)]),_:1},8,["icon-name","onOnClick"]),e.createElementVNode("div",{class:e.normalizeClass(["pkt-inputwrapper__helptext",{"pkt-inputwrapper__helptext-expandable-open":n.isHelpTextOpen,"pkt-inputwrapper__helptext-expandable-closed":!n.isHelpTextOpen}])},[e.createElementVNode("span",{innerHTML:t.helptextDropdown},null,8,u)],2),e.renderSlot(o.$slots,"default")])):e.createCommentVNode("",!0)])}const x=i._export_sfc(s,[["render",h]]);exports.PktHelptext=x;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";const z=require("vue"),bt=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/const L=globalThis,Y=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,yt=Symbol(),et=new WeakMap;let Et=class{constructor(s,t,e){if(this._$cssResult$=!0,e!==yt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=s,this.t=t}get styleSheet(){let s=this.o;const t=this.t;if(Y&&s===void 0){const e=t!==void 0&&t.length===1;e&&(s=et.get(t)),s===void 0&&((this.o=s=new CSSStyleSheet).replaceSync(this.cssText),e&&et.set(t,s))}return s}toString(){return this.cssText}};const wt=s=>new Et(typeof s=="string"?s:s+"",void 0,yt),St=(s,t)=>{if(Y)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),n=L.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=e.cssText,s.appendChild(i)}},st=Y?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return wt(e)})(s):s;/**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2017 Google LLC
|
|
8
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
+
*/const{is:Pt,defineProperty:Ct,getOwnPropertyDescriptor:Ut,getOwnPropertyNames:Tt,getOwnPropertySymbols:xt,getPrototypeOf:kt}=Object,P=globalThis,it=P.trustedTypes,Ot=it?it.emptyScript:"",nt=P.reactiveElementPolyfillSupport,x=(s,t)=>s,F={toAttribute(s,t){switch(t){case Boolean:s=s?Ot:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},Q=(s,t)=>!Pt(s,t),rt={attribute:!0,type:String,converter:F,reflect:!1,hasChanged:Q};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),P.litPropertyMetadata??(P.litPropertyMetadata=new WeakMap);class S extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=rt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(t,i,e);n!==void 0&&Ct(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){const{get:n,set:o}=Ut(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get(){return n==null?void 0:n.call(this)},set(r){const l=n==null?void 0:n.call(this);o.call(this,r),this.requestUpdate(t,l,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??rt}static _$Ei(){if(this.hasOwnProperty(x("elementProperties")))return;const t=kt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(x("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(x("properties"))){const e=this.properties,i=[...Tt(e),...xt(e)];for(const n of i)this.createProperty(n,e[n])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,n]of e)this.elementProperties.set(i,n)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const n=this._$Eu(e,i);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const n of i)e.unshift(st(n))}else t!==void 0&&e.push(st(t));return e}static _$Eu(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return St(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostConnected)==null?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){var i;const n=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,n);if(o!==void 0&&n.reflect===!0){const r=(((i=n.converter)==null?void 0:i.toAttribute)!==void 0?n.converter:F).toAttribute(e,n.type);this._$Em=t,r==null?this.removeAttribute(o):this.setAttribute(o,r),this._$Em=null}}_$AK(t,e){var i;const n=this.constructor,o=n._$Eh.get(t);if(o!==void 0&&this._$Em!==o){const r=n.getPropertyOptions(o),l=typeof r.converter=="function"?{fromAttribute:r.converter}:((i=r.converter)==null?void 0:i.fromAttribute)!==void 0?r.converter:F;this._$Em=o,this[o]=l.fromAttribute(e,r.type),this._$Em=null}}requestUpdate(t,e,i){if(t!==void 0){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??Q)(this[t],e))return;this.P(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,r]of this._$Ep)this[o]=r;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[o,r]of n)r.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],r)}let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),(t=this._$EO)==null||t.forEach(n=>{var o;return(o=n.hostUpdate)==null?void 0:o.call(n)}),this.update(i)):this._$EU()}catch(n){throw e=!1,this._$EU(),n}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(i=>{var n;return(n=i.hostUpdated)==null?void 0:n.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}S.elementStyles=[],S.shadowRootOptions={mode:"open"},S[x("elementProperties")]=new Map,S[x("finalized")]=new Map,nt==null||nt({ReactiveElement:S}),(P.reactiveElementVersions??(P.reactiveElementVersions=[])).push("2.0.4");/**
|
|
10
|
+
* @license
|
|
11
|
+
* Copyright 2017 Google LLC
|
|
12
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
+
*/const B=globalThis,q=B.trustedTypes,ot=q?q.createPolicy("lit-html",{createHTML:s=>s}):void 0,ft="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,$t="?"+_,Mt=`<${$t}>`,E=document,O=()=>E.createComment(""),M=s=>s===null||typeof s!="object"&&typeof s!="function",X=Array.isArray,Rt=s=>X(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",W=`[
|
|
14
|
+
\f\r]`,T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,at=/-->/g,lt=/>/g,A=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ht=/'/g,ct=/"/g,_t=/^(?:script|style|textarea|title)$/i,Nt=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),Ht=Nt(1),w=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),dt=new WeakMap,b=E.createTreeWalker(E,129);function At(s,t){if(!X(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return ot!==void 0?ot.createHTML(t):t}const It=(s,t)=>{const e=s.length-1,i=[];let n,o=t===2?"<svg>":t===3?"<math>":"",r=T;for(let l=0;l<e;l++){const a=s[l];let p,v,h=-1,f=0;for(;f<a.length&&(r.lastIndex=f,v=r.exec(a),v!==null);)f=r.lastIndex,r===T?v[1]==="!--"?r=at:v[1]!==void 0?r=lt:v[2]!==void 0?(_t.test(v[2])&&(n=RegExp("</"+v[2],"g")),r=A):v[3]!==void 0&&(r=A):r===A?v[0]===">"?(r=n??T,h=-1):v[1]===void 0?h=-2:(h=r.lastIndex-v[2].length,p=v[1],r=v[3]===void 0?A:v[3]==='"'?ct:ht):r===ct||r===ht?r=A:r===at||r===lt?r=T:(r=A,n=void 0);const $=r===A&&s[l+1].startsWith("/>")?" ":"";o+=r===T?a+Mt:h>=0?(i.push(p),a.slice(0,h)+ft+a.slice(h)+_+$):a+_+(h===-2?l:$)}return[At(s,o+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};class R{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let o=0,r=0;const l=t.length-1,a=this.parts,[p,v]=It(t,e);if(this.el=R.createElement(p,i),b.currentNode=this.el.content,e===2||e===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(n=b.nextNode())!==null&&a.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(const h of n.getAttributeNames())if(h.endsWith(ft)){const f=v[r++],$=n.getAttribute(h).split(_),I=/([.?@])?(.*)/.exec(f);a.push({type:1,index:o,name:I[2],strings:$,ctor:I[1]==="."?Lt:I[1]==="?"?Dt:I[1]==="@"?Ft:j}),n.removeAttribute(h)}else h.startsWith(_)&&(a.push({type:6,index:o}),n.removeAttribute(h));if(_t.test(n.tagName)){const h=n.textContent.split(_),f=h.length-1;if(f>0){n.textContent=q?q.emptyScript:"";for(let $=0;$<f;$++)n.append(h[$],O()),b.nextNode(),a.push({type:2,index:++o});n.append(h[f],O())}}}else if(n.nodeType===8)if(n.data===$t)a.push({type:2,index:o});else{let h=-1;for(;(h=n.data.indexOf(_,h+1))!==-1;)a.push({type:7,index:o}),h+=_.length-1}o++}}static createElement(t,e){const i=E.createElement("template");return i.innerHTML=t,i}}function C(s,t,e=s,i){var n,o;if(t===w)return t;let r=i!==void 0?(n=e._$Co)==null?void 0:n[i]:e._$Cl;const l=M(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==l&&((o=r==null?void 0:r._$AO)==null||o.call(r,!1),l===void 0?r=void 0:(r=new l(s),r._$AT(s,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=r:e._$Cl=r),r!==void 0&&(t=C(s,r._$AS(s,t.values),r,i)),t}class Vt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,n=((t==null?void 0:t.creationScope)??E).importNode(e,!0);b.currentNode=n;let o=b.nextNode(),r=0,l=0,a=i[0];for(;a!==void 0;){if(r===a.index){let p;a.type===2?p=new N(o,o.nextSibling,this,t):a.type===1?p=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(p=new Bt(o,this,t)),this._$AV.push(p),a=i[++l]}r!==(a==null?void 0:a.index)&&(o=b.nextNode(),r++)}return b.currentNode=E,n}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class N{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,n){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=n,this._$Cv=(n==null?void 0:n.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=C(this,t,e),M(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==w&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Rt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&M(this._$AH)?this._$AA.nextSibling.data=t:this.T(E.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:n}=t,o=typeof n=="number"?this._$AC(t):(n.el===void 0&&(n.el=R.createElement(At(n.h,n.h[0]),this.options)),n);if(((e=this._$AH)==null?void 0:e._$AD)===o)this._$AH.p(i);else{const r=new Vt(o,this),l=r.u(this.options);r.p(i),this.T(l),this._$AH=r}}_$AC(t){let e=dt.get(t.strings);return e===void 0&&dt.set(t.strings,e=new R(t)),e}k(t){X(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,n=0;for(const o of t)n===e.length?e.push(i=new N(this.O(O()),this.O(O()),this,this.options)):i=e[n],i._$AI(o),n++;n<e.length&&(this._$AR(i&&i._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t&&t!==this._$AB;){const n=t.nextSibling;t.remove(),t=n}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class j{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,n,o){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=d}_$AI(t,e=this,i,n){const o=this.strings;let r=!1;if(o===void 0)t=C(this,t,e,0),r=!M(t)||t!==this._$AH&&t!==w,r&&(this._$AH=t);else{const l=t;let a,p;for(t=o[0],a=0;a<o.length-1;a++)p=C(this,l[i+a],e,a),p===w&&(p=this._$AH[a]),r||(r=!M(p)||p!==this._$AH[a]),p===d?t=d:t!==d&&(t+=(p??"")+o[a+1]),this._$AH[a]=p}r&&!n&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Lt extends j{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class Dt extends j{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class Ft extends j{constructor(t,e,i,n,o){super(t,e,i,n,o),this.type=5}_$AI(t,e=this){if((t=C(this,t,e,0)??d)===w)return;const i=this._$AH,n=t===d&&i!==d||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==d&&(i===d||n);n&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Bt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){C(this,t)}}const pt=B.litHtmlPolyfillSupport;pt==null||pt(R,N),(B.litHtmlVersions??(B.litHtmlVersions=[])).push("3.2.1");const qt=(s,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let n=i._$litPart$;if(n===void 0){const o=(e==null?void 0:e.renderBefore)??null;i._$litPart$=n=new N(t.insertBefore(O(),o),o,void 0,e??{})}return n._$AI(s),n};/**
|
|
16
|
+
* @license
|
|
17
|
+
* Copyright 2017 Google LLC
|
|
18
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
+
*/let k=class extends S{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var s;const t=super.createRenderRoot();return(s=this.renderOptions).renderBefore??(s.renderBefore=t.firstChild),t}update(s){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(s),this._$Do=qt(t,this.renderRoot,this.renderOptions)}connectedCallback(){var s;super.connectedCallback(),(s=this._$Do)==null||s.setConnected(!0)}disconnectedCallback(){var s;super.disconnectedCallback(),(s=this._$Do)==null||s.setConnected(!1)}render(){return w}};var ut;k._$litElement$=!0,k.finalized=!0,(ut=globalThis.litElementHydrateSupport)==null||ut.call(globalThis,{LitElement:k});const gt=globalThis.litElementPolyfillSupport;gt==null||gt({LitElement:k});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/**
|
|
20
|
+
* @license
|
|
21
|
+
* Copyright 2017 Google LLC
|
|
22
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
+
*/const jt={attribute:!0,type:String,converter:F,reflect:!1,hasChanged:Q},zt=(s=jt,t,e)=>{const{kind:i,metadata:n}=e;let o=globalThis.litPropertyMetadata.get(n);if(o===void 0&&globalThis.litPropertyMetadata.set(n,o=new Map),o.set(e.name,s),i==="accessor"){const{name:r}=e;return{set(l){const a=t.get.call(this);t.set.call(this,l),this.requestUpdate(r,a,s)},init(l){return l!==void 0&&this.P(r,void 0,s),l}}}if(i==="setter"){const{name:r}=e;return function(l){const a=this[r];t.call(this,l),this.requestUpdate(r,a,s)}}throw Error("Unsupported decorator location: "+i)};function c(s){return(t,e)=>typeof e=="object"?zt(s,t,e):((i,n,o)=>{const r=n.hasOwnProperty(o);return n.constructor.createProperty(o,r?{...i,wrapped:!0}:i),r?Object.getOwnPropertyDescriptor(n,o):void 0})(s,t,e)}/**
|
|
24
|
+
* @license
|
|
25
|
+
* Copyright 2017 Google LLC
|
|
26
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
+
*/function Wt(s){return c({...s,state:!0,attribute:!1})}var g=[];for(var J=0;J<256;++J)g.push((J+256).toString(16).slice(1));function Jt(s,t=0){return(g[s[t+0]]+g[s[t+1]]+g[s[t+2]]+g[s[t+3]]+"-"+g[s[t+4]]+g[s[t+5]]+"-"+g[s[t+6]]+g[s[t+7]]+"-"+g[s[t+8]]+g[s[t+9]]+"-"+g[s[t+10]]+g[s[t+11]]+g[s[t+12]]+g[s[t+13]]+g[s[t+14]]+g[s[t+15]]).toLowerCase()}var V,Zt=new Uint8Array(16);function Gt(){if(!V&&(V=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!V))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return V(Zt)}var Kt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const mt={randomUUID:Kt};function Yt(s,t,e){if(mt.randomUUID&&!t&&!s)return mt.randomUUID();s=s||{};var i=s.random||(s.rng||Gt)();return i[6]=i[6]&15|64,i[8]=i[8]&63|128,Jt(i)}const Qt={hi:"Hei!"},Xt={buttonAltText:"Åpne kalender"},te={days:["Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Man","Tir","Ons","Tor","Fre","Lør","Søn"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],week:"Uke",prevMonth:"Forrige måned",nextMonth:"Neste måned"},ee={labels:{optional:"Valgfritt",required:"Må fylles ut"},messages:{required:"Dette feltet er påkrevd",invalid:"Ugyldig verdi",invalidPattern:"Ugyldig format",tooShort:"For kort",tooLong:"For lang",rangeUnderflow:"For lav verdi",rangeOverflow:"For høy verdi",dateUnderflow:"For tidlig dato",dateOverflow:"For sen dato"},date:{multiple:"Her kan du velge flere datoer. Trykk komma eller enter når du har skrevet inn en dato."}},y={example:Qt,calendar:Xt,dates:te,forms:ee};var se=Object.defineProperty,u=(s,t,e,i)=>{for(var n=void 0,o=s.length-1,r;o>=0;o--)(r=s[o])&&(n=r(t,e,n)||n);return n&&se(t,e,n),n};class tt extends k{constructor(){super(),this.strings=y}connectedCallback(){super.connectedCallback()}createRenderRoot(){return this}hotReplacedCallback(){this.requestUpdate()}}u([c({type:Object})],tt.prototype,"strings");class m extends tt{constructor(){super(),this.id=Yt(),this.name=this.id,this.required=!1,this.disabled=!1,this.placeholder="",this.min=null,this.max=null,this.minlength=0,this.maxlength=0,this.pattern="",this.optionalTag=!1,this.optionalText=y.forms.labels.optional,this.requiredTag=!1,this.requiredText=y.forms.labels.required,this.hasError=!1,this.errorMessage="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){this.required&&!this.value?this.internals.setValidity({valueMissing:!0},y.forms.messages.required,t):t.validity.typeMismatch||t.validity.badInput?this.internals.setValidity({typeMismatch:!0},y.forms.messages.invalid,t):t.validity.patternMismatch?this.internals.setValidity({patternMismatch:!0},y.forms.messages.invalidPattern,t):t.validity.tooShort||this.minLength>0&&this.value.length<this.minLength?this.internals.setValidity({tooShort:!0},y.forms.messages.tooShort,t):t.validity.tooLong||this.maxLength>0&&this.value.length>this.maxLength?this.internals.setValidity({tooLong:!0},y.forms.messages.tooLong,t):t.validity.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},y.forms.messages.rangeUnderflow,t):t.validity.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},y.forms.messages.rangeOverflow,t):t.validity.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({})}setFormValue(t){if(this.internals)if(Array.isArray(t)){const e=new FormData;t.forEach(i=>{e.append(this.name,i)}),this.internals.setFormValue(e)}else this.internals.setFormValue(t)}valueChanged(t,e){typeof t=="string"?((this.multiple||this.range)&&t.includes(",")&&(t=t.split(",")),this.value=t,this._value=Array.isArray(t)?t:[t]):Array.isArray(t)?(this.value=t,this._value=t):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&e&&e.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(e==null?void 0:e.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate())}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.internals.setFormValue(t),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus"))}onBlur(){this.dispatchEvent(new FocusEvent("blur"))}onInput(){this.dispatchEvent(new InputEvent("input"))}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}typeof t!="string"&&!Array.isArray(t)||((this.range||this.multiple)&&!Array.isArray(t)&&t.includes(",")&&(t=t.split(",")),!this.multiple&&!this.range&&Array.isArray(t)&&(t=t[0]),this.setFormValue(t),this.manageValidity(this.inputRef.value),this.inputRef2&&this.manageValidity(this.inputRef2.value),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0})),this.internals.reportValidity())}firstUpdated(t){super.firstUpdated(t),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.disabled=!0,this.internals.ariaDisabled=!0),this.internals.setFormValue(this.value),this.manageValidity(this.inputRef.value)}}u([c({type:String,reflect:!0})],m.prototype,"id");u([c({type:String,reflect:!0})],m.prototype,"name");u([c({type:Boolean,reflect:!0})],m.prototype,"required");u([c({type:Boolean,reflect:!0})],m.prototype,"disabled");u([c({type:String,reflect:!0})],m.prototype,"placeholder");u([c({type:Number,reflect:!0})],m.prototype,"min");u([c({type:Number,reflect:!0})],m.prototype,"max");u([c({type:Number,reflect:!0})],m.prototype,"minlength");u([c({type:Number,reflect:!0})],m.prototype,"maxlength");u([c({type:String,reflect:!0})],m.prototype,"pattern");u([c({type:Boolean,reflect:!0})],m.prototype,"optionalTag");u([c({type:String,reflect:!0})],m.prototype,"optionalText");u([c({type:Boolean,reflect:!0})],m.prototype,"requiredTag");u([c({type:String,reflect:!0})],m.prototype,"requiredText");u([c({type:Boolean,reflect:!0})],m.prototype,"hasError");u([c({type:String,reflect:!0})],m.prototype,"errorMessage");u([Wt()],m.prototype,"touched");/**
|
|
28
|
+
* @license
|
|
29
|
+
* Copyright 2017 Google LLC
|
|
30
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
31
|
+
*/const ie=s=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(s,t)}):customElements.define(s,t)};/**
|
|
32
|
+
* @license
|
|
33
|
+
* Copyright 2017 Google LLC
|
|
34
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
35
|
+
*/const ne={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},re=s=>(...t)=>({_$litDirective$:s,values:t});class oe{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/**
|
|
36
|
+
* @license
|
|
37
|
+
* Copyright 2017 Google LLC
|
|
38
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
39
|
+
*/class G extends oe{constructor(t){if(super(t),this.it=d,t.type!==ne.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===d||t==null)return this._t=void 0,this.it=t;if(t===w)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}G.directiveName="unsafeHTML",G.resultType=1;/**
|
|
40
|
+
* @license
|
|
41
|
+
* Copyright 2017 Google LLC
|
|
42
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
43
|
+
*/class K extends G{}K.directiveName="unsafeSVG",K.resultType=2;const vt=re(K);var ae=Object.defineProperty,le=Object.getOwnPropertyDescriptor,H=(s,t,e,i)=>{for(var n=i>1?void 0:i?le(t,e):t,o=s.length-1,r;o>=0;o--)(r=s[o])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&ae(t,e,n),n};window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch;window.pktIconPath=window.pktIconPath||"https://punkt-cdn.oslo.kommune.no/12.5/icons/";const he=s=>new Promise(t=>setTimeout(t,s)),D='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',Z={},ce=async(s,t)=>{let e=0;for(;Z[t+s+".svg"]==="fetching"&&(e++,!(e>50));)await he(50);return localStorage.getItem(t+s+".svg")?Promise.resolve(localStorage.getItem(t+s+".svg")):typeof window.pktFetch=="function"?(Z[t+s+".svg"]="fetching",Promise.resolve(window.pktFetch(t+s+".svg").then(i=>i.ok?i.text():(console.error("Missing icon: "+t+s+".svg"),D)).then(i=>(i!==D&&localStorage.setItem(t+s+".svg",i),Z[t+s+".svg"]="fetched",i)))):Promise.resolve(D)};let U=class extends tt{constructor(){super(...arguments),this.path=window.pktIconPath,this.name="",this.icon=vt(D),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(s,t,e){super.attributeChangedCallback(s,t,e),(s==="name"||s==="path")&&this.getIcon(this.name)}async updated(s){super.updated(s),(s.has("name")||s.has("path"))&&this.getIcon(this.name)}async getIcon(s=""){this._updatedProps.length>0?(this.path||(this.path,window.pktIconPath),this.icon=vt(await ce(this.name||"",this.path).then(t=>t)),this._updatedProps=[]):this._updatedProps.includes(s)||this._updatedProps.push(s)}render(){return Ht`${this.name&&this.icon}`}};H([c({type:String,reflect:!1})],U.prototype,"path",2);H([c({type:String,reflect:!0})],U.prototype,"name",2);H([c({type:SVGElement})],U.prototype,"icon",2);H([c({type:Array,noAccessor:!0})],U.prototype,"_updatedProps",2);U=H([ie("pkt-icon")],U);const de={name:"PktIcon",props:{name:{type:String,required:!0,default:void 0},path:{type:String,default:void 0}}},pe=["name"];function ue(s,t,e,i,n,o){return z.openBlock(),z.createElementBlock("pkt-icon",z.mergeProps({name:e.name},e.path&&{path:e.path}),null,16,pe)}const ge=bt._export_sfc(de,[["render",ue]]);exports.PktIcon=ge;
|