import{h as y,i as b}from"./chunk-V67SIXYX.js";import{c as s,d as P}from"./chunk-YADAVUVK.js";import{f as S}from"./chunk-HEIW4SFT.js";var o,D=S(()=>{"use strict";o=(()=>{class u{static{this.setParam=null}static{this.sys=null}static{this.locale="sl-SI"}static{this.formatting={datetime:{date:"dd.MM.yyyy",dateTime:"dd.MM.yyyy HH:mm"},numeral:{currencyCode:"EUR",decimalSeparator:",",thousandsSeparator:"."}}}}return u})()});var N,T=S(()=>{"use strict";b();P();D();N=class u{static currency(t,r,n=o.sys?.defaultDecimalPlacesPrice||2){if(t===void 0&&(t=0),!s.isSet(r))return u.decimal(t,n);let e={style:"currency",currency:r,minimumFractionDigits:n??o.sys?.defaultDecimalPlacesPrice,maximumFractionDigits:n??o.sys?.defaultDecimalPlacesPrice};return new Intl.NumberFormat(o.locale,e).format(t)}static decimal(t,r=o.sys?.defaultDecimalPlacesPrice||2,n=o.formatting.numeral.decimalSeparator,e=o.formatting.numeral.thousandsSeparator){if(r===0)return s.isNaN(t)?"0":`${t}`;s.isString(t)&&t.indexOf(".")>-1&&t.indexOf(",")===-1&&(t=t.replaceAll(".",""));let i=s.numToStr(s.isNumber(t)?t:s.strToFloat(t));if(s.isEmpty(i)&&(i="0"),i.indexOf(".")===-1&&s.isSet(r)&&r>0)i+=".0";else if(r===0)return s.isNumber(t)?s.numToStr(t):s.numToStr(s.strToNum(t));let f=i.split(".");i[0]==="0"&&(f[0]="0");let a=s.zeroPad(f[1]||"",r);i=`${f[0]}.${a}`;let m=i.indexOf(".");return m>-1&&n!=="."?(i=i.replace(".",n),i.substring(0,m+(r||0)+1)):i}static thousands(t,r=o.formatting.numeral.thousandsSeparator){let n=t.indexOf("-")===0,e=t.indexOf(".")>-1,i=e?t.indexOf("."):t.indexOf(",");e?r=",":!e&&r===","&&(r=".");let f=n?1:0,a=t.substring(f,i),m=f,l="";for(let c=0;c<a.length;c++){if(a[c]!=="0"){m=c;break}l+="0"}let g=m>0?m-1:0,d="";for(let c=a.length-1;c>=m;c--){let h=a[c],p=a.length-c+g;d=(p>m&&p<a.length&&p%3===0?r:"")+h+d}return(n?"-":"")+(d!="0"?l:"")+d+t.substring(i)}static toStringWithSeparators(t){return t==null||isNaN(t)?"0":t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,".")}static formatNumberToThousands(t,r=0,n=o.formatting.numeral.thousandsSeparator){if(t==null||t==="")return"0";let e=typeof t=="string"?parseFloat(t):t;return isNaN(e)?"0":e.toLocaleString(o.locale||"en-US",{minimumFractionDigits:r,maximumFractionDigits:r})}static date(t,r=o.formatting.datetime.date,n="MMM d yyyy hh:mma"){return this.datetime(t,r,n)}static dateFromIso(t,r=o.formatting.datetime.date){if(!s.isSet(t)||s.isString(t)&&t.length===0)return"";let n=t instanceof Date?t.toISOString():s.collapseWhitespace(t),e=y.fromISO(n);return e.isValid?e.toFormat(r):(console.error("Invalid date format"),n)}static datetime(t,r,n="MMM d yyyy hh:mma"){if(s.notSet(t))return"";let e=y.fromFormat(s.collapseWhitespace(t),n);return e.isValid?e.toFormat(r):(console.error("Invalid date format"),t)}static formatAcKey(t){if(!s.isSet(t))return"";let r=2,n=4,e=7;if(t.length<13||t.includes("-"))return t;let i=o.sys,f=Math.min(i?.docKeyLenYear??r,r),a=Math.min(i?.docKeyLenDocType??n,n),m=Math.min(i?.docKeyLenNumber??e,e),l=t.substring(0,r).substring(0,f),g=t.substring(r,r+n).substring(0,a),d=t.substring(r+n,r+n+e).substring(e-m,e);return`${l}-${g}-${d}`}static parseDecimal(t,r=o.formatting.numeral.decimalSeparator,n=o.formatting.numeral.thousandsSeparator){if(typeof t=="number")return isNaN(t)?0:t;if(!t)return 0;let e=t.split(n).join("").replace(r,"."),i=parseFloat(e);return isNaN(i)?0:i}}});export{o as a,D as b,N as c,T as d};
