@hakit/core
Version:
A collection of React hooks and helpers for Home Assistant to easily communicate with the Home Assistant WebSocket API.
3 lines (2 loc) • 1.35 kB
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../hooks/useLocale/locales/index.js");var u=(a=>(a.language="language",a.system="system",a.comma_decimal="comma_decimal",a.decimal_comma="decimal_comma",a.quote_decimal="quote_decimal",a.space_comma="space_comma",a.none="none",a))(u||{}),l=(a=>(a.language="language",a.system="system",a.DMY="DMY",a.MDY="MDY",a.YMD="YMD",a))(l||{}),r=(a=>(a.language="language",a.monday="monday",a.tuesday="tuesday",a.wednesday="wednesday",a.thursday="thursday",a.friday="friday",a.saturday="saturday",a.sunday="sunday",a))(r||{});const i=(a,n,e)=>a.subscribeMessage(e,{type:"frontend/subscribe_user_data",key:n}),c={"zh-cn":"zh-Hans","zh-sg":"zh-Hans","zh-my":"zh-Hans","zh-tw":"zh-Hant","zh-hk":"zh-Hant","zh-mo":"zh-Hant",zh:"zh-Hant"};function o(a){if(t.localeTranslations.find(s=>s.code===a))return a;const n=a.toLowerCase();if(n in c)return c[n];const e=t.localeTranslations.find(s=>s.code.toLowerCase()===n);if(e)return e.code;if(a.includes("-"))return o(a.split("-")[0])}function d(a){const n=a.language;if(n){const e=o(n);if(e)return e}return n}exports.DateFormat=l;exports.FirstWeekday=r;exports.NumberFormat=u;exports.findAvailableLanguage=o;exports.getUserLocaleLanguage=d;exports.subscribeFrontendUserData=i;
//# sourceMappingURL=frontend_data.js.map