@everymatrix/player-reality-check 0.0.162 → 0.0.166

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.
@@ -93,6 +93,14 @@
93
93
  function set_current_component(component) {
94
94
  current_component = component;
95
95
  }
96
+ function get_current_component() {
97
+ if (!current_component)
98
+ throw new Error('Function called outside component initialization');
99
+ return current_component;
100
+ }
101
+ function onMount(fn) {
102
+ get_current_component().$$.on_mount.push(fn);
103
+ }
96
104
 
97
105
  const dirty_components = [];
98
106
  const binding_callbacks = [];
@@ -4425,103 +4433,188 @@
4425
4433
 
4426
4434
  function get_each_context(ctx, list, i) {
4427
4435
  const child_ctx = ctx.slice();
4428
- child_ctx[8] = list[i].value;
4429
- child_ctx[9] = list[i].text;
4430
- child_ctx[11] = i;
4436
+ child_ctx[17] = list[i].value;
4437
+ child_ctx[18] = list[i].text;
4438
+ child_ctx[20] = i;
4431
4439
  return child_ctx;
4432
4440
  }
4433
4441
 
4434
- // (23:4) {#if isMobile}
4435
- function create_if_block(ctx) {
4442
+ // (58:4) {#if isMobile}
4443
+ function create_if_block_1(ctx) {
4444
+ let t0;
4436
4445
  let div;
4437
4446
  let svg;
4438
4447
  let defs;
4439
4448
  let style;
4440
- let t0;
4449
+ let t1;
4441
4450
  let g1;
4442
4451
  let g0;
4443
4452
  let path;
4444
- let t1;
4453
+ let t2;
4445
4454
  let h2;
4446
4455
  let mounted;
4447
4456
  let dispose;
4457
+ let if_block = /*realityCheckSuccess*/ ctx[1] && create_if_block_2(ctx);
4448
4458
 
4449
4459
  const block = {
4450
4460
  c: function create() {
4461
+ if (if_block) if_block.c();
4462
+ t0 = space();
4451
4463
  div = element("div");
4452
4464
  svg = svg_element("svg");
4453
4465
  defs = svg_element("defs");
4454
4466
  style = svg_element("style");
4455
- t0 = text(".aaa{fill:#d0046c;}");
4467
+ t1 = text(".aaa{fill:#d0046c;}");
4456
4468
  g1 = svg_element("g");
4457
4469
  g0 = svg_element("g");
4458
4470
  path = svg_element("path");
4459
- t1 = space();
4471
+ t2 = space();
4460
4472
  h2 = element("h2");
4461
4473
  h2.textContent = "Reality Check";
4462
- add_location(style, file, 24, 95, 1003);
4463
- add_location(defs, file, 24, 89, 997);
4474
+ add_location(style, file, 62, 95, 2059);
4475
+ add_location(defs, file, 62, 89, 2053);
4464
4476
  attr_dev(path, "class", "aaa");
4465
4477
  attr_dev(path, "d", "M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z");
4466
4478
  attr_dev(path, "transform", "translate(15 15) rotate(180)");
4467
- add_location(path, file, 26, 10, 1132);
4479
+ add_location(path, file, 64, 10, 2188);
4468
4480
  attr_dev(g0, "transform", "translate(20 158)");
4469
- add_location(g0, file, 25, 8, 1088);
4481
+ add_location(g0, file, 63, 8, 2144);
4470
4482
  attr_dev(g1, "transform", "translate(-20 -158)");
4471
- add_location(g1, file, 24, 136, 1044);
4483
+ add_location(g1, file, 62, 136, 2100);
4472
4484
  attr_dev(svg, "xmlns", "http://www.w3.org/2000/svg");
4473
4485
  attr_dev(svg, "width", "15");
4474
4486
  attr_dev(svg, "height", "15");
4475
4487
  attr_dev(svg, "viewBox", "0 0 15 15");
4476
- add_location(svg, file, 24, 6, 914);
4488
+ add_location(svg, file, 62, 6, 1970);
4477
4489
  attr_dev(h2, "class", "RealityCheckTitleMobile");
4478
- add_location(h2, file, 29, 6, 1304);
4490
+ add_location(h2, file, 67, 6, 2360);
4479
4491
  attr_dev(div, "class", "MenuReturnButton");
4480
- add_location(div, file, 23, 4, 845);
4492
+ add_location(div, file, 61, 4, 1901);
4481
4493
  },
4482
4494
  m: function mount(target, anchor) {
4495
+ if (if_block) if_block.m(target, anchor);
4496
+ insert_dev(target, t0, anchor);
4483
4497
  insert_dev(target, div, anchor);
4484
4498
  append_dev(div, svg);
4485
4499
  append_dev(svg, defs);
4486
4500
  append_dev(defs, style);
4487
- append_dev(style, t0);
4501
+ append_dev(style, t1);
4488
4502
  append_dev(svg, g1);
4489
4503
  append_dev(g1, g0);
4490
4504
  append_dev(g0, path);
4491
- append_dev(div, t1);
4505
+ append_dev(div, t2);
4492
4506
  append_dev(div, h2);
4493
4507
 
4494
4508
  if (!mounted) {
4495
- dispose = listen_dev(div, "click", /*click_handler*/ ctx[4], false, false, false);
4509
+ dispose = listen_dev(div, "click", /*click_handler*/ ctx[8], false, false, false);
4496
4510
  mounted = true;
4497
4511
  }
4498
4512
  },
4499
- p: noop$1,
4513
+ p: function update(ctx, dirty) {
4514
+ if (/*realityCheckSuccess*/ ctx[1]) {
4515
+ if (if_block) {
4516
+ if_block.p(ctx, dirty);
4517
+ } else {
4518
+ if_block = create_if_block_2(ctx);
4519
+ if_block.c();
4520
+ if_block.m(t0.parentNode, t0);
4521
+ }
4522
+ } else if (if_block) {
4523
+ if_block.d(1);
4524
+ if_block = null;
4525
+ }
4526
+ },
4500
4527
  d: function destroy(detaching) {
4528
+ if (if_block) if_block.d(detaching);
4529
+ if (detaching) detach_dev(t0);
4501
4530
  if (detaching) detach_dev(div);
4502
4531
  mounted = false;
4503
4532
  dispose();
4504
4533
  }
4505
4534
  };
4506
4535
 
4536
+ dispatch_dev("SvelteRegisterBlock", {
4537
+ block,
4538
+ id: create_if_block_1.name,
4539
+ type: "if",
4540
+ source: "(58:4) {#if isMobile}",
4541
+ ctx
4542
+ });
4543
+
4544
+ return block;
4545
+ }
4546
+
4547
+ // (59:6) {#if realityCheckSuccess}
4548
+ function create_if_block_2(ctx) {
4549
+ let div;
4550
+
4551
+ const block = {
4552
+ c: function create() {
4553
+ div = element("div");
4554
+ div.textContent = `${/*realityCheckSuccessMessage*/ ctx[3]}`;
4555
+ attr_dev(div, "class", "successMessageMobile");
4556
+ add_location(div, file, 59, 8, 1816);
4557
+ },
4558
+ m: function mount(target, anchor) {
4559
+ insert_dev(target, div, anchor);
4560
+ },
4561
+ p: noop$1,
4562
+ d: function destroy(detaching) {
4563
+ if (detaching) detach_dev(div);
4564
+ }
4565
+ };
4566
+
4567
+ dispatch_dev("SvelteRegisterBlock", {
4568
+ block,
4569
+ id: create_if_block_2.name,
4570
+ type: "if",
4571
+ source: "(59:6) {#if realityCheckSuccess}",
4572
+ ctx
4573
+ });
4574
+
4575
+ return block;
4576
+ }
4577
+
4578
+ // (71:4) {#if realityCheckSuccess}
4579
+ function create_if_block(ctx) {
4580
+ let div;
4581
+ let t;
4582
+
4583
+ const block = {
4584
+ c: function create() {
4585
+ div = element("div");
4586
+ t = text(/*realityCheckSuccessMessage*/ ctx[3]);
4587
+ attr_dev(div, "class", "successMessage " + (/*isMobile*/ ctx[2] ? "successMessageMobile" : ""));
4588
+ add_location(div, file, 71, 6, 2472);
4589
+ },
4590
+ m: function mount(target, anchor) {
4591
+ insert_dev(target, div, anchor);
4592
+ append_dev(div, t);
4593
+ },
4594
+ p: noop$1,
4595
+ d: function destroy(detaching) {
4596
+ if (detaching) detach_dev(div);
4597
+ }
4598
+ };
4599
+
4507
4600
  dispatch_dev("SvelteRegisterBlock", {
4508
4601
  block,
4509
4602
  id: create_if_block.name,
4510
4603
  type: "if",
4511
- source: "(23:4) {#if isMobile}",
4604
+ source: "(71:4) {#if realityCheckSuccess}",
4512
4605
  ctx
4513
4606
  });
4514
4607
 
4515
4608
  return block;
4516
4609
  }
4517
4610
 
4518
- // (39:10) {#each options as {value, text}
4611
+ // (79:10) {#each realityCheckOptions as {value, text}
4519
4612
  function create_each_block(ctx) {
4520
4613
  let div;
4521
4614
  let input;
4522
4615
  let t0;
4523
4616
  let label;
4524
- let t1_value = /*text*/ ctx[9] + "";
4617
+ let t1_value = /*text*/ ctx[18] + "";
4525
4618
  let t1;
4526
4619
  let t2;
4527
4620
  let mounted;
@@ -4536,14 +4629,14 @@
4536
4629
  t1 = text(t1_value);
4537
4630
  t2 = space();
4538
4631
  attr_dev(input, "type", "radio");
4539
- attr_dev(input, "id", /*value*/ ctx[8]);
4540
- input.__value = /*value*/ ctx[8];
4632
+ attr_dev(input, "id", /*value*/ ctx[17]);
4633
+ input.__value = /*value*/ ctx[17];
4541
4634
  input.value = input.__value;
4542
- /*$$binding_groups*/ ctx[6][0].push(input);
4543
- add_location(input, file, 40, 14, 2028);
4544
- attr_dev(label, "for", /*value*/ ctx[8]);
4545
- add_location(label, file, 41, 14, 2109);
4546
- add_location(div, file, 39, 12, 2008);
4635
+ /*$$binding_groups*/ ctx[10][0].push(input);
4636
+ add_location(input, file, 80, 14, 3245);
4637
+ attr_dev(label, "for", /*value*/ ctx[17]);
4638
+ add_location(label, file, 81, 14, 3326);
4639
+ add_location(div, file, 79, 12, 3225);
4547
4640
  },
4548
4641
  m: function mount(target, anchor) {
4549
4642
  insert_dev(target, div, anchor);
@@ -4555,7 +4648,7 @@
4555
4648
  append_dev(div, t2);
4556
4649
 
4557
4650
  if (!mounted) {
4558
- dispose = listen_dev(input, "change", /*input_change_handler*/ ctx[5]);
4651
+ dispose = listen_dev(input, "change", /*input_change_handler*/ ctx[9]);
4559
4652
  mounted = true;
4560
4653
  }
4561
4654
  },
@@ -4566,7 +4659,7 @@
4566
4659
  },
