@everymatrix/lottery-program-wof 1.23.0 → 1.24.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.
@@ -5195,9 +5195,11 @@
5195
5195
  ActiveTickets: `Active Tickets`,
5196
5196
  ImplicitTickets: `Implicit Tickets`,
5197
5197
  RemainingTimes: `Remaining Times`,
5198
+ Retry: 'Network is a bit busy now, please click OK to re-spin',
5198
5199
  ShowNext: `The Wheel will be available on<br /> <strong>{startTime}</strong> <br />Please wait till it is open.`,
5199
5200
  SpinFailed: `We are sorry that you don't have any Wheels available, please <strong>check T&C</strong> here to get a chance!`,
5200
- DrawFailed: 'There was a problem to grant the reward. Please contact support',
5201
+ DrawFailed: 'The prize assignment may be failed, please contact customer support for more details',
5202
+ Timeout: 'Network is a bit busy now, please try again later.',
5201
5203
  Congratulation: `Congratulations! You won a {prize}!`,
5202
5204
  OK: `OK`,
5203
5205
  Rewards: `Rewards`,
@@ -5330,7 +5332,7 @@
5330
5332
  const { Object: Object_1$2 } = globals;
5331
5333
  const file$6 = "src/private.message.svelte";
5332
5334
 
5333
- // (75:0) {#if isShown && isOptionsReady}
5335
+ // (83:0) {#if isShown && isOptionsReady}
5334
5336
  function create_if_block$5(ctx) {
5335
5337
  let div;
5336
5338
  let t0;
@@ -5340,7 +5342,7 @@
5340
5342
  let t4;
5341
5343
  let show_if = !['init-failed', 'show-next', 'NoNext'].includes(/*mode*/ ctx[5]);
5342
5344
  let div_style_value;
5343
- let if_block0 = (/*mode*/ ctx[5] === 'normal' || /*mode*/ ctx[5] === 'init-failed') && create_if_block_7(ctx);
5345
+ let if_block0 = (/*mode*/ ctx[5] === 'normal' || /*mode*/ ctx[5] === 'init-failed' || /*mode*/ ctx[5] === 'timeout') && create_if_block_7(ctx);
5344
5346
  let if_block1 = /*mode*/ ctx[5] === 'show-next' && create_if_block_6(ctx);
5345
5347
  let if_block2 = /*mode*/ ctx[5] === 'NoNext' && create_if_block_5(ctx);
5346
5348
  let if_block3 = /*mode*/ ctx[5] === 'gift' && create_if_block_3$1(ctx);
@@ -5370,7 +5372,7 @@
5370
5372
  /*isShown*/ ctx[4] ? 'opacity: 1' : ''
5371
5373
  ].join(';'));
5372
5374
 
5373
- add_location(div, file$6, 75, 0, 2565);
5375
+ add_location(div, file$6, 83, 0, 2786);
5374
5376
  },
5375
5377
  m: function mount(target, anchor) {
5376
5378
  insert_dev(target, div, anchor);
@@ -5388,7 +5390,7 @@
5388
5390
  /*div_binding*/ ctx[20](div);
5389
5391
  },
5390
5392
  p: function update(ctx, dirty) {
5391
- if (/*mode*/ ctx[5] === 'normal' || /*mode*/ ctx[5] === 'init-failed') {
5393
+ if (/*mode*/ ctx[5] === 'normal' || /*mode*/ ctx[5] === 'init-failed' || /*mode*/ ctx[5] === 'timeout') {
5392
5394
  if (if_block0) {
5393
5395
  if_block0.p(ctx, dirty);
5394
5396
  } else {
@@ -5493,14 +5495,14 @@
5493
5495
  block,
5494
5496
  id: create_if_block$5.name,
5495
5497
  type: "if",
5496
- source: "(75:0) {#if isShown && isOptionsReady}",
5498
+ source: "(83:0) {#if isShown && isOptionsReady}",
5497
5499
  ctx
5498
5500
  });
5499
5501
 
5500
5502
  return block;
5501
5503
  }
5502
5504
 
5503
- // (87:2) {#if mode === 'normal' || mode === 'init-failed'}
5505
+ // (95:2) {#if mode === 'normal' || mode === 'init-failed' || mode === 'timeout'}
5504
5506
  function create_if_block_7(ctx) {
5505
5507
  let p;
5506
5508
  let t_value = /*$_*/ ctx[11](`wof.${/*modeValue*/ ctx[1]}`) + "";
@@ -5510,7 +5512,7 @@
5510
5512
  c: function create() {
5511
5513
  p = element("p");
5512
5514
  t = text(t_value);
5513
- add_location(p, file$6, 87, 2, 2808);
5515
+ add_location(p, file$6, 95, 2, 3051);
5514
5516
  },
5515
5517
  m: function mount(target, anchor) {
5516
5518
  insert_dev(target, p, anchor);
@@ -5528,14 +5530,14 @@
5528
5530
  block,
5529
5531
  id: create_if_block_7.name,
5530
5532
  type: "if",
5531
- source: "(87:2) {#if mode === 'normal' || mode === 'init-failed'}",
5533
+ source: "(95:2) {#if mode === 'normal' || mode === 'init-failed' || mode === 'timeout'}",
5532
5534
  ctx
5533
5535
  });
5534
5536
 
5535
5537
  return block;
5536
5538
  }
