import{h as d}from"./chunk-GJIGZB63.js";import{b as s}from"./chunk-5VDVFGVW.js";var n=(()=>{class m{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 m})();var f=class m{static currency(t,r,a=n.sys?.defaultDecimalPlacesPrice||2){if(!s.isSet(r))return m.decimal(t,a);let i={style:"currency",currency:r,minimumFractionDigits:n.sys?.defaultDecimalPlacesPrice,maximumFractionDigits:n.sys?.defaultDecimalPlacesPrice};return new Intl.NumberFormat(n.locale,i).format(t)}static decimal(t,r=n.sys?.defaultDecimalPlacesPrice||2,a=n.formatting.numeral.decimalSeparator,i=n.formatting.numeral.thousandsSeparator){let e=s.numToStr(s.isNumber(t)?t:s.strToFloat(t));s.isEmpty(e)&&(e="0"),e.indexOf(".")===-1&&s.isSet(r)&&r>0&&(e+=".0");let o=e.split("."),c=s.zeroPad(o[1]||"",r);e=`${o[0]}.${c}`;let l=e.indexOf(".");return l>-1&&a!=="."?(e=e.replace(".",a),e.substring(0,l+(r||0)+1)):e}static thousands(t,r=n.formatting.numeral.thousandsSeparator){let a=t.indexOf(".")>-1?t.indexOf("."):t.indexOf(","),i=t.substring(0,a),e="";for(let o=i.length-1;o>=0;o--){let c=i[o];e=(o>0&&(o+1)%3===0?r:"")+c+e}return e+t.substring(a)}static formatNumberToThousands(t,r=0,a=n.formatting.numeral.thousandsSeparator){if(t==null||t==="")return"0";let i=typeof t=="string"?parseFloat(t):t;return isNaN(i)?"0":i.toLocaleString(n.locale||"en-US",{minimumFractionDigits:r,maximumFractionDigits:r})}static date(t,r=n.formatting.datetime.date,a="MMM d yyyy hh:mma"){return this.datetime(t,r,a)}static dateFromIso(t,r=n.formatting.datetime.date){if(!s.isSet(t)||s.isString(t)&&t.length===0)return"";let a=t instanceof Date?t.toISOString():s.collapseWhitespace(t),i=d.fromISO(a);return i.isValid?i.toFormat(r):(console.error("Invalid date format"),a)}static datetime(t,r,a="MMM d yyyy hh:mma"){if(s.notSet(t))return"";let i=d.fromFormat(s.collapseWhitespace(t),a);return i.isValid?i.toFormat(r):(console.error("Invalid date format"),t)}};export{n as a,f as b};
