"use strict";var i=require("./kd/iso8601Utils.js");function t(t){return null!=t&&""!==t&&(isFinite(t)||i.isValidISODateTimeString(t))}function e(i){return null!=i&&""!==i&&isFinite(i)&&Math.abs(i)<=90}function n(i){return null!=i&&""!==i&&isFinite(i)&&Math.abs(i)<=180}function r(i){const t={weekday:i.weekday,era:i.era,year:i.year,month:i.month,day:i.day,hour:i.hour,hourCycle:void 0,hour12:void 0,minute:i.minute,second:i.second,timeZoneName:i.timeZoneName,timeZone:i.timeZone},{hour12:e}=i;return i._hour12Set&&(!1===e?t.hourCycle="h23":t.hour12=e),t}exports.isValidDate=t,exports.isValidLatitude=e,exports.isValidLongitude=n,exports.isValidPhone=function(i){return"string"==typeof i&&""!==i},exports.toDateTimeFormatOptions=r,exports.toFormattedDate=function(i,e){const{value:n}=i;if(t(n)){const t=e(r(i),i.dateStyle).format(n);if(t)return t}return""},exports.toFormattedLocation=function(i){const{latitude:t,longitude:r}=i;return e(t)&&n(r)?`${t}, ${r}`:""},exports.toFormattedNumber=function(i,t){const{value:e}=i;if(null!=e&&""!==e&&isFinite(e)){const{formatStyle:n}=i,r={style:n,currency:i.currencyCode,currencyDisplay:i.currencyDisplayAs,minimumIntegerDigits:i.minimumIntegerDigits,minimumFractionDigits:i.minimumFractionDigits,maximumFractionDigits:i.maximumFractionDigits,minimumSignificantDigits:i.minimumSignificantDigits,maximumSignificantDigits:i.maximumSignificantDigits},o=String(e);let u=o;return"percent-fixed"===n&&(r.style="percent",u=parseFloat(e)/100,o.indexOf(".")>0&&o.indexOf("e")<0&&(u=u.toFixed(o.split(".")[1].length+2))),t(r).format(u)}return""};