5537
5539
 
5538
- // (91:2) {#if mode === 'show-next'}
5540
+ // (99:2) {#if mode === 'show-next'}
5539
5541
  function create_if_block_6(ctx) {
5540
5542
  let p;
5541
5543
 
@@ -5546,7 +5548,7 @@
5546
5548
  const block = {
5547
5549
  c: function create() {
5548
5550
  p = element("p");
5549
- add_location(p, file$6, 91, 2, 2880);
5551
+ add_location(p, file$6, 99, 2, 3123);
5550
5552
  },
5551
5553
  m: function mount(target, anchor) {
5552
5554
  insert_dev(target, p, anchor);
@@ -5565,14 +5567,14 @@
5565
5567
  block,
5566
5568
  id: create_if_block_6.name,
5567
5569
  type: "if",
5568
- source: "(91:2) {#if mode === 'show-next'}",
5570
+ source: "(99:2) {#if mode === 'show-next'}",
5569
5571
  ctx
5570
5572
  });
5571
5573
 
5572
5574
  return block;
5573
5575
  }
5574
5576
 
5575
- // (95:2) {#if mode === 'NoNext'}
5577
+ // (103:2) {#if mode === 'NoNext'}
5576
5578
  function create_if_block_5(ctx) {
5577
5579
  let p;
5578
5580
  let raw_value = /*$_*/ ctx[11](`wof.NoNext`) + "";
@@ -5580,7 +5582,7 @@
5580
5582
  const block = {
5581
5583
  c: function create() {
5582
5584
  p = element("p");
5583
- add_location(p, file$6, 95, 2, 2976);
5585
+ add_location(p, file$6, 103, 2, 3219);
5584
5586
  },
5585
5587
  m: function mount(target, anchor) {
5586
5588
  insert_dev(target, p, anchor);
@@ -5599,14 +5601,14 @@
5599
5601
  block,
5600
5602
  id: create_if_block_5.name,
5601
5603
  type: "if",
5602
- source: "(95:2) {#if mode === 'NoNext'}",
5604
+ source: "(103:2) {#if mode === 'NoNext'}",
5603
5605
  ctx
5604
5606
  });
5605
5607
 
5606
5608
  return block;
5607
5609
  }
5608
5610
 
5609
- // (99:2) {#if mode === 'gift'}
5611
+ // (107:2) {#if mode === 'gift'}
5610
5612
  function create_if_block_3$1(ctx) {
5611
5613
  let p0;
5612
5614
  let img;
@@ -5634,9 +5636,9 @@
5634
5636
  if (!src_url_equal(img.src, img_src_value = /*prizeSrc*/ ctx[7])) attr_dev(img, "src", img_src_value);
5635
5637
  attr_dev(img, "alt", "");
5636
5638
  attr_dev(img, "class", "GiftImage");
5637
- add_location(img, file$6, 100, 4, 3072);
5638
- add_location(p0, file$6, 99, 2, 3064);
5639
- add_location(p1, file$6, 107, 2, 3290);
5639
+ add_location(img, file$6, 108, 4, 3315);
5640
+ add_location(p0, file$6, 107, 2, 3307);
5641
+ add_location(p1, file$6, 115, 2, 3533);
5640
5642
  },
5641
5643
  m: function mount(target, anchor) {
5642
5644
  insert_dev(target, p0, anchor);
@@ -5676,14 +5678,14 @@
5676
5678
  block,
5677
5679
  id: create_if_block_3$1.name,
5678
5680
  type: "if",
5679
- source: "(99:2) {#if mode === 'gift'}",
5681
+ source: "(107:2) {#if mode === 'gift'}",
5680
5682
  ctx
5681
5683
  });
5682
5684
 
5683
5685
  return block;
5684
5686
  }
5685
5687
 
5686
- // (105:4) {:else}
5688
+ // (113:4) {:else}
5687
5689
  function create_else_block$2(ctx) {
5688
5690
  let html_tag;
5689
5691
 
@@ -5718,14 +5720,14 @@
5718
5720
  block,
5719
5721
  id: create_else_block$2.name,
5720
5722
  type: "else",
5721
- source: "(105:4) {:else}",
5723
+ source: "(113:4) {:else}",
5722
5724
  ctx
5723
5725
  });
5724
5726
 
5725
5727
  return block;
5726
5728
  }
5727
5729
 
5728
- // (103:4) {#if modeValue.prizeText}
5730
+ // (111:4) {#if modeValue.prizeText}
5729
5731
  function create_if_block_4(ctx) {
5730
5732
  let html_tag;
5731
5733
  let raw_value = /*modeValue*/ ctx[1].prizeText + "";
@@ -5754,14 +5756,14 @@
5754
5756
  block,
5755
5757
  id: create_if_block_4.name,
5756
5758
  type: "if",
5757
- source: "(103:4) {#if modeValue.prizeText}",
5759
+ source: "(111:4) {#if modeValue.prizeText}",
5758
5760
  ctx
5759
5761
  });
5760
5762
 
5761
5763
  return block;
5762
5764
  }
5763
5765
 
