@fkui/vue 5.36.0

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.
@@ -0,0 +1,896 @@
1
+ import"core-js/modules/es.array.push.js";import"core-js/modules/es.array-buffer.detached.js";import"core-js/modules/es.array-buffer.transfer.js";import"core-js/modules/es.array-buffer.transfer-to-fixed-length.js";var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:true,configurable:true,writable:true,value}):obj[key]=value;var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!=="symbol"?key+"":key,value);import{defineComponent,openBlock,createElementBlock,normalizeClass,renderSlot,mergeProps,createTextVNode,createElementVNode,isVNode,Comment,createApp,resolveComponent,withKeys,createCommentVNode,toDisplayString,createVNode,createBlock,withCtx,Fragment,renderList,withModifiers,resolveDynamicComponent,Teleport,normalizeProps,guardReactiveProps,ref,inject,toValue,Transition,createSlots,withDirectives,vModelSelect,normalizeStyle,vModelDynamic,toHandlers,shallowRef,vShow,onMounted,onUnmounted,watchEffect,toRefs,computed,getCurrentInstance}from"vue";import{TranslationService,isSet,configLogic,focus as focus$1,ElementIdService,pushFocus,findTabbableElements,popFocus,scrollTo,Reference,documentOrderComparator,ValidationService,isValidatableHTMLElement,alertScreenReader,debounce,handleTab,deepClone,formatNumber,parseNumber,parseBankAccountNumber,parseBankgiro,parseClearingNumber,formatPersonnummer,parsePersonnummer,parsePlusgiro,formatPostalCode,parsePercent,formatPercent,parseOrganisationsnummer,isInvalidDatesConfig,isInvalidWeekdaysConfig,parseDate,waitForScreenReader,saveFocus,addFocusListener,removeFocusListener,restoreFocus,DomUtils,focusFirst}from"@fkui/logic";import{getWeekdayNamings,groupByWeek,FDate,DateFormat}from"@fkui/date";import{isEqual as isEqual$2}from"lodash";const statuses=["default","warning","error","success","info"];const _sfc_main$1d=defineComponent({name:"FBadge",props:{/**
2
+ * The status of the badge, can be either 'default', 'warning', 'error', 'success' or 'info'.
3
+ *
4
+ */status:{type:String,default:"default",validator:function(value){return statuses.includes(value);}},/**
5
+ * If badge should be inverted.
6
+ *
7
+ */inverted:{type:Boolean,default:false}},computed:{badgeClass(){return this.inverted?`badge--${this.status}-inverted`:`badge--${this.status}`;}}});const _export_sfc=(sfc,props)=>{const target=sfc.__vccOpts||sfc;for(const[key,val]of props){target[key]=val;}return target;};function _sfc_render$13(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createElementBlock("div",{class:normalizeClass(["badge",_ctx.badgeClass])},[renderSlot(_ctx.$slots,"default")],2/* CLASS */);}const FBadge=/* @__PURE__ */_export_sfc(_sfc_main$1d,[["render",_sfc_render$13]]);const Flip=["horizontal","vertical"];const Rotate=["90","180","270"];const _sfc_main$1c=defineComponent({name:"FIcon",inheritAttrs:false,props:{/**
8
+ * Icon name.
9
+ */name:{type:String,required:true},/**
10
+ * fk-icon library
11
+ */library:{type:String,required:false,default:"f"},/**
12
+ * Flip icon horizontally or vertically.
13
+ *
14
+ * Must be set to one of:
15
+ *
16
+ * - `horizontal`
17
+ * - `vertical`
18
+ */flip:{type:String,default:null,required:false,validator(value){return Flip.includes(value);}},/**
19
+ * Rotate icon.
20
+ *
21
+ * Must be set to one of:
22
+ *
23
+ * - `90`
24
+ * - `180`
25
+ * - `270`
26
+ */rotate:{type:String,default:null,required:false,validator(value){return Rotate.includes(value);}}},computed:{spriteKey(){return`${this.library}-icon-${this.name}`;},spriteId(){return`#${this.spriteKey}`;},modifiers(){const classes=[];if(this.flip){classes.push(`icon--flip-${this.flip}`);}if(this.rotate){classes.push(`icon--rotate-${this.rotate}`);}return classes;},ariaHidden(){const slotUsed=Boolean(this.$slots.default);const ariaLabel=this.$attrs["aria-label"]!==void 0;const ariaLabelledby=this.$attrs["aria-labelledby"]!==void 0;const ariaDescription=this.$attrs["aria-description"]!==void 0;const ariaDescribedby=this.$attrs["aria-describedby"]!==void 0;const hasText=slotUsed||ariaLabel||ariaLabelledby||ariaDescription||ariaDescribedby;return hasText?void 0:"true";}}});const _hoisted_1$U=["aria-hidden"];const _hoisted_2$G=["xlink:href"];function _sfc_render$12(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createElementBlock("svg",mergeProps(_ctx.$attrs,{focusable:"false",class:["icon",[_ctx.spriteKey,..._ctx.modifiers]],"aria-hidden":_ctx.ariaHidden}),[renderSlot(_ctx.$slots,"default"),createTextVNode(),createElementVNode("use",{"xlink:href":_ctx.spriteId},null,8,_hoisted_2$G)],16,_hoisted_1$U);}const FIcon=/* @__PURE__ */_export_sfc(_sfc_main$1c,[["render",_sfc_render$12]]);const DATA_TEST_ATTRIBUTE_NAME="data-test";function throwErrorIfEmpty(value){if(!value){throw new Error(`Did you forgot to add a value to v-test?`);}}const TestDirective={mounted(el,{value}){throwErrorIfEmpty(value);el.setAttribute(DATA_TEST_ATTRIBUTE_NAME,value);},updated(el,{value}){throwErrorIfEmpty(value);el.setAttribute(DATA_TEST_ATTRIBUTE_NAME,value);}};const TestPlugin={install(app){app.directive("test",TestDirective);}};function translate(key,defaultValueOrArgs,args){const{provider}=TranslationService;return provider.translate(key,defaultValueOrArgs,args);}const TranslationMixin={methods:{$t:translate}};const TranslationPlugin={install(app){app.mixin(TranslationMixin);}};function useTranslate(){return translate;}var commonjsGlobal=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x["default"]:x;}function listCacheClear$1(){this.__data__=[];this.size=0;}var _listCacheClear=listCacheClear$1;function eq$2(value,other){return value===other||value!==value&&other!==other;}var eq_1=eq$2;var eq$1=eq_1;function assocIndexOf$4(array,key){var length=array.length;while(length--){if(eq$1(array[length][0],key)){return length;}}return-1;}var _assocIndexOf=assocIndexOf$4;var assocIndexOf$3=_assocIndexOf;var arrayProto=Array.prototype;var splice=arrayProto.splice;function listCacheDelete$1(key){var data=this.__data__,index=assocIndexOf$3(data,key);if(index<0){return false;}var lastIndex=data.length-1;if(index==lastIndex){data.pop();}else{splice.call(data,index,1);}--this.size;return true;}var _listCacheDelete=listCacheDelete$1;var assocIndexOf$2=_assocIndexOf;function listCacheGet$1(key){var data=this.__data__,index=assocIndexOf$2(data,key);return index<0?void 0:data[index][1];}var _listCacheGet=listCacheGet$1;var assocIndexOf$1=_assocIndexOf;function listCacheHas$1(key){return assocIndexOf$1(this.__data__,key)>-1;}var _listCacheHas=listCacheHas$1;var assocIndexOf=_assocIndexOf;function listCacheSet$1(key,value){var data=this.__data__,index=assocIndexOf(data,key);if(index<0){++this.size;data.push([key,value]);}else{data[index][1]=value;}return this;}var _listCacheSet=listCacheSet$1;var listCacheClear=_listCacheClear,listCacheDelete=_listCacheDelete,listCacheGet=_listCacheGet,listCacheHas=_listCacheHas,listCacheSet=_listCacheSet;function ListCache$4(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1]);}}ListCache$4.prototype.clear=listCacheClear;ListCache$4.prototype["delete"]=listCacheDelete;ListCache$4.prototype.get=listCacheGet;ListCache$4.prototype.has=listCacheHas;ListCache$4.prototype.set=listCacheSet;var _ListCache=ListCache$4;var ListCache$3=_ListCache;function stackClear$1(){this.__data__=new ListCache$3();this.size=0;}var _stackClear=stackClear$1;function stackDelete$1(key){var data=this.__data__,result=data["delete"](key);this.size=data.size;return result;}var _stackDelete=stackDelete$1;function stackGet$1(key){return this.__data__.get(key);}var _stackGet=stackGet$1;function stackHas$1(key){return this.__data__.has(key);}var _stackHas=stackHas$1;var freeGlobal$1=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal;var _freeGlobal=freeGlobal$1;var freeGlobal=_freeGlobal;var freeSelf=typeof self=="object"&&self&&self.Object===Object&&self;var root$8=freeGlobal||freeSelf||Function("return this")();var _root=root$8;var root$7=_root;var Symbol$4=root$7.Symbol;var _Symbol=Symbol$4;var Symbol$3=_Symbol;var objectProto$b=Object.prototype;var hasOwnProperty$8=objectProto$b.hasOwnProperty;var nativeObjectToString$1=objectProto$b.toString;var symToStringTag$1=Symbol$3?Symbol$3.toStringTag:void 0;function getRawTag$1(value){var isOwn=hasOwnProperty$8.call(value,symToStringTag$1),tag=value[symToStringTag$1];try{value[symToStringTag$1]=void 0;var unmasked=true;}catch(e){}var result=nativeObjectToString$1.call(value);if(unmasked){if(isOwn){value[symToStringTag$1]=tag;}else{delete value[symToStringTag$1];}}return result;}var _getRawTag=getRawTag$1;var objectProto$a=Object.prototype;var nativeObjectToString=objectProto$a.toString;function objectToString$1(value){return nativeObjectToString.call(value);}var _objectToString=objectToString$1;var Symbol$2=_Symbol,getRawTag=_getRawTag,objectToString=_objectToString;var nullTag="[object Null]",undefinedTag="[object Undefined]";var symToStringTag=Symbol$2?Symbol$2.toStringTag:void 0;function baseGetTag$4(value){if(value==null){return value===void 0?undefinedTag:nullTag;}return symToStringTag&&symToStringTag in Object(value)?getRawTag(value):objectToString(value);}var _baseGetTag=baseGetTag$4;function isObject$2(value){var type=typeof value;return value!=null&&(type=="object"||type=="function");}var isObject_1=isObject$2;var baseGetTag$3=_baseGetTag,isObject$1=isObject_1;var asyncTag="[object AsyncFunction]",funcTag$1="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction$2(value){if(!isObject$1(value)){return false;}var tag=baseGetTag$3(value);return tag==funcTag$1||tag==genTag||tag==asyncTag||tag==proxyTag;}var isFunction_1=isFunction$2;var root$6=_root;var coreJsData$1=root$6["__core-js_shared__"];var _coreJsData=coreJsData$1;var coreJsData=_coreJsData;var maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:"";}();function isMasked$1(func){return!!maskSrcKey&&maskSrcKey in func;}var _isMasked=isMasked$1;var funcProto$1=Function.prototype;var funcToString$1=funcProto$1.toString;function toSource$2(func){if(func!=null){try{return funcToString$1.call(func);}catch(e){}try{return func+"";}catch(e){}}return"";}var _toSource=toSource$2;var isFunction$1=isFunction_1,isMasked=_isMasked,isObject=isObject_1,toSource$1=_toSource;var reRegExpChar=/[\\^$.*+?()[\]{}|]/g;var reIsHostCtor=/^\[object .+?Constructor\]$/;var funcProto=Function.prototype,objectProto$9=Object.prototype;var funcToString=funcProto.toString;var hasOwnProperty$7=objectProto$9.hasOwnProperty;var reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$7).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative$1(value){if(!isObject(value)||isMasked(value)){return false;}var pattern=isFunction$1(value)?reIsNative:reIsHostCtor;return pattern.test(toSource$1(value));}var _baseIsNative=baseIsNative$1;function getValue$1(object,key){return object==null?void 0:object[key];}var _getValue=getValue$1;var baseIsNative=_baseIsNative,getValue=_getValue;function getNative$6(object,key){var value=getValue(object,key);return baseIsNative(value)?value:void 0;}var _getNative=getNative$6;var getNative$5=_getNative,root$5=_root;var Map$4=getNative$5(root$5,"Map");var _Map=Map$4;var getNative$4=_getNative;var nativeCreate$4=getNative$4(Object,"create");var _nativeCreate=nativeCreate$4;var nativeCreate$3=_nativeCreate;function hashClear$1(){this.__data__=nativeCreate$3?nativeCreate$3(null):{};this.size=0;}var _hashClear=hashClear$1;function hashDelete$1(key){var result=this.has(key)&&delete this.__data__[key];this.size-=result?1:0;return result;}var _hashDelete=hashDelete$1;var nativeCreate$2=_nativeCreate;var HASH_UNDEFINED$2="__lodash_hash_undefined__";var objectProto$8=Object.prototype;var hasOwnProperty$6=objectProto$8.hasOwnProperty;function hashGet$1(key){var data=this.__data__;if(nativeCreate$2){var result=data[key];return result===HASH_UNDEFINED$2?void 0:result;}return hasOwnProperty$6.call(data,key)?data[key]:void 0;}var _hashGet=hashGet$1;var nativeCreate$1=_nativeCreate;var objectProto$7=Object.prototype;var hasOwnProperty$5=objectProto$7.hasOwnProperty;function hashHas$1(key){var data=this.__data__;return nativeCreate$1?data[key]!==void 0:hasOwnProperty$5.call(data,key);}var _hashHas=hashHas$1;var nativeCreate=_nativeCreate;var HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet$1(key,value){var data=this.__data__;this.size+=this.has(key)?0:1;data[key]=nativeCreate&&value===void 0?HASH_UNDEFINED$1:value;return this;}var _hashSet=hashSet$1;var hashClear=_hashClear,hashDelete=_hashDelete,hashGet=_hashGet,hashHas=_hashHas,hashSet=_hashSet;function Hash$1(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1]);}}Hash$1.prototype.clear=hashClear;Hash$1.prototype["delete"]=hashDelete;Hash$1.prototype.get=hashGet;Hash$1.prototype.has=hashHas;Hash$1.prototype.set=hashSet;var _Hash=Hash$1;var Hash=_Hash,ListCache$2=_ListCache,Map$3=_Map;function mapCacheClear$1(){this.size=0;this.__data__={"hash":new Hash(),"map":new(Map$3||ListCache$2)(),"string":new Hash()};}var _mapCacheClear=mapCacheClear$1;function isKeyable$1(value){var type=typeof value;return type=="string"||type=="number"||type=="symbol"||type=="boolean"?value!=="__proto__":value===null;}var _isKeyable=isKeyable$1;var isKeyable=_isKeyable;function getMapData$4(map,key){var data=map.__data__;return isKeyable(key)?data[typeof key=="string"?"string":"hash"]:data.map;}var _getMapData=getMapData$4;var getMapData$3=_getMapData;function mapCacheDelete$1(key){var result=getMapData$3(this,key)["delete"](key);this.size-=result?1:0;return result;}var _mapCacheDelete=mapCacheDelete$1;var getMapData$2=_getMapData;function mapCacheGet$1(key){return getMapData$2(this,key).get(key);}var _mapCacheGet=mapCacheGet$1;var getMapData$1=_getMapData;function mapCacheHas$1(key){return getMapData$1(this,key).has(key);}var _mapCacheHas=mapCacheHas$1;var getMapData=_getMapData;function mapCacheSet$1(key,value){var data=getMapData(this,key),size=data.size;data.set(key,value);this.size+=data.size==size?0:1;return this;}var _mapCacheSet=mapCacheSet$1;var mapCacheClear=_mapCacheClear,mapCacheDelete=_mapCacheDelete,mapCacheGet=_mapCacheGet,mapCacheHas=_mapCacheHas,mapCacheSet=_mapCacheSet;function MapCache$2(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1]);}}MapCache$2.prototype.clear=mapCacheClear;MapCache$2.prototype["delete"]=mapCacheDelete;MapCache$2.prototype.get=mapCacheGet;MapCache$2.prototype.has=mapCacheHas;MapCache$2.prototype.set=mapCacheSet;var _MapCache=MapCache$2;var ListCache$1=_ListCache,Map$2=_Map,MapCache$1=_MapCache;var LARGE_ARRAY_SIZE=200;function stackSet$1(key,value){var data=this.__data__;if(data instanceof ListCache$1){var pairs=data.__data__;if(!Map$2||pairs.length<LARGE_ARRAY_SIZE-1){pairs.push([key,value]);this.size=++data.size;return this;}data=this.__data__=new MapCache$1(pairs);}data.set(key,value);this.size=data.size;return this;}var _stackSet=stackSet$1;var ListCache=_ListCache,stackClear=_stackClear,stackDelete=_stackDelete,stackGet=_stackGet,stackHas=_stackHas,stackSet=_stackSet;function Stack$1(entries){var data=this.__data__=new ListCache(entries);this.size=data.size;}Stack$1.prototype.clear=stackClear;Stack$1.prototype["delete"]=stackDelete;Stack$1.prototype.get=stackGet;Stack$1.prototype.has=stackHas;Stack$1.prototype.set=stackSet;var _Stack=Stack$1;var HASH_UNDEFINED="__lodash_hash_undefined__";function setCacheAdd$1(value){this.__data__.set(value,HASH_UNDEFINED);return this;}var _setCacheAdd=setCacheAdd$1;function setCacheHas$1(value){return this.__data__.has(value);}var _setCacheHas=setCacheHas$1;var MapCache=_MapCache,setCacheAdd=_setCacheAdd,setCacheHas=_setCacheHas;function SetCache$1(values){var index=-1,length=values==null?0:values.length;this.__data__=new MapCache();while(++index<length){this.add(values[index]);}}SetCache$1.prototype.add=SetCache$1.prototype.push=setCacheAdd;SetCache$1.prototype.has=setCacheHas;var _SetCache=SetCache$1;function arraySome$1(array,predicate){var index=-1,length=array==null?0:array.length;while(++index<length){if(predicate(array[index],index,array)){return true;}}return false;}var _arraySome=arraySome$1;function cacheHas$1(cache,key){return cache.has(key);}var _cacheHas=cacheHas$1;var SetCache=_SetCache,arraySome=_arraySome,cacheHas=_cacheHas;var COMPARE_PARTIAL_FLAG$3=1,COMPARE_UNORDERED_FLAG$1=2;function equalArrays$2(array,other,bitmask,customizer,equalFunc,stack){var isPartial=bitmask&COMPARE_PARTIAL_FLAG$3,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength)){return false;}var arrStacked=stack.get(array);var othStacked=stack.get(other);if(arrStacked&&othStacked){return arrStacked==other&&othStacked==array;}var index=-1,result=true,seen=bitmask&COMPARE_UNORDERED_FLAG$1?new SetCache():void 0;stack.set(array,other);stack.set(other,array);while(++index<arrLength){var arrValue=array[index],othValue=other[index];if(customizer){var compared=isPartial?customizer(othValue,arrValue,index,other,array,stack):customizer(arrValue,othValue,index,array,other,stack);}if(compared!==void 0){if(compared){continue;}result=false;break;}if(seen){if(!arraySome(other,function(othValue2,othIndex){if(!cacheHas(seen,othIndex)&&(arrValue===othValue2||equalFunc(arrValue,othValue2,bitmask,customizer,stack))){return seen.push(othIndex);}})){result=false;break;}}else if(!(arrValue===othValue||equalFunc(arrValue,othValue,bitmask,customizer,stack))){result=false;break;}}stack["delete"](array);stack["delete"](other);return result;}var _equalArrays=equalArrays$2;var root$4=_root;var Uint8Array$1=root$4.Uint8Array;var _Uint8Array=Uint8Array$1;function mapToArray$1(map){var index=-1,result=Array(map.size);map.forEach(function(value,key){result[++index]=[key,value];});return result;}var _mapToArray=mapToArray$1;function setToArray$1(set){var index=-1,result=Array(set.size);set.forEach(function(value){result[++index]=value;});return result;}var _setToArray=setToArray$1;var Symbol$1=_Symbol,Uint8Array2=_Uint8Array,eq=eq_1,equalArrays$1=_equalArrays,mapToArray=_mapToArray,setToArray=_setToArray;var COMPARE_PARTIAL_FLAG$2=1,COMPARE_UNORDERED_FLAG=2;var boolTag$1="[object Boolean]",dateTag$1="[object Date]",errorTag$1="[object Error]",mapTag$2="[object Map]",numberTag$1="[object Number]",regexpTag$1="[object RegExp]",setTag$2="[object Set]",stringTag$1="[object String]",symbolTag="[object Symbol]";var arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$2="[object DataView]";var symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function equalByTag$1(object,other,tag,bitmask,customizer,equalFunc,stack){switch(tag){case dataViewTag$2:if(object.byteLength!=other.byteLength||object.byteOffset!=other.byteOffset){return false;}object=object.buffer;other=other.buffer;case arrayBufferTag$1:if(object.byteLength!=other.byteLength||!equalFunc(new Uint8Array2(object),new Uint8Array2(other))){return false;}return true;case boolTag$1:case dateTag$1:case numberTag$1:return eq(+object,+other);case errorTag$1:return object.name==other.name&&object.message==other.message;case regexpTag$1:case stringTag$1:return object==other+"";case mapTag$2:var convert=mapToArray;case setTag$2:var isPartial=bitmask&COMPARE_PARTIAL_FLAG$2;convert||(convert=setToArray);if(object.size!=other.size&&!isPartial){return false;}var stacked=stack.get(object);if(stacked){return stacked==other;}bitmask|=COMPARE_UNORDERED_FLAG;stack.set(object,other);var result=equalArrays$1(convert(object),convert(other),bitmask,customizer,equalFunc,stack);stack["delete"](object);return result;case symbolTag:if(symbolValueOf){return symbolValueOf.call(object)==symbolValueOf.call(other);}}return false;}var _equalByTag=equalByTag$1;function arrayPush$1(array,values){var index=-1,length=values.length,offset2=array.length;while(++index<length){array[offset2+index]=values[index];}return array;}var _arrayPush=arrayPush$1;var isArray$3=Array.isArray;var isArray_1=isArray$3;var arrayPush=_arrayPush,isArray$2=isArray_1;function baseGetAllKeys$1(object,keysFunc,symbolsFunc){var result=keysFunc(object);return isArray$2(object)?result:arrayPush(result,symbolsFunc(object));}var _baseGetAllKeys=baseGetAllKeys$1;function arrayFilter$1(array,predicate){var index=-1,length=array==null?0:array.length,resIndex=0,result=[];while(++index<length){var value=array[index];if(predicate(value,index,array)){result[resIndex++]=value;}}return result;}var _arrayFilter=arrayFilter$1;function stubArray$1(){return[];}var stubArray_1=stubArray$1;var arrayFilter=_arrayFilter,stubArray=stubArray_1;var objectProto$6=Object.prototype;var propertyIsEnumerable$1=objectProto$6.propertyIsEnumerable;var nativeGetSymbols=Object.getOwnPropertySymbols;var getSymbols$1=!nativeGetSymbols?stubArray:function(object){if(object==null){return[];}object=Object(object);return arrayFilter(nativeGetSymbols(object),function(symbol){return propertyIsEnumerable$1.call(object,symbol);});};var _getSymbols=getSymbols$1;function baseTimes$1(n,iteratee){var index=-1,result=Array(n);while(++index<n){result[index]=iteratee(index);}return result;}var _baseTimes=baseTimes$1;function isObjectLike$4(value){return value!=null&&typeof value=="object";}var isObjectLike_1=isObjectLike$4;var baseGetTag$2=_baseGetTag,isObjectLike$3=isObjectLike_1;var argsTag$2="[object Arguments]";function baseIsArguments$1(value){return isObjectLike$3(value)&&baseGetTag$2(value)==argsTag$2;}var _baseIsArguments=baseIsArguments$1;var baseIsArguments=_baseIsArguments,isObjectLike$2=isObjectLike_1;var objectProto$5=Object.prototype;var hasOwnProperty$4=objectProto$5.hasOwnProperty;var propertyIsEnumerable=objectProto$5.propertyIsEnumerable;var isArguments$1=baseIsArguments(/* @__PURE__ */function(){return arguments;}())?baseIsArguments:function(value){return isObjectLike$2(value)&&hasOwnProperty$4.call(value,"callee")&&!propertyIsEnumerable.call(value,"callee");};var isArguments_1=isArguments$1;var isBuffer$2={exports:{}};function stubFalse(){return false;}var stubFalse_1=stubFalse;isBuffer$2.exports;(function(module,exports){var root2=_root,stubFalse2=stubFalse_1;var freeExports=exports&&!exports.nodeType&&exports;var freeModule=freeExports&&true&&module&&!module.nodeType&&module;var moduleExports=freeModule&&freeModule.exports===freeExports;var Buffer2=moduleExports?root2.Buffer:void 0;var nativeIsBuffer=Buffer2?Buffer2.isBuffer:void 0;var isBuffer2=nativeIsBuffer||stubFalse2;module.exports=isBuffer2;})(isBuffer$2,isBuffer$2.exports);var isBufferExports=isBuffer$2.exports;var MAX_SAFE_INTEGER$1=9007199254740991;var reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex$1(value,length){var type=typeof value;length=length==null?MAX_SAFE_INTEGER$1:length;return!!length&&(type=="number"||type!="symbol"&&reIsUint.test(value))&&value>-1&&value%1==0&&value<length;}var _isIndex=isIndex$1;var MAX_SAFE_INTEGER=9007199254740991;function isLength$2(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER;}var isLength_1=isLength$2;var baseGetTag$1=_baseGetTag,isLength$1=isLength_1,isObjectLike$1=isObjectLike_1;var argsTag$1="[object Arguments]",arrayTag$1="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",mapTag$1="[object Map]",numberTag="[object Number]",objectTag$2="[object Object]",regexpTag="[object RegExp]",setTag$1="[object Set]",stringTag="[object String]",weakMapTag$1="[object WeakMap]";var arrayBufferTag="[object ArrayBuffer]",dataViewTag$1="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]";var typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=true;typedArrayTags[argsTag$1]=typedArrayTags[arrayTag$1]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag$1]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag$1]=typedArrayTags[numberTag]=typedArrayTags[objectTag$2]=typedArrayTags[regexpTag]=typedArrayTags[setTag$1]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag$1]=false;function baseIsTypedArray$1(value){return isObjectLike$1(value)&&isLength$1(value.length)&&!!typedArrayTags[baseGetTag$1(value)];}var _baseIsTypedArray=baseIsTypedArray$1;function baseUnary$1(func){return function(value){return func(value);};}var _baseUnary=baseUnary$1;var _nodeUtil={exports:{}};_nodeUtil.exports;(function(module,exports){var freeGlobal2=_freeGlobal;var freeExports=exports&&!exports.nodeType&&exports;var freeModule=freeExports&&true&&module&&!module.nodeType&&module;var moduleExports=freeModule&&freeModule.exports===freeExports;var freeProcess=moduleExports&&freeGlobal2.process;var nodeUtil2=function(){try{var types=freeModule&&freeModule.require&&freeModule.require("util").types;if(types){return types;}return freeProcess&&freeProcess.binding&&freeProcess.binding("util");}catch(e){}}();module.exports=nodeUtil2;})(_nodeUtil,_nodeUtil.exports);var _nodeUtilExports=_nodeUtil.exports;var baseIsTypedArray=_baseIsTypedArray,baseUnary=_baseUnary,nodeUtil=_nodeUtilExports;var nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray;var isTypedArray$2=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;var isTypedArray_1=isTypedArray$2;var baseTimes=_baseTimes,isArguments=isArguments_1,isArray$1=isArray_1,isBuffer$1=isBufferExports,isIndex=_isIndex,isTypedArray$1=isTypedArray_1;var objectProto$4=Object.prototype;var hasOwnProperty$3=objectProto$4.hasOwnProperty;function arrayLikeKeys$1(value,inherited){var isArr=isArray$1(value),isArg=!isArr&&isArguments(value),isBuff=!isArr&&!isArg&&isBuffer$1(value),isType=!isArr&&!isArg&&!isBuff&&isTypedArray$1(value),skipIndexes=isArr||isArg||isBuff||isType,result=skipIndexes?baseTimes(value.length,String):[],length=result.length;for(var key in value){if((inherited||hasOwnProperty$3.call(value,key))&&!(skipIndexes&&(// Safari 9 has enumerable `arguments.length` in strict mode.
27
+ key=="length"||// Node.js 0.10 has enumerable non-index properties on buffers.
28
+ isBuff&&(key=="offset"||key=="parent")||// PhantomJS 2 has enumerable non-index properties on typed arrays.
29
+ isType&&(key=="buffer"||key=="byteLength"||key=="byteOffset")||// Skip index properties.
30
+ isIndex(key,length)))){result.push(key);}}return result;}var _arrayLikeKeys=arrayLikeKeys$1;var objectProto$3=Object.prototype;function isPrototype$1(value){var Ctor=value&&value.constructor,proto=typeof Ctor=="function"&&Ctor.prototype||objectProto$3;return value===proto;}var _isPrototype=isPrototype$1;function overArg$1(func,transform){return function(arg){return func(transform(arg));};}var _overArg=overArg$1;var overArg=_overArg;var nativeKeys$1=overArg(Object.keys,Object);var _nativeKeys=nativeKeys$1;var isPrototype=_isPrototype,nativeKeys=_nativeKeys;var objectProto$2=Object.prototype;var hasOwnProperty$2=objectProto$2.hasOwnProperty;function baseKeys$1(object){if(!isPrototype(object)){return nativeKeys(object);}var result=[];for(var key in Object(object)){if(hasOwnProperty$2.call(object,key)&&key!="constructor"){result.push(key);}}return result;}var _baseKeys=baseKeys$1;var isFunction=isFunction_1,isLength=isLength_1;function isArrayLike$1(value){return value!=null&&isLength(value.length)&&!isFunction(value);}var isArrayLike_1=isArrayLike$1;var arrayLikeKeys=_arrayLikeKeys,baseKeys=_baseKeys,isArrayLike=isArrayLike_1;function keys$1(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object);}var keys_1=keys$1;var baseGetAllKeys=_baseGetAllKeys,getSymbols=_getSymbols,keys=keys_1;function getAllKeys$1(object){return baseGetAllKeys(object,keys,getSymbols);}var _getAllKeys=getAllKeys$1;var getAllKeys=_getAllKeys;var COMPARE_PARTIAL_FLAG$1=1;var objectProto$1=Object.prototype;var hasOwnProperty$1=objectProto$1.hasOwnProperty;function equalObjects$1(object,other,bitmask,customizer,equalFunc,stack){var isPartial=bitmask&COMPARE_PARTIAL_FLAG$1,objProps=getAllKeys(object),objLength=objProps.length,othProps=getAllKeys(other),othLength=othProps.length;if(objLength!=othLength&&!isPartial){return false;}var index=objLength;while(index--){var key=objProps[index];if(!(isPartial?key in other:hasOwnProperty$1.call(other,key))){return false;}}var objStacked=stack.get(object);var othStacked=stack.get(other);if(objStacked&&othStacked){return objStacked==other&&othStacked==object;}var result=true;stack.set(object,other);stack.set(other,object);var skipCtor=isPartial;while(++index<objLength){key=objProps[index];var objValue=object[key],othValue=other[key];if(customizer){var compared=isPartial?customizer(othValue,objValue,key,other,object,stack):customizer(objValue,othValue,key,object,other,stack);}if(!(compared===void 0?objValue===othValue||equalFunc(objValue,othValue,bitmask,customizer,stack):compared)){result=false;break;}skipCtor||(skipCtor=key=="constructor");}if(result&&!skipCtor){var objCtor=object.constructor,othCtor=other.constructor;if(objCtor!=othCtor&&"constructor"in object&&"constructor"in other&&!(typeof objCtor=="function"&&objCtor instanceof objCtor&&typeof othCtor=="function"&&othCtor instanceof othCtor)){result=false;}}stack["delete"](object);stack["delete"](other);return result;}var _equalObjects=equalObjects$1;var getNative$3=_getNative,root$3=_root;var DataView$1=getNative$3(root$3,"DataView");var _DataView=DataView$1;var getNative$2=_getNative,root$2=_root;var Promise$2=getNative$2(root$2,"Promise");var _Promise=Promise$2;var getNative$1=_getNative,root$1=_root;var Set$1=getNative$1(root$1,"Set");var _Set=Set$1;var getNative=_getNative,root=_root;var WeakMap$1=getNative(root,"WeakMap");var _WeakMap=WeakMap$1;var DataView=_DataView,Map$1=_Map,Promise$1=_Promise,Set=_Set,WeakMap=_WeakMap,baseGetTag=_baseGetTag,toSource=_toSource;var mapTag="[object Map]",objectTag$1="[object Object]",promiseTag="[object Promise]",setTag="[object Set]",weakMapTag="[object WeakMap]";var dataViewTag="[object DataView]";var dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map$1),promiseCtorString=toSource(Promise$1),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap);var getTag$1=baseGetTag;if(DataView&&getTag$1(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map$1&&getTag$1(new Map$1())!=mapTag||Promise$1&&getTag$1(Promise$1.resolve())!=promiseTag||Set&&getTag$1(new Set())!=setTag||WeakMap&&getTag$1(new WeakMap())!=weakMapTag){getTag$1=function(value){var result=baseGetTag(value),Ctor=result==objectTag$1?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):"";if(ctorString){switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return promiseTag;case setCtorString:return setTag;case weakMapCtorString:return weakMapTag;}}return result;};}var _getTag=getTag$1;var Stack=_Stack,equalArrays=_equalArrays,equalByTag=_equalByTag,equalObjects=_equalObjects,getTag=_getTag,isArray=isArray_1,isBuffer=isBufferExports,isTypedArray=isTypedArray_1;var COMPARE_PARTIAL_FLAG=1;var argsTag="[object Arguments]",arrayTag="[object Array]",objectTag="[object Object]";var objectProto=Object.prototype;var hasOwnProperty=objectProto.hasOwnProperty;function baseIsEqualDeep$1(object,other,bitmask,customizer,equalFunc,stack){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=objIsArr?arrayTag:getTag(object),othTag=othIsArr?arrayTag:getTag(other);objTag=objTag==argsTag?objectTag:objTag;othTag=othTag==argsTag?objectTag:othTag;var objIsObj=objTag==objectTag,othIsObj=othTag==objectTag,isSameTag=objTag==othTag;if(isSameTag&&isBuffer(object)){if(!isBuffer(other)){return false;}objIsArr=true;objIsObj=false;}if(isSameTag&&!objIsObj){stack||(stack=new Stack());return objIsArr||isTypedArray(object)?equalArrays(object,other,bitmask,customizer,equalFunc,stack):equalByTag(object,other,objTag,bitmask,customizer,equalFunc,stack);}if(!(bitmask&COMPARE_PARTIAL_FLAG)){var objIsWrapped=objIsObj&&hasOwnProperty.call(object,"__wrapped__"),othIsWrapped=othIsObj&&hasOwnProperty.call(other,"__wrapped__");if(objIsWrapped||othIsWrapped){var objUnwrapped=objIsWrapped?object.value():object,othUnwrapped=othIsWrapped?other.value():other;stack||(stack=new Stack());return equalFunc(objUnwrapped,othUnwrapped,bitmask,customizer,stack);}}if(!isSameTag){return false;}stack||(stack=new Stack());return equalObjects(object,other,bitmask,customizer,equalFunc,stack);}var _baseIsEqualDeep=baseIsEqualDeep$1;var baseIsEqualDeep=_baseIsEqualDeep,isObjectLike=isObjectLike_1;function baseIsEqual$1(value,other,bitmask,customizer,stack){if(value===other){return true;}if(value==null||other==null||!isObjectLike(value)&&!isObjectLike(other)){return value!==value&&other!==other;}return baseIsEqualDeep(value,other,bitmask,customizer,baseIsEqual$1,stack);}var _baseIsEqual=baseIsEqual$1;var baseIsEqual=_baseIsEqual;function isEqual(value,other){return baseIsEqual(value,other);}var isEqual_1=isEqual;const isEqual$1=/* @__PURE__ */getDefaultExportFromCjs(isEqual_1);function itemEquals(item1,item2,compareAttribute){if(!isSet(item1)||!isSet(item2)){return false;}if(item1===item2){return true;}return item1[compareAttribute]===item2[compareAttribute];}function includeItem(item,itemList,compareAttribute){if(!isSet(item)||!isSet(itemList)){return false;}const itemCompareValue=item[compareAttribute];const match=itemList.find(it=>{return it[compareAttribute]===itemCompareValue;});return Boolean(match);}function handleKeyboardFocusNavigation(key,focusedElement,focusableElements){let tabPosition=focusableElements.indexOf(focusedElement);const keyDown2=["ArrowDown","Down"];const keyUp2=["ArrowUp","Up"];if(keyDown2.includes(key)){tabPosition++;if(tabPosition===focusableElements.length){tabPosition=0;}}if(keyUp2.includes(key)){tabPosition--;if(tabPosition===-1){tabPosition=focusableElements.length-1;}}if(focusableElements[tabPosition]){focusableElements[tabPosition].focus();}}var TableScroll=/* @__PURE__ */(TableScroll2=>{TableScroll2["HORIZONTAL"]="horizontal";TableScroll2["VERTICAL"]="vertical";TableScroll2["BOTH"]="both";TableScroll2["NONE"]="none";return TableScroll2;})(TableScroll||{});const scrollClasses={["horizontal"/* HORIZONTAL */]:["table__scroll","table__scroll--horizontal"],["vertical"/* VERTICAL */]:["table__scroll","table__scroll--vertical"],["both"/* BOTH */]:["table__scroll","table__scroll--horizontal","table__scroll--vertical"],["none"/* NONE */]:[]};function tableScrollClasses(val){return scrollClasses[val];}const defaultOptions={stripClasses:["sr-only"]};function collapseWhitespace(text){return text.replace(/\s+/gm," ").replace(/(^ | $)/g,"");}function intersection(a,b){return a.filter(it=>b.includes(it));}function excludeClass(exclude){return node=>{var _a;if(typeof((_a=node.props)==null?void 0:_a.class)!=="string"){return true;}const classes=node.props.class.split(/\s+/);const matches=intersection(classes,exclude);return matches.length===0;};}function excludeComment(node){return node.type!==Comment;}function getTextContent(children,options){return children.filter(isVNode).filter(excludeComment).filter(excludeClass(options.stripClasses)).map(child=>{if(Array.isArray(child.children)){return getTextContent(child.children,options);}if(typeof child.children==="string"){return child.children;}}).join("");}function renderSlotText(render,props={},options){if(!render){return void 0;}const nodes=render(props);if(nodes.length===0){return void 0;}return collapseWhitespace(getTextContent(nodes,{...defaultOptions,...options}));}function getTextFromScopedSlot(slot){var _renderSlotText;return(_renderSlotText=renderSlotText(slot))!==null&&_renderSlotText!==void 0?_renderSlotText:"";}function dispatchComponentValidityEvent(element,detail){element.dispatchEvent(new CustomEvent("component-validity",{detail,bubbles:true}));}function dispatchComponentUnmountEvent(element){const event=new CustomEvent("component-unmount",{detail:{elementId:element.id},bubbles:true});element.dispatchEvent(event);}function refIsElement(value){return value instanceof Element;}function refIsElementArray(value){return Array.isArray(value)&&value.length>0&&value[0]instanceof Element;}function refIsHTMLElementArray(value){return Array.isArray(value)&&value.length>0&&value[0]instanceof HTMLElement;}function refIsVue(value){return(value==null?void 0:value.$el)!==void 0;}function refIsVueArray(value){return Array.isArray(value)&&value.length>0&&refIsVue(value[0]);}function getElementsFromVueRef(ref2){let result=[];if(refIsVueArray(ref2)){result=ref2.map(vueRef=>vueRef.$el);}else if(refIsElementArray(ref2)){result=ref2;}else if(isSet(ref2)){result=[getElementFromVueRef(ref2)];}return result;}function getSortedHTMLElementsFromVueRef(ref2){const htmlElements=getHTMLElementsFromVueRef(ref2);htmlElements.sort((lhs,rhs)=>{const lhsIndex=parseIntOrDefault(lhs.dataset.refIndex,-Infinity);const rhsIndex=parseIntOrDefault(rhs.dataset.refIndex,-Infinity);return lhsIndex===rhsIndex?0:lhsIndex-rhsIndex;});return htmlElements;}function parseIntOrDefault(value,defaultValue){if(typeof value==="string"){const parsed=parseInt(value,10);if(!isNaN(parsed)){return parsed;}}return defaultValue;}function getHTMLElementsFromVueRef(ref2){let result=[];if(isEmptyArray(ref2)){result=[];}else if(refIsVueArray(ref2)){result=ref2.map(vueRef=>vueRef.$el);}else if(refIsHTMLElementArray(ref2)){result=[...ref2];}else if(isSet(ref2)){result=[getHTMLElementFromVueRef(ref2)];}return result;}function isEmptyArray(value){return Array.isArray(value)&&value.length===0;}function findElementFromVueRef(ref2){if(refIsElement(ref2)){return ref2;}else if(refIsVue(ref2)){return ref2.$el;}}function findHTMLElementFromVueRef(ref2){const result=findElementFromVueRef(ref2);if(result instanceof HTMLElement){return result;}return void 0;}function getElementFromVueRef(ref2){const element=findElementFromVueRef(ref2);if(!isSet(element)){throw new Error(`Unable to find element from ${ref2}.`);}return element;}function getHTMLElementFromVueRef(ref2){const element=findElementFromVueRef(ref2);if(!isSet(element)){throw new Error(`Unable to find element from ${ref2}.`);}if(element instanceof HTMLElement){return element;}throw new Error(`Not instance of HTMLELement ${ref2}.`);}function emptyTableRow(textContent=""){function toPrimitive(hint){if(hint==="string"){return textContent;}else{return null;}}function toString(){return textContent;}const proxy=new Proxy(()=>textContent,{apply(){return textContent;},get(_target,prop){switch(prop){case Symbol.toPrimitive:return toPrimitive;case"toString":return toString;case"__v_isRef":return false;default:return proxy;}}});return proxy;}function lazyLoad(fn2){let cache;return()=>{var _cache2;return(_cache2=cache)!==null&&_cache2!==void 0?_cache2:cache=fn2();};}const eventTarget=lazyLoad(()=>new EventTarget());const fn=/* @__PURE__ */new Map();function $emit(type,...args){const event=new CustomEvent(type,{detail:args});eventTarget().dispatchEvent(event);}function $on(type,callback){fn.set(callback,event=>callback(...event.detail));eventTarget().addEventListener(type,fn.get(callback));}function $off(type,callback){eventTarget().removeEventListener(type,fn.get(callback));fn.delete(callback);}const EventBus={$emit,$on,$off};var FKUIConfigButtonOrder=/* @__PURE__ */(FKUIConfigButtonOrder2=>{FKUIConfigButtonOrder2[FKUIConfigButtonOrder2["LEFT_TO_RIGHT"]=0]="LEFT_TO_RIGHT";FKUIConfigButtonOrder2[FKUIConfigButtonOrder2["RIGHT_TO_LEFT"]=1]="RIGHT_TO_LEFT";return FKUIConfigButtonOrder2;})(FKUIConfigButtonOrder||{});let popupContainer=document.body;let production=true;const config={buttonOrder:FKUIConfigButtonOrder.LEFT_TO_RIGHT,teleportTarget:document.body,modalTarget:null,popupTarget:null,get popupContainer(){if(typeof popupContainer==="string"){const element=document.querySelector(popupContainer);if(!element){throw new Error(`Failed to find popupContainer element from selector "${popupContainer}"`);}return element;}else{return popupContainer;}},set popupContainer(value){popupContainer=value;},set production(value){production=value;configLogic.production=value;},get production(){return production;}};function setRunningContext(app){const fkuiContext={appContext:app._context};app.config.globalProperties.$fkui=fkuiContext;}function getRunningContext(callingInstance){if(!callingInstance.$fkui){throw new Error("Application running context is unset. Call `setRunningContext(app)` after `app = createApp(..)`.");}return callingInstance.$fkui;}function getTargetElement(target){if(!target){return document.body;}if(typeof target!=="string"){return target;}const element=document.querySelector(target);if(!element){throw new Error(`mountComponent(..) requires a target element (selector "${target}" returned no element)`);}return element;}function createContainer(options){const{attachTo,attachFirst}=options;const parent=getTargetElement(attachTo);const element=document.createElement("div");if(attachFirst){parent.insertBefore(element,parent.firstChild);}else{parent.appendChild(element);}return element;}function mountComponent(callingInstance,Component,options={}){if(!Component){throw new Error("mountComponent(..) called without a component");}const{attachTo,attachFirst=false,...data}=options;const el=createContainer({attachTo,attachFirst});const app=createApp(Component,data);const fkuiContext=getRunningContext(callingInstance);if(fkuiContext){Object.assign(app._context,fkuiContext.appContext);}app.mount(el);const unmount=app.unmount;app.unmount=()=>{unmount.call(app);if(el.parentNode){el.parentNode.removeChild(el);}};return app;}function unpackPayload(event,src){const defaultPayload={};const{reason=event,data:rawData}=src!==null&&src!==void 0?src:defaultPayload;const data=rawData;return{reason,data};}function openModal(callingInstance,Component,options){var _config$modalTarget;if(typeof options==="string"){return openModal(callingInstance,Component,{props:{content:options}});}const defaultOptions2={attachTo:(_config$modalTarget=config.modalTarget)!==null&&_config$modalTarget!==void 0?_config$modalTarget:config.teleportTarget,props:{}};const{attachTo,props}={...defaultOptions2,...options};return new Promise((resolve,reject)=>{const terminate=(event,payload)=>{try{const result=unpackPayload(event,payload);app.unmount();resolve(result);}catch(err){console.error(err);reject(err);}};const app=mountComponent(callingInstance,Component,{attachTo,isOpen:true,onClose(data){terminate("close",data);},...props});});}async function formModal(callingInstance,Component,options){var _ref;const props={size:(_ref=options==null?void 0:options.size)!==null&&_ref!==void 0?_ref:"",beforeSubmit:options==null?void 0:options.beforeSubmit,...(options==null?void 0:options.props)};const result=await openModal(callingInstance,Component,{props});if(result.reason==="submit"){return result.data;}else{return Promise.reject("cancel");}}var ModalReason=/* @__PURE__ */(ModalReason2=>{ModalReason2["CONFIRM"]="confirm";ModalReason2["DISMISS"]="dismiss";return ModalReason2;})(ModalReason||{});const sizes=["","small","medium","large","fullscreen","fullwidth"];function sizeClass(size){if(!sizes.includes(size)){throw new Error(`"${size}" is not a valid size`);}if(!size){return[];}else if(size==="fullscreen"){return[`modal__dialog-container--fullwidth`];}else{return[`modal__dialog-container--${size}`];}}function focusElement(element,container){if(elementIsRadioButton(element)){focusRadioButtonGroup(element,container);}else{focus$1(element);}}function focusRadioButtonGroup(element,container){const radioGroupInputs=container.querySelectorAll(`input[type="radio"][name="${element.name}"]`);const checkedRadioButton=Array.from(radioGroupInputs).find(inputEl=>inputEl.checked);if(checkedRadioButton){focus$1(checkedRadioButton);}else{focus$1(element);}}function elementIsRadioButton(element){return isHTMLInputElement(element)&&element.type==="radio";}function isHTMLInputElement(element){return element instanceof HTMLInputElement;}const _sfc_main$1b=defineComponent({name:"FModal",components:{FIcon},mixins:[TranslationMixin],inheritAttrs:true,props:{/**
31
+ * The id for the root element id attribute.
32
+ * If the prop is not set a random value will be generated.
33
+ */id:{type:String,required:false,default:()=>ElementIdService.generateElementId()},/**
34
+ * If the modal is open.
35
+ * Use this to toggle if the modal should be visible or not.
36
+ */isOpen:{type:Boolean,required:false,default:false},/**
37
+ * The aria-label attribute text for the top right close button.
38
+ */ariaCloseText:{type:String,required:false,default:void 0},/**
39
+ * Enable fullscreen mode in mobile.
40
+ */fullscreen:{type:Boolean,required:false,default:false},/**
41
+ * The type of modal. 'information', 'warning' and 'error' is valid.
42
+ */type:{type:String,default:"",validator(value){return["","information","warning","error"].includes(value);}},/**
43
+ * The size of modal in desktop mode.
44
+ */size:{type:String,default:"",validator(value){return sizes.includes(value);}}},emits:["close"],data(){return{nonModalFocusableElements:[],savedFocus:null,savedScroll:null};},computed:{modalClass(){return this.type?[`modal--${this.type}`]:[];},containerClasses(){const size=sizeClass(this.size);if(this.fullscreen){return[...size,"modal__dialog-container--fullscreen"];}else{return size;}},hasHeaderSlot(){return hasSlot(this,"header");}},watch:{isOpen:{immediate:true,async handler(value){if(value){await this.$nextTick();this.openModal();}else{this.restoreState();}}}},beforeUnmount(){this.restoreState();},methods:{onClose(){this.$emit("close");},openModal(){const root2=document.documentElement;const scroll=root2.scrollTop;root2.style.top=`-${scroll}px`;root2.classList.add("modal__open");const focusElement2=this.resolveFocusElement();this.savedFocus=pushFocus(focusElement2);this.savedScroll=scroll;},/**
45
+ * Prioritises what element to initially focus on in the following order:
46
+ *
47
+ * 1. Header
48
+ * 2. First interactive element within content
49
+ * 3. Content
50
+ */resolveFocusElement(){const titleElement=findElementFromVueRef(this.$refs.modalTitle);if(titleElement){return titleElement;}const contentElement=getHTMLElementFromVueRef(this.$refs.modalContent);const tabbableChildren=findTabbableElements(contentElement);const firstTabbableChildElement=tabbableChildren.length?tabbableChildren[0]:void 0;return firstTabbableChildElement!==null&&firstTabbableChildElement!==void 0?firstTabbableChildElement:contentElement;},restoreState(){if(this.savedFocus){var _this$savedScroll;const root2=document.documentElement;root2.classList.remove("modal__open");root2.style.removeProperty("top");root2.scrollTop=(_this$savedScroll=this.savedScroll)!==null&&_this$savedScroll!==void 0?_this$savedScroll:0;popFocus(this.savedFocus);this.savedFocus=null;this.savedScroll=null;}},onFocusFirst(){const tabbableElements=findTabbableElements(this.$refs.modalDialogContainer);const lastTabbableElement=tabbableElements[tabbableElements.length-2];focusElement(lastTabbableElement,this.$el);},onFocusLast(){const tabbableElements=findTabbableElements(this.$refs.modalDialogContainer);const firstTabbableElement=tabbableElements[1];focusElement(firstTabbableElement,this.$el);}}});const _hoisted_1$T=["id"];const _hoisted_2$F={class:"modal__backdrop"};const _hoisted_3$z={class:"modal__inner-container"};const _hoisted_4$t={class:"modal__dialog"};const _hoisted_5$p={class:"modal__dialog-inner"};const _hoisted_6$l={class:"modal__header"};const _hoisted_7$g={key:0,ref:"modalTitle",class:"modal__title",tabindex:"-1"};const _hoisted_8$b={ref:"modalContent",class:"modal__content",tabindex:"-1"};const _hoisted_9$7={class:"modal__footer"};const _hoisted_10$7={class:"modal__shelf"};const _hoisted_11$3=["aria-label"];function _sfc_render$11(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");return _ctx.isOpen?(openBlock(),createElementBlock("div",{key:0,id:_ctx.id,class:normalizeClass(["modal",_ctx.modalClass])},[createElementVNode("div",_hoisted_2$F,[createElementVNode("div",{class:"modal__outer-container scroll-target",tabindex:"-1",role:"dialog","aria-modal":"true",onKeyup:_cache[3]||(_cache[3]=withKeys((...args)=>_ctx.onClose&&_ctx.onClose(...args),["esc"]))},[createElementVNode("div",_hoisted_3$z,[createElementVNode("div",{ref:"modalDialogContainer",class:normalizeClass(["modal__dialog-container",_ctx.containerClasses])},[createElementVNode("div",_hoisted_4$t,[createElementVNode("div",_hoisted_5$p,[createElementVNode("div",_hoisted_6$l,[createElementVNode("div",{tabindex:"0",onFocus:_cache[0]||(_cache[0]=(...args)=>_ctx.onFocusFirst&&_ctx.onFocusFirst(...args))},null,32/* NEED_HYDRATION */),createTextVNode(),_ctx.hasHeaderSlot?(openBlock(),createElementBlock("h1",_hoisted_7$g,[renderSlot(_ctx.$slots,"header")],512/* NEED_PATCH */)):createCommentVNode("v-if",true)]),createTextVNode(),createElementVNode("div",_hoisted_8$b,[renderSlot(_ctx.$slots,"content")],512/* NEED_PATCH */),createTextVNode(),createElementVNode("div",_hoisted_9$7,[renderSlot(_ctx.$slots,"footer")])]),createTextVNode(),createElementVNode("div",_hoisted_10$7,[createElementVNode("button",{type:"button",class:"close-button","aria-label":_ctx.ariaCloseText,onClick:_cache[1]||(_cache[1]=(...args)=>_ctx.onClose&&_ctx.onClose(...args))},[createElementVNode("span",null,toDisplayString(_ctx.$t("fkui.modal.close","Stäng")),1/* TEXT */),createTextVNode(),createVNode(_component_f_icon,{name:"close"})],8,_hoisted_11$3),createTextVNode(),createElementVNode("div",{tabindex:"0",onFocus:_cache[2]||(_cache[2]=(...args)=>_ctx.onFocusLast&&_ctx.onFocusLast(...args))},null,32/* NEED_HYDRATION */)])])],2/* CLASS */)])],32/* NEED_HYDRATION */)])],10,_hoisted_1$T)):createCommentVNode("v-if",true);}const FModal=/* @__PURE__ */_export_sfc(_sfc_main$1b,[["render",_sfc_render$11]]);function prepareButtonList(src,buttonOrder=config.buttonOrder){const list=src.map(it=>{var _it$event,_ref2,_it$reason,_it$type;return{label:it.label,screenreader:it.screenreader,event:(_it$event=it.event)!==null&&_it$event!==void 0?_it$event:"dismiss",reason:(_ref2=(_it$reason=it.reason)!==null&&_it$reason!==void 0?_it$reason:it.event)!==null&&_ref2!==void 0?_ref2:"dismiss",classlist:["button",`button--${(_it$type=it.type)!==null&&_it$type!==void 0?_it$type:"secondary"}`],buttonType:it.submitButton?"submit":"button"};});switch(buttonOrder){case FKUIConfigButtonOrder.LEFT_TO_RIGHT:return list;case FKUIConfigButtonOrder.RIGHT_TO_LEFT:return list.reverse();}}const defaultButtons=[{label:"Primärknapp",event:"confirm",type:"primary"},{label:"Sekundärknapp",event:"dismiss",type:"secondary"}];const _sfc_main$1a=defineComponent({name:"FConfirmModal",components:{FModal},inheritAttrs:true,props:{/**
51
+ * Enable fullscreen mode in mobile.
52
+ */fullscreen:{type:Boolean,required:false,default:false},/**
53
+ * Prop for opening modal
54
+ */isOpen:{type:Boolean,required:false,default:false},/**
55
+ * Simple text content
56
+ */content:{type:String,required:false,default:"Brödtext"},/**
57
+ * Simple text header
58
+ */heading:{type:String,required:false,default:"Rubrik"},/**
59
+ * The size of modal. 'large' and 'fullscreen' is valid.
60
+ */size:{type:String,default:"",validator(value){return sizes.includes(value);}},/**
61
+ * The aria-label attribute text for the top right close button.
62
+ */ariaCloseText:{type:String,required:false,default:void 0},/**
63
+ * List of buttons
64
+ */buttons:{type:Array,required:false,default:()=>{return defaultButtons;}}},emits:["close",...defaultButtons.map(it=>{var _it$event2;return(_it$event2=it.event)!==null&&_it$event2!==void 0?_it$event2:"";})],computed:{preparedButtons(){return prepareButtonList(this.buttons);}},methods:{onClose(){this.$emit("close",{reason:"close"});},onClick(button){this.$emit(button.event);this.$emit("close",{reason:button.reason});}}});const _hoisted_1$S={class:"button-group"};const _hoisted_2$E=["onClick"];const _hoisted_3$y={key:0,class:"sr-only"};function _sfc_render$10(_ctx,_cache,$props,$setup,$data,$options){const _component_f_modal=resolveComponent("f-modal");return openBlock(),createBlock(_component_f_modal,{fullscreen:_ctx.fullscreen,"is-open":_ctx.isOpen,"aria-close-text":_ctx.ariaCloseText,type:"warning",size:_ctx.size,onClose:_ctx.onClose},{header:withCtx(()=>[renderSlot(_ctx.$slots,"heading",{},()=>[createTextVNode(toDisplayString(_ctx.heading),1/* TEXT */)])]),content:withCtx(()=>[renderSlot(_ctx.$slots,"content",{},()=>[createTextVNode(toDisplayString(_ctx.content),1/* TEXT */)])]),footer:withCtx(()=>[createElementVNode("div",_hoisted_1$S,[(openBlock(true),createElementBlock(Fragment,null,renderList(_ctx.preparedButtons,button=>{return openBlock(),createElementBlock("button",{key:button.label,type:"button",class:normalizeClass([button.classlist,"button-group__item"]),onClick:$event=>_ctx.onClick(button)},[createElementVNode("span",null,toDisplayString(button.label),1/* TEXT */),createTextVNode(),button.screenreader?(openBlock(),createElementBlock("span",_hoisted_3$y," "+toDisplayString(button.screenreader),1/* TEXT */)):createCommentVNode("v-if",true)],10,_hoisted_2$E);}),128/* KEYED_FRAGMENT */))])]),_:3/* FORWARDED */},8,["fullscreen","is-open","aria-close-text","size","onClose"]);}const FConfirmModal=/* @__PURE__ */_export_sfc(_sfc_main$1a,[["render",_sfc_render$10]]);const GAP=["1x","2x","3x","4x","5x","6x","7x","8x"];const ALIGNMENT=["top","center","bottom"];const FLOAT=["left","center","right"];const _sfc_main$19=defineComponent({name:"IFlex",inheritAttrs:true,props:{/**
65
+ * Set gap (gutter) between items.
66
+ *
67
+ * Must be one of:
68
+ *
69
+ * - `"1x"`
70
+ * - `"2x"`
71
+ * - `"3x"`
72
+ * - ...
73
+ * - `"8x"`
74
+ *
75
+ * Example: a value of `"3x"` corresponds to a gap of `3 * 0.25 = 0.75rem`.
76
+ */gap:{type:String,default:"",validator(val){return val===""||GAP.includes(val);}},/**
77
+ * If set the IFlexItems will be fullwidth and
78
+ * stacked on top of each other when breakpoint is small (aka mobile).
79
+ */collapse:{type:Boolean,default:false},/**
80
+ * If set the IFlexItems will wrap when out of space
81
+ */wrap:{type:Boolean,default:false},/**
82
+ * Set how IFlexItems should float.
83
+ *
84
+ * Must be one of:
85
+ *
86
+ * - `"left"`
87
+ * - `"center"`
88
+ * - `"right"`
89
+ */float:{type:String,default:"",validator(val){return val===""||FLOAT.includes(val);}}},computed:{classList(){const classes=[];if(this.collapse){classes.push("iflex--collapse");}if(this.gap){classes.push(`iflex--gap-${this.gap}`);}if(this.wrap){classes.push(`iflex--wrap`);}if(this.float){classes.push(`iflex--float-${this.float}`);}return classes;}}});function _sfc_render$$(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createElementBlock("div",{class:normalizeClass(["iflex",_ctx.classList])},[renderSlot(_ctx.$slots,"default")],2/* CLASS */);}const IFlex=/* @__PURE__ */_export_sfc(_sfc_main$19,[["render",_sfc_render$$]]);const _sfc_main$18=defineComponent({name:"IFlexItem",inheritAttrs:true,props:{/**
90
+ * If set this item will grow to its largest possible size.
91
+ */grow:{type:Boolean,default:false},/**
92
+ * If set this item will shrink to its smallest possible size.
93
+ */shrink:{type:Boolean,default:false},/**
94
+ * Vertical positioning of content.
95
+ *
96
+ * Must be one of:
97
+ *
98
+ * - `"top"`
99
+ * - `"center"`
100
+ * - `"bottom"`
101
+ */align:{type:String,default:"top",validator(val){return ALIGNMENT.includes(val);}}},computed:{classList(){const classList=[`iflex--align-${this.align}`];if(this.grow){classList.push("iflex--grow");}else if(this.shrink){classList.push("iflex--shrink");}return classList;}}});function _sfc_render$_(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createElementBlock("div",{class:normalizeClass(["iflex__item",_ctx.classList])},[renderSlot(_ctx.$slots,"default")],2/* CLASS */);}const IFlexItem=/* @__PURE__ */_export_sfc(_sfc_main$18,[["render",_sfc_render$_]]);function focusError(item){const element=document.querySelector(`#${item.id}`);if(!element){throw new Error(`Can not find element with id "${item.id}"`);}const focusElement2=document.querySelector(`#${item.focusElementId}`);scrollTo(element,window.innerHeight*0.25);focus$1(focusElement2?focusElement2:element);}const _sfc_main$17=defineComponent({name:"FErrorList",components:{FIcon,IFlex,IFlexItem},props:{/**
102
+ * List of errors of type `ErrorItem`.
103
+ * If element id is unspecified, no link will be rendered.
104
+ * If element with id don't exist on navigation, an exception is thrown.
105
+ */items:{type:Array,required:true},/**
106
+ * Display bullets in list.
107
+ */bullets:{type:Boolean,required:false,default:false},/**
108
+ * Optional callback for performing actions before navigation.
109
+ */beforeNavigate:{type:Function,required:false,default(){return()=>{};}}},computed:{hasTitleSlot(){return hasSlot(this,"title");}},methods:{liClasses(errorItem){const classes=[];if(!this.bullets&&errorItem.id){classes.push("error-list__link");}return classes;},async onClickItem(item){await this.beforeNavigate(item);focusError(item);}}});const _hoisted_1$R={class:"error-list"};const _hoisted_2$D={key:0};const _hoisted_3$x={class:"error-list__list error-list--list-style-none"};const _hoisted_4$s=["onClick"];const _hoisted_5$o=/* @__PURE__ */createElementVNode("span",{class:"error-list__bullet","aria-hidden":"true"},null,-1/* HOISTED */);const _hoisted_6$k={class:"error-list__link"};const _hoisted_7$f=/* @__PURE__ */createElementVNode("span",{class:"error-list__bullet","aria-hidden":"true"},null,-1/* HOISTED */);function _sfc_render$Z(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");const _component_i_flex_item=resolveComponent("i-flex-item");const _component_i_flex=resolveComponent("i-flex");return openBlock(),createElementBlock("div",_hoisted_1$R,[createVNode(_component_i_flex,null,{default:withCtx(()=>[_ctx.hasTitleSlot?(openBlock(),createBlock(_component_i_flex_item,{key:0,shrink:""},{default:withCtx(()=>[createVNode(_component_f_icon,{class:"error-list__icon",name:"error"})]),_:1/* STABLE */})):createCommentVNode("v-if",true),createTextVNode(),_ctx.hasTitleSlot?(openBlock(),createBlock(_component_i_flex_item,{key:1,shrink:""},{default:withCtx(()=>[createTextVNode(" ")]),_:1/* STABLE */})):createCommentVNode("v-if",true),createTextVNode(),createVNode(_component_i_flex_item,{grow:""},{default:withCtx(()=>[_ctx.hasTitleSlot?(openBlock(),createElementBlock("div",_hoisted_2$D,[renderSlot(_ctx.$slots,"title")])):createCommentVNode("v-if",true),createTextVNode(),createElementVNode("ul",_hoisted_3$x,[(openBlock(true),createElementBlock(Fragment,null,renderList(_ctx.items,item=>{return openBlock(),createElementBlock("li",{key:item.id,class:normalizeClass(_ctx.liClasses(item))},[item.id?(openBlock(),createElementBlock("a",{key:0,href:"javascript:",onClick:withModifiers($event=>_ctx.onClickItem(item),["prevent"])},[_ctx.bullets?(openBlock(),createElementBlock(Fragment,{key:0},[_hoisted_5$o,createTextVNode(),createElementVNode("span",_hoisted_6$k,toDisplayString(item.title),1/* TEXT */)],64/* STABLE_FRAGMENT */)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(item.title),1/* TEXT */)],64/* STABLE_FRAGMENT */))],8,_hoisted_4$s)):(openBlock(),createElementBlock(Fragment,{key:1},[_ctx.bullets?(openBlock(),createElementBlock(Fragment,{key:0},[_hoisted_7$f,createTextVNode(),createElementVNode("span",null,toDisplayString(item.title),1/* TEXT */)],64/* STABLE_FRAGMENT */)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(item.title),1/* TEXT */)],64/* STABLE_FRAGMENT */))],64/* STABLE_FRAGMENT */))],2/* CLASS */);}),128/* KEYED_FRAGMENT */))])]),_:3/* FORWARDED */})]),_:3/* FORWARDED */})]);}const FErrorList=/* @__PURE__ */_export_sfc(_sfc_main$17,[["render",_sfc_render$Z]]);function cleanUpElements(vm){return new Promise(resolve=>{window.setTimeout(()=>{Object.keys(vm.components).forEach(id=>{const domElement=vm.$el.querySelector(`#${id}`);if(!domElement){delete vm.components[id];}});resolve();},0);});}function sortComponentsWithErrorsOnDOMOrder(componentList){const errorList=Object.values(componentList).filter(component=>{const validity=component instanceof Reference?component.ref.isValid:component.validityMode;return typeof validity==="boolean"?validity===false:validity==="ERROR";});errorList.sort((a,b)=>{const elementToCompareA=a instanceof Reference?document.querySelector(`#${a.ref.id}`):a.target;const elementToCompareB=b instanceof Reference?document.querySelector(`#${b.ref.id}`):b.target;return documentOrderComparator(elementToCompareA,elementToCompareB);});return errorList;}function isFormStepReference(reference){return"isOpen"in reference.ref;}const _sfc_main$16=defineComponent({name:"FValidationGroup",props:{/**
110
+ * A `GroupValidityEvent` object containing:
111
+ *
112
+ * `isValid`: the aggregated validity of underlying components
113
+ *
114
+ * `componentsWithError`: a list of components with errors sorted in DOM order
115
+ *
116
+ * `componentCount`: number of registered components
117
+ * @model
118
+ */modelValue:{type:Object,required:false,default:()=>{return{isValid:false,componentsWithError:[],componentCount:0};}},/**
119
+ * Controls whether component-validity event should be propagated or not from underlying components.
120
+ */stopPropagation:{type:Boolean,required:false,default:false}},emits:["group-validity","update:modelValue"],data(){return{components:{}};},methods:{onComponentUnmount(event){delete this.components[event.detail.elementId];this.triggerGroupValidityEvent();},async onComponentValidity(event){if(this.stopPropagation){event.stopPropagation();}await cleanUpElements(this);this.components[event.detail.elementId]=event.detail;this.triggerGroupValidityEvent();},triggerGroupValidityEvent(){const components=Object.values(this.components);const isValid=components.every(component=>component.isValid);const componentsWithError=components.filter(component=>component.validityMode==="ERROR");componentsWithError.sort((a,b)=>documentOrderComparator(a.target,b.target));this.$emit("update:modelValue",{isValid,componentsWithError,componentCount:components.length});this.$emit("group-validity",{isValid,componentsWithError,componentCount:components.length});}}});function _sfc_render$Y(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createElementBlock("div",{onComponentValidity:_cache[0]||(_cache[0]=(...args)=>_ctx.onComponentValidity&&_ctx.onComponentValidity(...args)),onComponentUnmount:_cache[1]||(_cache[1]=(...args)=>_ctx.onComponentUnmount&&_ctx.onComponentUnmount(...args))},[renderSlot(_ctx.$slots,"default")],32/* NEED_HYDRATION */);}const FValidationGroup=/* @__PURE__ */_export_sfc(_sfc_main$16,[["render",_sfc_render$Y]]);var FValidationFormAction=/* @__PURE__ */(FValidationFormAction2=>{FValidationFormAction2[FValidationFormAction2["CONTINUE"]=0]="CONTINUE";FValidationFormAction2[FValidationFormAction2["CANCEL"]=1]="CANCEL";return FValidationFormAction2;})(FValidationFormAction||{});const _sfc_main$15=defineComponent({name:"FValidationForm",components:{FValidationGroup,FErrorList},inheritAttrs:false,props:{/**
121
+ * If given, this function is called before the `submit` event is emitted.
122
+ *
123
+ * Optionally this callback may return `FValidationFormAction`. If
124
+ * `FValidationFormAction.CANCEL` is returned the submission is
125
+ * cancelled and no event will be emitted. The consumer should make it
126
+ * clear why the action was cancelled.
127
+ *
128
+ * If a promise is returned it will be awaited.
129
+ *
130
+ * The consumer does not need to validate form data, it is handled
131
+ * internally by the component.
132
+ */beforeSubmit:{type:Function,required:false,default(){return()=>void 0;}},/**
133
+ * If given, this function is called before the form data is validated and the `submit` event is emitted.
134
+ */beforeValidation:{type:Function,required:false,default(){return()=>void 0;}},/**
135
+ * The id for the form id attribute.
136
+ * If the prop is not set a random value will be generated.
137
+ */id:{type:String,required:false,default:()=>ElementIdService.generateElementId()},/**
138
+ * Include the error list component.
139
+ */useErrorList:{type:Boolean,required:false,default:true}},emits:["submit"],data(){return{validity:{isValid:true,componentsWithError:[],componentCount:0},submitted:false};},computed:{groupKey(){return`${this.id}-group`;},errors(){return this.validity.componentsWithError.map(c=>({id:c.elementId,focusElementId:c.focusElementId,title:c.errorMessage}));},displayErrors(){return this.useErrorList&&this.submitted&&this.errors.length>0;}},methods:{async hasFormErrors(){ValidationService.setSubmitted(this.id);await ValidationService.validateAllElements(this.id);await this.$nextTick();await new Promise(resolve=>window.setTimeout(resolve,0));if(this.validity.isValid){return false;}if(this.useErrorList){focus$1(this.$refs.errors);}else{const firstError=this.validity.componentsWithError[0];const element=document.getElementById(firstError.focusElementId);focus$1(element);}return true;},async onSubmit(event){this.submitted=true;const beforeValidation=this.beforeValidation?await this.beforeValidation():void 0;if(beforeValidation===FValidationFormAction.CANCEL){return;}if(await this.hasFormErrors()){return;}const beforeAction=this.beforeSubmit?await this.beforeSubmit():void 0;if(beforeAction===FValidationFormAction.CANCEL){return;}if(await this.hasFormErrors()){return;}this.$emit("submit",event);}}});const _hoisted_1$Q=["id"];const _hoisted_2$C={key:0,ref:"errors",tabindex:"-1",role:"group"};function _sfc_render$X(_ctx,_cache,$props,$setup,$data,$options){const _component_f_error_list=resolveComponent("f-error-list");const _component_f_validation_group=resolveComponent("f-validation-group");return openBlock(),createBlock(_component_f_validation_group,{key:_ctx.groupKey,modelValue:_ctx.validity,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>_ctx.validity=$event),"stop-propagation":true},{default:withCtx(()=>[createElementVNode("form",mergeProps({id:_ctx.id},_ctx.$attrs,{novalidate:"",autocomplete:"off",onSubmit:_cache[0]||(_cache[0]=withModifiers((...args)=>_ctx.onSubmit&&_ctx.onSubmit(...args),["prevent"]))}),[_ctx.displayErrors?(openBlock(),createElementBlock("nav",_hoisted_2$C,[createVNode(_component_f_error_list,{bullets:true,items:_ctx.errors},{title:withCtx(()=>[renderSlot(_ctx.$slots,"error-message")]),_:3/* FORWARDED */},8,["items"])],512/* NEED_PATCH */)):createCommentVNode("v-if",true),createTextVNode(),renderSlot(_ctx.$slots,"default")],16,_hoisted_1$Q)]),_:3/* FORWARDED */},8,["modelValue"]);}const FValidationForm=/* @__PURE__ */_export_sfc(_sfc_main$15,[["render",_sfc_render$X]]);const _sfc_main$14=defineComponent({name:"FFormModal",components:{FModal,FValidationForm},mixins:[TranslationMixin],inheritAttrs:true,props:{/**
140
+ * Enable fullscreen mode in mobile.
141
+ */fullscreen:{type:Boolean,required:false,default:true},/**
142
+ * If the modal is open.
143
+ * Use this to toggle if the modal should be visible or not.
144
+ */isOpen:{type:Boolean,required:false,default:true},/**
145
+ * See <f-modal> `size` props.
146
+ */size:{type:String,default:"",validator(value){return sizes.includes(value);}},/**
147
+ * @ignore
148
+ */dataTest:{type:String,required:false,default:""},/**
149
+ * The data that has been submitted.
150
+ */value:{type:Object,default:function(){return{};}},/**
151
+ * Include the error list component.
152
+ */useErrorList:{type:Boolean,required:false,default:true},/**
153
+ * The id for the form id attribute.
154
+ * If the prop is not set a random value will be generated.
155
+ */formId:{type:String,required:false,default:()=>ElementIdService.generateElementId()},/**
156
+ * The aria-label attribute text for the top right close button.
157
+ */ariaCloseText:{type:String,required:false,default:void 0},/**
158
+ * If given, this function is called before the [[submit]] event is emitted.
159
+ * See <f-validation-form> `beforeSubmit` props for more info.
160
+ */beforeSubmit:{type:Function,required:false,default(){}},/**
161
+ * If given, this function is called before the form data is validated and the [[submit]] event is emitted.
162
+ * See <f-validation-form> `beforeValidation` props for more info.
163
+ */beforeValidation:{type:Function,required:false,default(){}},buttons:{type:Array,required:false,default:()=>[{label:TranslationService.provider.translate("fkui.form-modal.button.submit.text","Spara"),event:"submit",type:"primary",submitButton:true},{label:TranslationService.provider.translate("fkui.form-modal.button.cancel.text","Avbryt"),event:"dismiss",type:"secondary"}]}},emits:["cancel","close","submit"],data(){return{};},computed:{preparedButtons(){return prepareButtonList(this.buttons,FKUIConfigButtonOrder.LEFT_TO_RIGHT);},hasDeprecatedSlots(){return hasSlot(this,"cancel-button-text")||hasSlot(this,"submit-button-text");}},methods:{onClose(){ValidationService.resetState(this.$el);this.$emit("cancel");this.$emit("close",{reason:"close"});},async onSubmit(){ValidationService.resetState(this.$el);this.$emit("submit",{data:this.value});this.$emit("close",{reason:"submit",data:this.value});},onCancel(){ValidationService.resetState(this.$el);this.$emit("cancel");this.$emit("close",{reason:"close"});}}});const _hoisted_1$P={class:"button-group"};const _hoisted_2$B=["type","form","onClick"];const _hoisted_3$w={key:0,class:"sr-only"};const _hoisted_4$r=["form"];function _sfc_render$W(_ctx,_cache,$props,$setup,$data,$options){const _component_f_validation_form=resolveComponent("f-validation-form");const _component_f_modal=resolveComponent("f-modal");return openBlock(),createBlock(_component_f_modal,{"data-test":_ctx.dataTest,fullscreen:_ctx.fullscreen,"is-open":_ctx.isOpen,size:_ctx.size,"aria-close-text":_ctx.ariaCloseText,onClose:_ctx.onClose},{header:withCtx(()=>[renderSlot(_ctx.$slots,"header")]),content:withCtx(()=>[createElementVNode("div",null,[renderSlot(_ctx.$slots,"default")]),createTextVNode(),createVNode(_component_f_validation_form,{id:_ctx.formId,"before-submit":_ctx.beforeSubmit,"before-validation":_ctx.beforeValidation,"use-error-list":_ctx.useErrorList,onSubmit:_ctx.onSubmit,onCancel:_ctx.onCancel},{"error-message":withCtx(()=>[renderSlot(_ctx.$slots,"error-message")]),default:withCtx(()=>[createTextVNode(),renderSlot(_ctx.$slots,"input-text-fields")]),_:3/* FORWARDED */},8,["id","before-submit","before-validation","use-error-list","onSubmit","onCancel"])]),footer:withCtx(()=>[createElementVNode("div",_hoisted_1$P,[!_ctx.hasDeprecatedSlots?(openBlock(true),createElementBlock(Fragment,{key:0},renderList(_ctx.preparedButtons,button=>{return openBlock(),createElementBlock("button",{key:button.label,type:button.buttonType,class:normalizeClass([button.classlist,"button-group__item"]),form:button.buttonType==="submit"?_ctx.formId:void 0,onClick:$event=>button.buttonType==="button"?_ctx.onCancel():false},[createElementVNode("span",null,toDisplayString(button.label),1/* TEXT */),createTextVNode(),button.screenreader?(openBlock(),createElementBlock("span",_hoisted_3$w," "+toDisplayString(button.screenreader),1/* TEXT */)):createCommentVNode("v-if",true)],10,_hoisted_2$B);}),128/* KEYED_FRAGMENT */)):(openBlock(),createElementBlock(Fragment,{key:1},[createElementVNode("button",{form:_ctx.formId,"data-test":"submit-button",type:"submit",class:"button button--primary button-group__item button--large"},[renderSlot(_ctx.$slots,"submit-button-text",{},()=>[createTextVNode(toDisplayString(_ctx.$t("fkui.form-modal.button.submit.text","Spara")),1/* TEXT */)])],8,_hoisted_4$r),createTextVNode(),createElementVNode("button",{"data-test":"cancel-button",type:"button",class:"button button--secondary button-group__item button--large",onClick:_cache[0]||(_cache[0]=(...args)=>_ctx.onCancel&&_ctx.onCancel(...args))},[renderSlot(_ctx.$slots,"cancel-button-text",{},()=>[createTextVNode(toDisplayString(_ctx.$t("fkui.form-modal.button.cancel.text","Avbryt")),1/* TEXT */)])])],64/* STABLE_FRAGMENT */))])]),_:3/* FORWARDED */},8,["data-test","fullscreen","is-open","size","aria-close-text","onClose"]);}const FFormModal=/* @__PURE__ */_export_sfc(_sfc_main$14,[["render",_sfc_render$W]]);async function confirmModal(callingInstance,modalData){const buttons=[{label:modalData.confirm,event:"confirm",type:"primary"},{label:modalData.dismiss,event:"dismiss",type:"secondary"}];const{reason}=await openModal(callingInstance,FConfirmModal,{props:{heading:modalData.heading,content:modalData.content,buttons}});return reason==="confirm";}function isVueComponent(element){return Boolean(element&&typeof element==="object"&&"$el"in element);}function focus(element,options={}){if(Array.isArray(element)){return focus(element[0],options);}if(isVueComponent(element)){var _element$focusTarget;const targetElement=(_element$focusTarget=element.focusTarget)!==null&&_element$focusTarget!==void 0?_element$focusTarget:element.$el;return focus(targetElement,options);}if(element instanceof HTMLElement){focus$1(element,options);return true;}return false;}function getInputElement(vm){const inputElement=vm.$el.querySelector("input");if(!inputElement){const id=vm.$el.id;const tag=vm.$el.tagName.toLowerCase();throw new Error(`Could not find input element from element "${tag}#${id}"`);}return inputElement;}function hasSlot(vm,name,props={}){const slot=vm.$slots[name];return Boolean(renderSlotText(slot,props));}function findParentByName(vm,name){let current=vm;while(current){if(current.$options.name===name){return current;}current=current.$parent;}return void 0;}function getParentByName(vm,name){const parentVm=findParentByName(vm,name);if(parentVm===void 0){throw new Error(`Unable to find parent component by given name '${name}'.`);}return parentVm;}function hasParentByName(vm,name){return findParentByName(vm,name)!==void 0;}class ErrorData{constructor(error,vm,info){__publicField(this,"error");__publicField(this,"vm");__publicField(this,"info");this.error=error;this.vm=vm;this.info=info;}}class ErrorViewData{constructor(hasError=false,payload){__publicField(this,"hasError");__publicField(this,"payload");this.hasError=hasError;this.payload=payload;}}class FormErrorList{constructor(fields){__publicField(this,"focusElementId","");__publicField(this,"id","");__publicField(this,"isValid",false);__publicField(this,"numberOfTimesSubmitted",0);__publicField(this,"title","");Object.assign(this,fields);}}class FormStep{constructor(fields){__publicField(this,"isOpen",false);__publicField(this,"isAnyFieldTouched",false);__publicField(this,"focusElementId","");__publicField(this,"id","");__publicField(this,"isValid",false);__publicField(this,"numberOfTimesSubmitted",0);__publicField(this,"title","");Object.assign(this,fields);}}var MenuAction=/* @__PURE__ */(MenuAction2=>{MenuAction2[MenuAction2["MOVE_NEXT"]=0]="MOVE_NEXT";MenuAction2[MenuAction2["MOVE_PREV"]=1]="MOVE_PREV";MenuAction2[MenuAction2["MOVE_FIRST"]=2]="MOVE_FIRST";MenuAction2[MenuAction2["MOVE_LAST"]=3]="MOVE_LAST";MenuAction2[MenuAction2["ACTIVATE"]=4]="ACTIVATE";return MenuAction2;})(MenuAction||{});function actionFromKeyboardEvent(event){switch(event.key){case"End":return MenuAction.MOVE_LAST;case"Home":return MenuAction.MOVE_FIRST;case"Up":case"ArrowUp":return MenuAction.MOVE_PREV;case"Down":case"ArrowDown":return MenuAction.MOVE_NEXT;case"Left":case"ArrowLeft":return MenuAction.MOVE_PREV;case"Right":case"ArrowRight":return MenuAction.MOVE_NEXT;case"Tab":if(event.shiftKey){return MenuAction.MOVE_PREV;}return MenuAction.MOVE_NEXT;case" ":case"Spacebar":case"Enter":return MenuAction.ACTIVATE;default:return null;}}function getValidatableElement(element){if(isValidatableHTMLElement(element)){return element;}const validatableInsideElement=element.querySelector("input, textarea, select");if(validatableInsideElement){return validatableInsideElement;}else{throw new Error(`Couldn't find any validatable element`);}}function triggerInitialValidationToSupportFFormStepValidation(el){const target=getValidatableElement(el);ValidationService.validateElement(target);}function registerValidators(el,binding){const{modifiers:bindingModifiers={},value:bindingValue={}}=binding;const target=getValidatableElement(el);Object.keys(bindingValue).forEach(validatorName=>{if(!bindingModifiers[validatorName]){throw new Error(`Have you forget to add '${validatorName}' to v-validation.${validatorName}?`);}});const validatorConfigs={};Object.keys(bindingModifiers).forEach(validatorName=>{validatorConfigs[validatorName]=bindingValue[validatorName]||{};});ValidationService.addValidatorsToElement(target,validatorConfigs);}const ValidationDirective={beforeMount(el,binding){registerValidators(el,binding);},beforeUnmount(el,_binding){const validatableElement=getValidatableElement(el);dispatchComponentUnmountEvent(validatableElement);ValidationService.removeValidatorsFromElement(validatableElement);},updated(el,binding){if(!isEqual$1(binding.value,binding.oldValue)){registerValidators(el,binding);}},mounted(el){triggerInitialValidationToSupportFFormStepValidation(el);}};const ValidationPrefixDirective={beforeMount(el,binding){el.addEventListener("component-validity",event=>{const e=event;e.detail.errorMessage=`${binding.value}${e.detail.errorMessage}`;});}};const ValidationPlugin={install(app){app.directive("validation",ValidationDirective);app.directive("validationPrefix",ValidationPrefixDirective);}};const UNHANDLED_ERROR_EVENT="unhandled-error";const defaults={captureWarnings:true,logToConsole:true};function errorHandler(options,error,vm,info){if(options.logToConsole){const consoleOutput=info?[`Error in ${info}:`,error,vm]:[error,vm];console.error(...consoleOutput);}if(error instanceof Error){EventBus.$emit(UNHANDLED_ERROR_EVENT,new ErrorData(error,vm,info));}else{EventBus.$emit(UNHANDLED_ERROR_EVENT,new ErrorData(new Error(String(error)),vm,info));}}function warnHandler(options,msg,vm,trace){if(options.logToConsole){console.warn(`Warning:`,msg,trace);}const error={name:"warning",message:msg,stack:trace};EventBus.$emit(UNHANDLED_ERROR_EVENT,new ErrorData(error,vm,"warning"));}const ErrorPlugin={install(app,options){const config2={...defaults,...options};app.config.errorHandler=errorHandler.bind(void 0,config2);if(config2.captureWarnings){app.config.warnHandler=warnHandler.bind(void 0,config2);}}};const _sfc_main$13=defineComponent({name:"FErrorPage",props:{payload:{type:Object,required:false,default:null}}});const _hoisted_1$O={"data-test":"f-error-page"};const _hoisted_2$A=/* @__PURE__ */createElementVNode("h1",null,"Fel",-1/* HOISTED */);const _hoisted_3$v=/* @__PURE__ */createElementVNode("p",null,"Ett fel har uppstått.",-1/* HOISTED */);const _hoisted_4$q=/* @__PURE__ */createElementVNode("a",{href:"/"},"Gå till startsidan",-1/* HOISTED */);function _sfc_render$V(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createElementBlock("div",_hoisted_1$O,[_hoisted_2$A,createTextVNode(),_hoisted_3$v,createTextVNode(),_hoisted_4$q]);}const FErrorPage=/* @__PURE__ */_export_sfc(_sfc_main$13,[["render",_sfc_render$V]]);const _sfc_main$12=defineComponent({name:"FErrorHandlingApp",props:{defaultComponent:{type:[Function,Object],required:false,default:void 0},errorComponent:{type:[Function,Object],required:false,default:FErrorPage}},data(){return new ErrorViewData();},watch:{$route(){this.hasError=false;}},created(){EventBus.$on(UNHANDLED_ERROR_EVENT,payload=>{this.hasError=true;this.payload=payload;});}});function _sfc_render$U(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createElementBlock("div",null,[_ctx.hasError?(openBlock(),createBlock(resolveDynamicComponent(_ctx.errorComponent),{key:0,payload:_ctx.payload},null,8,["payload"])):_ctx.defaultComponent?(openBlock(),createBlock(resolveDynamicComponent(_ctx.defaultComponent),{key:1})):renderSlot(_ctx.$slots,"default",{key:2})]);}const FErrorHandlingApp=/* @__PURE__ */_export_sfc(_sfc_main$12,[["render",_sfc_render$U]]);function isMonthBefore(date,minDate){return Boolean(minDate&&date.isBefore(minDate.startOfMonth()));}function isMonthAfter(date,maxDate){return Boolean(maxDate&&date.isAfter(maxDate.endOfMonth()));}function isInvalidMonth(date,minDate,maxDate){const startOfMonth=date.startOfMonth();return isMonthBefore(startOfMonth,minDate)||isMonthAfter(startOfMonth,maxDate);}function getMessage($t,date,minDate,maxDate){const invalidMonth=isInvalidMonth(date,minDate,maxDate);if(!invalidMonth){return void 0;}if(date.isBefore(minDate)){const{day,monthName,year}=minDate;return $t("fkui.calendar.error.below-min-date","Du kan inte välja en dag före {{day}} {{month}} {{year}}",{day,month:monthName,year});}if(date.isAfter(maxDate)){const{day,monthName,year}=maxDate;return $t("fkui.calendar.error.above-max-date","Du kan inte välja en dag efter {{day}} {{month}} {{year}}",{day,month:monthName,year});}}const _sfc_main$11=defineComponent({name:"ICalendarNavbar",components:{FIcon},mixins:[TranslationMixin],props:{/**
164
+ * Focused month.
165
+ */modelValue:{type:Object,required:true},/**
166
+ * Min date.
167
+ */minDate:{type:Object,required:true},/**
168
+ * Max date.
169
+ */maxDate:{type:Object,required:true}},emits:["change","update:modelValue"],computed:{previousDisabled(){return isInvalidMonth(this.modelValue.addMonths(-1),this.minDate,this.maxDate);},nextDisabled(){return isInvalidMonth(this.modelValue.addMonths(1),this.minDate,this.maxDate);},previousValue(){return this.modelValue.addMonths(-1);},nextValue(){return this.modelValue.addMonths(1);},currentText(){return this.getDateText(this.modelValue);},previousSrText(){return this.$t("fkui.calendar-navbar.previous","Föregående månad");},nextSrText(){return this.$t("fkui.calendar-navbar.next","Nästa månad");},previousIconClasses(){return{"calendar-navbar__icon":true,"calendar-navbar__icon--disabled":this.previousDisabled};},nextIconClasses(){return{"calendar-navbar__icon":true,"calendar-navbar__icon--disabled":this.nextDisabled};}},methods:{onClickPreviousButton(){if(!this.previousDisabled){this.$emit("update:modelValue",this.previousValue);this.$emit("change",this.previousValue);const previousMonth=this.getDateText(this.previousValue);const previousMonthText=this.$t("fkui.calendar-navbar.previous-month","{{ previousMonth }} visas",{previousMonth});alertScreenReader(previousMonthText,{assertive:true});return;}const message=getMessage(this.$t,this.previousValue,this.minDate,this.maxDate);if(message){alertScreenReader(message,{assertive:true});}},onClickNextButton(){if(!this.nextDisabled){this.$emit("update:modelValue",this.nextValue);this.$emit("change",this.nextValue);const nextMonth=this.getDateText(this.nextValue);const nextMonthText=this.$t("fkui.calendar-navbar.next-month","{{ nextMonth }} visas",{nextMonth});alertScreenReader(nextMonthText,{assertive:true});return;}const message=getMessage(this.$t,this.nextValue,this.minDate,this.maxDate);if(message){alertScreenReader(message,{assertive:true});}},getDateText(value){return`${value.monthName} ${value.year}`;},isFocused(ref2){return document.activeElement===this.$refs[ref2];}}});const _hoisted_1$N={class:"calendar-navbar"};const _hoisted_2$z={class:"calendar-navbar__month",tabindex:"-1"};const _hoisted_3$u=["aria-disabled","aria-live"];const _hoisted_4$p={class:"sr-only"};const _hoisted_5$n=["aria-disabled","aria-live"];const _hoisted_6$j={class:"sr-only"};function _sfc_render$T(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");return openBlock(),createElementBlock("div",_hoisted_1$N,[createElementVNode("div",_hoisted_2$z,toDisplayString(_ctx.currentText),1/* TEXT */),createTextVNode(),createElementVNode("button",{ref:"previousButton",class:"calendar-navbar__arrow calendar-navbar__arrow--previous",type:"button","aria-disabled":_ctx.previousDisabled,"aria-live":_ctx.isFocused("previousButton")?"polite":"off",onClick:_cache[0]||(_cache[0]=withModifiers((...args)=>_ctx.onClickPreviousButton&&_ctx.onClickPreviousButton(...args),["stop"]))},[createElementVNode("span",_hoisted_4$p,toDisplayString(_ctx.previousSrText),1/* TEXT */),createTextVNode(),createVNode(_component_f_icon,{class:normalizeClass(_ctx.previousIconClasses),name:"arrow-right"},null,8,["class"])],8,_hoisted_3$u),createTextVNode(),createElementVNode("button",{ref:"nextButton",class:"calendar-navbar__arrow calendar-navbar__arrow--next",type:"button","aria-disabled":_ctx.nextDisabled,"aria-live":_ctx.isFocused("nextButton")?"polite":"off",onClick:_cache[1]||(_cache[1]=withModifiers((...args)=>_ctx.onClickNextButton&&_ctx.onClickNextButton(...args),["stop"]))},[createElementVNode("span",_hoisted_6$j,toDisplayString(_ctx.nextSrText),1/* TEXT */),createTextVNode(),createVNode(_component_f_icon,{class:normalizeClass(_ctx.nextIconClasses),name:"arrow-right"},null,8,["class"])],8,_hoisted_5$n)]);}const ICalendarNavbar=/* @__PURE__ */_export_sfc(_sfc_main$11,[["render",_sfc_render$T]]);function getDayStartOffset(days){return days[0].weekDay-1;}function getDayEndOffset(days){return 7-days[days.length-1].weekDay;}const _sfc_main$10=defineComponent({name:"ICalendarMonthGrid",props:{/**
170
+ * Focused month.
171
+ * @model
172
+ */value:{type:Object,required:true},/**
173
+ * Hide week numbers.
174
+ */hideWeekNumbers:{type:Boolean,required:false,default:false}},data(){return{weekdays:getWeekdayNamings(),focused:false,resizeObserver:void 0,internalHideWeekNumbers:false,showShortWeekdays:false};},computed:{totalCols(){return this.hideWeekNumbers?7:8;},weeks(){return groupByWeek(this.value.startOfMonth(),this.value.endOfMonth());}},mounted(){this.resizeObserver=new ResizeObserver(debounce(this.onResize,100));this.resizeObserver.observe(this.$el);this.onResize();},unmounted(){if(this.resizeObserver){this.resizeObserver.disconnect();}},methods:{onResize(){const component=this.$el;this.internalHideWeekNumbers=this.hideWeekNumbers||component.offsetWidth<320;this.showShortWeekdays=component.offsetWidth<640;},onFocusin(){this.focused=true;},onFocusout(e){const component=this.$el;const relatedTarget=e.relatedTarget;if(!component.contains(relatedTarget)){this.focused=false;}},getDayStartOffset,getDayEndOffset}});const _hoisted_1$M={key:0,class:"calendar-month__col--week"};const _hoisted_2$y=/* @__PURE__ */createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */);const _hoisted_3$t=/* @__PURE__ */createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */);const _hoisted_4$o=/* @__PURE__ */createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */);const _hoisted_5$m=/* @__PURE__ */createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */);const _hoisted_6$i=/* @__PURE__ */createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */);const _hoisted_7$e=/* @__PURE__ */createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */);const _hoisted_8$a=/* @__PURE__ */createElementVNode("col",{class:"calendar-month__col--day"},null,-1/* HOISTED */);const _hoisted_9$6={role:"presentation"};const _hoisted_10$6={role:"presentation"};const _hoisted_11$2={key:0,scope:"col","aria-hidden":"true",class:"calendar-month__header-cell"};const _hoisted_12$2=["title"];const _hoisted_13$2={role:"presentation"};const _hoisted_14$2={key:0,class:"calendar-month__cell calendar-month__cell--week-number","aria-hidden":"true"};const _hoisted_15$2=["colspan"];const _hoisted_16$1=["colspan"];const _hoisted_17$1={key:0,"aria-hidden":"true"};const _hoisted_18$1=["colspan"];const _hoisted_19$1={key:1,"aria-hidden":"true"};const _hoisted_20$1=["colspan"];function _sfc_render$S(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createElementBlock("table",{class:"calendar-month__table",role:"application",onFocusin:_cache[0]||(_cache[0]=(...args)=>_ctx.onFocusin&&_ctx.onFocusin(...args)),onFocusout:_cache[1]||(_cache[1]=(...args)=>_ctx.onFocusout&&_ctx.onFocusout(...args))},[createElementVNode("colgroup",null,[!_ctx.internalHideWeekNumbers?(openBlock(),createElementBlock("col",_hoisted_1$M)):createCommentVNode("v-if",true),createTextVNode(),_hoisted_2$y,createTextVNode(),_hoisted_3$t,createTextVNode(),_hoisted_4$o,createTextVNode(),_hoisted_5$m,createTextVNode(),_hoisted_6$i,createTextVNode(),_hoisted_7$e,createTextVNode(),_hoisted_8$a]),createTextVNode(),createElementVNode("thead",_hoisted_9$6,[createElementVNode("tr",_hoisted_10$6,[!_ctx.internalHideWeekNumbers?(openBlock(),createElementBlock("th",_hoisted_11$2)):createCommentVNode("v-if",true),createTextVNode(),(openBlock(true),createElementBlock(Fragment,null,renderList(_ctx.weekdays,weekday=>{return openBlock(),createElementBlock("th",{key:weekday.name,scope:"col",role:"presentation",class:"calendar-month__header-cell"},[createElementVNode("abbr",{"aria-hidden":"true",title:weekday.name},toDisplayString(_ctx.showShortWeekdays?weekday.shortName:weekday.name),9,_hoisted_12$2)]);}),128/* KEYED_FRAGMENT */))])]),createTextVNode(),createElementVNode("tbody",_hoisted_13$2,[(openBlock(true),createElementBlock(Fragment,null,renderList(_ctx.weeks,week=>{return openBlock(),createElementBlock("tr",{key:week.week,role:"presentation"},[!_ctx.internalHideWeekNumbers?(openBlock(),createElementBlock("td",_hoisted_14$2,toDisplayString(week.week),1/* TEXT */)):createCommentVNode("v-if",true),createTextVNode(),_ctx.getDayStartOffset(week.days)?(openBlock(),createElementBlock("td",{key:1,class:"calendar-month__cell",colspan:_ctx.getDayStartOffset(week.days),"aria-hidden":"true"},null,8,_hoisted_15$2)):createCommentVNode("v-if",true),createTextVNode(),(openBlock(true),createElementBlock(Fragment,null,renderList(week.days,day=>{return openBlock(),createElementBlock("td",{key:day.toString(),class:"calendar-month__cell",role:"presentation"},[renderSlot(_ctx.$slots,"default",{date:day,focused:_ctx.focused})]);}),128/* KEYED_FRAGMENT */)),createTextVNode(),_ctx.getDayEndOffset(week.days)?(openBlock(),createElementBlock("td",{key:2,class:"calendar-month__cell",colspan:_ctx.getDayEndOffset(week.days),"aria-hidden":"true"},null,8,_hoisted_16$1)):createCommentVNode("v-if",true)]);}),128/* KEYED_FRAGMENT */)),createTextVNode(),_ctx.weeks.length<5?(openBlock(),createElementBlock("tr",_hoisted_17$1,[createElementVNode("td",{class:"calendar-month__cell",colspan:_ctx.totalCols,"aria-hidden":"true"},null,8,_hoisted_18$1)])):createCommentVNode("v-if",true),createTextVNode(),_ctx.weeks.length<6?(openBlock(),createElementBlock("tr",_hoisted_19$1,[createElementVNode("td",{class:"calendar-month__cell",colspan:_ctx.totalCols,"aria-hidden":"true"},null,8,_hoisted_20$1)])):createCommentVNode("v-if",true)])],32/* NEED_HYDRATION */);}const ICalendarMonthGrid=/* @__PURE__ */_export_sfc(_sfc_main$10,[["render",_sfc_render$S]]);const DayStep={ArrowRight:1,ArrowLeft:-1,ArrowUp:-7,ArrowDown:7};function isDayStepKey(e){return Object.keys(DayStep).includes(e.code);}function getDayStep(keyBoardEvent){return DayStep[keyBoardEvent.code];}function isSameMonth(a,b){return a.startOfMonth().equals(b.startOfMonth());}function getDayTabindex(date,active,entry){const ref2=active!==null&&active!==void 0?active:entry;if(ref2&&isSameMonth(ref2,date)){return date.equals(ref2)?0:-1;}else{return date.day===1?0:-1;}}const _sfc_main$$=defineComponent({name:"ICalendarMonth",components:{ICalendarMonthGrid},mixins:[TranslationMixin],props:{/**
175
+ * Active month.
176
+ * @model
177
+ */modelValue:{type:Object,required:true},/**
178
+ * Date to focus on when component gains focus.
179
+ *
180
+ * Consumers can update this related to active month.
181
+ * If undefined, the first day of the month will gain focus.
182
+ */tabDate:{type:Object,required:false,default:void 0},/**
183
+ * Min date.
184
+ */minDate:{type:Object,required:true},/**
185
+ * Max date.
186
+ */maxDate:{type:Object,required:true}},emits:["change","click","update:modelValue"],methods:{onClickDay(date){this.$emit("click",date);},async onKeydownDay(date,event){if(!isDayStepKey(event)){return;}event.preventDefault();const dayStep=getDayStep(event);const navigatedDay=date.addDays(dayStep);const navigatedMonth=navigatedDay.startOfMonth();const message=getMessage(this.$t,navigatedDay,this.minDate,this.maxDate);if(message){alertScreenReader(message,{assertive:true});return;}this.$emit("update:modelValue",navigatedMonth);this.$emit("change",navigatedMonth);if(navigatedDay.month!==date.month){await this.$nextTick();}this.$forceUpdate();const navigatedDayRef=this.$refs[navigatedDay.toString()];if(navigatedDayRef){const navigatedDayElement=getHTMLElementFromVueRef(navigatedDayRef);focus$1(navigatedDayElement);}},isDayFocused(date){return document.activeElement===this.$refs[date.toString()];},getTabindex(date){let activeDate=void 0;if(document.activeElement instanceof HTMLElement){const activeString=document.activeElement.dataset.date;activeDate=activeString?FDate.fromIso(activeString):void 0;}return getDayTabindex(date,activeDate,this.tabDate);}}});const _hoisted_1$L=["data-date","tabindex","onClick","onKeydown"];function _sfc_render$R(_ctx,_cache,$props,$setup,$data,$options){const _component_i_calendar_month_grid=resolveComponent("i-calendar-month-grid");return openBlock(),createBlock(_component_i_calendar_month_grid,{value:_ctx.modelValue},{default:withCtx(({date})=>[createElementVNode("button",{ref:date.toString(),class:"calendar-month__button","data-test":"select-day-button","data-date":date.toString(),tabindex:_ctx.getTabindex(date),type:"button",onClick:withModifiers($event=>_ctx.onClickDay(date),["stop","prevent"]),onKeydown:$event=>_ctx.onKeydownDay(date,$event)},[renderSlot(_ctx.$slots,"default",{date,isFocused:_ctx.isDayFocused(date)})],40,_hoisted_1$L)]),_:3/* FORWARDED */},8,["value"]);}const ICalendarMonth=/* @__PURE__ */_export_sfc(_sfc_main$$,[["render",_sfc_render$R]]);const _sfc_main$_=defineComponent({name:"FCalendar",components:{ICalendarNavbar,ICalendarMonth},props:{/**
187
+ * Active month.
188
+ * @model
189
+ */modelValue:{type:Object,required:true},/**
190
+ * Date to set tabindex on when component gains focus.
191
+ *
192
+ * Consumers can update this related to active month.
193
+ * If undefined, the first day of the month will gain focus.
194
+ */tabDate:{type:Object,required:false,default:void 0},/**
195
+ * Min date.
196
+ */minDate:{type:Object,required:true},/**
197
+ * Max date.
198
+ */maxDate:{type:Object,required:true}},emits:["click","change","update:modelValue"],methods:{onClickDay(date){this.$emit("click",date);},onChangeMonth(date){this.$emit("update:modelValue",date);this.$emit("change",date);}}});const _hoisted_1$K={class:"calendar__wrapper"};function _sfc_render$Q(_ctx,_cache,$props,$setup,$data,$options){const _component_i_calendar_navbar=resolveComponent("i-calendar-navbar");const _component_i_calendar_month=resolveComponent("i-calendar-month");return openBlock(),createElementBlock("div",_hoisted_1$K,[createVNode(_component_i_calendar_navbar,{"model-value":_ctx.modelValue,"min-date":_ctx.minDate,"max-date":_ctx.maxDate,"onUpdate:modelValue":_ctx.onChangeMonth},null,8,["model-value","min-date","max-date","onUpdate:modelValue"]),createTextVNode(),createVNode(_component_i_calendar_month,{"model-value":_ctx.modelValue,"min-date":_ctx.minDate,"max-date":_ctx.maxDate,"tab-date":_ctx.tabDate,onClick:_ctx.onClickDay,"onUpdate:modelValue":_ctx.onChangeMonth},{default:withCtx(({date,focused})=>[renderSlot(_ctx.$slots,"default",{date,isFocused:focused})]),_:3/* FORWARDED */},8,["model-value","min-date","max-date","tab-date","onClick","onUpdate:modelValue"])]);}const FCalendar=/* @__PURE__ */_export_sfc(_sfc_main$_,[["render",_sfc_render$Q]]);function getCalendarDaySrText(day,enabled,selected,t){const parts=[];if(!enabled){parts.push(t("fkui.calendar.day.unselectable","inte valbar"));}else if(selected){parts.push(t("fkui.calendar.day.selected","vald dag"));}const today=FDate.now();if(day.equals(today)){parts.push(t("fkui.calendar.day.today","idag"));}else if(day.equals(today.addDays(-1))){parts.push(t("fkui.calendar.day.yesterday","igår"));}else if(day.equals(today.addDays(1))){parts.push(t("fkui.calendar.day.tomorrow","imorgon"));}parts.push(day.toString(DateFormat.FULL));return parts.join(" ");}const _sfc_main$Z=defineComponent({name:"FCalendarDay",mixins:[TranslationMixin],props:{/**
199
+ * Day to render.
200
+ */day:{type:Object,required:true},/**
201
+ * Set to `true` if day is enabled.
202
+ */enabled:{type:Boolean,required:false,default:true},/**
203
+ * Set to `true` if day is focused.
204
+ */focused:{type:Boolean,required:false,default:false},/**
205
+ * Set to `true` if day is selected.
206
+ */selected:{type:Boolean,required:false,default:false},/**
207
+ * Set to `true` if day should be highlighted.
208
+ */highlight:{type:Boolean,required:false,default:false}},computed:{srText(){return getCalendarDaySrText(this.day,this.enabled,this.selected,this.$t);},dayClasses(){const component="calendar-day";const classes=[component];if(this.highlight){classes.push(`${component}--highlight`);}if(this.enabled){if(this.selected){classes.push(`${component}--selected`);}}else{classes.push(`${component}--disabled`);}return classes;}}});const _hoisted_1$J={"aria-hidden":"true"};const _hoisted_2$x={class:"sr-only"};function _sfc_render$P(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createElementBlock("span",{class:normalizeClass(_ctx.dayClasses)},[createElementVNode("span",_hoisted_1$J,toDisplayString(_ctx.day.day),1/* TEXT */),createTextVNode(),createElementVNode("span",_hoisted_2$x,toDisplayString(_ctx.srText),1/* TEXT */)],2/* CLASS */);}const FCalendarDay=/* @__PURE__ */_export_sfc(_sfc_main$Z,[["render",_sfc_render$P]]);function offset(page,el){const rect=el.getBoundingClientRect();return{top:rect.top+page.pageYOffset,left:rect.left+page.pageXOffset};}function getElement(anchor){if(!anchor){return null;}if(typeof anchor==="string"){return document.getElementById(anchor);}else{return anchor;}}var Placement=/* @__PURE__ */(Placement2=>{Placement2["A"]="A";Placement2["B"]="B";Placement2["C"]="C";Placement2["D"]="D";Placement2["E"]="E";Placement2["F"]="F";Placement2["G"]="G";Placement2["H"]="H";Placement2["I"]="I";Placement2["Fallback"]="Fallback";Placement2["NotCalculated"]="NotCalculated";return Placement2;})(Placement||{});var CandidateOrder=/* @__PURE__ */(CandidateOrder2=>{CandidateOrder2["Default"]="Default";CandidateOrder2["IPopupError"]="IPopupError";return CandidateOrder2;})(CandidateOrder||{});function getCandidates(anchor,target,clippedArea,spacing,candidateOrder){const dw=target.width-anchor.width;const a={placement:"A",x:anchor.x,y:anchor.y+anchor.height+spacing,width:target.width,height:target.height,direction:1/* Vertical */};const b={placement:"B",x:anchor.x-dw,y:anchor.y+anchor.height+spacing,width:target.width,height:target.height,direction:1/* Vertical */};const c={placement:"C",x:anchor.x,y:anchor.y-target.height-spacing,width:target.width,height:target.height,direction:1/* Vertical */};const d={placement:"D",x:anchor.x-dw,y:anchor.y-target.height-spacing,width:target.width,height:target.height,direction:1/* Vertical */};const e={placement:"E",x:anchor.x+anchor.width+spacing,y:anchor.y+anchor.height/2-target.height/2,width:target.width,height:target.height,direction:0/* Horizontal */};const f={placement:"F",x:anchor.x-(target.width+spacing),y:anchor.y+anchor.height/2-target.height/2,width:target.width,height:target.height,direction:0/* Horizontal */};const g={placement:"G",x:anchor.x+anchor.width+spacing,y:clippedArea.y+spacing,width:target.width,height:target.height,direction:2/* Both */};const h={placement:"H",x:anchor.x-(target.width+spacing),y:clippedArea.y+spacing,width:target.width,height:target.height,direction:2/* Both */};const i={placement:"I",x:clippedArea.x+(clippedArea.width-target.width)/2,y:clippedArea.y+(clippedArea.height-target.height)/2,width:target.width,height:target.height,direction:3/* None */};if(candidateOrder==="IPopupError"){return[b,a,d,c,e,f,f,f,f];}else{return[a,b,c,d,e,f,g,h,i];}}function isInside(outer,inner,spacing){const isHorizontalDirection=inner.direction===0||inner.direction===2;const xSpacing=isHorizontalDirection?spacing:0;const isVerticalDirection=inner.direction===1||inner.direction===2;const ySpacing=isVerticalDirection?spacing:0;const ax=[inner.x,inner.x+inner.width];const ay=[inner.y,inner.y+inner.height];const bx=[outer.x+xSpacing,outer.x+outer.width-xSpacing];const by=[outer.y+ySpacing,outer.y+outer.height-ySpacing];if(ax[0]<bx[0]||ax[1]>bx[1]){return false;}if(ay[0]<by[0]||ay[1]>by[1]){return false;}return true;}function isElementOptions(options){return options.target instanceof HTMLElement;}function clipRect(src,clip){if(!clip){return src;}const x=Math.max(src.x,clip.x);const y=Math.max(src.y,clip.y);const width=Math.min(src.x+src.width,clip.x+clip.width)-x;const height=Math.min(src.y+src.height,clip.y+clip.height)-y;return{x,y,width,height};}function getAbsolutePosition(src){if(!src){return void 0;}const isRoot=src.isSameNode(document.documentElement);if(isRoot){return{x:window.pageXOffset,y:window.pageYOffset,width:src.clientWidth,height:src.clientHeight};}const rect=src.getBoundingClientRect();return{x:Math.floor(rect.left+window.pageXOffset),y:Math.floor(rect.top+window.pageYOffset),width:Math.floor(rect.width),height:Math.floor(rect.height)};}function fitInsideArea(options){var _a;if(isElementOptions(options)){const{area:areaElement,anchor:anchorElement,target:targetElement,viewport:viewportElement,spacing:spacing2,candidateOrder}=options;const area2=getAbsolutePosition(areaElement);const anchor2=getAbsolutePosition(anchorElement);const target2=getAbsolutePosition(targetElement);const viewport2=getAbsolutePosition(viewportElement);const result=fitInsideArea({area:area2,target:target2,anchor:anchor2,viewport:viewport2,spacing:spacing2,candidateOrder});const offset2=(_a=targetElement.offsetParent)==null?void 0:_a.getBoundingClientRect();if(!offset2){return result;}return{...result,x:result.x-(offset2.left+window.pageXOffset),y:result.y-(offset2.top+window.pageYOffset)};}const{anchor,target,area,viewport,spacing}=options;const clippedArea=clipRect(area,viewport);const candidates=getCandidates(anchor,target,clippedArea,spacing,options.candidateOrder);const index=candidates.findIndex(it=>isInside(clippedArea,it,spacing));if(index>=0){const match=candidates[index];return{x:match.x,y:match.y,placement:match.placement};}return{...getFallbackPosition(anchor,target,clippedArea,spacing),placement:"Fallback"/* Fallback */};}function getScrollToPopup(param){const popupOffset=offset({pageXOffset:0,pageYOffset:param.scrollTop},param.popup);const popupHeight=param.popup.offsetHeight;const neededScroll=popupOffset.top-param.windowInnerHeight+popupHeight+param.spacing;if(neededScroll>param.scrollTop){return neededScroll;}else{return param.scrollTop;}}function getFallbackPosition(anchor,target,clippedArea,spacing){const x=anchor.x-(target.width+spacing);const y=anchor.y+anchor.height+spacing;if(x>=clippedArea.x){return{x,y};}else{return{x:clippedArea.x+spacing,y};}}function getContainer(element,prop){if(prop){return prop;}const parent=element.closest(".popup__container");if(parent){return parent;}return config.popupContainer;}function getFocusableElement(rootElement,callback){var _elements$;if(callback){return callback();}const popupElement=getHTMLElementFromVueRef(rootElement);const elements=findTabbableElements(popupElement);return(_elements$=elements[0])!==null&&_elements$!==void 0?_elements$:null;}const MIN_DESKTOP_WIDTH=640;const POPUP_SPACING$1=20;function isTeleportDisabled(options){const{window:window2,placement,forceInline,forceOverlay}=options;const isMobileSize=window2.innerWidth<MIN_DESKTOP_WIDTH;let disableTeleport=isMobileSize||placement===Placement.Fallback;if(forceInline){disableTeleport=true;}else if(forceOverlay){disableTeleport=false;}return disableTeleport;}const _sfc_main$Y=defineComponent({name:"IPopup",inheritAttrs:false,props:{/**
209
+ * Toggle open/closed popup.
210
+ */isOpen:{type:Boolean,required:true},/**
211
+ * DOM element to position popup at.
212
+ */anchor:{type:HTMLElement,required:false,default:void 0},/**
213
+ * Type of inline behaviour.
214
+ * - `"auto"` changes between overlay or inline depending on window size.
215
+ * - `"always"` forces the popup to always be inline.
216
+ * - `"never"` forces the popup to never be inline.
217
+ */inline:{type:String,required:false,validator(value){return["always","never","auto"].includes(value);},default:"auto"},/**
218
+ * Force popup to always display inline.
219
+ * @deprecated Use `inline="always"` instead.
220
+ */alwaysInline:{type:Boolean,required:false,default:false},/**
221
+ * Which element to use as container.
222
+ */container:{type:HTMLElement,required:false,default:void 0},/**
223
+ * Which element to use as viewport.
224
+ */viewport:{type:HTMLElement,required:false,default(){return document.documentElement;}},/**
225
+ * Prevents tabbing outside of component.
226
+ */keyboardTrap:{type:Boolean,required:false,default:true},/**
227
+ * Function that returns the element that will receive focus
228
+ */focusElement:{type:Function,required:false,default:null},/**
229
+ * Set focus on first tabbable element (or element in the `focusElement` prop if provided) when opened.
230
+ */setFocus:{type:Boolean,required:false,default:true}},emits:["open","close"],data(){return{teleportDisabled:false,placement:Placement.NotCalculated,focus:null,noCloseOnResize:false};},computed:{popupClasses(){let isInline=this.teleportDisabled||this.placement===Placement.Fallback;if(this.forceInline){isInline=true;}else if(this.forceOverlay){isInline=false;}const popupState=isInline?["popup--inline"]:["popup--overlay"];return["popup",...popupState];},forceInline(){return this.alwaysInline||this.inline==="always";},forceOverlay(){return this.inline==="never";},teleportTarget(){var _config$popupTarget;return(_config$popupTarget=config.popupTarget)!==null&&_config$popupTarget!==void 0?_config$popupTarget:config.teleportTarget;}},watch:{isOpen:{immediate:true,handler(value){this.toggleIsOpen(value);if(value){const{placement,forceInline,forceOverlay}=this;this.teleportDisabled=isTeleportDisabled({window,placement,forceInline,forceOverlay});setTimeout(()=>{if(this.isOpen){document.addEventListener("click",this.onDocumentClickHandler);window.addEventListener("resize",this.onWindowResizeHandler);}},0);}else{document.removeEventListener("click",this.onDocumentClickHandler);window.removeEventListener("resize",this.onWindowResizeHandler);}}}},unmounted(){document.removeEventListener("click",this.onDocumentClickHandler);window.removeEventListener("resize",this.onWindowResizeHandler);},methods:{async toggleIsOpen(isOpen){if(!isOpen){this.placement=Placement.NotCalculated;if(this.focus){popFocus(this.focus);this.focus=null;}return;}await this.$nextTick();const popup=this.$refs["popup"];const wrapper=this.$refs["wrapper"];const anchor=getElement(this.anchor);if(!anchor){throw new Error("No anchor element found");}const shouldCheckCandidates=this.forceOverlay||!(this.isMobileSize()||this.forceInline);if(shouldCheckCandidates){const area=getContainer(popup,this.container);const viewport=this.viewport;const result=fitInsideArea({area,anchor,target:wrapper,viewport,spacing:POPUP_SPACING$1,candidateOrder:CandidateOrder.Default});this.placement=result.placement;const useOverlay=this.forceOverlay||result.placement!==Placement.Fallback;if(useOverlay){wrapper.style.left=`${result.x}px`;wrapper.style.top=`${result.y}px`;this.applyFocus();this.$emit("open");return;}}this.noCloseOnResize=true;this.teleportDisabled=true;await new Promise(resolve=>setTimeout(resolve,200));const scrollTarget=popup.closest(".scroll-target");const hasScrollTarget=scrollTarget!==null;const top=getScrollToPopup({popup:wrapper,windowInnerHeight:window.innerHeight,scrollTop:hasScrollTarget?scrollTarget.scrollTop:window.scrollY,spacing:POPUP_SPACING$1});const scrollOptions={top,behavior:"smooth"};wrapper.style.removeProperty("left");wrapper.style.removeProperty("top");if(hasScrollTarget){scrollTarget.scrollTo(scrollOptions);}else{window.scrollTo(scrollOptions);}this.noCloseOnResize=false;this.applyFocus();this.$emit("open");},applyFocus(){if(this.setFocus){const wrapper=this.$refs["wrapper"];const focusableElement=getFocusableElement(wrapper,this.focusElement);this.focus=pushFocus(focusableElement);}},isMobileSize(){return window.innerWidth<MIN_DESKTOP_WIDTH;},onDocumentClickHandler(){this.$emit("close");},onWindowResizeHandler(){if(this.noCloseOnResize){return;}this.$emit("close");},onPopupClickHandler(event){event.stopPropagation();},onKeyEsc(){this.$emit("close");},onKeyTab(event){if(this.keyboardTrap){handleTab(event,this.$refs.wrapper);}}}});function _sfc_render$O(_ctx,_cache,$props,$setup,$data,$options){return _ctx.isOpen?(openBlock(),createBlock(Teleport,{key:0,to:_ctx.teleportTarget,disabled:_ctx.teleportDisabled},[createElementVNode("div",mergeProps({ref:"popup"},_ctx.$attrs,{class:_ctx.popupClasses}),[createElementVNode("div",{ref:"wrapper",role:"presentation",class:"popup__wrapper",onClick:_cache[0]||(_cache[0]=(...args)=>_ctx.onPopupClickHandler&&_ctx.onPopupClickHandler(...args)),onKeyup:_cache[1]||(_cache[1]=withKeys(withModifiers((...args)=>_ctx.onKeyEsc&&_ctx.onKeyEsc(...args),["stop"]),["esc"])),onKeydown:_cache[2]||(_cache[2]=withKeys((...args)=>_ctx.onKeyTab&&_ctx.onKeyTab(...args),["tab"]))},[renderSlot(_ctx.$slots,"default",normalizeProps(guardReactiveProps({toggleIsOpen:_ctx.toggleIsOpen,placement:_ctx.placement})))],544/* NEED_HYDRATION, NEED_PATCH */)],16/* FULL_PROPS */)],8,["to","disabled"])):createCommentVNode("v-if",true);}const IPopup=/* @__PURE__ */_export_sfc(_sfc_main$Y,[["render",_sfc_render$O]]);function isContextMenuTextItem(value){return typeof value.key==="string";}function isContextMenuSeparatorItem(value){return typeof value.separator==="boolean"&&value.separator;}function getNewItemIndexFromMenuAction$3(action,index,n){let newIndex;if(n<=0){return 0;}switch(action){case MenuAction.MOVE_NEXT:newIndex=(index+1)%n;break;case MenuAction.MOVE_PREV:newIndex=(index-1+n)%n;break;case MenuAction.MOVE_FIRST:newIndex=0;break;case MenuAction.MOVE_LAST:newIndex=Math.max(n-1,0);break;default:newIndex=index;}return newIndex;}async function doMenuAction$3(action,target){const itemsLength=target.popupItems.length;const currentIndex=target.currentFocusedItemIndex;const newFocusedItemIndex=getNewItemIndexFromMenuAction$3(action,currentIndex,itemsLength);switch(action){case MenuAction.MOVE_NEXT:case MenuAction.MOVE_PREV:case MenuAction.MOVE_FIRST:case MenuAction.MOVE_LAST:await target.setFocusOnItem(newFocusedItemIndex);break;case MenuAction.ACTIVATE:await target.activateItem(newFocusedItemIndex);break;}}const preventKeys$3=["Tab","Up","Down","ArrowUp","ArrowDown","Home","End"," ","Spacebar","Enter","Escape"];const keyUp$1=["ArrowUp","Up"];const _sfc_main$X=defineComponent({name:"FContextMenu",components:{IPopup,FIcon},props:{/**
231
+ * Toggle open/closed popup.
232
+ */isOpen:{type:Boolean,required:true},/**
233
+ * DOM element to position popup at.
234
+ */anchor:{type:HTMLElement,required:false,default:void 0},/**
235
+ * The items to be diplayed in the menu
236
+ */items:{type:Array,required:true},/**
237
+ * Unique accessible name for navigation landmark.
238
+ */ariaLabel:{type:String,required:false,default:"Kontextuell meny"}},emits:["close","select"],setup(){return{contextmenu:ref(null)};},data(){return{selectedItem:"",currentFocusedItemIndex:-1};},computed:{popupItems(){return this.items.filter(isContextMenuTextItem);},separatorPositions(){const res=[];if(this.items.length>1){this.items.forEach((it,i)=>{if(isContextMenuSeparatorItem(it)){const pos=i-1-res.length;if(pos>=0&&pos<this.items.length-1){res.push(pos);}}});}return res;},hasIcons(){return this.items.some(it=>isContextMenuTextItem(it)&&it.icon);}},watch:{isOpen:{immediate:true,async handler(){if(this.isOpen){this.currentFocusedItemIndex=-1;this.selectedItem="";}}}},methods:{hasSeparatorAfterItemAt(index){return this.separatorPositions.includes(index);},closePopup(){this.$emit("close");},onClickItem(item){if(isContextMenuTextItem(item)&&item.key){this.selectedItem=item.key;this.$emit("select",this.selectedItem);this.closePopup();}},tabIndex(index){return index===this.currentFocusedItemIndex?0:-1;},onKeyUp(event){if(preventKeys$3.includes(event.key)){event.preventDefault();}},doHandlePopupMenuTabKey(action){if(action===MenuAction.MOVE_NEXT&&this.currentFocusedItemIndex+1===this.popupItems.length){this.closePopup();return true;}else if(action===MenuAction.MOVE_PREV&&(this.currentFocusedItemIndex===0||this.currentFocusedItemIndex===-1)){this.closePopup();return false;}return false;},async onKeyDown(event){if(!preventKeys$3.includes(event.key)){return;}if(event.key==="Escape"){this.$emit("close");return;}const action=actionFromKeyboardEvent(event);if(action===null){return;}if(event.key==="Tab"&&this.doHandlePopupMenuTabKey(action)){return;}if(keyUp$1.includes(event.key)&&this.currentFocusedItemIndex===-1){this.currentFocusedItemIndex=this.popupItems.length>0?this.popupItems.length:1;}event.preventDefault();await doMenuAction$3(action,this);},async setFocusOnItem(index){if(index<0||index>=this.popupItems.length){return;}this.currentFocusedItemIndex=index;await this.$nextTick();if(!this.isOpen){return;}const items=getHTMLElementsFromVueRef(this.$refs.items);if(items.length>0){const popupMenuItem=items[index];focus$1(popupMenuItem,{preventScroll:true});}},async activateItem(index){if(index<0||index>=this.popupItems.length){return;}if(index!==this.currentFocusedItemIndex){await this.setFocusOnItem(index);}this.onClickItem(this.popupItems[this.currentFocusedItemIndex]);}}});const _hoisted_1$I=["aria-label"];const _hoisted_2$w={ref:"contextmenu",role:"menu",tabindex:"-1",class:"contextmenu__list"};const _hoisted_3$s=["onClick"];const _hoisted_4$n=["tabindex"];const _hoisted_5$l={key:0,class:"contextmenu__separator"};function _sfc_render$N(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");const _component_i_popup=resolveComponent("i-popup");return openBlock(),createBlock(_component_i_popup,{"is-open":_ctx.isOpen,"keyboard-trap":false,anchor:_ctx.anchor,"set-focus":true,"focus-element":()=>_ctx.contextmenu,inline:"never",onClose:_cache[2]||(_cache[2]=$event=>_ctx.$emit("close"))},{default:withCtx(()=>[createElementVNode("nav",{class:"contextmenu","aria-label":_ctx.ariaLabel,onKeyup:_cache[0]||(_cache[0]=(...args)=>_ctx.onKeyUp&&_ctx.onKeyUp(...args)),onKeydown:_cache[1]||(_cache[1]=(...args)=>_ctx.onKeyDown&&_ctx.onKeyDown(...args))},[createElementVNode("ul",_hoisted_2$w,[(openBlock(true),createElementBlock(Fragment,null,renderList(_ctx.popupItems,(item,index)=>{return openBlock(),createElementBlock("li",{key:item.key,role:"menuitem",onClick:$event=>_ctx.onClickItem(item)},[createElementVNode("div",{ref_for:true,ref:"items",tabindex:_ctx.tabIndex(index),class:"contextmenu__list__item"},[_ctx.hasIcons?(openBlock(),createBlock(_component_f_icon,{key:0,class:"contextmenu__lefticon",name:item.icon?item.icon:"",library:item.iconLibrary?item.iconLibrary:"f"},null,8,["name","library"])):createCommentVNode("v-if",true),createTextVNode(),createElementVNode("a",{ref_for:true,ref:"anchors"},toDisplayString(item.label),513/* TEXT, NEED_PATCH */)],8,_hoisted_4$n),createTextVNode(),_ctx.hasSeparatorAfterItemAt(index)?(openBlock(),createElementBlock("hr",_hoisted_5$l)):createCommentVNode("v-if",true)],8,_hoisted_3$s);}),128/* KEYED_FRAGMENT */))],512/* NEED_PATCH */)],40,_hoisted_1$I)]),_:1/* STABLE */},8,["is-open","anchor","focus-element"]);}const FContextMenu=/* @__PURE__ */_export_sfc(_sfc_main$X,[["render",_sfc_render$N]]);const anyType$1=[String,Object,Array,Number,Date,Boolean];const _sfc_main$W=defineComponent({name:"FCheckboxField",inheritAttrs:false,props:{/**
239
+ * Set to `true`, empty string `""` or string `"disabled"` to disable this input field.
240
+ */disabled:{type:Boolean,required:false,default:false},/**
241
+ * The id for the input id attribute.
242
+ * The id for the label for attribute.
243
+ * If the prop is not set a random value will be generated.
244
+ */id:{type:String,required:false,default:()=>ElementIdService.generateElementId()},/**
245
+ * The value for the input checked attribute.
246
+ * @model
247
+ */// ? The rule is disabled so that the `checked` prop can be undefined or null.
248
+ /* eslint-disable-next-line vue/require-default-prop -- technical debt,
249
+ /* it should contain a default value of undefined and proptype should
250
+ /* include undefined (see comment on line above) */modelValue:{type:anyType$1,required:false},/**
251
+ * The value for the input.
252
+ */value:{type:anyType$1,required:true}},emits:["change","update:modelValue"],setup(){return{showDetails:inject("showDetails","never"),getFieldsetLabelText:inject("getFieldsetLabelText",()=>"")};},data(){return{expanded:false,height:0,initialStyle:{overflow:"hidden",transition:"height 400ms cubic-bezier(0.46, 0.03, 0.52, 0.96)"},hiddenStyle:{height:"auto",position:"absolute",visibility:"hidden"},visibleStyle:{width:"",position:"",visibility:"",height:"0px"},openedStyle:{height:"auto"}};},computed:{attrs(){let checked;if(Array.isArray(this.modelValue)){checked=this.modelValue.findIndex(it=>isEqual$2(toValue(it),toValue(this.value)))>=0;}else{checked=this.value===this.modelValue;}return{...this.$attrs,value:this.value,checked,onChange:event=>{if(event.target instanceof HTMLInputElement){this.emitVModelEvent(event);}},onInput:event=>{event.target.focus();}};},disabledClass(){return this.disabled?"disabled":"";},// eslint-disable-next-line @typescript-eslint/no-explicit-any -- technical debt, nore sure whats going on here
253
+ injected(){return this;}},methods:{updateExpandedFlag(){const checkboxInput=getHTMLElementFromVueRef(this.$refs["checkboxInput"]);this.expanded=checkboxInput.checked;},emitVModelEvent(event){let newModel;if(Array.isArray(this.modelValue)){newModel=[...this.modelValue].filter(it=>!isEqual$2(toValue(it),toValue(this.value)));if(this.modelValue.length<=newModel.length){newModel.push(this.value);}}else{if(this.value===this.modelValue){newModel=typeof this.value==="boolean"?false:void 0;}else{const target=event.target;newModel=target.value==="true"?true:this.value;}}this.$emit("update:modelValue",newModel);this.$emit("change",newModel);},onKeydown(event){event.stopPropagation();},onValidity({detail}){if(detail.target!==this.$el.querySelector("input")){return;}let errorMessage="";if(hasSlot(this,"default")){const labelText=this.injected.getFieldsetLabelText();if(labelText){errorMessage=`${labelText} ${renderSlotText(this.$slots.default)}`;}else{errorMessage=`${renderSlotText(this.$slots.default)}`;}}const element=this.$el.querySelector(`#${detail.elementId}`);if(element){dispatchComponentValidityEvent(element,{...detail,errorMessage,focusElementId:detail.elementId});}},enter(element){const htmlElement=getHTMLElementFromVueRef(element);const computedStyle=getComputedStyle(element);Object.assign(htmlElement.style,this.initialStyle);Object.assign(htmlElement.style,this.hiddenStyle);htmlElement.style.width=computedStyle.width;const height=computedStyle.height;Object.assign(htmlElement.style,this.visibleStyle);getComputedStyle(element).height;setTimeout(()=>{this.height=parseInt(height,10);htmlElement.style.height=height;});},afterEnter(element){const htmlElement=getHTMLElementFromVueRef(element);Object.assign(htmlElement.style,this.openedStyle);},leave(element){const htmlElement=getHTMLElementFromVueRef(element);const height=getComputedStyle(element).height;htmlElement.style.height=height;getComputedStyle(element).height;setTimeout(()=>{Object.assign(htmlElement.style,this.visibleStyle);});}}});const _hoisted_1$H=["id","disabled"];const _hoisted_2$v=["for"];const _hoisted_3$r={key:0,class:"checkbox__details"};const _hoisted_4$m=/* @__PURE__ */createElementVNode("br",null,null,-1/* HOISTED */);const _hoisted_5$k={key:0,class:"checkbox__details"};const _hoisted_6$h=/* @__PURE__ */createElementVNode("br",null,null,-1/* HOISTED */);function _sfc_render$M(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createElementBlock("div",{class:normalizeClass(["checkbox",_ctx.disabledClass]),onValidity:_cache[2]||(_cache[2]=(...args)=>_ctx.onValidity&&_ctx.onValidity(...args))},[createElementVNode("input",mergeProps({id:_ctx.id},_ctx.attrs,{ref:"checkboxInput",type:"checkbox",class:"checkbox__input",disabled:_ctx.disabled,onKeydown:_cache[0]||(_cache[0]=withKeys((...args)=>_ctx.onKeydown&&_ctx.onKeydown(...args),["space"])),onChange:_cache[1]||(_cache[1]=$event=>_ctx.updateExpandedFlag())}),null,16,_hoisted_1$H),createTextVNode(),createElementVNode("label",{class:normalizeClass(_ctx.$slots.details?"checkbox__label checkbox__width":"checkbox__label"),for:_ctx.id},[renderSlot(_ctx.$slots,"default"),createTextVNode(),_ctx.$slots.details?(openBlock(),createElementBlock(Fragment,{key:0},[_ctx.showDetails==="always"?(openBlock(),createElementBlock("span",_hoisted_3$r,[_hoisted_4$m,createTextVNode(),renderSlot(_ctx.$slots,"details")])):createCommentVNode("v-if",true),createTextVNode(),_ctx.showDetails==="when-selected"?(openBlock(),createBlock(Transition,{key:1,onEnter:_ctx.enter,onAfterEnter:_ctx.afterEnter,onLeave:_ctx.leave},{default:withCtx(()=>[_ctx.expanded?(openBlock(),createElementBlock("span",_hoisted_5$k,[_hoisted_6$h,createTextVNode(),renderSlot(_ctx.$slots,"details",{height:_ctx.height})])):createCommentVNode("v-if",true)]),_:3/* FORWARDED */},8,["onEnter","onAfterEnter","onLeave"])):createCommentVNode("v-if",true)],64/* STABLE_FRAGMENT */)):createCommentVNode("v-if",true)],10,_hoisted_2$v)],34/* CLASS, NEED_HYDRATION */);}const FCheckboxField=/* @__PURE__ */_export_sfc(_sfc_main$W,[["render",_sfc_render$M]]);const getFieldsetLabelText=Symbol("getFieldsetLabelText");function*labelClasses(options){const{labelClass}=options;yield"fieldset__label";yield labelClass;}function*contentClasses(options){const{hasRadiobutton,hasCheckbox,contentClass}=options;yield"fieldset__content";if(hasRadiobutton){yield"radio-button-group__content";}if(hasCheckbox){yield"checkbox-group__content";}yield contentClass;}const _sfc_main$V=defineComponent({name:"FFieldset",components:{FIcon},mixins:[TranslationMixin],provide(){return{[getFieldsetLabelText]:()=>{return renderSlotText(this.$slots.label);},sharedName:this.name,showDetails:this.showDetails};},props:{/**
254
+ * The id for the fieldset id attribute.
255
+ * If the prop is not set a random value will be generated.
256
+ */id:{type:String,required:false,default:()=>ElementIdService.generateElementId()},/**
257
+ * Name provided to child content as `sharedName` for optional usage (it will not be set on the fieldset element).
258
+ * For radio inputs this is a shortcut to specify the shared name attribute at one place,
259
+ * instead of repeatedly setting the name attribute on each radio input.
260
+ */name:{type:String,required:false,default:void 0},/**
261
+ * The CSS classes for the label, description and error-message slot.
262
+ */labelClass:{type:String,required:false,default:""},/**
263
+ * The CSS classes for the default slot.
264
+ */contentClass:{type:String,required:false,default:""},/**
265
+ * Aligns underlying items horizontally.
266
+ * Supported by radiobuttons and chip layout.
267
+ */horizontal:{type:Boolean,required:false},/**
268
+ * Displays radio and checkbox content with chip layout.
269
+ */chip:{type:Boolean,required:false,default:false},/**
270
+ * Displays a box with border around radiobuttons and checkboxes.
271
+ */border:{type:Boolean,required:false},/**
272
+ * Sets visibility behaviour for details slot in selectable child items. By default details slot is not rendered.
273
+ *
274
+ * * `never` (default) - Never show item details.
275
+ * - `when-selected` - Show item details when selected.
276
+ * - `always` - Always show item details.
277
+ */showDetails:{type:String,default:"never",validator(value){return["never","when-selected","always"].includes(value);}}},data(){return{validity:{validityMode:"INITIAL"},descriptionClass:["label__description"],discreteDescriptionClass:["label__description","label__description--discrete"],validityElement:null,dispatchObject:{},detail:{},hasDocumentListener:false,legendKey:1,oldMessage:"",children:new Array(),hasCheckbox:false,hasRadiobutton:false};},computed:{hasError(){return this.validity.validityMode==="ERROR";},hasErrorMessageSlot(){return hasSlot(this,"error-message");},hasTooltipSlot(){return Boolean(this.$slots.tooltip);},hasDescriptionSlot(){return hasSlot(this,"description");},legendClass(){return this.hasTooltipSlot?["sr-only"]:this.groupLabelClass;},groupLabelClass(){return Array.from(labelClasses(this));},groupContentClass(){return Array.from(contentClasses(this));},classes(){const{hasRadiobutton,hasCheckbox,horizontal,chip,border}=this;return{"radio-button-group":hasRadiobutton,"radio-button-group--chip":chip&&hasRadiobutton,"radio-button-group--horizontal":horizontal&&hasRadiobutton,"radio-button-group--border":border&&hasRadiobutton,"checkbox-group":hasCheckbox,"checkbox-group--chip":chip&&hasCheckbox,"checkbox-group--horizontal":horizontal&&hasCheckbox,"checkbox-group--border":border&&hasCheckbox};},checkedChildren(){return this.children.filter(child=>child.checked);},debouncedUpdateChildren(){return debounce(this.updateCheckboxChildren.bind(this),150);},checkboxCheckedScreenReaderText(){return this.checkedChildren.length===1?this.$t("fkui.checkbox-group.checkbox.checked","Kryssruta kryssad"):this.$t("fkui.checkbox-group.checkbox.not.checked","Kryssruta ej kryssad");},numberOfCheckboxesScreenReaderText(){return this.$t("fkui.checkbox-group.count","Grupp med {{ count }} kryssrutor",{count:String(this.children.length)});},numberOfCheckedCheckboxesScreenText(){return this.$t("fkui.checkbox-group.checked","{{ checked }} kryssad av {{ count }}",{checked:String(this.checkedChildren.length),count:String(this.children.length)});}},async mounted(){await this.$nextTick();const types=Array.from(this.$el.querySelectorAll(`input[type="checkbox"], input[type="radio"]`),it=>it.getAttribute("type"));this.hasCheckbox=types.includes("checkbox");this.hasRadiobutton=types.includes("radio");if(this.hasCheckbox){this.updateCheckboxChildren();}},updated(){if(this.hasCheckbox){this.debouncedUpdateChildren();}},methods:{async onValidity({detail}){var _renderSlotText2;if(detail.target!==this.$el){return;}this.detail=detail;await this.$nextTick();const errorMessage=(_renderSlotText2=renderSlotText(this.$slots.label))!==null&&_renderSlotText2!==void 0?_renderSlotText2:"";const firstFocusableElement=this.$el.querySelector("input:not(disabled), select:not(disabled), textarea:not(disabled)");const focusElementId=firstFocusableElement?firstFocusableElement.id:this.id;this.validityElement=this.$el;this.dispatchObject={...detail,errorMessage,focusElementId};this.validity=this.detail;if(this.validityElement){dispatchComponentValidityEvent(this.validityElement,this.dispatchObject);}const message=detail.validityMode==="INITIAL"?"":detail.validationMessage;if(message!==this.oldMessage){this.forceLegendUpdate();this.oldMessage=message;}},/**
278
+ * Workaround for NVDA-bug. Force re rendering of legend element due to NVDA not recognizing innerHTML changes.
279
+ * NVDA has closed the bug as it is related to the browser (works in FF): https://github.com/nvaccess/nvda/issues/13162
280
+ */forceLegendUpdate(){this.legendKey++;},async updateCheckboxChildren(){await this.$nextTick();this.children=Array.from(this.$el.querySelectorAll('input[type="checkbox"]'));}}});const _hoisted_1$G=["id"];const _hoisted_2$u={key:0,class:"sr-only"};const _hoisted_3$q={key:0,class:"label__message label__message--error"};const _hoisted_4$l={key:0,"data-test":"checked-boxes",class:"sr-only","aria-live":"polite"};const _hoisted_5$j={key:0};const _hoisted_6$g={key:1};const _hoisted_7$d={class:"sr-separator"};const _hoisted_8$9={class:"tooltip-before","aria-hidden":"true"};const _hoisted_9$5={class:"label tooltip-before__label"};const _hoisted_10$5={key:0,class:"label__message label__message--error"};function _sfc_render$L(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");return openBlock(),createElementBlock("fieldset",{id:_ctx.id,class:normalizeClass(["fieldset",_ctx.classes]),onValidity:_cache[0]||(_cache[0]=(...args)=>_ctx.onValidity&&_ctx.onValidity(...args))},[(openBlock(),createElementBlock("legend",{key:_ctx.legendKey,class:normalizeClass(["label",_ctx.legendClass])},[renderSlot(_ctx.$slots,"label"),createTextVNode(),_ctx.hasCheckbox&&_ctx.children.length>1?(openBlock(),createElementBlock("span",_hoisted_2$u,[createElementVNode("span",null,toDisplayString(_ctx.numberOfCheckboxesScreenReaderText),1/* TEXT */)])):createCommentVNode("v-if",true),createTextVNode(),renderSlot(_ctx.$slots,"description",normalizeProps(guardReactiveProps({descriptionClass:_ctx.descriptionClass,discreteDescriptionClass:_ctx.discreteDescriptionClass}))),createTextVNode(),renderSlot(_ctx.$slots,"error-message",normalizeProps(guardReactiveProps({hasError:_ctx.hasError,validationMessage:_ctx.validity.validationMessage})),()=>[_ctx.hasError?(openBlock(),createElementBlock("span",_hoisted_3$q,[createVNode(_component_f_icon,{class:"label__icon--left",name:"error"}),createTextVNode(" "+toDisplayString(_ctx.validity.validationMessage),1/* TEXT */)])):createCommentVNode("v-if",true)])],2/* CLASS */)),createTextVNode(),_ctx.hasCheckbox?(openBlock(),createElementBlock("span",_hoisted_4$l,[_ctx.children.length===1?(openBlock(),createElementBlock("span",_hoisted_5$j,toDisplayString(_ctx.checkboxCheckedScreenReaderText),1/* TEXT */)):(openBlock(),createElementBlock("span",_hoisted_6$g,toDisplayString(_ctx.numberOfCheckedCheckboxesScreenText),1/* TEXT */))])):createCommentVNode("v-if",true),createTextVNode(),_ctx.hasTooltipSlot?(openBlock(),createElementBlock(Fragment,{key:1},[createElementVNode("div",_hoisted_7$d,[createElementVNode("div",_hoisted_8$9,[createElementVNode("div",_hoisted_9$5,[renderSlot(_ctx.$slots,"label")])]),createTextVNode(),renderSlot(_ctx.$slots,"tooltip")]),createTextVNode(),_ctx.hasDescriptionSlot||_ctx.hasErrorMessageSlot||_ctx.hasError?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(["label",_ctx.groupLabelClass]),"aria-hidden":"true"},[renderSlot(_ctx.$slots,"description",normalizeProps(guardReactiveProps({descriptionClass:_ctx.descriptionClass,discreteDescriptionClass:_ctx.discreteDescriptionClass}))),createTextVNode(),renderSlot(_ctx.$slots,"error-message",normalizeProps(guardReactiveProps({hasError:_ctx.hasError,validationMessage:_ctx.validity.validationMessage})),()=>[_ctx.hasError?(openBlock(),createElementBlock("span",_hoisted_10$5,[createVNode(_component_f_icon,{class:"label__icon--left",name:"error"}),createTextVNode(" "+toDisplayString(_ctx.validity.validationMessage),1/* TEXT */)])):createCommentVNode("v-if",true)])],2/* CLASS */)):createCommentVNode("v-if",true)],64/* STABLE_FRAGMENT */)):createCommentVNode("v-if",true),createTextVNode(),createElementVNode("div",{class:normalizeClass(_ctx.groupContentClass)},[renderSlot(_ctx.$slots,"default")],2/* CLASS */)],42,_hoisted_1$G);}const FFieldset=/* @__PURE__ */_export_sfc(_sfc_main$V,[["render",_sfc_render$L]]);const _sfc_main$U=defineComponent({name:"FCheckboxGroup",components:{FFieldset},mixins:[TranslationMixin],inheritAttrs:false,props:{/**
281
+ * The id for the fieldset id attribute.
282
+ * If the prop is not set the id will be generated.
283
+ */id:{type:String,required:false,default:()=>ElementIdService.generateElementId()},/**
284
+ * The name of the checkbox group.
285
+ */name:{type:String,required:true}}});function _sfc_render$K(_ctx,_cache,$props,$setup,$data,$options){const _component_f_fieldset=resolveComponent("f-fieldset");return openBlock(),createBlock(_component_f_fieldset,mergeProps({id:_ctx.id,name:_ctx.name},_ctx.$attrs),createSlots({label:withCtx(()=>[renderSlot(_ctx.$slots,"label")]),description:withCtx(({descriptionClass,discreteDescriptionClass})=>[renderSlot(_ctx.$slots,"description",normalizeProps(guardReactiveProps({descriptionClass,discreteDescriptionClass})))]),"error-message":withCtx(()=>[renderSlot(_ctx.$slots,"error-message")]),default:withCtx(()=>[createTextVNode(),createTextVNode(),createTextVNode(),createTextVNode(),renderSlot(_ctx.$slots,"default")]),_:2/* DYNAMIC */},[_ctx.$slots.tooltip?{name:"tooltip",fn:withCtx(()=>[renderSlot(_ctx.$slots,"tooltip")]),key:"0"}:void 0]),1040,["id","name"]);}const FCheckboxGroup=/* @__PURE__ */_export_sfc(_sfc_main$U,[["render",_sfc_render$K]]);var Operation=/* @__PURE__ */(Operation2=>{Operation2[Operation2["ADD"]=0]="ADD";Operation2[Operation2["DELETE"]=1]="DELETE";Operation2[Operation2["MODIFY"]=2]="MODIFY";Operation2[Operation2["NONE"]=3]="NONE";return Operation2;})(Operation||{});const _sfc_main$T=defineComponent({name:"FCrudDataset",components:{FFormModal,FConfirmModal,FIcon},mixins:[TranslationMixin],provide(){return{delete:item=>{this.deleteItem(item);},modify:item=>{this.updateItem(item);},registerCallbackAfterItemAdd:callback=>{this.callbackAfterItemAdd=callback;},registerCallbackBeforeItemDelete:callback=>{this.callbackBeforeItemDelete=callback;}};},props:{/**
286
+ * The list of items that should be deleted, modified or added to.
287
+ * If the prop is not set an empty array will be used.
288
+ * @model
289
+ */modelValue:{type:Array,required:false,default:()=>[]},/**
290
+ * A function that returns an item to the #add template. Can be used to populate data that the user should not input themself e.g. an id.
291
+ * Or to give the user suggestions for inputs. If the prop is not used an empty item will be returned.
292
+ */beforeCreate:{type:Function,required:false,default:void 0},/**
293
+ * If `true` the primary button in the modals will be placed to the right side instead of to the left.
294
+ */primaryButtonRight:{type:Boolean,default:false},/**
295
+ * If given, this function is called before the [[submit]] event is emitted.
296
+ * See <f-validation-form> `beforeSubmit` props for more info.
297
+ */beforeSubmit:{type:Function,required:false,default(){}},/**
298
+ * If given, this function is called before the form data is validated and the [[submit]] event is emitted.
299
+ * See <f-validation-form> `beforeValidation` props for more info.
300
+ */beforeValidation:{type:Function,required:false,default(){}},/**
301
+ * If given, this function is called after the modal has been closed.
302
+ */onCancel:{type:Function,required:false,default(){return void 0;}},/**
303
+ * Property for changing the "add new" modal heading
304
+ */addNewModalHeader:{type:String,required:false,default:TranslationService.provider.translate("fkui.crud-dataset.modal.header.add","Lägg till rad")},/**
305
+ * Property for changing the "modify" modal heading
306
+ */modifyModalHeader:{type:String,required:false,default:TranslationService.provider.translate("fkui.crud-dataset.modal.header.modify","Ändra rad")},/**
307
+ * Property for changing the "delete" modal heading
308
+ */deleteModalHeader:{type:String,required:false,default:TranslationService.provider.translate("fkui.crud-dataset.modal.header.delete","Är du säker på att du vill ta bort raden?")}},emits:["change","created","deleted","updated","update:modelValue"],data(){return{result:[],Operation,operation:3,item:null,originalItemToUpdate:null,isFormModalOpen:false,isConfirmModalOpen:false,callbackAfterItemAdd(){},callbackBeforeItemDelete(){}};},computed:{confirmButtonText(){return this.operation===0?this.$t("fkui.crud-dataset.modal.confirm.add","Lägg till"):this.$t("fkui.crud-dataset.modal.confirm.modify","Spara");},cancelButtonText(){return this.operation===0?this.$t("fkui.crud-dataset.modal.cancel.add","Avbryt"):this.$t("fkui.crud-dataset.modal.cancel.modify","Avbryt");},confirmDeleteButtons(){return[{label:this.$t("fkui.crud-dataset.modal.confirm.delete","Ja, ta bort"),type:"primary",event:"confirm"},{label:this.$t("fkui.crud-dataset.modal.cancel.delete","Nej, avbryt"),type:"secondary"}];},hasAddSlot(){return Boolean(this.$slots.add);},hasDeleteSlot(){return Boolean(this.$slots.delete);},hasModifySlot(){return Boolean(this.$slots.modify);},formModalHeader(){return this.operation===0?this.addNewModalHeader:this.modifyModalHeader;}},watch:{modelValue:{immediate:true,deep:true,handler(data){this.result=[...data];}}},mounted(){if(!this.hasAddSlot&&!this.hasDeleteSlot&&!this.hasModifySlot){throw Error("Atleast one template of the following must be defined. #add, #delete or #modify");}},methods:{createItem(){if(!this.hasAddSlot){throw Error("No template is defined for #add");}this.operation=0;this.item=this.beforeCreate?this.beforeCreate():{};this.isFormModalOpen=true;},deleteItem(item){if(!this.hasDeleteSlot){throw Error("No template is defined for #delete");}this.operation=1;this.item=item;this.isConfirmModalOpen=true;},onDeleteConfirm(){if(!this.item){return;}this.callbackBeforeItemDelete(this.item);this.result=this.result.filter(item=>item!==this.item);this.$emit("deleted",this.item);this.$emit("update:modelValue",this.result);this.$emit("change",this.result);alertScreenReader(this.$t("fkui.crud-dataset.aria-live.delete","Raden har tagits bort"),{assertive:true});},onDeleteClose(e){this.onModalClose();if(e.reason==="close"&&this.onCancel){this.onCancel();}},onModalClose(){this.isFormModalOpen=false;this.isConfirmModalOpen=false;},onFormModalSubmit(){if(!this.item){return;}if(this.operation===0){this.result.push(this.item);this.$emit("created",this.item);this.$emit("update:modelValue",this.result);this.$emit("change",this.result);this.callbackAfterItemAdd(this.item);alertScreenReader(this.$t("fkui.crud-dataset.aria-live.add","En rad har lagts till"),{assertive:true});}else if(this.operation===2){if(this.originalItemToUpdate){Object.assign(this.originalItemToUpdate,this.item);}else{this.originalItemToUpdate=this.item;}this.$emit("updated",this.originalItemToUpdate);this.$emit("update:modelValue",this.result);this.$emit("change",this.result);alertScreenReader(this.$t("fkui.crud-dataset.aria-live.modify","Raden har ändrats"),{assertive:true});}this.isFormModalOpen=false;},updateItem(item){if(!this.hasModifySlot){throw Error("No template is defined for #modify");}this.operation=2;this.originalItemToUpdate=item;this.item=deepClone(item);this.isFormModalOpen=true;}}});const _hoisted_1$F={class:"crud-dataset"};const _hoisted_2$t={key:0};function _sfc_render$J(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");const _component_f_form_modal=resolveComponent("f-form-modal");const _component_f_confirm_modal=resolveComponent("f-confirm-modal");return openBlock(),createElementBlock("div",_hoisted_1$F,[renderSlot(_ctx.$slots,"default"),createTextVNode(),_ctx.hasAddSlot?(openBlock(),createElementBlock("div",_hoisted_2$t,[createElementVNode("button",{"data-test":"f-crud-dataset-add-button",type:"button",class:"button button--discrete crud-dataset__add-button",onClick:_cache[0]||(_cache[0]=$event=>_ctx.createItem())},[createVNode(_component_f_icon,{class:"button__icon",name:"plus"}),createTextVNode(),renderSlot(_ctx.$slots,"add-button",{},()=>[createTextVNode(toDisplayString(_ctx.$t("fkui.crud-dataset.button.add","Lägg till ny")),1/* TEXT */)])])])):createCommentVNode("v-if",true),createTextVNode(),createVNode(_component_f_form_modal,{"is-open":_ctx.isFormModalOpen,"aria-close-text":_ctx.$t("fkui.crud-dataset.modal.close","Stäng"),"use-error-list":false,"before-submit":_ctx.beforeSubmit,"before-validation":_ctx.beforeValidation,"on-cancel":_ctx.onCancel,onClose:_ctx.onModalClose,onCancel:_ctx.onCancel,onSubmit:_ctx.onFormModalSubmit},{header:withCtx(()=>[createTextVNode(toDisplayString(_ctx.formModalHeader),1/* TEXT */)]),"input-text-fields":withCtx(()=>[_ctx.operation===_ctx.Operation.ADD?renderSlot(_ctx.$slots,"add",normalizeProps(mergeProps({key:0},{item:_ctx.item}))):createCommentVNode("v-if",true),createTextVNode(),_ctx.operation===_ctx.Operation.MODIFY?renderSlot(_ctx.$slots,"modify",normalizeProps(mergeProps({key:1},{item:_ctx.item}))):createCommentVNode("v-if",true)]),"submit-button-text":withCtx(()=>[createTextVNode(toDisplayString(_ctx.confirmButtonText),1/* TEXT */)]),"cancel-button-text":withCtx(()=>[createTextVNode(toDisplayString(_ctx.cancelButtonText),1/* TEXT */)]),_:3/* FORWARDED */},8,["is-open","aria-close-text","before-submit","before-validation","on-cancel","onClose","onCancel","onSubmit"]),createTextVNode(),createVNode(_component_f_confirm_modal,{"is-open":_ctx.isConfirmModalOpen,buttons:_ctx.confirmDeleteButtons,onConfirm:_ctx.onDeleteConfirm,onClose:_ctx.onDeleteClose},{heading:withCtx(()=>[createTextVNode(toDisplayString(_ctx.deleteModalHeader),1/* TEXT */)]),content:withCtx(()=>[renderSlot(_ctx.$slots,"delete",normalizeProps(guardReactiveProps({item:_ctx.item})))]),_:3/* FORWARDED */},8,["is-open","buttons","onConfirm","onClose"])]);}const FCrudDataset=/* @__PURE__ */_export_sfc(_sfc_main$T,[["render",_sfc_render$J]]);function FCrudDatasetInjected(){return{delete:inject("delete"),modify:inject("modify")};}const _sfc_main$S=defineComponent({name:"FCrudButton",components:{FIcon},mixins:[TranslationMixin],props:{action:{type:String,required:true,validator(value){return["delete","modify"].includes(value);}},icon:{type:Boolean,default:false},item:{type:Object,required:true},label:{type:Boolean,default:false}},setup(){return FCrudDatasetInjected();},computed:{iconName(){if(this.action==="delete"){return"trashcan";}else{return"pen";}},buttonText(){if(this.action==="delete"){return this.$t("fkui.crud-button.delete","Ta bort");}else{return this.$t("fkui.crud-button.modify","Ändra");}}},methods:{executeAction(){if(this.action==="delete"){this.delete(this.item);}else{this.modify(this.item);}}}});const _hoisted_1$E={key:1,class:"sr-only"};function _sfc_render$I(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");return openBlock(),createElementBlock("button",{type:"button",class:"button button--discrete",onClick:_cache[0]||(_cache[0]=(...args)=>_ctx.executeAction&&_ctx.executeAction(...args))},[_ctx.icon?(openBlock(),createBlock(_component_f_icon,{key:0,class:"button__icon",name:_ctx.iconName},null,8,["name"])):createCommentVNode("v-if",true),createTextVNode(),!_ctx.label?(openBlock(),createElementBlock("span",_hoisted_1$E,[renderSlot(_ctx.$slots,"default",{},()=>[createTextVNode(toDisplayString(_ctx.buttonText),1/* TEXT */)])])):createCommentVNode("v-if",true),createTextVNode(),_ctx.label?renderSlot(_ctx.$slots,"default",{key:2},()=>[createTextVNode(toDisplayString(_ctx.buttonText),1/* TEXT */)]):createCommentVNode("v-if",true)]);}const FCrudButton=/* @__PURE__ */_export_sfc(_sfc_main$S,[["render",_sfc_render$I]]);function ActivateItemInjected(){return{registerCallbackAfterItemAdd:inject("registerCallbackAfterItemAdd",()=>void 0),registerCallbackBeforeItemDelete:inject("registerCallbackBeforeItemDelete",()=>void 0)};}var FTableColumnType=/* @__PURE__ */(FTableColumnType2=>{FTableColumnType2["TEXT"]="text";FTableColumnType2["DATE"]="date";FTableColumnType2["NUMERIC"]="numeric";FTableColumnType2["ACTION"]="action";return FTableColumnType2;})(FTableColumnType||{});var FTableColumnSize=/* @__PURE__ */(FTableColumnSize2=>{FTableColumnSize2["EXPAND"]="table__column--expand";FTableColumnSize2["SHRINK"]="table__column--shrink";return FTableColumnSize2;})(FTableColumnSize||{});var FTableColumnSort=/* @__PURE__ */(FTableColumnSort2=>{FTableColumnSort2["UNSORTED"]="unsorted";FTableColumnSort2["ASCENDING"]="ascending";FTableColumnSort2["DESCENDING"]="descending";return FTableColumnSort2;})(FTableColumnSort||{});function addColumn(src,column){if(!src.some(col=>col.name===column.name)){return[...src,column];}return src;}function setVisibilityColumn(src,id,visible){const column=src.find(col=>col.name===id);if(column){column.visible=visible;}}function updateSortOrder(src,columnName,ascending){src.forEach(column=>{if(column.name===columnName){column.sort=ascending?"ascending":"descending";}else{column.sort="unsorted";}});}function setSortableColumns(src,columnNames){for(const columnName of columnNames){const foundColumn=src.find(col=>col.name===columnName);if(foundColumn){foundColumn.sortable=true;}}}function getSortableIconName(column){switch(column.sort){case"unsorted":return"sort";case"ascending":return"caret-up";case"descending":return"caret-down";default:return"";}}function getSortableIconClasses(column){const classes=["table__column__header__icon"];if(column.sort==="unsorted"){classes.push("table__column__header__icon--discrete");}return classes;}function isTableColumnType(value){return["text","date","numeric","action"].includes(value);}function FTableInjected(){return{addColumn:inject("addColumn"),setVisibilityColumn:inject("setVisibilityColumn"),textFieldTableMode:true};}const _sfc_main$R=defineComponent({name:"FTableColumn",inheritAttrs:false,props:{/**
309
+ * Unique (per-table) identifier.
310
+ *
311
+ * Typically set to the row property displayed but any unique string can
312
+ * be used.
313
+ */name:{type:String,required:true},/**
314
+ * If set to true, display the column, set to false to hide it.
315
+ */visible:{type:Boolean,default:true},/**
316
+ * If `true` this cell will be a row header (`<th>` as opposed to
317
+ * `<td>`).
318
+ */rowHeader:{type:Boolean,required:false,default:false},/**
319
+ * Text to show in column header. In order to force newlines use `\n`.
320
+ */title:{type:String,required:true},/**
321
+ * Additional column description.
322
+ */description:{type:String,required:false,default:""},/**
323
+ * Set this column to shrink as small as possible.
324
+ *
325
+ * Cannot be combined with `expand`
326
+ */shrink:{type:Boolean,required:false,default:false},/**
327
+ * Set this column to expand as large as possible.
328
+ *
329
+ * Cannot be combined with `shrink`
330
+ *
331
+ * Default if neither `expand` or `shrink` is set.
332
+ */expand:{type:Boolean,required:false,default:false},/**
333
+ * Type of data the rows contains.
334
+ *
335
+ * Applies proper alignment and some styling (e.g. "numeric" uses fixed
336
+ * width numbers).
337
+ *
338
+ * Can be one of the following values:
339
+ *
340
+ * - `"text"`: regular text data (default)
341
+ * - `"date"`: date (should be YYYY-MM-DD)
342
+ * - `"numeric"`: numeric data
343
+ * - `"action"`: buttons to perform actions on row
344
+ */type:{type:String,required:false,default:FTableColumnType.TEXT,validator(value){return isTableColumnType(value);}}},setup(){return FTableInjected();},computed:{classes(){return["table__column",`table__column--${this.type}`];},scope(){return this.rowHeader?"row":null;},tagName(){if(this.rowHeader){return"th";}else{return"td";}}},watch:{visible:{handler:function(){this.setVisibilityColumn(this.name,this.visible);}}},created(){if(this.shrink&&this.expand){throw new Error("Table cannot have both shrink and expand enabled at the same time");}const size=this.shrink?FTableColumnSize.SHRINK:FTableColumnSize.EXPAND;this.addColumn({name:this.name,title:this.title,description:this.description||void 0,id:ElementIdService.generateElementId("column"),size,type:this.type,visible:this.visible,sortable:false,sort:FTableColumnSort.UNSORTED});}});const _hoisted_1$D=/* @__PURE__ */createElementVNode("span",{class:"sr-only"}," ",-1/* HOISTED */);function _sfc_render$H(_ctx,_cache,$props,$setup,$data,$options){return _ctx.visible?(openBlock(),createBlock(resolveDynamicComponent(_ctx.tagName),mergeProps({key:0,class:_ctx.classes,scope:_ctx.scope},_ctx.$attrs),{default:withCtx(()=>[renderSlot(_ctx.$slots,"default"),createTextVNode(),_hoisted_1$D]),_:3/* FORWARDED */},16,["class","scope"])):createCommentVNode("v-if",true);}const FTableColumn=/* @__PURE__ */_export_sfc(_sfc_main$R,[["render",_sfc_render$H]]);function FSortFilterDatasetInjected(){return{sort:inject("sort",()=>void 0),registerCallbackOnSort:inject("registerCallbackOnSort",()=>void 0),registerCallbackOnMount:inject("registerCallbackOnMount",()=>void 0)};}const _sfc_main$Q=defineComponent({name:"FLabel",components:{FIcon},props:{/**
345
+ * The id for the form element the label is bound to.
346
+ */for:{type:String,required:false,default:void 0}},data(){return{descriptionClass:["label__description"],discreteDescriptionClass:["label__description","label__description--discrete"]};},computed:{forProperty(){return this.for;},hasDefaultSlot(){return hasSlot(this,"default");},hasErrorMessageSlot(){return hasSlot(this,"error-message");},hasDescriptionSlot(){return hasSlot(this,"description");}}});const _hoisted_1$C={key:0};const _hoisted_2$s={key:0,class:"tooltip-before"};const _hoisted_3$p=["for"];const _hoisted_4$k=["for"];const _hoisted_5$i={key:0,class:"label__message label__message--error"};const _hoisted_6$f=["for"];const _hoisted_7$c={key:0,class:"label__message label__message--error"};function _sfc_render$G(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");return _ctx.$slots.tooltip?(openBlock(),createElementBlock("div",_hoisted_1$C,[_ctx.hasDefaultSlot?(openBlock(),createElementBlock("div",_hoisted_2$s,[createElementVNode("label",{class:"label tooltip-before__label",for:_ctx.forProperty},[renderSlot(_ctx.$slots,"default")],8,_hoisted_3$p)])):createCommentVNode("v-if",true),createTextVNode(),renderSlot(_ctx.$slots,"tooltip"),createTextVNode(),_ctx.hasDescriptionSlot||_ctx.hasErrorMessageSlot?(openBlock(),createElementBlock("label",{key:1,class:"label sr-separator",for:_ctx.forProperty},[renderSlot(_ctx.$slots,"description",normalizeProps(guardReactiveProps({descriptionClass:_ctx.descriptionClass,discreteDescriptionClass:_ctx.discreteDescriptionClass}))),createTextVNode(),_ctx.hasErrorMessageSlot?(openBlock(),createElementBlock("span",_hoisted_5$i,[createVNode(_component_f_icon,{class:"label__icon--left",name:"error"}),createTextVNode(),renderSlot(_ctx.$slots,"error-message")])):createCommentVNode("v-if",true)],8,_hoisted_4$k)):createCommentVNode("v-if",true)])):(openBlock(),createElementBlock("label",{key:1,class:"label",for:_ctx.forProperty},[renderSlot(_ctx.$slots,"default"),createTextVNode(),renderSlot(_ctx.$slots,"description",normalizeProps(guardReactiveProps({descriptionClass:_ctx.descriptionClass,discreteDescriptionClass:_ctx.discreteDescriptionClass}))),createTextVNode(),_ctx.hasErrorMessageSlot?(openBlock(),createElementBlock("span",_hoisted_7$c,[createVNode(_component_f_icon,{class:"label__icon--left",name:"error"}),createTextVNode(),renderSlot(_ctx.$slots,"error-message")])):createCommentVNode("v-if",true)],8,_hoisted_6$f));}const FLabel=/* @__PURE__ */_export_sfc(_sfc_main$Q,[["render",_sfc_render$G]]);function resolveWidthClass$1(words,inline){return inline?void 0:words.split(" ").map(word=>`i-width-${word}`).join(" ");}const _sfc_main$P=defineComponent({name:"FSelectField",components:{FIcon,FLabel},inheritAttrs:false,props:{/**
347
+ * The id for the select id attribute.
348
+ * The id for the label for attribute.
349
+ * If the prop is not set a random value will be generated.
350
+ */id:{type:String,required:false,default:()=>ElementIdService.generateElementId()},/**
351
+ * Show the component inline.
352
+ */inline:{type:Boolean,required:false,default:false},/**
353
+ * The value for the input.
354
+ * If the prop is not set undefined will be used.
355
+ * @model
356
+ */modelValue:{type:[String,Number,Object,Array,Boolean],required:false,default:void 0},/**
357
+ * Set responsive width for label section.
358
+ *
359
+ * ```
360
+ * label-width="md-9 lg-6"
361
+ * ```
362
+ */labelWidth:{type:String,required:false,default:"sm-12"},/**
363
+ * Set responsive width for select section that wraps select element and icons.
364
+ *
365
+ * ```
366
+ * select-width="md-6 lg-3"
367
+ * ```
368
+ */selectWidth:{type:String,required:false,default:"sm-12"}},emits:["change","update:modelValue"],setup(){return{textFieldTableMode:inject("textFieldTableMode",false)};},data(){return{validityMode:"INITIAL",validationMessage:""};},computed:{attrs(){return{...this.$attrs,// Disable change
369
+ onChange:()=>void 0};},hasError(){return this.validityMode==="ERROR";},rootClass(){return{["select-field--error"]:this.hasError,["select-field--inline"]:this.inline,["text-field--table"]:this.textFieldTableMode,["select-field--table-error"]:this.textFieldTableMode&&this.hasError};},labelClass(){return this.textFieldTableMode?"sr-only":"";},labelWrapperClass(){return resolveWidthClass$1(this.labelWidth,this.inline);},selectWrapperClass(){return resolveWidthClass$1(this.selectWidth,this.inline);},vModel:{get(){return this.modelValue;},set(value){this.$emit("update:modelValue",value);this.$emit("change",value);}}},methods:{async onValidity({detail}){var _renderSlotText3;this.validationMessage=detail.validationMessage;this.validityMode=detail.validityMode;await this.$nextTick();const errorMessage=(_renderSlotText3=renderSlotText(this.$slots.label))!==null&&_renderSlotText3!==void 0?_renderSlotText3:"";const element=this.$el.querySelector(`#${detail.elementId}`);if(element){dispatchComponentValidityEvent(element,{...detail,errorMessage,focusElementId:detail.elementId});}}}});const _hoisted_1$B=["id"];function _sfc_render$F(_ctx,_cache,$props,$setup,$data,$options){const _component_f_label=resolveComponent("f-label");const _component_f_icon=resolveComponent("f-icon");return openBlock(),createElementBlock("div",{class:normalizeClass(["select-field",_ctx.rootClass]),onValidity:_cache[1]||(_cache[1]=(...args)=>_ctx.onValidity&&_ctx.onValidity(...args))},[createElementVNode("div",{class:normalizeClass(_ctx.labelWrapperClass)},[createVNode(_component_f_label,{for:_ctx.id,class:normalizeClass(_ctx.labelClass)},createSlots({default:withCtx(()=>[renderSlot(_ctx.$slots,"label")]),description:withCtx(({descriptionClass,discreteDescriptionClass})=>[renderSlot(_ctx.$slots,"description",normalizeProps(guardReactiveProps({descriptionClass,discreteDescriptionClass})))]),"error-message":withCtx(()=>[renderSlot(_ctx.$slots,"error-message",normalizeProps(guardReactiveProps({hasError:_ctx.hasError,validationMessage:_ctx.validationMessage})),()=>[_ctx.hasError?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(toDisplayString(_ctx.validationMessage),1/* TEXT */)],64/* STABLE_FRAGMENT */)):createCommentVNode("v-if",true)])]),_:2/* DYNAMIC */},[_ctx.$slots.tooltip?{name:"tooltip",fn:withCtx(()=>[renderSlot(_ctx.$slots,"tooltip")]),key:"0"}:void 0]),1032,["for","class"])],2/* CLASS */),createTextVNode(),createElementVNode("div",{class:normalizeClass(["select-field__icon-wrapper",_ctx.selectWrapperClass])},[withDirectives(createElementVNode("select",mergeProps({id:_ctx.id,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>_ctx.vModel=$event),class:"select-field__select"},_ctx.attrs),[renderSlot(_ctx.$slots,"default")],16,_hoisted_1$B),[[vModelSelect,_ctx.vModel]]),createTextVNode(),_ctx.hasError&&_ctx.textFieldTableMode?(openBlock(),createBlock(_component_f_icon,{key:0,ref:"icon",class:"text-field__icon input-icon select-field__error-popup-icon",name:"error"},null,512/* NEED_PATCH */)):createCommentVNode("v-if",true),createTextVNode(),createVNode(_component_f_icon,{class:"select-field__icon",name:"arrow-down"})],2/* CLASS */)],34/* CLASS, NEED_HYDRATION */);}const FSelectField=/* @__PURE__ */_export_sfc(_sfc_main$P,[["render",_sfc_render$F]]);function computeArrowOffset(placement,inputIconRect,wrapperRect){switch(placement){case Placement.A:{const wrapperRightX=wrapperRect.x+wrapperRect.width;const iconCenterX=inputIconRect.x+inputIconRect.width/2;const offset2=wrapperRightX-iconCenterX;return{position:"top",offset:offset2};}case Placement.B:{const offset2=wrapperRect.x+wrapperRect.width-(inputIconRect.x+inputIconRect.width/2);return{position:"top",offset:offset2};}case Placement.C:{const wrapperRightX=wrapperRect.x+wrapperRect.width;const iconCenterX=inputIconRect.x+inputIconRect.width/2;const offset2=wrapperRightX-iconCenterX;return{position:"bottom",offset:offset2};}case Placement.D:{const offset2=wrapperRect.x+wrapperRect.width-(inputIconRect.x+inputIconRect.width/2);return{position:"bottom",offset:offset2};}case Placement.E:{const offset2=wrapperRect.y+wrapperRect.height-(inputIconRect.y+inputIconRect.height/2);return{position:"left",offset:offset2};}case Placement.F:{const offset2=wrapperRect.y+wrapperRect.height-(inputIconRect.y+inputIconRect.height/2);return{position:"right",offset:offset2};}case Placement.G:case Placement.H:case Placement.I:case Placement.Fallback:case Placement.NotCalculated:{const offset2=wrapperRect.x+wrapperRect.width-(inputIconRect.x+inputIconRect.width/2);return{position:"top",offset:offset2};}}}const POPUP_SPACING=10;const _sfc_main$O=defineComponent({name:"IPopupError",components:{FIcon},inheritAttrs:false,props:{/**
370
+ * Toggle open/closed error popup.
371
+ */isOpen:{type:Boolean,required:true},/**
372
+ * Message to display
373
+ */errorMessage:{type:String,required:false,default:"Error"},/**
374
+ * DOM element to position error popup at.
375
+ */anchor:{type:HTMLElement,required:false,default:void 0}},emits:["close"],data(){return{teleportDisabled:false,placement:Placement.NotCalculated,arrowPosition:"top",arrowOffset:24};},computed:{popupClasses(){const forceInline=this.teleportDisabled||this.placement===Placement.Fallback;const popupState=forceInline?["popup-error--inline"]:["popup-error--overlay"];return["popup-error",...popupState];},arrowClass(){return`popup-error popup-error--arrow popup-error--${this.arrowPosition}`;},errorStyle(){return`--i-popup-error-offset: ${this.arrowOffset}px`;}},watch:{anchor:{immediate:true,handler(anchor){if(anchor){anchor.addEventListener("keyup",this.onKeyEsc);window.addEventListener("resize",this.onResize);}}},isOpen:{immediate:true,async handler(value){await this.toggleIsOpen(value);}}},unmounted(){var _a;(_a=this.anchor)==null?void 0:_a.removeEventListener("keyup",this.onKeyEsc);window.removeEventListener("resize",this.onResize);},methods:{onResize(){this.toggleIsOpen(this.isOpen);},onKeyEsc(event){if(event.key==="Escape"){this.$emit("close");}},onClose(){this.$emit("close");},setArrowOffset(){var _a;const wrapper=this.$refs["wrapper"];const inputIcon=(_a=this.anchor)==null?void 0:_a.nextElementSibling;if(!inputIcon||!wrapper){return;}const inputIconRect=inputIcon.getBoundingClientRect();const wrapperRect=wrapper.getBoundingClientRect();const arrow=computeArrowOffset(this.placement,inputIconRect,wrapperRect);this.arrowOffset=arrow.offset;this.arrowPosition=arrow.position;},async toggleIsOpen(isOpen){if(!isOpen){this.placement=Placement.NotCalculated;return;}await this.$nextTick();const wrapper=this.$refs["wrapper"];if(!this.anchor){throw new Error("No anchor element found");}const area=document.body;const viewport=document.documentElement;const result=fitInsideArea({area,anchor:this.anchor,target:wrapper,viewport,spacing:POPUP_SPACING,candidateOrder:CandidateOrder.IPopupError});this.placement=result.placement;if(result.placement!==Placement.Fallback){this.teleportDisabled=false;wrapper.style.left=`${result.x}px`;wrapper.style.top=`${result.y}px`;await this.setArrowOffset();return;}await this.setArrowOffset();this.teleportDisabled=true;wrapper.style.removeProperty("left");wrapper.style.removeProperty("top");}}});const _hoisted_1$A={ref:"wrapper",class:"popup-error__wrapper"};function _sfc_render$E(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");return _ctx.isOpen?(openBlock(),createBlock(Teleport,{key:0,to:"body",disabled:_ctx.teleportDisabled},[createElementVNode("div",{ref:"popup",class:normalizeClass(_ctx.popupClasses),"aria-hidden":"true"},[createElementVNode("div",_hoisted_1$A,[createElementVNode("div",{class:normalizeClass(_ctx.arrowClass),style:normalizeStyle(_ctx.errorStyle)},[createElementVNode("span",null,toDisplayString(_ctx.errorMessage),1/* TEXT */),createTextVNode(),createElementVNode("button",{tabindex:"-1",type:"button",class:"button button--discrete button--discrete--black modal__close-button popup-error__button","aria-label":"Stäng",onClick:_cache[0]||(_cache[0]=(...args)=>_ctx.onClose&&_ctx.onClose(...args))},[createVNode(_component_f_icon,{name:"close",class:"button__icon"})])],6/* CLASS, STYLE */)],512/* NEED_PATCH */)],2/* CLASS */)],8,["disabled"])):createCommentVNode("v-if",true);}const IPopupError=/* @__PURE__ */_export_sfc(_sfc_main$O,[["render",_sfc_render$E]]);function resolveWidthClass(words,inline){return inline?void 0:words.split(" ").map(word=>`i-width-${word}`).join(" ");}const _sfc_main$N=defineComponent({name:"FTextField",components:{FLabel,FIcon,IPopupError},inheritAttrs:false,props:{/**
376
+ * The id for the input id attribute.
377
+ * The id for the label for attribute.
378
+ * If the prop is not set a random value will be generated.
379
+ */id:{type:String,required:false,default:()=>ElementIdService.generateElementId()},/**
380
+ * Show the component inline.
381
+ */inline:{type:Boolean,required:false,default:false},/**
382
+ * The value for the input.
383
+ * If the prop is not set undefined will be used.
384
+ * @model
385
+ */modelValue:{type:[String,Number],required:false,default:""},/**
386
+ * The type used for the input.
387
+ * If the prop is not set text will be used.
388
+ */type:{type:String,required:false,default:"text"},/**
389
+ * - The `formatter` function must only be used on a component that uses validation.
390
+ * - The `formatter` function acts differently depending on if the `parser` function is defined or not.
391
+ *
392
+ * | formatter without parser | formatter with parser |
393
+ * | ----- | -----|
394
+ * | modelvalue = parsed viewvalue using formatter function | modelvalue = parsed viewvalue using parser function |
395
+ * | viewvalue = modelvalue (where modelvalue is already parsed) | viewvalue = formatted modelvalue using formatter function (where modelvalue is already parsed) |
396
+ */formatter:{// eslint-disable-next-line @typescript-eslint/no-explicit-any -- We cannot know which type is used.
397
+ type:Function,required:false,default:void 0},/**
398
+ * - The `parser` function must only be used on a component that uses validation.
399
+ * - The `parser` function acts differently depending on if the `formatter` function is defined or not.
400
+ * - For parser combined with formatter, refer to formatter prop doc.
401
+ *
402
+ * | parser without formatter |
403
+ * | ----- |
404
+ * | modelvalue = parsed viewvalue using parser function |
405
+ * | viewvalue = never updated except when modelvalue differs from parsed viewvalue |
406
+ */parser:{// eslint-disable-next-line @typescript-eslint/no-explicit-any -- We cannot know which type is used.
407
+ type:Function,required:false,default:void 0},/**
408
+ * Set responsive width for label section.
409
+ *
410
+ * ```
411
+ * label-width="md-9 lg-6"
412
+ * ```
413
+ */labelWidth:{type:String,required:false,default:"sm-12"},/**
414
+ * Set responsive width for input section that wraps input element and icons.
415
+ *
416
+ * ```
417
+ * input-width="md-6 lg-3"
418
+ * ```
419
+ */inputWidth:{type:String,required:false,default:"sm-12"}},emits:["blur","change","update","update:modelValue"],setup(){return{textFieldTableMode:inject("textFieldTableMode",false)};},data(){return{showErrorPopup:false,viewValue:"",lastModelValue:"",validationMessage:"",validityMode:"INITIAL",// internal default texts possible to override when extending component
420
+ defaultText:"",descriptionText:"",descriptionScreenReaderText:"",discreteDescriptionText:"",discreteDescriptionScreenReaderText:""};},computed:{showPopupError(){return this.textFieldTableMode&&this.hasError&&this.showErrorPopup;},labelClass(){return this.textFieldTableMode?"sr-only":"";},isValid(){return this.validityMode==="VALID";},hasError(){return this.validityMode==="ERROR";},rootClass(){return{"text-field--error":this.hasError,"text-field--inline":this.inline,"text-field--table":this.textFieldTableMode};},labelWrapperClass(){return resolveWidthClass(this.labelWidth,this.inline);},inputWrapperClass(){return resolveWidthClass(this.inputWidth,this.inline);},isModelUpdatedProgrammatically(){return this.lastModelValue!==this.modelValue;}},watch:{modelValue:{immediate:true,handler:function(){if(this.modelValue===void 0||this.modelValue===null){this.viewValue="";return;}if(!this.isModelUpdatedProgrammatically){return;}this.setViewValueToFormattedValueOrFallbackToValue();this.lastModelValue=this.modelValue;}}},methods:{getErrorPopupAnchor(){return this.$refs.input;},closePopupError(){this.showErrorPopup=false;},async onChange(){if(!this.$refs.input.hasAttribute("data-validation")){this.$emit("update:modelValue",this.viewValue);this.$emit("update",this.viewValue);await this.$nextTick();this.$emit("change",this.viewValue);}},onFocus(){this.showErrorPopup=true;},async onBlur(){this.showErrorPopup=false;if(!this.$refs.input){return;}if(!this.$refs.input.hasAttribute("data-validation")){this.$emit("update:modelValue",this.viewValue);this.$emit("update",this.viewValue);await this.$nextTick();this.$emit("blur",this.viewValue);}},async onValidity({detail}){this.validationMessage=detail.validationMessage;this.validityMode=detail.validityMode;if(detail.nativeEvent==="change"||detail.nativeEvent==="blur"){let newModelValue;if(detail.isValid){newModelValue=this.resolveNewModelValue(this.viewValue);}else{newModelValue=this.viewValue;}this.lastModelValue=newModelValue;this.$emit("update:modelValue",newModelValue);this.$emit("update",newModelValue);await this.$nextTick();this.$emit(detail.nativeEvent,newModelValue);if(detail.isValid){this.syncViewValueAfterModelUpdate(newModelValue);}}this.triggerComponentValidityEvent(detail);},onPendingValidity(){this.validityMode="INITIAL";},resolveNewModelValue(viewValue){const trimmedViewValue=viewValue.trim();if(trimmedViewValue===""){return"";}else if(isSet(this.parser)){var _this$parser;return(_this$parser=this.parser(trimmedViewValue))!==null&&_this$parser!==void 0?_this$parser:trimmedViewValue;}else if(isSet(this.formatter)){var _this$formatter;return(_this$formatter=this.formatter(trimmedViewValue))!==null&&_this$formatter!==void 0?_this$formatter:trimmedViewValue;}else{return trimmedViewValue;}},syncViewValueAfterModelUpdate(newModelValue){if(newModelValue===""){this.viewValue="";}else if(isSet(this.parser)){if(isSet(this.formatter)){this.viewValue=String(this.formatter(newModelValue)||this.viewValue);}}else{this.viewValue=String(newModelValue);}},triggerComponentValidityEvent(validityEvent){var _renderSlotText4;const errorMessage=(_renderSlotText4=renderSlotText(this.$slots.default,{},{stripClasses:[]}))!==null&&_renderSlotText4!==void 0?_renderSlotText4:this.defaultText;const element=this.$el.querySelector(`#${validityEvent.elementId}`);if(element){dispatchComponentValidityEvent(element,{...validityEvent,errorMessage,focusElementId:validityEvent.elementId});}},setViewValueToFormattedValueOrFallbackToValue(){if(!isSet(this.formatter)){this.viewValue=String(this.modelValue);return;}const parsedValue=isSet(this.parser)&&typeof this.modelValue==="string"?this.parser(this.modelValue):this.modelValue;const formattedValue=isSet(parsedValue)?this.formatter(parsedValue):void 0;this.viewValue=isSet(formattedValue)?formattedValue:String(this.modelValue);}}});const _hoisted_1$z={key:0};const _hoisted_2$r={key:0,class:"sr-only"};const _hoisted_3$o={key:0,class:"sr-only"};const _hoisted_4$j={class:"text-field__icon-wrapper"};const _hoisted_5$h=["id","type"];const _hoisted_6$e={key:2,class:"text-field__append-inner"};function _sfc_render$D(_ctx,_cache,$props,$setup,$data,$options){const _component_f_label=resolveComponent("f-label");const _component_f_icon=resolveComponent("f-icon");const _component_i_popup_error=resolveComponent("i-popup-error");return openBlock(),createElementBlock("div",{class:normalizeClass(["text-field",_ctx.rootClass])},[createElementVNode("div",{class:normalizeClass(_ctx.labelWrapperClass)},[createVNode(_component_f_label,{for:_ctx.id,class:normalizeClass(_ctx.labelClass)},createSlots({default:withCtx(()=>[renderSlot(_ctx.$slots,"default",{},()=>[_ctx.defaultText!==""?(openBlock(),createElementBlock("span",_hoisted_1$z,toDisplayString(_ctx.defaultText),1/* TEXT */)):createCommentVNode("v-if",true)])]),description:withCtx(({descriptionClass,discreteDescriptionClass})=>[renderSlot(_ctx.$slots,"description",normalizeProps(guardReactiveProps({descriptionClass,discreteDescriptionClass})),()=>[_ctx.descriptionText?(openBlock(),createElementBlock("span",{key:0,class:normalizeClass(descriptionClass)},[_ctx.descriptionScreenReaderText?(openBlock(),createElementBlock("span",_hoisted_2$r,toDisplayString(_ctx.descriptionScreenReaderText),1/* TEXT */)):createCommentVNode("v-if",true),createTextVNode(),createElementVNode("span",null,toDisplayString(_ctx.descriptionText),1/* TEXT */)],2/* CLASS */)):createCommentVNode("v-if",true),createTextVNode(),_ctx.discreteDescriptionText?(openBlock(),createElementBlock("span",{key:1,class:normalizeClass(discreteDescriptionClass)},[_ctx.discreteDescriptionScreenReaderText?(openBlock(),createElementBlock("span",_hoisted_3$o,toDisplayString(_ctx.discreteDescriptionScreenReaderText),1/* TEXT */)):createCommentVNode("v-if",true),createTextVNode(),createElementVNode("span",null,toDisplayString(_ctx.discreteDescriptionText),1/* TEXT */)],2/* CLASS */)):createCommentVNode("v-if",true)])]),"error-message":withCtx(()=>[renderSlot(_ctx.$slots,"error-message",normalizeProps(guardReactiveProps({hasError:_ctx.hasError,validationMessage:_ctx.validationMessage})),()=>[_ctx.hasError?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(toDisplayString(_ctx.validationMessage),1/* TEXT */)],64/* STABLE_FRAGMENT */)):createCommentVNode("v-if",true)])]),_:2/* DYNAMIC */},[_ctx.$slots.tooltip?{name:"tooltip",fn:withCtx(()=>[renderSlot(_ctx.$slots,"tooltip")]),key:"0"}:void 0]),1032,["for","class"])],2/* CLASS */),createTextVNode(),createElementVNode("div",{class:normalizeClass(["text-field__input-wrapper",_ctx.inputWrapperClass])},[renderSlot(_ctx.$slots,"input-left"),createTextVNode(),createElementVNode("div",_hoisted_4$j,[withDirectives(createElementVNode("input",mergeProps({id:_ctx.id,ref:"input","onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>_ctx.viewValue=$event),type:_ctx.type,class:"text-field__input"},_ctx.$attrs,{onBlur:_cache[1]||(_cache[1]=(...args)=>_ctx.onBlur&&_ctx.onBlur(...args)),onFocus:_cache[2]||(_cache[2]=(...args)=>_ctx.onFocus&&_ctx.onFocus(...args)),onChange:_cache[3]||(_cache[3]=(...args)=>_ctx.onChange&&_ctx.onChange(...args)),onValidity:_cache[4]||(_cache[4]=(...args)=>_ctx.onValidity&&_ctx.onValidity(...args)),onPendingValidity:_cache[5]||(_cache[5]=(...args)=>_ctx.onPendingValidity&&_ctx.onPendingValidity(...args))}),null,16,_hoisted_5$h),[[vModelDynamic,_ctx.viewValue]]),createTextVNode(),_ctx.hasError&&_ctx.textFieldTableMode?(openBlock(),createBlock(_component_f_icon,{key:0,ref:"icon",class:"text-field__icon input-icon text-field__append-inner text-field__error-popup-icon",name:"error"},null,512/* NEED_PATCH */)):createCommentVNode("v-if",true),createTextVNode(),_ctx.textFieldTableMode?(openBlock(),createBlock(_component_i_popup_error,{key:1,anchor:_ctx.getErrorPopupAnchor(),"is-open":_ctx.showPopupError,"error-message":_ctx.validationMessage,onClose:_ctx.closePopupError},null,8,["anchor","is-open","error-message","onClose"])):createCommentVNode("v-if",true),createTextVNode(),_ctx.$slots["append-inner"]?(openBlock(),createElementBlock("div",_hoisted_6$e,[renderSlot(_ctx.$slots,"append-inner")])):createCommentVNode("v-if",true)]),createTextVNode(),renderSlot(_ctx.$slots,"input-right")],2/* CLASS */)],2/* CLASS */);}const FTextField=/* @__PURE__ */_export_sfc(_sfc_main$N,[["render",_sfc_render$D]]);const _sfc_main$M=defineComponent({name:"FEmailTextField",components:{FTextField},mixins:[TranslationMixin],inheritAttrs:false,props:{/**
421
+ * The id for the input id attribute.
422
+ * The id for the label for attribute.
423
+ * If the prop is not set a random value will be generated.
424
+ */id:{type:String,required:false,default:()=>ElementIdService.generateElementId()},/**
425
+ * The value for the input.
426
+ * If the prop is not set undefined will be used.
427
+ * @model
428
+ */modelValue:{type:String,required:false,default:void 0},maxLength:{type:Number,default:80},extendedValidation:{type:Boolean,default:false},/**
429
+ * The error message to be displayed on paste
430
+ * If the prop is not set the default text "Du kan inte kopiera mejladressen. Du måste skriva in den igen." will be set
431
+ */pasteErrorText:{type:String,required:false,default:TranslationService.provider.translate("fkui.email-text-field.error.pasting","Du kan inte kopiera mejladressen. Du måste skriva in den igen.")}},emits:["blur","change","update","update:modelValue"],data(){return{validityMode:"INITIAL",secondEmail:"",showPasteErrorMessage:false,defaultText:this.$t("fkui.email-text-field.label","Mejladress")};},mounted(){this.configureValidators();},methods:{onChange(event){this.$emit("change",event);},onBlur(event){this.$emit("blur",event);},onUpdate(event){this.$emit("update:modelValue",event);this.$emit("update",event);},onPaste(event){this.showPasteErrorMessage=true;event.preventDefault();return false;},onValidity({detail}){var _renderSlotText5;this.showPasteErrorMessage=false;this.validityMode=detail.validityMode;const errorMessage=(_renderSlotText5=renderSlotText(this.$slots.default))!==null&&_renderSlotText5!==void 0?_renderSlotText5:this.defaultText;const element=this.$el.querySelector(`#${detail.elementId}`);if(element){dispatchComponentValidityEvent(element,{...detail,errorMessage,focusElementId:detail.elementId});}},onPendingValidity(){this.validityMode="INITIAL";},configureValidators(){const elements=Array.from(this.$el.querySelectorAll("input"));const validatorEmailConfig={email:{}};ValidationService.addValidatorsToElement(elements[0],validatorEmailConfig,true);if(this.extendedValidation){this.configureExtendedValidation(elements);}},configureExtendedValidation(elements){const validatorEmailMatchesConfig={required:{enabled:elements[0].hasAttribute("required")},email:{},matches:{id:elements[0].id}};ValidationService.addValidatorsToElement(elements[1],validatorEmailMatchesConfig,true);}}});const _hoisted_1$y={key:0};function _sfc_render$C(_ctx,_cache,$props,$setup,$data,$options){const _component_f_text_field=resolveComponent("f-text-field");return openBlock(),createElementBlock("div",null,[createVNode(_component_f_text_field,mergeProps({id:_ctx.id,type:"email",maxlength:_ctx.maxLength},_ctx.$attrs,{"model-value":_ctx.modelValue,onChange:_ctx.onChange,onBlur:_ctx.onBlur,onUpdate:_ctx.onUpdate,onValidity:_ctx.onValidity,onPendingValidity:_ctx.onPendingValidity}),{"error-message":withCtx(()=>[_ctx.showPasteErrorMessage?(openBlock(),createElementBlock("span",_hoisted_1$y,toDisplayString(_ctx.pasteErrorText),1/* TEXT */)):createCommentVNode("v-if",true)]),default:withCtx(()=>[renderSlot(_ctx.$slots,"default",{},()=>[createTextVNode(toDisplayString(_ctx.defaultText),1/* TEXT */)]),createTextVNode()]),_:3/* FORWARDED */},16,["id","maxlength","model-value","onChange","onBlur","onUpdate","onValidity","onPendingValidity"]),createTextVNode(),_ctx.extendedValidation?(openBlock(),createBlock(_component_f_text_field,{key:0,modelValue:_ctx.secondEmail,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>_ctx.secondEmail=$event),type:"email",maxlength:_ctx.maxLength,onPaste:_ctx.onPaste,onBlur:_cache[1]||(_cache[1]=$event=>_ctx.showPasteErrorMessage=false)},{default:withCtx(()=>[renderSlot(_ctx.$slots,"extended-label",{},()=>[createTextVNode(toDisplayString(_ctx.$t("fkui.email-text-field.label.repeat","Upprepa mejladress")),1/* TEXT */)])]),_:3/* FORWARDED */},8,["modelValue","maxlength","onPaste"])):createCommentVNode("v-if",true)]);}const FEmailTextField=/* @__PURE__ */_export_sfc(_sfc_main$M,[["render",_sfc_render$C]]);const _sfc_main$L=defineComponent({name:"FPhoneTextField",components:{FTextField},mixins:[TranslationMixin],inheritAttrs:false,props:{/**
432
+ * The id for the input id attribute.
433
+ * The id for the label for attribute.
434
+ * If the prop is not set a random value will be generated.
435
+ */id:{type:String,required:false,default:()=>ElementIdService.generateElementId()},/**
436
+ * The value for the input.
437
+ * If the prop is not set undefined will be used.
438
+ * @model
439
+ */modelValue:{type:String,required:false,default:void 0},maxLength:{type:Number,default:80},extendedValidation:{type:Boolean,default:false}},emits:["blur","change","update","update:modelValue"],data(){return{validityMode:"INITIAL",secondPhone:"",defaultText:this.$t("fkui.phone-text-field.label","Telefonnummer")};},mounted(){this.configureValidators();},methods:{onChange(event){this.$emit("change",event);},onBlur(event){this.$emit("blur",event);},onUpdate(event){this.$emit("update:modelValue",event);this.$emit("update",event);},onValidity({detail}){var _renderSlotText6;this.validityMode=detail.validityMode;const errorMessage=(_renderSlotText6=renderSlotText(this.$slots.default))!==null&&_renderSlotText6!==void 0?_renderSlotText6:this.defaultText;const element=this.$el.querySelector(`#${detail.elementId}`);if(element){dispatchComponentValidityEvent(element,{...detail,errorMessage,focusElementId:detail.elementId});}},onPendingValidity(){this.validityMode="INITIAL";},configureValidators(){const elements=Array.from(this.$el.querySelectorAll("input"));const validatorPhoneConfig={phoneNumber:{}};ValidationService.addValidatorsToElement(elements[0],validatorPhoneConfig,true);if(this.extendedValidation){this.configureExtendedValidation(elements);}},configureExtendedValidation(elements){const validatorPhoneMatchesConfig={required:{enabled:elements[0].hasAttribute("required")},phoneNumber:{},matches:{id:elements[0].id}};ValidationService.addValidatorsToElement(elements[1],validatorPhoneMatchesConfig,true);}}});function _sfc_render$B(_ctx,_cache,$props,$setup,$data,$options){const _component_f_text_field=resolveComponent("f-text-field");return openBlock(),createElementBlock("div",null,[createVNode(_component_f_text_field,mergeProps({id:_ctx.id,type:"tel",maxlength:_ctx.maxLength},_ctx.$attrs,{"model-value":_ctx.modelValue,onChange:_ctx.onChange,onBlur:_ctx.onBlur,onUpdate:_ctx.onUpdate,onValidity:_ctx.onValidity,onPendingValidity:_ctx.onPendingValidity}),{default:withCtx(()=>[renderSlot(_ctx.$slots,"default",{},()=>[createTextVNode(toDisplayString(_ctx.defaultText),1/* TEXT */)])]),_:3/* FORWARDED */},16,["id","maxlength","model-value","onChange","onBlur","onUpdate","onValidity","onPendingValidity"]),createTextVNode(),_ctx.extendedValidation?(openBlock(),createBlock(_component_f_text_field,{key:0,modelValue:_ctx.secondPhone,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>_ctx.secondPhone=$event),type:"tel",maxlength:_ctx.maxLength},{default:withCtx(()=>[renderSlot(_ctx.$slots,"extendedLabel",{},()=>[createTextVNode(toDisplayString(_ctx.$t("fkui.phone-text-field.label.repeat","Upprepa telefonnumret")),1/* TEXT */)])]),_:3/* FORWARDED */},8,["modelValue","maxlength"])):createCommentVNode("v-if",true)]);}const FPhoneTextField=/* @__PURE__ */_export_sfc(_sfc_main$L,[["render",_sfc_render$B]]);const _sfc_main$K=defineComponent({name:"FCurrencyTextField",extends:FTextField,mixins:[TranslationMixin],props:{formatter:{type:Function,required:false,default:formatNumber},parser:{type:Function,required:false,default:parseNumber}},setup(){return{textFieldTableMode:inject("textFieldTableMode",false)};},data(){return{defaultText:this.$t("fkui.currency-text-field.label","Pengar")};},mounted(){const inputElement=getInputElement(this);inputElement.setAttribute("inputmode","numeric");inputElement.setAttribute("maxlength","20");ValidationService.addValidatorsToElement(inputElement,{currency:{},integer:{}},true);ValidationService.validateElement(inputElement);}});const _sfc_main$J=defineComponent({name:"FSearchTextField",components:{FTextField,FIcon},props:{id:{type:String,required:false,default:()=>ElementIdService.generateElementId()},modelValue:{type:String,required:false,default:""},clearableScreenReaderText:{type:String,required:false,default:TranslationService.provider.translate("fkui.search-text-field.search-screen-reader","Töm inmatningsfält")},maxLength:{type:Number,default:80}},emits:["blur","change","update","update:modelValue"],data(){return{defaultText:this.$t("fkui.search-text-field.label","Sök")};},computed:{canClear(){return this.modelValue!=="";}},methods:{clear(){alertScreenReader(this.$t("fkui.search-text-field.aria-live.clear","Inmatningsfältet har tömts"),{assertive:true});this.$emit("update:modelValue","");this.$el.querySelector("input").focus();},onInput(event){this.$emit("update:modelValue",event.target.value);},onChange(event){this.$emit("change",event);},onBlur(event){this.$emit("blur",event);},onUpdate(event){this.$emit("update:modelValue",event);}}});const _hoisted_1$x={class:"sr-only"};function _sfc_render$A(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");const _component_f_text_field=resolveComponent("f-text-field");return openBlock(),createElementBlock("div",null,[createVNode(_component_f_text_field,mergeProps({id:_ctx.id,maxlength:_ctx.maxLength,"model-value":_ctx.modelValue},_ctx.$attrs,{type:"search",class:"text-field--search",onChange:_ctx.onChange,onInput:_ctx.onInput,onBlur:_ctx.onBlur,onUpdate:_ctx.onUpdate}),createSlots({"input-right":withCtx(()=>[renderSlot(_ctx.$slots,"input-right")]),"input-left":withCtx(()=>[renderSlot(_ctx.$slots,"input-left")]),"error-message":withCtx(({hasError,validationMessage})=>[renderSlot(_ctx.$slots,"error-message",normalizeProps(guardReactiveProps({hasError,validationMessage})))]),description:withCtx(({descriptionClass,discreteDescriptionClass})=>[renderSlot(_ctx.$slots,"description",normalizeProps(guardReactiveProps({descriptionClass,discreteDescriptionClass})))]),default:withCtx(()=>[renderSlot(_ctx.$slots,"default",{},()=>[createTextVNode(toDisplayString(_ctx.defaultText),1/* TEXT */)]),createTextVNode(),createTextVNode(),createTextVNode(),createTextVNode(),createTextVNode(),createTextVNode()]),_:2/* DYNAMIC */},[_ctx.$slots.tooltip?{name:"tooltip",fn:withCtx(()=>[renderSlot(_ctx.$slots,"tooltip")]),key:"0"}:void 0,_ctx.canClear?{name:"append-inner",fn:withCtx(()=>[createElementVNode("button",{class:"text-field__icon clear-button",type:"button",onClick:_cache[0]||(_cache[0]=withModifiers((...args)=>_ctx.clear&&_ctx.clear(...args),["self"]))},[createVNode(_component_f_icon,{name:"cross",class:"clear-button__icon"}),createTextVNode(),createElementVNode("span",_hoisted_1$x,toDisplayString(_ctx.clearableScreenReaderText),1/* TEXT */)])]),key:"1"}:void 0]),1040,["id","maxlength","model-value","onChange","onInput","onBlur","onUpdate"])]);}const FSearchTextField=/* @__PURE__ */_export_sfc(_sfc_main$J,[["render",_sfc_render$A]]);const _sfc_main$I=defineComponent({name:"FBankAccountNumberTextField",extends:FTextField,mixins:[TranslationMixin],props:{parser:{type:Function,required:false,default:parseBankAccountNumber}},setup(){return{textFieldTableMode:inject("textFieldTableMode",false)};},data(){return{defaultText:this.$t("fkui.bank-account-number-text-field.label","Kontonummer")};},mounted(){const inputElement=getInputElement(this);ValidationService.addValidatorsToElement(inputElement,{bankAccountNumber:{}},true);inputElement.setAttribute("inputmode","numeric");inputElement.setAttribute("maxlength","40");ValidationService.validateElement(inputElement);}});const _sfc_main$H=defineComponent({name:"FBankgiroTextField",extends:FTextField,mixins:[TranslationMixin],props:{formatter:{type:Function,required:false,default:parseBankgiro}},setup(){return{textFieldTableMode:inject("textFieldTableMode",false)};},data(){return{defaultText:this.$t("fkui.bankgiro-text-field.label","Bankgironummer")};},mounted(){const inputElement=getInputElement(this);ValidationService.addValidatorsToElement(inputElement,{maxLength:{length:9},bankgiro:{}},true);inputElement.setAttribute("inputmode","numeric");inputElement.setAttribute("maxlength","40");ValidationService.validateElement(inputElement);}});const _sfc_main$G=defineComponent({name:"FClearingnumberTextField",extends:FTextField,mixins:[TranslationMixin],props:{formatter:{type:Function,required:false,default:parseClearingNumber}},setup(){return{textFieldTableMode:inject("textFieldTableMode",false)};},data(){return{defaultText:this.$t("fkui.clearingnumber-text-field.label","Clearingnummer")};},mounted(){const inputElement=getInputElement(this);ValidationService.addValidatorsToElement(inputElement,{clearingNumber:{}},true);inputElement.setAttribute("inputmode","numeric");inputElement.setAttribute("maxlength","16");ValidationService.validateElement(inputElement);}});function defaultFormatter$1(modelValue){return formatNumber(modelValue,this.decimals);}const _sfc_main$F=defineComponent({name:"FNumericTextField",extends:FTextField,props:{/**
440
+ * The number of decimals to format number as.
441
+ * @model
442
+ */decimals:{type:Number,required:false,default:void 0},formatter:{type:Function,required:false,default:defaultFormatter$1},parser:{type:Function,required:false,default:parseNumber}},setup(){return{textFieldTableMode:inject("textFieldTableMode",false)};},mounted(){const inputElement=getInputElement(this);inputElement.setAttribute("inputmode","numeric");inputElement.setAttribute("maxlength","20");ValidationService.addValidatorsToElement(inputElement,{number:{}},true);ValidationService.validateElement(inputElement);}});const _sfc_main$E=defineComponent({name:"FPersonnummerTextField",extends:FTextField,mixins:[TranslationMixin],props:{formatter:{type:Function,required:false,default:formatPersonnummer},parser:{type:Function,required:false,default:parsePersonnummer}},setup(){return{textFieldTableMode:inject("textFieldTableMode",false)};},data(){return{defaultText:this.$t("fkui.personnummer-text-field.label-10-digits","Personnummer"),discreteDescriptionText:this.$t("fkui.personnummer-text-field.example-10-digits","(ååmmdd-nnnn)"),discreteDescriptionScreenReaderText:this.$t("fkui.personnummer-text-field.format-description-10-digits","Skriv personnumret med 10 siffror,")};},mounted(){const inputElement=getInputElement(this);ValidationService.addValidatorsToElement(inputElement,{maxLength:{length:20},personnummerFormat:{},personnummerLuhn:{}},true);inputElement.setAttribute("inputmode","numeric");inputElement.setAttribute("maxlength","23");ValidationService.validateElement(inputElement);}});const _sfc_main$D=defineComponent({name:"FPlusgiroTextField",extends:FTextField,mixins:[TranslationMixin],props:{formatter:{type:Function,required:false,default:parsePlusgiro}},setup(){return{textFieldTableMode:inject("textFieldTableMode",false)};},data(){return{defaultText:this.$t("fkui.plusgiro-text-field.label","Plusgironummer")};},mounted(){const inputElement=getInputElement(this);ValidationService.addValidatorsToElement(inputElement,{maxLength:{length:11},plusgiro:{}},true);inputElement.setAttribute("inputmode","numeric");inputElement.setAttribute("maxlength","16");ValidationService.validateElement(inputElement);}});const _sfc_main$C=defineComponent({name:"FPostalCodeTextField",extends:FTextField,mixins:[TranslationMixin],props:{formatter:{type:Function,required:false,default:formatPostalCode}},setup(){return{textFieldTableMode:inject("textFieldTableMode",false)};},data(){return{defaultText:this.$t("fkui.postal-code-text-field.label","Postnummer"),discreteDescriptionText:this.$t("fkui.postal-code-text-field.example","(123 45)"),discreteDescriptionScreenReaderText:this.$t("fkui.postal-code-text-field.format-description","Formatbeskrivning")};},mounted(){const inputElement=getInputElement(this);ValidationService.addValidatorsToElement(inputElement,{maxLength:{length:13},postalCode:{}},true);inputElement.setAttribute("inputmode","numeric");inputElement.setAttribute("maxlength","15");ValidationService.validateElement(inputElement);}});function defaultFormatter(modelValue){return formatPercent(modelValue,this.decimals);}const _sfc_main$B=defineComponent({name:"FPercentTextField",extends:FTextField,mixins:[TranslationMixin],props:{/**
443
+ * The number of decimals to format number as.
444
+ */decimals:{type:Number,required:false,default:void 0},formatter:{type:Function,required:false,default:defaultFormatter},parser:{type:Function,required:false,default:parsePercent}},setup(){return{textFieldTableMode:inject("textFieldTableMode",false)};},data(){return{defaultText:this.$t("fkui.percent-text-field.label","Procent")};},mounted(){const inputElement=getInputElement(this);inputElement.setAttribute("inputmode",this.decimals?"decimal":"numeric");inputElement.setAttribute("maxlength","10");ValidationService.addValidatorsToElement(inputElement,{percent:{},minValue:{minValue:0},maxValue:{maxValue:999}},true);ValidationService.validateElement(inputElement);}});const _sfc_main$A=defineComponent({name:"FOrganisationsnummerTextField",extends:FTextField,mixins:[TranslationMixin],props:{formatter:{type:Function,required:false,default:parseOrganisationsnummer}},setup(){return{textFieldTableMode:inject("textFieldTableMode",false)};},data(){return{defaultText:this.$t("fkui.organisationsnummer-text-field.label","Organisationsnummer"),discreteDescriptionText:this.$t("fkui.organisationsnummer-text-field.example","(999999-9999)"),discreteDescriptionScreenReaderText:this.$t("fkui.organisationsnummer-text-field.format-description","Formatbeskrivning")};},mounted(){const inputElement=getInputElement(this);ValidationService.addValidatorsToElement(inputElement,{maxLength:{length:11},organisationsnummer:{}},true);inputElement.setAttribute("inputmode","numeric");inputElement.setAttribute("maxlength","20");ValidationService.validateElement(inputElement);}});function sort(list,sortAttribute,ascending){return list.sort((item1,item2)=>compare(item1,item2,sortAttribute,ascending));}function compare(item1,item2,attribute,ascending){const value1=item1[attribute];const value2=item2[attribute];if(!isSet(value1)||!isSet(value2)){return nullCompare(value1,value2);}if(typeof value1==="string"&&typeof value2==="string"){return fixOrder(value1.localeCompare(value2),ascending);}if(typeof value1==="number"&&typeof value2==="number"){return fixOrder(numberCompare(value1,value2),ascending);}if(typeof value1==="boolean"&&typeof value2==="boolean"){return fixOrder(booleanCompare(value1,value2),ascending);}if(typeof value1!==typeof value2){throw Error(`Sorting is not supported for rows containing different types (attribute '${attribute.toString()}')`);}throw Error(`Sorting is only supported for types number, string and boolean (attribute '${attribute.toString()}')`);}function fixOrder(order,ascending){return ascending?order:order-order*2;}function booleanCompare(value1,value2){if(value1===value2){return 0;}else if(value1>value2){return 1;}return-1;}function numberCompare(value1,value2){return value1-value2;}function nullCompare(value1,value2){if(!isSet(value1)&&!isSet(value2)){return 0;}else if(!isSet(value1)){return 1;}return-1;}function includesAllSearchTerms(item,filterAttributes,searchTerms){const values=filterAttributes.map(it=>{const value=item[it];return isSet(value)?value.toString().toLocaleLowerCase():void 0;}).filter(Boolean);for(const searchTerm of searchTerms){const match=values.find(it=>it==null?void 0:it.includes(searchTerm));if(!match){return false;}}return true;}function filter(list,filterAttributes,searchString){searchString=searchString.trim();if(searchString.trim()===""){return list;}const searchTerms=searchString.split(/\s+/).map(word=>word.toLocaleLowerCase());return list.filter(item=>includesAllSearchTerms(item,filterAttributes,searchTerms));}const _sfc_main$z=defineComponent({name:"FSortFilterDataset",components:{FSelectField,FTextField,FIcon,IFlex,IFlexItem},mixins:[TranslationMixin],provide(){return{sort:(attribute,ascending)=>{const foundAttribute=this.sortOrders.find(item=>item.attribute===attribute&&item.ascending===ascending);if(foundAttribute){this.sortAttribute=foundAttribute;}else{this.sortAttribute={attribute:"",ascending:false};}this.sortFilterData();this.$emit("usedSortAttributes",this.sortAttribute);},registerCallbackOnSort:callback=>{this.tableCallbackOnSort=callback;},registerCallbackOnMount:callback=>{this.tableCallbackSortableColumns=callback;}};},props:{/**
445
+ * The data that you wish to sort or filter.
446
+ */data:{type:Array,required:true,default:()=>[]},/**
447
+ * All the attributes you want to enable sorting for and the corresponding name to display in the dropdown.
448
+ * Structured as `{attributeName: "Name for dropdown", secondAttributeName: "Name for dropdown"}`
449
+ */sortableAttributes:{type:Object,required:true},/**
450
+ * If set the data will be sorted by this attribute by default.
451
+ */defaultSortAttribute:{type:String,required:false,default:()=>""},/**
452
+ * Show/hides the sort dropdown.
453
+ */showSort:{type:Boolean,required:false,default:true},/**
454
+ * Show/hides the filter input.
455
+ */showFilter:{type:Boolean,required:false,default:true},/**
456
+ * Set placeholder text in filter input field.
457
+ * Default is textkey "fkui.sort-filter-dataset.placeholder.filter"
458
+ */placeholderFilter:{type:String,required:false,default:TranslationMixin.methods.$t("fkui.sort-filter-dataset.placeholder.filter","Sök")},/**
459
+ * The order the data will be sorted by if defaultSortAttribute has been set.
460
+ */defaultSortAscending:{type:Boolean,required:false,default:()=>true}},emits:["datasetSorted","usedSortAttributes"],data(){return{searchString:"",sortAttribute:{attribute:"",ascending:false},sortFilterResult:[],tableCallbackOnSort:()=>{return;},tableCallbackSortableColumns:()=>{return;}};},computed:{showClearButton(){return this.searchString.length>0;},sortOrders(){const arr=[];let id=0;Object.keys(this.sortableAttributes).forEach(key=>{arr.push({attribute:key,name:this.sortableAttributes[key],ascendingName:this.$t("fkui.sort-filter-dataset.label.ascending","stigande"),ascending:true,id:id++});arr.push({attribute:key,name:this.sortableAttributes[key],ascendingName:this.$t("fkui.sort-filter-dataset.label.descending","fallande"),ascending:false,id:id++});});return arr;},filterAttributes(){return Object.keys(this.sortableAttributes);}},watch:{data:{immediate:true,deep:true,handler:function(){if(this.defaultSortAttribute!==""){const foundAttribute=this.sortOrders.find(item=>item.attribute===this.defaultSortAttribute&&item.ascending===this.defaultSortAscending);if(foundAttribute){this.sortAttribute=foundAttribute;}}this.sortFilterData();}}},created(){this.debouncedFilterResultset=debounce(this.filterResultset,250).bind(this);},mounted(){this.tableCallbackSortableColumns(Object.keys(this.sortableAttributes));},methods:{sortFilterData(){const filteredData=filter(this.data,this.filterAttributes,this.searchString);if(this.sortAttribute.attribute===""){this.sortFilterResult=filteredData;}else{this.sortFilterResult=sort([...filteredData],this.sortAttribute.attribute,this.sortAttribute.ascending);}this.$nextTick(()=>{this.tableCallbackOnSort(this.sortAttribute.attribute,this.sortAttribute.ascending);});this.$emit("datasetSorted",this.sortFilterResult);},onChangeSortAttribute(){this.sortFilterData();this.$emit("usedSortAttributes",this.sortAttribute);},onSearchInput(event){this.searchString=event.target.value;this.debouncedFilterResultset();},onClickClearSearch(){this.searchString="";this.sortFilterData();const input=this.$el.querySelector(".text-field--inline input");focus$1(input);},debouncedFilterResultset(){},filterResultset(){this.sortFilterData();if(this.searchString===""){alertScreenReader(this.$t("fkui.sort-filter-dataset.aria-live.empty","Sök redigera Sök tom"));}else{const searchAriaLive=this.$t("fkui.sort-filter-dataset.aria-live.search",`Din sökning på "{{ search }}" gav {{ result }} träffar.`,{result:this.sortFilterResult.length,search:this.searchString});alertScreenReader(searchAriaLive);}}}});const _hoisted_1$w={class:"sort-filter-dataset"};const _hoisted_2$q={class:"sort-filter-dataset__search"};const _hoisted_3$n={class:"sr-only"};const _hoisted_4$i=["title"];const _hoisted_5$g={class:"sr-only"};const _hoisted_6$d={value:{attribute:"",ascending:false}};const _hoisted_7$b=["value"];function _sfc_render$z(_ctx,_cache,$props,$setup,$data,$options){const _component_i_flex_item=resolveComponent("i-flex-item");const _component_f_icon=resolveComponent("f-icon");const _component_f_text_field=resolveComponent("f-text-field");const _component_f_select_field=resolveComponent("f-select-field");const _component_i_flex=resolveComponent("i-flex");return openBlock(),createElementBlock("div",_hoisted_1$w,[createVNode(_component_i_flex,{collapse:"",gap:"3x",wrap:""},{default:withCtx(()=>[createVNode(_component_i_flex_item,{shrink:"",align:"center"},{default:withCtx(()=>[renderSlot(_ctx.$slots,"header",normalizeProps(guardReactiveProps({slotClass:"sort-filter-dataset__toolbar__header"})))]),_:3/* FORWARDED */}),createTextVNode(),createVNode(_component_i_flex_item,{grow:""},{default:withCtx(()=>[createVNode(_component_i_flex,{collapse:"",float:"right"},{default:withCtx(()=>[_ctx.showFilter?(openBlock(),createBlock(_component_i_flex_item,{key:0,shrink:"",align:"center"},{default:withCtx(()=>[createElementVNode("div",_hoisted_2$q,[createVNode(_component_f_icon,{name:"search",class:"sort-filter-dataset__search__magnify-icon"}),createTextVNode(),createVNode(_component_f_text_field,{modelValue:_ctx.searchString,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>_ctx.searchString=$event),inline:"",placeholder:_ctx.placeholderFilter,maxlength:"64",onInput:_ctx.onSearchInput},{default:withCtx(()=>[createElementVNode("span",_hoisted_3$n,toDisplayString(_ctx.placeholderFilter),1/* TEXT */)]),_:1/* STABLE */},8,["modelValue","placeholder","onInput"]),createTextVNode(),_ctx.showClearButton?(openBlock(),createElementBlock("button",{key:0,type:"button",class:"button button--discrete sort-filter-dataset__search__close-icon",title:_ctx.$t("fkui.sort-filter-dataset.clear.filter","Rensa sökfält"),onClick:_cache[1]||(_cache[1]=(...args)=>_ctx.onClickClearSearch&&_ctx.onClickClearSearch(...args))},[createVNode(_component_f_icon,{name:"close"}),createTextVNode(),createElementVNode("span",_hoisted_5$g,toDisplayString(_ctx.$t("fkui.sort-filter-dataset.clear.filter","Rensa sökfält")),1/* TEXT */)],8,_hoisted_4$i)):createCommentVNode("v-if",true)])]),_:1/* STABLE */})):createCommentVNode("v-if",true),createTextVNode(),_ctx.showSort?(openBlock(),createBlock(_component_i_flex_item,{key:1,shrink:"",align:"center"},{default:withCtx(()=>[createVNode(_component_f_select_field,{modelValue:_ctx.sortAttribute,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>_ctx.sortAttribute=$event),class:"sort-filter-dataset__sort",inline:"",onChange:_ctx.onChangeSortAttribute},{label:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t("fkui.sort-filter-dataset.label.sort","Sortera på")),1/* TEXT */)]),default:withCtx(()=>[createTextVNode(),createElementVNode("option",_hoisted_6$d,toDisplayString(_ctx.$t("fkui.sort-filter-dataset.label.unsorted","Välj")),1/* TEXT */),createTextVNode(),(openBlock(true),createElementBlock(Fragment,null,renderList(_ctx.sortOrders,sortOrder=>{return openBlock(),createElementBlock("option",{key:sortOrder.id,value:sortOrder},toDisplayString(sortOrder.name)+" ("+toDisplayString(sortOrder.ascendingName)+")\n ",9,_hoisted_7$b);}),128/* KEYED_FRAGMENT */))]),_:1/* STABLE */},8,["modelValue","onChange"])]),_:1/* STABLE */})):createCommentVNode("v-if",true)]),_:1/* STABLE */})]),_:1/* STABLE */})]),_:3/* FORWARDED */}),createTextVNode(),renderSlot(_ctx.$slots,"default",normalizeProps(guardReactiveProps({sortFilterResult:_ctx.sortFilterResult})))]);}const FSortFilterDataset=/* @__PURE__ */_export_sfc(_sfc_main$z,[["render",_sfc_render$z]]);const _sfc_main$y=defineComponent({name:"FDataTable",components:{FIcon},mixins:[TranslationMixin],provide(){return{addColumn:column=>{if(column.type===FTableColumnType.ACTION){throw new Error("Cannot use action column in FDataTable component");}this.columns=addColumn(this.columns,column);},setVisibilityColumn:(id,visible)=>{setVisibilityColumn(this.columns,id,visible);},textFieldTableMode:true};},inheritAttrs:false,props:{/**
461
+ * The rows to be listed.
462
+ * The rows will be listed in the given array order.
463
+ */rows:{type:Array,required:true},/**
464
+ * Unique attribute in rows.
465
+ */keyAttribute:{type:String,required:true},/**
466
+ * If `true` alternating rows will use a different background color.
467
+ */striped:{type:Boolean,default:false},/**
468
+ * Enable scrolling inside table.
469
+ *
470
+ * Can be one of the following values:
471
+ *
472
+ * - `"horizontal"`: Enables horizontal scrolling
473
+ * - `"vertical"`: Enables vertical scrolling
474
+ * - `"both"`: Enables scrolling in both directions
475
+ * - `"none"`: Disables scrolling (default)
476
+ */scroll:{type:String,default:TableScroll.NONE,validator:function(value){const types=Object.values(TableScroll);return types.includes(value);}}},setup(){return FSortFilterDatasetInjected();},data(){return{columns:[],emptyRow:emptyTableRow()};},computed:{hasCaption(){return hasSlot(this,"caption");},tableClasses(){const classes=[];if(this.striped){classes.push("table--striped");}return classes;},isEmpty(){return this.rows.length===0;},visibleColumns(){return this.columns.filter(col=>col.visible);},hasInitiateColumns(){return this.columns.length>0;},wrapperClasses(){return tableScrollClasses(this.scroll);},tabindex(){return this.scroll!==TableScroll.NONE?0:void 0;}},mounted(){this.registerCallbackOnSort(this.callbackOnSort);this.registerCallbackOnMount(this.callbackSortableColumns);},methods:{rowKey(item){const key=item[this.keyAttribute];if(typeof key==="undefined"){throw new Error(`Key attribute [${this.keyAttribute}]' is missing in row`);}return String(key);},columnClasses(column){const classes=["table__column",`table__column--${column.type}`,column.size];if(column.sortable){classes.push("table__column--sortable");}return classes;},iconClasses(column){return getSortableIconClasses(column);},iconName(column){return getSortableIconName(column);},onClickColumnHeader(column){if(!column.sortable){return;}let columnName=column.name;if(column.sort===FTableColumnSort.DESCENDING){columnName="";column.sort=FTableColumnSort.UNSORTED;}this.sort(columnName,column.sort!==FTableColumnSort.ASCENDING);},callbackOnSort(columnName,ascending){updateSortOrder(this.columns,columnName,ascending);},callbackSortableColumns(columnNames){setSortableColumns(this.columns,columnNames);},escapeNewlines(value){return value.replace(/\n/g,"<br/>");}}});const _hoisted_1$v=["tabindex"];const _hoisted_2$p={key:0};const _hoisted_3$m={class:"table__row"};const _hoisted_4$h=["innerHTML"];const _hoisted_5$f={key:1,class:"table__column__description"};const _hoisted_6$c={key:0};const _hoisted_7$a={key:1};const _hoisted_8$8=["colspan"];function _sfc_render$y(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");return openBlock(),createElementBlock("div",{class:normalizeClass(_ctx.wrapperClasses)},[createElementVNode("table",mergeProps({class:["table",_ctx.tableClasses],tabindex:_ctx.tabindex},_ctx.$attrs),[_ctx.hasCaption?(openBlock(),createElementBlock("caption",_hoisted_2$p,[renderSlot(_ctx.$slots,"caption")])):createCommentVNode("v-if",true),createTextVNode(),createElementVNode("colgroup",null,[(openBlock(true),createElementBlock(Fragment,null,renderList(_ctx.columns,column=>{return openBlock(),createElementBlock("col",{key:column.id,class:normalizeClass(column.size)},null,2/* CLASS */);}),128/* KEYED_FRAGMENT */))]),createTextVNode(),createElementVNode("thead",null,[createElementVNode("tr",_hoisted_3$m,[(openBlock(true),createElementBlock(Fragment,null,renderList(_ctx.visibleColumns,column=>{return openBlock(),createElementBlock("th",mergeProps({key:column.id,scope:"col",class:_ctx.columnClasses(column)},toHandlers(column.sortable?{click:()=>_ctx.onClickColumnHeader(column)}:{},true)),[createElementVNode("span",{innerHTML:_ctx.escapeNewlines(column.title)},null,8,_hoisted_4$h),createTextVNode(),column.sortable?(openBlock(),createBlock(_component_f_icon,{key:0,class:normalizeClass(_ctx.iconClasses(column)),name:_ctx.iconName(column)},null,8,["class","name"])):createCommentVNode("v-if",true),createTextVNode(),column.description?(openBlock(),createElementBlock("span",_hoisted_5$f,toDisplayString(column.description),1/* TEXT */)):createCommentVNode("v-if",true)],16/* FULL_PROPS */);}),128/* KEYED_FRAGMENT */))])]),createTextVNode(),createElementVNode("tbody",null,[!_ctx.hasInitiateColumns?(openBlock(),createElementBlock("tr",_hoisted_6$c,[renderSlot(_ctx.$slots,"default",normalizeProps(guardReactiveProps({row:_ctx.emptyRow})))])):createCommentVNode("v-if",true),createTextVNode(),_ctx.isEmpty?(openBlock(),createElementBlock("tr",_hoisted_7$a,[createElementVNode("td",{class:"table__column table__column--action",colspan:_ctx.columns.length},[renderSlot(_ctx.$slots,"empty",{},()=>[createTextVNode(toDisplayString(_ctx.$t("fkui.data-table.empty","Tabellen är tom")),1/* TEXT */)])],8,_hoisted_8$8)])):createCommentVNode("v-if",true),createTextVNode(),(openBlock(true),createElementBlock(Fragment,null,renderList(_ctx.rows,row=>{return openBlock(),createElementBlock("tr",{key:_ctx.rowKey(row),class:"table__row"},[renderSlot(_ctx.$slots,"default",mergeProps({ref_for:true},{row}))]);}),128/* KEYED_FRAGMENT */))])],16,_hoisted_1$v)],2/* CLASS */);}const FDataTable=/* @__PURE__ */_export_sfc(_sfc_main$y,[["render",_sfc_render$y]]);function isDayEnabled(day,config2){return passesMinDate(day,config2.minDate)&&passesMaxDate(day,config2.maxDate)&&passesInvalidDates(day,config2.invalidDates)&&passesInvalidWeekdays(day,config2.invalidWeekdays);}function passesMinDate(day,config2){if(!config2){throw new Error("MinDate validator must be set");}if(!config2.limit){throw new Error("Invalid minDate config");}return config2.limit<=day.toString();}function passesMaxDate(day,config2){if(!config2){throw new Error("MaxDate validator must be set");}if(!config2.limit){throw new Error("Invalid maxDate config");}return day.toString()<=config2.limit;}function passesInvalidDates(day,config2){if(!config2){return true;}if(!isInvalidDatesConfig(config2)){throw new Error("Invalid invalidDates config");}return!config2.dates.includes(day.toString());}function passesInvalidWeekdays(day,config2){if(!config2){return true;}if(!isInvalidWeekdaysConfig(config2)){throw new Error("Invalid invalidWeekdays config");}return!config2.days.includes(day.weekDay);}function updateCalendarValue(newValue){const newCalendarValue=FDate.fromIso(newValue);if(!newCalendarValue.isValid()){this.calendarValue=void 0;}else if(isInvalidMonth(newCalendarValue,this.minDate,this.maxDate)){this.calendarValue=void 0;}else if(!this.isDateEnabled(newCalendarValue)){this.calendarValue=void 0;}else if(!this.calendarValue||!this.calendarValue.equals(newCalendarValue)){this.calendarValue=newCalendarValue;}}function getDisplayMonth(minDate,maxDate,selectedDate,initialMonth){let effectiveDate;if(selectedDate&&selectedDate.isValid()){effectiveDate=selectedDate;}else if(initialMonth&&initialMonth.isValid()){effectiveDate=initialMonth;}else{effectiveDate=FDate.now();}let month;if(!isInvalidMonth(effectiveDate,minDate,maxDate)){month=effectiveDate.startOfMonth();}else if(isMonthBefore(effectiveDate,minDate)){month=minDate==null?void 0:minDate.startOfMonth();}else if(isMonthAfter(effectiveDate,maxDate)){month=maxDate==null?void 0:maxDate.startOfMonth();}return month||FDate.now().startOfMonth();}const _sfc_main$x=defineComponent({name:"FDatepickerField",components:{FCalendar,IPopup,FTextField,FIcon,FCalendarDay},mixins:[TranslationMixin],inheritAttrs:false,props:{/** Selected day.
477
+ * @model
478
+ */modelValue:{type:String,required:false,default:""},/**
479
+ * Initial month. Applies when no day is selected.
480
+ * If unspecified, todays month will be shown when no day is selected.
481
+ */initialMonth:{type:Object,required:false,default:void 0},/**
482
+ * Highlight today.
483
+ */highlightToday:{type:Boolean,required:false,default:true},/**
484
+ * Always display inline.
485
+ */alwaysInline:{type:Boolean,default:false},/**
486
+ * Set responsive width for label section.
487
+ *
488
+ * ```
489
+ * label-width="md-9 lg-6"
490
+ * ```
491
+ */labelWidth:{type:String,required:false,default:"sm-12"},/**
492
+ * Set responsive width for input section that wraps input element and icons.
493
+ *
494
+ * ```
495
+ * input-width="md-6 lg-3"
496
+ * ```
497
+ */inputWidth:{type:String,required:false,default:"sm-12"},/**
498
+ * Set to `true`, empty string `""` or string `"disabled"` to disable this field.
499
+ */disabled:{type:Boolean,required:false,default:false}},emits:["change","update:modelValue"],setup(){const defaultMinDate=FDate.now().addYears(-10);const defaultMaxDate=FDate.now().addYears(10);return{textFieldValue:ref(""),textFieldTouched:ref(false),textFieldValidityRevealed:ref(false),textFieldTableMode:inject("textFieldTableMode",false),componentTouched:ref(false),calendarMonth:shallowRef(getDisplayMonth(defaultMinDate,defaultMaxDate)),calendarValue:shallowRef(void 0),isCalendarOpen:ref(false),validationConfig:ref({}),minDate:shallowRef(defaultMinDate),maxDate:shallowRef(defaultMaxDate),calendarInputs:ref(null)};},computed:{calendarButtonText(){const{calendarValue}=this;if(calendarValue&&calendarValue.isValid()){const prettyDate=calendarValue.toString(DateFormat.FULL);const text=this.$t("fkui.datepicker-field.change","Ändra datum");return`${text} ${prettyDate}`;}else{return this.$t("fkui.datepicker-field.choose","Välj datum");}},popupClass(){return this.textFieldTableMode?"datepicker-field__popup datepicker-field__table":"datepicker-field__popup";}},watch:{modelValue:{async handler(value){if(value!==this.textFieldValue){await this.updateTextFieldValue(value);this.updateCalendarValue(value);}},immediate:true}},mounted(){ValidationService.addValidatorsToElement(getInputElement(this),{date:{},dateFormat:{},minDate:{limit:this.minDate.toString()},maxDate:{limit:this.maxDate.toString()}},true);},methods:{dateFormatter:parseDate,async onValidityTextField({detail}){if(this.textFieldValidityRevealed&&detail.validityMode==="INITIAL"){this.textFieldTouched=false;this.componentTouched=false;}if(!this.textFieldTouched&&["blur","change"].includes(detail.nativeEvent)){this.textFieldTouched=true;}if(this.isCalendarOpen){alertScreenReader(detail.validationMessage,{assertive:true});}this.textFieldValidityRevealed=detail.validityMode!=="INITIAL";if(detail.validityMode==="INITIAL"||!this.textFieldTouched||this.componentTouched){return;}const inputElement=getInputElement(this);const pendingValidityEvent=new CustomEvent("pending-validity",{bubbles:false});inputElement.dispatchEvent(pendingValidityEvent);},onChangeTextField(){this.updateCalendarValue(this.textFieldValue);this.$emit("update:modelValue",this.textFieldValue);this.$emit("change",this.textFieldValue);},onClickCalendarButton(){if(!this.isCalendarOpen){this.calendarMonth=getDisplayMonth(this.minDate,this.maxDate,this.calendarValue,this.initialMonth);}this.isCalendarOpen=!this.isCalendarOpen;},onFocusoutTextFieldButton(e){if(this.componentTouched||this.$refs.component===null){return;}const component=getHTMLElementFromVueRef(this.$refs.component);const relatedTarget=e.relatedTarget;if(!component.contains(relatedTarget)){this.componentTouched=true;const inputElement=getInputElement(this);ValidationService.setTouched(inputElement);ValidationService.validateElement(inputElement);}},async onSelectCalendarDay(date){this.componentTouched=true;this.isCalendarOpen=!this.isDateEnabled(date);if(!this.isCalendarOpen){getHTMLElementFromVueRef(this.$refs.calendarButton).focus();}this.$emit("update:modelValue",date.toString());this.$emit("change",date.toString());await this.updateTextFieldValue(date.toString());this.updateCalendarValue(date.toString());},async onKeyupEsc(){this.isCalendarOpen=false;waitForScreenReader(()=>{getHTMLElementFromVueRef(this.$refs.calendarButton).focus();});},async onClickCloseCalendarButton(){this.isCalendarOpen=false;waitForScreenReader(()=>{getHTMLElementFromVueRef(this.$refs.calendarButton).focus();});},onOpenPopup(){if(!this.isCalendarOpen){return;}const popup=getHTMLElementFromVueRef(this.$refs.popup);const navMonth=popup.querySelector(".calendar-navbar__month");if(navMonth){navMonth.focus({preventScroll:true});}},onClosePopup(){this.isCalendarOpen=false;},async onValidationConfigUpdate(event){this.validationConfig=event.detail.config;if(this.validationConfig.minDate){const minDateConfig=this.validationConfig.minDate;if(!minDateConfig.limit){throw new Error("MinDate validator must be set");}this.minDate=FDate.fromIso(minDateConfig.limit.toString());}if(this.validationConfig.maxDate){const maxDateConfig=this.validationConfig.maxDate;if(!maxDateConfig.limit){throw new Error("MaxDate validator must be set");}this.maxDate=FDate.fromIso(maxDateConfig.limit.toString());}const element=findHTMLElementFromVueRef(this.$refs.calendarInputs);if(element){await this.$nextTick();ValidationService.validateAllElements(element);}},isDateEnabled(day){return isDayEnabled(day,this.validationConfig);},isDaySelected(date){return this.calendarValue?date.equals(this.calendarValue):false;},highlightDay(date){return this.highlightToday&&date.equals(FDate.now());},async updateTextFieldValue(newValue){this.textFieldValue=newValue;await this.$nextTick();ValidationService.validateElement(getInputElement(this));},updateCalendarValue}});const _hoisted_1$u={ref:"component",class:"datepicker-field"};const _hoisted_2$o=["disabled","aria-expanded"];const _hoisted_3$l={class:"sr-only"};const _hoisted_4$g={class:"datepicker-field__close"};function _sfc_render$x(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");const _component_f_text_field=resolveComponent("f-text-field");const _component_f_calendar_day=resolveComponent("f-calendar-day");const _component_f_calendar=resolveComponent("f-calendar");const _component_i_popup=resolveComponent("i-popup");return openBlock(),createElementBlock("div",_hoisted_1$u,[createElementVNode("div",{ref:"calendarInputs",onFocusout:_cache[2]||(_cache[2]=(...args)=>_ctx.onFocusoutTextFieldButton&&_ctx.onFocusoutTextFieldButton(...args))},[createVNode(_component_f_text_field,mergeProps(_ctx.$attrs,{modelValue:_ctx.textFieldValue,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>_ctx.textFieldValue=$event),maxlength:"20",disabled:_ctx.disabled,formatter:_ctx.dateFormatter,"label-width":_ctx.labelWidth,"input-width":_ctx.inputWidth,onComponentValidity:_ctx.onValidityTextField,onChange:_ctx.onChangeTextField,onValidationConfigUpdate:_ctx.onValidationConfigUpdate}),createSlots({description:withCtx(({descriptionClass,discreteDescriptionClass})=>[renderSlot(_ctx.$slots,"description",normalizeProps(guardReactiveProps({descriptionClass,discreteDescriptionClass})))]),"error-message":withCtx(({hasError,validationMessage})=>[renderSlot(_ctx.$slots,"error-message",normalizeProps(guardReactiveProps({hasError,validationMessage})))]),"input-right":withCtx(()=>[createElementVNode("button",{ref:"calendarButton",disabled:_ctx.disabled,class:"datepicker-field__button",type:"button","aria-expanded":_ctx.isCalendarOpen?"true":"false","data-test":"calendar-button",onClick:_cache[0]||(_cache[0]=$event=>_ctx.onClickCalendarButton())},[createVNode(_component_f_icon,{name:"calendar"}),createTextVNode(),createElementVNode("span",_hoisted_3$l,toDisplayString(_ctx.calendarButtonText),1/* TEXT */)],8,_hoisted_2$o)]),default:withCtx(()=>[renderSlot(_ctx.$slots,"default",{},()=>[createTextVNode(toDisplayString(_ctx.$t("fkui.datepicker-field.label","Datum")),1/* TEXT */)]),createTextVNode(),createTextVNode(),createTextVNode(),createTextVNode()]),_:2/* DYNAMIC */},[_ctx.$slots.tooltip?{name:"tooltip",fn:withCtx(()=>[renderSlot(_ctx.$slots,"tooltip")]),key:"0"}:void 0]),1040,["modelValue","disabled","formatter","label-width","input-width","onComponentValidity","onChange","onValidationConfigUpdate"])],544/* NEED_HYDRATION, NEED_PATCH */),createTextVNode(),createVNode(_component_i_popup,{"is-open":_ctx.isCalendarOpen,anchor:_ctx.calendarInputs,inline:_ctx.alwaysInline?"always":void 0,"set-focus":false,onOpen:_ctx.onOpenPopup,onClose:_ctx.onClosePopup},{default:withCtx(()=>[createElementVNode("div",{ref:"popup",class:normalizeClass(_ctx.popupClass)},[createVNode(_component_f_calendar,{modelValue:_ctx.calendarMonth,"onUpdate:modelValue":_cache[3]||(_cache[3]=$event=>_ctx.calendarMonth=$event),"tab-date":_ctx.calendarValue,"min-date":_ctx.minDate,"max-date":_ctx.maxDate,onClick:_ctx.onSelectCalendarDay,onKeyup:withKeys(withModifiers(_ctx.onKeyupEsc,["stop"]),["esc","native"])},{default:withCtx(({date,isFocused})=>[createVNode(_component_f_calendar_day,{day:date,enabled:_ctx.isDateEnabled(date),focused:isFocused,highlight:_ctx.highlightDay(date),selected:_ctx.isDaySelected(date)},null,8,["day","enabled","focused","highlight","selected"])]),_:1/* STABLE */},8,["modelValue","tab-date","min-date","max-date","onClick","onKeyup"]),createTextVNode(),createElementVNode("div",_hoisted_4$g,[createElementVNode("button",{class:"button button--discrete button--discrete--black datepicker-field__close__button",type:"button",onClick:_cache[4]||(_cache[4]=(...args)=>_ctx.onClickCloseCalendarButton&&_ctx.onClickCloseCalendarButton(...args)),onKeyup:_cache[5]||(_cache[5]=withKeys(withModifiers((...args)=>_ctx.onKeyupEsc&&_ctx.onKeyupEsc(...args),["stop"]),["esc"]))},[createElementVNode("span",null,toDisplayString(_ctx.$t("fkui.datepicker-field.close","Stäng")),1/* TEXT */),createTextVNode(),createVNode(_component_f_icon,{"aria-hidden":"true",class:"button__icon",name:"close"})],32/* NEED_HYDRATION */)])],2/* CLASS */)]),_:1/* STABLE */},8,["is-open","anchor","inline","onOpen","onClose"])],512/* NEED_PATCH */);}const FDatepickerField=/* @__PURE__ */_export_sfc(_sfc_main$x,[["render",_sfc_render$x]]);const _sfc_main$w=defineComponent({name:"FExpand",data(){return{height:0,initialStyle:{overflow:"hidden",transition:"height 400ms cubic-bezier(0.46, 0.03, 0.52, 0.96)"},hiddenStyle:{height:"auto",position:"absolute",visibility:"hidden"},visibleStyle:{width:"",position:"",visibility:"",height:"0px"},openedStyle:{height:"auto"}};},methods:{enter(element){const htmlElement=getHTMLElementFromVueRef(element);Object.assign(htmlElement.style,this.initialStyle);Object.assign(htmlElement.style,this.hiddenStyle);htmlElement.style.width=getComputedStyle(element).width;const height=getComputedStyle(element).height;Object.assign(htmlElement.style,this.visibleStyle);getComputedStyle(element).height;setTimeout(()=>{this.height=parseInt(height,10);htmlElement.style.height=height;});},afterEnter(element){const htmlElement=getHTMLElementFromVueRef(element);Object.assign(htmlElement.style,this.openedStyle);},leave(element){const htmlElement=getHTMLElementFromVueRef(element);const height=getComputedStyle(element).height;htmlElement.style.height=height;getComputedStyle(element).height;setTimeout(()=>{Object.assign(htmlElement.style,this.visibleStyle);});}}});function _sfc_render$w(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createBlock(Transition,{onEnter:_ctx.enter,onAfterEnter:_ctx.afterEnter,onLeave:_ctx.leave},{default:withCtx(()=>[renderSlot(_ctx.$slots,"default",{height:_ctx.height})]),_:3/* FORWARDED */},8,["onEnter","onAfterEnter","onLeave"]);}const FExpand=/* @__PURE__ */_export_sfc(_sfc_main$w,[["render",_sfc_render$w]]);const _sfc_main$v=defineComponent({name:"FExpandablePanel",components:{FIcon,FExpand},mixins:[TranslationMixin],inheritAttrs:false,props:{/**
500
+ * Toggle expanded/collapsed state
501
+ */expanded:{type:Boolean,required:false,default:false},/**
502
+ * Element to render for the header element inside the expandable panel.
503
+ * 'h1', 'h2', 'h3', 'h4', 'h5' and 'h6' is valid.
504
+ */headerTag:{default:"h2",required:false,validator(value){return["h1","h2","h3","h4","h5","h6"].includes(value);}},/**
505
+ * The id for the content id attribute.
506
+ * If the prop is not set the id will be generated.
507
+ */id:{type:String,required:false,default:()=>ElementIdService.generateElementId()},/**
508
+ * Number of notifications present in panel.
509
+ *
510
+ * If set to zero (default) no notification badge will be displayed.
511
+ */notifications:{type:Number,required:false,default:0},screenReaderNotificationTemplate:{type:String,required:false,default:"Du har %VALUE% notifieringar."}},emits:["toggle"],computed:{expandedClass(){return this.expanded?"expandable-panel--expanded":"expandable-panel--collapsed";},hasOutsideSlot(){return hasSlot(this,"outside");},haveNotifications(){return this.notifications>0;},screenReaderNotificationText(){return`${this.screenReaderNotificationTemplate.replace("%VALUE%",this.notifications.toString())}`;}},methods:{onClickHeadingButton(event){this.$emit("toggle",event);}}});const _hoisted_1$t=["aria-expanded","aria-controls"];const _hoisted_2$n={class:"expandable-panel__icon"};const _hoisted_3$k={class:"icon-stack"};const _hoisted_4$f=["title"];const _hoisted_5$e={class:"sr-only"};const _hoisted_6$b=["id"];const _hoisted_7$9={class:"expandable-panel__body"};const _hoisted_8$7={key:0,class:"expandable-panel__outside"};function _sfc_render$v(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");const _component_f_expand=resolveComponent("f-expand");return openBlock(),createElementBlock("div",{class:normalizeClass(["expandable-panel",_ctx.expandedClass])},[(openBlock(),createBlock(resolveDynamicComponent(_ctx.headerTag),{class:"expandable-panel__heading"},{default:withCtx(()=>[createElementVNode("button",mergeProps({type:"button","aria-expanded":_ctx.expanded?"true":"false","aria-controls":_ctx.id},_ctx.$attrs,{onClick:_cache[0]||(_cache[0]=(...args)=>_ctx.onClickHeadingButton&&_ctx.onClickHeadingButton(...args))}),[createElementVNode("span",_hoisted_2$n,[createElementVNode("span",_hoisted_3$k,[createVNode(_component_f_icon,{name:"dash"}),createTextVNode(),createVNode(_component_f_icon,{name:"dash"})])]),createTextVNode(),renderSlot(_ctx.$slots,"title"),createTextVNode(),_ctx.haveNotifications?(openBlock(),createElementBlock("span",{key:0,class:"expandable-panel__notification",title:_ctx.$t("fkui.expandable-panel.notification.title","{{ count }} notifiering{{ suffix }}",{count:_ctx.notifications,suffix:_ctx.notifications>1?"ar":""})},[createElementVNode("span",_hoisted_5$e,toDisplayString(_ctx.screenReaderNotificationText),1/* TEXT */),createTextVNode(),createVNode(_component_f_icon,{name:"bell"})],8,_hoisted_4$f)):createCommentVNode("v-if",true)],16,_hoisted_1$t)]),_:3/* FORWARDED */})),createTextVNode(),createVNode(_component_f_expand,null,{default:withCtx(()=>[withDirectives(createElementVNode("div",{id:_ctx.id,class:"expandable-panel__content"},[createElementVNode("div",_hoisted_7$9,[renderSlot(_ctx.$slots,"default")]),createTextVNode(),_ctx.hasOutsideSlot?(openBlock(),createElementBlock("div",_hoisted_8$7,[renderSlot(_ctx.$slots,"outside")])):createCommentVNode("v-if",true)],8,_hoisted_6$b),[[vShow,_ctx.expanded]])]),_:3/* FORWARDED */})],2/* CLASS */);}const FExpandablePanel=/* @__PURE__ */_export_sfc(_sfc_main$v,[["render",_sfc_render$v]]);const _sfc_main$u=defineComponent({name:"FExpandableParagraph",components:{FIcon,FExpand},inheritAttrs:false,props:{/**
512
+ * Toggle expanded/collapsed state
513
+ */expanded:{type:Boolean,required:false,default:false},/**
514
+ * Element to render for the button elmement
515
+ * 'span', 'h1', 'h2', 'h3', 'h4', 'h5' and 'h6' is valid.
516
+ */headerTag:{default:"span",required:false,validator(value){return["h1","h2","h3","h4","h5","h6","span"].includes(value);}},/**
517
+ * Visual header size for the button element.
518
+ * 'h1', 'h2', 'h3', 'h4', 'h5' and 'h6' is valid.
519
+ * If not used, the default styling will be h4
520
+ */headerVisualTag:{type:String,default:"",required:false,validator(value){return["","h1","h2","h3","h4","h5","h6"].includes(value);}},/**
521
+ * Toggle list style of component
522
+ */list:{type:Boolean,default:false,required:false},/**
523
+ * The id for the content id attribute.
524
+ * If the prop is not set the id will be generated.
525
+ */id:{type:String,required:false,default:()=>ElementIdService.generateElementId()}},emits:["toggle"],computed:{expandedClass(){return this.expanded?"expandable-paragraph--open":"expandable-paragraph--closed";},listClass(){return this.list?"expandable-paragraph--list":"";},relatedClass(){return this.hasRelatedSlot?"expandable-paragraph--related-information":"";},hasRelatedSlot(){return hasSlot(this,"related");},headerVisualClass(){return`heading--${this.headerVisualTag||"h4"}`;}},methods:{onClickMinimize(event){this.$emit("toggle",event);}}});const _hoisted_1$s=["aria-expanded","aria-controls"];const _hoisted_2$m={class:"expandable-paragraph__icon"};const _hoisted_3$j={class:"icon-stack"};const _hoisted_4$e={key:0,class:"expandable-paragraph__related-information"};const _hoisted_5$d=["id"];const _hoisted_6$a={class:"expandable-paragraph__content"};const _hoisted_7$8={key:0,class:"expandable-paragraph__separator"};function _sfc_render$u(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");const _component_f_expand=resolveComponent("f-expand");return openBlock(),createElementBlock("div",{class:normalizeClass(["expandable-paragraph",[_ctx.expandedClass,_ctx.listClass]])},[createElementVNode("div",{class:normalizeClass(_ctx.relatedClass)},[(openBlock(),createBlock(resolveDynamicComponent(_ctx.headerTag),{class:normalizeClass(["expandable-paragraph__heading",_ctx.headerVisualClass])},{default:withCtx(()=>[createElementVNode("button",mergeProps({type:"button",class:"expandable-paragraph__button","aria-expanded":_ctx.expanded?"true":"false","aria-controls":_ctx.id},_ctx.$attrs,{onClick:_cache[0]||(_cache[0]=(...args)=>_ctx.onClickMinimize&&_ctx.onClickMinimize(...args))}),[createElementVNode("span",_hoisted_2$m,[createElementVNode("span",_hoisted_3$j,[createVNode(_component_f_icon,{name:"dash"}),createTextVNode(),createVNode(_component_f_icon,{name:"dash"})])]),createTextVNode(),renderSlot(_ctx.$slots,"title")],16,_hoisted_1$s)]),_:3/* FORWARDED */},8,["class"])),createTextVNode(),_ctx.hasRelatedSlot?(openBlock(),createElementBlock("div",_hoisted_4$e,[renderSlot(_ctx.$slots,"related")])):createCommentVNode("v-if",true)],2/* CLASS */),createTextVNode(),createVNode(_component_f_expand,null,{default:withCtx(()=>[withDirectives(createElementVNode("div",{id:_ctx.id,class:"expandable-paragraph__container"},[createElementVNode("div",_hoisted_6$a,[renderSlot(_ctx.$slots,"default")]),createTextVNode(),!_ctx.list?(openBlock(),createElementBlock("div",_hoisted_7$8)):createCommentVNode("v-if",true)],8,_hoisted_5$d),[[vShow,_ctx.expanded]])]),_:3/* FORWARDED */})],2/* CLASS */);}const FExpandableParagraph=/* @__PURE__ */_export_sfc(_sfc_main$u,[["render",_sfc_render$u]]);const DEFAULT_ICON="file";const iconMap={"image/*":"pic","application/msword":"doc","application/pdf":"pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.template":"doc"};const _sfc_main$t=defineComponent({name:"FFileItem",components:{FIcon},inheritAttrs:false,props:{/**
526
+ * The id for the input id attribute.
527
+ * The id for the label for attribute.
528
+ * If the prop is not set a random value will be generated.
529
+ */id:{type:String,required:false,default:()=>ElementIdService.generateElementId()},/**
530
+ * The file name.
531
+ */fileName:{type:String,required:true},/**
532
+ * The mime type, can be changed if i.e server change the name.
533
+ */mimeType:{type:String,required:false,default:void 0},/**
534
+ * The name of the file uploaded
535
+ */originalMimeType:{type:String,required:false,default:void 0},/**
536
+ * If file name changed, this info will be displayed, placeholder %before% and %after% will be replaced with originalMimeType and mimeType
537
+ */changedMimeTypeText:{type:String,required:false,default:void 0}},computed:{isMimeTypeChanged(){return isSet(this.originalMimeType)&&this.originalMimeType!==this.mimeType;},mimeTypeChangedText(){var _this$changedMimeType;const originalMimeType=(this.originalMimeType||"").split("/").pop()||"";const currentMimeType=(this.mimeType||"").split("/").pop()||"";const localChangedMimeTypeText=(_this$changedMimeType=this.changedMimeTypeText)!==null&&_this$changedMimeType!==void 0?_this$changedMimeType:this.$t("fkui.file-item.changed-mime-type.text","(%before% ändrad till %after%)");return localChangedMimeTypeText.replace("%before%",originalMimeType).replace("%after%",currentMimeType);},iconName(){const{mimeType}=this;if(!mimeType){return DEFAULT_ICON;}if(iconMap[mimeType]){return iconMap[mimeType];}const p=mimeType.split("/",1);const wildcard=[p[0],"*"].join("/");if(iconMap[wildcard]){return iconMap[wildcard];}return DEFAULT_ICON;}}});const _hoisted_1$r={class:"file-item"};const _hoisted_2$l={class:"file-item__row"};const _hoisted_3$i=["id"];const _hoisted_4$d={class:"icon-stack button__icon icon-stack--new-window"};const _hoisted_5$c={class:"file-item__file-name"};const _hoisted_6$9={class:"sr-only"};const _hoisted_7$7={key:0,class:"file-item__change-info"};const _hoisted_8$6=/* @__PURE__ */createElementVNode("hr",{class:"file-item__separator"},null,-1/* HOISTED */);function _sfc_render$t(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");return openBlock(),createElementBlock("div",_hoisted_1$r,[createElementVNode("div",_hoisted_2$l,[createElementVNode("a",mergeProps({id:_ctx.id,class:"file-item__file-open"},_ctx.$attrs),[createElementVNode("div",_hoisted_4$d,[createVNode(_component_f_icon,{name:"new-window"}),createTextVNode(),createVNode(_component_f_icon,{name:_ctx.iconName},null,8,["name"])]),createTextVNode(),createElementVNode("span",_hoisted_5$c,toDisplayString(_ctx.fileName),1/* TEXT */),createTextVNode(),createElementVNode("span",_hoisted_6$9," "+toDisplayString(_ctx.$t("fkui.file-item.file-open","öppnas i nytt fönster")),1/* TEXT */)],16,_hoisted_3$i),createTextVNode(),renderSlot(_ctx.$slots,"row")]),createTextVNode(),renderSlot(_ctx.$slots,"default"),createTextVNode(),_ctx.isMimeTypeChanged?(openBlock(),createElementBlock("div",_hoisted_7$7,toDisplayString(_ctx.mimeTypeChangedText),1/* TEXT */)):createCommentVNode("v-if",true),createTextVNode(),_hoisted_8$6]);}const FFileItem=/* @__PURE__ */_export_sfc(_sfc_main$t,[["render",_sfc_render$t]]);const _sfc_main$s=defineComponent({name:"FFileSelector",components:{FIcon},inheritAttrs:false,model:{prop:"files",event:"change"},props:{/**
538
+ * The id for the input id attribute.
539
+ * The id for the label for attribute.
540
+ * If the prop is not set a random value will be generated.
541
+ */id:{type:String,required:false,default:()=>ElementIdService.generateElementId()},disabled:{type:Boolean,required:false,default:false}},emits:["change"],computed:{attrs(){return{...this.$attrs,id:this.id,onChange:event=>{if(event.target instanceof HTMLInputElement){this.$emit("change",event.target.files);}}};},labelClass(){return this.disabled?"disabled":"enabled";},labelId(){return`${this.id}_label`;},ariaDisabled(){return this.disabled?"true":void 0;}},methods:{onClick(event){if(this.disabled){event.preventDefault();return;}const input=this.$refs["file-selector"];input.value="";}}});const _hoisted_1$q={class:"file-selector"};const _hoisted_2$k=["id","aria-labelledby","aria-disabled"];const _hoisted_3$h=["id","for"];function _sfc_render$s(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");return openBlock(),createElementBlock("div",_hoisted_1$q,[createElementVNode("input",mergeProps({id:_ctx.id,ref:"file-selector",type:"file","aria-labelledby":_ctx.labelId,"aria-disabled":_ctx.ariaDisabled?"true":void 0},_ctx.attrs,{onClick:_cache[0]||(_cache[0]=(...args)=>_ctx.onClick&&_ctx.onClick(...args))}),null,16,_hoisted_2$k),createTextVNode(),createElementVNode("label",{id:_ctx.labelId,role:"button",class:normalizeClass([_ctx.labelClass,"button button--tertiary button--medium"]),for:_ctx.id,"aria-hidden":"true"},[createVNode(_component_f_icon,{class:"button__icon",name:"paper-clip"}),createTextVNode(),renderSlot(_ctx.$slots,"default")],10,_hoisted_3$h)]);}const FFileSelector=/* @__PURE__ */_export_sfc(_sfc_main$s,[["render",_sfc_render$s]]);const iconClasses={success:{symbol:"circle",sign:"success",screenReaderContextKey:"fkui.message-box.sr-context.success",screenReaderContextDefault:"Meddelande"},warning:{symbol:"circle",sign:"alert",screenReaderContextKey:"fkui.message-box.sr-context.warning",screenReaderContextDefault:"Varningsmeddelande"},error:{symbol:"triangle",sign:"alert",screenReaderContextKey:"fkui.message-box.sr-context.error",screenReaderContextDefault:"Felmeddelande"},info:{symbol:"circle",sign:"i",screenReaderContextKey:"fkui.message-box.sr-context.info",screenReaderContextDefault:"Informationsmeddelande"}};const _sfc_main$r=defineComponent({name:"FMessageBox",components:{FIcon,IFlex,IFlexItem},props:{/**
542
+ * Type of message-box. 'success', 'error', 'warning' and 'info' is valid.
543
+ * */type:{type:String,required:true,validator(value){return["success","warning","error","info"].includes(value);}},/**
544
+ * If message-box should be a banner.
545
+ * If prop is not used message-box will have default styling.
546
+ */banner:{type:Boolean,required:false},/**
547
+ * It is important to provide a context for a screenreader, similar to a modal that initially outputs it is a dialog.
548
+ * Type-specific screenreader context is output by default in this component.
549
+ * By setting this property to false no context will be output.
550
+ * Note that by doing this, it is the applications responsiblity to provide a clear context.
551
+ */provideScreenReaderContext:{type:Boolean,required:false,default:true},/**
552
+ * Select standard or short layout.
553
+ *
554
+ * - 'normal' - Use normal layout when need for heading and/or longer text/multiple sentences
555
+ * - 'short' - Use short layout when only need for shorter text
556
+ */layout:{type:String,required:false,default:"standard",validator(value){return["standard","short"].includes(value);}}},data(){return{headingClass:["message-box__heading"]};},computed:{messageBoxType(){if(this.layout==="short"){return`message-box--${this.type}-short`;}else{return`message-box--${this.type}`;}},bannerType(){return this.banner?`message-box--banner`:"";},classType(){return`icon__${this.type}`;},classIcon(){return iconClasses[this.type].symbol==="circle"&&iconClasses[this.type].sign==="alert"?`icon__exclamation`:"";},stackTypeClass(){return`icon-stack--${this.type}`;},symbol(){return iconClasses[this.type].symbol;},sign(){return iconClasses[this.type].sign;}},methods:{screenReaderContext(){return TranslationService.provider.translate(iconClasses[this.type].screenReaderContextKey,iconClasses[this.type].screenReaderContextDefault);}}});const _hoisted_1$p={key:0,class:"sr-only"};function _sfc_render$r(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");const _component_i_flex_item=resolveComponent("i-flex-item");const _component_i_flex=resolveComponent("i-flex");return openBlock(),createElementBlock("div",{class:normalizeClass(["message-box",[_ctx.messageBoxType,_ctx.bannerType]])},[_ctx.provideScreenReaderContext?(openBlock(),createElementBlock("span",_hoisted_1$p,toDisplayString(_ctx.screenReaderContext()),1/* TEXT */)):createCommentVNode("v-if",true),createTextVNode(),createVNode(_component_i_flex,{gap:"2x"},{default:withCtx(()=>[_ctx.layout==="short"?(openBlock(),createBlock(_component_i_flex_item,{key:0,class:"message-box__icon",shrink:"",align:"center"},{default:withCtx(()=>[createElementVNode("span",{class:normalizeClass(["icon-stack",_ctx.stackTypeClass])},[createVNode(_component_f_icon,{class:normalizeClass(_ctx.classType),name:_ctx.symbol},null,8,["class","name"]),createTextVNode(),createVNode(_component_f_icon,{class:normalizeClass(_ctx.classIcon),name:_ctx.sign},null,8,["class","name"])],2/* CLASS */)]),_:1/* STABLE */})):createCommentVNode("v-if",true),createTextVNode(),createVNode(_component_i_flex_item,{class:"message-box__content",grow:"",align:"center"},{default:withCtx(()=>[renderSlot(_ctx.$slots,"default",normalizeProps(guardReactiveProps(_ctx.layout==="short"?{}:{headingSlotClass:_ctx.headingClass})))]),_:3/* FORWARDED */})]),_:3/* FORWARDED */})],2/* CLASS */);}const FMessageBox=/* @__PURE__ */_export_sfc(_sfc_main$r,[["render",_sfc_render$r]]);const setRef=Symbol("setRef");const getRef=Symbol("getRef");const setIsOpen=Symbol("setIsOpen");function createFFormProvideOptions(vm){const{components}=vm;return{[setRef](id,data){components[id]=new Reference(data);},[getRef](id){return components[id];},[setIsOpen](id,isOpen){const steps=Object.values(components).filter(isFormStepReference);for(const step2 of steps){step2.ref.isOpen=false;}const step=components[id];if(isFormStepReference(step)){step.ref.isOpen=isOpen;}}};}const _sfc_main$q=defineComponent({name:"FForm",components:{FMessageBox,FErrorList},provide(){return createFFormProvideOptions(this);},inheritAttrs:false,props:{/**
557
+ * The id for the form id attribute.
558
+ * If the prop is not set a random value will be generated.
559
+ */id:{type:String,required:false,default:()=>ElementIdService.generateElementId()},/**
560
+ * If the error-message slot and the invalid elements list
561
+ * should be displayed.
562
+ */displayError:{type:Boolean,default:true},/**
563
+ * If invalid fields at submit this tells how the scroll to the error
564
+ * field should occur. The default, "center", centres the error information
565
+ * vertically. Allowed value is also "top" which scrolls such that the error
566
+ * informations top is at the top of the viewport.
567
+ */errorScroll:{type:String,default:"center",validator(value){return["center","top"].includes(value);}}},data(){return{errorMessageSlotClass:["message-box__heading"],components:{}};},computed:{attrs(){let onSubmit;if(this.$attrs.onSubmit){const originalSubmit=this.$attrs.onSubmit;onSubmit=async event=>{const isValid=await this.onSubmit(event);if(isValid){if(Array.isArray(originalSubmit)){originalSubmit.forEach(submitFunction=>submitFunction(event));}else{originalSubmit(event);}}};}else{onSubmit=this.onSubmit;}const attrs={...this.$attrs,id:this.id,onSubmit};return attrs;},numberOfTimesSubmitted(){const components=Object.values(this.components);return Math.max(0,...components.map(it=>it.ref.numberOfTimesSubmitted));},isSubmitted(){return this.numberOfTimesSubmitted>0;},hasError(){if(Object.values(this.components).length===0){return false;}else{const components=Object.values(this.components);return components.some(component=>component.ref.isValid===false);}},componentsWithErrors(){const sortedComponents=sortComponentsWithErrorsOnDOMOrder(this.components);return sortedComponents.map(c=>c.ref);},needsErrorScroll(){return this.errorScroll!=="center";}},methods:{async focusDomElement(){await this.$nextTick();const messageBoxError=this.$el.querySelector(".message-box--error");if(messageBoxError){focus$1(messageBoxError,{scrollToTop:this.needsErrorScroll});}},async focusFallbackElement(){await this.$nextTick();const element=this.$el.querySelector(".form-step__header");const invalidElement=this.$el.querySelector(":invalid");if(element){focus$1(element,{scrollToTop:this.needsErrorScroll});}else if(invalidElement){focus$1(invalidElement,{force:true,scrollToTop:this.needsErrorScroll});}},async onSubmit(event){event.preventDefault();const components=Object.values(this.components);components.forEach(component=>{component.ref.numberOfTimesSubmitted++;if(!isFormStepReference(component)){ValidationService.setTouched(component.ref.id);ValidationService.setSubmitted(component.ref.id);}});await cleanUpElements(this);await ValidationService.validateAllElements(this.id);if(this.displayError){this.focusDomElement();}else{this.focusFallbackElement();}return this.hasError===false;},async onComponentValidity(event){const reference=new Reference({id:event.detail.elementId,focusElementId:event.detail.focusElementId,title:event.detail.errorMessage,isValid:event.detail.isValid,numberOfTimesSubmitted:this.numberOfTimesSubmitted});this.components[event.detail.elementId]=reference;await cleanUpElements(this);}}});const _hoisted_1$o=["id"];function _sfc_render$q(_ctx,_cache,$props,$setup,$data,$options){const _component_f_error_list=resolveComponent("f-error-list");const _component_f_message_box=resolveComponent("f-message-box");return openBlock(),createElementBlock("form",mergeProps({id:_ctx.id,class:"form",novalidate:""},_ctx.attrs,{onComponentValidity:_cache[0]||(_cache[0]=(...args)=>_ctx.onComponentValidity&&_ctx.onComponentValidity(...args))}),[_ctx.displayError&&_ctx.isSubmitted&&_ctx.hasError?(openBlock(),createBlock(_component_f_message_box,{key:0,tabindex:"-1",type:"error"},{default:withCtx(()=>[renderSlot(_ctx.$slots,"error-message",normalizeProps(guardReactiveProps({slotClass:_ctx.errorMessageSlotClass}))),createTextVNode(),createElementVNode("nav",null,[createVNode(_component_f_error_list,{items:_ctx.componentsWithErrors},null,8,["items"])])]),_:3/* FORWARDED */})):createCommentVNode("v-if",true),createTextVNode(),renderSlot(_ctx.$slots,"default")],16,_hoisted_1$o);}const FForm=/* @__PURE__ */_export_sfc(_sfc_main$q,[["render",_sfc_render$q]]);const _sfc_main$p=defineComponent({name:"FFormStep",components:{FIcon,FValidationGroup,FErrorList},mixins:[TranslationMixin],inheritAttrs:false,props:{/**
568
+ * The id for the root div id attribute.
569
+ * If the prop is not set a random value will be generated.
570
+ */id:{type:String,required:true,default:()=>ElementIdService.generateElementId()},/**
571
+ * If the form step should have a bottom arrow.
572
+ * It is recommended to remove the arrow for the last step with `:has-arrow="false"`.
573
+ */hasArrow:{type:Boolean,default:true},/**
574
+ * If the form step is the last step.
575
+ * If set to true the form step will have a bigger bottom margin.
576
+ */isLastStep:{type:Boolean,default:false},/**
577
+ * If error links should be disabled, `:disable-error-links="true"`..
578
+ * If `true`, errors will be displayed as text instead.
579
+ */disableErrorLinks:{type:Boolean,default:false}},setup(){return{setRef:inject(setRef),getRef:inject(getRef),setIsOpen:inject(setIsOpen)};},data(){return{self:new Reference({isOpen:false,numberOfTimesSubmitted:0,isAnyFieldTouched:false,isValid:true,id:this.id,focusElementId:`${this.id}-error`,title:""}),hasBeenValid:false,isOpenedClosed:false,headerSlotClass:["form-step__title"],stepErrorId:`${this.id}-error`,groupValidity:{isValid:false,componentsWithError:[],componentCount:0}};},computed:{attrs(){return{...this.$attrs,class:{"form-step--complete":this.self.ref.isValid,"form-step--last-step":this.isLastStep}};},defaultErrorMessage(){return this.$t("fkui.form-step.errorlist.title","Oj, du har glömt att fylla i något. Gå till:");},// eslint-disable-next-line @typescript-eslint/no-explicit-any -- technical debt, not sure what is going on here
580
+ injected(){return this;},isSubmitted(){return this.self.ref.numberOfTimesSubmitted>0;},componentsWithError(){return this.groupValidity.componentsWithError.map(c=>({id:this.disableErrorLinks?void 0:c.elementId,focusElementId:c.focusElementId,title:c.errorMessage}));},hasError(){return this.groupValidity.componentsWithError.length>0;},displayErrorList(){return(this.isOpenedClosed||this.hasBeenValid||this.isSubmitted)&&this.hasError;},validationGroupKey(){return`${this.id}-group`;}},watch:{"self.ref.numberOfTimesSubmitted":{handler(){ValidationService.setSubmitted(this.$el);ValidationService.validateAllElements(this.id);}},groupValidity:{immediate:true,handler(){this.self.ref.isValid=this.groupValidity.isValid;if(this.hasBeenValid===false){this.hasBeenValid=this.groupValidity.isValid;}}}},async mounted(){await this.$nextTick();this.loadSelf();this.injected.setRef(this.id,this.self.ref);this.loadSelf();this.updateSelfRefTitle();},beforeUpdate(){this.updateSelfRefTitle();},methods:{updateSelfRefTitle(){const[firstSlotClass]=this.headerSlotClass;const headerElement=this.$el.querySelector(`.${firstSlotClass}`);if(headerElement&&headerElement.textContent){this.self.ref.title=headerElement.textContent;}},loadSelf(){const ref2=this.injected.getRef(this.id);Object.assign(this.self,ref2);},async focusDomElement(){await this.$nextTick();if(this.hasError&&this.self.ref.isAnyFieldTouched){const formStepError=this.$el.querySelector(".form-step__error");focus$1(formStepError);}else{const formStepHeader=this.$el.querySelector(".form-step__header");focus$1(formStepHeader);}},async beforeNavigateToError(){this.injected.setIsOpen(this.id,true);await this.$nextTick();},/**
581
+ * Toggle if open or closed.
582
+ * If another form step is open then it will be closed.
583
+ * @public
584
+ */toggleIsOpen(){this.injected.setIsOpen(this.id,!this.self.ref.isOpen);if(this.self.ref.isAnyFieldTouched&&this.self.ref.isOpen===false){if(this.isOpenedClosed===false){this.isOpenedClosed=true;}ValidationService.setTouched(this.$el);ValidationService.validateAllElements(this.id);}this.focusDomElement();},onComponentValidity(event){const hasReceivedValidOrErrorEvent=event.detail.validityMode==="VALID"||event.detail.validityMode==="ERROR";if(hasReceivedValidOrErrorEvent&&this.self.ref.isOpen){this.self.ref.isAnyFieldTouched=true;}}}});const _hoisted_1$n={class:"form-step__header",tabindex:"-1",role:"group"};const _hoisted_2$j=["id"];const _hoisted_3$g={key:0,class:"form-step__arrow"};function _sfc_render$p(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");const _component_f_error_list=resolveComponent("f-error-list");const _component_f_validation_group=resolveComponent("f-validation-group");return openBlock(),createBlock(_component_f_validation_group,mergeProps({id:_ctx.id},_ctx.attrs,{key:_ctx.validationGroupKey,modelValue:_ctx.groupValidity,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>_ctx.groupValidity=$event),class:"form-step","stop-propagation":true}),{default:withCtx(()=>[createElementVNode("div",_hoisted_1$n,[renderSlot(_ctx.$slots,"header",normalizeProps(guardReactiveProps({slotClass:_ctx.headerSlotClass,..._ctx.self.ref,toggleIsOpen:_ctx.toggleIsOpen}))),createTextVNode(),_ctx.self.ref.isValid?(openBlock(),createBlock(_component_f_icon,{key:0,class:"form-step__check",name:"success"})):createCommentVNode("v-if",true)]),createTextVNode(),_ctx.displayErrorList?(openBlock(),createElementBlock("div",{key:0,id:_ctx.stepErrorId,class:"form-step__error",tabindex:"-1",role:"group"},[createElementVNode("nav",null,[createVNode(_component_f_error_list,{bullets:true,items:_ctx.componentsWithError,"before-navigate":_ctx.beforeNavigateToError},{title:withCtx(()=>[renderSlot(_ctx.$slots,"error-message",{},()=>[createTextVNode(toDisplayString(_ctx.defaultErrorMessage),1/* TEXT */)])]),_:3/* FORWARDED */},8,["items","before-navigate"])])],8,_hoisted_2$j)):createCommentVNode("v-if",true),createTextVNode(),createElementVNode("div",{onComponentValidity:_cache[0]||(_cache[0]=(...args)=>_ctx.onComponentValidity&&_ctx.onComponentValidity(...args))},[renderSlot(_ctx.$slots,"default",normalizeProps(guardReactiveProps({..._ctx.self.ref,isSubmitted:_ctx.isSubmitted,toggleIsOpen:_ctx.toggleIsOpen}))),createTextVNode(),_ctx.hasArrow?(openBlock(),createElementBlock("span",_hoisted_3$g)):createCommentVNode("v-if",true)],32/* NEED_HYDRATION */)]),_:3/* FORWARDED */},16,["id","modelValue"]);}const FFormStep=/* @__PURE__ */_export_sfc(_sfc_main$p,[["render",_sfc_render$p]]);const _sfc_main$o=defineComponent({name:"FFormStepButton",components:{FIcon},mixins:[TranslationMixin],inheritAttrs:false,model:{prop:"sr-only"},props:{/**
585
+ * If the id is not set a random value will be generated.
586
+ */id:{type:String,required:false,default:()=>ElementIdService.generateElementId()},isOpen:Boolean,isAnyFieldTouched:Boolean,additionalScreenreaderText:{type:String,required:false,default:""}}});const _hoisted_1$m=["id","aria-expanded"];const _hoisted_2$i={class:"sr-only"};function _sfc_render$o(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");return openBlock(),createElementBlock("button",mergeProps({id:_ctx.id,class:"button button--margin-bottom-0 button--large",type:"button"},_ctx.$attrs,{"aria-expanded":_ctx.isOpen?"true":"false","data-form-step-button":""}),[_ctx.isOpen?(openBlock(),createElementBlock(Fragment,{key:0},[createVNode(_component_f_icon,{name:"success",class:"button__icon"}),createTextVNode(" "+toDisplayString(_ctx.$t("fkui.form-step-button.close","OK")),1/* TEXT */)],64/* STABLE_FRAGMENT */)):(openBlock(),createElementBlock(Fragment,{key:1},[createVNode(_component_f_icon,{name:"pen",class:"button__icon"}),createTextVNode(" "+toDisplayString(_ctx.isAnyFieldTouched?_ctx.$t("fkui.form-step-button.edit","Ändra"):_ctx.$t("fkui.form-step-button.open","Fyll i")),1/* TEXT */)],64/* STABLE_FRAGMENT */)),createTextVNode(),createElementVNode("span",_hoisted_2$i,toDisplayString(_ctx.additionalScreenreaderText),1/* TEXT */)],16,_hoisted_1$m);}const FFormStepButton=/* @__PURE__ */_export_sfc(_sfc_main$o,[["render",_sfc_render$o]]);const _sfc_main$n=defineComponent({name:"FCard",data(){return{headingClass:["card__header-label"]};},computed:{hasHeaderSlot(){return hasSlot(this,"header");},hasFooterSlot(){return hasSlot(this,"footer");}}});const _hoisted_1$l={class:"card card--default"};const _hoisted_2$h={key:0,class:"card__header"};const _hoisted_3$f={class:"card__content"};const _hoisted_4$c={key:1,class:"card__footer"};function _sfc_render$n(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createElementBlock("div",_hoisted_1$l,[_ctx.hasHeaderSlot?(openBlock(),createElementBlock("div",_hoisted_2$h,[renderSlot(_ctx.$slots,"header",normalizeProps(guardReactiveProps({headingSlotClass:_ctx.headingClass})))])):createCommentVNode("v-if",true),createTextVNode(),createElementVNode("div",_hoisted_3$f,[renderSlot(_ctx.$slots,"default")]),createTextVNode(),_ctx.hasFooterSlot?(openBlock(),createElementBlock("div",_hoisted_4$c,[renderSlot(_ctx.$slots,"footer")])):createCommentVNode("v-if",true)]);}const FCard=/* @__PURE__ */_export_sfc(_sfc_main$n,[["render",_sfc_render$n]]);const _sfc_main$m=defineComponent({name:"FLayoutApplicationTemplate",computed:{showHeader(){return this.hasSlot("header");},showTopNavigation(){return this.hasSlot("top-navigation");},showFooter(){return this.hasSlot("footer");}},mounted(){document.body.classList.add("layout-application-template__body");},beforeUnmount(){document.body.classList.remove("layout-application-template__body");},methods:{hasSlot(name){return isSet(this.$slots[name]);}}});const _hoisted_1$k={class:"layout-application-template"};const _hoisted_2$g={key:0,ref:"header",class:"layout-application-template__header"};const _hoisted_3$e={key:1};const _hoisted_4$b={ref:"primary-content",class:"layout-application-template__main"};const _hoisted_5$b={key:0,class:"layout-application-template__footer"};function _sfc_render$m(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createElementBlock("div",_hoisted_1$k,[_ctx.showHeader||_ctx.showTopNavigation?(openBlock(),createElementBlock("header",_hoisted_2$g,[_ctx.showHeader?renderSlot(_ctx.$slots,"header",{key:0}):createCommentVNode("v-if",true),createTextVNode(),_ctx.showTopNavigation?(openBlock(),createElementBlock("nav",_hoisted_3$e,[renderSlot(_ctx.$slots,"top-navigation")])):createCommentVNode("v-if",true)],512/* NEED_PATCH */)):createCommentVNode("v-if",true),createTextVNode(),createElementVNode("main",_hoisted_4$b,[renderSlot(_ctx.$slots,"default"),createTextVNode(),_ctx.showFooter?(openBlock(),createElementBlock("footer",_hoisted_5$b,[renderSlot(_ctx.$slots,"footer")])):createCommentVNode("v-if",true)],512/* NEED_PATCH */)]);}const FLayoutApplicationTemplate=/* @__PURE__ */_export_sfc(_sfc_main$m,[["render",_sfc_render$m]]);function getGridClasses(target){if(target===null){return{};}const width=typeof target==="number"?target:target.offsetWidth;return{"grid--force":true,"grid--force-sm":true,"grid--force-md":width>=640,"grid--force-lg":width>=1024,"grid--force-xl":width>=1280};}function useLayoutPanel(options){const growToRight=options.grow==="right";let borderDrag=false;let dragStart=0;let dragStartWidth=0;let preferredWidth=-1;let minWidth=150;let maxWidth=0.5;const panelWidth=ref(0);const leftPrimaryClasses=ref({});const rightPrimaryClasses=ref({});function updateOptions(){var _options$initialWidth,_options$minWidth,_options$maxWidth;panelWidth.value=parseInt(toValue((_options$initialWidth=options.initialWidth)!==null&&_options$initialWidth!==void 0?_options$initialWidth:"0"),10);minWidth=parseInt(toValue((_options$minWidth=options.minWidth)!==null&&_options$minWidth!==void 0?_options$minWidth:"150"),10);maxWidth=toValue((_options$maxWidth=options.maxWidth)!==null&&_options$maxWidth!==void 0?_options$maxWidth:0.5);}function disableEvent(event){event.preventDefault();}function onMouseUp(){document.body.style.cursor="";borderDrag=false;window.removeEventListener("selectstart",disableEvent);}function onMouseMove(event){if(borderDrag){const growDirection=growToRight?1:-1;preferredWidth=dragStartWidth+(event.screenX-dragStart)*growDirection;limitWidth();}}function onBorderMouseDown(event){document.body.style.cursor="w-resize";borderDrag=true;dragStart=event.screenX;dragStartWidth=panelWidth.value;window.addEventListener("selectstart",disableEvent);const selection=window.getSelection();if(selection){selection.removeAllRanges();}}function limitWidth(){if(preferredWidth===-1){preferredWidth=panelWidth.value;}let newWidth=preferredWidth;newWidth=Math.max(newWidth,minWidth);newWidth=Math.min(newWidth,window.innerWidth*maxWidth);panelWidth.value=newWidth;updatePrimaryGrid();}function updatePrimaryGrid(){const leftPrimaryElement=document.getElementById("layout-side-navigation__primary-content");const rightPrimaryElement=document.getElementById("layout-secondary__primary");leftPrimaryClasses.value=getGridClasses(leftPrimaryElement);rightPrimaryClasses.value=getGridClasses(rightPrimaryElement);}function gridClasses(){updatePrimaryGrid();return getGridClasses(preferredWidth);}onMounted(()=>{window.addEventListener("mouseup",onMouseUp);window.addEventListener("mousemove",onMouseMove);window.addEventListener("resize",limitWidth);});onUnmounted(()=>{window.removeEventListener("mouseup",onMouseUp);window.removeEventListener("mousemove",onMouseMove);window.removeEventListener("resize",limitWidth);});watchEffect(()=>{updateOptions();});return{panelWidth,/* methods */onBorderMouseDown,updatePrimaryGrid,/* class getters */gridClasses,leftPrimaryClasses,rightPrimaryClasses};}const _sfc_main$l=defineComponent({name:"FLayoutLeftPanel",components:{FIcon},props:{/**
587
+ * The default width for the panel in pixels
588
+ */initialWidth:{type:String,default:"320",validator(value){const parsed=parseInt(value,10);return!isNaN(parsed);}}},setup(props){const{initialWidth}=toRefs(props);return useLayoutPanel({initialWidth,minWidth:"150",maxWidth:0.5,grow:"right"});},data(){return{isOpen:true,offsetTop:0};},computed:{navigationStyle(){if(this.isOpen){return{width:`${this.panelWidth}px`,top:`${this.offsetTop}px`};}else{return{top:`${this.offsetTop}px`};}},primaryStyle(){if(this.isOpen){return{"margin-left":`${this.panelWidth}px`};}else{return{"margin-left":`3.5rem`};}},// This is to make word-wrap work in IE11
589
+ contentStyle(){return{"max-width":`${this.panelWidth-35}px`};}},mounted(){const headers=document.getElementsByClassName("layout-application-template__header");const header=headers.item(0);if(header){this.offsetTop=header.offsetHeight;}},methods:{toggleSideNavigation(){this.isOpen=!this.isOpen;window.setTimeout(()=>{this.updatePrimaryGrid();const ref2=this.isOpen?"close-button":"open-button";const element=getElementFromVueRef(this.$refs[ref2]);focus$1(element);},0);}}});const _hoisted_1$j={class:"layout-navigation"};const _hoisted_2$f=["aria-expanded"];const _hoisted_3$d={class:"layout-navigation__navigation__inner"};const _hoisted_4$a=/* @__PURE__ */createElementVNode("span",{class:"sr-only"},"Stäng navigationspanelen",-1/* HOISTED */);const _hoisted_5$a=/* @__PURE__ */createElementVNode("div",null,[/* @__PURE__ */createElementVNode("hr")],-1/* HOISTED */);const _hoisted_6$8={key:1,class:"layout-navigation__navigation__inner--minimized"};const _hoisted_7$6=/* @__PURE__ */createElementVNode("span",{class:"sr-only"},"Öppna navigationspanelen",-1/* HOISTED */);const _hoisted_8$5=/* @__PURE__ */createElementVNode("div",{class:"layout-navigation__navigation__border__dot"},null,-1/* HOISTED */);const _hoisted_9$4=/* @__PURE__ */createElementVNode("div",{class:"layout-navigation__navigation__border__dot"},null,-1/* HOISTED */);const _hoisted_10$4=/* @__PURE__ */createElementVNode("div",{class:"layout-navigation__navigation__border__dot"},null,-1/* HOISTED */);function _sfc_render$l(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");return openBlock(),createElementBlock("div",_hoisted_1$j,[createElementVNode("nav",{id:"layout-navigation__navigation",class:"layout-navigation__navigation",style:normalizeStyle(_ctx.navigationStyle),"aria-expanded":_ctx.isOpen},[createElementVNode("div",_hoisted_3$d,[_ctx.isOpen?(openBlock(),createElementBlock(Fragment,{key:0},[createElementVNode("div",{class:"layout-navigation__navigation__inner__title",style:normalizeStyle(_ctx.contentStyle)},[renderSlot(_ctx.$slots,"heading"),createTextVNode(),createElementVNode("button",{ref:"close-button",class:"button button--tertiary button--small button--tertiary--black",type:"button",onClick:_cache[0]||(_cache[0]=(...args)=>_ctx.toggleSideNavigation&&_ctx.toggleSideNavigation(...args))},[_hoisted_4$a,createTextVNode(),createVNode(_component_f_icon,{class:"button__icon",name:"chevrons-left"})],512/* NEED_PATCH */)],4/* STYLE */),createTextVNode(),_hoisted_5$a,createTextVNode(),createElementVNode("div",{class:normalizeClass(["layout-navigation__navigation__inner__content scroll-target",_ctx.gridClasses]),style:normalizeStyle(_ctx.contentStyle)},[renderSlot(_ctx.$slots,"content")],6/* CLASS, STYLE */)],64/* STABLE_FRAGMENT */)):createCommentVNode("v-if",true),createTextVNode(),!_ctx.isOpen?(openBlock(),createElementBlock("div",_hoisted_6$8,[createElementVNode("button",{ref:"open-button",class:"button button--tertiary button--tertiary--black",type:"button",onClick:_cache[1]||(_cache[1]=(...args)=>_ctx.toggleSideNavigation&&_ctx.toggleSideNavigation(...args))},[_hoisted_7$6,createTextVNode(),createVNode(_component_f_icon,{class:"button__icon",name:"bars"})],512/* NEED_PATCH */)])):createCommentVNode("v-if",true)]),createTextVNode(),_ctx.isOpen?(openBlock(),createElementBlock("div",{key:0,class:"layout-navigation__navigation__border",onMousedown:_cache[2]||(_cache[2]=(...args)=>_ctx.onBorderMouseDown&&_ctx.onBorderMouseDown(...args))},[_hoisted_8$5,createTextVNode(),_hoisted_9$4,createTextVNode(),_hoisted_10$4],32/* NEED_HYDRATION */)):createCommentVNode("v-if",true)],12,_hoisted_2$f),createTextVNode(),createElementVNode("div",{id:"layout-navigation__primary",class:normalizeClass(["layout-navigation__primary",_ctx.leftPrimaryClasses]),style:normalizeStyle(_ctx.primaryStyle)},[renderSlot(_ctx.$slots,"default")],6/* CLASS, STYLE */)]);}const FLayoutLeftPanel=/* @__PURE__ */_export_sfc(_sfc_main$l,[["render",_sfc_render$l]]);class FRightPanelServiceImpl{constructor(){__publicField(this,"focusedElementBeforeOpenining",null);}open(){this.focusedElementBeforeOpenining=window.document.activeElement;this.emit("open");}openDialog(title){this.focusedElementBeforeOpenining=window.document.activeElement;this.emit("open-dialog",title);}close(){this.emit("close");if(this.focusedElementBeforeOpenining){this.focusedElementBeforeOpenining.focus();}}on(event,callback){EventBus.$on(`application-layout:${event}`,callback);}off(event,callback){EventBus.$off(`application-layout:${event}`,callback);}emit(event,arg){EventBus.$emit(`application-layout:${event}`,arg);}}const FLayoutRightPanelService=new FRightPanelServiceImpl();const _sfc_main$k=defineComponent({name:"FLayoutRightPanel",components:{FIcon},props:{/**
590
+ * The default width for the panel in pixels
591
+ */initialWidth:{type:String,default:"320"},/**
592
+ * The default maximun width for the panel in percentage where 1 is 100% and 0 is 0%
593
+ */maxWidth:{type:Number,default:0.5,validator(value){return typeof value==="number"&&value>0&&value<=1;}},/**
594
+ * The default minium width for the panel in pixels
595
+ */minWidth:{type:String,default:"150"}},setup(props){const{initialWidth,minWidth,maxWidth}=toRefs(props);return useLayoutPanel({initialWidth,minWidth,maxWidth,grow:"left"});},data(){return{isAbsolutePositioned:false,isOpen:false,offsetTop:0};},computed:{secondaryStyle(){if(this.isOpen){return{width:`${this.panelWidth}px`,top:`${this.offsetTop}px`};}return{top:`${this.offsetTop}px`};},primaryStyle(){if(this.isOpen&&!this.isAbsolutePositioned){return{"margin-right":`${this.panelWidth}px`};}return{};},// This is to make word-wrap work in IE11
596
+ contentStyle(){return{"max-width":`${this.panelWidth-35}px`};}},mounted(){const headers=document.getElementsByClassName("layout-application-template__header");const header=headers.item(0);if(header){this.offsetTop=header.offsetHeight;}FLayoutRightPanelService.on("open",this.onOpenSecondary);FLayoutRightPanelService.on("close",this.onCloseSecondary);window.addEventListener("resize",this.onResize);this.onResize();},unmounted(){FLayoutRightPanelService.off("open",this.onOpenSecondary);FLayoutRightPanelService.off("close",this.onCloseSecondary);},methods:{async onOpenSecondary(){this.isOpen=true;await this.$nextTick();const element=getElementFromVueRef(this.$refs["title"]);const heading=element.querySelector("h1, h2, h3, h4, h5, h6");focus$1(heading,{force:true});},onCloseSecondary(){this.isOpen=false;},openSecondary(){FLayoutRightPanelService.open();},onClickCloseSecondary(){FLayoutRightPanelService.close();},onResize(){this.isAbsolutePositioned=window.innerWidth<1280;}}});const _hoisted_1$i={class:"layout-secondary"};const _hoisted_2$e=/* @__PURE__ */createElementVNode("div",{class:"layout-secondary__secondary__border__dot"},null,-1/* HOISTED */);const _hoisted_3$c=/* @__PURE__ */createElementVNode("div",{class:"layout-secondary__secondary__border__dot"},null,-1/* HOISTED */);const _hoisted_4$9=/* @__PURE__ */createElementVNode("div",{class:"layout-secondary__secondary__border__dot"},null,-1/* HOISTED */);const _hoisted_5$9={class:"layout-secondary__secondary__inner"};const _hoisted_6$7=/* @__PURE__ */createElementVNode("div",null,[/* @__PURE__ */createElementVNode("hr",{"aria-hidden":"true"})],-1/* HOISTED */);const _hoisted_7$5=/* @__PURE__ */createElementVNode("span",{class:"sr-only"},"Stäng sekundärpanelen",-1/* HOISTED */);function _sfc_render$k(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");return openBlock(),createElementBlock("div",_hoisted_1$i,[createElementVNode("div",{id:"layout-secondary__primary",class:normalizeClass(["layout-secondary__primary",_ctx.rightPrimaryClasses]),style:normalizeStyle(_ctx.primaryStyle)},[renderSlot(_ctx.$slots,"default")],6/* CLASS, STYLE */),createTextVNode(),_ctx.isOpen?(openBlock(),createElementBlock("aside",{key:0,style:normalizeStyle(_ctx.secondaryStyle),class:"layout-secondary__secondary"},[createElementVNode("div",{class:"layout-secondary__secondary__border",onMousedown:_cache[0]||(_cache[0]=(...args)=>_ctx.onBorderMouseDown&&_ctx.onBorderMouseDown(...args))},[_hoisted_2$e,createTextVNode(),_hoisted_3$c,createTextVNode(),_hoisted_4$9],32/* NEED_HYDRATION */),createTextVNode(),createElementVNode("div",_hoisted_5$9,[createElementVNode("div",{ref:"title",class:"layout-secondary__secondary__inner__title",style:normalizeStyle(_ctx.contentStyle)},[renderSlot(_ctx.$slots,"heading")],4/* STYLE */),createTextVNode(),_hoisted_6$7,createTextVNode(),createElementVNode("div",{class:normalizeClass(["layout-secondary__secondary__inner__content scroll-target",_ctx.gridClasses]),style:normalizeStyle(_ctx.contentStyle)},[renderSlot(_ctx.$slots,"content"),createTextVNode(),createElementVNode("button",{class:"button button--tertiary button--small button--tertiary--black layout-secondary__secondary__inner__close",type:"button",onClick:_cache[1]||(_cache[1]=(...args)=>_ctx.onClickCloseSecondary&&_ctx.onClickCloseSecondary(...args))},[_hoisted_7$5,createTextVNode(),createVNode(_component_f_icon,{class:"button__icon",name:"close"})])],6/* CLASS, STYLE */)])],4/* STYLE */)):createCommentVNode("v-if",true)]);}const FLayoutRightPanel=/* @__PURE__ */_export_sfc(_sfc_main$k,[["render",_sfc_render$k]]);const _sfc_main$j=defineComponent({name:"FList",components:{FCheckboxField},mixins:[TranslationMixin],props:{/**
597
+ * The items to be listed.
598
+ * The items will be listed in the given array order.
599
+ */items:{type:Array,required:true},/**
600
+ * Unique attribute in items.
601
+ * V-for directive in vue requires a unique key to
602
+ * be able to optimize reuse of components.
603
+ */keyAttribute:{type:String,required:true},/**
604
+ * If `true` the list will be selectable.
605
+ * @see 'select' and 'unselect' events.
606
+ */selectable:{type:Boolean,default:false},/**
607
+ * Only applies if selectable:true
608
+ * Disable checkbox in interactive list and create a <a>-wrapper for each item, making them clickable
609
+ * @see 'select' and 'unselect' events.
610
+ */checkbox:{type:Boolean,default:true},/**
611
+ * V-model will bind to value containing selected items.
612
+ */modelValue:{type:Array,required:false,default:()=>void 0},/**
613
+ * V-model will bind to value containing the current active item.
614
+ */active:{type:Object,required:false,default:()=>void 0},/**
615
+ * Unique item id that will be used instead of the automatically generated one.
616
+ */elementId:{type:String,default:()=>ElementIdService.generateElementId()}},emits:["change","click","update","unselect","update:modelValue","select","update:active"],setup(){return ActivateItemInjected();},data(){return{selectedItems:[],activeItem:void 0};},computed:{isEmpty(){return this.items.length===0;},ariaActiveDescendant(){return this.activeItem?this.getItemId(this.activeItem):void 0;}},watch:{items:{deep:true,immediate:true,handler:function(){this.updateSelectedItemsFromVModel();}},modelValue:{deep:true,immediate:true,handler:function(){this.updateSelectedItemsFromVModel();}},active:{immediate:true,handler:function(){this.updateActiveItemFromVModel();}}},mounted(){if(this.selectable&&this.checkbox){if(!this.$slots["screenreader"]){throw Error('Slot "screenreader" is required when having "selectable" & "checkbox" option.');}this.registerCallbackAfterItemAdd(this.callbackAfterItemAdd);this.registerCallbackBeforeItemDelete(this.callbackBeforeItemDelete);}},methods:{getLiElements(){const ulElement=getElementFromVueRef(this.$refs["ulElement"]);return Array.from(ulElement.children);},itemKey(item){const key=item[this.keyAttribute];if(typeof key==="undefined"){throw new Error(`Key attribute [${this.keyAttribute}]' is missing in item`);}return String(key);},isSelected(item){return includeItem(item,this.selectedItems,this.keyAttribute);},itemClasses(item){return{"list__item--selected":this.isSelected(item),"list__item--active":this.isActive(item)};},getAriaSelected(item){return String(itemEquals(this.activeItem,item,this.keyAttribute));},onSelect(item){if(includeItem(item,this.selectedItems,this.keyAttribute)){this.selectedItems=this.selectedItems.filter(i=>!itemEquals(i,item,this.keyAttribute));this.$emit("unselect",item);}else{this.selectedItems.push(item);this.$emit("select",item);}this.updateVModelWithSelectedItems();this.$forceUpdate();},setActiveItem(item){this.$emit("click",item);if(!itemEquals(item,this.activeItem,this.keyAttribute)){this.$emit("change",item);this.activeItem=item;this.$emit("update:active",this.activeItem);}},onItemClick(event,index,item){this.setActiveItem(item);},updateVModelWithSelectedItems(){if(this.modelValue){this.$emit("update:modelValue",this.selectedItems);this.$emit("update",this.selectedItems);}},updateSelectedItemsFromVModel(){if(Array.isArray(this.modelValue)){this.selectedItems=this.modelValue.filter(item=>{return includeItem(item,this.items,this.keyAttribute);});}else{this.selectedItems=[];}},updateActiveItemFromVModel(){if(this.active&&!itemEquals(this.active,this.activeItem,this.keyAttribute)){this.activeItem=this.active;}},onItemKeyDown(event,item){switch(event.key){case"Up":case"Down":case"ArrowUp":case"ArrowDown":event.preventDefault();handleKeyboardFocusNavigation(event.key,event.target,this.getLiElements());break;case" ":case"Spacebar":event.preventDefault();this.setActiveItem(item);break;}},// Unique id to connect aria-labelledby with readonly label
617
+ getAriaLabelledbyId(item){return`${this.elementId}_${this.itemKey(item)}`;},// Unique id to connect aria-labelledby with readonly label
618
+ getItemId(item){return`${this.elementId}_item_${this.itemKey(item)}`;},// Focus effect is done with box-shadow.
619
+ // By setting position to relative the
620
+ // item and box-shadow is drawn with a higher z-index,
621
+ // thus no focus border under other list items.
622
+ onItemFocus(event){if(event&&event.target){event.target.style.position="relative";}},onItemBlur(event){if(event&&event.target){event.target.style.position="static";}},callbackAfterItemAdd(item){this.setActiveItem(item);},callbackBeforeItemDelete(item){if(this.items.length===0){return;}let targetIndex=this.items.indexOf(item)-1;if(targetIndex<0&&this.items.length>1){targetIndex=1;}else if(targetIndex<0){targetIndex=0;}this.setActiveItem(this.items[targetIndex]);if(this.getLiElements()[targetIndex]){this.getLiElements()[targetIndex].focus();}},isActive(item){return this.checkbox&&itemEquals(this.activeItem,item,this.keyAttribute);}}});const _hoisted_1$h={key:0,class:"list"};const _hoisted_2$d={key:0,class:"list__item"};const _hoisted_3$b={class:"list__item__itempane"};const _hoisted_4$8=["tabindex"];const _hoisted_5$8=["id","aria-labelledby","tabindex","onKeydown"];const _hoisted_6$6=["onClick"];const _hoisted_7$4={class:"list__item__selectpane__input"};const _hoisted_8$4=["id"];const _hoisted_9$3={key:0,class:"list__item"};const _hoisted_10$3={class:"list__item__itempane"};function _sfc_render$j(_ctx,_cache,$props,$setup,$data,$options){const _component_f_checkbox_field=resolveComponent("f-checkbox-field");return!_ctx.selectable?(openBlock(),createElementBlock("ul",_hoisted_1$h,[(openBlock(true),createElementBlock(Fragment,null,renderList(_ctx.items,item=>{return openBlock(),createElementBlock("li",{key:_ctx.itemKey(item),class:"list__item"},[createElementVNode("div",{ref_for:true,ref:"listItemPanes",class:"list__item__itempane"},[renderSlot(_ctx.$slots,"default",mergeProps({ref_for:true},{item}))],512/* NEED_PATCH */)]);}),128/* KEYED_FRAGMENT */)),createTextVNode(),_ctx.isEmpty?(openBlock(),createElementBlock("li",_hoisted_2$d,[createElementVNode("div",_hoisted_3$b,[renderSlot(_ctx.$slots,"empty",{},()=>[createElementVNode("em",null,toDisplayString(_ctx.$t("fkui.list.empty","Listan är tom")),1/* TEXT */)])])])):createCommentVNode("v-if",true)])):(openBlock(),createElementBlock("ul",{key:1,ref:"ulElement",class:"list list--hover",tabindex:_ctx.checkbox?0:void 0},[(openBlock(true),createElementBlock(Fragment,null,renderList(_ctx.items,(item,index)=>{return openBlock(),createElementBlock("li",{id:_ctx.getItemId(item),key:_ctx.itemKey(item),"aria-labelledby":_ctx.getItemId(item),class:normalizeClass([_ctx.itemClasses(item),"list__item"]),tabindex:_ctx.checkbox?0:void 0,onKeydown:withModifiers($event=>_ctx.onItemKeyDown($event,item),["self"]),onFocus:_cache[0]||(_cache[0]=withModifiers((...args)=>_ctx.onItemFocus&&_ctx.onItemFocus(...args),["self"])),onBlur:_cache[1]||(_cache[1]=withModifiers((...args)=>_ctx.onItemBlur&&_ctx.onItemBlur(...args),["self"]))},[_ctx.checkbox?(openBlock(),createElementBlock("div",{key:0,class:"list__item__selectpane",onClick:withModifiers($event=>_ctx.onSelect(item),["self"])},[createElementVNode("div",_hoisted_7$4,[createVNode(_component_f_checkbox_field,{value:true,"model-value":_ctx.isSelected(item),onClick:withModifiers($event=>_ctx.onSelect(item),["self"])},{default:withCtx(()=>[createElementVNode("span",{id:_ctx.getAriaLabelledbyId(item),class:"sr-only"},[renderSlot(_ctx.$slots,"screenreader",mergeProps({ref_for:true},{item}))],8,_hoisted_8$4)]),_:2/* DYNAMIC */},1032,["model-value","onClick"])])],8,_hoisted_6$6)):createCommentVNode("v-if",true),createTextVNode(),(openBlock(),createBlock(resolveDynamicComponent(_ctx.checkbox?"div":"a"),{ref_for:true,ref:"listItemPanes",href:!_ctx.checkbox?"javascript:":void 0,class:"list__item__itempane",onClick:$event=>_ctx.onItemClick($event,index,item)},{default:withCtx(()=>[renderSlot(_ctx.$slots,"default",mergeProps({ref_for:true},{item}))]),_:2/* DYNAMIC */},1032,["href","onClick"]))],42,_hoisted_5$8);}),128/* KEYED_FRAGMENT */)),createTextVNode(),_ctx.isEmpty?(openBlock(),createElementBlock("li",_hoisted_9$3,[createElementVNode("div",_hoisted_10$3,[renderSlot(_ctx.$slots,"empty",{},()=>[createElementVNode("em",null,toDisplayString(_ctx.$t("fkui.list.empty","Listan är tom")),1/* TEXT */)])])])):createCommentVNode("v-if",true)],8,_hoisted_4$8));}const FList=/* @__PURE__ */_export_sfc(_sfc_main$j,[["render",_sfc_render$j]]);const _sfc_main$i=defineComponent({name:"FLoader",mixins:[TranslationMixin],inheritAttrs:false,props:{/* Aria-live must always be visible, hence v-if on component level is not possible, therefore we use show-prop *//**
623
+ * Determine if the loader is visible or not
624
+ */show:{type:Boolean,required:true,default:false},/**
625
+ * If loader should be displayed as a fullscreen overlay.
626
+ */overlay:{type:Boolean,required:false,default:false},/**
627
+ * Delay the loader icon and text by 1 second
628
+ */delay:{type:Boolean,required:false,default:false},/**
629
+ * Language used for determining fallback value for the loading text. Useful if loader is displayed before
630
+ * text keys have been downloaded
631
+ */language:{type:String,required:false,default:"sv"}},data(){return{oldFocus:void 0};},computed:{defaultLoadingText(){return this.language==="en"?"Please wait":"Vänligen vänta";},classes(){return{"loader--overlay":this.overlay,"loader--delay":this.delay};},teleportTarget(){return config.teleportTarget;},teleportDisabled(){return!this.overlay;}},watch:{show(show){if(show){this.openLoader();}else{this.closeLoader();}}},mounted(){if(this.show){this.openLoader();}},methods:{async listener(){await this.$nextTick();focus(this.$refs["loader-text"]);},async openLoader(){if(this.overlay){saveFocus(document);this.listener();addFocusListener(findTabbableElements(document),this.listener);}},closeLoader(){if(this.overlay){removeFocusListener(findTabbableElements(document),this.listener);restoreFocus();}}}});const _hoisted_1$g={class:"loader__backdrop"};const _hoisted_2$c=/* @__PURE__ */createElementVNode("div",{class:"loader__wrapper"},[/* @__PURE__ */createElementVNode("div",{class:"loader__spinner-1 loader__spinner"},[/* @__PURE__ */createElementVNode("div",{class:"loader__spinner-1-circle1 loader__circle loader__circle--1"}),/* @__PURE__ */createTextVNode(),/* @__PURE__ */createElementVNode("div",{class:"loader__spinner-1-circle2 loader__circle loader__circle--2"}),/* @__PURE__ */createTextVNode(),/* @__PURE__ */createElementVNode("div",{class:"loader__spinner-1-circle3 loader__circle loader__circle--3"}),/* @__PURE__ */createTextVNode(),/* @__PURE__ */createElementVNode("div",{class:"loader__spinner-1-circle4 loader__circle loader__circle--4"})]),/* @__PURE__ */createTextVNode(),/* @__PURE__ */createElementVNode("div",{class:"loader__spinner-2 loader__spinner"},[/* @__PURE__ */createElementVNode("div",{class:"loader__spinner-2-circle1 loader__circle loader__circle--1"}),/* @__PURE__ */createTextVNode(),/* @__PURE__ */createElementVNode("div",{class:"loader__spinner-2-circle2 loader__circle loader__circle--2"}),/* @__PURE__ */createTextVNode(),/* @__PURE__ */createElementVNode("div",{class:"loader__spinner-2-circle3 loader__circle loader__circle--3"}),/* @__PURE__ */createTextVNode(),/* @__PURE__ */createElementVNode("div",{class:"loader__spinner-2-circle4 loader__circle loader__circle--4"})]),/* @__PURE__ */createTextVNode(),/* @__PURE__ */createElementVNode("div",{class:"loader__spinner-3 loader__spinner"},[/* @__PURE__ */createElementVNode("div",{class:"loader__spinner-3-circle1 loader__circle loader__circle--1"}),/* @__PURE__ */createTextVNode(),/* @__PURE__ */createElementVNode("div",{class:"loader__spinner-3-circle2 loader__circle loader__circle--2"}),/* @__PURE__ */createTextVNode(),/* @__PURE__ */createElementVNode("div",{class:"loader__spinner-3-circle3 loader__circle loader__circle--3"}),/* @__PURE__ */createTextVNode(),/* @__PURE__ */createElementVNode("div",{class:"loader__spinner-3-circle4 loader__circle loader__circle--4"})])],-1/* HOISTED */);const _hoisted_3$a={role:"alert"};function _sfc_render$i(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createBlock(Teleport,{to:_ctx.teleportTarget,disabled:_ctx.teleportDisabled},[withDirectives(createElementVNode("div",mergeProps(_ctx.$attrs,{class:["loader",_ctx.classes]}),[createElementVNode("div",_hoisted_1$g,[_hoisted_2$c,createTextVNode(),createElementVNode("div",{ref:"loader-text",class:normalizeClass(["loader__wait-text",{"loader--delay":_ctx.delay}]),tabindex:"-1"},[createElementVNode("span",_hoisted_3$a,[renderSlot(_ctx.$slots,"default",{},()=>[createTextVNode(toDisplayString(_ctx.$t("fkui.loader.wait.text",_ctx.defaultLoadingText)),1/* TEXT */)])])],2/* CLASS */)])],16/* FULL_PROPS */),[[vShow,_ctx.show]])],8,["to","disabled"]);}const FLoader=/* @__PURE__ */_export_sfc(_sfc_main$i,[["render",_sfc_render$i]]);function getNewItemIndexFromMenuAction$2(action,index,n){let newIndex;if(n<=0){return 0;}switch(action){case MenuAction.MOVE_NEXT:newIndex=(index+1)%n;break;case MenuAction.MOVE_PREV:newIndex=(index-1+n)%n;break;case MenuAction.MOVE_FIRST:newIndex=0;break;case MenuAction.MOVE_LAST:newIndex=Math.max(n-1,0);break;default:newIndex=index;}return newIndex;}async function doMenuAction$2(action,target){const itemsLength=target.items.length;const currentIndex=target.currentFocusedItemIndex;const newFocusedItemIndex=getNewItemIndexFromMenuAction$2(action,currentIndex,itemsLength);switch(action){case MenuAction.MOVE_NEXT:case MenuAction.MOVE_PREV:case MenuAction.MOVE_FIRST:case MenuAction.MOVE_LAST:await target.setFocusOnItem(newFocusedItemIndex);break;case MenuAction.ACTIVATE:await target.activateItem(newFocusedItemIndex);break;}}const preventKeys$2=["Up","Down","ArrowUp","ArrowDown","Home","End"," ","Spacebar","Enter"];const _sfc_main$h=defineComponent({name:"IPopupMenu",components:{FIcon,IPopup},props:{/**
632
+ * Toggle open/closed popup.
633
+ */isOpen:{type:Boolean,required:true},/**
634
+ * DOM element to position popup at.
635
+ */anchor:{type:HTMLElement,default:void 0},/**
636
+ * The currently highlighted menu item key
637
+ * @model
638
+ */modelValue:{type:String,required:false,default:""},/**
639
+ * The items to be diplayed in the menu
640
+ */items:{type:Array,required:true},/**
641
+ * The key of the currently selected focused item
642
+ */focusedItemKey:{type:String,required:false,default:""},/**
643
+ * If true, enable built-in keyboard navigation
644
+ */enableKeyboardNavigation:{type:Boolean,required:false,default:false},/**
645
+ * Unique accessible name for navigation landmark.
646
+ */ariaLabel:{type:String,required:false,default:"Popupmeny"},/**
647
+ * Text for selected item for screen reader
648
+ */selectedMenuItemScreenReaderText:{type:String,required:false,default:"vald nu"}},emits:["close","select","update:modelValue"],data(){return{currentFocusedItemIndex:0,lastSelectedItem:""};},watch:{isOpen:{immediate:true,async handler(){this.currentFocusedItemIndex=0;this.lastSelectedItem="";}},focusedItemKey:{async handler(newVal){if(this.enableKeyboardNavigation){return;}const index=this.indexOfItemByKey(newVal);if(index>=0){await this.setFocusOnItem(index);}else{this.setFocusedItemIndex(0);}}},modelValue:{async handler(newVal){if(this.enableKeyboardNavigation){return;}const index=this.indexOfItemByKey(newVal);if(index>=0){await this.activateItem(index);}else{this.setFocusedItemIndex(0);}}}},methods:{isSelected(index){return this.items[index].key===this.modelValue;},focusElement(){return null;},findItemByKey(key){return this.items.find(it=>it.key===key);},indexOfItemByKey(key){const item=this.findItemByKey(key);if(!item){return-1;}return this.items.indexOf(item);},async onClickItem(item,doClick=false){var _a;if(item.key!==this.lastSelectedItem){this.$emit("update:modelValue",item.key);this.$emit("select",item.key);this.lastSelectedItem=item.key;}this.$emit("close");if(item.href&&doClick){const anchors=getSortedHTMLElementsFromVueRef(this.$refs.anchors);(_a=anchors[this.currentFocusedItemIndex])==null?void 0:_a.click();}},cssClassHighlight(item){return item.key===this.modelValue?"ipopupmenu__list__item--highlight":"";},async setFocusOnItem(index){this.setFocusedItemIndex(index);await this.$nextTick();if(this.isOpen){const anchors=getSortedHTMLElementsFromVueRef(this.$refs.anchors);if(anchors.length>0){const itemAnchor=anchors[index];focus$1(itemAnchor,{preventScroll:true});}}},async activateItem(index){if(index!==this.currentFocusedItemIndex){await this.setFocusOnItem(index);}await this.onClickItem(this.items[index],true);},setFocusedItemIndex(index){this.currentFocusedItemIndex=index;},onKeyUp(event){if(!this.enableKeyboardNavigation){return;}if(preventKeys$2.includes(event.key)){event.preventDefault();}},async onKeyDown(event){if(!this.enableKeyboardNavigation){return;}if(!preventKeys$2.includes(event.key)){return;}const action=actionFromKeyboardEvent(event);if(action!==null){event.preventDefault();await doMenuAction$2(action,this);}}}});const _hoisted_1$f=["aria-label"];const _hoisted_2$b={role:"menu",class:"ipopupmenu__list"};const _hoisted_3$9=["onClick"];const _hoisted_4$7=["data-ref-index","href","target"];const _hoisted_5$7={key:0,class:"sr-only"};function _sfc_render$h(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");const _component_i_popup=resolveComponent("i-popup");return openBlock(),createBlock(_component_i_popup,{class:"ipopupmenu","is-open":_ctx.isOpen,"keyboard-trap":false,anchor:_ctx.anchor,"focus-element":_ctx.focusElement,onClose:_cache[0]||(_cache[0]=$event=>_ctx.$emit("close")),onKeyup:_ctx.onKeyUp,onKeydown:_ctx.onKeyDown},{default:withCtx(()=>[createElementVNode("nav",{class:"ipopupmenu ipopupmenu--vertical","aria-label":_ctx.ariaLabel},[createElementVNode("ul",_hoisted_2$b,[(openBlock(true),createElementBlock(Fragment,null,renderList(_ctx.items,(item,index)=>{return openBlock(),createElementBlock("li",{ref_for:true,ref:"items",key:item.key,role:"presentation",class:normalizeClass(["ipopupmenu__list__item",_ctx.cssClassHighlight(item)]),onClick:$event=>_ctx.onClickItem(item)},[createElementVNode("a",{ref_for:true,ref:"anchors","data-ref-index":index,href:item.href,role:"menuitem",target:item.target,tabindex:"0"},[_ctx.isSelected(index)?(openBlock(),createElementBlock("span",_hoisted_5$7,[createElementVNode("span",null,toDisplayString(_ctx.selectedMenuItemScreenReaderText)+" ",1/* TEXT */)])):createCommentVNode("v-if",true),createTextVNode(toDisplayString(item.label)+" ",1/* TEXT */),item.iconRight?(openBlock(),createBlock(_component_f_icon,{key:1,name:item.iconRight},null,8,["name"])):createCommentVNode("v-if",true)],8,_hoisted_4$7)],10,_hoisted_3$9);}),128/* KEYED_FRAGMENT */))])],8,_hoisted_1$f)]),_:1/* STABLE */},8,["is-open","anchor","focus-element","onKeyup","onKeydown"]);}const IPopupMenu=/* @__PURE__ */_export_sfc(_sfc_main$h,[["render",_sfc_render$h]]);const menuMoreKey="MENU_MORE";function findOverflowIndex(totalWidth,elements){let sum=0;return elements.findIndex(element=>{sum+=element.offsetWidth;return sum>totalWidth;});}function getNewItemIndexFromMenuAction$1(action,index,n){let newIndex;if(n<=0){return 0;}switch(action){case MenuAction.MOVE_NEXT:newIndex=(index+1)%n;break;case MenuAction.MOVE_PREV:newIndex=(index-1+n)%n;break;case MenuAction.MOVE_FIRST:newIndex=0;break;case MenuAction.MOVE_LAST:newIndex=Math.max(n-1,0);break;default:newIndex=index;}return newIndex;}async function doMenuAction$1(action,target){const itemsLength=target.items.length;const currentIndex=target.currentFocusedItemIndex;const newFocusedItemIndex=getNewItemIndexFromMenuAction$1(action,currentIndex,itemsLength);switch(action){case MenuAction.MOVE_NEXT:case MenuAction.MOVE_PREV:case MenuAction.MOVE_FIRST:case MenuAction.MOVE_LAST:await target.setFocusOnItem(newFocusedItemIndex);break;case MenuAction.ACTIVATE:await target.activateItem(newFocusedItemIndex);break;}}const preventKeys$1=["Tab","Up","Down","Left","Right","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"," ","Spacebar","Enter"];const _sfc_main$g=defineComponent({name:"IMenu",components:{FIcon},props:{/**
649
+ * The currently highlighted menu item key
650
+ * @model
651
+ */modelValue:{type:String,required:false,default:""},/**
652
+ * The items to be diplayed in the menu
653
+ */items:{type:Array,required:true},/**
654
+ * If true, show the menu vertically
655
+ */vertical:{type:Boolean,required:false,default:false},/**
656
+ * The key of the currently selected focused item
657
+ */focusedItemKey:{type:String,required:false,default:""},/**
658
+ * If true, enable built-in keyboard navigation
659
+ */enableKeyboardNavigation:{type:Boolean,required:false,default:false},/**
660
+ * Text for selected item for screen reader
661
+ */selectedMenuItemScreenReaderText:{type:String,required:false,default:"vald nu"},/**
662
+ * If true, indicates that the menu "Mer/More" has selected items
663
+ */hasMenuMoreSelectedItems:{type:Boolean,required:false,default:false}},emits:["overflow","select","update:modelValue"],data(){return{resizeObserver:void 0,currentFocusedItemIndex:0,lastSelectedItem:""};},computed:{cssClasses(){return{"imenu--horizontal":!this.vertical,"imenu--vertical":this.vertical};}},watch:{items:{deep:true,async handler(){await this.$nextTick();this.onResize();}},focusedItemKey:{async handler(newVal){if(this.enableKeyboardNavigation){return;}const index=this.indexOfItemByKey(newVal);if(index>=0){await this.setFocusOnItem(index);}else{this.setFocusedItemIndex(0);}}},modelValue:{async handler(newVal){if(this.enableKeyboardNavigation){return;}const index=this.indexOfItemByKey(newVal);if(index>=0){await this.activateItem(index);}else{this.setFocusedItemIndex(0);}}}},mounted(){this.currentFocusedItemIndex=0;if(!this.vertical){this.resizeObserver=new ResizeObserver(debounce(this.onResize,100));this.resizeObserver.observe(this.$el);this.onResize();}},unmounted(){if(this.resizeObserver){this.resizeObserver.disconnect();}},methods:{getAnchor(index){return getSortedHTMLElementsFromVueRef(this.$refs.anchors)[index];},getSelectedMenuItemScreenReaderText(index){const menuMoreItem=this.items[index].key===menuMoreKey?this.items[index]:null;if(menuMoreItem){if(this.hasMenuMoreSelectedItems){return menuMoreItem.srMenuMoreTextSelectedContents;}else{return menuMoreItem.srMenuMoreTextContents;}}return this.selectedMenuItemScreenReaderText;},isSelected(index){return this.items[index].key===this.modelValue;},ariaHasPopup(index){const item=this.items[index];return(item==null?void 0:item.ariaHasPopup)?true:void 0;},findItemByKey(key){return this.items.find(it=>it.key===key);},indexOfItemByKey(key){const item=this.findItemByKey(key);if(!item){return-1;}return this.items.indexOf(item);},async onClickItem(item,doClick=false){var _a;if(item.key===menuMoreKey||item.key!==this.lastSelectedItem){this.$emit("update:modelValue",item.key);this.$emit("select",item.key);this.lastSelectedItem=item.key;}if(item.href&&doClick){(_a=this.getAnchor(this.items.indexOf(item)))==null?void 0:_a.click();}},onResize(){const barElement=this.$el;if(!barElement){return;}const barWidth=barElement.offsetWidth;const itemElements=getSortedHTMLElementsFromVueRef(this.$refs.items);const overflowIndex=findOverflowIndex(barWidth,itemElements);this.$emit("overflow",overflowIndex);},cssClassHighlight(item){return item.key===this.modelValue?"imenu__list__item--highlight":"";},ccsClassHighlightAnchor(item){return item.key===this.modelValue?"imenu__list__anchor--highlight":"";},ccsClassHighlightAnchorContainer(item){return item.key===this.modelValue?"imenu__list__anchor-container--highlight":"";},async setFocusOnItem(index){this.setFocusedItemIndex(index);await this.$nextTick();const itemAnchor=this.getAnchor(index);focus$1(itemAnchor,{preventScroll:true});},async activateItem(index){await this.onClickItem(this.items[index],true);},setFocusedItemIndex(index){this.currentFocusedItemIndex=index;},onKeyUp(event){if(!this.enableKeyboardNavigation){return;}if(preventKeys$1.includes(event.key)){event.preventDefault();}},async onKeyDown(event){if(!this.enableKeyboardNavigation){return;}const action=actionFromKeyboardEvent(event);if(action!==null){event.preventDefault();await doMenuAction$1(action,this);}}}});const _hoisted_1$e={class:"imenu__list",role:"menubar"};const _hoisted_2$a=["data-ref-index","onClick"];const _hoisted_3$8=["data-ref-index","href","target","aria-haspopup"];const _hoisted_4$6={key:0,class:"sr-only"};const _hoisted_5$6={key:1,class:"imenu__list__anchor-span"};function _sfc_render$g(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");return openBlock(),createElementBlock("nav",{class:normalizeClass(["imenu",_ctx.cssClasses]),"aria-label":"Navigeringsmeny",onKeyup:_cache[0]||(_cache[0]=(...args)=>_ctx.onKeyUp&&_ctx.onKeyUp(...args)),onKeydown:_cache[1]||(_cache[1]=(...args)=>_ctx.onKeyDown&&_ctx.onKeyDown(...args))},[createElementVNode("ul",_hoisted_1$e,[(openBlock(true),createElementBlock(Fragment,null,renderList(_ctx.items,(item,index)=>{return openBlock(),createElementBlock("li",{ref_for:true,ref:"items",key:item.key,"data-ref-index":index,class:normalizeClass(["imenu__list__item",_ctx.cssClassHighlight(item)]),role:"none",onClick:$event=>_ctx.onClickItem(item)},[createElementVNode("div",{class:normalizeClass([_ctx.ccsClassHighlightAnchorContainer(item),"imenu__list__anchor-container"])},[createElementVNode("a",{ref_for:true,ref:"anchors","data-ref-index":index,tabindex:"0",href:item.href,target:item.target,class:normalizeClass(["imenu__list__anchor",_ctx.ccsClassHighlightAnchor(item)]),role:"menuitem","aria-haspopup":_ctx.ariaHasPopup(index)},[_ctx.isSelected(index)?(openBlock(),createElementBlock("span",_hoisted_4$6,[createElementVNode("span",null,toDisplayString(_ctx.getSelectedMenuItemScreenReaderText(index))+" ",1/* TEXT */)])):createCommentVNode("v-if",true),createTextVNode(toDisplayString(item.label),1/* TEXT */),item.iconRight?(openBlock(),createElementBlock("span",_hoisted_5$6)):createCommentVNode("v-if",true),createTextVNode(),item.iconRight?(openBlock(),createBlock(_component_f_icon,{key:2,name:item.iconRight,class:"imenu__list__anchor-icon-right"},null,8,["name"])):createCommentVNode("v-if",true)],10,_hoisted_3$8)],2/* CLASS */)],10,_hoisted_2$a);}),128/* KEYED_FRAGMENT */))])],34/* CLASS, NEED_HYDRATION */);}const IMenu=/* @__PURE__ */_export_sfc(_sfc_main$g,[["render",_sfc_render$g]]);function calcOverflowIndexFromIndex(index){return index===-1?-1:index-1;}function getNewItemIndexFromMenuAction(action,index,minIndex,maxIndex){let newIndex;if(maxIndex<=minIndex){return minIndex;}if(index>=maxIndex){return maxIndex-1;}switch(action){case MenuAction.MOVE_NEXT:newIndex=(index+1)%maxIndex;newIndex=Math.max(newIndex,minIndex);break;case MenuAction.MOVE_PREV:newIndex=index-1;if(newIndex<minIndex){newIndex=maxIndex-1;}break;case MenuAction.MOVE_FIRST:newIndex=minIndex;break;case MenuAction.MOVE_LAST:newIndex=Math.max(maxIndex-1,minIndex);break;default:newIndex=index;}return newIndex;}async function doMenuAction(action,target,minIndex,maxIndex){const currentIndex=target.currentFocusedItemIndex;const newFocusedItemIndex=getNewItemIndexFromMenuAction(action,currentIndex,minIndex,maxIndex);switch(action){case MenuAction.MOVE_NEXT:case MenuAction.MOVE_PREV:case MenuAction.MOVE_FIRST:case MenuAction.MOVE_LAST:await target.setFocusOnItem(newFocusedItemIndex);break;case MenuAction.ACTIVATE:await target.activateItem(newFocusedItemIndex);break;}}const preventKeys=["Tab","Up","Down","Left","Right","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"," ","Spacebar","Enter","Escape"];const keyUp=["ArrowUp","Up"];const keyDown=["ArrowDown","Down"];const arrowKeys=[...keyUp,...keyDown];const _sfc_main$f=defineComponent({name:"FNavigationMenu",components:{IMenu,IPopupMenu},mixins:[TranslationMixin],props:{/** Current route.
664
+ * @model
665
+ */route:{type:String,required:false,default:""},/**
666
+ * The route items to be diplayed in the menu
667
+ */routes:{type:Array,required:true},/**
668
+ * If true, show the menu vertically
669
+ */vertical:{type:Boolean,required:false,default:false},/**
670
+ * Screen reader text for selected item
671
+ */selectedMenuItemScreenReaderText:{type:String,required:false,default:""},/**
672
+ * Screen reader text for the more menu item
673
+ */menuMoreScreenReaderText:{type:String,required:false,default:""},/**
674
+ * Screen reader text for the more menu with selected items
675
+ */menuMoreWithSelectedItemsScreenReaderText:{type:String,required:false,default:""},/**
676
+ * Unique accessible name for navigation landmark in menu.
677
+ */menuAriaLabel:{type:String,required:false,default:"Navigeringsmeny"},/**
678
+ * Unique accessible name for navigation landmark in popup.
679
+ */popupAriaLabel:{type:String,required:false,default:"Popupmeny"}},emits:[/**
680
+ * Event that is dispatched when a menu item is selected, for example, by clicking on the item.
681
+ * In most use cases the event payload is used to call Vue `router.push()` from the consumer code.
682
+ *
683
+ * @event selectedRoute
684
+ * @param route
685
+ * @type {string}
686
+ */"selectedRoute",/**
687
+ * V-model event to update route property.
688
+ *
689
+ * @event update:route
690
+ * @param route
691
+ * @type {string}
692
+ */"update:route"],data(){return{overflowIndex:-1,ignoreNoOverflow:false,selectedMenuItemKey:"",selectedPopupItemKey:"",popupAnchor:this.$el,popupOpen:false,currentFocusedItemIndex:0,focusedMenuItemKey:"",focusedPopupMenuItemKey:"",initPopupNavigationIndex:true};},computed:{items(){return this.routes.map(i=>({label:i.label,key:i.route,href:i.href,target:i.target}));},visibleItems(){if(this.overflowIndex>-1){const visibleItems=this.items.slice(0,this.overflowIndex);visibleItems.push({label:this.$t("fkui.navigation-menu.more-text","Mer"),key:menuMoreKey,iconRight:"arrow-down",ariaHasPopup:true,srMenuMoreTextContents:this.menuMoreScreenReaderText,srMenuMoreTextSelectedContents:this.menuMoreWithSelectedItemsSrText()});return visibleItems;}else{return this.items;}},popupItems(){return this.overflowIndex>-1?this.items.slice(this.overflowIndex):[];},hasPopupMenuSelectedItems(){return this.selectedPopupItemKey!=="";}},watch:{route:{async handler(value){const itemIndex=isSet(value)?this.indexOfItemByKey(this.items,value):-1;if(itemIndex<0){await this.activateItem(-1);return;}const isWithinMoreMenu=!this.findItemByKey(this.visibleItems,value);if(isWithinMoreMenu){const item=this.items[itemIndex];await this.activateInvisibleItem(item);}else{await this.activateItem(itemIndex);}},immediate:true}},mounted(){this.currentFocusedItemIndex=0;},methods:{selectedMenuItemSrText(){if(this.selectedMenuItemScreenReaderText===""){return this.$t("fkui.navigation-menu.current-page","Aktuell sida");}else{return this.selectedMenuItemScreenReaderText;}},menuMoreWithSelectedItemsSrText(){if(this.menuMoreWithSelectedItemsScreenReaderText===""){return this.$t("fkui.navigation-menu.more-selection","underliggande vald nu");}else{return this.menuMoreWithSelectedItemsScreenReaderText;}},findItemByKey(items,key){return items.find(it=>it.key===key);},indexOfItemByKey(items,key){return items.findIndex(it=>it.key===key);},async onOverflow(index){const ignore=this.ignoreNoOverflow;const shouldReset=index===-1&&ignore;const shouldIgnore=index>=0;if(shouldReset){this.ignoreNoOverflow=false;return;}if(shouldIgnore){this.ignoreNoOverflow=true;}this.updateOverflowIndex(index);await this.refreshSelectedItem();const shouldClosePopup=this.overflowIndex>-1&&!this.ignoreNoOverflow;if(shouldClosePopup){await this.setPopupOpen(false);}},async refreshSelectedItem(){const popupStatus=this.popupOpen;if(this.overflowIndex===-1){if(this.visibleItems.some(i=>i.key===this.selectedPopupItemKey)){this.selectedMenuItemKey=this.selectedPopupItemKey;this.selectedPopupItemKey="";}}else{if(this.popupItems.some(i=>i.key===this.selectedMenuItemKey)){var _ref3;this.selectedPopupItemKey=this.selectedMenuItemKey;const lastItem=this.visibleItems.at(-1);this.selectedMenuItemKey=(_ref3=lastItem==null?void 0:lastItem.key)!==null&&_ref3!==void 0?_ref3:"";}}await this.setPopupOpen(popupStatus);},async doSelectItem(key){if(key!==menuMoreKey){this.$emit("update:route",key);this.$emit("selectedRoute",key);}let index=-1;if(this.hasOverflow()){index=this.indexOfItemByKey(this.visibleItems,key);if(index===-1){index=this.indexOfItemByKey(this.items,key);}}else{index=this.indexOfItemByKey(this.items,key);}},async onSelectMenu(key){await this.doSelectItem(key);if(key!==menuMoreKey){if(this.findItemByKey(this.visibleItems,key)&&this.selectedPopupItemKey!==""){this.focusedPopupMenuItemKey="";this.selectedPopupItemKey="";}}else{const anchor=getHTMLElementFromVueRef(this.$refs.menu).querySelector("li:last-child");if(anchor){this.popupAnchor=anchor;}await this.setPopupOpen(true);}},async onSelectPopup(key){await this.setPopupOpen(false);await this.doSelectItem(key);},async onClosePopup(){await this.setPopupOpen(false);},async setPopupOpen(value){if(value){this.focusedPopupMenuItemKey="";}else{this.initPopupNavigationIndex=true;}this.popupOpen=value;await this.$nextTick();},updateOverflowIndex(index){this.overflowIndex=calcOverflowIndexFromIndex(index);},onKeyUp(event){if(preventKeys.includes(event.key)){event.preventDefault();}},doHandleMenuTabKey(action){if(this.hasOverflow()){if(action===MenuAction.MOVE_NEXT&&this.currentFocusedItemIndex+1===this.visibleItems.length){return true;}if(action===MenuAction.MOVE_PREV&&this.currentFocusedItemIndex-1===-1){return true;}}else{if(action===MenuAction.MOVE_NEXT&&this.currentFocusedItemIndex+1===this.items.length){return true;}if(action===MenuAction.MOVE_PREV&&this.currentFocusedItemIndex-1===-1){return true;}}return false;},async doHandlePopupMenuTabKey(action){if(action===MenuAction.MOVE_NEXT&&this.currentFocusedItemIndex+1===this.items.length){await this.setPopupOpen(false);return true;}else if(action===MenuAction.MOVE_NEXT&&this.currentFocusedItemIndex===this.overflowIndex){if(this.initPopupNavigationIndex){this.initPopupNavigationIndex=!this.initPopupNavigationIndex;this.setCurrentFocusedItemIndex(this.overflowIndex-1);return false;}}else if(action===MenuAction.MOVE_PREV&&this.currentFocusedItemIndex===this.overflowIndex){await this.setPopupOpen(false);this.setCurrentFocusedItemIndex(this.overflowIndex-1);return false;}return false;},setCurrentFocusedItemIndex(value){this.currentFocusedItemIndex=value;},doInitPopupNavigationIndex(event){if(keyDown.includes(event.key)||event.key==="Tab"){this.setCurrentFocusedItemIndex(this.overflowIndex-1);}else if(keyUp.includes(event.key)){this.setCurrentFocusedItemIndex(this.items.length+1);}},async onKeyDown(event){if(event.key==="Escape"){await this.setPopupOpen(false);return;}let action=actionFromKeyboardEvent(event);if(action===null){return;}if(!this.popupOpen){if(event.key==="Tab"&&this.doHandleMenuTabKey(action)){return;}event.preventDefault();await doMenuAction(action,this,0,this.visibleItems.length);}else{if(event.key==="Tab"&&(await this.doHandlePopupMenuTabKey(action))){return;}event.preventDefault();if(action===MenuAction.ACTIVATE&&this.focusedPopupMenuItemKey===""){action=null;await this.setPopupOpen(false);return;}if(this.initPopupNavigationIndex&&arrowKeys.includes(event.key)){this.initPopupNavigationIndex=!this.initPopupNavigationIndex;this.doInitPopupNavigationIndex(event);}await doMenuAction(action,this,this.overflowIndex,this.items.length);}},async setFocusOnItem(index){var _a,_b;this.setFocusedItemIndex(index);if(!this.hasOverflow()||!this.popupOpen&&index<=this.overflowIndex){this.setFocusedMenuItemKey(((_a=this.visibleItems[index])==null?void 0:_a.key)||"");}else{await this.setFocusedPopupMenuItemKey(((_b=this.items[index])==null?void 0:_b.key)||"");}},hasOverflow(){return this.overflowIndex!==-1;},async activateItem(index){var _a,_b;if(!this.hasOverflow()||!this.popupOpen&&index<=this.overflowIndex){const key=((_a=this.visibleItems[index])==null?void 0:_a.key)||"";await this.setSelectedMenuItemKey(key);await this.onSelectMenu(key);}else{const key=((_b=this.items[index])==null?void 0:_b.key)||"";this.selectedPopupItemKey=key;await this.onSelectPopup(key);}},async activateInvisibleItem(item){await this.setSelectedMenuItemKey(menuMoreKey);await this.onSelectMenu(menuMoreKey);this.selectedPopupItemKey=item.key;await this.onSelectPopup(item.key);if(item.href){const anchor=document.createElement("a");anchor.href=item.href;if(item.target){anchor.target=item.target;}anchor.click();}},setFocusedItemIndex(index){if(index<0){return;}if(!this.popupOpen&&this.hasOverflow()&&index>this.overflowIndex){this.setCurrentFocusedItemIndex(this.overflowIndex);}else{this.setCurrentFocusedItemIndex(index);}},async setFocusedPopupMenuItemKey(key){this.focusedPopupMenuItemKey="";if(key!==""){await this.$nextTick();this.focusedPopupMenuItemKey=key;}},setFocusedMenuItemKey(key){this.focusedMenuItemKey=key;},async setSelectedMenuItemKey(key){this.selectedMenuItemKey="";if(key!==""){await this.$nextTick();this.selectedMenuItemKey=key;}}}});function _sfc_render$f(_ctx,_cache,$props,$setup,$data,$options){const _component_i_menu=resolveComponent("i-menu");const _component_i_popup_menu=resolveComponent("i-popup-menu");return openBlock(),createElementBlock("div",null,[createVNode(_component_i_menu,{ref:"menu",modelValue:_ctx.selectedMenuItemKey,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>_ctx.selectedMenuItemKey=$event),items:_ctx.visibleItems,vertical:_ctx.vertical,"focused-item-key":_ctx.focusedMenuItemKey,"selected-menu-item-screen-reader-text":_ctx.selectedMenuItemSrText(),"has-menu-more-selected-items":_ctx.hasPopupMenuSelectedItems,"aria-label":_ctx.menuAriaLabel,onSelect:_ctx.onSelectMenu,onOverflow:_ctx.onOverflow,onKeyup:_ctx.onKeyUp,onKeydown:_ctx.onKeyDown},null,8,["modelValue","items","vertical","focused-item-key","selected-menu-item-screen-reader-text","has-menu-more-selected-items","aria-label","onSelect","onOverflow","onKeyup","onKeydown"]),createTextVNode(),createVNode(_component_i_popup_menu,{ref:"popupMenu",modelValue:_ctx.selectedPopupItemKey,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>_ctx.selectedPopupItemKey=$event),items:_ctx.popupItems,"is-open":_ctx.popupOpen,anchor:_ctx.popupAnchor,"focused-item-key":_ctx.focusedPopupMenuItemKey,"selected-menu-item-screen-reader-text":_ctx.selectedMenuItemSrText(),"aria-label":_ctx.popupAriaLabel,onSelect:_ctx.onSelectPopup,onClose:_ctx.onClosePopup,onKeyup:_ctx.onKeyUp,onKeydown:_ctx.onKeyDown},null,8,["modelValue","items","is-open","anchor","focused-item-key","selected-menu-item-screen-reader-text","aria-label","onSelect","onClose","onKeyup","onKeydown"])]);}const FNavigationMenu=/* @__PURE__ */_export_sfc(_sfc_main$f,[["render",_sfc_render$f]]);const EVENTS=["online","offline"];const _sfc_main$e=defineComponent({name:"FOffline",components:{FIcon},data(){return{isOnline:navigator.onLine||false,role:"none",shouldNotRead:true};},created(){EVENTS.forEach(event=>{window.addEventListener(event,this.updateOnlineStatus);});},beforeUnmount(){EVENTS.forEach(event=>{window.removeEventListener(event,this.updateOnlineStatus);});},mounted(){document.body.prepend(getElementFromVueRef(this.$refs.offline));},methods:{updateOnlineStatus(event){switch(event.type){case"online":this.shouldNotRead=false;this.isOnline=true;break;case"offline":this.shouldNotRead=true;this.isOnline=false;break;default:this.shouldNotRead=true;this.isOnline=false;break;}this.role="alert";}}});const _hoisted_1$d=["role"];const _hoisted_2$9={key:0,class:"offline"};const _hoisted_3$7={class:"offline__icon"};const _hoisted_4$5={class:"icon-stack icon-stack--error"};const _hoisted_5$5={class:"offline__content"};const _hoisted_6$5=["aria-hidden"];function _sfc_render$e(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");return openBlock(),createElementBlock("div",{ref:"offline",class:"offline__wrapper",role:_ctx.role},[!_ctx.isOnline?(openBlock(),createElementBlock("div",_hoisted_2$9,[createElementVNode("span",_hoisted_3$7,[createElementVNode("span",_hoisted_4$5,[createVNode(_component_f_icon,{name:"triangle"}),createTextVNode(),createVNode(_component_f_icon,{name:"alert"})])]),createTextVNode(),createElementVNode("p",_hoisted_5$5,[renderSlot(_ctx.$slots,"default",{},()=>[createTextVNode(" Det verkar som att du inte har någon internetuppkoppling just nu ")])])])):createCommentVNode("v-if",true),createTextVNode(),withDirectives(createElementVNode("span",{class:"sr-only","aria-hidden":_ctx.shouldNotRead?"true":void 0},"\n Din internetuppkoppling fungerar igen\n ",8,_hoisted_6$5),[[vShow,_ctx.isOnline]])],8,_hoisted_1$d);}const FOffline=/* @__PURE__ */_export_sfc(_sfc_main$e,[["render",_sfc_render$e]]);const _sfc_main$d=defineComponent({name:"FOutputField",components:{FLabel},inheritAttrs:false,props:{/**
693
+ * Associate the output field with one or more id's of the elements
694
+ * contributing or affecting the result of this field. Multiple id's can
695
+ * be set with a space-separated string or an array of strings.
696
+ */for:{type:[String,Array],required:true},/**
697
+ * The id for the output id attribute.
698
+ * The id for the label for attribute.
699
+ * If the prop is not set a random value will be generated.
700
+ */id:{type:String,required:false,default:()=>ElementIdService.generateElementId()}},computed:{htmlFor(){return Array.isArray(this.for)?this.for.join(" "):this.for;}}});const _hoisted_1$c={class:"output-field"};const _hoisted_2$8=["id","for"];function _sfc_render$d(_ctx,_cache,$props,$setup,$data,$options){const _component_f_label=resolveComponent("f-label");return openBlock(),createElementBlock("div",_hoisted_1$c,[createVNode(_component_f_label,{for:_ctx.id},createSlots({default:withCtx(()=>[renderSlot(_ctx.$slots,"label")]),_:2/* DYNAMIC */},[_ctx.$slots.tooltip?{name:"tooltip",fn:withCtx(()=>[renderSlot(_ctx.$slots,"tooltip")]),key:"0"}:void 0]),1032,["for"]),createTextVNode(),createElementVNode("output",mergeProps({id:_ctx.id,for:_ctx.htmlFor,class:"output-field__output"},_ctx.$attrs),[renderSlot(_ctx.$slots,"default")],16,_hoisted_2$8)]);}const FOutputField=/* @__PURE__ */_export_sfc(_sfc_main$d,[["render",_sfc_render$d]]);const _sfc_main$c=defineComponent({name:"ISkipLink",mixins:[TranslationMixin],props:{/**
701
+ * Target for skiplink.
702
+ */href:{type:String,required:false,default:"main"}}});const _hoisted_1$b=["href"];function _sfc_render$c(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createElementBlock("a",{class:"iskiplink",href:_ctx.href},[renderSlot(_ctx.$slots,"default",{},()=>[createTextVNode(toDisplayString(_ctx.$t("fkui.skip-link.text","Gå direkt till innehåll")),1/* TEXT */)])],8,_hoisted_1$b);}const ISkipLink=/* @__PURE__ */_export_sfc(_sfc_main$c,[["render",_sfc_render$c]]);function getAltLogoText(hasRouterLink,routerLinkLabel,t){const srStdLogoAltText=t("fkui.page-header.logo.alt-text","Försäkringskassan");const srStdRouterLinkLabel=t("fkui.page-header.router.link.label","gå till startsidan");if(hasRouterLink&&routerLinkLabel!==""){return`${srStdLogoAltText} ${routerLinkLabel}`;}else if(hasRouterLink){return`${srStdLogoAltText}, ${srStdRouterLinkLabel}`;}else{return srStdLogoAltText;}}const _sfc_main$b=defineComponent({name:"FPageHeader",components:{ISkipLink},mixins:[TranslationMixin],inheritAttrs:true,props:{/** Setting the logo sizes small, large or responsive. */logoSize:{type:String,default:"responsive",required:false,validator(value){return["small","large","responsive"].includes(value);}},/**
703
+ * Render skiplink.
704
+ */skipLink:{type:Boolean,required:false,default:false},/**
705
+ * Target for skiplink.
706
+ */skipLinkHref:{type:String,required:false,default:"#applicationlayout-main-content"},/**
707
+ * HTML element type for header.
708
+ */headerTag:{default:"span",required:false,validator(value){return["span","h1"].includes(value);}},/**
709
+ * Target for router-link via path.
710
+ * (Behaviour from using both name and path in combination is undefined.)
711
+ */routerLinkPath:{type:String,required:false,default:""},/**
712
+ * Target for router-link via name.
713
+ * (Behaviour from using both name and path in combination is undefined.)
714
+ */routerLinkName:{type:String,required:false,default:""},/**
715
+ * Label to override the router-link label when router-link is present.
716
+ */routerLinkLabel:{type:String,required:false,default:""}},computed:{logoClass(){return`page-header__logo--${this.logoSize}`;},hasRouterLink(){return Boolean(this.routerLinkName||this.routerLinkPath);},routerLinkTo(){const{routerLinkName,routerLinkPath}=this;if(routerLinkName){return{name:routerLinkName};}if(routerLinkPath){return{path:routerLinkPath};}return null;},altLogoText(){return getAltLogoText(this.hasRouterLink,this.routerLinkLabel,this.$t);}}});const _hoisted_1$a={class:"page-header__root"};const _hoisted_2$7={key:0};const _hoisted_3$6={ref:"header",class:"page-header"};const _hoisted_4$4={class:"page-header__logo"};const _hoisted_5$4=["aria-label"];const _hoisted_6$4=["aria-label"];const _hoisted_7$3={class:"page-header__right"};const _hoisted_8$3={class:"page-header__right-slot"};function _sfc_render$b(_ctx,_cache,$props,$setup,$data,$options){const _component_i_skip_link=resolveComponent("i-skip-link");const _component_router_link=resolveComponent("router-link");return openBlock(),createElementBlock("div",_hoisted_1$a,[_ctx.skipLink?(openBlock(),createElementBlock("nav",_hoisted_2$7,[createVNode(_component_i_skip_link,{href:_ctx.skipLinkHref},{default:withCtx(()=>[renderSlot(_ctx.$slots,"skip-link-text")]),_:3/* FORWARDED */},8,["href"])])):createCommentVNode("v-if",true),createTextVNode(),createElementVNode("div",_hoisted_3$6,[createElementVNode("div",_hoisted_4$4,[renderSlot(_ctx.$slots,"logo",{},()=>[_ctx.routerLinkTo?(openBlock(),createBlock(_component_router_link,{key:0,to:_ctx.routerLinkTo},{default:withCtx(()=>[createElementVNode("span",{class:normalizeClass(_ctx.logoClass),"aria-label":_ctx.altLogoText,role:"img"},null,10,_hoisted_5$4)]),_:1/* STABLE */},8,["to"])):(openBlock(),createElementBlock("span",{key:1,class:normalizeClass(_ctx.logoClass),"aria-label":_ctx.altLogoText,role:"img"},null,10,_hoisted_6$4))])]),createTextVNode(),(openBlock(),createBlock(resolveDynamicComponent(_ctx.headerTag),{class:"page-header__app-name"},{default:withCtx(()=>[renderSlot(_ctx.$slots,"default")]),_:3/* FORWARDED */})),createTextVNode(),createElementVNode("div",_hoisted_7$3,[createElementVNode("div",_hoisted_8$3,[renderSlot(_ctx.$slots,"right")])])],512/* NEED_PATCH */)]);}const FPageHeader=/* @__PURE__ */_export_sfc(_sfc_main$b,[["render",_sfc_render$b]]);const MIN_VALUE=0;const MAX_VALUE=100;function clamp(val){return Math.round(Math.min(Math.max(val||0,MIN_VALUE),MAX_VALUE));}const _sfc_main$a=defineComponent({name:"FProgressbar",props:{/**
717
+ * Sets the progress. Higher value indicates further progress. Value must be in range 0-100.
718
+ */value:{type:Number,required:true,validator(value){return value>=MIN_VALUE&&value<=MAX_VALUE;}},/**
719
+ * Text that the screenreader will read, the actual value will be replaced with %VALUE% e.g You have uploaded %VALUE% percent
720
+ */valueText:{type:String,required:false,default:"Du har slutfört %VALUE% %."},ariaLabel:{type:String,required:true}},computed:{progressValueNow(){return clamp(this.value);},isFinished(){return this.progressValueNow===MAX_VALUE;},isInProgress(){return this.progressValueNow>MIN_VALUE&&this.progressValueNow<MAX_VALUE;},isPending(){return this.progressValueNow===MIN_VALUE;},cssWidth(){return`width: ${this.progressValueNow}%`;},progressBarClass(){return`${this.isInProgress?"progress__meter--inprogress":""} ${this.isPending?"progress__meter--pending":""} ${this.isFinished?"progress__meter--finished":""}`;},progressText(){return`${this.valueText.replace("%VALUE%",this.progressValueNow.toString())}`;}}});const _hoisted_1$9={class:"progress"};const _hoisted_2$6=["aria-label","aria-valuenow","aria-valuetext"];const _hoisted_3$5={class:"sr-only"};function _sfc_render$a(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createElementBlock("div",_hoisted_1$9,[createElementVNode("span",{class:normalizeClass(["progress__meter",_ctx.progressBarClass]),role:"progressbar","aria-label":_ctx.ariaLabel,"aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":_ctx.progressValueNow,"aria-valuetext":_ctx.progressText,style:normalizeStyle(_ctx.cssWidth)},[createElementVNode("span",_hoisted_3$5,toDisplayString(_ctx.progressText),1/* TEXT */)],14,_hoisted_2$6)]);}const FProgressbar=/* @__PURE__ */_export_sfc(_sfc_main$a,[["render",_sfc_render$a]]);const anyType=[String,Object,Array,Number,Date,Boolean];const _sfc_main$9=defineComponent({name:"FRadioField",inheritAttrs:false,props:{/**
721
+ * Set to `true`, empty string `""` or string `"disabled"` to disable this input field.
722
+ */disabled:{type:Boolean,required:false,default:false},/**
723
+ * The id for the input id attribute.
724
+ * The id for the label for attribute.
725
+ * If the prop is not set a random value will be generated.
726
+ */id:{type:String,required:false,default:()=>ElementIdService.generateElementId()},/**
727
+ * The value for the input checked attribute.
728
+ * @model
729
+ */// ? The rule is disabled so that the `checked` prop can be undefined or null.
730
+ /* eslint-disable-next-line vue/require-default-prop -- technical debt,
731
+ /* it should contain a default value of undefined and proptype should
732
+ /* include undefined (see comment on line above) */modelValue:{type:anyType,required:false},/**
733
+ * The value for the input.
734
+ */value:{type:anyType,required:true}},emits:["change","update:modelValue"],setup(){return{sharedName:inject("sharedName",void 0),showDetails:inject("showDetails","never"),getFieldsetLabelText:inject("getFieldsetLabelText",()=>"")};},data(){return{height:0,initialStyle:{overflow:"hidden",transition:"height 400ms cubic-bezier(0.46, 0.03, 0.52, 0.96)"},hiddenStyle:{height:"auto",position:"absolute",visibility:"hidden"},visibleStyle:{width:"",position:"",visibility:"",height:"0px"},openedStyle:{height:"auto"}};},computed:{attrs(){var _this$sharedName;return{...this.$attrs,value:this.value,checked:this.value===this.modelValue,name:(_this$sharedName=this.sharedName)!==null&&_this$sharedName!==void 0?_this$sharedName:this.$attrs.name,onChange:event=>{if(event.target instanceof HTMLInputElement){this.$emit("update:modelValue",this.value);this.$emit("change",this.value);}},onInput:event=>{event.target.focus();}};},disabledClass(){return this.disabled?"disabled":"";}},methods:{async onValidity({detail}){if(detail.target!==this.$el.querySelector("input")){return;}await this.$nextTick();let errorMessage="";if(hasSlot(this,"default")){const labelText=this.getFieldsetLabelText();if(labelText){errorMessage=`${labelText} ${renderSlotText(this.$slots.default)}`;}else{errorMessage=`${renderSlotText(this.$slots.default)}`;}}const element=this.$el.querySelector(`#${detail.elementId}`);if(element){dispatchComponentValidityEvent(element,{...detail,errorMessage,focusElementId:detail.elementId});}},enter(element){const htmlElement=getHTMLElementFromVueRef(element);const computedStyle=getComputedStyle(element);Object.assign(htmlElement.style,this.initialStyle);Object.assign(htmlElement.style,this.hiddenStyle);htmlElement.style.width=computedStyle.width;const height=computedStyle.height;Object.assign(htmlElement.style,this.visibleStyle);getComputedStyle(element).height;setTimeout(()=>{this.height=parseInt(height,10);htmlElement.style.height=height;});},afterEnter(element){const htmlElement=getHTMLElementFromVueRef(element);Object.assign(htmlElement.style,this.openedStyle);},leave(element){const htmlElement=getHTMLElementFromVueRef(element);const height=getComputedStyle(element).height;htmlElement.style.height=height;getComputedStyle(element).height;setTimeout(()=>{Object.assign(htmlElement.style,this.visibleStyle);});}}});const _hoisted_1$8=["id","disabled"];const _hoisted_2$5=["for"];const _hoisted_3$4={key:0,class:"radio-button__details"};const _hoisted_4$3=/* @__PURE__ */createElementVNode("br",null,null,-1/* HOISTED */);const _hoisted_5$3={key:0,class:"radio-button__details"};const _hoisted_6$3=/* @__PURE__ */createElementVNode("br",null,null,-1/* HOISTED */);function _sfc_render$9(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createElementBlock("div",{class:normalizeClass(["radio-button",_ctx.disabledClass]),onValidity:_cache[0]||(_cache[0]=(...args)=>_ctx.onValidity&&_ctx.onValidity(...args))},[createElementVNode("input",mergeProps({id:_ctx.id,type:"radio",class:"radio-button__input",disabled:_ctx.disabled},_ctx.attrs),null,16,_hoisted_1$8),createTextVNode(),createElementVNode("label",{class:normalizeClass(_ctx.$slots.details?"radio-button__label radio-button__width":"radio-button__label"),for:_ctx.id},[renderSlot(_ctx.$slots,"default"),createTextVNode(),_ctx.$slots.details?(openBlock(),createElementBlock(Fragment,{key:0},[_ctx.showDetails==="always"?(openBlock(),createElementBlock("span",_hoisted_3$4,[_hoisted_4$3,createTextVNode(),renderSlot(_ctx.$slots,"details")])):createCommentVNode("v-if",true),createTextVNode(),_ctx.showDetails==="when-selected"?(openBlock(),createBlock(Transition,{key:1,onEnter:_ctx.enter,onAfterEnter:_ctx.afterEnter,onLeave:_ctx.leave},{default:withCtx(()=>[_ctx.value===_ctx.modelValue?(openBlock(),createElementBlock("span",_hoisted_5$3,[_hoisted_6$3,createTextVNode(),renderSlot(_ctx.$slots,"details",{height:_ctx.height})])):createCommentVNode("v-if",true)]),_:3/* FORWARDED */},8,["onEnter","onAfterEnter","onLeave"])):createCommentVNode("v-if",true)],64/* STABLE_FRAGMENT */)):createCommentVNode("v-if",true)],10,_hoisted_2$5)],34/* CLASS, NEED_HYDRATION */);}const FRadioField=/* @__PURE__ */_export_sfc(_sfc_main$9,[["render",_sfc_render$9]]);const _sfc_main$8=defineComponent({name:"FRadioGroup",components:{FFieldset},inheritAttrs:false,props:{/**
735
+ * The id for the fieldset id attribute.
736
+ * If the prop is not set the id will be generated.
737
+ */id:{type:String,required:false,default:()=>ElementIdService.generateElementId()},/**
738
+ * The name of the radio group.
739
+ * The radio group fields in the group will use the same name.
740
+ */name:{type:String,required:true},/**
741
+ * If radio buttons should be aligned horizontally.
742
+ * If the prop is not set the radio buttons will be aligned vertically.
743
+ * Default: `false`
744
+ */isHorizontal:{type:Boolean,required:false}}});function _sfc_render$8(_ctx,_cache,$props,$setup,$data,$options){const _component_f_fieldset=resolveComponent("f-fieldset");return openBlock(),createBlock(_component_f_fieldset,mergeProps({id:_ctx.id,name:_ctx.name},_ctx.$attrs,{horizontal:_ctx.isHorizontal}),createSlots({label:withCtx(()=>[renderSlot(_ctx.$slots,"label")]),description:withCtx(({descriptionClass,discreteDescriptionClass})=>[renderSlot(_ctx.$slots,"description",normalizeProps(guardReactiveProps({descriptionClass,discreteDescriptionClass})))]),"error-message":withCtx(()=>[renderSlot(_ctx.$slots,"error-message")]),default:withCtx(()=>[renderSlot(_ctx.$slots,"default",normalizeProps(guardReactiveProps({indentClass:"indent"})))]),_:2/* DYNAMIC */},[_ctx.$slots.tooltip?{name:"tooltip",fn:withCtx(()=>[renderSlot(_ctx.$slots,"tooltip")]),key:"0"}:void 0]),1040,["id","name","horizontal"]);}const FRadioGroup=/* @__PURE__ */_export_sfc(_sfc_main$8,[["render",_sfc_render$8]]);const _sfc_main$7=defineComponent({name:"FStaticField",components:{FLabel}});const _hoisted_1$7={class:"output-field"};const _hoisted_2$4={class:"output-field__output"};function _sfc_render$7(_ctx,_cache,$props,$setup,$data,$options){const _component_f_label=resolveComponent("f-label");return openBlock(),createElementBlock("div",_hoisted_1$7,[createVNode(_component_f_label,null,createSlots({default:withCtx(()=>[renderSlot(_ctx.$slots,"label")]),description:withCtx(({descriptionClass,discreteDescriptionClass})=>[renderSlot(_ctx.$slots,"description",normalizeProps(guardReactiveProps({descriptionClass,discreteDescriptionClass})))]),_:2/* DYNAMIC */},[_ctx.$slots.tooltip?{name:"tooltip",fn:withCtx(()=>[renderSlot(_ctx.$slots,"tooltip")]),key:"0"}:void 0]),1024/* DYNAMIC_SLOTS */),createTextVNode(),createElementVNode("p",_hoisted_2$4,[renderSlot(_ctx.$slots,"default")])]);}const FStaticField=/* @__PURE__ */_export_sfc(_sfc_main$7,[["render",_sfc_render$7]]);const keybindings=Object.fromEntries([["Up",focusTrAbove],["Down",focusTrBelow],["ArrowUp",focusTrAbove],["ArrowDown",focusTrBelow],[" ",activateRow],["Spacebar",activateRow]]);function focusTrAbove(current){if(current>0){this.tr[current-1].focus();}else{this.tr[this.tr.length-1].focus();}}function focusTrBelow(current){if(current<this.tr.length-1){this.tr[current+1].focus();}else{this.tr[0].focus();}}function activateRow(current){const row=this.rows[current];const element=this.tr[current];this.activate(row,element);}function onKeydown(event,current){const fn2=keybindings[event.key];if(fn2){event.preventDefault();fn2.call(this,current);}}function useExpandableTable(expandableAttribute,keyAttribute,describedby,emit,slots){const expandedRows=ref([]);const isExpandableTable=computed(()=>{return expandableAttribute.length>0;});const hasExpandableSlot=computed(()=>{return Boolean(slots["expandable"]);});function toggleExpanded(row){if(isExpanded(row)){expandedRows.value=expandedRows.value.filter(it=>!itemEquals(it,row,keyAttribute));emit("collapse",row);}else{expandedRows.value.push(row);emit("expand",row);}}function isExpanded(row){return includeItem(row,expandedRows.value,keyAttribute);}function rowAriaExpanded(row){if(!isExpandableTable||!row[expandableAttribute]){return void 0;}return isExpanded(row);}function expandableRowClasses(row,index){const rows=expandableRows(row);if(!rows){return[];}const border=index<rows.length-1?["table__row--expanded-border"]:[];const expanded=isExpanded(row)?[]:["table__expandable-row--collapsed"];return["table__expandable-row",...border,...expanded];}function expandableColumnClasses(column,index){const indented=index===0?["table__column--indented"]:[];return["table__column",`table__column--${column.type}`,column.size,...indented];}function getExpandableDescribedby(row){if(!isExpandableTable){return void 0;}if(!describedby||describedby.length<1){return void 0;}if(!hasExpandableContent(row)){return void 0;}return describedby;}function expandableRows(row){const expandableRows2=row[expandableAttribute];if(typeof expandableRows2==="undefined"){return void 0;}if(!Array.isArray(expandableRows2)){throw new Error(`Expandable rows must be a ListArray`);}return expandableRows2;}function hasExpandableContent(row){return Boolean(expandableRows(row));}return{expandedRows,isExpandableTable,hasExpandableSlot,toggleExpanded,isExpanded,rowAriaExpanded,expandableRowClasses,expandableColumnClasses,getExpandableDescribedby,expandableRows,hasExpandableContent};}function forceRepaintIE11(target){if(navigator.userAgent.includes("Trident")){target.style.display="none";target.offsetHeight;target.style.removeProperty("display");}}const _sfc_main$6=defineComponent({name:"FInteractiveTable",components:{FCheckboxField,FIcon},mixins:[TranslationMixin],provide(){return{addColumn:column=>{this.columns=addColumn(this.columns,column);},setVisibilityColumn:(id,visible)=>{setVisibilityColumn(this.columns,id,visible);},textFieldTableMode:true};},inheritAttrs:false,props:{/**
745
+ * The rows to be listed.
746
+ * The rows will be listed in the given array order.
747
+ */rows:{type:Array,required:true},/**
748
+ * If `true` hovering over a row will be highlighted
749
+ */hover:{type:Boolean,default:false},/**
750
+ * Unique attribute in rows.
751
+ */keyAttribute:{type:String,required:true},/**
752
+ * Attribute of expandable content in rows.
753
+ * If provided, the table can contain expandable rows.
754
+ */expandableAttribute:{type:String,default:""},/**
755
+ * Element id for aria-describedby on expandable rows to describe expanded content.
756
+ */expandableDescribedby:{type:String,default:""},/**
757
+ * If `true` the table rows will be selectable.
758
+ * @see 'select' and 'unselect' events.
759
+ */selectable:{type:Boolean,default:false},/**
760
+ * If `true` alternating rows will use a different background color.
761
+ */striped:{type:Boolean,default:false},/**
762
+ * Enable scrolling inside table.
763
+ *
764
+ * Can be one of the following values:
765
+ *
766
+ * - `"horizontal"`: Enables horizontal scrolling
767
+ * - `"vertical"`: Enables vertical scrolling
768
+ * - `"both"`: Enables scrolling in both directions
769
+ * - `"none"`: Disables scrolling (default)
770
+ */scroll:{type:String,default:TableScroll.NONE,validator:function(value){const types=Object.values(TableScroll);return types.includes(value);}},/**
771
+ * V-model will bind to value containing selected rows.
772
+ */modelValue:{type:Array,required:false,default:void 0}},emits:["change","click","update","unselect","update:modelValue","select",/**
773
+ * Emitted when row is expanded.
774
+ *
775
+ * @event expand
776
+ * @param row
777
+ * @type {ListItem}
778
+ */"expand",/**
779
+ * Emitted when row is collapsed.
780
+ *
781
+ * @event collapse
782
+ * @param row
783
+ * @type {ListItem}
784
+ */"collapse"],setup(props,context){const sortFilterDatasetInjected=FSortFilterDatasetInjected();const activateItemInjected=ActivateItemInjected();const expandableTable=useExpandableTable(props.expandableAttribute,props.keyAttribute,props.expandableDescribedby,context.emit,context.slots);return{...sortFilterDatasetInjected,...activateItemInjected,...expandableTable};},data(){return{activeRow:void 0,columns:[],emptyRow:emptyTableRow(),selectedRows:[],tr:[]};},computed:{hasCaption(){return hasSlot(this,"caption");},hasCheckboxDescription(){return hasSlot(this,"checkbox-description",{row:this.emptyRow});},hasInitiateColumns(){return this.columns.length>0;},isEmpty(){return this.rows.length===0;},visibleColumns(){return this.columns.filter(col=>col.visible);},tableClasses(){const classes=[];if(this.selectable){classes.push("table--selectable");}if(this.hover){classes.push("table--hover");}return classes;},tableRole(){return this.isExpandableTable?"treegrid":"grid";},wrapperClasses(){return tableScrollClasses(this.scroll);},nbOfColumns(){let columnCount=this.columns.length;if(this.selectable){columnCount++;}if(this.isExpandableTable){columnCount++;}return columnCount;}},watch:{rows:{immediate:true,deep:true,handler:function(){if(this.modelValue){this.selectedRows=this.modelValue.filter(row=>{return includeItem(row,this.rows,this.keyAttribute);});}}}},updated(){const tbodyElement=this.$refs["tbodyElement"];const trElements=[].slice.call(tbodyElement.children);const trInteractableElements=trElements.filter(tr=>{return tr.tabIndex===0;});this.tr=trInteractableElements;},mounted(){this.registerCallbackOnSort(this.callbackOnSort);this.registerCallbackOnMount(this.callbackSortableColumns);this.registerCallbackAfterItemAdd(this.callbackAfterItemAdd);this.registerCallbackBeforeItemDelete(this.callbackBeforeItemDelete);},methods:{isActive(row){return itemEquals(row,this.activeRow,this.keyAttribute);},isSelected(row){return includeItem(row,this.selectedRows,this.keyAttribute);},onKeydownExpandable(event,index){if(event.key===" "||event.key==="Spacebar"){event.preventDefault();return;}onKeydown.call(this,event,index);},onKeydown(event,index){onKeydown.call(this,event,index);},onClick(event,row){const{target}=event;const isRelevant=["TD","TH"].includes(target.nodeName);if(isRelevant){const parent=target.parentElement;this.activate(row,parent);}},activate(row,tr){this.$emit("click",row);if(this.isExpandableTable&&this.hasExpandableContent(row)){this.toggleExpanded(row);}if(!itemEquals(row,this.activeRow,this.keyAttribute)){this.$emit("change",row);this.activeRow=row;if(tr){tr.focus();const td=tr.children[0];forceRepaintIE11(td);}}},rowDescription(row){const slot=this.$slots["row-description"];return renderSlotText(slot,{row});},onSelect(row){if(includeItem(row,this.selectedRows,this.keyAttribute)){this.selectedRows=this.selectedRows.filter(i=>!itemEquals(i,row,this.keyAttribute));this.$emit("unselect",row);}else{this.selectedRows.push(row);this.$emit("select",row);}this.updateVModelWithSelectedRows();this.$forceUpdate();},updateVModelWithSelectedRows(){if(this.modelValue){this.$emit("update:modelValue",this.selectedRows);this.$emit("update",this.selectedRows);}},rowClasses(row,index){const active=this.isActive(row)?["table__row--active"]:[];const selected=this.isSelected(row)?["table__row--selected"]:[];const isExpandableRow=this.isExpandableTable&&this.hasExpandableContent(row);const expandable=isExpandableRow?["table__row--expandable"]:[];const expanded=this.isExpanded(row)?["table__row--expanded-border"]:[];const striped=this.striped&&index%2!==0?["table__row--striped"]:[];return["table__row",...active,...selected,...striped,...expandable,...expanded];},rowKey(row){const key=row[this.keyAttribute];if(typeof key==="undefined"){throw new Error(`Key attribute [${this.keyAttribute}]' is missing in row`);}return String(key);},columnClasses(column){const sortable=column.sortable?["table__column--sortable"]:[];return["table__column",`table__column--${column.type}`,...sortable,column.size];},iconClasses(column){return getSortableIconClasses(column);},iconName(column){return getSortableIconName(column);},onClickColumnHeader(column){if(!column.sortable){return;}let columnName=column.name;if(column.sort===FTableColumnSort.DESCENDING){columnName="";column.sort=FTableColumnSort.UNSORTED;}this.sort(columnName,column.sort!==FTableColumnSort.ASCENDING);},callbackOnSort(columnName,ascending){updateSortOrder(this.columns,columnName,ascending);},callbackSortableColumns(columnNames){setSortableColumns(this.columns,columnNames);},callbackAfterItemAdd(item){this.activate(item,null);},callbackBeforeItemDelete(item){if(this.rows.length===0){return;}let targetIndex=this.rows.indexOf(item)-1;if(targetIndex<0&&this.rows.length>1){targetIndex=1;}else if(targetIndex<0){targetIndex=0;}this.activate(this.rows[targetIndex],this.tr[targetIndex]);},escapeNewlines(value){return value.replace(/\n/g,"<br/>");}}});const _hoisted_1$6=["role"];const _hoisted_2$3={key:0};const _hoisted_3$3={key:0,class:"table__column--shrink"};const _hoisted_4$2={key:1,class:"table__column--shrink"};const _hoisted_5$2={class:"table__row"};const _hoisted_6$2={key:0,scope:"col"};const _hoisted_7$2={class:"sr-only"};const _hoisted_8$2={key:1,scope:"col"};const _hoisted_9$2={class:"sr-only"};const _hoisted_10$2=["innerHTML"];const _hoisted_11$1={key:1,class:"table__column__description"};const _hoisted_12$1={ref:"tbodyElement"};const _hoisted_13$1=["aria-label","aria-expanded","aria-level","aria-describedby","onKeydown","onClick"];const _hoisted_14$1={key:0};const _hoisted_15$1={key:0,class:"table__expand-icon"};const _hoisted_16={key:1,class:"table__column--selectable"};const _hoisted_17={class:"table__input"};const _hoisted_18={key:0,class:"sr-only"};const _hoisted_19=/* @__PURE__ */createElementVNode("td",null,null,-1/* HOISTED */);const _hoisted_20={key:0,class:"table__column--selectable"};const _hoisted_21=["colspan"];const _hoisted_22={key:0};const _hoisted_23={hidden:""};const _hoisted_24=["colspan"];function _sfc_render$6(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");const _component_f_checkbox_field=resolveComponent("f-checkbox-field");return openBlock(),createElementBlock("div",{class:normalizeClass(_ctx.wrapperClasses)},[createElementVNode("table",mergeProps({class:["table",_ctx.tableClasses],role:_ctx.tableRole},_ctx.$attrs),[_ctx.hasCaption?(openBlock(),createElementBlock("caption",_hoisted_2$3,[renderSlot(_ctx.$slots,"caption")])):createCommentVNode("v-if",true),createTextVNode(),createElementVNode("colgroup",null,[_ctx.isExpandableTable?(openBlock(),createElementBlock("col",_hoisted_3$3)):createCommentVNode("v-if",true),createTextVNode(),_ctx.selectable?(openBlock(),createElementBlock("col",_hoisted_4$2)):createCommentVNode("v-if",true),createTextVNode(),(openBlock(true),createElementBlock(Fragment,null,renderList(_ctx.columns,column=>{return openBlock(),createElementBlock("col",{key:column.id,class:normalizeClass(column.size)},null,2/* CLASS */);}),128/* KEYED_FRAGMENT */))]),createTextVNode(),createElementVNode("thead",null,[createElementVNode("tr",_hoisted_5$2,[_ctx.isExpandableTable?(openBlock(),createElementBlock("th",_hoisted_6$2,[createElementVNode("span",_hoisted_7$2,toDisplayString(_ctx.$t("fkui.interactive-table.select","Expandera")),1/* TEXT */)])):createCommentVNode("v-if",true),createTextVNode(),_ctx.selectable?(openBlock(),createElementBlock("th",_hoisted_8$2,[createElementVNode("span",_hoisted_9$2,toDisplayString(_ctx.$t("fkui.interactive-table.select","Markera")),1/* TEXT */)])):createCommentVNode("v-if",true),createTextVNode(),(openBlock(true),createElementBlock(Fragment,null,renderList(_ctx.visibleColumns,column=>{return openBlock(),createElementBlock("th",mergeProps({key:column.id,scope:"col",class:_ctx.columnClasses(column)},toHandlers(column.sortable?{click:()=>_ctx.onClickColumnHeader(column)}:{},true)),[createElementVNode("span",{innerHTML:_ctx.escapeNewlines(column.title)},null,8,_hoisted_10$2),createTextVNode(),column.sortable?(openBlock(),createBlock(_component_f_icon,{key:0,class:normalizeClass(_ctx.iconClasses(column)),name:_ctx.iconName(column)},null,8,["class","name"])):createCommentVNode("v-if",true),createTextVNode(),column.description?(openBlock(),createElementBlock("span",_hoisted_11$1,toDisplayString(column.description),1/* TEXT */)):createCommentVNode("v-if",true)],16/* FULL_PROPS */);}),128/* KEYED_FRAGMENT */))])]),createTextVNode(),createElementVNode("tbody",_hoisted_12$1,[(openBlock(true),createElementBlock(Fragment,null,renderList(_ctx.rows,(row,index)=>{return openBlock(),createElementBlock(Fragment,{key:_ctx.rowKey(row)},[createElementVNode("tr",{class:normalizeClass(_ctx.rowClasses(row,index)),"aria-label":_ctx.rowDescription(row),"aria-expanded":_ctx.rowAriaExpanded(row),"aria-level":_ctx.isExpandableTable?1:void 0,"aria-describedby":_ctx.getExpandableDescribedby(row),tabindex:"0",onKeydown:withModifiers($event=>_ctx.onKeydown($event,index),["self"]),onClick:$event=>_ctx.onClick($event,row,index)},[_ctx.isExpandableTable?(openBlock(),createElementBlock("td",_hoisted_14$1,[_ctx.hasExpandableContent(row)?(openBlock(),createElementBlock("div",_hoisted_15$1,[createVNode(_component_f_icon,{name:"arrow-right",rotate:_ctx.isExpanded(row)?"270":"90"},null,8,["rotate"])])):createCommentVNode("v-if",true)])):createCommentVNode("v-if",true),createTextVNode(),_ctx.selectable?(openBlock(),createElementBlock("td",_hoisted_16,[createElementVNode("div",_hoisted_17,[createVNode(_component_f_checkbox_field,{value:true,"model-value":_ctx.isSelected(row),onClick:withModifiers($event=>_ctx.onSelect(row),["self"])},{default:withCtx(()=>[_ctx.hasCheckboxDescription?(openBlock(),createElementBlock("span",_hoisted_18,[renderSlot(_ctx.$slots,"checkbox-description",mergeProps({ref_for:true},{row}))])):createCommentVNode("v-if",true)]),_:2/* DYNAMIC */},1032,["model-value","onClick"])])])):createCommentVNode("v-if",true),createTextVNode(),renderSlot(_ctx.$slots,"default",mergeProps({ref_for:true},{row}))],42,_hoisted_13$1),createTextVNode(),_ctx.isExpandableTable&&_ctx.hasExpandableContent(row)?(openBlock(true),createElementBlock(Fragment,{key:0},renderList(_ctx.expandableRows(row),(expandableRow,expandableIndex)=>{return openBlock(),createElementBlock("tr",{key:_ctx.rowKey(expandableRow),"aria-level":"2",class:normalizeClass(_ctx.expandableRowClasses(row,expandableIndex))},[_hoisted_19,createTextVNode(),_ctx.selectable?(openBlock(),createElementBlock("td",_hoisted_20)):createCommentVNode("v-if",true),createTextVNode(),!_ctx.hasExpandableSlot?(openBlock(true),createElementBlock(Fragment,{key:1},renderList(_ctx.columns,(column,columnIndex)=>{return openBlock(),createElementBlock("td",{key:`${_ctx.rowKey(expandableRow)}${column.name}`,class:normalizeClass(_ctx.expandableColumnClasses(column,columnIndex))},toDisplayString(expandableRow[column.name]),3/* TEXT, CLASS */);}),128/* KEYED_FRAGMENT */)):(openBlock(),createElementBlock("td",{key:2,class:"table__column table__column--indented",colspan:_ctx.columns.length},[renderSlot(_ctx.$slots,"expandable",mergeProps({ref_for:true},{expandableRow,parentRow:row}))],8,_hoisted_21))],2/* CLASS */);}),128/* KEYED_FRAGMENT */)):createCommentVNode("v-if",true)],64/* STABLE_FRAGMENT */);}),128/* KEYED_FRAGMENT */)),createTextVNode(),!_ctx.hasInitiateColumns?(openBlock(),createElementBlock("tr",_hoisted_22,[renderSlot(_ctx.$slots,"default",normalizeProps(guardReactiveProps({row:_ctx.emptyRow})))])):createCommentVNode("v-if",true),createTextVNode(),_ctx.isEmpty?(openBlock(),createElementBlock(Fragment,{key:1},[withDirectives(createElementVNode("tr",_hoisted_23,[renderSlot(_ctx.$slots,"default",normalizeProps(guardReactiveProps({row:_ctx.emptyRow})))],512/* NEED_PATCH */),[[vShow,false]]),createTextVNode(),createElementVNode("tr",null,[createElementVNode("td",{class:"table__column table__column--action",colspan:_ctx.nbOfColumns},[renderSlot(_ctx.$slots,"empty",{},()=>[createTextVNode(toDisplayString(_ctx.$t("fkui.interactive-table.empty","Tabellen är tom")),1/* TEXT */)])],8,_hoisted_24)])],64/* STABLE_FRAGMENT */)):createCommentVNode("v-if",true)],512/* NEED_PATCH */)],16,_hoisted_1$6)],2/* CLASS */);}const FInteractiveTable=/* @__PURE__ */_export_sfc(_sfc_main$6,[["render",_sfc_render$6]]);const _sfc_main$5=defineComponent({name:"FTextareaField",components:{FLabel},inheritAttrs:false,props:{/**
785
+ * The id for the input id attribute.
786
+ * The id for the label for attribute.
787
+ * If the prop is not set a random value will be generated.
788
+ */id:{type:String,required:false,default:()=>ElementIdService.generateElementId()},/**
789
+ * The value for the input.
790
+ * If the prop is not set undefined will be used.
791
+ * @model
792
+ */modelValue:{type:String,required:false,default:void 0},/**
793
+ * The number of characters for when the "characters left" warning should be shown.
794
+ * A value of 100 means that when 100 or less characters is left the warning is shown.
795
+ * If softLimit is used, then maxlength is required.
796
+ * If the prop is not set undefined will be used, which means that no warning will be shown.
797
+ */softLimit:{type:Number,required:false,default:void 0},/**
798
+ * The maximum amount of characters permitted in the textarea.
799
+ * If the prop is not set undefined will be used, which means unlimited.
800
+ */maxlength:{type:Number,required:false,default:void 0},/**
801
+ * The string that should be shown in the "characters left" warning.
802
+ * Must contain the word %charactersLeft% which is used to interpolate the number of characters left into the warning string.
803
+ * If the prop is not set "Antal tecken kvar: %charactersLeft%" will be used.
804
+ */charactersLeftWarning:{type:String,required:false,default:"Antal tecken kvar: %charactersLeft%"},/**
805
+ * Specifies that the component should be disabled, i.e. unusable.
806
+ */disabled:{type:Boolean,default:false},/**
807
+ * Enabling vertical resizing of the textarea
808
+ */resizable:{type:Boolean,default:false}},emits:["input","update:modelValue"],data(){return{validityMode:"INITIAL",validationMessage:""};},computed:{attrs(){return{rows:4,...this.$attrs,value:this.modelValue,maxlength:this.maxlength};},isValid(){return this.validityMode==="VALID";},hasError(){return this.validityMode==="ERROR";},validityClass(){return{["textarea-field--error"]:this.hasError};},charactersLeft(){if(this.modelValue){return this.maxlength-this.modelValue.length;}else{return this.maxlength;}},showCharactersLeftWarning(){return isSet(this.softLimit)&&isSet(this.modelValue)&&// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- required when `softLimit`
809
+ this.modelValue.length>=this.maxlength-this.softLimit;},charactersLeftWarningInterpolated(){return`${this.charactersLeftWarning.replace("%charactersLeft%",this.charactersLeft.toString())}`;},textareaClass(){const classes=["textarea-field__textarea"];if(this.resizable){classes.push("textarea-field__resize--vertical");}else{classes.push("textarea-field__resize--none");}return classes;}},mounted(){if(isSet(this.softLimit)&&!isSet(this.maxlength)){throw new Error("You must pass a maxlength");}},methods:{onInput(event){if(event.target instanceof HTMLTextAreaElement){this.$emit("update:modelValue",event.target.value);this.$emit("input",event.target.value);}},onValidity({detail}){var _renderSlotText7;this.validationMessage=detail.validationMessage;this.validityMode=detail.validityMode;const errorMessage=(_renderSlotText7=renderSlotText(this.$slots.default))!==null&&_renderSlotText7!==void 0?_renderSlotText7:"";const element=this.$el.querySelector(`#${detail.elementId}`);if(element){dispatchComponentValidityEvent(element,{...detail,errorMessage,focusElementId:detail.elementId});}},onPendingValidity(){this.validityMode="INITIAL";}}});const _hoisted_1$5=["id","disabled"];function _sfc_render$5(_ctx,_cache,$props,$setup,$data,$options){const _component_f_label=resolveComponent("f-label");return openBlock(),createElementBlock("div",{class:normalizeClass(["textarea-field",_ctx.validityClass])},[createVNode(_component_f_label,{for:_ctx.id},createSlots({default:withCtx(()=>[renderSlot(_ctx.$slots,"default")]),description:withCtx(({descriptionClass,discreteDescriptionClass})=>[renderSlot(_ctx.$slots,"description",normalizeProps(guardReactiveProps({descriptionClass,discreteDescriptionClass})))]),"error-message":withCtx(()=>[renderSlot(_ctx.$slots,"error-message",normalizeProps(guardReactiveProps({hasError:_ctx.hasError,validationMessage:_ctx.validationMessage})),()=>[_ctx.hasError?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(toDisplayString(_ctx.validationMessage),1/* TEXT */)],64/* STABLE_FRAGMENT */)):createCommentVNode("v-if",true)])]),_:2/* DYNAMIC */},[_ctx.$slots.tooltip?{name:"tooltip",fn:withCtx(()=>[renderSlot(_ctx.$slots,"tooltip")]),key:"0"}:void 0]),1032,["for"]),createTextVNode(),_ctx.softLimit?(openBlock(),createBlock(_component_f_label,{key:0,for:_ctx.id,"aria-live":"polite"},{description:withCtx(({descriptionClass})=>[_ctx.showCharactersLeftWarning?(openBlock(),createElementBlock("span",{key:0,class:normalizeClass(descriptionClass)},toDisplayString(_ctx.charactersLeftWarningInterpolated),3/* TEXT, CLASS */)):createCommentVNode("v-if",true)]),_:1/* STABLE */},8,["for"])):createCommentVNode("v-if",true),createTextVNode(),createElementVNode("textarea",mergeProps({id:_ctx.id,class:_ctx.textareaClass},_ctx.attrs,{disabled:_ctx.disabled,onInput:_cache[0]||(_cache[0]=(...args)=>_ctx.onInput&&_ctx.onInput(...args)),onValidity:_cache[1]||(_cache[1]=(...args)=>_ctx.onValidity&&_ctx.onValidity(...args)),onPendingValidity:_cache[2]||(_cache[2]=(...args)=>_ctx.onPendingValidity&&_ctx.onPendingValidity(...args))}),null,16,_hoisted_1$5)],2/* CLASS */);}const FTextareaField=/* @__PURE__ */_export_sfc(_sfc_main$5,[["render",_sfc_render$5]]);const ANIMATION_DURATION=500;const NO_CSS_CLASSES="";const CLOSED_CSS_CLASS_OPACITY="animate-expand animate-expand--opacity";const CLOSED_CSS_CLASS="animate-expand";const ANIMATION_CSS_CLASSES="animate-expand animate-expand--expanded";const _sfc_main$4=defineComponent({name:"IAnimateExpand",props:{/**
810
+ * Perform animation or not
811
+ */animate:{type:Boolean,default:true},/**
812
+ * Use v-show instead of v-if when hiding content.
813
+ */useVShow:{type:Boolean,default:false},/**
814
+ * Toggle expanded/collapsed state
815
+ */expanded:{type:[String,Number,Boolean],default:true},/* Toggle opacity in animation */opacity:{type:Boolean,default:true},/**
816
+ * Optional callback for performing actions before animation.
817
+ * Callback will await Promise.
818
+ */beforeAnimation:{type:Function,required:false,default(){return()=>{};}},/**
819
+ * Optional callback for performing actions after animation.
820
+ * Callback will await Promise.
821
+ */afterAnimation:{type:Function,required:false,default(){return()=>{};}}},data(){return{internalExpanded:Boolean(this.expanded),height:0,isAnimating:false,cssClasses:"",/**
822
+ * When the open animation is triggered it creates a timer for `ANIMATION_DURATION`.
823
+ * If the collapse animation is triggered before this timer has started
824
+ * it must be canceled or the previous opening will reset the state before collapse is finished thus corrupting the state of the element.
825
+ * Vice verse when collapse animation is triggered it also creates timers which the open animation must cancel.
826
+ *
827
+ * ```
828
+ * Actor IAnimationExpand
829
+ * | |
830
+ * +----[ open ] -------> |
831
+ * | +----+ Timer 1
832
+ * | | |
833
+ * +----[ close ] ------> | |
834
+ * | +----)----+ Timer 2
835
+ * | | | |
836
+ * | *KABOOM* |<---+ |
837
+ * | | |
838
+ * | | |
839
+ * | *KABOOM* |<--------+
840
+ * | |
841
+ * ```
842
+ */timerList:[]};},computed:{animationClasses(){if(!this.animate){return"";}return this.cssClasses;},heightStyle(){return this.height===""?"":`height: ${this.height}px`;},shouldVIf(){if(this.useVShow){return true;}else{return this.internalExpanded;}},shouldVShow(){if(this.useVShow){return this.internalExpanded;}else{return true;}}},watch:{expanded:{immediate:false,handler(){if(this.expanded&&this.animate){this.openAnimation();}else if(this.expanded){this.openNoAnimation();}else if(this.animate){this.closeAnimation();}else{this.closeNoAnimation();}}}},beforeMount(){if(this.expanded){this.height="";}else if(this.animate){this.cssClasses=this.opacity?CLOSED_CSS_CLASS_OPACITY:CLOSED_CSS_CLASS;}},methods:{getContentHeight(){const content=this.$refs.content;return content?content.getBoundingClientRect().height:0;},async openNoAnimation(){await this.beforeAnimation(true);this.internalExpanded=true;await this.$nextTick();this.cssClasses=NO_CSS_CLASSES;this.height=this.getContentHeight();await this.afterAnimation(true);},async closeNoAnimation(){await this.beforeAnimation(false);this.internalExpanded=false;this.cssClasses=NO_CSS_CLASSES;this.height="0";await this.$nextTick();await this.afterAnimation(false);},async openAnimation(){await this.beforeAnimation(true);this.internalExpanded=true;await this.$nextTick();this.cssClasses=ANIMATION_CSS_CLASSES;this.height=this.getContentHeight();for(const timer of this.timerList){clearTimeout(timer);}const t=setTimeout(async()=>{this.timerList=[];this.cssClasses=NO_CSS_CLASSES;this.height="";await this.afterAnimation(true);},ANIMATION_DURATION);this.timerList=[t];},async closeAnimation(){await this.beforeAnimation(false);this.height=this.getContentHeight();this.cssClasses=ANIMATION_CSS_CLASSES;for(const timer of this.timerList){clearTimeout(timer);}const t1=setTimeout(()=>{this.timerList=this.timerList.filter(it=>it!==t1);this.cssClasses=this.opacity?CLOSED_CSS_CLASS_OPACITY:CLOSED_CSS_CLASS;this.height="0";},0);const t2=setTimeout(async()=>{this.timerList=this.timerList.filter(it=>it!==t2);this.internalExpanded=false;await this.afterAnimation(false);},ANIMATION_DURATION);this.timerList=[t1,t2];}}});const _hoisted_1$4={key:0,ref:"content","data-test":"animation-content"};function _sfc_render$4(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createElementBlock("div",{class:normalizeClass(_ctx.animationClasses),style:normalizeStyle(_ctx.heightStyle)},[_ctx.shouldVIf?withDirectives((openBlock(),createElementBlock("div",_hoisted_1$4,[renderSlot(_ctx.$slots,"default")],512/* NEED_PATCH */)),[[vShow,_ctx.shouldVShow]]):createCommentVNode("v-if",true)],6/* CLASS, STYLE */);}const IAnimateExpand=/* @__PURE__ */_export_sfc(_sfc_main$4,[["render",_sfc_render$4]]);const _sfc_main$3=defineComponent({name:"FTooltip",components:{FExpand,FIcon,IFlex,IFlexItem},props:{/**
843
+ * State (expanded or collapsed) of the tooltip. The value is `true` if the tooltip is expanded.
844
+ *
845
+ * @model
846
+ */modelValue:{type:Boolean,required:false},/**
847
+ * Screen reader text for toggle button
848
+ */screenReaderText:{type:String,required:true},/**
849
+ * Close button text
850
+ */closeButtonText:{type:String,required:false,default:TranslationService.provider.translate("fkui.tooltip.close","Stäng")},/**
851
+ * Element to render for the header element inside the tooltip.
852
+ *
853
+ * Must be set to one of:
854
+ *
855
+ * - `div` (default)
856
+ * - `span`
857
+ * - `h1`
858
+ * - `h2`
859
+ * - `h3`
860
+ * - `h4`
861
+ * - `h5`
862
+ * - `h6`
863
+ */headerTag:{default:"div",required:false,validator(value){return["div","span","h1","h2","h3","h4","h5","h6"].includes(value);}}},emits:["update:modelValue","toggle"],data(){return{isOpen:false};},computed:{hasHeader(){return hasSlot(this,"header");}},watch:{modelValue:{immediate:true,handler(value){this.isOpen=value;}}},mounted(){window.addEventListener("resize",()=>{if(this.isOpen){this.positionArrow();}});if(this.isOpen){this.positionArrow();}},methods:{/**
864
+ * Gets called when the user interacts with the toggle button
865
+ *
866
+ * @internal
867
+ */onClickToggle(){this.isOpen=!this.isOpen;const value=this.isOpen;const event={isOpen:this.isOpen};this.$emit("update:modelValue",value);this.$emit("toggle",event);if(!this.isOpen){const button=this.$el.querySelector(".tooltip__button");focus$1(button);}this.$nextTick(()=>{this.positionArrow();});},positionArrow(){const button=this.$el.querySelector(".tooltip__button");const arrow=this.$el.querySelector(".tooltip__arrow");const content=this.$el.querySelector(".tooltip__content-wrapper");const borderSize=2;if(button&&arrow&&content){const buttonOffsetLeft=button.offsetLeft-content.offsetLeft;const relativeOffset=buttonOffsetLeft-borderSize+button.getBoundingClientRect().width/2;arrow.style.left=`${relativeOffset}px`;}}}});const _hoisted_1$3={class:"tooltip"};const _hoisted_2$2={class:"tooltip__container"};const _hoisted_3$2=["aria-expanded"];const _hoisted_4$1={class:"icon-stack icon-stack--tooltip"};const _hoisted_5$1={class:"sr-only"};const _hoisted_6$1={key:0};const _hoisted_7$1=["aria-hidden"];const _hoisted_8$1={class:"tooltip__arrow"};const _hoisted_9$1={class:"tooltip__content"};const _hoisted_10$1={class:"tooltip__body"};function _sfc_render$3(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");const _component_i_flex_item=resolveComponent("i-flex-item");const _component_i_flex=resolveComponent("i-flex");const _component_f_expand=resolveComponent("f-expand");return openBlock(),createElementBlock("div",_hoisted_1$3,[createElementVNode("div",_hoisted_2$2,[createElementVNode("button",{class:"tooltip__button",type:"button","aria-expanded":_ctx.isOpen?"true":"false",onClick:_cache[0]||(_cache[0]=(...args)=>_ctx.onClickToggle&&_ctx.onClickToggle(...args))},[createElementVNode("span",_hoisted_4$1,[createVNode(_component_f_icon,{name:"circle"}),createTextVNode(),createVNode(_component_f_icon,{name:"i"}),createTextVNode(),createElementVNode("span",_hoisted_5$1,toDisplayString(_ctx.screenReaderText),1/* TEXT */)])],8,_hoisted_3$2),createTextVNode(),createVNode(_component_f_expand,null,{default:withCtx(()=>[_ctx.isOpen?(openBlock(),createElementBlock("div",_hoisted_6$1,[createElementVNode("div",{class:"tooltip__content-wrapper",tabindex:"-1","aria-hidden":_ctx.isOpen?void 0:"true"},[withDirectives(createElementVNode("span",_hoisted_8$1,null,512/* NEED_PATCH */),[[vShow,_ctx.isOpen]]),createTextVNode(),createElementVNode("div",_hoisted_9$1,[_ctx.hasHeader?(openBlock(),createBlock(resolveDynamicComponent(_ctx.headerTag),{key:0,class:"tooltip__header"},{default:withCtx(()=>[renderSlot(_ctx.$slots,"header")]),_:3/* FORWARDED */})):createCommentVNode("v-if",true),createTextVNode(),createElementVNode("div",_hoisted_10$1,[renderSlot(_ctx.$slots,"body")])]),createTextVNode(),createVNode(_component_i_flex,{float:"right"},{default:withCtx(()=>[createVNode(_component_i_flex_item,{shrink:""},{default:withCtx(()=>[createElementVNode("button",{class:"close-button",type:"button",onClick:_cache[1]||(_cache[1]=(...args)=>_ctx.onClickToggle&&_ctx.onClickToggle(...args))},[createElementVNode("span",null,toDisplayString(_ctx.closeButtonText),1/* TEXT */),createTextVNode(),createVNode(_component_f_icon,{class:"button__icon",name:"close"})])]),_:1/* STABLE */})]),_:1/* STABLE */})],8,_hoisted_7$1)])):createCommentVNode("v-if",true)]),_:3/* FORWARDED */})])]);}const FTooltip=/* @__PURE__ */_export_sfc(_sfc_main$3,[["render",_sfc_render$3]]);function FWizardApiInjected(){return{register:inject("register"),unregister:inject("unregister"),getStepCount:inject("getStepCount"),openStep:inject("openStep"),openNext:inject("openNext"),cancel:inject("cancel"),inheritedProps:inject("inheritedProps")};}function reindex(dst){dst.sort((a,b)=>documentOrderComparator(a.element,b.element));for(let i=0;i<dst.length;i++){dst[i].stepNumber=i+1;}}function addStep(dst,key,element){const index=dst.findIndex(it=>it.key===key);if(index>=0){throw new Error(`An FWizardStep with key "${key.toString()}" is already registered, refusing to register multiple steps with same key.`);}const step={key,element,stepNumber:-1,isOpen:false,currentOpen:-1};dst.push(step);reindex(dst);return step;}function removeStep(dst,key){const index=dst.findIndex(it=>it.key===key);if(index>=0){dst.splice(index,1);reindex(dst);}}const _sfc_main$2=defineComponent({name:"FWizard",provide(){const wizard=this;const inheritedProps={get headerTag(){return wizard.headerTag;},get disableInitialFocus(){return wizard.disableInitialFocus;}};return{register:this.register,unregister:this.unregister,getStepCount:this.getStepCount,openStep:this.openStep,openNext:this.openNext,cancel:this.cancel,inheritedProps};},inheritAttrs:true,props:{modelValue:{type:String,default:null},/**
868
+ * Element to render for the header element inside the wizard steps.
869
+ */headerTag:{type:String,required:true,validator(value){return["h1","h2","h3","h4","h5","h6"].includes(value);}},/**
870
+ * When the first wizard step is registered, it is opened and focused by default.
871
+ * Set this property to disable that behaviour.
872
+ */disableInitialFocus:{type:Boolean,required:false,default:false}},emits:["cancel","change","completed","update:modelValue"],data(){return{steps:[]};},computed:{anyOpen(){return Boolean(this.getCurrentOpen());}},watch:{modelValue:{handler(){if(!this.modelValue){return;}const step=this.steps.find(it=>it.key===this.modelValue);if(!step){throw new Error(`Failed to open step "${this.modelValue}"`);}if(!step.isOpen){this.openStep(step);}}}},methods:{register(key,element){const step=addStep(this.steps,key,element);if(this.modelValue!==null){if(step.key===this.modelValue){this.doOpen(step.stepNumber);}}else{if(this.steps.length===1){this.doOpen(step.stepNumber);}}const current=this.getCurrentOpen();step.currentOpen=current?current.stepNumber:-1;return step;},unregister(key){removeStep(this.steps,key);},getStepCount(){return this.steps.length;},getCurrentOpen(){var _this$steps$find;return(_this$steps$find=this.steps.find(it=>it.isOpen))!==null&&_this$steps$find!==void 0?_this$steps$find:null;},openStep(step){this.doOpen(step.stepNumber);},async openNext(step){const current=step.stepNumber;const next=current+1;if(next>this.steps.length){await this.doOpen(-1);this.$emit("completed");}else{await this.doOpen(next);}},async doOpen(open){const stepToClose=this.steps.find(it=>it.isOpen);if(stepToClose){stepToClose.isOpen=false;}await this.$nextTick();for(const step of this.steps){step.isOpen=step.stepNumber===open;step.currentOpen=open;}if(open>=0){const step=this.steps[open-1];this.$emit("update:modelValue",step.key);this.$emit("change",step.key);}else{this.$emit("update:modelValue",null);this.$emit("change",null);}},cancel(){this.$emit("cancel");}}});const _hoisted_1$2={class:"wizard"};function _sfc_render$2(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createElementBlock("div",_hoisted_1$2,[renderSlot(_ctx.$slots,"default")]);}const FWizard=/* @__PURE__ */_export_sfc(_sfc_main$2,[["render",_sfc_render$2]]);const SCROLL_DURATION=500;let ongoingScrollPromise=void 0;const _sfc_main$1=defineComponent({name:"FWizardStep",components:{IAnimateExpand,IFlex,IFlexItem,FValidationForm,FIcon},mixins:[TranslationMixin],inheritAttrs:true,props:{title:{type:String,required:true},/**
873
+ * Supply this function in order to run actions before navigating to the next step.
874
+ *
875
+ * It is possible to cancel the navigation by returning `BeforeNextAction.CANCEL`.
876
+ * When cancelled, the consumer is responsible to indicate why this happened.
877
+ *
878
+ * Note that `FWizardStep` already checks validity of contained fields using `v-validation`
879
+ * before allowing navigation to the next step.
880
+ */beforeNext:{type:Function,required:false,default(){}},/**
881
+ * Supply this function in order to run actions before `FWizardStep` checks validity.
882
+ *
883
+ * `beforeValidation` is used by {@link FValidationForm}.
884
+ *
885
+ * It is possible to cancel the navigation by returning `BeforeNextAction.CANCEL`.
886
+ * When cancelled, the consumer is responsible to indicate why this happened.
887
+ */beforeValidation:{type:Function,required:false,default(){}},/**
888
+ * Include the error list component.
889
+ */useErrorList:{type:Boolean,required:false,default:true}},setup(){return FWizardApiInjected();},data(){return{step:{},validity:{isValid:true,componentsWithError:[],componentCount:0},isOpenedFirstTime:true,ignoreClick:false};},computed:{defaultCurrentStepInformation(){return this.$t("fkui.wizard-step.current-step",`Steg {{ stepNumber }} av {{ totalSteps }}`,{stepNumber:this.stepNumber,totalSteps:this.totalSteps});},formId(){return`${String(this.step.key)}-form`;},animationId(){return`${String(this.step.key)}-animation`;},isOpen(){return this.step.isOpen;},isPending(){const{currentOpen,stepNumber}=this.step;return currentOpen>=0&&currentOpen<stepNumber;},isFinalStep(){return this.stepNumber===this.totalSteps;},showLink(){return!this.isOpen&&!this.isPending;},stepNumber(){return this.step.stepNumber;},totalSteps(){return this.getStepCount();},cssClass(){if(this.isOpen){return"wizard-step--open";}if(this.isPending){return"wizard-step--pending";}return"wizard-step--done";}},mounted(){var _a,_b;const key=(_b=(_a=getCurrentInstance())==null?void 0:_a.vnode)==null?void 0:_b.key;if(!key){throw new Error("FWizardStep requires key to be set");}this.step=this.register(key,this.$el);},beforeUnmount(){var _a,_b;const key=(_b=(_a=getCurrentInstance())==null?void 0:_a.vnode)==null?void 0:_b.key;if(key){this.unregister(key);}},methods:{open(){this.openStep(this.step);},async onSubmit(){if(this.ignoreClick){return;}this.openNext(this.step);},onCancel(){this.cancel();},/**
890
+ * Scroll down before animation starts.
891
+ */async beforeAnimation(open){await this.$nextTick();this.ignoreClick=true;if(!open){const headerElement=getHTMLElementFromVueRef(this.$refs["header"]);if(!DomUtils.isVisibleInViewport(headerElement)){ongoingScrollPromise=DomUtils.scrollTo(headerElement,{duration:SCROLL_DURATION,offset:10});await ongoingScrollPromise;}}else if(ongoingScrollPromise){await ongoingScrollPromise;}},async afterAnimation(open){if(!open){return;}this.ignoreClick=false;if(this.isOpenedFirstTime){this.isOpenedFirstTime=false;if(this.inheritedProps.disableInitialFocus&&this.stepNumber===1){return;}}const headerElement=getHTMLElementFromVueRef(this.$refs["header"]);await this.$nextTick();if(!DomUtils.isVisibleInViewport(headerElement)){await DomUtils.scrollTo(headerElement,{duration:SCROLL_DURATION,offset:10});}DomUtils.focus(headerElement);}}});const _hoisted_1$1=["aria-current"];const _hoisted_2$1={ref:"header",role:"group",class:"wizard-step__header",tabindex:"-1"};const _hoisted_3$1=/* @__PURE__ */createElementVNode("div",{class:"wizard-step__header__line-up"},null,-1/* HOISTED */);const _hoisted_4={class:"icon-stack"};const _hoisted_5={"data-test":"step-number"};const _hoisted_6=/* @__PURE__ */createElementVNode("div",{class:"wizard-step__header__line-down"},null,-1/* HOISTED */);const _hoisted_7={"aria-hidden":"true",class:"wizard-step__header__step-of"};const _hoisted_8={class:"sr-only"};const _hoisted_9={class:"sr-only"};const _hoisted_10={class:"sr-only"};const _hoisted_11={key:0,class:"sr-only"};const _hoisted_12=/* @__PURE__ */createElementVNode("div",{class:"wizard-step__header__line-adjustment"},null,-1/* HOISTED */);const _hoisted_13={class:"button-group"};const _hoisted_14=["data-disabled"];const _hoisted_15={class:"sr-only"};function _sfc_render$1(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");const _component_i_flex_item=resolveComponent("i-flex-item");const _component_i_flex=resolveComponent("i-flex");const _component_f_validation_form=resolveComponent("f-validation-form");const _component_i_animate_expand=resolveComponent("i-animate-expand");return openBlock(),createElementBlock("div",{class:normalizeClass(["wizard-step",_ctx.cssClass]),"aria-current":_ctx.isOpen?"step":void 0},[createElementVNode("div",_hoisted_2$1,[createVNode(_component_i_flex,null,{default:withCtx(()=>[createVNode(_component_i_flex_item,{align:"bottom",shrink:"","aria-hidden":"true"},{default:withCtx(()=>[_hoisted_3$1,createTextVNode(),createElementVNode("div",_hoisted_4,[createVNode(_component_f_icon,{name:"circle"}),createTextVNode(),createVNode(_component_f_icon,{name:"success"}),createTextVNode(),createElementVNode("div",_hoisted_5,toDisplayString(_ctx.stepNumber),1/* TEXT */)]),createTextVNode(),_hoisted_6]),_:1/* STABLE */}),createTextVNode(),createVNode(_component_i_flex_item,{align:"bottom",grow:""},{default:withCtx(()=>[_ctx.isOpen?renderSlot(_ctx.$slots,"step-of",normalizeProps(mergeProps({key:0},{headerClass:"wizard-step__header__step-of",stepNumber:_ctx.stepNumber,totalSteps:_ctx.totalSteps})),()=>[createElementVNode("span",_hoisted_7,toDisplayString(_ctx.defaultCurrentStepInformation),1/* TEXT */)]):createCommentVNode("v-if",true),createTextVNode(),createVNode(_component_i_flex,{class:"wizard-step__header__title-container"},{default:withCtx(()=>[createVNode(_component_i_flex_item,{align:"center"},{default:withCtx(()=>[_ctx.showLink?(openBlock(),createElementBlock("a",{key:0,"aria-expanded":"false",role:"button",href:"#",class:"anchor wizard-step__header__title",onClick:_cache[0]||(_cache[0]=withModifiers((...args)=>_ctx.open&&_ctx.open(...args),["prevent"])),onKeypress:_cache[1]||(_cache[1]=withKeys(withModifiers((...args)=>_ctx.open&&_ctx.open(...args),["prevent"]),["space"]))},[createElementVNode("span",_hoisted_8,toDisplayString(_ctx.defaultCurrentStepInformation)+" ",1/* TEXT */),createTextVNode(" "+toDisplayString(_ctx.title)+" ",1/* TEXT */),createElementVNode("span",_hoisted_9," "+toDisplayString(_ctx.$t("fkui.wizard-step.finished-step","Avklarat steg")),1/* TEXT */)],32/* NEED_HYDRATION */)):(openBlock(),createBlock(resolveDynamicComponent(_ctx.inheritedProps.headerTag),{key:1,class:"wizard-step__header__title"},{default:withCtx(()=>[createElementVNode("span",_hoisted_10,toDisplayString(_ctx.defaultCurrentStepInformation)+" ",1/* TEXT */),createTextVNode(" "+toDisplayString(_ctx.title)+" ",1/* TEXT */),_ctx.isPending?(openBlock(),createElementBlock("span",_hoisted_11,"\n  "+toDisplayString(_ctx.$t("fkui.wizard-step.pending","Inaktivt")),1/* TEXT */)):createCommentVNode("v-if",true)]),_:1/* STABLE */}))]),_:1/* STABLE */})]),_:1/* STABLE */}),createTextVNode(),_hoisted_12]),_:3/* FORWARDED */})]),_:3/* FORWARDED */})],512/* NEED_PATCH */),createTextVNode(),(openBlock(),createBlock(_component_i_animate_expand,{key:_ctx.animationId,opacity:false,expanded:_ctx.isOpen,"before-animation":_ctx.beforeAnimation,"after-animation":_ctx.afterAnimation,class:"wizard-step__connector"},{default:withCtx(()=>[createVNode(_component_f_validation_form,{id:_ctx.formId,"before-submit":_ctx.beforeNext,"before-validation":_ctx.beforeValidation,"use-error-list":_ctx.useErrorList,class:"wizard-step-body",onSubmit:_ctx.onSubmit},{"error-message":withCtx(()=>[renderSlot(_ctx.$slots,"error-message",{},()=>[createTextVNode(toDisplayString(_ctx.$t("fkui.wizard-step.errorlist.title","Oj, du har glömt att fylla i något. Gå till:")),1/* TEXT */)])]),default:withCtx(()=>[renderSlot(_ctx.$slots,"default"),createTextVNode(),createElementVNode("div",_hoisted_13,[createElementVNode("button",{"data-test":"submit-button","data-disabled":_ctx.ignoreClick?"true":"false",type:"submit",class:"button button--primary button-group__item button--large"},[renderSlot(_ctx.$slots,"next-button-text",{},()=>[_ctx.isFinalStep?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(toDisplayString(_ctx.$t("fkui.wizard-step.button.next.text-final","Gå vidare och granska")),1/* TEXT */)],64/* STABLE_FRAGMENT */)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(_ctx.$t("fkui.wizard-step.button.next.text","Fortsätt"))+" ",1/* TEXT */),createElementVNode("span",_hoisted_15,"\n  "+toDisplayString(_ctx.$t("fkui.wizard-step.button.next.sr-text","till nästa steg")),1/* TEXT */)],64/* STABLE_FRAGMENT */))])],8,_hoisted_14),createTextVNode(),createElementVNode("button",{"data-test":"cancel-button",type:"button",class:"button button--secondary button-group__item button--large",onClick:_cache[2]||(_cache[2]=(...args)=>_ctx.onCancel&&_ctx.onCancel(...args))},toDisplayString(_ctx.$t("fkui.wizard-step.button.cancel.text","Avbryt")),1/* TEXT */)])]),_:3/* FORWARDED */},8,["id","before-submit","before-validation","use-error-list","onSubmit"])]),_:3/* FORWARDED */},8,["expanded","before-animation","after-animation"]))],10,_hoisted_1$1);}const FWizardStep=/* @__PURE__ */_export_sfc(_sfc_main$1,[["render",_sfc_render$1]]);function isDialogueTreeEndQuestion(value){return Boolean(value.userData);}const _sfc_main=defineComponent({name:"FDialogueTree",components:{FIcon},props:{/**
892
+ * Current dialogue question
893
+ * @model
894
+ */modelValue:{type:Object,required:true},/**
895
+ * Dialogue tree
896
+ */dialogueTree:{type:Object,required:true}},emits:["change","update:modelValue"],data(){return{currentStep:this.dialogueTree,steps:[]};},computed:{userData(){if(isDialogueTreeEndQuestion(this.currentStep)){return this.currentStep.userData;}return void 0;},options(){if(!isDialogueTreeEndQuestion(this.currentStep)){return this.currentStep.options;}return[];}},created(){this.currentStep=this.dialogueTree;if(isDialogueTreeEndQuestion(this.currentStep)){this.emitChange(true);}else{this.emitChange(false);}},methods:{async onClickedOption(option,index){this.steps.push(index);this.currentStep=option.question;if(isDialogueTreeEndQuestion(option.question)){this.emitChange(true);await this.$nextTick();focusFirst(this.$el);}else{this.emitChange(false);await this.$nextTick();const firstElement=getHTMLElementsFromVueRef(this.$refs["dialogueButton-0"])[0];if(firstElement){focus$1(firstElement);}}},emitChange(lastStep){const emit={label:this.currentStep.label,lastStep,steps:this.steps};this.$emit("update:modelValue",emit);this.$emit("change",emit);}}});const _hoisted_1={class:"dialogue-tree"};const _hoisted_2={key:0,class:"dialogue-tree__list"};const _hoisted_3=["onClick"];function _sfc_render(_ctx,_cache,$props,$setup,$data,$options){const _component_f_icon=resolveComponent("f-icon");return openBlock(),createElementBlock("div",_hoisted_1,[_ctx.options.length>0?(openBlock(),createElementBlock("ul",_hoisted_2,[(openBlock(true),createElementBlock(Fragment,null,renderList(_ctx.options,(option,index)=>{return openBlock(),createElementBlock("li",{key:option.label,class:"dialogue-tree__list-item"},[createElementVNode("button",{ref_for:true,ref:`dialogueButton-${index}`,type:"button",onClick:$event=>_ctx.onClickedOption(option,index)},[createElementVNode("span",null,toDisplayString(option.label),1/* TEXT */),createTextVNode(),createVNode(_component_f_icon,{name:"arrow-right"})],8,_hoisted_3)]);}),128/* KEYED_FRAGMENT */))])):renderSlot(_ctx.$slots,"default",normalizeProps(mergeProps({key:1},{userData:_ctx.userData})))]);}const FDialogueTree=/* @__PURE__ */_export_sfc(_sfc_main,[["render",_sfc_render]]);export{ActivateItemInjected,ErrorData,ErrorPlugin,ErrorViewData,EventBus,FBadge,_sfc_main$I as FBankAccountNumberTextField,_sfc_main$H as FBankgiroTextField,FCalendar,FCalendarDay,FCard,FCheckboxField,FCheckboxGroup,FCheckboxField as FCheckboxGroupField,_sfc_main$G as FClearingnumberTextField,FConfirmModal,FContextMenu,FCrudButton,FCrudDataset,_sfc_main$K as FCurrencyTextField,FDataTable,FDatepickerField,FDialogueTree,FEmailTextField,FErrorHandlingApp,FErrorList,FExpand,FExpandablePanel,FExpandableParagraph,FFieldset,FFileItem,FFileSelector,FForm,FFormModal,FValidationFormAction as FFormModalAction,FFormStep,FFormStepButton,FIcon,FInteractiveTable,FKUIConfigButtonOrder,FLabel,FLayoutApplicationTemplate,FLayoutLeftPanel,FLayoutRightPanel,FLayoutRightPanelService,FList,FLoader,FMessageBox,FModal,FNavigationMenu,_sfc_main$F as FNumericTextField,FOffline,_sfc_main$A as FOrganisationsnummerTextField,FOutputField,FPageHeader,_sfc_main$B as FPercentTextField,_sfc_main$E as FPersonnummerTextField,FPhoneTextField,_sfc_main$D as FPlusgiroTextField,_sfc_main$C as FPostalCodeTextField,FProgressbar,FRadioField,FRadioGroup,FRadioField as FRadioGroupField,FSearchTextField,FSelectField,FSortFilterDataset,FSortFilterDatasetInjected,FStaticField,FTableColumn,FTextField,FTextareaField,FTooltip,FValidationForm,FValidationFormAction,FValidationGroup,FWizard,FWizardStep,FValidationFormAction as FWizardStepAction,FormErrorList,FormStep,IAnimateExpand,ICalendarMonth,ICalendarMonthGrid,ICalendarNavbar,IFlex,IFlexItem,IMenu,IPopup,IPopupError,IPopupMenu,ISkipLink,FValidationForm as IValidationForm,MenuAction,ModalReason,TableScroll,TestPlugin,TranslationMixin,TranslationPlugin,UNHANDLED_ERROR_EVENT,ValidationPlugin,actionFromKeyboardEvent,cleanUpElements,config,confirmModal,createFFormProvideOptions,dispatchComponentUnmountEvent,dispatchComponentValidityEvent,emptyTableRow,findElementFromVueRef,findHTMLElementFromVueRef,findParentByName,focus,formModal,getDayEndOffset,getDayStartOffset,getElementFromVueRef,getElementsFromVueRef,getHTMLElementFromVueRef,getHTMLElementsFromVueRef,getInputElement,getParentByName,getRef,getSortedHTMLElementsFromVueRef,getTextFromScopedSlot,handleKeyboardFocusNavigation,hasParentByName,hasSlot,includeItem,isContextMenuSeparatorItem,isContextMenuTextItem,isDialogueTreeEndQuestion,isFormStepReference,itemEquals,mountComponent,openModal,refIsElement,refIsElementArray,refIsHTMLElementArray,refIsVue,refIsVueArray,renderSlotText,setIsOpen,setRef,setRunningContext,sortComponentsWithErrorsOnDOMOrder,tableScrollClasses,updateCalendarValue,useTranslate};