4567
4660
  d: function destroy(detaching) {
4568
4661
  if (detaching) detach_dev(div);
4569
- /*$$binding_groups*/ ctx[6][0].splice(/*$$binding_groups*/ ctx[6][0].indexOf(input), 1);
4662
+ /*$$binding_groups*/ ctx[10][0].splice(/*$$binding_groups*/ ctx[10][0].indexOf(input), 1);
4570
4663
  mounted = false;
4571
4664
  dispose();
4572
4665
  }
@@ -4576,7 +4669,7 @@
4576
4669
  block,
4577
4670
  id: create_each_block.name,
4578
4671
  type: "each",
4579
- source: "(39:10) {#each options as {value, text}",
4672
+ source: "(79:10) {#each realityCheckOptions as {value, text}",
4580
4673
  ctx
4581
4674
  });
4582
4675
 
@@ -4586,22 +4679,26 @@
4586
4679
  function create_fragment(ctx) {
4587
4680
  let div2;
4588
4681
  let t0;
4589
- let h2;
4590
4682
  let t1;
4683
+ let h2;
4591
4684
  let t2;
4685
+ let t3;
4592
4686
  let div0;
4593
4687
  let p;
4594
- let t3;
4688
+ let t4;
4595
4689
  let br0;
4596
4690
  let br1;
4597
- let t4;
4598
4691
  let t5;
4599
- let form;
4600
4692
  let t6;
4693
+ let form;
4694
+ let t7;
4601
4695
  let div1;
4602
4696
  let button;
4603
- let if_block = /*isMobile*/ ctx[1] && create_if_block(ctx);
4604
- let each_value = /*options*/ ctx[2];
4697
+ let mounted;
4698
+ let dispose;
4699
+ let if_block0 = /*isMobile*/ ctx[2] && create_if_block_1(ctx);
4700
+ let if_block1 = /*realityCheckSuccess*/ ctx[1] && create_if_block(ctx);
4701
+ let each_value = /*realityCheckOptions*/ ctx[4];
4605
4702
  validate_each_argument(each_value);
4606
4703
  let each_blocks = [];
4607
4704
 
@@ -4612,85 +4709,107 @@
4612
4709
  const block = {
4613
4710
  c: function create() {
4614
4711
  div2 = element("div");
4615
- if (if_block) if_block.c();
4712
+ if (if_block0) if_block0.c();
4616
4713
  t0 = space();
4714
+ if (if_block1) if_block1.c();
4715
+ t1 = space();
4617
4716
  h2 = element("h2");
4618
- t1 = text("Reality Check");
4619
- t2 = space();
4717
+ t2 = text("Reality Check");
4718
+ t3 = space();
4620
4719
  div0 = element("div");
4621
4720
  p = element("p");
4622
- t3 = text("The Reality Check facility allows you to set the frequency at which you will see a Reality Check on the screen within your gaming session. A Reality Check means a display of the time elapsed since your session began.");
4721
+ t4 = text("The Reality Check facility allows you to set the frequency at which you will see a Reality Check on the screen within your gaming session. A Reality Check means a display of the time elapsed since your session began.");
4623
4722
  br0 = element("br");
4624
4723
  br1 = element("br");
4625
- t4 = text("\n You are able to control the frequency at which the Reality Check will appear on your screen.");
4626
- t5 = space();
4724
+ t5 = text("\n You are able to control the frequency at which the Reality Check will appear on your screen.");
4725
+ t6 = space();
4627
4726
  form = element("form");
4628
4727
 
4629
4728
  for (let i = 0; i < each_blocks.length; i += 1) {
4630
4729
  each_blocks[i].c();
4631
4730
  }
4632
4731
 
4633
- t6 = space();
4732
+ t7 = space();
4634
4733
  div1 = element("div");
4635
4734
  button = element("button");
4636
4735
  button.textContent = "Set frequency";
4637
4736
  this.c = noop$1;
4638
- attr_dev(h2, "class", "RealityCheckTitle " + (/*isMobile*/ ctx[1] ? "RealityCheckTitleNone" : ""));
4639
- add_location(h2, file, 33, 4, 1385);
4640
- add_location(br0, file, 35, 227, 1797);
4641
- add_location(br1, file, 35, 231, 1801);
4642
- add_location(p, file, 35, 8, 1578);
4737
+ attr_dev(h2, "class", "RealityCheckTitle " + (/*isMobile*/ ctx[2] ? "RealityCheckTitleNone" : ""));
4738
+ add_location(h2, file, 73, 4, 2590);
4739
+ add_location(br0, file, 75, 227, 3002);
4740
+ add_location(br1, file, 75, 231, 3006);
4741
+ add_location(p, file, 75, 8, 2783);
4643
4742
  attr_dev(form, "class", "customRadio");
4644
- add_location(form, file, 37, 8, 1921);
4743
+ add_location(form, file, 77, 8, 3126);
4645
4744
 
4646
- attr_dev(div0, "class", "RealityCheckDescription " + (/*isMobile*/ ctx[1]
4745
+ attr_dev(div0, "class", "RealityCheckDescription " + (/*isMobile*/ ctx[2]
4647
4746
  ? "RealityCheckDescriptionMobile"
4648
4747
  : ""));
4649
4748
 
4650
- add_location(div0, file, 34, 6, 1482);
4749
+ add_location(div0, file, 74, 6, 2687);
4651
4750
  attr_dev(button, "class", "PlayerRealityCheckButton");
4652
- add_location(button, file, 47, 8, 2301);
4653
- attr_dev(div1, "class", "BottomButtonsArea " + (/*isMobile*/ ctx[1] ? "BottomButtonsAreaMobile" : ""));
4654
- add_location(div1, file, 46, 6, 2217);
4751
+ add_location(button, file, 87, 8, 3518);
4752
+ attr_dev(div1, "class", "BottomButtonsArea " + (/*isMobile*/ ctx[2] ? "BottomButtonsAreaMobile" : ""));
4753
+ add_location(div1, file, 86, 6, 3434);
4655
4754
 
4656
- attr_dev(div2, "class", "PlayerRealityCheckWrapper " + (/*isMobile*/ ctx[1]
4755
+ attr_dev(div2, "class", "PlayerRealityCheckWrapper " + (/*isMobile*/ ctx[2]
4657
4756
  ? "PlayerRealityCheckWrapperMobile"
4658
4757
  : ""));
4659
4758
 
4660
- add_location(div2, file, 21, 2, 728);
4759
+ add_location(div2, file, 56, 2, 1663);
4661
4760
  },
4662
4761
  l: function claim(nodes) {
4663
4762
  throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
4664
4763
  },
4665
4764
  m: function mount(target, anchor) {
4666
4765
  insert_dev(target, div2, anchor);
4667
- if (if_block) if_block.m(div2, null);
4766
+ if (if_block0) if_block0.m(div2, null);
4668
4767
  append_dev(div2, t0);
4768
+ if (if_block1) if_block1.m(div2, null);
4769
+ append_dev(div2, t1);
4669
4770
  append_dev(div2, h2);
4670
- append_dev(h2, t1);
4671
- append_dev(div2, t2);
4771
+ append_dev(h2, t2);
4772
+ append_dev(div2, t3);
4672
4773
  append_dev(div2, div0);
4673
4774
  append_dev(div0, p);
4674
- append_dev(p, t3);
4775
+ append_dev(p, t4);
4675
4776
  append_dev(p, br0);
4676
4777
  append_dev(p, br1);
4677
- append_dev(p, t4);
4678
- append_dev(div0, t5);
4778
+ append_dev(p, t5);
4779
+ append_dev(div0, t6);
4679
4780
  append_dev(div0, form);
4680
4781
 
4681
4782
  for (let i = 0; i < each_blocks.length; i += 1) {
4682
4783
  each_blocks[i].m(form, null);
4683
4784
  }
4684
4785
 
4685
- append_dev(div2, t6);
4786
+ append_dev(div2, t7);
4686
4787
  append_dev(div2, div1);
4687
4788
  append_dev(div1, button);
4789
+
4790
+ if (!mounted) {
4791
+ dispose = listen_dev(button, "click", /*click_handler_1*/ ctx[11], false, false, false);
4792
+ mounted = true;
4793
+ }
4688
4794
  },
4689
4795
  p: function update(ctx, [dirty]) {
4690
- if (/*isMobile*/ ctx[1]) if_block.p(ctx, dirty);
4796
+ if (/*isMobile*/ ctx[2]) if_block0.p(ctx, dirty);
4797
+
4798
+ if (/*realityCheckSuccess*/ ctx[1]) {
4799
+ if (if_block1) {
4800
+ if_block1.p(ctx, dirty);
4801
+ } else {
4802
+ if_block1 = create_if_block(ctx);
4803
+ if_block1.c();
4804
+ if_block1.m(div2, t1);
4805
+ }
4806
+ } else if (if_block1) {
4807
+ if_block1.d(1);
4808
+ if_block1 = null;
4809
+ }
4691
4810
 
4692
- if (dirty & /*options, frequency*/ 5) {
4693
- each_value = /*options*/ ctx[2];
4811
+ if (dirty & /*realityCheckOptions, frequency*/ 17) {
4812
+ each_value = /*realityCheckOptions*/ ctx[4];
4694
4813
  validate_each_argument(each_value);
4695
4814
  let i;
4696
4815
 
@@ -4717,8 +4836,11 @@
4717
4836
  o: noop$1,
4718
4837
  d: function destroy(detaching) {
4719
4838
  if (detaching) detach_dev(div2);
4720
- if (if_block) if_block.d();
4839
+ if (if_block0) if_block0.d();
4840
+ if (if_block1) if_block1.d();
4721
4841
  destroy_each(each_blocks, detaching);
4842
+ mounted = false;
4843
+ dispose();
4722
4844
  }
4723
4845
  };
4724
4846
 
@@ -4736,27 +4858,71 @@
4736
4858
  function instance($$self, $$props, $$invalidate) {
4737
4859
  let { $$slots: slots = {}, $$scope } = $$props;
4738
4860
  validate_slots("undefined", slots, []);
4861
+ let { realitycheck = "" } = $$props;
4739
4862
  let userAgent = window.navigator.userAgent;
4740
4863
  let isMobile = getDevice(userAgent) === "PC" ? false : true;
4741
- let frequency = "never";
4742
-
4743
- let options = [
4744
- { value: "never", text: "Never" },
4745
- { value: "oneHour", text: "1 Hour" },
4746
- { value: "twoHours", text: "2 Hours" },
4747
- { value: "threeHours", text: "3 Hours" },
4748
- { value: "fourHours", text: "4 Hours" }
4864
+ let frequency = "";
4865
+ let receivedData = {};
4866
+ let realityCheckData = {};
4867
+ let realityCheckSuccess = false;
4868
+ let realityCheckSuccessMessage = "Reality check ha been successfully updated.";
4869
+
4870
+ let realityCheckOptions = [
4871
+ { value: "0", text: "Never" },
4872
+ { value: "60", text: "1 Hour" },
4873
+ { value: "120", text: "2 Hours" },
4874
+ { value: "180", text: "3 Hours" },
4875
+ { value: "240", text: "4 Hours" }
4749
4876
  ];
4750
4877
 
4751
- //TODO: this should be used when api will be done
4752
- // const submitFrequency = () => {
4753
- // window.postMessage({ type: '' }, window.location.href);
4754
- // }
4878
+ // Send Frequency period and date
4879
+ const submitFrequency = () => {
4880
+ window.postMessage(
4881
+ {
4882
+ type: "SubmittedRealityCheck",
4883
+ realityCheckUpdatedValue: frequency
4884
+ },
4885
+ window.location.href
4886
+ );
4887
+ };
4888
+
4755
4889
  const toggleScreen = () => {
4756
4890
  window.postMessage({ type: "ReturnToMenu" }, window.location.href);
4757
4891
  };
4758
4892
 
4759
- const writable_props = [];
4893
+ const initialLoad = () => {
4894
+ if (realitycheck) {
4895
+ $$invalidate(0, frequency = realitycheck);
4896
+ } else {
4897
+ $$invalidate(0, frequency = realityCheckOptions[0].value);
4898
+ }
4899
+ };
4900
+
4901
+ const messageHandler = e => {
4902
+ if (e.data) {
4903
+ switch (e.data.type) {
4904
+ case "RealityCheckValueUpdated":
4905
+ $$invalidate(1, realityCheckSuccess = true);
4906
+ setTimeout(
4907
+ () => {
4908
+ $$invalidate(1, realityCheckSuccess = false);
4909
+ },
4910
+ 2000
4911
+ );
4912
+ break;
4913
+ }
4914
+ }
4915
+ };
4916
+
4917
+ onMount(() => {
4918
+ window.addEventListener("message", messageHandler, false);
4919
+
4920
+ return () => {
4921
+ window.removeEventListener("message", messageHandler);
4922
+ };
4923
+ });
4924
+
4925
+ const writable_props = ["realitycheck"];
4760
4926
 
4761
4927
  Object.keys($$props).forEach(key => {
4762
4928
  if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<undefined> was created with unknown prop '${key}'`);
@@ -4770,41 +4936,72 @@
4770
4936
  $$invalidate(0, frequency);
4771
4937
  }
4772
4938
 
4939
+ const click_handler_1 = () => submitFrequency();
4940
+
4941
+ $$self.$$set = $$props => {
4942
+ if ("realitycheck" in $$props) $$invalidate(7, realitycheck = $$props.realitycheck);
4943
+ };
4944
+
4773
4945
  $$self.$capture_state = () => ({
4946
+ onMount,
4774
4947
  getDevice,
4948
+ realitycheck,
4775
4949
  userAgent,
4776
4950
  isMobile,
4777
4951
  frequency,
4778
- options,
4779
- toggleScreen
4952
+ receivedData,
4953
+ realityCheckData,
4954
+ realityCheckSuccess,
4955
+ realityCheckSuccessMessage,
4956
+ realityCheckOptions,
4957
+ submitFrequency,
4958
+ toggleScreen,
4959
+ initialLoad,
4960
+ messageHandler
4780
4961
  });
4781
4962
 
4782
4963
  $$self.$inject_state = $$props => {
4964
+ if ("realitycheck" in $$props) $$invalidate(7, realitycheck = $$props.realitycheck);
4783
4965
  if ("userAgent" in $$props) userAgent = $$props.userAgent;
4784
- if ("isMobile" in $$props) $$invalidate(1, isMobile = $$props.isMobile);
4966
+ if ("isMobile" in $$props) $$invalidate(2, isMobile = $$props.isMobile);
4785
4967
  if ("frequency" in $$props) $$invalidate(0, frequency = $$props.frequency);
4786
- if ("options" in $$props) $$invalidate(2, options = $$props.options);
4968
+ if ("receivedData" in $$props) receivedData = $$props.receivedData;
4969
+ if ("realityCheckData" in $$props) realityCheckData = $$props.realityCheckData;
4970
+ if ("realityCheckSuccess" in $$props) $$invalidate(1, realityCheckSuccess = $$props.realityCheckSuccess);
4971
+ if ("realityCheckSuccessMessage" in $$props) $$invalidate(3, realityCheckSuccessMessage = $$props.realityCheckSuccessMessage);
4972
+ if ("realityCheckOptions" in $$props) $$invalidate(4, realityCheckOptions = $$props.realityCheckOptions);
4787
4973
  };
4788
4974
 
4789
4975
  if ($$props && "$$inject" in $$props) {
4790
4976
  $$self.$inject_state($$props.$$inject);
4791
4977
  }
4792
4978
 
4979
+ $$self.$$.update = () => {
4980
+ if ($$self.$$.dirty & /*realitycheck*/ 128) {
4981
+ realitycheck && initialLoad();
4982
+ }
4983
+ };
4984
+
4793
4985
  return [
4794
4986
  frequency,
4987
+ realityCheckSuccess,
4795
4988
  isMobile,
4796
- options,
4989
+ realityCheckSuccessMessage,
4990
+ realityCheckOptions,
4991
+ submitFrequency,
4797
4992
  toggleScreen,
4993
+ realitycheck,
4798
4994
  click_handler,
4799
4995
  input_change_handler,
4800
- $$binding_groups
4996
+ $$binding_groups,
4997
+ click_handler_1
4801
4998
  ];
4802
4999
  }
4803
5000
 
4804
5001
  class PlayerRealityCheck extends SvelteElement {
4805
5002
  constructor(options) {
4806
5003
  super();
4807
- this.shadowRoot.innerHTML = `<style>.customRadio{margin-top:30px}.customRadio div{margin:0 0 30px}.customRadio input[type="radio"]{position:absolute;left:-9999px}.customRadio input[type="radio"]+label{position:relative;padding:3px 0 0 40px;cursor:pointer}.customRadio input[type="radio"]+label:before{content:'';background:#fff;border:1px solid #707070;height:20px;width:20px;border-radius:50%;position:absolute;top:0;left:0}.customRadio input[type="radio"]+label:after{content:'';background:#d0046c;width:18px;height:18px;border-radius:50%;position:absolute;top:2px;left:2px;opacity:0;transform:scale(2);transition:transform 0.3s linear, opacity 0.3s linear}.customRadio input[type="radio"]:checked+label:after{opacity:1;transform:scale(1)}.RealityCheckDescription{color:#58586B;line-height:24px}.PlayerRealityCheckWrapper{color:#07072A;padding:50px;max-width:760px}.PlayerRealityCheckWrapper.PlayerRealityCheckWrapperMobile{padding:20px 15px;max-width:unset}.RealityCheckTitle{font-size:26px;color:#D0046C;font-weight:400}.RealityCheckTitleMobile{font-size:16px;color:#D0046C}.RealityCheckTitleNone{display:none}.BottomButtonsArea{display:grid;grid-column-gap:30px;grid-template-rows:auto;grid-template-columns:1fr 1fr;margin-top:20px}.BottomButtonsArea.BottomButtonsAreaMobile{width:100%;grid-template-columns:1fr}.PlayerRealityCheckButton{cursor:pointer;border-radius:5px;width:100%;height:50px;display:flex;align-items:center;justify-content:center;font-size:15px;color:#FFF;text-transform:uppercase;text-align:center;transition-duration:0.3s;box-sizing:border-box;padding:10px}.PlayerRealityCheckButton{background:transparent;border:1px solid #58586B}.PlayerRealityCheckButton{background:#D0046C;border:1px solid #D0046C}.MenuReturnButton{color:#D0046C;display:inline-flex;align-items:center;column-gap:20PX}.MenuReturnButton svg{fill:#D0046C}</style>`;
5004
+ this.shadowRoot.innerHTML = `<style>.successMessage{position:absolute;display:block;top:25px;left:50px;background:#16CE16;font-size:14px;border-radius:5px;padding:10px;color:#FFF}.successMessage.successMessageMobile{display:none}.successMessageMobile{display:block;background:#16CE16;font-size:14px;border-radius:5px;padding:10px;color:#FFF}.successMessageMobile.successMessage{display:none}.customRadio{margin-top:15px}.customRadio div{margin:0 0 30px}.customRadio input[type="radio"]{position:absolute;left:-9999px}.customRadio input[type="radio"]+label{position:relative;padding:3px 0 0 40px;cursor:pointer}.customRadio input[type="radio"]+label:before{content:'';background:#fff;border:1px solid #707070;height:20px;width:20px;border-radius:50%;position:absolute;top:0;left:0}.customRadio input[type="radio"]+label:after{content:'';background:#d0046c;width:18px;height:18px;border-radius:50%;position:absolute;top:2px;left:2px;opacity:0;transform:scale(2);transition:transform 0.3s linear, opacity 0.3s linear}.customRadio input[type="radio"]:checked+label:after{opacity:1;transform:scale(1)}.RealityCheckDescription{color:#58586B;line-height:24px}.PlayerRealityCheckWrapper{position:relative;color:#07072A;padding:50px;max-width:760px}.PlayerRealityCheckWrapper.PlayerRealityCheckWrapperMobile{padding:20px 15px;max-width:unset}.RealityCheckTitle{font-size:26px;color:#D0046C;font-weight:400}.RealityCheckTitleMobile{font-size:16px;color:#D0046C}.RealityCheckTitleNone{display:none}.BottomButtonsArea{display:grid;grid-column-gap:30px;grid-template-rows:auto;grid-template-columns:1fr 1fr;margin-top:20px}.BottomButtonsArea.BottomButtonsAreaMobile{width:100%;grid-template-columns:1fr}.PlayerRealityCheckButton{cursor:pointer;border-radius:5px;width:100%;height:50px;display:flex;align-items:center;justify-content:center;font-size:15px;color:#FFF;text-transform:uppercase;text-align:center;transition-duration:0.3s;box-sizing:border-box;padding:10px}.PlayerRealityCheckButton{background:transparent;border:1px solid #58586B}.PlayerRealityCheckButton{background:#D0046C;border:1px solid #D0046C}.MenuReturnButton{color:#D0046C;display:inline-flex;align-items:center;column-gap:20PX}.MenuReturnButton svg{fill:#D0046C}</style>`;
4808
5005
 
4809
5006
  init(
4810
5007
  this,
@@ -4816,15 +5013,33 @@
4816
5013
  instance,
4817
5014
  create_fragment,
4818
5015
  safe_not_equal,
4819
- {}
5016
+ { realitycheck: 7 }
4820
5017
  );
4821
5018
 
4822
5019
  if (options) {
4823
5020
  if (options.target) {
4824
5021
  insert_dev(options.target, this, options.anchor);
4825
5022
  }
5023
+
5024
+ if (options.props) {
5025
+ this.$set(options.props);
5026
+ flush();
5027
+ }
4826
5028
  }
4827
5029
  }
5030
+
5031
+ static get observedAttributes() {
5032
+ return ["realitycheck"];
5033
+ }
5034
+
5035
+ get realitycheck() {
5036
+ return this.$$.ctx[7];
5037
+ }
5038
+
5039
+ set realitycheck(realitycheck) {
5040
+ this.$set({ realitycheck });
5041
+ flush();
5042
+ }
4828
5043
  }
4829
5044
 
4830
5045
  !customElements.get('player-reality-check') && customElements.define('player-reality-check', PlayerRealityCheck);