5764
- // (113:2) {#if mode === 'nogift'}
5766
+ // (121:2) {#if mode === 'nogift'}
5765
5767
  function create_if_block_2$1(ctx) {
5766
5768
  let p0;
5767
5769
  let img;
@@ -5779,9 +5781,9 @@
5779
5781
  if (!src_url_equal(img.src, img_src_value = /*modeValue*/ ctx[1].image)) attr_dev(img, "src", img_src_value);
5780
5782
  attr_dev(img, "alt", "");
5781
5783
  attr_dev(img, "class", "GiftImage");
5782
- add_location(img, file$6, 114, 4, 3347);
5783
- add_location(p0, file$6, 113, 2, 3339);
5784
- add_location(p1, file$6, 116, 2, 3409);
5784
+ add_location(img, file$6, 122, 4, 3590);
5785
+ add_location(p0, file$6, 121, 2, 3582);
5786
+ add_location(p1, file$6, 124, 2, 3652);
5785
5787
  },
5786
5788
  m: function mount(target, anchor) {
5787
5789
  insert_dev(target, p0, anchor);
@@ -5807,14 +5809,14 @@
5807
5809
  block,
5808
5810
  id: create_if_block_2$1.name,
5809
5811
  type: "if",
5810
- source: "(113:2) {#if mode === 'nogift'}",
5812
+ source: "(121:2) {#if mode === 'nogift'}",
5811
5813
  ctx
5812
5814
  });
5813
5815
 
5814
5816
  return block;
5815
5817
  }
5816
5818
 
5817
- // (120:2) {#if !['init-failed', 'show-next', 'NoNext'].includes(mode)}
5819
+ // (128:2) {#if !['init-failed', 'show-next', 'NoNext'].includes(mode)}
5818
5820
  function create_if_block_1$4(ctx) {
5819
5821
  let div;
5820
5822
  let button;
@@ -5829,8 +5831,8 @@
5829
5831
  button = element("button");
5830
5832
  t = text(t_value);
5831
5833
  attr_dev(button, "class", "MessagePanelButton");
5832
- add_location(button, file$6, 121, 4, 3523);
5833
- add_location(div, file$6, 120, 2, 3513);
5834
+ add_location(button, file$6, 129, 4, 3766);
5835
+ add_location(div, file$6, 128, 2, 3756);
5834
5836
  },
5835
5837
  m: function mount(target, anchor) {
5836
5838
  insert_dev(target, div, anchor);
@@ -5856,7 +5858,7 @@
5856
5858
  block,
5857
5859
  id: create_if_block_1$4.name,
5858
5860
  type: "if",
5859
- source: "(120:2) {#if !['init-failed', 'show-next', 'NoNext'].includes(mode)}",
5861
+ source: "(128:2) {#if !['init-failed', 'show-next', 'NoNext'].includes(mode)}",
5860
5862
  ctx
5861
5863
  });
5862
5864
 
@@ -5952,8 +5954,16 @@
5952
5954
  const _postMessageScoped = props => _postMessage(Object.assign(Object.assign({}, props), { id }));
5953
5955
 
5954
5956
  const eventButton = () => {
5955
- $$invalidate(4, isShown = false);
5956
- _postMessageScoped({ type: 'wof-private-message-close' });
5957
+ switch (mode) {
5958
+ case 'timeout':
5959
+ $$invalidate(4, isShown = false);
5960
+ _postMessageScoped({ type: 'wof-private-message-retry' });
5961
+ break;
5962
+ default:
5963
+ $$invalidate(4, isShown = false);
5964
+ _postMessageScoped({ type: 'wof-private-message-close' });
5965
+ break;
5966
+ }
5957
5967
  };
5958
5968
 
