var e=new Map,t=!1;try{t=new Intl.NumberFormat(`de-DE`,{signDisplay:`exceptZero`}).resolvedOptions().signDisplay===`exceptZero`}catch{}var n=!1;try{n=new Intl.NumberFormat(`de-DE`,{style:`unit`,unit:`degree`}).resolvedOptions().style===`unit`}catch{}var r={degree:{narrow:{default:`°`,"ja-JP":` 度`,"zh-TW":`度`,"sl-SI":` °`}}},i=class{constructor(e,t={}){this.numberFormatter=a(e,t),this.options=t}format(e){let i=``;if(i=!t&&this.options.signDisplay!=null?o(this.numberFormatter,this.options.signDisplay,e):this.numberFormatter.format(e),this.options.style===`unit`&&!n){let{unit:e,unitDisplay:t=`short`,locale:n}=this.resolvedOptions();if(!e)return i;let a=r[e]?.[t];i+=a[n]||a.default}return i}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,t){if(typeof this.numberFormatter.formatRange==`function`)return this.numberFormatter.formatRange(e,t);if(t<e)throw RangeError(`End date must be >= start date`);return`${this.format(e)} \u{2013} ${this.format(t)}`}formatRangeToParts(e,t){if(typeof this.numberFormatter.formatRangeToParts==`function`)return this.numberFormatter.formatRangeToParts(e,t);if(t<e)throw RangeError(`End date must be >= start date`);let n=this.numberFormatter.formatToParts(e),r=this.numberFormatter.formatToParts(t);return[...n.map(e=>({...e,source:`startRange`})),{type:`literal`,value:` – `,source:`shared`},...r.map(e=>({...e,source:`endRange`}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!t&&this.options.signDisplay!=null&&(e={...e,signDisplay:this.options.signDisplay}),!n&&this.options.style===`unit`&&(e={...e,style:`unit`,unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}};function a(t,i={}){let{numberingSystem:a}=i;if(a&&t.includes(`-nu-`)&&(t.includes(`-u-`)||(t+=`-u-`),t+=`-nu-${a}`),i.style===`unit`&&!n){let{unit:e,unitDisplay:t=`short`}=i;if(!e)throw Error(`unit option must be provided with style: "unit"`);if(!r[e]?.[t])throw Error(`Unsupported unit ${e} with unitDisplay = ${t}`);i={...i,style:`decimal`}}let o=t+(i?Object.entries(i).sort((e,t)=>e[0]<t[0]?-1:1).join():``);if(e.has(o))return e.get(o);let s=new Intl.NumberFormat(t,i);return e.set(o,s),s}function o(e,t,n){if(t===`auto`)return e.format(n);if(t===`never`)return e.format(Math.abs(n));{let r=!1;if(t===`always`?r=n>0||Object.is(n,0):t===`exceptZero`&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):r=n>0),r){let t=e.format(-n),r=e.format(n),i=t.replace(r,``).replace(/\u200e|\u061C/,``);return[...i].length!==1&&console.warn(`@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case`),t.replace(r,`!!!`).replace(i,`+`).replace(`!!!`,r)}return e.format(n)}}export{i as t};