@everymatrix/lottery-program-wof 1.15.6 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -239,7 +239,7 @@
239
239
  function schedule_update() {
240
240
  if (!update_scheduled) {
241
241
  update_scheduled = true;
242
- resolved_promise.then(flush);
242
+ resolved_promise.then(flush$1);
243
243
  }
244
244
  }
245
245
  function add_render_callback(fn) {
@@ -265,7 +265,7 @@
265
265
  // function, guarantees this behavior.
266
266
  const seen_callbacks = new Set();
267
267
  let flushidx = 0; // Do *not* move this inside the flush() function
268
- function flush() {
268
+ function flush$1() {
269
269
  // Do not reenter flush while dirty components are updated, as this can
270
270
  // result in an infinite loop. Instead, let the inner flush handle it.
271
271
  // Reentrancy is ok afterwards for bindings etc.
@@ -476,7 +476,7 @@
476
476
  if (options.intro)
477
477
  transition_in(component.$$.fragment);
478
478
  mount_component(component, options.target, options.anchor, options.customElement);
479
- flush();
479
+ flush$1();
480
480
  }
481
481
  set_current_component(parent_component);
482
482
  }
@@ -4745,14 +4745,444 @@
4745
4745
  return IntlMessageFormat;
4746
4746
  }());
4747
4747
 