5959
5969
  const getTimeString = _d => {
@@ -8274,6 +8284,9 @@
8274
8284
 
8275
8285
  class Process {
8276
8286
  constructor(params) {
8287
+ this.isDrawn = false;
8288
+ this.retryingTimes = 0;
8289
+ this.retryingMaxTimes = 4;
8277
8290
  this.id = params.id;
8278
8291
  this.afterSetMessage = params.afterSetMessage;
8279
8292
  this.halter = params.halter;
@@ -8292,24 +8305,69 @@
8292
8305
  // spinner.halt(calc.getDeg(index), cb)
8293
8306
  this.halter(index, cb);
8294
8307
  }
8295
- async drawer(guid, frequency = 0) {
8296
- let index;
8308
+ getRetryingPeriod() {
8309
+ if (this.retryingTimes === 1) {
8310
+ return 5 * 1000;
8311
+ }
8312
+ else {
8313
+ return 10 * 1000;
8314
+ }
8315
+ }
8316
+ drawInit() {
8317
+ this.retryingTimes = 0;
8318
+ this.guid = undefined;
8319
+ this.isDrawn = false;
8320
+ }
8321
+ async drawer(guid) {
8322
+ if (guid)
8323
+ this.guid = guid;
8324
+ if (!this.guid)
8325
+ throw new Error('GUID NOT FOUND');
8326
+ if (this.retryingTimes >= this.retryingMaxTimes) {
8327
+ if (this.isDrawn) {
8328
+ this.handleHaltProcess(this.drawnIndex, 'DrawFailed');
8329
+ }
8330
+ else {
8331
+ this.handleHaltProcess(undefined, 'Timeout');
8332
+ }
8333
+ this.drawInit();
8334
+ return;
8335
+ }
8336
+ this.retryingTimes += 1;
8337
+ let isFetchSucceeded = false;
8338
+ let isTimeouted = false;
8339
+ setTimeout(() => {
8340
+ if (!isFetchSucceeded) {
8341
+ isTimeouted = true;
8342
+ this.setMessage({
8343
+ mode: 'timeout',
8344
+ modeValue: 'Retry'
8345
+ });
8346
+ }
8347
+ }, this.getRetryingPeriod());
8297
8348
  try {
8298
- const { data, message, index: _index } = await this.fetcher(guid);
8299
- index = _index;
8349
+ const { data, message, index: _index } = await this.fetcher(this.guid);
8350
+ this.drawnIndex = _index;
8351
+ isFetchSucceeded = true;
8300
8352
  if (!data.success)
8301
8353
  throw new Error();
8302
- if (data.item.state === "drawn")
8303
- throw new Error();
8304
- this.handleHaltProcess(index, message, this.afterSuccess);
8354
+ switch (data.item.state) {
8355
+ case 'fulfilled':
8356
+ this.isDrawn = true;
8357
+ break;
8358
+ case 'drawn':
8359
+ this.isDrawn = true;
8360
+ throw new Error();
8361
+ }
8362
+ if (isTimeouted)
8363
+ return;
8364
+ this.handleHaltProcess(this.drawnIndex, message, this.afterSuccess);
8365
+ this.drawInit();
8305
8366
  }
8306
8367
  catch (e) {
8307
- if (frequency < 4) {
8308
- this.drawer(guid, frequency + 1);
8309
- }
8310
- else {
8311
- this.handleHaltProcess(index, 'DrawFailed');
8312
- }
8368
+ if (isTimeouted)
8369
+ return;
8370
+ this.drawer();
8313
8371
  }
8314
8372
  }
8315
8373
  setMessage(entry) {
@@ -8443,7 +8501,7 @@
8443
8501
  return child_ctx;
8444
8502
  }
8445
8503
 
8446
- // (175:2) {#if Number(size) && options.length}
8504
+ // (184:2) {#if Number(size) && options.length}
8447
8505
  function create_if_block$2(ctx) {
8448
8506
  let svg_1;
8449
8507
  let foreignObject0;
@@ -8586,39 +8644,39 @@
8586
8644
  }
8587
8645
 
8588
8646
  set_svg_attributes(foreignObject0, foreignObject_data_3);
8589
- add_location(foreignObject0, file$2, 182, 4, 5530);
8647
+ add_location(foreignObject0, file$2, 191, 4, 5777);
8590
8648
  attr_dev(g0, "class", "PartitionsBackgrounds");
8591
- add_location(g0, file$2, 185, 6, 5660);
8649
+ add_location(g0, file$2, 194, 6, 5907);
8592
8650
  attr_dev(g1, "class", "PartitionsBackgroundStrokes");
8593
- add_location(g1, file$2, 196, 6, 5993);
8651
+ add_location(g1, file$2, 205, 6, 6240);
8594
8652
  attr_dev(g2, "class", "Partitions");
8595
8653
  set_style(g2, "filter", /*optionFilter*/ ctx[13]);
8596
- add_location(g2, file$2, 207, 6, 6268);
8654
+ add_location(g2, file$2, 216, 6, 6515);
8597
8655
  set_svg_attributes(g3, g_data_7);
8598
- add_location(g3, file$2, 184, 4, 5594);
8656
+ add_location(g3, file$2, 193, 4, 5841);
8599
8657
  attr_dev(g4, "class", "PartitionsCustomable1");
8600
8658
  toggle_class(g4, "active", /*isPartitionsCustomableReady*/ ctx[7]);
8601
- add_location(g4, file$2, 233, 4, 7006);
8659
+ add_location(g4, file$2, 242, 4, 7253);
8602
8660
  attr_dev(g5, "class", "PartitionsCustomable2");
8603
8661
  toggle_class(g5, "active", /*isPartitionsCustomableReady*/ ctx[7]);
8604
- add_location(g5, file$2, 242, 4, 7275);
8662
+ add_location(g5, file$2, 251, 4, 7522);
8605
8663
  set_svg_attributes(foreignObject1, foreignObject_data_2);
8606
- add_location(foreignObject1, file$2, 265, 4, 7888);
8664
+ add_location(foreignObject1, file$2, 274, 4, 8135);
8607
8665
  set_svg_attributes(foreignObject2, foreignObject_data_1);
8608
- add_location(foreignObject2, file$2, 266, 4, 7951);
8666
+ add_location(foreignObject2, file$2, 275, 4, 8198);
8609
8667
  attr_dev(foreignObject3, "x", foreignObject3_x_value = Number(/*size*/ ctx[0]) / 2 - 100 / 2);
8610
8668
  attr_dev(foreignObject3, "y", foreignObject3_y_value = Number(/*size*/ ctx[0]) / 2 - 100 / 2);
8611
8669
  attr_dev(foreignObject3, "width", 100);
8612
8670
  attr_dev(foreignObject3, "height", 100);
8613
- add_location(foreignObject3, file$2, 273, 6, 8131);
8671
+ add_location(foreignObject3, file$2, 282, 6, 8378);
8614
8672
  attr_dev(g6, "class", "Center");
8615
8673
  toggle_class(g6, "disabled", /*isSpinning*/ ctx[9]);
8616
- add_location(g6, file$2, 268, 4, 8012);
8617
- add_location(g7, file$2, 282, 4, 8298);
8674
+ add_location(g6, file$2, 277, 4, 8259);
8675
+ add_location(g7, file$2, 291, 4, 8545);
8618
8676
  attr_dev(svg_1, "width", /*size*/ ctx[0]);
8619
8677
  attr_dev(svg_1, "height", /*size*/ ctx[0]);
8620
8678
  set_style(svg_1, "opacity", /*messageShown*/ ctx[11] ? '.3' : '');
8621
- add_location(svg_1, file$2, 175, 2, 5371);
8679
+ add_location(svg_1, file$2, 184, 2, 5618);
8622
8680
  },
8623
8681
  m: function mount(target, anchor) {
8624
8682
  insert_dev(target, svg_1, anchor);
@@ -8921,14 +8979,14 @@
8921
8979
  block,
8922
8980
  id: create_if_block$2.name,
8923
8981
  type: "if",
8924
- source: "(175:2) {#if Number(size) && options.length}",
8982
+ source: "(184:2) {#if Number(size) && options.length}",
8925
8983
  ctx
8926
8984
  });
8927
8985
 
8928
8986
  return block;
8929
8987
  }
