@liveblocks/core 3.11.0 → 3.12.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.
package/dist/index.cjs CHANGED
@@ -6,7 +6,7 @@ var __export = (target, all) => {
6
6
 
7
7
  // src/version.ts
8
8
  var PKG_NAME = "@liveblocks/core";
9
- var PKG_VERSION = "3.11.0";
9
+ var PKG_VERSION = "3.12.0";
10
10
  var PKG_FORMAT = "cjs";
11
11
 
12
12
  // src/dupe-detection.ts
@@ -3198,12 +3198,12 @@ function log(level, message) {
3198
3198
  function logPrematureErrorOrCloseEvent(e) {
3199
3199
  const conn = "Connection to Liveblocks websocket server";
3200
3200
  return (ctx) => {
3201
- if (e instanceof Error) {
3202
- warn(`${conn} could not be established. ${String(e)}`);
3203
- } else {
3201
+ if (isCloseEvent(e)) {
3204
3202
  warn(
3205
- isCloseEvent(e) ? `${conn} closed prematurely (code: ${e.code}). Retrying in ${ctx.backoffDelay}ms.` : `${conn} could not be established.`
3203
+ `${conn} closed prematurely (code: ${e.code}). Retrying in ${ctx.backoffDelay}ms.`
3206
3204
  );
3205
+ } else {
3206
+ warn(`${conn} could not be established.`, e);
3207
3207
  }
3208
3208
  };
3209
3209
  }
@@ -5615,6 +5615,171 @@ function isNotificationChannelEnabled(settings) {
5615
5615
  return settings !== null ? values(settings).every((enabled) => enabled === true) : false;
5616
5616
  }
5617
5617
 
5618
+ // src/brand.ts
5619
+ var OFFSET = "12px";
5620
+ var injectBrandBadge = (badgeLocation = "bottom-right") => {
5621
+ if (typeof document === "undefined") {
5622
+ return;
5623
+ }
5624
+ if (document.getElementById("liveblocks-badge")) {
5625
+ return;
5626
+ }
5627
+ const badgeDiv = document.createElement("div");
5628
+ badgeDiv.id = "liveblocks-badge";
5629
+ badgeDiv.style.position = "fixed";
5630
+ badgeDiv.style.opacity = "0";
5631
+ badgeDiv.style.transition = "opacity 300ms";
5632
+ badgeDiv.style.zIndex = "9999";
5633
+ switch (badgeLocation) {
5634
+ case "top-right":
5635
+ badgeDiv.style.top = OFFSET;
5636
+ badgeDiv.style.right = OFFSET;
5637
+ break;
5638
+ case "bottom-right":
5639
+ badgeDiv.style.bottom = OFFSET;
5640
+ badgeDiv.style.right = OFFSET;
5641
+ break;
5642
+ case "bottom-left":
5643
+ badgeDiv.style.bottom = OFFSET;
5644
+ badgeDiv.style.left = OFFSET;
5645
+ break;
5646
+ case "top-left":
5647
+ badgeDiv.style.top = OFFSET;
5648
+ badgeDiv.style.left = OFFSET;
5649
+ break;
5650
+ }
5651
+ badgeDiv.onmouseenter = () => {
5652
+ const hideButton2 = document.getElementById("liveblocks-badge-hide-button");
5653
+ if (hideButton2) {
5654
+ hideButton2.style.opacity = "0.3";
5655
+ }
5656
+ };
5657
+ badgeDiv.onmouseleave = () => {
5658
+ const hideButton2 = document.getElementById("liveblocks-badge-hide-button");
5659
+ if (hideButton2) {
5660
+ hideButton2.style.opacity = "0";
5661
+ }
5662
+ };
5663
+ const link = document.createElement("a");
5664
+ link.href = "https://lblcks.io/badge";
5665
+ link.target = "_blank";
5666
+ link.rel = "noopener noreferrer";
5667
+ link.title = "Liveblocks";
5668
+ const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
5669
+ svg.setAttribute("width", "111");
5670
+ svg.setAttribute("height", "38");
5671
+ svg.setAttribute("viewBox", "0 0 111 38");
5672
+ svg.setAttribute("fill", "none");
5673
+ const rect1 = document.createElementNS("http://www.w3.org/2000/svg", "rect");
5674
+ rect1.setAttribute("x", "1");
5675
+ rect1.setAttribute("y", "1");
5676
+ rect1.setAttribute("width", "109");
5677
+ rect1.setAttribute("height", "36");
5678
+ rect1.setAttribute("rx", "8");
5679
+ rect1.setAttribute("fill", "white");
5680
+ svg.appendChild(rect1);
5681
+ const rect2 = document.createElementNS("http://www.w3.org/2000/svg", "rect");
5682
+ rect2.setAttribute("x", "0.5");
5683
+ rect2.setAttribute("y", "0.5");
5684
+ rect2.setAttribute("width", "110");
5685
+ rect2.setAttribute("height", "37");
5686
+ rect2.setAttribute("rx", "8.5");
5687
+ rect2.setAttribute("stroke", "black");
5688
+ rect2.setAttribute("stroke-opacity", "0.1");
5689
+ svg.appendChild(rect2);
5690
+ const path1 = document.createElementNS("http://www.w3.org/2000/svg", "path");
5691
+ path1.setAttribute(
5692
+ "d",
5693
+ "M39.8256 18.0832H38L38.0005 28.9009H39.8256V18.0832ZM43.213 21.1757H41.3879V28.9009H43.213V21.1757ZM43.213 18H41.3879V19.9688H43.213V18ZM45.8916 21.1757H43.9302L46.6915 28.9009H48.7283L51.4896 21.1757H49.5581L48.4039 24.8348C48.3739 24.93 48.2657 25.3024 48.0795 25.9511L47.7099 27.1959C47.4914 26.406 47.2626 25.6189 47.0237 24.8348L45.8916 21.1757ZM58.9659 23.59C58.8147 23.0721 58.5934 22.6317 58.3014 22.2694C57.9743 21.8628 57.5598 21.5482 57.0571 21.3268C56.5589 21.1004 56.0058 20.9877 55.3973 20.9877C54.2407 20.9877 53.3152 21.3495 52.6212 22.0735C52.275 22.4476 52.0103 22.8896 51.844 23.3715C51.6731 23.8691 51.5876 24.4199 51.5876 25.0233C51.5876 26.3157 51.9322 27.3142 52.6217 28.0184C53.3203 28.7323 54.2509 29.0894 55.4125 29.0894C56.4083 29.0894 57.2151 28.8658 57.8342 28.4181C58.453 27.9704 58.8628 27.3068 59.0638 26.4266L57.2834 26.2908C57.198 26.7685 57.0016 27.1257 56.6948 27.3618C56.3879 27.5933 55.9555 27.7093 55.3973 27.7093C54.1201 27.7093 53.4663 26.9899 53.4363 25.5514H59.1844L59.1922 25.295C59.1922 24.6763 59.1165 24.108 58.9659 23.59ZM53.8434 23.0471C54.1654 22.5943 54.6834 22.3679 55.3973 22.3679C55.7443 22.3679 56.0363 22.4155 56.2725 22.5111C56.509 22.6067 56.7128 22.7601 56.8837 22.9713C57.0167 23.1352 57.1189 23.3218 57.1855 23.5221C57.2605 23.731 57.3062 23.9493 57.3213 24.1708H53.451C53.4964 23.7231 53.6271 23.3484 53.8434 23.0471ZM66.2836 21.4779C65.7656 21.1406 65.1673 20.9724 64.4885 20.9724H64.4875C63.995 20.9724 63.5449 21.0727 63.1374 21.2742C62.7364 21.4696 62.3931 21.7659 62.1412 22.1341V18.0832H60.316V28.9009H62.1416V27.8373C62.373 28.2195 62.7008 28.5342 63.0921 28.7499C63.4996 28.9763 63.9497 29.0894 64.4422 29.0894C65.1266 29.0894 65.7324 28.9259 66.2614 28.5992C66.7891 28.2726 67.1989 27.8045 67.4905 27.1959C67.7871 26.5823 67.9359 25.8634 67.9359 25.0386C67.9359 24.2337 67.7895 23.5248 67.4984 22.9113C67.2115 22.2926 66.8066 21.8148 66.2836 21.4779ZM65.5064 27.0828C65.2148 27.5254 64.7172 27.7463 64.0125 27.7463C63.3786 27.7463 62.9013 27.5175 62.5797 27.0601C62.2576 26.6026 62.0968 25.9336 62.0968 25.0534C62.0968 24.2032 62.24 23.5397 62.5265 23.0619C62.8185 22.579 63.3088 22.3378 63.9978 22.3378C64.7019 22.3378 65.2023 22.5592 65.499 23.0013C65.7961 23.4389 65.944 24.1181 65.944 25.0386C65.944 25.9585 65.7985 26.6401 65.5064 27.0828ZM70.901 18.0832H69.0754V28.9009H70.901V18.0832ZM73.8582 28.6066C74.452 28.9286 75.1558 29.0894 75.9708 29.0894C76.7554 29.0894 77.4444 28.9208 78.0377 28.5844C78.6268 28.2569 79.1068 27.7637 79.4183 27.1659C79.745 26.5523 79.9086 25.843 79.9086 25.0386C79.9086 24.2642 79.7478 23.5697 79.4257 22.9565C79.117 22.3516 78.6404 21.8487 78.0529 21.508C77.4592 21.161 76.7652 20.9872 75.9708 20.9872C75.171 20.9872 74.4719 21.161 73.8735 21.508C73.2876 21.8472 72.811 22.3471 72.5002 22.9486C72.1837 23.5572 72.0252 24.254 72.0252 25.0386C72.0252 25.8735 72.181 26.5948 72.4929 27.2033C72.7962 27.798 73.2722 28.2871 73.8582 28.6066ZM77.4869 27.0906C77.18 27.5231 76.6746 27.7393 75.9708 27.7393C75.493 27.7393 75.1082 27.6437 74.8166 27.4524C74.5246 27.2565 74.3134 26.9621 74.1826 26.5699C74.0518 26.1725 73.9867 25.6619 73.9867 25.0381C73.9867 24.1029 74.1401 23.419 74.4469 22.9866C74.7588 22.5541 75.2667 22.3378 75.9708 22.3378C76.6699 22.3378 77.1727 22.5541 77.4795 22.9866C77.7914 23.419 77.9471 24.1029 77.9471 25.0386C77.9471 25.9738 77.7937 26.6576 77.4869 27.0906ZM82.3982 28.6066C82.9869 28.9286 83.6883 29.0894 84.5033 29.0894C85.1369 29.0894 85.7029 28.9791 86.2005 28.7577C86.6989 28.5364 87.1031 28.2272 87.4152 27.8299C87.7279 27.4249 87.9329 26.9471 88.0109 26.4414L86.2534 26.2607C86.1328 26.7431 85.9316 27.1031 85.6497 27.3392C85.3683 27.5757 84.9857 27.694 84.5033 27.694C84.0103 27.694 83.6232 27.5933 83.3413 27.3918C83.0598 27.1858 82.8635 26.8919 82.7531 26.5093C82.6422 26.1221 82.5872 25.6318 82.5872 25.0386C82.5872 24.455 82.6422 23.9722 82.7531 23.59C82.8635 23.2028 83.0571 22.9062 83.3339 22.6997C83.6157 22.4884 84.0053 22.3831 84.5033 22.3831C85.0362 22.3831 85.4312 22.5314 85.6877 22.8281C85.949 23.1196 86.1354 23.5193 86.2456 24.0276L87.9735 23.718C87.8078 22.8932 87.4326 22.232 86.8491 21.7344C86.2708 21.2363 85.489 20.9877 84.5033 20.9877C83.6985 20.9877 83.0021 21.1587 82.4134 21.5006C81.8322 21.8351 81.3625 22.3337 81.0633 22.9339C80.7514 23.5424 80.5952 24.2439 80.5952 25.0386C80.5952 25.8781 80.7486 26.6026 81.0554 27.2112C81.3673 27.8197 81.8151 28.285 82.3982 28.6066ZM90.8104 26.0343L91.6627 25.2192L93.9257 28.9009H96.0308L92.8999 24.0498L95.9328 21.1757H93.5634L90.8104 23.9976V18.0832H88.9845V28.9009H90.8104V26.0343ZM97.6304 28.8103C98.1436 28.9965 98.7142 29.0894 99.3428 29.0894C100.303 29.0894 101.095 28.8981 101.719 28.5165C102.348 28.1339 102.663 27.5101 102.663 26.6451C102.663 26.0818 102.516 25.6392 102.225 25.3176C101.933 24.9905 101.586 24.7566 101.184 24.6157C100.786 24.4702 100.245 24.3219 99.562 24.1707C99.1642 24.0853 98.8502 24.0049 98.6188 23.9295C98.3873 23.8538 98.201 23.7558 98.0604 23.6352C97.925 23.5141 97.8567 23.3584 97.8567 23.1676C97.8567 22.8858 97.9824 22.6723 98.2338 22.5263C98.4853 22.3803 98.7973 22.3073 99.1694 22.3073C99.6619 22.3073 100.047 22.4255 100.324 22.6621C100.605 22.8987 100.756 23.2531 100.776 23.7258L102.466 23.4467C102.385 22.5817 102.046 21.9556 101.447 21.568C100.854 21.1812 100.095 20.9872 99.1694 20.9872C98.6258 20.9872 98.1236 21.0699 97.6607 21.2362C97.2029 21.397 96.8335 21.6511 96.5517 21.9986C96.27 22.3451 96.1294 22.7827 96.1294 23.3109C96.1294 23.7988 96.25 24.1934 96.4911 24.4951C96.7368 24.8001 97.0527 25.0408 97.4118 25.1965C97.7838 25.3578 98.2512 25.5112 98.8147 25.6567L99.2828 25.7699C99.5949 25.844 99.9044 25.9295 100.211 26.0264C100.421 26.092 100.595 26.1826 100.731 26.2981C100.867 26.4136 100.935 26.5647 100.935 26.7509C100.935 27.0776 100.799 27.3294 100.527 27.505C100.261 27.6815 99.8708 27.7693 99.3583 27.7693C98.8347 27.7693 98.4176 27.6385 98.1055 27.377C97.7941 27.1154 97.6355 26.7384 97.6304 26.2454L95.9109 26.4413C95.9302 27.0351 96.094 27.5304 96.4009 27.9278C96.7129 28.3252 97.1223 28.619 97.6304 28.8103Z"
5694
+ );
5695
+ path1.setAttribute("fill", "black");
5696
+ svg.appendChild(path1);
5697
+ const path2 = document.createElementNS("http://www.w3.org/2000/svg", "path");
5698
+ path2.setAttribute(
5699
+ "d",
5700
+ "M37.6392 15V9.18182H39.7131C40.1657 9.18182 40.5407 9.2642 40.8381 9.42898C41.1354 9.59375 41.358 9.81913 41.5057 10.1051C41.6534 10.3892 41.7273 10.7093 41.7273 11.0653C41.7273 11.4233 41.6525 11.7453 41.5028 12.0312C41.3551 12.3153 41.1316 12.5407 40.8324 12.7074C40.535 12.8722 40.161 12.9545 39.7102 12.9545H38.2841V12.2102H39.6307C39.9167 12.2102 40.1487 12.161 40.3267 12.0625C40.5047 11.9621 40.6354 11.8258 40.7188 11.6534C40.8021 11.4811 40.8438 11.285 40.8438 11.0653C40.8438 10.8456 40.8021 10.6506 40.7188 10.4801C40.6354 10.3097 40.5038 10.1761 40.3239 10.0795C40.1458 9.98295 39.911 9.93466 39.6193 9.93466H38.517V15H37.6392ZM44.4716 15.0881C44.0625 15.0881 43.7055 14.9943 43.4006 14.8068C43.0956 14.6193 42.8589 14.357 42.6903 14.0199C42.5218 13.6828 42.4375 13.2888 42.4375 12.8381C42.4375 12.3854 42.5218 11.9896 42.6903 11.6506C42.8589 11.3116 43.0956 11.0483 43.4006 10.8608C43.7055 10.6733 44.0625 10.5795 44.4716 10.5795C44.8807 10.5795 45.2377 10.6733 45.5426 10.8608C45.8475 11.0483 46.0843 11.3116 46.2528 11.6506C46.4214 11.9896 46.5057 12.3854 46.5057 12.8381C46.5057 13.2888 46.4214 13.6828 46.2528 14.0199C46.0843 14.357 45.8475 14.6193 45.5426 14.8068C45.2377 14.9943 44.8807 15.0881 44.4716 15.0881ZM44.4744 14.375C44.7396 14.375 44.9593 14.3049 45.1335 14.1648C45.3078 14.0246 45.4366 13.8381 45.5199 13.6051C45.6051 13.3722 45.6477 13.1155 45.6477 12.8352C45.6477 12.5568 45.6051 12.3011 45.5199 12.0682C45.4366 11.8333 45.3078 11.6449 45.1335 11.5028C44.9593 11.3608 44.7396 11.2898 44.4744 11.2898C44.2074 11.2898 43.9858 11.3608 43.8097 11.5028C43.6354 11.6449 43.5057 11.8333 43.4205 12.0682C43.3371 12.3011 43.2955 12.5568 43.2955 12.8352C43.2955 13.1155 43.3371 13.3722 43.4205 13.6051C43.5057 13.8381 43.6354 14.0246 43.8097 14.1648C43.9858 14.3049 44.2074 14.375 44.4744 14.375ZM48.267 15L46.983 10.6364H47.8608L48.7159 13.8409H48.7585L49.6165 10.6364H50.4943L51.3466 13.8267H51.3892L52.2386 10.6364H53.1165L51.8352 15H50.9688L50.0824 11.8494H50.017L49.1307 15H48.267ZM55.6705 15.0881C55.2405 15.0881 54.8703 14.9962 54.5597 14.8125C54.2509 14.6269 54.0123 14.3665 53.8438 14.0312C53.6771 13.6941 53.5938 13.2992 53.5938 12.8466C53.5938 12.3996 53.6771 12.0057 53.8438 11.6648C54.0123 11.3239 54.2472 11.0578 54.5483 10.8665C54.8513 10.6752 55.2055 10.5795 55.6108 10.5795C55.857 10.5795 56.0956 10.6203 56.3267 10.7017C56.5578 10.7831 56.7652 10.911 56.9489 11.0852C57.1326 11.2595 57.2775 11.4858 57.3835 11.7642C57.4896 12.0407 57.5426 12.3769 57.5426 12.7727V13.0739H54.0739V12.4375H56.7102C56.7102 12.214 56.6648 12.0161 56.5739 11.8438C56.483 11.6695 56.3551 11.5322 56.1903 11.4318C56.0275 11.3314 55.8362 11.2812 55.6165 11.2812C55.3778 11.2812 55.1695 11.34 54.9915 11.4574C54.8153 11.5729 54.679 11.7244 54.5824 11.9119C54.4877 12.0975 54.4403 12.2992 54.4403 12.517V13.0142C54.4403 13.3059 54.4915 13.554 54.5938 13.7585C54.6979 13.9631 54.8428 14.1193 55.0284 14.2273C55.214 14.3333 55.4309 14.3864 55.679 14.3864C55.84 14.3864 55.9867 14.3636 56.1193 14.3182C56.2519 14.2708 56.3665 14.2008 56.4631 14.108C56.5597 14.0152 56.6335 13.9006 56.6847 13.7642L57.4886 13.9091C57.4242 14.1458 57.3087 14.3532 57.142 14.5312C56.9773 14.7074 56.7699 14.8447 56.5199 14.9432C56.2718 15.0398 55.9886 15.0881 55.6705 15.0881ZM58.4851 15V10.6364H59.3061V11.3295H59.3516C59.4311 11.0947 59.5713 10.91 59.772 10.7756C59.9747 10.6392 60.2038 10.571 60.4595 10.571C60.5125 10.571 60.575 10.5729 60.647 10.5767C60.7209 10.5805 60.7786 10.5852 60.8203 10.5909V11.4034C60.7862 11.3939 60.7256 11.3835 60.6385 11.3722C60.5514 11.3589 60.4643 11.3523 60.3771 11.3523C60.1764 11.3523 59.9974 11.3949 59.8402 11.4801C59.6849 11.5634 59.5618 11.6799 59.4709 11.8295C59.38 11.9773 59.3345 12.1458 59.3345 12.3352V15H58.4851ZM63.2798 15.0881C62.8499 15.0881 62.4796 14.9962 62.169 14.8125C61.8603 14.6269 61.6217 14.3665 61.4531 14.0312C61.2865 13.6941 61.2031 13.2992 61.2031 12.8466C61.2031 12.3996 61.2865 12.0057 61.4531 11.6648C61.6217 11.3239 61.8565 11.0578 62.1577 10.8665C62.4607 10.6752 62.8149 10.5795 63.2202 10.5795C63.4664 10.5795 63.705 10.6203 63.9361 10.7017C64.1671 10.7831 64.3745 10.911 64.5582 11.0852C64.742 11.2595 64.8868 11.4858 64.9929 11.7642C65.099 12.0407 65.152 12.3769 65.152 12.7727V13.0739H61.6832V12.4375H64.3196C64.3196 12.214 64.2741 12.0161 64.1832 11.8438C64.0923 11.6695 63.9645 11.5322 63.7997 11.4318C63.6368 11.3314 63.4455 11.2812 63.2259 11.2812C62.9872 11.2812 62.7789 11.34 62.6009 11.4574C62.4247 11.5729 62.2884 11.7244 62.1918 11.9119C62.0971 12.0975 62.0497 12.2992 62.0497 12.517V13.0142C62.0497 13.3059 62.1009 13.554 62.2031 13.7585C62.3073 13.9631 62.4522 14.1193 62.6378 14.2273C62.8234 14.3333 63.0402 14.3864 63.2884 14.3864C63.4493 14.3864 63.5961 14.3636 63.7287 14.3182C63.8613 14.2708 63.9759 14.2008 64.0724 14.108C64.169 14.0152 64.2429 13.9006 64.294 13.7642L65.098 13.9091C65.0336 14.1458 64.9181 14.3532 64.7514 14.5312C64.5866 14.7074 64.3793 14.8447 64.1293 14.9432C63.8812 15.0398 63.598 15.0881 63.2798 15.0881ZM67.728 15.0852C67.3757 15.0852 67.0613 14.9953 66.7848 14.8153C66.5102 14.6335 66.2943 14.375 66.1371 14.0398C65.9818 13.7027 65.9041 13.2983 65.9041 12.8267C65.9041 12.3551 65.9827 11.9517 66.1399 11.6165C66.299 11.2812 66.5168 11.0246 66.7933 10.8466C67.0698 10.6686 67.3833 10.5795 67.7337 10.5795C68.0045 10.5795 68.2223 10.625 68.3871 10.7159C68.5537 10.8049 68.6825 10.9091 68.7734 11.0284C68.8662 11.1477 68.9382 11.2528 68.9893 11.3438H69.0405V9.18182H69.8899V15H69.0604V14.321H68.9893C68.9382 14.4138 68.8643 14.5199 68.7678 14.6392C68.6731 14.7585 68.5424 14.8627 68.3757 14.9517C68.209 15.0407 67.9931 15.0852 67.728 15.0852ZM67.9155 14.3608C68.1598 14.3608 68.3662 14.2964 68.5348 14.1676C68.7053 14.0369 68.834 13.8561 68.9212 13.625C69.0102 13.3939 69.0547 13.125 69.0547 12.8182C69.0547 12.5152 69.0111 12.25 68.924 12.0227C68.8369 11.7955 68.709 11.6184 68.5405 11.4915C68.3719 11.3646 68.1636 11.3011 67.9155 11.3011C67.6598 11.3011 67.4467 11.3674 67.2763 11.5C67.1058 11.6326 66.977 11.8134 66.8899 12.0426C66.8047 12.2718 66.7621 12.5303 66.7621 12.8182C66.7621 13.1098 66.8056 13.3722 66.8928 13.6051C66.9799 13.8381 67.1087 14.0227 67.2791 14.1591C67.4515 14.2936 67.6636 14.3608 67.9155 14.3608ZM73.2876 15V9.18182H74.1371V11.3438H74.1882C74.2375 11.2528 74.3085 11.1477 74.4013 11.0284C74.4941 10.9091 74.6229 10.8049 74.7876 10.7159C74.9524 10.625 75.1702 10.5795 75.4411 10.5795C75.7933 10.5795 76.1077 10.6686 76.3842 10.8466C76.6607 11.0246 76.8776 11.2812 77.0348 11.6165C77.1939 11.9517 77.2734 12.3551 77.2734 12.8267C77.2734 13.2983 77.1948 13.7027 77.0376 14.0398C76.8804 14.375 76.6645 14.6335 76.3899 14.8153C76.1153 14.9953 75.8018 15.0852 75.4496 15.0852C75.1844 15.0852 74.9676 15.0407 74.799 14.9517C74.6323 14.8627 74.5017 14.7585 74.407 14.6392C74.3123 14.5199 74.2393 14.4138 74.1882 14.321H74.1172V15H73.2876ZM74.12 12.8182C74.12 13.125 74.1645 13.3939 74.2536 13.625C74.3426 13.8561 74.4714 14.0369 74.6399 14.1676C74.8085 14.2964 75.0149 14.3608 75.2592 14.3608C75.513 14.3608 75.7251 14.2936 75.8956 14.1591C76.0661 14.0227 76.1948 13.8381 76.282 13.6051C76.371 13.3722 76.4155 13.1098 76.4155 12.8182C76.4155 12.5303 76.3719 12.2718 76.2848 12.0426C76.1996 11.8134 76.0708 11.6326 75.8984 11.5C75.728 11.3674 75.5149 11.3011 75.2592 11.3011C75.013 11.3011 74.8047 11.3646 74.6342 11.4915C74.4657 11.6184 74.3378 11.7955 74.2507 12.0227C74.1636 12.25 74.12 12.5152 74.12 12.8182ZM78.6158 16.6364C78.4889 16.6364 78.3733 16.6259 78.2692 16.6051C78.165 16.5862 78.0874 16.5653 78.0362 16.5426L78.2408 15.8466C78.3961 15.8883 78.5343 15.9063 78.6555 15.9006C78.7768 15.8949 78.8838 15.8494 78.9766 15.7642C79.0713 15.679 79.1546 15.5398 79.2266 15.3466L79.3317 15.0568L77.7351 10.6364H78.6442L79.7493 14.0227H79.7947L80.8999 10.6364H81.8118L80.0135 15.5824C79.9302 15.8097 79.8241 16.0019 79.6953 16.1591C79.5665 16.3182 79.4131 16.4375 79.2351 16.517C79.0571 16.5966 78.8506 16.6364 78.6158 16.6364Z"
5701
+ );
5702
+ path2.setAttribute("fill", "black");
5703
+ path2.setAttribute("fill-opacity", "0.5");
5704
+ svg.appendChild(path2);
5705
+ const rect3 = document.createElementNS("http://www.w3.org/2000/svg", "rect");
5706
+ rect3.setAttribute("x", "7");
5707
+ rect3.setAttribute("y", "7");
5708
+ rect3.setAttribute("width", "24");
5709
+ rect3.setAttribute("height", "24");
5710
+ rect3.setAttribute("rx", "3");
5711
+ rect3.setAttribute("fill", "black");
5712
+ svg.appendChild(rect3);
5713
+ const path3 = document.createElementNS("http://www.w3.org/2000/svg", "path");
5714
+ path3.setAttribute("fill-rule", "evenodd");
5715
+ path3.setAttribute("clip-rule", "evenodd");
5716
+ path3.setAttribute(
5717
+ "d",
5718
+ "M22.0455 15H12.2273L15.1364 17.9091V21.9091L22.0455 15Z"
5719
+ );
5720
+ path3.setAttribute("fill", "white");
5721
+ svg.appendChild(path3);
5722
+ const path4 = document.createElementNS("http://www.w3.org/2000/svg", "path");
5723
+ path4.setAttribute("fill-rule", "evenodd");
5724
+ path4.setAttribute("clip-rule", "evenodd");
5725
+ path4.setAttribute(
5726
+ "d",
5727
+ "M16.9546 22.9999H26.7728L23.8637 20.0908V16.0908L16.9546 22.9999Z"
5728
+ );
5729
+ path4.setAttribute("fill", "white");
5730
+ svg.appendChild(path4);
5731
+ link.appendChild(svg);
5732
+ badgeDiv.appendChild(link);
5733
+ const hideButton = document.createElement("button");
5734
+ hideButton.id = "liveblocks-badge-hide-button";
5735
+ hideButton.style.position = "absolute";
5736
+ hideButton.style.top = "0";
5737
+ hideButton.style.right = "0";
5738
+ hideButton.style.border = "none";
5739
+ hideButton.style.padding = "0";
5740
+ hideButton.style.margin = "0";
5741
+ hideButton.style.background = "none";
5742
+ hideButton.style.font = "inherit";
5743
+ hideButton.style.cursor = "pointer";
5744
+ hideButton.style.outline = "none";
5745
+ hideButton.style.setProperty("-webkit-appearance", "none");
5746
+ hideButton.style.setProperty("-moz-appearance", "none");
5747
+ hideButton.style.setProperty("appearance", "none");
5748
+ hideButton.style.opacity = "0";
5749
+ hideButton.onclick = () => {
5750
+ const badge2 = document.getElementById("liveblocks-badge");
5751
+ if (badge2) {
5752
+ badge2.style.display = "none";
5753
+ }
5754
+ };
5755
+ hideButton.onmouseenter = () => {
5756
+ hideButton.style.opacity = "0.5";
5757
+ };
5758
+ hideButton.onmouseleave = () => {
5759
+ hideButton.style.opacity = "0.3";
5760
+ };
5761
+ const hideSvg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
5762
+ hideSvg.setAttribute("width", "18");
5763
+ hideSvg.setAttribute("height", "18");
5764
+ hideSvg.setAttribute("viewBox", "0 0 18 18");
5765
+ hideSvg.setAttribute("fill", "none");
5766
+ const hidePath = document.createElementNS(
5767
+ "http://www.w3.org/2000/svg",
5768
+ "path"
5769
+ );
5770
+ hidePath.setAttribute("d", "M6 6L9 9M12 12L9 9M9 9L12 6M9 9L6 12");
5771
+ hidePath.setAttribute("stroke", "black");
5772
+ hideSvg.appendChild(hidePath);
5773
+ hideButton.appendChild(hideSvg);
5774
+ badgeDiv.appendChild(hideButton);
5775
+ document.body.appendChild(badgeDiv);
5776
+ requestAnimationFrame(() => {
5777
+ requestAnimationFrame(() => {
5778
+ badgeDiv.style.opacity = "1";
5779
+ });
5780
+ });
5781
+ };
5782
+
5618
5783
  // src/lib/position.ts
5619
5784
  var MIN_CODE = 32;
5620
5785
  var MAX_CODE = 126;
@@ -5980,12 +6145,6 @@ var CrdtType = /* @__PURE__ */ ((CrdtType2) => {
5980
6145
  CrdtType2[CrdtType2["REGISTER"] = 3] = "REGISTER";
5981
6146
  return CrdtType2;
5982
6147
  })(CrdtType || {});
5983
- function isRootCrdt(crdt) {
5984
- return crdt.type === 0 /* OBJECT */ && !isChildCrdt(crdt);
5985
- }
5986
- function isChildCrdt(crdt) {
5987
- return crdt.parentId !== void 0 && crdt.parentKey !== void 0;
5988
- }
5989
6148
 
5990
6149
  // src/crdts/LiveRegister.ts
5991
6150
  var LiveRegister = class _LiveRegister extends AbstractCrdt {
@@ -7420,6 +7579,9 @@ var LiveMap = class _LiveMap extends AbstractCrdt {
7420
7579
 
7421
7580
  // src/crdts/LiveObject.ts
7422
7581
  var MAX_LIVE_OBJECT_SIZE = 128 * 1024;
7582
+ function isRootCrdt(id, _) {
7583
+ return id === "root";
7584
+ }
7423
7585
  var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
7424
7586
  #map;
7425
7587
  #propToLastUpdate;
@@ -7437,8 +7599,8 @@ var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
7437
7599
  const parentToChildren = /* @__PURE__ */ new Map();
7438
7600
  let root = null;
7439
7601
  for (const [id, crdt] of items) {
7440
- if (isRootCrdt(crdt)) {
7441
- root = [id, crdt];
7602
+ if (isRootCrdt(id, crdt)) {
7603
+ root = crdt;
7442
7604
  } else {
7443
7605
  const tuple = [id, crdt];
7444
7606
  const children = parentToChildren.get(crdt.parentId);
@@ -7458,7 +7620,7 @@ var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
7458
7620
  static _fromItems(items, pool) {
7459
7621
  const [root, parentToChildren] = _LiveObject.#buildRootAndParentToChildren(items);
7460
7622
  return _LiveObject._deserialize(
7461
- root,
7623
+ ["root", root],
7462
7624
  parentToChildren,
7463
7625
  pool
7464
7626
  );
@@ -9173,10 +9335,14 @@ function createRoom(options, config) {
9173
9335
  context.dynamicSessionInfoSig.set({
9174
9336
  actor: message.actor,
9175
9337
  nonce: message.nonce,
9176
- scopes: message.scopes
9338
+ scopes: message.scopes,
9339
+ meta: message.meta
9177
9340
  });
9178
9341
  context.idFactory = makeIdFactory(message.actor);
9179
9342
  notifySelfChanged();
9343
+ if (_optionalChain([message, 'access', _201 => _201.meta, 'optionalAccess', _202 => _202.showBrand]) === true) {
9344
+ injectBrandBadge(_nullishCoalesce(config.badgeLocation, () => ( "bottom-right")));
9345
+ }
9180
9346
  for (const connectionId of context.others.connectionIds()) {
9181
9347
  const user = message.users[connectionId];
9182
9348
  if (user === void 0) {
@@ -9450,7 +9616,7 @@ function createRoom(options, config) {
9450
9616
  const unacknowledgedOps = new Map(context.unacknowledgedOps);
9451
9617
  createOrUpdateRootFromMessage(message);
9452
9618
  applyAndSendOps(unacknowledgedOps);
9453
- _optionalChain([_resolveStoragePromise, 'optionalCall', _201 => _201()]);
9619
+ _optionalChain([_resolveStoragePromise, 'optionalCall', _203 => _203()]);
9454
9620
  notifyStorageStatus();
9455
9621
  eventHub.storageDidLoad.notify();
9456
9622
  }
@@ -9671,8 +9837,8 @@ function createRoom(options, config) {
9671
9837
  async function getThreads(options2) {
9672
9838
  return httpClient.getThreads({
9673
9839
  roomId,
9674
- query: _optionalChain([options2, 'optionalAccess', _202 => _202.query]),
9675
- cursor: _optionalChain([options2, 'optionalAccess', _203 => _203.cursor])
9840
+ query: _optionalChain([options2, 'optionalAccess', _204 => _204.query]),
9841
+ cursor: _optionalChain([options2, 'optionalAccess', _205 => _205.cursor])
9676
9842
  });
9677
9843
  }
9678
9844
  async function getThread(threadId) {
@@ -9779,7 +9945,7 @@ function createRoom(options, config) {
9779
9945
  function getSubscriptionSettings(options2) {
9780
9946
  return httpClient.getSubscriptionSettings({
9781
9947
  roomId,
9782
- signal: _optionalChain([options2, 'optionalAccess', _204 => _204.signal])
9948
+ signal: _optionalChain([options2, 'optionalAccess', _206 => _206.signal])
9783
9949
  });
9784
9950
  }
9785
9951
  function updateSubscriptionSettings(settings) {
@@ -9801,7 +9967,7 @@ function createRoom(options, config) {
9801
9967
  {
9802
9968
  [kInternal]: {
9803
9969
  get presenceBuffer() {
9804
- return deepClone(_nullishCoalesce(_optionalChain([context, 'access', _205 => _205.buffer, 'access', _206 => _206.presenceUpdates, 'optionalAccess', _207 => _207.data]), () => ( null)));
9970
+ return deepClone(_nullishCoalesce(_optionalChain([context, 'access', _207 => _207.buffer, 'access', _208 => _208.presenceUpdates, 'optionalAccess', _209 => _209.data]), () => ( null)));
9805
9971
  },
9806
9972
  // prettier-ignore
9807
9973
  get undoStack() {
@@ -9816,9 +9982,9 @@ function createRoom(options, config) {
9816
9982
  return context.yjsProvider;
9817
9983
  },
9818
9984
  setYjsProvider(newProvider) {
9819
- _optionalChain([context, 'access', _208 => _208.yjsProvider, 'optionalAccess', _209 => _209.off, 'call', _210 => _210("status", yjsStatusDidChange)]);
9985
+ _optionalChain([context, 'access', _210 => _210.yjsProvider, 'optionalAccess', _211 => _211.off, 'call', _212 => _212("status", yjsStatusDidChange)]);
9820
9986
  context.yjsProvider = newProvider;
9821
- _optionalChain([newProvider, 'optionalAccess', _211 => _211.on, 'call', _212 => _212("status", yjsStatusDidChange)]);
9987
+ _optionalChain([newProvider, 'optionalAccess', _213 => _213.on, 'call', _214 => _214("status", yjsStatusDidChange)]);
9822
9988
  context.yjsProviderDidChange.notify();
9823
9989
  },
9824
9990
  yjsProviderDidChange: context.yjsProviderDidChange.observable,
@@ -9864,7 +10030,7 @@ function createRoom(options, config) {
9864
10030
  source.dispose();
9865
10031
  }
9866
10032
  eventHub.roomWillDestroy.notify();
9867
- _optionalChain([context, 'access', _213 => _213.yjsProvider, 'optionalAccess', _214 => _214.off, 'call', _215 => _215("status", yjsStatusDidChange)]);
10033
+ _optionalChain([context, 'access', _215 => _215.yjsProvider, 'optionalAccess', _216 => _216.off, 'call', _217 => _217("status", yjsStatusDidChange)]);
9868
10034
  syncSourceForStorage.destroy();
9869
10035
  syncSourceForYjs.destroy();
9870
10036
  uninstallBgTabSpy();
@@ -10014,7 +10180,7 @@ function makeClassicSubscribeFn(roomId, events, errorEvents) {
10014
10180
  }
10015
10181
  if (isLiveNode(first)) {
10016
10182
  const node = first;
10017
- if (_optionalChain([options, 'optionalAccess', _216 => _216.isDeep])) {
10183
+ if (_optionalChain([options, 'optionalAccess', _218 => _218.isDeep])) {
10018
10184
  const storageCallback = second;
10019
10185
  return subscribeToLiveStructureDeeply(node, storageCallback);
10020
10186
  } else {
@@ -10094,8 +10260,8 @@ function createClient(options) {
10094
10260
  const userId = token.k === "sec-legacy" /* SECRET_LEGACY */ ? token.id : token.uid;
10095
10261
  currentUserId.set(() => userId);
10096
10262
  });
10097
- const fetchPolyfill = _optionalChain([clientOptions, 'access', _217 => _217.polyfills, 'optionalAccess', _218 => _218.fetch]) || /* istanbul ignore next */
10098
- _optionalChain([globalThis, 'access', _219 => _219.fetch, 'optionalAccess', _220 => _220.bind, 'call', _221 => _221(globalThis)]);
10263
+ const fetchPolyfill = _optionalChain([clientOptions, 'access', _219 => _219.polyfills, 'optionalAccess', _220 => _220.fetch]) || /* istanbul ignore next */
10264
+ _optionalChain([globalThis, 'access', _221 => _221.fetch, 'optionalAccess', _222 => _222.bind, 'call', _223 => _223(globalThis)]);
10099
10265
  const httpClient = createApiClient({
10100
10266
  baseUrl,
10101
10267
  fetchPolyfill,
@@ -10113,7 +10279,7 @@ function createClient(options) {
10113
10279
  delegates: {
10114
10280
  createSocket: makeCreateSocketDelegateForAi(
10115
10281
  baseUrl,
10116
- _optionalChain([clientOptions, 'access', _222 => _222.polyfills, 'optionalAccess', _223 => _223.WebSocket])
10282
+ _optionalChain([clientOptions, 'access', _224 => _224.polyfills, 'optionalAccess', _225 => _225.WebSocket])
10117
10283
  ),
10118
10284
  authenticate: async () => {
10119
10285
  const resp = await authManager.getAuthValue({
@@ -10175,7 +10341,7 @@ function createClient(options) {
10175
10341
  createSocket: makeCreateSocketDelegateForRoom(
10176
10342
  roomId,
10177
10343
  baseUrl,
10178
- _optionalChain([clientOptions, 'access', _224 => _224.polyfills, 'optionalAccess', _225 => _225.WebSocket])
10344
+ _optionalChain([clientOptions, 'access', _226 => _226.polyfills, 'optionalAccess', _227 => _227.WebSocket])
10179
10345
  ),
10180
10346
  authenticate: makeAuthDelegateForRoom(roomId, authManager)
10181
10347
  })),
@@ -10185,7 +10351,8 @@ function createClient(options) {
10185
10351
  largeMessageStrategy: clientOptions.largeMessageStrategy,
10186
10352
  unstable_streamData: !!clientOptions.unstable_streamData,
10187
10353
  roomHttpClient: httpClient,
10188
- createSyncSource
10354
+ createSyncSource,
10355
+ badgeLocation: _nullishCoalesce(clientOptions.badgeLocation, () => ( "bottom-right"))
10189
10356
  }
10190
10357
  );
10191
10358
  const newRoomDetails = {
@@ -10198,7 +10365,7 @@ function createClient(options) {
10198
10365
  const shouldConnect = _nullishCoalesce(options2.autoConnect, () => ( true));
10199
10366
  if (shouldConnect) {
10200
10367
  if (typeof atob === "undefined") {
10201
- if (_optionalChain([clientOptions, 'access', _226 => _226.polyfills, 'optionalAccess', _227 => _227.atob]) === void 0) {
10368
+ if (_optionalChain([clientOptions, 'access', _228 => _228.polyfills, 'optionalAccess', _229 => _229.atob]) === void 0) {
10202
10369
  throw new Error(
10203
10370
  "You need to polyfill atob to use the client in your environment. Please follow the instructions at https://liveblocks.io/docs/errors/liveblocks-client/atob-polyfill"
10204
10371
  );
@@ -10210,7 +10377,7 @@ function createClient(options) {
10210
10377
  return leaseRoom(newRoomDetails);
10211
10378
  }
10212
10379
  function getRoom(roomId) {
10213
- const room = _optionalChain([roomsById, 'access', _228 => _228.get, 'call', _229 => _229(roomId), 'optionalAccess', _230 => _230.room]);
10380
+ const room = _optionalChain([roomsById, 'access', _230 => _230.get, 'call', _231 => _231(roomId), 'optionalAccess', _232 => _232.room]);
10214
10381
  return room ? room : null;
10215
10382
  }
10216
10383
  function logout() {
@@ -10226,7 +10393,7 @@ function createClient(options) {
10226
10393
  const batchedResolveUsers = new Batch(
10227
10394
  async (batchedUserIds) => {
10228
10395
  const userIds = batchedUserIds.flat();
10229
- const users = await _optionalChain([resolveUsers, 'optionalCall', _231 => _231({ userIds })]);
10396
+ const users = await _optionalChain([resolveUsers, 'optionalCall', _233 => _233({ userIds })]);
10230
10397
  warnOnceIf(
10231
10398
  !resolveUsers,
10232
10399
  "Set the resolveUsers option in createClient to specify user info."
@@ -10243,7 +10410,7 @@ function createClient(options) {
10243
10410
  const batchedResolveRoomsInfo = new Batch(
10244
10411
  async (batchedRoomIds) => {
10245
10412
  const roomIds = batchedRoomIds.flat();
10246
- const roomsInfo = await _optionalChain([resolveRoomsInfo, 'optionalCall', _232 => _232({ roomIds })]);
10413
+ const roomsInfo = await _optionalChain([resolveRoomsInfo, 'optionalCall', _234 => _234({ roomIds })]);
10247
10414
  warnOnceIf(
10248
10415
  !resolveRoomsInfo,
10249
10416
  "Set the resolveRoomsInfo option in createClient to specify room info."
@@ -10260,7 +10427,7 @@ function createClient(options) {
10260
10427
  const batchedResolveGroupsInfo = new Batch(
10261
10428
  async (batchedGroupIds) => {
10262
10429
  const groupIds = batchedGroupIds.flat();
10263
- const groupsInfo = await _optionalChain([resolveGroupsInfo, 'optionalCall', _233 => _233({ groupIds })]);
10430
+ const groupsInfo = await _optionalChain([resolveGroupsInfo, 'optionalCall', _235 => _235({ groupIds })]);
10264
10431
  warnOnceIf(
10265
10432
  !resolveGroupsInfo,
10266
10433
  "Set the resolveGroupsInfo option in createClient to specify group info."
@@ -10316,7 +10483,7 @@ function createClient(options) {
10316
10483
  }
10317
10484
  };
10318
10485
  const win = typeof window !== "undefined" ? window : void 0;
10319
- _optionalChain([win, 'optionalAccess', _234 => _234.addEventListener, 'call', _235 => _235("beforeunload", maybePreventClose)]);
10486
+ _optionalChain([win, 'optionalAccess', _236 => _236.addEventListener, 'call', _237 => _237("beforeunload", maybePreventClose)]);
10320
10487
  }
10321
10488
  async function getNotificationSettings(options2) {
10322
10489
  const plainSettings = await httpClient.getNotificationSettings(options2);
@@ -10443,7 +10610,7 @@ var commentBodyElementsTypes = {
10443
10610
  mention: "inline"
10444
10611
  };
10445
10612
  function traverseCommentBody(body, elementOrVisitor, possiblyVisitor) {
10446
- if (!body || !_optionalChain([body, 'optionalAccess', _236 => _236.content])) {
10613
+ if (!body || !_optionalChain([body, 'optionalAccess', _238 => _238.content])) {
10447
10614
  return;
10448
10615
  }
10449
10616
  const element = typeof elementOrVisitor === "string" ? elementOrVisitor : void 0;
@@ -10453,13 +10620,13 @@ function traverseCommentBody(body, elementOrVisitor, possiblyVisitor) {
10453
10620
  for (const block of body.content) {
10454
10621
  if (type === "all" || type === "block") {
10455
10622
  if (guard(block)) {
10456
- _optionalChain([visitor, 'optionalCall', _237 => _237(block)]);
10623
+ _optionalChain([visitor, 'optionalCall', _239 => _239(block)]);
10457
10624
  }
10458
10625
  }
10459
10626
  if (type === "all" || type === "inline") {
10460
10627
  for (const inline of block.children) {
10461
10628
  if (guard(inline)) {
10462
- _optionalChain([visitor, 'optionalCall', _238 => _238(inline)]);
10629
+ _optionalChain([visitor, 'optionalCall', _240 => _240(inline)]);
10463
10630
  }
10464
10631
  }
10465
10632
  }
@@ -10629,7 +10796,7 @@ var stringifyCommentBodyPlainElements = {
10629
10796
  text: ({ element }) => element.text,
10630
10797
  link: ({ element }) => _nullishCoalesce(element.text, () => ( element.url)),
10631
10798
  mention: ({ element, user, group }) => {
10632
- return `@${_nullishCoalesce(_nullishCoalesce(_optionalChain([user, 'optionalAccess', _239 => _239.name]), () => ( _optionalChain([group, 'optionalAccess', _240 => _240.name]))), () => ( element.id))}`;
10799
+ return `@${_nullishCoalesce(_nullishCoalesce(_optionalChain([user, 'optionalAccess', _241 => _241.name]), () => ( _optionalChain([group, 'optionalAccess', _242 => _242.name]))), () => ( element.id))}`;
10633
10800
  }
10634
10801
  };
10635
10802
  var stringifyCommentBodyHtmlElements = {
@@ -10659,7 +10826,7 @@ var stringifyCommentBodyHtmlElements = {
10659
10826
  return html`<a href="${href}" target="_blank" rel="noopener noreferrer">${element.text ? html`${element.text}` : element.url}</a>`;
10660
10827
  },
10661
10828
  mention: ({ element, user, group }) => {
10662
- return html`<span data-mention>@${_optionalChain([user, 'optionalAccess', _241 => _241.name]) ? html`${_optionalChain([user, 'optionalAccess', _242 => _242.name])}` : _optionalChain([group, 'optionalAccess', _243 => _243.name]) ? html`${_optionalChain([group, 'optionalAccess', _244 => _244.name])}` : element.id}</span>`;
10829
+ return html`<span data-mention>@${_optionalChain([user, 'optionalAccess', _243 => _243.name]) ? html`${_optionalChain([user, 'optionalAccess', _244 => _244.name])}` : _optionalChain([group, 'optionalAccess', _245 => _245.name]) ? html`${_optionalChain([group, 'optionalAccess', _246 => _246.name])}` : element.id}</span>`;
10663
10830
  }
10664
10831
  };
10665
10832
  var stringifyCommentBodyMarkdownElements = {
@@ -10689,20 +10856,20 @@ var stringifyCommentBodyMarkdownElements = {
10689
10856
  return markdown`[${_nullishCoalesce(element.text, () => ( element.url))}](${href})`;
10690
10857
  },
10691
10858
  mention: ({ element, user, group }) => {
10692
- return markdown`@${_nullishCoalesce(_nullishCoalesce(_optionalChain([user, 'optionalAccess', _245 => _245.name]), () => ( _optionalChain([group, 'optionalAccess', _246 => _246.name]))), () => ( element.id))}`;
10859
+ return markdown`@${_nullishCoalesce(_nullishCoalesce(_optionalChain([user, 'optionalAccess', _247 => _247.name]), () => ( _optionalChain([group, 'optionalAccess', _248 => _248.name]))), () => ( element.id))}`;
10693
10860
  }
10694
10861
  };
10695
10862
  async function stringifyCommentBody(body, options) {
10696
- const format = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _247 => _247.format]), () => ( "plain"));
10697
- const separator = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _248 => _248.separator]), () => ( (format === "markdown" ? "\n\n" : "\n")));
10863
+ const format = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _249 => _249.format]), () => ( "plain"));
10864
+ const separator = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _250 => _250.separator]), () => ( (format === "markdown" ? "\n\n" : "\n")));
10698
10865
  const elements = {
10699
10866
  ...format === "html" ? stringifyCommentBodyHtmlElements : format === "markdown" ? stringifyCommentBodyMarkdownElements : stringifyCommentBodyPlainElements,
10700
- ..._optionalChain([options, 'optionalAccess', _249 => _249.elements])
10867
+ ..._optionalChain([options, 'optionalAccess', _251 => _251.elements])
10701
10868
  };
10702
10869
  const { users: resolvedUsers, groups: resolvedGroupsInfo } = await resolveMentionsInCommentBody(
10703
10870
  body,
10704
- _optionalChain([options, 'optionalAccess', _250 => _250.resolveUsers]),
10705
- _optionalChain([options, 'optionalAccess', _251 => _251.resolveGroupsInfo])
10871
+ _optionalChain([options, 'optionalAccess', _252 => _252.resolveUsers]),
10872
+ _optionalChain([options, 'optionalAccess', _253 => _253.resolveGroupsInfo])
10706
10873
  );
10707
10874
  const blocks = body.content.flatMap((block, blockIndex) => {
10708
10875
  switch (block.type) {
@@ -10989,12 +11156,12 @@ function legacy_patchImmutableNode(state, path, update) {
10989
11156
  }
10990
11157
  const newState = Object.assign({}, state);
10991
11158
  for (const key in update.updates) {
10992
- if (_optionalChain([update, 'access', _252 => _252.updates, 'access', _253 => _253[key], 'optionalAccess', _254 => _254.type]) === "update") {
11159
+ if (_optionalChain([update, 'access', _254 => _254.updates, 'access', _255 => _255[key], 'optionalAccess', _256 => _256.type]) === "update") {
10993
11160
  const val = update.node.get(key);
10994
11161
  if (val !== void 0) {
10995
11162
  newState[key] = lsonToJson(val);
10996
11163
  }
10997
- } else if (_optionalChain([update, 'access', _255 => _255.updates, 'access', _256 => _256[key], 'optionalAccess', _257 => _257.type]) === "delete") {
11164
+ } else if (_optionalChain([update, 'access', _257 => _257.updates, 'access', _258 => _258[key], 'optionalAccess', _259 => _259.type]) === "delete") {
10998
11165
  delete newState[key];
10999
11166
  }
11000
11167
  }
@@ -11055,12 +11222,12 @@ function legacy_patchImmutableNode(state, path, update) {
11055
11222
  }
11056
11223
  const newState = Object.assign({}, state);
11057
11224
  for (const key in update.updates) {
11058
- if (_optionalChain([update, 'access', _258 => _258.updates, 'access', _259 => _259[key], 'optionalAccess', _260 => _260.type]) === "update") {
11225
+ if (_optionalChain([update, 'access', _260 => _260.updates, 'access', _261 => _261[key], 'optionalAccess', _262 => _262.type]) === "update") {
11059
11226
  const value = update.node.get(key);
11060
11227
  if (value !== void 0) {
11061
11228
  newState[key] = lsonToJson(value);
11062
11229
  }
11063
- } else if (_optionalChain([update, 'access', _261 => _261.updates, 'access', _262 => _262[key], 'optionalAccess', _263 => _263.type]) === "delete") {
11230
+ } else if (_optionalChain([update, 'access', _263 => _263.updates, 'access', _264 => _264[key], 'optionalAccess', _265 => _265.type]) === "delete") {
11064
11231
  delete newState[key];
11065
11232
  }
11066
11233
  }
@@ -11140,9 +11307,9 @@ function makePoller(callback, intervalMs, options) {
11140
11307
  const startTime = performance.now();
11141
11308
  const doc = typeof document !== "undefined" ? document : void 0;
11142
11309
  const win = typeof window !== "undefined" ? window : void 0;
11143
- const maxStaleTimeMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _264 => _264.maxStaleTimeMs]), () => ( Number.POSITIVE_INFINITY));
11310
+ const maxStaleTimeMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _266 => _266.maxStaleTimeMs]), () => ( Number.POSITIVE_INFINITY));
11144
11311
  const context = {
11145
- inForeground: _optionalChain([doc, 'optionalAccess', _265 => _265.visibilityState]) !== "hidden",
11312
+ inForeground: _optionalChain([doc, 'optionalAccess', _267 => _267.visibilityState]) !== "hidden",
11146
11313
  lastSuccessfulPollAt: startTime,
11147
11314
  count: 0,
11148
11315
  backoff: 0
@@ -11223,11 +11390,11 @@ function makePoller(callback, intervalMs, options) {
11223
11390
  pollNowIfStale();
11224
11391
  }
11225
11392
  function onVisibilityChange() {
11226
- setInForeground(_optionalChain([doc, 'optionalAccess', _266 => _266.visibilityState]) !== "hidden");
11393
+ setInForeground(_optionalChain([doc, 'optionalAccess', _268 => _268.visibilityState]) !== "hidden");
11227
11394
  }
11228
- _optionalChain([doc, 'optionalAccess', _267 => _267.addEventListener, 'call', _268 => _268("visibilitychange", onVisibilityChange)]);
11229
- _optionalChain([win, 'optionalAccess', _269 => _269.addEventListener, 'call', _270 => _270("online", onVisibilityChange)]);
11230
- _optionalChain([win, 'optionalAccess', _271 => _271.addEventListener, 'call', _272 => _272("focus", pollNowIfStale)]);
11395
+ _optionalChain([doc, 'optionalAccess', _269 => _269.addEventListener, 'call', _270 => _270("visibilitychange", onVisibilityChange)]);
11396
+ _optionalChain([win, 'optionalAccess', _271 => _271.addEventListener, 'call', _272 => _272("online", onVisibilityChange)]);
11397
+ _optionalChain([win, 'optionalAccess', _273 => _273.addEventListener, 'call', _274 => _274("focus", pollNowIfStale)]);
11231
11398
  fsm.start();
11232
11399
  return {
11233
11400
  inc,
@@ -11360,7 +11527,5 @@ detectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);
11360
11527
 
11361
11528
 
11362
11529
 
11363
-
11364
-
11365
- exports.ClientMsgCode = ClientMsgCode; exports.CrdtType = CrdtType; exports.DefaultMap = DefaultMap; exports.Deque = Deque; exports.DerivedSignal = DerivedSignal; exports.HttpError = HttpError; exports.LiveList = LiveList; exports.LiveMap = LiveMap; exports.LiveObject = LiveObject; exports.LiveblocksError = LiveblocksError; exports.MENTION_CHARACTER = MENTION_CHARACTER; exports.MutableSignal = MutableSignal; exports.OpCode = OpCode; exports.Permission = Permission; exports.Promise_withResolvers = Promise_withResolvers; exports.ServerMsgCode = ServerMsgCode; exports.Signal = Signal; exports.SortedList = SortedList; exports.TextEditorType = TextEditorType; exports.WebsocketCloseCodes = WebsocketCloseCodes; exports.ackOp = ackOp; exports.asPos = asPos; exports.assert = assert; exports.assertNever = assertNever; exports.autoRetry = autoRetry; exports.b64decode = b64decode; exports.batch = batch; exports.checkBounds = checkBounds; exports.chunk = chunk; exports.cloneLson = cloneLson; exports.compactObject = compactObject; exports.console = fancy_console_exports; exports.convertToCommentData = convertToCommentData; exports.convertToCommentUserReaction = convertToCommentUserReaction; exports.convertToGroupData = convertToGroupData; exports.convertToInboxNotificationData = convertToInboxNotificationData; exports.convertToSubscriptionData = convertToSubscriptionData; exports.convertToThreadData = convertToThreadData; exports.convertToUserSubscriptionData = convertToUserSubscriptionData; exports.createClient = createClient; exports.createCommentAttachmentId = createCommentAttachmentId; exports.createCommentId = createCommentId; exports.createInboxNotificationId = createInboxNotificationId; exports.createManagedPool = createManagedPool; exports.createNotificationSettings = createNotificationSettings; exports.createThreadId = createThreadId; exports.defineAiTool = defineAiTool; exports.deprecate = deprecate; exports.deprecateIf = deprecateIf; exports.detectDupes = detectDupes; exports.entries = entries; exports.errorIf = errorIf; exports.findLastIndex = findLastIndex; exports.freeze = freeze; exports.generateUrl = generateUrl; exports.getMentionsFromCommentBody = getMentionsFromCommentBody; exports.getSubscriptionKey = getSubscriptionKey; exports.html = html; exports.htmlSafe = htmlSafe; exports.isChildCrdt = isChildCrdt; exports.isCommentBodyLink = isCommentBodyLink; exports.isCommentBodyMention = isCommentBodyMention; exports.isCommentBodyText = isCommentBodyText; exports.isJsonArray = isJsonArray; exports.isJsonObject = isJsonObject; exports.isJsonScalar = isJsonScalar; exports.isLiveNode = isLiveNode; exports.isNotificationChannelEnabled = isNotificationChannelEnabled; exports.isNumberOperator = isNumberOperator; exports.isPlainObject = isPlainObject; exports.isRootCrdt = isRootCrdt; exports.isStartsWithOperator = isStartsWithOperator; exports.isUrl = isUrl; exports.kInternal = kInternal; exports.keys = keys; exports.legacy_patchImmutableObject = legacy_patchImmutableObject; exports.lsonToJson = lsonToJson; exports.makeAbortController = makeAbortController; exports.makeEventSource = makeEventSource; exports.makePoller = makePoller; exports.makePosition = makePosition; exports.mapValues = mapValues; exports.memoizeOnSuccess = memoizeOnSuccess; exports.nanoid = nanoid; exports.nn = nn; exports.objectToQuery = objectToQuery; exports.patchLiveObjectKey = patchLiveObjectKey; exports.patchNotificationSettings = patchNotificationSettings; exports.raise = raise; exports.resolveMentionsInCommentBody = resolveMentionsInCommentBody; exports.sanitizeUrl = sanitizeUrl; exports.shallow = shallow; exports.shallow2 = shallow2; exports.stableStringify = stableStringify; exports.stringifyCommentBody = stringifyCommentBody; exports.throwUsageError = throwUsageError; exports.toPlainLson = toPlainLson; exports.tryParseJson = tryParseJson; exports.url = url; exports.urljoin = urljoin; exports.wait = wait; exports.warnOnce = warnOnce; exports.warnOnceIf = warnOnceIf; exports.withTimeout = withTimeout;
11530
+ exports.ClientMsgCode = ClientMsgCode; exports.CrdtType = CrdtType; exports.DefaultMap = DefaultMap; exports.Deque = Deque; exports.DerivedSignal = DerivedSignal; exports.HttpError = HttpError; exports.LiveList = LiveList; exports.LiveMap = LiveMap; exports.LiveObject = LiveObject; exports.LiveblocksError = LiveblocksError; exports.MENTION_CHARACTER = MENTION_CHARACTER; exports.MutableSignal = MutableSignal; exports.OpCode = OpCode; exports.Permission = Permission; exports.Promise_withResolvers = Promise_withResolvers; exports.ServerMsgCode = ServerMsgCode; exports.Signal = Signal; exports.SortedList = SortedList; exports.TextEditorType = TextEditorType; exports.WebsocketCloseCodes = WebsocketCloseCodes; exports.ackOp = ackOp; exports.asPos = asPos; exports.assert = assert; exports.assertNever = assertNever; exports.autoRetry = autoRetry; exports.b64decode = b64decode; exports.batch = batch; exports.checkBounds = checkBounds; exports.chunk = chunk; exports.cloneLson = cloneLson; exports.compactObject = compactObject; exports.console = fancy_console_exports; exports.convertToCommentData = convertToCommentData; exports.convertToCommentUserReaction = convertToCommentUserReaction; exports.convertToGroupData = convertToGroupData; exports.convertToInboxNotificationData = convertToInboxNotificationData; exports.convertToSubscriptionData = convertToSubscriptionData; exports.convertToThreadData = convertToThreadData; exports.convertToUserSubscriptionData = convertToUserSubscriptionData; exports.createClient = createClient; exports.createCommentAttachmentId = createCommentAttachmentId; exports.createCommentId = createCommentId; exports.createInboxNotificationId = createInboxNotificationId; exports.createManagedPool = createManagedPool; exports.createNotificationSettings = createNotificationSettings; exports.createThreadId = createThreadId; exports.defineAiTool = defineAiTool; exports.deprecate = deprecate; exports.deprecateIf = deprecateIf; exports.detectDupes = detectDupes; exports.entries = entries; exports.errorIf = errorIf; exports.findLastIndex = findLastIndex; exports.freeze = freeze; exports.generateUrl = generateUrl; exports.getMentionsFromCommentBody = getMentionsFromCommentBody; exports.getSubscriptionKey = getSubscriptionKey; exports.html = html; exports.htmlSafe = htmlSafe; exports.isCommentBodyLink = isCommentBodyLink; exports.isCommentBodyMention = isCommentBodyMention; exports.isCommentBodyText = isCommentBodyText; exports.isJsonArray = isJsonArray; exports.isJsonObject = isJsonObject; exports.isJsonScalar = isJsonScalar; exports.isLiveNode = isLiveNode; exports.isNotificationChannelEnabled = isNotificationChannelEnabled; exports.isNumberOperator = isNumberOperator; exports.isPlainObject = isPlainObject; exports.isStartsWithOperator = isStartsWithOperator; exports.isUrl = isUrl; exports.kInternal = kInternal; exports.keys = keys; exports.legacy_patchImmutableObject = legacy_patchImmutableObject; exports.lsonToJson = lsonToJson; exports.makeAbortController = makeAbortController; exports.makeEventSource = makeEventSource; exports.makePoller = makePoller; exports.makePosition = makePosition; exports.mapValues = mapValues; exports.memoizeOnSuccess = memoizeOnSuccess; exports.nanoid = nanoid; exports.nn = nn; exports.objectToQuery = objectToQuery; exports.patchLiveObjectKey = patchLiveObjectKey; exports.patchNotificationSettings = patchNotificationSettings; exports.raise = raise; exports.resolveMentionsInCommentBody = resolveMentionsInCommentBody; exports.sanitizeUrl = sanitizeUrl; exports.shallow = shallow; exports.shallow2 = shallow2; exports.stableStringify = stableStringify; exports.stringifyCommentBody = stringifyCommentBody; exports.throwUsageError = throwUsageError; exports.toPlainLson = toPlainLson; exports.tryParseJson = tryParseJson; exports.url = url; exports.urljoin = urljoin; exports.wait = wait; exports.warnOnce = warnOnce; exports.warnOnceIf = warnOnceIf; exports.withTimeout = withTimeout;
11366
11531
  //# sourceMappingURL=index.cjs.map