4748
- /*
4749
- Copyright (c) 2014, Yahoo! Inc. All rights reserved.
4750
- Copyrights licensed under the New BSD License.
4751
- See the accompanying LICENSE file for terms.
4752
- */
4753
- var o = IntlMessageFormat;
4748
+ function delve(obj, fullKey) {
4749
+ if (fullKey == null)
4750
+ return void 0;
4751
+ if (fullKey in obj) {
4752
+ return obj[fullKey];
4753
+ }
4754
+ const keys = fullKey.split(".");
4755
+ let result = obj;
4756
+ for (let p = 0; p < keys.length; p++) {
4757
+ if (typeof result === "object") {
4758
+ if (p > 0) {
4759
+ const partialKey = keys.slice(p, keys.length).join(".");
4760
+ if (partialKey in result) {
4761
+ result = result[partialKey];
4762
+ break;
4763
+ }
4764
+ }
4765
+ result = result[keys[p]];
4766
+ } else {
4767
+ result = void 0;
4768
+ }
4769
+ }
4770
+ return result;
4771
+ }
4772
+
4773
+ const lookupCache = {};
4774
+ const addToCache = (path, locale, message) => {
4775
+ if (!message)
4776
+ return message;
4777
+ if (!(locale in lookupCache))
4778
+ lookupCache[locale] = {};
4779
+ if (!(path in lookupCache[locale]))
4780
+ lookupCache[locale][path] = message;
4781
+ return message;
4782
+ };
4783
+ const lookup = (path, refLocale) => {
4784
+ if (refLocale == null)
4785
+ return void 0;
4786
+ if (refLocale in lookupCache && path in lookupCache[refLocale]) {
4787
+ return lookupCache[refLocale][path];
4788
+ }
4789
+ const locales = getPossibleLocales(refLocale);
4790
+ for (let i = 0; i < locales.length; i++) {
4791
+ const locale = locales[i];
4792
+ const message = getMessageFromDictionary(locale, path);
4793
+ if (message) {
4794
+ return addToCache(path, refLocale, message);
4795
+ }
4796
+ }
4797
+ return void 0;
4798
+ };
4799
+
4800
+ let dictionary;
4801
+ const $dictionary = writable({});
4802
+ function getLocaleDictionary(locale) {
4803
+ return dictionary[locale] || null;
4804
+ }
4805
+ function hasLocaleDictionary(locale) {
4806
+ return locale in dictionary;
4807
+ }
4808
+ function getMessageFromDictionary(locale, id) {
4809
+ if (!hasLocaleDictionary(locale)) {
4810
+ return null;
4811
+ }
4812
+ const localeDictionary = getLocaleDictionary(locale);
4813
+ const match = delve(localeDictionary, id);
4814
+ return match;
4815
+ }
4816
+ function getClosestAvailableLocale(refLocale) {
4817
+ if (refLocale == null)
4818
+ return void 0;
4819
+ const relatedLocales = getPossibleLocales(refLocale);
4820
+ for (let i = 0; i < relatedLocales.length; i++) {
4821
+ const locale = relatedLocales[i];
4822
+ if (hasLocaleDictionary(locale)) {
4823
+ return locale;
4824
+ }
4825
+ }
4826
+ return void 0;
4827
+ }
4828
+ function addMessages(locale, ...partials) {
4829
+ delete lookupCache[locale];
4830
+ $dictionary.update((d) => {
4831
+ d[locale] = cjs.all([d[locale] || {}, ...partials]);
4832
+ return d;
4833
+ });
4834
+ }
4835
+ derived(
4836
+ [$dictionary],
4837
+ ([dictionary2]) => Object.keys(dictionary2)
4838
+ );
4839
+ $dictionary.subscribe((newDictionary) => dictionary = newDictionary);
4840
+
4841
+ const queue = {};
4842
+ function removeLoaderFromQueue(locale, loader) {
4843
+ queue[locale].delete(loader);
4844
+ if (queue[locale].size === 0) {
4845
+ delete queue[locale];
4846
+ }
4847
+ }
4848
+ function getLocaleQueue(locale) {
4849
+ return queue[locale];
4850
+ }
4851
+ function getLocalesQueues(locale) {
4852
+ return getPossibleLocales(locale).map((localeItem) => {
4853
+ const localeQueue = getLocaleQueue(localeItem);
4854
+ return [localeItem, localeQueue ? [...localeQueue] : []];
4855
+ }).filter(([, localeQueue]) => localeQueue.length > 0);
4856
+ }
4857
+ function hasLocaleQueue(locale) {
4858
+ if (locale == null)
4859
+ return false;
4860
+ return getPossibleLocales(locale).some(
4861
+ (localeQueue) => {
4862
+ var _a;
4863
+ return (_a = getLocaleQueue(localeQueue)) == null ? void 0 : _a.size;
4864
+ }
4865
+ );
4866
+ }
4867
+ function loadLocaleQueue(locale, localeQueue) {
4868
+ const allLoadersPromise = Promise.all(
4869
+ localeQueue.map((loader) => {
4870
+ removeLoaderFromQueue(locale, loader);
4871
+ return loader().then((partial) => partial.default || partial);
4872
+ })
4873
+ );
4874
+ return allLoadersPromise.then((partials) => addMessages(locale, ...partials));
4875
+ }
4876
+ const activeFlushes = {};
4877
+ function flush(locale) {
4878
+ if (!hasLocaleQueue(locale)) {
4879
+ if (locale in activeFlushes) {
4880
+ return activeFlushes[locale];
4881
+ }
4882
+ return Promise.resolve();
4883
+ }
4884
+ const queues = getLocalesQueues(locale);
4885
+ activeFlushes[locale] = Promise.all(
4886
+ queues.map(
4887
+ ([localeName, localeQueue]) => loadLocaleQueue(localeName, localeQueue)
4888
+ )
4889
+ ).then(() => {
4890
+ if (hasLocaleQueue(locale)) {
4891
+ return flush(locale);
4892
+ }
4893
+ delete activeFlushes[locale];
4894
+ });
4895
+ return activeFlushes[locale];
4896
+ }
4897
+ const defaultFormats = {
4898
+ number: {
4899
+ scientific: { notation: "scientific" },
4900
+ engineering: { notation: "engineering" },
4901
+ compactLong: { notation: "compact", compactDisplay: "long" },
4902
+ compactShort: { notation: "compact", compactDisplay: "short" }
4903
+ },
4904
+ date: {
4905
+ short: { month: "numeric", day: "numeric", year: "2-digit" },
4906
+ medium: { month: "short", day: "numeric", year: "numeric" },
4907
+ long: { month: "long", day: "numeric", year: "numeric" },
4908
+ full: { weekday: "long", month: "long", day: "numeric", year: "numeric" }
4909
+ },
4910
+ time: {
4911
+ short: { hour: "numeric", minute: "numeric" },
4912
+ medium: { hour: "numeric", minute: "numeric", second: "numeric" },
4913
+ long: {
4914
+ hour: "numeric",
4915
+ minute: "numeric",
4916
+ second: "numeric",
4917
+ timeZoneName: "short"
4918
+ },
4919
+ full: {
4920
+ hour: "numeric",
4921
+ minute: "numeric",
4922
+ second: "numeric",
4923
+ timeZoneName: "short"
4924
+ }
4925
+ }
4926
+ };
4927
+ const defaultOptions = {
4928
+ fallbackLocale: null,
4929
+ loadingDelay: 200,
4930
+ formats: defaultFormats,
4931
+ warnOnMissingMessages: true,
4932
+ handleMissingMessage: void 0,
4933
+ ignoreTag: true
4934
+ };
4935
+ const options = defaultOptions;
4936
+ function getOptions$1() {
4937
+ return options;
4938
+ }
4939
+
4940
+ const $isLoading = writable(false);
4941
+
4942
+ var __defProp$1 = Object.defineProperty;
4943
+ var __defProps = Object.defineProperties;
4944
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4945
+ var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
4946
+ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
4947
+ var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
4948
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4949
+ var __spreadValues$1 = (a, b) => {
4950
+ for (var prop in b || (b = {}))
4951
+ if (__hasOwnProp$1.call(b, prop))
4952
+ __defNormalProp$1(a, prop, b[prop]);
4953
+ if (__getOwnPropSymbols$1)
4954
+ for (var prop of __getOwnPropSymbols$1(b)) {
4955
+ if (__propIsEnum$1.call(b, prop))
4956
+ __defNormalProp$1(a, prop, b[prop]);
4957
+ }
4958
+ return a;
4959
+ };
4960
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
4961
+ let current;
4962
+ const internalLocale = writable(null);
4963
+ function getSubLocales(refLocale) {
4964
+ return refLocale.split("-").map((_, i, arr) => arr.slice(0, i + 1).join("-")).reverse();
4965
+ }
4966
+ function getPossibleLocales(refLocale, fallbackLocale = getOptions$1().fallbackLocale) {
4967
+ const locales = getSubLocales(refLocale);
4968
+ if (fallbackLocale) {
4969
+ return [.../* @__PURE__ */ new Set([...locales, ...getSubLocales(fallbackLocale)])];
4970
+ }
4971
+ return locales;
4972
+ }
4973
+ function getCurrentLocale() {
4974
+ return current != null ? current : void 0;
4975
+ }
4976
+ internalLocale.subscribe((newLocale) => {
4977
+ current = newLocale != null ? newLocale : void 0;
4978
+ if (typeof window !== "undefined" && newLocale != null) {
4979
+ document.documentElement.setAttribute("lang", newLocale);
4980
+ }
4981
+ });
4982
+ const set = (newLocale) => {
4983
+ if (newLocale && getClosestAvailableLocale(newLocale) && hasLocaleQueue(newLocale)) {
4984
+ const { loadingDelay } = getOptions$1();
4985
+ let loadingTimer;
4986
+ if (typeof window !== "undefined" && getCurrentLocale() != null && loadingDelay) {
4987
+ loadingTimer = window.setTimeout(
4988
+ () => $isLoading.set(true),
4989
+ loadingDelay
4990
+ );
4991
+ } else {
4992
+ $isLoading.set(true);
4993
+ }
4994
+ return flush(newLocale).then(() => {
4995
+ internalLocale.set(newLocale);
4996
+ }).finally(() => {
4997
+ clearTimeout(loadingTimer);
4998
+ $isLoading.set(false);
4999
+ });
5000
+ }
5001
+ return internalLocale.set(newLocale);
5002
+ };
5003
+ const $locale = __spreadProps(__spreadValues$1({}, internalLocale), {
5004
+ set
5005
+ });
4754
5006
 