8930
8988
 
8931
- // (187:8) {#each options as option, index}
8989
+ // (196:8) {#each options as option, index}
8932
8990
  function create_each_block_5(ctx) {
8933
8991
  let foreignObject;
8934
8992
 
@@ -8940,7 +8998,7 @@
8940
8998
  attr_dev(foreignObject, "style", `--index: ${/*index*/ ctx[45]}`);
8941
8999
  attr_dev(foreignObject, "width", /*size*/ ctx[0]);
8942
9000
  attr_dev(foreignObject, "height", /*size*/ ctx[0]);
8943
- add_location(foreignObject, file$2, 187, 10, 5745);
9001
+ add_location(foreignObject, file$2, 196, 10, 5992);
8944
9002
  },
8945
9003
  m: function mount(target, anchor) {
8946
9004
  insert_dev(target, foreignObject, anchor);
@@ -8963,14 +9021,14 @@
8963
9021
  block,
8964
9022
  id: create_each_block_5.name,
8965
9023
  type: "each",
8966
- source: "(187:8) {#each options as option, index}",
9024
+ source: "(196:8) {#each options as option, index}",
8967
9025
  ctx
8968
9026
  });
8969
9027
 
8970
9028
  return block;
8971
9029
  }
8972
9030
 
8973
- // (198:8) {#each options as option, index}
9031
+ // (207:8) {#each options as option, index}
8974
9032
  function create_each_block_4(ctx) {
8975
9033
  let path;
8976
9034
 
@@ -8991,7 +9049,7 @@
8991
9049
  c: function create() {
8992
9050
  path = svg_element("path");
8993
9051
  set_svg_attributes(path, path_data);
8994
- add_location(path, file$2, 198, 8, 6082);
9052
+ add_location(path, file$2, 207, 8, 6329);
8995
9053
  },
8996
9054
  m: function mount(target, anchor) {
8997
9055
  insert_dev(target, path, anchor);
@@ -9013,14 +9071,14 @@
9013
9071
  block,
9014
9072
  id: create_each_block_4.name,
9015
9073
  type: "each",
9016
- source: "(198:8) {#each options as option, index}",
9074
+ source: "(207:8) {#each options as option, index}",
9017
9075
  ctx
9018
9076
  });
9019
9077
 
9020
9078
  return block;
9021
9079
  }
9022
9080
 
9023
- // (211:10) {#if option.image}
9081
+ // (220:10) {#if option.image}
9024
9082
  function create_if_block_3(ctx) {
9025
9083
  let g;
9026
9084
  let mounted;
@@ -9030,7 +9088,7 @@
9030
9088
  c: function create() {
9031
9089
  g = svg_element("g");
9032
9090
  attr_dev(g, "class", `PartitionImage PartitionImage${/*index*/ ctx[45]}`);
9033
- add_location(g, file$2, 211, 12, 6401);
9091
+ add_location(g, file$2, 220, 12, 6648);
9034
9092
  },
9035
9093
  m: function mount(target, anchor) {
9036
9094
  insert_dev(target, g, anchor);
@@ -9054,14 +9112,14 @@
9054
9112
  block,
9055
9113
  id: create_if_block_3.name,
9056
9114
  type: "if",
9057
- source: "(211:10) {#if option.image}",
9115
+ source: "(220:10) {#if option.image}",
9058
9116
  ctx
9059
9117
  });
9060
9118
 
9061
9119
  return block;
9062
9120
  }
9063
9121
 
9064
- // (218:10) {#if option.name}
9122
+ // (227:10) {#if option.name}
9065
9123
  function create_if_block_2(ctx) {
9066
9124
  let foreignObject;
9067
9125
  let div;
@@ -9092,11 +9150,11 @@
9092
9150
  ? ''
9093
9151
  : ' Anticlockwise'}`);
9094
9152
 
9095
- add_location(p, file$2, 223, 16, 6776);
9153
+ add_location(p, file$2, 232, 16, 7023);
9096
9154
  attr_dev(div, "class", "PartitionTextEntityContainer");
9097
- add_location(div, file$2, 222, 14, 6717);
9155
+ add_location(div, file$2, 231, 14, 6964);
9098
9156
  set_svg_attributes(foreignObject, foreignObject_data);
9099
- add_location(foreignObject, file$2, 218, 12, 6576);
9157
+ add_location(foreignObject, file$2, 227, 12, 6823);
9100
9158
  },
9101
9159
  m: function mount(target, anchor) {
9102
9160
  insert_dev(target, foreignObject, anchor);
@@ -9127,14 +9185,14 @@
9127
9185
  block,
9128
9186
  id: create_if_block_2.name,
9129
9187
  type: "if",
9130
- source: "(218:10) {#if option.name}",
9188
+ source: "(227:10) {#if option.name}",
9131
9189
  ctx
9132
9190
  });
9133
9191
 
9134
9192
  return block;
9135
9193
  }
9136
9194
 
9137
- // (209:8) {#each options as option,index}
9195
+ // (218:8) {#each options as option,index}
9138
9196
  function create_each_block_3(ctx) {
9139
9197
  let if_block0_anchor;
9140
9198
  let if_block1_anchor;
@@ -9191,14 +9249,14 @@
9191
9249
  block,
9192
9250
  id: create_each_block_3.name,
9193
9251
  type: "each",
9194
- source: "(209:8) {#each options as option,index}",
9252
+ source: "(218:8) {#each options as option,index}",
9195
9253
  ctx
9196
9254
  });
9197
9255
 
9198
9256
  return block;
9199
9257
  }
9200
9258
 
9201
- // (235:6) {#each options as option,index}
9259
+ // (244:6) {#each options as option,index}
9202
9260
  function create_each_block_2(ctx) {
9203
9261
  let foreignObject;
9204
9262
  let foreignObject_style_value;
@@ -9221,7 +9279,7 @@
9221
9279
  c: function create() {
9222
9280
  foreignObject = svg_element("foreignObject");
9223
9281
  set_svg_attributes(foreignObject, foreignObject_data);
9224
- add_location(foreignObject, file$2, 235, 6, 7127);
9282
+ add_location(foreignObject, file$2, 244, 6, 7374);
9225
9283
  },
9226
9284
  m: function mount(target, anchor) {
9227
9285
  insert_dev(target, foreignObject, anchor);
@@ -9242,14 +9300,14 @@
9242
9300
  block,
9243
9301
  id: create_each_block_2.name,
9244
9302
  type: "each",
9245
- source: "(235:6) {#each options as option,index}",
9303
+ source: "(244:6) {#each options as option,index}",
9246
9304
  ctx
9247
9305
  });
9248
9306
 
9249
9307
  return block;
9250
9308
  }
9251
9309
 
9252
- // (244:6) {#each options as option,index}
9310
+ // (253:6) {#each options as option,index}
9253
9311
  function create_each_block_1(ctx) {
9254
9312
  let foreignObject;
9255
9313
  let foreignObject_style_value;
@@ -9272,7 +9330,7 @@
9272
9330
  c: function create() {
9273
9331
  foreignObject = svg_element("foreignObject");
9274
9332
  set_svg_attributes(foreignObject, foreignObject_data);
9275
- add_location(foreignObject, file$2, 244, 6, 7396);
9333
+ add_location(foreignObject, file$2, 253, 6, 7643);
9276
9334
  },
9277
9335
  m: function mount(target, anchor) {
9278
9336
  insert_dev(target, foreignObject, anchor);
@@ -9293,14 +9351,14 @@
9293
9351
  block,
9294
9352
  id: create_each_block_1.name,
9295
9353
  type: "each",
9296
- source: "(244:6) {#each options as option,index}",
9354
+ source: "(253:6) {#each options as option,index}",
9297
9355
  ctx
9298
9356
  });
9299
9357
 
9300
9358
  return block;
9301
9359
  }
9302
9360
 
9303
- // (253:4) {#if theme.pointerMode === PointerMode.Partition}
9361
+ // (262:4) {#if theme.pointerMode === PointerMode.Partition}
9304
9362
  function create_if_block_1$1(ctx) {
9305
9363
  let g;
9306
9364
  let foreignObject;
@@ -9332,12 +9390,12 @@
9332
9390
  foreignObject = svg_element("foreignObject");
9333
9391
  path = svg_element("path");
9334
9392
  set_svg_attributes(foreignObject, foreignObject_data);
9335
- add_location(foreignObject, file$2, 255, 6, 7663);
9393
+ add_location(foreignObject, file$2, 264, 6, 7910);
9336
9394
  set_svg_attributes(path, path_data);
9337
9395
  toggle_class(path, "active", /*isShowPrizeArea*/ ctx[10]);
9338
- add_location(path, file$2, 257, 6, 7734);
9396
+ add_location(path, file$2, 266, 6, 7981);
9339
9397
  set_svg_attributes(g, g_data);
9340
- add_location(g, file$2, 253, 4, 7599);
9398
+ add_location(g, file$2, 262, 4, 7846);
9341
9399
  },
9342
9400
  m: function mount(target, anchor) {
9343
9401
  insert_dev(target, g, anchor);
@@ -9371,14 +9429,14 @@
9371
9429
  block,
9372
9430
  id: create_if_block_1$1.name,
9373
9431
  type: "if",
9374
- source: "(253:4) {#if theme.pointerMode === PointerMode.Partition}",
9432
+ source: "(262:4) {#if theme.pointerMode === PointerMode.Partition}",
9375
9433
  ctx
9376
9434
  });
9377
9435
 
9378
9436
  return block;
9379
9437
  }
9380
9438
 
9381
- // (284:6) {#each options as option, index}
9439
+ // (293:6) {#each options as option, index}
9382
9440
  function create_each_block$2(ctx) {
9383
9441
  let clipPath;
9384
9442
  let path;
@@ -9401,9 +9459,9 @@
9401
9459
  clipPath = svg_element("clipPath");
9402
9460
  path = svg_element("path");
9403
9461
  set_svg_attributes(path, path_data);
9404
- add_location(path, file$2, 285, 8, 8392);
9462
+ add_location(path, file$2, 294, 8, 8639);
9405
9463
  set_svg_attributes(clipPath, clipPath_data);
9406
- add_location(clipPath, file$2, 284, 6, 8347);
9464
+ add_location(clipPath, file$2, 293, 6, 8594);
9407
9465
  },
9408
9466
  m: function mount(target, anchor) {
9409
9467
  insert_dev(target, clipPath, anchor);
@@ -9423,7 +9481,7 @@
9423
9481
  block,
9424
9482
  id: create_each_block$2.name,
9425
9483
  type: "each",
9426
- source: "(284:6) {#each options as option, index}",
9484
+ source: "(293:6) {#each options as option, index}",
9427
9485
  ctx
9428
9486
  });
9429
9487
 
@@ -9444,7 +9502,7 @@
9444
9502
  this.c = noop;
9445
9503
  attr_dev(div, "class", div_class_value = `WheelContainer theme${Number(/*themeIndex*/ ctx[6]) + 1}`);
9446
9504
  attr_dev(div, "style", div_style_value = `${defines()} --length: ${/*options*/ ctx[3].length}; --radius: ${/*radius*/ ctx[1]}; --ratio: ${Number(/*size*/ ctx[0]) / 480}; --size: ${/*size*/ ctx[0]}`);
9447
- add_location(div, file$2, 169, 0, 5114);
9505
+ add_location(div, file$2, 178, 0, 5361);
9448
9506
  },
9449
9507
  l: function claim(nodes) {
9450
9508
  throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
@@ -9635,6 +9693,11 @@
9635
9693
  $$invalidate(9, isSpinning = false);
9636
9694
  setTimeout(() => updateSpinable(), 1);
9637
9695
  $$invalidate(11, messageShown = false);
9696
+ },
9697
+ 'wof-private-message-retry': data => {
9698
+ if (data.id !== id) return;
9699
+ $$invalidate(11, messageShown = false);
9700
+ process.drawer();
9638
9701
  }
9639
9702
  });
9640
9703
 
@@ -9830,11 +9893,14 @@
9830
9893
  bonus && runFirstCheck();
9831
9894
  }
9832
9895
 
9833
- if ($$self.$$.dirty[0] & /*id, calc, endpoint, session, options*/ 4587560) {
9896
+ if ($$self.$$.dirty[0] & /*id, options, calc, endpoint, session*/ 4587560) {
9834
9897
  process = new Process({
9835
9898
  id,
9836
9899
  afterSetMessage: () => $$invalidate(11, messageShown = true),
9837
- halter: (index, cb) => spinner.halt(calc.getDeg(index), cb),
9900
+ halter: (index, cb) => {
9901
+ const targetIndex = index >= 0 ? index : options.length - 1;
9902
+ spinner.halt(calc.getDeg(targetIndex), cb);
9903
+ },
9838
9904
  afterSuccess: () => $$invalidate(10, isShowPrizeArea = true),
9839
9905
  fetcher: async guid => await api.draw(endpoint, session, id, guid, options)
9840
9906
  });
@@ -10650,7 +10716,7 @@
10650
10716
  return child_ctx;
10651
10717
  }
10652
10718
 
10653
- // (100:10) {:else}
10719
+ // (101:10) {:else}
10654
10720
  function create_else_block(ctx) {
10655
10721
  let div;
10656
10722
  let p;
@@ -10662,9 +10728,9 @@
10662
10728
  div = element("div");
10663
10729
  p = element("p");
10664
10730
  t = text(t_value);
10665
- add_location(p, file, 101, 14, 3045);
10731
+ add_location(p, file, 102, 14, 3117);
10666
10732
  attr_dev(div, "class", "NoContent");
10667
- add_location(div, file, 100, 12, 3007);
10733
+ add_location(div, file, 101, 12, 3079);
10668
10734
  },
10669
10735
  m: function mount(target, anchor) {
10670
10736
  insert_dev(target, div, anchor);
@@ -10683,14 +10749,14 @@
10683
10749
  block,
10684
10750
  id: create_else_block.name,
10685
10751
  type: "else",
10686
- source: "(100:10) {:else}",
10752
+ source: "(101:10) {:else}",
10687
10753
  ctx
10688
10754
  });
10689
10755
 
10690
10756
  return block;
10691
10757
  }
10692
10758
 
10693
- // (90:10) {#if bonuses.length}
10759
+ // (91:10) {#if bonuses.length}
10694
10760
  function create_if_block_1(ctx) {
10695
10761
  let each_1_anchor;
10696
10762
  let each_value = /*bonuses*/ ctx[6];
@@ -10753,21 +10819,21 @@
10753
10819
  block,
10754
10820
  id: create_if_block_1.name,
10755
10821
  type: "if",
10756
- source: "(90:10) {#if bonuses.length}",
10822
+ source: "(91:10) {#if bonuses.length}",
10757
10823
  ctx
10758
10824
  });
10759
10825
 
10760
10826
  return block;
10761
10827
  }
10762
10828
 
10763
- // (87:8) {#if loading}
10829
+ // (88:8) {#if loading}
10764
10830
  function create_if_block(ctx) {
10765
10831
  let wof_loader;
10766
10832
 
10767
10833
  const block = {
10768
10834
  c: function create() {
10769
10835
  wof_loader = element("wof-loader");
10770
- add_location(wof_loader, file, 87, 10, 2621);
10836
+ add_location(wof_loader, file, 88, 10, 2693);
10771
10837
  },
10772
10838
  m: function mount(target, anchor) {
10773
10839
  insert_dev(target, wof_loader, anchor);
@@ -10782,14 +10848,14 @@
10782
10848
  block,
10783
10849
  id: create_if_block.name,
10784
10850
  type: "if",
10785
- source: "(87:8) {#if loading}",
10851
+ source: "(88:8) {#if loading}",
10786
10852
  ctx
10787
10853
  });
10788
10854
 
10789
10855
  return block;
10790
10856
  }
10791
10857
 
10792
- // (91:12) {#each bonuses as bonus}
10858
+ // (92:12) {#each bonuses as bonus}
10793
10859
  function create_each_block(ctx) {
10794
10860
  let lottery_program_wof_private_item;
10795
10861
 
@@ -10813,7 +10879,7 @@
10813
10879
  c: function create() {
10814
10880
  lottery_program_wof_private_item = element("lottery-program-wof-private-item");
10815
10881
  set_attributes(lottery_program_wof_private_item, lottery_program_wof_private_item_data);
10816
- add_location(lottery_program_wof_private_item, file, 91, 14, 2734);
10882
+ add_location(lottery_program_wof_private_item, file, 92, 14, 2806);
10817
10883
  },
10818
10884
  m: function mount(target, anchor) {
10819
10885
  insert_dev(target, lottery_program_wof_private_item, anchor);
@@ -10838,7 +10904,7 @@
10838
10904
  block,
10839
10905
  id: create_each_block.name,
10840
10906
  type: "each",
10841
- source: "(91:12) {#each bonuses as bonus}",
10907
+ source: "(92:12) {#each bonuses as bonus}",
10842
10908
  ctx
10843
10909
  });
10844
10910
 
@@ -10895,17 +10961,17 @@
10895
10961
  lottery_program_wof_private_outcomes = element("lottery-program-wof-private-outcomes");
10896
10962
  this.c = noop;
10897
10963
  attr_dev(div0, "class", "CommonContainer");
10898
- add_location(div0, file, 85, 6, 2559);
10964
+ add_location(div0, file, 86, 6, 2631);
10899
10965
  attr_dev(div1, "slot", "tab-Program");
10900
- add_location(div1, file, 84, 4, 2528);
10966
+ add_location(div1, file, 85, 4, 2600);
10901
10967
  set_attributes(lottery_program_wof_private_outcomes, lottery_program_wof_private_outcomes_data);
10902
- add_location(lottery_program_wof_private_outcomes, file, 108, 6, 3182);
10968
+ add_location(lottery_program_wof_private_outcomes, file, 109, 6, 3254);
10903
10969
  attr_dev(div2, "slot", "tab-History");
10904
- add_location(div2, file, 107, 4, 3151);
10970
+ add_location(div2, file, 108, 4, 3223);
10905
10971
  set_attributes(lottery_program_wof_private_tabs, lottery_program_wof_private_tabs_data);
10906
- add_location(lottery_program_wof_private_tabs, file, 83, 2, 2456);
10972
+ add_location(lottery_program_wof_private_tabs, file, 84, 2, 2528);
10907
10973
  attr_dev(div3, "class", "WofContainer");
10908
- add_location(div3, file, 82, 0, 2401);
10974
+ add_location(div3, file, 83, 0, 2473);
10909
10975
  },
10910
10976
  l: function claim(nodes) {
10911
10977
  throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
@@ -11015,6 +11081,12 @@
11015
11081
 
11016
11082
  const fetcher = async () => {
11017
11083
  $$invalidate(6, bonuses = await api.lotteries(endpoint, session));
11084
+
11085
+ _postMessage({
11086
+ type: 'WofStatus',
11087
+ avaliable: bonuses.length > 0
11088
+ });
11089
+
11018
11090
  _postMessage({ type: 'wof-private-bonuses', bonuses });
11019
11091
  };
11020
11092