4755
- const i={},r=(e,n,t)=>t?(n in i||(i[n]={}),e in i[n]||(i[n][e]=t),t):t,s=(e,n)=>{if(null==n)return;if(n in i&&e in i[n])return i[n][e];const t=E(n);for(let o=0;o<t.length;o++){const i=c(t[o],e);if(i)return r(e,n,i)}};let l;const a=writable({});function u(e){return e in l}function c(e,n){if(!u(e))return null;const t=function(e){return l[e]||null}(e);return function(e,n){if(null==n)return;if(n in e)return e[n];const t=n.split(".");let o=e;for(let e=0;e<t.length;e++)if("object"==typeof o){if(e>0){const n=t.slice(e,t.length).join(".");if(n in o){o=o[n];break}}o=o[t[e]];}else o=void 0;return o}(t,n)}function m(e,...n){delete i[e],a.update((o=>(o[e]=cjs.all([o[e]||{},...n]),o)));}derived([a],(([e])=>Object.keys(e)));a.subscribe((e=>l=e));const d={};function g(e){return d[e]}function h(e){return null!=e&&E(e).some((e=>{var n;return null===(n=g(e))||void 0===n?void 0:n.size}))}function w(e,n){const t=Promise.all(n.map((n=>(function(e,n){d[e].delete(n),0===d[e].size&&delete d[e];}(e,n),n().then((e=>e.default||e))))));return t.then((n=>m(e,...n)))}const p={};function b(e){if(!h(e))return e in p?p[e]:Promise.resolve();const n=function(e){return E(e).map((e=>{const n=g(e);return [e,n?[...n]:[]]})).filter((([,e])=>e.length>0))}(e);return p[e]=Promise.all(n.map((([e,n])=>w(e,n)))).then((()=>{if(h(e))return b(e);delete p[e];})),p[e]}const M={fallbackLocale:null,loadingDelay:200,formats:{number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0};function j(){return M}const $=writable(!1);let k;const T=writable(null);function L(e){return e.split("-").map(((e,n,t)=>t.slice(0,n+1).join("-"))).reverse()}function E(e,n=j().fallbackLocale){const t=L(e);return n?[...new Set([...t,...L(n)])]:t}function D(){return null!=k?k:void 0}T.subscribe((e=>{k=null!=e?e:void 0,"undefined"!=typeof window&&null!=e&&document.documentElement.setAttribute("lang",e);}));const x={...T,set:e=>{if(e&&function(e){if(null==e)return;const n=E(e);for(let e=0;e<n.length;e++){const t=n[e];if(u(t))return t}}(e)&&h(e)){const{loadingDelay:n}=j();let t;return "undefined"!=typeof window&&null!=D()&&n?t=window.setTimeout((()=>$.set(!0)),n):$.set(!0),b(e).then((()=>{T.set(e);})).finally((()=>{clearTimeout(t),$.set(!1);}))}return T.set(e)}},Z=e=>{const n=Object.create(null);return t=>{const o=JSON.stringify(t);return o in n?n[o]:n[o]=e(t)}},C=(e,n)=>{const{formats:t}=j();if(e in t&&n in t[e])return t[e][n];throw new Error(`[svelte-i18n] Unknown "${n}" ${e} format.`)},G=Z((({locale:e,format:n,...t})=>{if(null==e)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return n&&(t=C("number",n)),new Intl.NumberFormat(e,t)})),J=Z((({locale:e,format:n,...t})=>{if(null==e)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return n?t=C("date",n):0===Object.keys(t).length&&(t=C("date","short")),new Intl.DateTimeFormat(e,t)})),U=Z((({locale:e,format:n,...t})=>{if(null==e)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return n?t=C("time",n):0===Object.keys(t).length&&(t=C("time","short")),new Intl.DateTimeFormat(e,t)})),V=({locale:e=D(),...n}={})=>G({locale:e,...n}),_=({locale:e=D(),...n}={})=>J({locale:e,...n}),q=({locale:e=D(),...n}={})=>U({locale:e,...n}),B=Z(((e,n=D())=>new o(e,n,j().formats,{ignoreTag:j().ignoreTag}))),H=(e,n={})=>{var t,o,i,r;let l=n;"object"==typeof e&&(l=e,e=l.id);const{values:a,locale:u=D(),default:c}=l;if(null==u)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let m=s(e,u);if(m){if("string"!=typeof m)return console.warn(`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof m}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),m}else m=null!==(r=null!==(i=null===(o=(t=j()).handleMissingMessage)||void 0===o?void 0:o.call(t,{locale:u,id:e,defaultValue:c}))&&void 0!==i?i:c)&&void 0!==r?r:e;if(!a)return m;let f=m;try{f=B(m,u).format(a);}catch(n){n instanceof Error&&console.warn(`[svelte-i18n] Message "${e}" has syntax error:`,n.message);}return f},K=(e,n)=>q(n).format(e),Q=(e,n)=>_(n).format(e),R=(e,n)=>V(n).format(e),W=(e,n=D())=>s(e,n),X=derived([x,a],(()=>H));derived([x],(()=>K));derived([x],(()=>Q));derived([x],(()=>R));derived([x,a],(()=>W));
5007
+ const monadicMemoize = (fn) => {
5008
+ const cache = /* @__PURE__ */ Object.create(null);
5009
+ const memoizedFn = (arg) => {
5010
+ const cacheKey = JSON.stringify(arg);
5011
+ if (cacheKey in cache) {
5012
+ return cache[cacheKey];
5013
+ }
5014
+ return cache[cacheKey] = fn(arg);
5015
+ };
5016
+ return memoizedFn;
5017
+ };
5018
+
5019
+ var __defProp = Object.defineProperty;
5020
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5021
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5022
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5023
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5024
+ var __spreadValues = (a, b) => {
5025
+ for (var prop in b || (b = {}))
5026
+ if (__hasOwnProp.call(b, prop))
5027
+ __defNormalProp(a, prop, b[prop]);
5028
+ if (__getOwnPropSymbols)
5029
+ for (var prop of __getOwnPropSymbols(b)) {
5030
+ if (__propIsEnum.call(b, prop))
5031
+ __defNormalProp(a, prop, b[prop]);
5032
+ }
5033
+ return a;
5034
+ };
5035
+ var __objRest = (source, exclude) => {
5036
+ var target = {};
5037
+ for (var prop in source)
5038
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
5039
+ target[prop] = source[prop];
5040
+ if (source != null && __getOwnPropSymbols)
5041
+ for (var prop of __getOwnPropSymbols(source)) {
5042
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
5043
+ target[prop] = source[prop];
5044
+ }
5045
+ return target;
5046
+ };
5047
+ const getIntlFormatterOptions = (type, name) => {
5048
+ const { formats } = getOptions$1();
5049
+ if (type in formats && name in formats[type]) {
5050
+ return formats[type][name];
5051
+ }
5052
+ throw new Error(`[svelte-i18n] Unknown "${name}" ${type} format.`);
5053
+ };
5054
+ const createNumberFormatter = monadicMemoize(
5055
+ (_a) => {
5056
+ var _b = _a, { locale, format } = _b, options = __objRest(_b, ["locale", "format"]);
5057
+ if (locale == null) {
5058
+ throw new Error('[svelte-i18n] A "locale" must be set to format numbers');
5059
+ }
5060
+ if (format) {
5061
+ options = getIntlFormatterOptions("number", format);
5062
+ }
5063
+ return new Intl.NumberFormat(locale, options);
5064
+ }
5065
+ );
5066
+ const createDateFormatter = monadicMemoize(
5067
+ (_c) => {
5068
+ var _d = _c, { locale, format } = _d, options = __objRest(_d, ["locale", "format"]);
5069
+ if (locale == null) {
5070
+ throw new Error('[svelte-i18n] A "locale" must be set to format dates');
5071
+ }
5072
+ if (format) {
5073
+ options = getIntlFormatterOptions("date", format);
5074
+ } else if (Object.keys(options).length === 0) {
5075
+ options = getIntlFormatterOptions("date", "short");
5076
+ }
5077
+ return new Intl.DateTimeFormat(locale, options);
5078
+ }
5079
+ );
5080
+ const createTimeFormatter = monadicMemoize(
5081
+ (_e) => {
5082
+ var _f = _e, { locale, format } = _f, options = __objRest(_f, ["locale", "format"]);
5083
+ if (locale == null) {
5084
+ throw new Error(
5085
+ '[svelte-i18n] A "locale" must be set to format time values'
5086
+ );
5087
+ }
5088
+ if (format) {
5089
+ options = getIntlFormatterOptions("time", format);
5090
+ } else if (Object.keys(options).length === 0) {
5091
+ options = getIntlFormatterOptions("time", "short");
5092
+ }
5093
+ return new Intl.DateTimeFormat(locale, options);
5094
+ }
5095
+ );
5096
+ const getNumberFormatter = (_g = {}) => {
5097
+ var _h = _g, {
5098
+ locale = getCurrentLocale()
5099
+ } = _h, args = __objRest(_h, [
5100
+ "locale"
5101
+ ]);
5102
+ return createNumberFormatter(__spreadValues({ locale }, args));
5103
+ };
5104
+ const getDateFormatter = (_i = {}) => {
5105
+ var _j = _i, {
5106
+ locale = getCurrentLocale()
5107
+ } = _j, args = __objRest(_j, [
5108
+ "locale"
5109
+ ]);
5110
+ return createDateFormatter(__spreadValues({ locale }, args));
5111
+ };
5112
+ const getTimeFormatter = (_k = {}) => {
5113
+ var _l = _k, {
5114
+ locale = getCurrentLocale()
5115
+ } = _l, args = __objRest(_l, [
5116
+ "locale"
5117
+ ]);
5118
+ return createTimeFormatter(__spreadValues({ locale }, args));
5119
+ };
5120
+ const getMessageFormatter = monadicMemoize(
5121
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
5122
+ (message, locale = getCurrentLocale()) => new IntlMessageFormat(message, locale, getOptions$1().formats, {
5123
+ ignoreTag: getOptions$1().ignoreTag
5124
+ })
5125
+ );
5126
+
5127
+ const formatMessage = (id, options = {}) => {
5128
+ var _a, _b, _c, _d;
5129
+ let messageObj = options;
5130
+ if (typeof id === "object") {
5131
+ messageObj = id;
5132
+ id = messageObj.id;
5133
+ }
5134
+ const {
5135
+ values,
5136
+ locale = getCurrentLocale(),
5137
+ default: defaultValue
5138
+ } = messageObj;
5139
+ if (locale == null) {
5140
+ throw new Error(
5141
+ "[svelte-i18n] Cannot format a message without first setting the initial locale."
5142
+ );
5143
+ }
5144
+ let message = lookup(id, locale);
5145
+ if (!message) {
5146
+ message = (_d = (_c = (_b = (_a = getOptions$1()).handleMissingMessage) == null ? void 0 : _b.call(_a, { locale, id, defaultValue })) != null ? _c : defaultValue) != null ? _d : id;
5147
+ } else if (typeof message !== "string") {
5148
+ console.warn(
5149
+ `[svelte-i18n] Message with id "${id}" must be of type "string", found: "${typeof message}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`
5150
+ );
5151
+ return message;
5152
+ }
5153
+ if (!values) {
5154
+ return message;
5155
+ }
5156
+ let result = message;
5157
+ try {
5158
+ result = getMessageFormatter(message, locale).format(values);
5159
+ } catch (e) {
5160
+ if (e instanceof Error) {
5161
+ console.warn(
5162
+ `[svelte-i18n] Message "${id}" has syntax error:`,
5163
+ e.message
5164
+ );
5165
+ }
5166
+ }
5167
+ return result;
5168
+ };
5169
+ const formatTime = (t, options) => {
5170
+ return getTimeFormatter(options).format(t);
5171
+ };
5172
+ const formatDate = (d, options) => {
5173
+ return getDateFormatter(options).format(d);
5174
+ };
5175
+ const formatNumber = (n, options) => {
5176
+ return getNumberFormatter(options).format(n);
5177
+ };
5178
+ const getJSON = (id, locale = getCurrentLocale()) => {
5179
+ return lookup(id, locale);
5180
+ };
5181
+ const $format = derived([$locale, $dictionary], () => formatMessage);
5182
+ derived([$locale], () => formatTime);
5183
+ derived([$locale], () => formatDate);
5184
+ derived([$locale], () => formatNumber);
5185
+ derived([$locale, $dictionary], () => getJSON);
4756
5186
 
4757
5187
  const translations = {
4758
5188
  en: {
@@ -4808,20 +5238,20 @@
4808
5238
  };
4809
5239
 
4810
5240
  function setupI18n({ withLocale: _locale, translations }) {
4811
- x.subscribe((data) => {
5241
+ $locale.subscribe((data) => {
4812
5242
  if (data == null) {
4813
- a.set(translations);
4814
- x.set(_locale);
5243
+ $dictionary.set(translations);
5244
+ $locale.set(_locale);
4815
5245
  }
4816
5246
  }); // maybe we will need this to make sure that the i18n is set up only once
4817
5247
  /*dictionary.set(translations);
4818
5248
  locale.set(_locale);*/
4819
5249
  }
4820
5250
  function addNewMessages(lang, dict) {
4821
- m(lang, dict);
5251
+ addMessages(lang, dict);
4822
5252
  }
4823
5253
  function setLocale(_locale) {
4824
- x.set(_locale);
5254
+ $locale.set(_locale);
4825
5255
  }
4826
5256
  const setLocaleWhenInit = () => {
4827
5257
  setupI18n({ withLocale: 'en', translations: {} });
@@ -5474,8 +5904,8 @@
5474
5904
  let prize;
5475
5905
  let prizeSrc;
5476
5906
  let $_;
5477
- validate_store(X, '_');
5478
- component_subscribe($$self, X, $$value => $$invalidate(10, $_ = $$value));
5907
+ validate_store($format, '_');
5908
+ component_subscribe($$self, $format, $$value => $$invalidate(10, $_ = $$value));
5479
5909
  let { $$slots: slots = {}, $$scope } = $$props;
5480
5910
  validate_slots('lottery-program-wof-private-message-panel', slots, []);
5481
5911
  let { r = 0 } = $$props;
@@ -5554,7 +5984,7 @@
5554
5984
  giftSvg: img$g,
5555
5985
  onMountMessageLifeCycle,
5556
5986
  _postMessage,
5557
- _: X,
5987
+ _: $format,
5558
5988
  setClientStyling,
5559
5989
  r,
5560
5990
  id,
@@ -5698,7 +6128,7 @@
5698
6128
 
5699
6129
  if (options.props) {
5700
6130
  this.$set(options.props);
5701
- flush();
6131
+ flush$1();
5702
6132
  }
5703
6133
  }
5704
6134
  }
@@ -5713,7 +6143,7 @@
5713
6143
 
5714
6144
  set r(r) {
5715
6145
  this.$$set({ r });
5716
- flush();
6146
+ flush$1();
5717
6147
  }
5718
6148
 
5719
6149
  get id() {
@@ -5722,7 +6152,7 @@
5722
6152
 
5723
6153
  set id(id) {
5724
6154
  this.$$set({ id });
5725
- flush();
6155
+ flush$1();
5726
6156
  }
5727
6157
 
5728
6158
  get clientstyling() {
@@ -5731,7 +6161,7 @@
5731
6161
 
5732
6162
  set clientstyling(clientstyling) {
5733
6163
  this.$$set({ clientstyling });
5734
- flush();
6164
+ flush$1();
5735
6165
  }
5736
6166
 
5737
6167
  get giftimagesrc() {
@@ -5740,7 +6170,7 @@
5740
6170
 
5741
6171
  set giftimagesrc(giftimagesrc) {
5742
6172
  this.$$set({ giftimagesrc });
5743
- flush();
6173
+ flush$1();
5744
6174
  }
5745
6175
  }
5746
6176
 
@@ -6117,8 +6547,8 @@
6117
6547
 
6118
6548
  function instance$5($$self, $$props, $$invalidate) {
6119
6549
  let $_;
6120
- validate_store(X, '_');
6121
- component_subscribe($$self, X, $$value => $$invalidate(3, $_ = $$value));
6550
+ validate_store($format, '_');
6551
+ component_subscribe($$self, $format, $$value => $$invalidate(3, $_ = $$value));
6122
6552
  let { $$slots: slots = {}, $$scope } = $$props;
6123
6553
  validate_slots('lottery-program-wof-private-tabs', slots, []);
6124
6554
  let { lang = Lang.en } = $$props;
@@ -6166,7 +6596,7 @@
6166
6596
  _postMessage,
6167
6597
  Lang,
6168
6598
  Tab,
6169
- _: X,
6599
+ _: $format,
6170
6600
  setClientStyling,
6171
6601
  lang,
6172
6602
  endpoint,
@@ -6246,7 +6676,7 @@
6246
6676
 
6247
6677
  if (options.props) {
6248
6678
  this.$set(options.props);
6249
- flush();
6679
+ flush$1();
6250
6680
  }
6251
6681
  }
6252
6682
  }
@@ -6261,7 +6691,7 @@
6261
6691
 
6262
6692
  set lang(lang) {
6263
6693
  this.$$set({ lang });
6264
- flush();
6694
+ flush$1();
6265
6695
  }
6266
6696
 
6267
6697
  get endpoint() {
@@ -6270,7 +6700,7 @@
6270
6700
 
6271
6701
  set endpoint(endpoint) {
6272
6702
  this.$$set({ endpoint });
6273
- flush();
6703
+ flush$1();
6274
6704
  }
6275
6705
 
6276
6706
  get session() {
@@ -6279,7 +6709,7 @@
6279
6709
 
6280
6710
  set session(session) {
6281
6711
  this.$$set({ session });
6282
- flush();
6712
+ flush$1();
6283
6713
  }
6284
6714
 
6285
6715
  get clientstyling() {
@@ -6288,7 +6718,7 @@
6288
6718
 
6289
6719
  set clientstyling(clientstyling) {
6290
6720
  this.$$set({ clientstyling });
6291
- flush();
6721
+ flush$1();
6292
6722
  }
6293
6723
 
6294
6724
  get isshowhistory() {
@@ -6297,7 +6727,7 @@
6297
6727
 
6298
6728
  set isshowhistory(isshowhistory) {
6299
6729
  this.$$set({ isshowhistory });
6300
- flush();
6730
+ flush$1();
6301
6731
  }
6302
6732
  }
6303
6733
 
@@ -7047,8 +7477,8 @@
7047
7477
 
7048
7478
  function instance$3($$self, $$props, $$invalidate) {
7049
7479
  let $_;
7050
- validate_store(X, '_');
7051
- component_subscribe($$self, X, $$value => $$invalidate(3, $_ = $$value));
7480
+ validate_store($format, '_');
7481
+ component_subscribe($$self, $format, $$value => $$invalidate(3, $_ = $$value));
7052
7482
  let { $$slots: slots = {}, $$scope } = $$props;
7053
7483
  validate_slots('lottery-program-wof-private-outcomes', slots, []);
7054
7484
  let { lang = Lang.en } = $$props;
@@ -7140,7 +7570,7 @@
7140
7570
  $$self.$capture_state = () => ({
7141
7571
  api,
7142
7572
  onMountMessageLifeCycle,
7143
- _: X,
7573
+ _: $format,
7144
7574
  Lang,
7145
7575
  setClientStyling,
7146
7576
  lang,
@@ -7234,7 +7664,7 @@
7234
7664
 
7235
7665
  if (options.props) {
7236
7666
  this.$set(options.props);
7237
- flush();
7667
+ flush$1();
7238
7668
  }
7239
7669
  }
7240
7670
  }
@@ -7249,7 +7679,7 @@
7249
7679
 
7250
7680
  set lang(lang) {
7251
7681
  this.$$set({ lang });
7252
- flush();
7682
+ flush$1();
7253
7683
  }
7254
7684
 
7255
7685
  get endpoint() {
@@ -7258,7 +7688,7 @@
7258
7688
 
7259
7689
  set endpoint(endpoint) {
7260
7690
  this.$$set({ endpoint });
7261
- flush();
7691
+ flush$1();
7262
7692
  }
7263
7693
 
7264
7694
  get session() {
@@ -7267,7 +7697,7 @@
7267
7697
 
7268
7698
  set session(session) {
7269
7699
  this.$$set({ session });
7270
- flush();
7700
+ flush$1();
7271
7701
  }
7272
7702
 
7273
7703
  get clientstyling() {
@@ -7276,7 +7706,7 @@
7276
7706
 
7277
7707
  set clientstyling(clientstyling) {
7278
7708
  this.$$set({ clientstyling });
7279
- flush();
7709
+ flush$1();
7280
7710
  }
7281
7711
  }
7282
7712
 
@@ -10092,8 +10522,8 @@
10092
10522
  let process;
10093
10523
  let optionFilter;
10094
10524
  let $_;
10095
- validate_store(X, '_');
10096
- component_subscribe($$self, X, $$value => $$invalidate(30, $_ = $$value));
10525
+ validate_store($format, '_');
10526
+ component_subscribe($$self, $format, $$value => $$invalidate(30, $_ = $$value));
10097
10527
  let { $$slots: slots = {}, $$scope } = $$props;
10098
10528
  validate_slots('lottery-program-wof-private-item-svg', slots, []);
10099
10529
  var _a, _b;
@@ -10290,7 +10720,7 @@
10290
10720
  Spinner,
10291
10721
  SvgCalc,
10292
10722
  Process,
10293
- _: X,
10723
+ _: $format,
10294
10724
  setClientStyling,
10295
10725
  lang,
10296
10726
  endpoint,
@@ -10486,7 +10916,7 @@
10486
10916
 
10487
10917
  if (options.props) {
10488
10918
  this.$set(options.props);
10489
- flush();
10919
+ flush$1();
10490
10920
  }
10491
10921
  }
10492
10922
  }
@@ -10509,7 +10939,7 @@
10509
10939
 
10510
10940
  set lang(lang) {
10511
10941
  this.$$set({ lang });
10512
- flush();
10942
+ flush$1();
10513
10943
  }
10514
10944
 
10515
10945
  get endpoint() {
@@ -10518,7 +10948,7 @@
10518
10948
 
10519
10949
  set endpoint(endpoint) {
10520
10950
  this.$$set({ endpoint });
10521
- flush();
10951
+ flush$1();
10522
10952
  }
10523
10953
 
10524
10954
  get session() {
@@ -10527,7 +10957,7 @@
10527
10957
 
10528
10958
  set session(session) {
10529
10959
  this.$$set({ session });
10530
- flush();
10960
+ flush$1();
10531
10961
  }
10532
10962
 
10533
10963
  get clientstyling() {
@@ -10536,7 +10966,7 @@
10536
10966
 
10537
10967
  set clientstyling(clientstyling) {
10538
10968
  this.$$set({ clientstyling });
10539
- flush();
10969
+ flush$1();
10540
10970
  }
10541
10971
 
10542
10972
  get contentdirection() {
@@ -10545,7 +10975,7 @@
10545
10975
 
10546
10976
  set contentdirection(contentdirection) {
10547
10977
  this.$$set({ contentdirection });
10548
- flush();
10978
+ flush$1();
10549
10979
  }
10550
10980
 
10551
10981
  get id() {
@@ -10554,7 +10984,7 @@
10554
10984
 
10555
10985
  set id(id) {
10556
10986
  this.$$set({ id });
10557
- flush();
10987
+ flush$1();
10558
10988
  }
10559
10989
 
10560
10990
  get size() {
@@ -10563,7 +10993,7 @@
10563
10993
 
10564
10994
  set size(size) {
10565
10995
  this.$$set({ size });
10566
- flush();
10996
+ flush$1();
10567
10997
  }
10568
10998
  }
10569
10999
 
@@ -10834,8 +11264,8 @@
10834
11264
  let ratio;
10835
11265
  let radius;
10836
11266
  let $_;
10837
- validate_store(X, '_');
10838
- component_subscribe($$self, X, $$value => $$invalidate(9, $_ = $$value));
11267
+ validate_store($format, '_');
11268
+ component_subscribe($$self, $format, $$value => $$invalidate(9, $_ = $$value));
10839
11269
  let { $$slots: slots = {}, $$scope } = $$props;
10840
11270
  validate_slots('lottery-program-wof-private-item', slots, []);
10841
11271
  let { lang = Lang.en } = $$props;
@@ -10924,7 +11354,7 @@
10924
11354
  api,
10925
11355
  onMountMessageLifeCycle,
10926
11356
  CurrentInfo,
10927
- _: X,
11357
+ _: $format,
10928
11358
  setClientStyling,
10929
11359
  lang,
10930
11360
  endpoint,
@@ -11048,7 +11478,7 @@
11048
11478
 
11049
11479
  if (options.props) {
11050
11480
  this.$set(options.props);
11051
- flush();
11481
+ flush$1();
11052
11482
  }
11053
11483
  }
11054
11484
  }
@@ -11072,7 +11502,7 @@
11072
11502
 
11073
11503
  set lang(lang) {
11074
11504
  this.$$set({ lang });
11075
- flush();
11505
+ flush$1();
11076
11506
  }
11077
11507
 
11078
11508
  get endpoint() {
@@ -11081,7 +11511,7 @@
11081
11511
 
11082
11512
  set endpoint(endpoint) {
11083
11513
  this.$$set({ endpoint });
11084
- flush();
11514
+ flush$1();
11085
11515
  }
11086
11516
 
11087
11517
  get session() {
@@ -11090,7 +11520,7 @@
11090
11520
 
11091
11521
  set session(session) {
11092
11522
  this.$$set({ session });
11093
- flush();
11523
+ flush$1();
11094
11524
  }
11095
11525
 
11096
11526
  get clientstyling() {
@@ -11099,7 +11529,7 @@
11099
11529
 
11100
11530
  set clientstyling(clientstyling) {
11101
11531
  this.$$set({ clientstyling });
11102
- flush();
11532
+ flush$1();
11103
11533
  }
11104
11534
 
11105
11535
  get currentinfo() {
@@ -11108,7 +11538,7 @@
11108
11538
 
11109
11539
  set currentinfo(currentinfo) {
11110
11540
  this.$$set({ currentinfo });
11111
- flush();
11541
+ flush$1();
11112
11542
  }
11113
11543
 
11114
11544
  get giftimagesrc() {
@@ -11117,7 +11547,7 @@
11117
11547
 
11118
11548
  set giftimagesrc(giftimagesrc) {
11119
11549
  this.$$set({ giftimagesrc });
11120
- flush();
11550
+ flush$1();
11121
11551
  }
11122
11552
 
11123
11553
  get contentdirection() {
@@ -11126,7 +11556,7 @@
11126
11556
 
11127
11557
  set contentdirection(contentdirection) {
11128
11558
  this.$$set({ contentdirection });
11129
- flush();
11559
+ flush$1();
11130
11560
  }
11131
11561
 
11132
11562
  get id() {
@@ -11135,7 +11565,7 @@
11135
11565
 
11136
11566
  set id(id) {
11137
11567
  this.$$set({ id });
11138
- flush();
11568
+ flush$1();
11139
11569
  }
11140
11570
  }
11141
11571
 
@@ -11459,8 +11889,8 @@
11459
11889
  let commonProps;
11460
11890
  let hasSession;
11461
11891
  let $_;
11462
- validate_store(X, '_');
11463
- component_subscribe($$self, X, $$value => $$invalidate(8, $_ = $$value));
11892
+ validate_store($format, '_');
11893
+ component_subscribe($$self, $format, $$value => $$invalidate(8, $_ = $$value));
11464
11894
  let { $$slots: slots = {}, $$scope } = $$props;
11465
11895
  validate_slots('undefined', slots, []);
11466
11896
  let { lang = Lang.en } = $$props;
@@ -11564,7 +11994,7 @@
11564
11994
 
11565
11995
  $$self.$capture_state = () => ({
11566
11996
  onMount,
11567
- _: X,
11997
+ _: $format,
11568
11998
  setLocale,
11569
11999
  setLocaleWhenInit,
11570
12000
  Lang,
@@ -11726,7 +12156,7 @@
11726
12156
 
11727
12157
  if (options.props) {
11728
12158
  this.$set(options.props);
11729
- flush();
12159
+ flush$1();
11730
12160
  }
11731
12161
  }
11732
12162
  }
@@ -11754,7 +12184,7 @@
11754
12184
 
11755
12185
  set lang(lang) {
11756
12186
  this.$$set({ lang });
11757
- flush();
12187
+ flush$1();
11758
12188
  }
11759
12189
 
11760
12190
  get endpoint() {
@@ -11763,7 +12193,7 @@
11763
12193
 
11764
12194
  set endpoint(endpoint) {
11765
12195
  this.$$set({ endpoint });
11766
- flush();
12196
+ flush$1();
11767
12197
  }
11768
12198
 
11769
12199
  get session() {
@@ -11772,7 +12202,7 @@
11772
12202
 
11773
12203
  set session(session) {
11774
12204
  this.$$set({ session });
11775
- flush();
12205
+ flush$1();
11776
12206
  }
11777
12207
 
11778
12208
  get clientstyling() {
@@ -11781,7 +12211,7 @@
11781
12211
 
11782
12212
  set clientstyling(clientstyling) {
11783
12213
  this.$$set({ clientstyling });
11784
- flush();
12214
+ flush$1();
11785
12215
  }
11786
12216
 
11787
12217
  get clientstylingurl() {
@@ -11790,7 +12220,7 @@
11790
12220
 
11791
12221
  set clientstylingurl(clientstylingurl) {
11792
12222
  this.$$set({ clientstylingurl });
11793
- flush();
12223
+ flush$1();
11794
12224
  }
11795
12225
 
11796
12226
  get translationurl() {
@@ -11799,7 +12229,7 @@
11799
12229
 
11800
12230
  set translationurl(translationurl) {
11801
12231
  this.$$set({ translationurl });
11802
- flush();
12232
+ flush$1();
11803
12233
  }
11804
12234
 
11805
12235
  get loginevent() {
@@ -11808,7 +12238,7 @@
11808
12238
 
11809
12239
  set loginevent(loginevent) {
11810
12240
  this.$$set({ loginevent });
11811
- flush();
12241
+ flush$1();
11812
12242
  }
11813
12243
 
11814
12244
  get loginurl() {
@@ -11817,7 +12247,7 @@
11817
12247
 
11818
12248
  set loginurl(loginurl) {
11819
12249
  this.$$set({ loginurl });
11820
- flush();
12250
+ flush$1();
11821
12251
  }
11822
12252
 
11823
12253
  get currentinfo() {
@@ -11826,7 +12256,7 @@
11826
12256
 
11827
12257
  set currentinfo(currentinfo) {
11828
12258
  this.$$set({ currentinfo });
11829
- flush();
12259
+ flush$1();
11830
12260
  }
11831
12261
 
11832
12262
  get giftimagesrc() {
@@ -11835,7 +12265,7 @@
11835
12265
 
11836
12266
  set giftimagesrc(giftimagesrc) {
11837
12267
  this.$$set({ giftimagesrc });
11838
- flush();
12268
+ flush$1();
11839
12269
  }
11840
12270
 
11841
12271
  get isshowhistory() {
@@ -11844,7 +12274,7 @@
11844
12274
 
11845
12275
  set isshowhistory(isshowhistory) {
11846
12276
  this.$$set({ isshowhistory });
11847
- flush();
12277
+ flush$1();
11848
12278
  }
11849
12279
 
11850
12280
  get contentdirection() {
@@ -11853,7 +12283,7 @@
11853
12283
 
11854
12284
  set contentdirection(contentdirection) {
11855
12285
  this.$$set({ contentdirection });
11856
- flush();
12286
+ flush$1();
11857
12287
  }
11858
12288
  }
11859
12289