@celljs/ta-nearby 4.16.0 → 4.18.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/web/index.js CHANGED
@@ -41,7 +41,7 @@ var TaLanguageUtil;
41
41
  var EN = {
42
42
  title: "Nearby",
43
43
  offTitle: "See who is around",
44
- offHint: "Turned on, the Ta around you on the same network that turned it on too show here, and Ta can make a room of them, hand them work or ask their doubles.",
44
+ offHint: "Turned on, the Ta around you on the same network that turned it on too show here, and Ta can make a group chat of them, hand them work or ask their doubles.",
45
45
  hour: "For an hour",
46
46
  today: "Today",
47
47
  always: "Until I turn it off",
@@ -55,19 +55,19 @@ var EN = {
55
55
  nobodyHint: "Those with you open Discover → Nearby in their Ta and turn it on too.",
56
56
  friend: "Friend",
57
57
  someone: "A user of Ta",
58
- makeRoom: "Make a room of {n}",
59
- makeRoomAll: "Make a room together",
60
- roomTitle: "Name of the room",
58
+ makeRoom: "Make a group chat of {n}",
59
+ makeRoomAll: "Make a group chat together",
60
+ roomTitle: "Name of the group chat",
61
61
  defaultRoom: "Nearby · {time}",
62
62
  made: "Invited {names}: each comes in once they tap Join.",
63
63
  missed: "Could not reach {names}.",
64
- sayIt: "Or tell Ta: “make a room and send today’s notes to those nearby”.",
64
+ sayIt: "Or tell Ta: “make a group chat and send today’s notes to those nearby”.",
65
65
  youAre: "Others see you as",
66
66
  hideName: "Hide my name",
67
67
  showName: "Show my name",
68
68
  invites: "Invitations",
69
69
  invited: "{name} invites you into “{title}”",
70
- inviteNote: "Nearby, on your network. Once in, you see what is said and shared in the room, and they see what you say there.",
70
+ inviteNote: "Nearby, on your network. Once in, you see what is said and shared in the group chat, and they see what you say there.",
71
71
  inviteStranger: "The name is only what they say: join if you know who it is.",
72
72
  join: "Join",
73
73
  notNow: "Not now",
@@ -97,7 +97,7 @@ var EN = {
97
97
  showAsk: "Ask me",
98
98
  showAuto: "At once",
99
99
  settingsWork: "Those nearby may ask my Ta to work",
100
- settingsWorkHint: "They hand it tasks in a room; working in a folder still needs your permission each time.",
100
+ settingsWorkHint: "They hand it tasks in a group chat; working in a folder still needs your permission each time.",
101
101
  settingsMeet: "Open to meet people nearby",
102
102
  settingsMeetHint: "Your Ta and theirs compare cards; Ta proposes to say hello only for a reason, 3 a day at most. Names go only once both say yes.",
103
103
  card: "Your card",
@@ -125,7 +125,7 @@ var EN = {
125
125
  var ZH = {
126
126
  title: "附近",
127
127
  offTitle: "看看身边有谁",
128
- offHint: "打开后,同一网络里也打开了附近的 Ta 会出现在这里;Ta 能和他们一起建房间、派任务、问他们的分身。",
128
+ offHint: "打开后,同一网络里也打开了附近的 Ta 会出现在这里;Ta 能和他们一起建群聊、派任务、问他们的分身。",
129
129
  hour: "1 小时",
130
130
  today: "今天",
131
131
  always: "一直,直到我关掉",
@@ -139,19 +139,19 @@ var ZH = {
139
139
  nobodyHint: "让身边的人在自己的 Ta 里打开 发现 → 附近。",
140
140
  friend: "好友",
141
141
  someone: "一位 Ta 用户",
142
- makeRoom: "和这 {n} 位建房间",
143
- makeRoomAll: "一起建个房间",
144
- roomTitle: "房间名",
142
+ makeRoom: "和这 {n} 位建群聊",
143
+ makeRoomAll: "一起建个群聊",
144
+ roomTitle: "群聊名",
145
145
  defaultRoom: "附近 · {time}",
146
146
  made: "已邀请 {names},他们点“加入”后就进来。",
147
147
  missed: "没联系上 {names}。",
148
- sayIt: "也可以直接对 Ta 说:“建个房间,把今天的纪要发给附近的人”。",
148
+ sayIt: "也可以直接对 Ta 说:“建个群聊,把今天的纪要发给附近的人”。",
149
149
  youAre: "别人看到的你",
150
150
  hideName: "不显示名字",
151
151
  showName: "显示名字",
152
152
  invites: "邀请",
153
- invited: "{name} 邀请你进房间「{title}」",
154
- inviteNote: "在你附近、同一网络里。进去后能看到房间里说的和放的东西,他们也能看到你在那里说的话。",
153
+ invited: "{name} 邀请你进群聊「{title}」",
154
+ inviteNote: "在你附近、同一网络里。进去后能看到群里说的和放的东西,他们也能看到你在那里说的话。",
155
155
  inviteStranger: "名字是对方自称的,认识再加入。",
156
156
  join: "加入",
157
157
  notNow: "不了",
@@ -181,7 +181,7 @@ var ZH = {
181
181
  showAsk: "先问我",
182
182
  showAuto: "直接展示",
183
183
  settingsWork: "附近的人可以请我的 Ta 做事",
184
- settingsWorkHint: "对方在房间里把任务交给你的分身;要在目录里做事,每次仍由你授权。",
184
+ settingsWorkHint: "对方在群里把任务交给你的分身;要在目录里做事,每次仍由你授权。",
185
185
  settingsMeet: "愿意认识附近的人",
186
186
  settingsMeetHint: "你和对方的 Ta 先比对名片,有具体理由才提议你打招呼,每天最多 3 次;双方都同意后才互相知道名字。",
187
187
  card: "我的名片",
@@ -209,7 +209,7 @@ var ZH = {
209
209
  var ZH_TW = {
210
210
  title: "附近",
211
211
  offTitle: "看看身邊有誰",
212
- offHint: "開啟後,同一網路裡也打開了附近的 Ta 會出現在這裡;Ta 能和他們一起建房間、派任務、問他們的分身。",
212
+ offHint: "開啟後,同一網路裡也打開了附近的 Ta 會出現在這裡;Ta 能和他們一起建群聊、派任務、問他們的分身。",
213
213
  hour: "1 小時",
214
214
  today: "今天",
215
215
  always: "一直,直到我關掉",
@@ -223,19 +223,19 @@ var ZH_TW = {
223
223
  nobodyHint: "讓身邊的人在自己的 Ta 裡開啟 發現 → 附近。",
224
224
  friend: "好友",
225
225
  someone: "一位 Ta 使用者",
226
- makeRoom: "和這 {n} 位建房間",
227
- makeRoomAll: "一起建個房間",
228
- roomTitle: "房間名",
226
+ makeRoom: "和這 {n} 位建群聊",
227
+ makeRoomAll: "一起建個群聊",
228
+ roomTitle: "群聊名",
229
229
  defaultRoom: "附近 · {time}",
230
230
  made: "已邀請 {names},他們點「加入」後就進來。",
231
231
  missed: "沒聯絡上 {names}。",
232
- sayIt: "也可以直接對 Ta 說:「建個房間,把今天的紀要發給附近的人」。",
232
+ sayIt: "也可以直接對 Ta 說:「建個群聊,把今天的紀要發給附近的人」。",
233
233
  youAre: "別人看到的你",
234
234
  hideName: "不顯示名字",
235
235
  showName: "顯示名字",
236
236
  invites: "邀請",
237
- invited: "{name} 邀請你進房間「{title}」",
238
- inviteNote: "在你附近、同一網路裡。進去後能看到房間裡說的和放的東西,他們也能看到你在那裡說的話。",
237
+ invited: "{name} 邀請你進群聊「{title}」",
238
+ inviteNote: "在你附近、同一網路裡。進去後能看到群裡說的和放的東西,他們也能看到你在那裡說的話。",
239
239
  inviteStranger: "名字是對方自稱的,認識再加入。",
240
240
  join: "加入",
241
241
  notNow: "不了",
@@ -265,7 +265,7 @@ var ZH_TW = {
265
265
  showAsk: "先問我",
266
266
  showAuto: "直接展示",
267
267
  settingsWork: "附近的人可以請我的 Ta 做事",
268
- settingsWorkHint: "對方在房間裡把任務交給你的分身;要在目錄裡做事,每次仍由你授權。",
268
+ settingsWorkHint: "對方在群裡把任務交給你的分身;要在目錄裡做事,每次仍由你授權。",
269
269
  settingsMeet: "願意認識附近的人",
270
270
  settingsMeetHint: "你和對方的 Ta 先比對名片,有具體理由才提議你打招呼,每天最多 3 次;雙方都同意後才互相知道名字。",
271
271
  card: "我的名片",
@@ -293,7 +293,7 @@ var ZH_TW = {
293
293
  var JA = {
294
294
  title: "近くの人",
295
295
  offTitle: "身近にいる人を探す",
296
- offHint: "オンにすると、同じネットワークで近くの人もオンにしている Ta が表示されます;Ta は一緒にルームを作ったり、タスクを派遣したり、彼らの分身に問い合わせることができます。",
296
+ offHint: "オンにすると、同じネットワークで近くの人もオンにしている Ta が表示されます;Ta は一緒にグループチャットを作ったり、タスクを派遣したり、彼らの分身に問い合わせることができます。",
297
297
  hour: "1 時間",
298
298
  today: "今日",
299
299
  always: "オフにするまで",
@@ -307,19 +307,19 @@ var JA = {
307
307
  nobodyHint: "身近な人に自分の Ta で 見つける → 近くの人 をオンにしてもらいます。",
308
308
  friend: "友だち",
309
309
  someone: "Ta のユーザー",
310
- makeRoom: "この {n} 人とルームを作成",
311
- makeRoomAll: "一緒にルームを作成",
312
- roomTitle: "ルーム名",
310
+ makeRoom: "この {n} 人とグループチャットを作成",
311
+ makeRoomAll: "一緒にグループチャットを作成",
312
+ roomTitle: "グループチャット名",
313
313
  defaultRoom: "近くの人 · {time}",
314
314
  made: "{names} を招待しました。「参加」をタップすると入室します。",
315
315
  missed: "{names} に連絡できませんでした。",
316
- sayIt: "または Ta に「ルームを作成して、今日のノートを近くの人に送って」と言うこともできます。",
316
+ sayIt: "または Ta に「グループチャットを作成して、今日のノートを近くの人に送って」と言うこともできます。",
317
317
  youAre: "ほかの人に見えているあなた",
318
318
  hideName: "名前を非表示",
319
319
  showName: "名前を表示",
320
320
  invites: "招待",
321
- invited: "{name} があなたを「{title}」ルームに招待しました",
322
- inviteNote: "あなたの近くの同じネットワーク上です。入室すると、ルーム内で言ったことや共有したものが見え、他の人もあなたが言ったことが見えます。",
321
+ invited: "{name} があなたを「{title}」グループチャットに招待しました",
322
+ inviteNote: "あなたの近くの同じネットワーク上です。入室すると、グループ内で言ったことや共有したものが見え、他の人もあなたが言ったことが見えます。",
323
323
  inviteStranger: "名前は相手の自称です。知り合いなら参加してください。",
324
324
  join: "参加",
325
325
  notNow: "あとで",
@@ -349,7 +349,7 @@ var JA = {
349
349
  showAsk: "まず聞く",
350
350
  showAuto: "直接表示",
351
351
  settingsWork: "近くの人が私の Ta に仕事を依頼できます",
352
- settingsWorkHint: "ほかの人がルームであなたの分身にタスクを与えます。ディレクトリで作業するには毎回許可が必要です。",
352
+ settingsWorkHint: "ほかの人がグループチャットであなたの分身にタスクを与えます。ディレクトリで作業するには毎回許可が必要です。",
353
353
  settingsMeet: "近くの人と知り合う意思があります",
354
354
  settingsMeetHint: "あなたと相手の Ta がまず名刺を比較します。具体的な理由がある場合のみ Ta があいさつを提案します。1 日最大 3 回。両方が同意してからお互いの名前がわかります。",
355
355
  card: "私の名刺",
@@ -504,39 +504,6 @@ function Face({ seed, face, look, size }) {
504
504
  size
505
505
  });
506
506
  }
507
- function Looking({ peers }) {
508
- const shown = peers.slice(0, 5);
509
- const spots = [
510
- [0.2, 0.3],
511
- [0.78, 0.26],
512
- [0.86, 0.68],
513
- [0.16, 0.74],
514
- [0.5, 0.12]
515
- ];
516
- return /* @__PURE__ */ React.createElement("div", {
517
- className: "tnb-looking",
518
- "aria-hidden": "true"
519
- }, /* @__PURE__ */ React.createElement("span", {
520
- className: "tnb-ring"
521
- }), /* @__PURE__ */ React.createElement("span", {
522
- className: "tnb-ring tnb-ring-2"
523
- }), /* @__PURE__ */ React.createElement("span", {
524
- className: "tnb-ring tnb-ring-3"
525
- }), /* @__PURE__ */ React.createElement("span", {
526
- className: "tnb-me"
527
- }, pi.ui.Avatar ? /* @__PURE__ */ React.createElement(pi.ui.Avatar, {
528
- size: 44
529
- }) : null), shown.map((peer, index) => /* @__PURE__ */ React.createElement("span", {
530
- key: peer.e,
531
- className: "tnb-spot",
532
- style: { left: `${spots[index][0] * 100}%`, top: `${spots[index][1] * 100}%` }
533
- }, /* @__PURE__ */ React.createElement(Face, {
534
- seed: peer.friend?.id ?? peer.e,
535
- face: peer.face,
536
- look: peer.look,
537
- size: 30
538
- }))));
539
- }
540
507
  function Busy({ children, onClick, primary }) {
541
508
  const [busy, run] = pi.ui.useBusy ? pi.ui.useBusy() : [false, async (action) => action()];
542
509
  return /* @__PURE__ */ React.createElement("button", {
@@ -564,50 +531,6 @@ async function makeRoom(people) {
564
531
  pi.ui.notify([result.invited.length ? t("made", { names: names(result.invited) }) : "", result.missed.length ? t("missed", { names: names(result.missed) }) : ""].filter(Boolean).join(" "));
565
532
  pi.ui.showView(ROOMS_VIEW);
566
533
  }
567
- function PeerTile({ peer, chosen, toggle }) {
568
- return /* @__PURE__ */ React.createElement("li", null, /* @__PURE__ */ React.createElement("button", {
569
- type: "button",
570
- className: `tnb-peer${chosen ? " tnb-chosen" : ""}`,
571
- "aria-pressed": chosen,
572
- onClick: toggle
573
- }, /* @__PURE__ */ React.createElement("span", {
574
- className: "tnb-peer-face"
575
- }, /* @__PURE__ */ React.createElement(Face, {
576
- seed: peer.friend?.id ?? peer.e,
577
- face: peer.face,
578
- look: peer.look,
579
- size: 52
580
- }), /* @__PURE__ */ React.createElement("span", {
581
- className: "tnb-check"
582
- }, pi.ui.SelectCheck ? /* @__PURE__ */ React.createElement(pi.ui.SelectCheck, {
583
- checked: chosen
584
- }) : null)), /* @__PURE__ */ React.createElement("span", {
585
- className: "tnb-peer-name tnb-ellipsis"
586
- }, who(peer)), peer.friend && /* @__PURE__ */ React.createElement("span", {
587
- className: "tnb-tag tnb-tag-friend"
588
- }, t("friend"))));
589
- }
590
- function InviteRow({ invite }) {
591
- return /* @__PURE__ */ React.createElement("li", {
592
- className: "tnb-invite"
593
- }, /* @__PURE__ */ React.createElement(Face, {
594
- seed: invite.friend?.id ?? invite.e,
595
- face: invite.face,
596
- look: invite.look,
597
- size: 40
598
- }), /* @__PURE__ */ React.createElement("div", {
599
- className: "tnb-invite-text"
600
- }, /* @__PURE__ */ React.createElement("span", null, t("invited", { name: who(invite), title: invite.title })), invite.why && /* @__PURE__ */ React.createElement("span", {
601
- className: "tnb-quiet"
602
- }, invite.why)), /* @__PURE__ */ React.createElement("div", {
603
- className: "tnb-actions"
604
- }, /* @__PURE__ */ React.createElement(Busy, {
605
- onClick: () => answer(invite.k, false)
606
- }, t("notNow")), /* @__PURE__ */ React.createElement(Busy, {
607
- primary: true,
608
- onClick: () => answer(invite.k, true)
609
- }, t("join"))));
610
- }
611
534
  async function answer(k, accept) {
612
535
  store.set(await call({ kind: "answer", k, accept }));
613
536
  if (accept) {
@@ -622,239 +545,6 @@ function useNow(ms) {
622
545
  }, [ms]);
623
546
  return now;
624
547
  }
625
- function NearbyPage() {
626
- const status = useStatus();
627
- const now = useNow(30000);
628
- const [left, setLeft] = React.useState(new Set);
629
- const chosen = status.peers.filter((peer) => !left.has(peer.e));
630
- const toggle = (e) => setLeft((before) => {
631
- const next = new Set(before);
632
- if (!next.delete(e)) {
633
- next.add(e);
634
- }
635
- return next;
636
- });
637
- return /* @__PURE__ */ React.createElement("div", {
638
- className: "tnb-page"
639
- }, /* @__PURE__ */ React.createElement("div", {
640
- className: "tnb-body"
641
- }, status.invites.length > 0 && /* @__PURE__ */ React.createElement("section", {
642
- className: "tnb-section"
643
- }, /* @__PURE__ */ React.createElement("h3", null, t("invites")), /* @__PURE__ */ React.createElement("ul", {
644
- className: "tnb-card"
645
- }, status.invites.map((invite) => /* @__PURE__ */ React.createElement(InviteRow, {
646
- key: invite.k,
647
- invite
648
- })))), (status.greets ?? []).length > 0 && /* @__PURE__ */ React.createElement("section", {
649
- className: "tnb-section"
650
- }, /* @__PURE__ */ React.createElement("h3", null, t("greets")), /* @__PURE__ */ React.createElement("ul", {
651
- className: "tnb-card"
652
- }, (status.greets ?? []).map((greet) => /* @__PURE__ */ React.createElement(GreetRow, {
653
- key: greet.k,
654
- greet
655
- })))), !status.visible ? /* @__PURE__ */ React.createElement("div", {
656
- className: "tnb-off"
657
- }, /* @__PURE__ */ React.createElement(Looking, {
658
- peers: []
659
- }), /* @__PURE__ */ React.createElement("h2", null, t("offTitle")), /* @__PURE__ */ React.createElement("p", {
660
- className: "tnb-quiet"
661
- }, t("offHint")), /* @__PURE__ */ React.createElement("div", {
662
- className: "tnb-durations"
663
- }, /* @__PURE__ */ React.createElement(Busy, {
664
- primary: true,
665
- onClick: () => visible(60)
666
- }, t("hour")), /* @__PURE__ */ React.createElement(Busy, {
667
- onClick: () => visible(restOfDay())
668
- }, t("today")), /* @__PURE__ */ React.createElement(Busy, {
669
- onClick: () => visible()
670
- }, t("always")))) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
671
- className: "tnb-on"
672
- }, /* @__PURE__ */ React.createElement(Looking, {
673
- peers: status.peers
674
- }), /* @__PURE__ */ React.createElement("div", {
675
- className: "tnb-on-line"
676
- }, /* @__PURE__ */ React.createElement("span", {
677
- className: "tnb-dot"
678
- }), /* @__PURE__ */ React.createElement("span", null, t("on"), " · ", leftText(status.until, now)), /* @__PURE__ */ React.createElement("button", {
679
- type: "button",
680
- className: "tnb-link",
681
- onClick: () => void call({ kind: "visible", on: false }).then((next) => store.set(next), (error) => pi.ui.notify(message(error), "error"))
682
- }, t("turnOff"))), status.error && /* @__PURE__ */ React.createElement("p", {
683
- className: "tnb-error"
684
- }, t("error", { error: status.error }))), status.peers.length === 0 ? /* @__PURE__ */ React.createElement("div", {
685
- className: "tnb-nobody"
686
- }, /* @__PURE__ */ React.createElement("strong", null, t("nobody")), /* @__PURE__ */ React.createElement("span", {
687
- className: "tnb-quiet"
688
- }, t("nobodyHint"))) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("ul", {
689
- className: "tnb-peers"
690
- }, status.peers.map((peer) => /* @__PURE__ */ React.createElement(PeerTile, {
691
- key: peer.e,
692
- peer,
693
- chosen: !left.has(peer.e),
694
- toggle: () => toggle(peer.e)
695
- }))), /* @__PURE__ */ React.createElement("div", {
696
- className: "tnb-make"
697
- }, chosen.length > 0 && /* @__PURE__ */ React.createElement(Busy, {
698
- primary: true,
699
- onClick: () => makeRoom(chosen)
700
- }, chosen.length === status.peers.length ? t("makeRoomAll") : t("makeRoom", { n: chosen.length })), /* @__PURE__ */ React.createElement("p", {
701
- className: "tnb-quiet"
702
- }, t("sayIt")))), /* @__PURE__ */ React.createElement(SpotRow, {
703
- status,
704
- now
705
- }), /* @__PURE__ */ React.createElement(MeetRow, {
706
- status
707
- }), /* @__PURE__ */ React.createElement("p", {
708
- className: "tnb-self"
709
- }, /* @__PURE__ */ React.createElement("span", {
710
- className: "tnb-quiet"
711
- }, t("youAre")), /* @__PURE__ */ React.createElement("span", null, status.self.name || t("someone"))))));
712
- }
713
- function spot(action, code) {
714
- return call({ kind: "spot", action, ...code ? { code } : {} }).then((status) => store.set(status));
715
- }
716
- function SpotRow({ status, now }) {
717
- const current = status.spot;
718
- if (current) {
719
- const minutes = Math.min(10, Math.ceil((current.until - Math.max(now, Date.now())) / 60000));
720
- return /* @__PURE__ */ React.createElement("div", {
721
- className: "tnb-code-card"
722
- }, /* @__PURE__ */ React.createElement("span", {
723
- className: "tnb-quiet"
724
- }, t("spotCode")), /* @__PURE__ */ React.createElement("strong", {
725
- className: "tnb-code"
726
- }, current.code.slice(0, 3), " ", current.code.slice(3)), /* @__PURE__ */ React.createElement("span", {
727
- className: "tnb-quiet"
728
- }, minutes > 0 ? current.mine ? t("spotShare", { n: minutes }) : t("spotIn") : t("spotClosed")), /* @__PURE__ */ React.createElement("button", {
729
- type: "button",
730
- className: "tnb-link",
731
- onClick: () => void spot("leave").catch((error) => pi.ui.notify(message(error), "error"))
732
- }, t("spotLeave")));
733
- }
734
- return /* @__PURE__ */ React.createElement("div", {
735
- className: "tnb-code-row"
736
- }, /* @__PURE__ */ React.createElement("span", {
737
- className: "tnb-quiet"
738
- }, t("spotHint")), /* @__PURE__ */ React.createElement("div", {
739
- className: "tnb-actions"
740
- }, /* @__PURE__ */ React.createElement(Busy, {
741
- onClick: () => spot("open")
742
- }, t("spotOpen")), /* @__PURE__ */ React.createElement("button", {
743
- type: "button",
744
- className: "ta-button",
745
- onClick: () => void pi.ui.input(t("spotJoinTitle"), "000000").then((code) => code?.trim() ? spot("join", code.replace(/\s/g, "")) : undefined).catch((error) => pi.ui.notify(message(error), "error"))
746
- }, t("spotJoin"))));
747
- }
748
- function ShowContent({ content }) {
749
- if (content.kind === "html") {
750
- return /* @__PURE__ */ React.createElement("iframe", {
751
- className: "tnb-show-frame",
752
- title: content.title,
753
- sandbox: "allow-scripts allow-popups",
754
- referrerPolicy: "no-referrer",
755
- srcDoc: content.data
756
- });
757
- }
758
- if (content.kind === "image") {
759
- return /* @__PURE__ */ React.createElement("img", {
760
- className: "tnb-show-image",
761
- alt: content.title,
762
- src: content.data
763
- });
764
- }
765
- if (content.kind === "markdown") {
766
- return /* @__PURE__ */ React.createElement("div", {
767
- className: "tnb-show-text"
768
- }, /* @__PURE__ */ React.createElement(pi.ui.Markdown, {
769
- text: content.data
770
- }));
771
- }
772
- return /* @__PURE__ */ React.createElement("pre", {
773
- className: "tnb-show-text tnb-show-pre"
774
- }, content.data);
775
- }
776
- function ShowOverlay({ shown, close }) {
777
- const status = useStatus();
778
- const current = status.shown?.k === shown.k ? status.shown : undefined;
779
- const [content, setContent] = React.useState();
780
- React.useEffect(() => {
781
- if (!current) {
782
- close();
783
- } else if (!current.ask && !content) {
784
- call({ kind: "shown", k: shown.k }).then(setContent, () => close());
785
- }
786
- }, [current, content, shown.k, close]);
787
- const finish = () => void call({ kind: "show", k: shown.k, action: "close" }).then((next) => store.set(next), close);
788
- if (!current) {
789
- return null;
790
- }
791
- if (current.ask) {
792
- return /* @__PURE__ */ React.createElement(pi.ui.Dialog, {
793
- title: t("title"),
794
- onClose: finish
795
- }, /* @__PURE__ */ React.createElement("div", {
796
- className: "tnb-dialog"
797
- }, /* @__PURE__ */ React.createElement("div", {
798
- className: "tnb-dialog-head"
799
- }, /* @__PURE__ */ React.createElement(Face, {
800
- seed: current.friend?.id ?? current.k,
801
- face: current.face,
802
- look: current.look,
803
- size: 48
804
- }), /* @__PURE__ */ React.createElement("strong", null, t("wantsToShow", { name: who(current), title: current.title }))), /* @__PURE__ */ React.createElement("p", {
805
- className: "tnb-quiet"
806
- }, [t("showNote"), current.friend ? "" : t("inviteStranger")].filter(Boolean).join(TaLanguageUtil.cjk(pi.ui.language) ? "" : " ")), /* @__PURE__ */ React.createElement("div", {
807
- className: "tnb-actions tnb-dialog-actions"
808
- }, /* @__PURE__ */ React.createElement("button", {
809
- type: "button",
810
- className: "ta-button",
811
- onClick: finish
812
- }, t("notNow")), /* @__PURE__ */ React.createElement(Busy, {
813
- primary: true,
814
- onClick: () => call({ kind: "show", k: shown.k, action: "accept" }).then((next) => store.set(next))
815
- }, t("showIt")))));
816
- }
817
- return /* @__PURE__ */ React.createElement(pi.ui.FullScreen, {
818
- className: "tnb-show"
819
- }, /* @__PURE__ */ React.createElement("div", {
820
- className: "tnb-show-bar"
821
- }, /* @__PURE__ */ React.createElement(Face, {
822
- seed: current.friend?.id ?? current.k,
823
- face: current.face,
824
- look: current.look,
825
- size: 26
826
- }), /* @__PURE__ */ React.createElement("span", {
827
- className: "tnb-show-title tnb-ellipsis"
828
- }, current.title), /* @__PURE__ */ React.createElement("span", {
829
- className: "tnb-quiet tnb-ellipsis"
830
- }, t("from", { name: who(current) })), /* @__PURE__ */ React.createElement("button", {
831
- type: "button",
832
- className: "ta-button",
833
- onClick: finish
834
- }, t("close"))), /* @__PURE__ */ React.createElement("div", {
835
- className: "tnb-show-body"
836
- }, content ? /* @__PURE__ */ React.createElement(ShowContent, {
837
- content
838
- }) : /* @__PURE__ */ React.createElement(pi.ui.Skeleton, {
839
- rows: 4
840
- })));
841
- }
842
- var showing;
843
- function openShown(shown) {
844
- if (showing === shown.k || !pi.ui.custom) {
845
- return;
846
- }
847
- showing = shown.k;
848
- pi.ui.custom(({ close }) => /* @__PURE__ */ React.createElement(ShowOverlay, {
849
- shown,
850
- close: () => {
851
- if (showing === shown.k) {
852
- showing = undefined;
853
- }
854
- close();
855
- }
856
- }));
857
- }
858
548
  function useSettings() {
859
549
  const settings = useStatus().settings ?? {};
860
550
  const change = async (next) => {
@@ -866,31 +556,10 @@ function useSettings() {
866
556
  };
867
557
  return [settings, change];
868
558
  }
869
- function ShowSetting() {
870
- const [settings, change] = useSettings();
871
- const modes = [
872
- ["off", "showOff"],
873
- ["ask", "showAsk"],
874
- ["auto", "showAuto"]
875
- ];
876
- return /* @__PURE__ */ React.createElement("select", {
877
- className: "tnb-select",
878
- "aria-label": t("settingsShow"),
879
- value: settings.show ?? "ask",
880
- onChange: (event) => void change({ show: event.target.value })
881
- }, modes.map(([mode, word]) => /* @__PURE__ */ React.createElement("option", {
882
- key: mode,
883
- value: mode
884
- }, t(word))));
885
- }
886
- function WorkSetting() {
887
- const [settings, change] = useSettings();
888
- return /* @__PURE__ */ React.createElement(pi.ui.Switch, {
889
- checked: settings.work === true,
890
- label: t("settingsWork"),
891
- onChange: (on) => change({ work: on })
892
- });
893
- }
559
+ var join = (items) => TaLanguageUtil.list(pi.ui.language, items);
560
+ var split = (text) => text.split(/[,,、;\n]/).map((item) => item.trim()).filter(Boolean);
561
+
562
+ // web-src/nearby-meet-view.tsx
894
563
  function GreetRow({ greet }) {
895
564
  const answer2 = async (accept) => {
896
565
  store.set(await call({ kind: "greet", k: greet.k, accept }));
@@ -918,8 +587,6 @@ function GreetRow({ greet }) {
918
587
  onClick: () => answer2(true)
919
588
  }, t("greetYes"))));
920
589
  }
921
- var join = (items) => TaLanguageUtil.list(pi.ui.language, items);
922
- var split = (text) => text.split(/[,,、;\n]/).map((item) => item.trim()).filter(Boolean);
923
590
  function CardDialog({ close }) {
924
591
  const status = useStatus();
925
592
  const start = status.cards?.draft ?? status.cards?.card;
@@ -1040,46 +707,144 @@ function CardSetting() {
1040
707
  onClick: openCard
1041
708
  }, t("cardEdit")));
1042
709
  }
1043
- var inviting;
1044
- function openInvite(invite) {
1045
- if (inviting || !pi.ui.custom) {
1046
- return;
710
+
711
+ // web-src/nearby-show-view.tsx
712
+ function ShowContent({ content }) {
713
+ if (content.kind === "html") {
714
+ return /* @__PURE__ */ React.createElement("iframe", {
715
+ className: "tnb-show-frame",
716
+ title: content.title,
717
+ sandbox: "allow-scripts allow-popups",
718
+ referrerPolicy: "no-referrer",
719
+ srcDoc: content.data
720
+ });
1047
721
  }
1048
- inviting = invite.k;
1049
- pi.ui.custom(({ close }) => {
1050
- const done = () => {
1051
- inviting = undefined;
722
+ if (content.kind === "image") {
723
+ return /* @__PURE__ */ React.createElement("img", {
724
+ className: "tnb-show-image",
725
+ alt: content.title,
726
+ src: content.data
727
+ });
728
+ }
729
+ if (content.kind === "markdown") {
730
+ return /* @__PURE__ */ React.createElement("div", {
731
+ className: "tnb-show-text"
732
+ }, /* @__PURE__ */ React.createElement(pi.ui.Markdown, {
733
+ text: content.data
734
+ }));
735
+ }
736
+ return /* @__PURE__ */ React.createElement("pre", {
737
+ className: "tnb-show-text tnb-show-pre"
738
+ }, content.data);
739
+ }
740
+ function ShowOverlay({ shown, close }) {
741
+ const Loading = pi.ui.Loading ?? pi.ui.Skeleton;
742
+ const status = useStatus();
743
+ const current = status.shown?.k === shown.k ? status.shown : undefined;
744
+ const [content, setContent] = React.useState();
745
+ React.useEffect(() => {
746
+ if (!current) {
1052
747
  close();
1053
- };
748
+ } else if (!current.ask && !content) {
749
+ call({ kind: "shown", k: shown.k }).then(setContent, () => close());
750
+ }
751
+ }, [current, content, shown.k, close]);
752
+ const finish = () => void call({ kind: "show", k: shown.k, action: "close" }).then((next) => store.set(next), close);
753
+ if (!current) {
754
+ return null;
755
+ }
756
+ if (current.ask) {
1054
757
  return /* @__PURE__ */ React.createElement(pi.ui.Dialog, {
1055
758
  title: t("title"),
1056
- onClose: done
759
+ onClose: finish
1057
760
  }, /* @__PURE__ */ React.createElement("div", {
1058
761
  className: "tnb-dialog"
1059
762
  }, /* @__PURE__ */ React.createElement("div", {
1060
763
  className: "tnb-dialog-head"
1061
764
  }, /* @__PURE__ */ React.createElement(Face, {
1062
- seed: invite.friend?.id ?? invite.e,
1063
- face: invite.face,
1064
- look: invite.look,
765
+ seed: current.friend?.id ?? current.k,
766
+ face: current.face,
767
+ look: current.look,
1065
768
  size: 48
1066
- }), /* @__PURE__ */ React.createElement("div", {
1067
- className: "tnb-invite-text"
1068
- }, /* @__PURE__ */ React.createElement("strong", null, t("invited", { name: who(invite), title: invite.title })), invite.friend ? /* @__PURE__ */ React.createElement("span", {
1069
- className: "tnb-tag tnb-tag-friend"
1070
- }, t("friend")) : null)), invite.why && /* @__PURE__ */ React.createElement("p", null, invite.why), /* @__PURE__ */ React.createElement("p", {
769
+ }), /* @__PURE__ */ React.createElement("strong", null, t("wantsToShow", { name: who(current), title: current.title }))), /* @__PURE__ */ React.createElement("p", {
1071
770
  className: "tnb-quiet"
1072
- }, [t("inviteNote"), invite.friend ? "" : t("inviteStranger")].filter(Boolean).join(TaLanguageUtil.cjk(pi.ui.language) ? "" : " ")), /* @__PURE__ */ React.createElement("div", {
771
+ }, [t("showNote"), current.friend ? "" : t("inviteStranger")].filter(Boolean).join(TaLanguageUtil.cjk(pi.ui.language) ? "" : " ")), /* @__PURE__ */ React.createElement("div", {
1073
772
  className: "tnb-actions tnb-dialog-actions"
1074
- }, /* @__PURE__ */ React.createElement(Busy, {
1075
- onClick: () => answer(invite.k, false).finally(done)
773
+ }, /* @__PURE__ */ React.createElement("button", {
774
+ type: "button",
775
+ className: "ta-button",
776
+ onClick: finish
1076
777
  }, t("notNow")), /* @__PURE__ */ React.createElement(Busy, {
1077
778
  primary: true,
1078
- onClick: () => answer(invite.k, true).finally(done)
1079
- }, t("join")))));
779
+ onClick: () => call({ kind: "show", k: shown.k, action: "accept" }).then((next) => store.set(next))
780
+ }, t("showIt")))));
781
+ }
782
+ return /* @__PURE__ */ React.createElement(pi.ui.FullScreen, {
783
+ className: "tnb-show"
784
+ }, /* @__PURE__ */ React.createElement("div", {
785
+ className: "tnb-show-bar"
786
+ }, /* @__PURE__ */ React.createElement(Face, {
787
+ seed: current.friend?.id ?? current.k,
788
+ face: current.face,
789
+ look: current.look,
790
+ size: 26
791
+ }), /* @__PURE__ */ React.createElement("span", {
792
+ className: "tnb-show-title tnb-ellipsis"
793
+ }, current.title), /* @__PURE__ */ React.createElement("span", {
794
+ className: "tnb-quiet tnb-ellipsis"
795
+ }, t("from", { name: who(current) })), /* @__PURE__ */ React.createElement("button", {
796
+ type: "button",
797
+ className: "ta-button",
798
+ onClick: finish
799
+ }, t("close"))), /* @__PURE__ */ React.createElement("div", {
800
+ className: "tnb-show-body"
801
+ }, content ? /* @__PURE__ */ React.createElement(ShowContent, {
802
+ content
803
+ }) : /* @__PURE__ */ React.createElement(Loading, null)));
804
+ }
805
+ var showing;
806
+ function openShown(shown) {
807
+ if (showing === shown.k || !pi.ui.custom) {
808
+ return;
809
+ }
810
+ showing = shown.k;
811
+ pi.ui.custom(({ close }) => /* @__PURE__ */ React.createElement(ShowOverlay, {
812
+ shown,
813
+ close: () => {
814
+ if (showing === shown.k) {
815
+ showing = undefined;
816
+ }
817
+ close();
818
+ }
819
+ }));
820
+ }
821
+ function ShowSetting() {
822
+ const [settings, change] = useSettings();
823
+ const modes = [
824
+ ["off", "showOff"],
825
+ ["ask", "showAsk"],
826
+ ["auto", "showAuto"]
827
+ ];
828
+ return /* @__PURE__ */ React.createElement("select", {
829
+ className: "tnb-select",
830
+ "aria-label": t("settingsShow"),
831
+ value: settings.show ?? "ask",
832
+ onChange: (event) => void change({ show: event.target.value })
833
+ }, modes.map(([mode, word]) => /* @__PURE__ */ React.createElement("option", {
834
+ key: mode,
835
+ value: mode
836
+ }, t(word))));
837
+ }
838
+ function WorkSetting() {
839
+ const [settings, change] = useSettings();
840
+ return /* @__PURE__ */ React.createElement(pi.ui.Switch, {
841
+ checked: settings.work === true,
842
+ label: t("settingsWork"),
843
+ onChange: (on) => change({ work: on })
1080
844
  });
1081
845
  }
1082
846
 
847
+ // web-src/nearby-home.tsx
1083
848
  class NearbyHome {
1084
849
  current = [];
1085
850
  signature = "";
@@ -1115,6 +880,7 @@ class NearbyHome {
1115
880
  detail,
1116
881
  icon: icon("Radar"),
1117
882
  unseen: status.invites.length > 0 || greets.length > 0,
883
+ place: "partners",
1118
884
  ...status.peers.length && pi.ui.GroupFace ? {
1119
885
  face: ({ size }) => /* @__PURE__ */ React.createElement(pi.ui.GroupFace, {
1120
886
  members: store.get().peers.map((peer) => ({ seed: peer.friend?.id ?? peer.e, face: peer.face })),
@@ -1141,6 +907,7 @@ function nearbySettings() {
1141
907
  return {
1142
908
  title: () => t("title"),
1143
909
  icon: icon("Radar"),
910
+ group: "privacy",
1144
911
  rows: [
1145
912
  { key: "name", label: () => t("settingsName"), description: () => t("settingsNameHint"), render: NameSwitch },
1146
913
  { key: "show", label: () => t("settingsShow"), description: () => t("settingsShowHint"), render: ShowSetting },
@@ -1151,12 +918,253 @@ function nearbySettings() {
1151
918
  };
1152
919
  }
1153
920
 
921
+ // web-src/nearby-page.tsx
922
+ function Looking({ peers }) {
923
+ const shown = peers.slice(0, 5);
924
+ const spots = [
925
+ [0.2, 0.3],
926
+ [0.78, 0.26],
927
+ [0.86, 0.68],
928
+ [0.16, 0.74],
929
+ [0.5, 0.12]
930
+ ];
931
+ return /* @__PURE__ */ React.createElement("div", {
932
+ className: "tnb-looking",
933
+ "aria-hidden": "true"
934
+ }, /* @__PURE__ */ React.createElement("span", {
935
+ className: "tnb-ring"
936
+ }), /* @__PURE__ */ React.createElement("span", {
937
+ className: "tnb-ring tnb-ring-2"
938
+ }), /* @__PURE__ */ React.createElement("span", {
939
+ className: "tnb-ring tnb-ring-3"
940
+ }), /* @__PURE__ */ React.createElement("span", {
941
+ className: "tnb-me"
942
+ }, pi.ui.Avatar ? /* @__PURE__ */ React.createElement(pi.ui.Avatar, {
943
+ size: 44
944
+ }) : null), shown.map((peer, index) => /* @__PURE__ */ React.createElement("span", {
945
+ key: peer.e,
946
+ className: "tnb-spot",
947
+ style: { left: `${spots[index][0] * 100}%`, top: `${spots[index][1] * 100}%` }
948
+ }, /* @__PURE__ */ React.createElement(Face, {
949
+ seed: peer.friend?.id ?? peer.e,
950
+ face: peer.face,
951
+ look: peer.look,
952
+ size: 30
953
+ }))));
954
+ }
955
+ function PeerTile({ peer, chosen, toggle }) {
956
+ return /* @__PURE__ */ React.createElement("li", null, /* @__PURE__ */ React.createElement("button", {
957
+ type: "button",
958
+ className: `tnb-peer${chosen ? " tnb-chosen" : ""}`,
959
+ "aria-pressed": chosen,
960
+ onClick: toggle
961
+ }, /* @__PURE__ */ React.createElement("span", {
962
+ className: "tnb-peer-face"
963
+ }, /* @__PURE__ */ React.createElement(Face, {
964
+ seed: peer.friend?.id ?? peer.e,
965
+ face: peer.face,
966
+ look: peer.look,
967
+ size: 52
968
+ }), /* @__PURE__ */ React.createElement("span", {
969
+ className: "tnb-check"
970
+ }, pi.ui.SelectCheck ? /* @__PURE__ */ React.createElement(pi.ui.SelectCheck, {
971
+ checked: chosen
972
+ }) : null)), /* @__PURE__ */ React.createElement("span", {
973
+ className: "tnb-peer-name tnb-ellipsis"
974
+ }, who(peer)), peer.friend && /* @__PURE__ */ React.createElement("span", {
975
+ className: "tnb-tag tnb-tag-friend"
976
+ }, t("friend"))));
977
+ }
978
+ function InviteRow({ invite }) {
979
+ return /* @__PURE__ */ React.createElement("li", {
980
+ className: "tnb-invite"
981
+ }, /* @__PURE__ */ React.createElement(Face, {
982
+ seed: invite.friend?.id ?? invite.e,
983
+ face: invite.face,
984
+ look: invite.look,
985
+ size: 40
986
+ }), /* @__PURE__ */ React.createElement("div", {
987
+ className: "tnb-invite-text"
988
+ }, /* @__PURE__ */ React.createElement("span", null, t("invited", { name: who(invite), title: invite.title })), invite.why && /* @__PURE__ */ React.createElement("span", {
989
+ className: "tnb-quiet"
990
+ }, invite.why)), /* @__PURE__ */ React.createElement("div", {
991
+ className: "tnb-actions"
992
+ }, /* @__PURE__ */ React.createElement(Busy, {
993
+ onClick: () => answer(invite.k, false)
994
+ }, t("notNow")), /* @__PURE__ */ React.createElement(Busy, {
995
+ primary: true,
996
+ onClick: () => answer(invite.k, true)
997
+ }, t("join"))));
998
+ }
999
+ function NearbyPage() {
1000
+ const status = useStatus();
1001
+ const now = useNow(30000);
1002
+ const [left, setLeft] = React.useState(new Set);
1003
+ const chosen = status.peers.filter((peer) => !left.has(peer.e));
1004
+ const toggle = (e) => setLeft((before) => {
1005
+ const next = new Set(before);
1006
+ if (!next.delete(e)) {
1007
+ next.add(e);
1008
+ }
1009
+ return next;
1010
+ });
1011
+ return /* @__PURE__ */ React.createElement("div", {
1012
+ className: "tnb-page"
1013
+ }, /* @__PURE__ */ React.createElement("div", {
1014
+ className: "tnb-body"
1015
+ }, status.invites.length > 0 && /* @__PURE__ */ React.createElement("section", {
1016
+ className: "tnb-section"
1017
+ }, /* @__PURE__ */ React.createElement("h3", null, t("invites")), /* @__PURE__ */ React.createElement("ul", {
1018
+ className: "tnb-card"
1019
+ }, status.invites.map((invite) => /* @__PURE__ */ React.createElement(InviteRow, {
1020
+ key: invite.k,
1021
+ invite
1022
+ })))), (status.greets ?? []).length > 0 && /* @__PURE__ */ React.createElement("section", {
1023
+ className: "tnb-section"
1024
+ }, /* @__PURE__ */ React.createElement("h3", null, t("greets")), /* @__PURE__ */ React.createElement("ul", {
1025
+ className: "tnb-card"
1026
+ }, (status.greets ?? []).map((greet) => /* @__PURE__ */ React.createElement(GreetRow, {
1027
+ key: greet.k,
1028
+ greet
1029
+ })))), !status.visible ? /* @__PURE__ */ React.createElement("div", {
1030
+ className: "tnb-off"
1031
+ }, /* @__PURE__ */ React.createElement(Looking, {
1032
+ peers: []
1033
+ }), /* @__PURE__ */ React.createElement("h2", null, t("offTitle")), /* @__PURE__ */ React.createElement("p", {
1034
+ className: "tnb-quiet"
1035
+ }, t("offHint")), /* @__PURE__ */ React.createElement("div", {
1036
+ className: "tnb-durations"
1037
+ }, /* @__PURE__ */ React.createElement(Busy, {
1038
+ primary: true,
1039
+ onClick: () => visible(60)
1040
+ }, t("hour")), /* @__PURE__ */ React.createElement(Busy, {
1041
+ onClick: () => visible(restOfDay())
1042
+ }, t("today")), /* @__PURE__ */ React.createElement(Busy, {
1043
+ onClick: () => visible()
1044
+ }, t("always")))) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
1045
+ className: "tnb-on"
1046
+ }, /* @__PURE__ */ React.createElement(Looking, {
1047
+ peers: status.peers
1048
+ }), /* @__PURE__ */ React.createElement("div", {
1049
+ className: "tnb-on-line"
1050
+ }, /* @__PURE__ */ React.createElement("span", {
1051
+ className: "tnb-dot"
1052
+ }), /* @__PURE__ */ React.createElement("span", null, t("on"), " · ", leftText(status.until, now)), /* @__PURE__ */ React.createElement("button", {
1053
+ type: "button",
1054
+ className: "tnb-link",
1055
+ onClick: () => void call({ kind: "visible", on: false }).then((next) => store.set(next), (error) => pi.ui.notify(message(error), "error"))
1056
+ }, t("turnOff"))), status.error && /* @__PURE__ */ React.createElement("p", {
1057
+ className: "tnb-error"
1058
+ }, t("error", { error: status.error }))), status.peers.length === 0 ? /* @__PURE__ */ React.createElement("div", {
1059
+ className: "tnb-nobody"
1060
+ }, /* @__PURE__ */ React.createElement("strong", null, t("nobody")), /* @__PURE__ */ React.createElement("span", {
1061
+ className: "tnb-quiet"
1062
+ }, t("nobodyHint"))) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("ul", {
1063
+ className: "tnb-peers"
1064
+ }, status.peers.map((peer) => /* @__PURE__ */ React.createElement(PeerTile, {
1065
+ key: peer.e,
1066
+ peer,
1067
+ chosen: !left.has(peer.e),
1068
+ toggle: () => toggle(peer.e)
1069
+ }))), /* @__PURE__ */ React.createElement("div", {
1070
+ className: "tnb-make"
1071
+ }, chosen.length > 0 && /* @__PURE__ */ React.createElement(Busy, {
1072
+ primary: true,
1073
+ onClick: () => makeRoom(chosen)
1074
+ }, chosen.length === status.peers.length ? t("makeRoomAll") : t("makeRoom", { n: chosen.length })), /* @__PURE__ */ React.createElement("p", {
1075
+ className: "tnb-quiet"
1076
+ }, t("sayIt")))), /* @__PURE__ */ React.createElement(SpotRow, {
1077
+ status,
1078
+ now
1079
+ }), /* @__PURE__ */ React.createElement(MeetRow, {
1080
+ status
1081
+ }), /* @__PURE__ */ React.createElement("p", {
1082
+ className: "tnb-self"
1083
+ }, /* @__PURE__ */ React.createElement("span", {
1084
+ className: "tnb-quiet"
1085
+ }, t("youAre")), /* @__PURE__ */ React.createElement("span", null, status.self.name || t("someone"))))));
1086
+ }
1087
+ function spot(action, code) {
1088
+ return call({ kind: "spot", action, ...code ? { code } : {} }).then((status) => store.set(status));
1089
+ }
1090
+ function SpotRow({ status, now }) {
1091
+ const current = status.spot;
1092
+ if (current) {
1093
+ const minutes = Math.min(10, Math.ceil((current.until - Math.max(now, Date.now())) / 60000));
1094
+ return /* @__PURE__ */ React.createElement("div", {
1095
+ className: "tnb-code-card"
1096
+ }, /* @__PURE__ */ React.createElement("span", {
1097
+ className: "tnb-quiet"
1098
+ }, t("spotCode")), /* @__PURE__ */ React.createElement("strong", {
1099
+ className: "tnb-code"
1100
+ }, current.code.slice(0, 3), " ", current.code.slice(3)), /* @__PURE__ */ React.createElement("span", {
1101
+ className: "tnb-quiet"
1102
+ }, minutes > 0 ? current.mine ? t("spotShare", { n: minutes }) : t("spotIn") : t("spotClosed")), /* @__PURE__ */ React.createElement("button", {
1103
+ type: "button",
1104
+ className: "tnb-link",
1105
+ onClick: () => void spot("leave").catch((error) => pi.ui.notify(message(error), "error"))
1106
+ }, t("spotLeave")));
1107
+ }
1108
+ return /* @__PURE__ */ React.createElement("div", {
1109
+ className: "tnb-code-row"
1110
+ }, /* @__PURE__ */ React.createElement("span", {
1111
+ className: "tnb-quiet"
1112
+ }, t("spotHint")), /* @__PURE__ */ React.createElement("div", {
1113
+ className: "tnb-actions"
1114
+ }, /* @__PURE__ */ React.createElement(Busy, {
1115
+ onClick: () => spot("open")
1116
+ }, t("spotOpen")), /* @__PURE__ */ React.createElement("button", {
1117
+ type: "button",
1118
+ className: "ta-button",
1119
+ onClick: () => void pi.ui.input(t("spotJoinTitle"), "000000").then((code) => code?.trim() ? spot("join", code.replace(/\s/g, "")) : undefined).catch((error) => pi.ui.notify(message(error), "error"))
1120
+ }, t("spotJoin"))));
1121
+ }
1122
+ var inviting;
1123
+ function openInvite(invite) {
1124
+ if (inviting || !pi.ui.custom) {
1125
+ return;
1126
+ }
1127
+ inviting = invite.k;
1128
+ pi.ui.custom(({ close }) => {
1129
+ const done = () => {
1130
+ inviting = undefined;
1131
+ close();
1132
+ };
1133
+ return /* @__PURE__ */ React.createElement(pi.ui.Dialog, {
1134
+ title: t("title"),
1135
+ onClose: done
1136
+ }, /* @__PURE__ */ React.createElement("div", {
1137
+ className: "tnb-dialog"
1138
+ }, /* @__PURE__ */ React.createElement("div", {
1139
+ className: "tnb-dialog-head"
1140
+ }, /* @__PURE__ */ React.createElement(Face, {
1141
+ seed: invite.friend?.id ?? invite.e,
1142
+ face: invite.face,
1143
+ look: invite.look,
1144
+ size: 48
1145
+ }), /* @__PURE__ */ React.createElement("div", {
1146
+ className: "tnb-invite-text"
1147
+ }, /* @__PURE__ */ React.createElement("strong", null, t("invited", { name: who(invite), title: invite.title })), invite.friend ? /* @__PURE__ */ React.createElement("span", {
1148
+ className: "tnb-tag tnb-tag-friend"
1149
+ }, t("friend")) : null)), invite.why && /* @__PURE__ */ React.createElement("p", null, invite.why), /* @__PURE__ */ React.createElement("p", {
1150
+ className: "tnb-quiet"
1151
+ }, [t("inviteNote"), invite.friend ? "" : t("inviteStranger")].filter(Boolean).join(TaLanguageUtil.cjk(pi.ui.language) ? "" : " ")), /* @__PURE__ */ React.createElement("div", {
1152
+ className: "tnb-actions tnb-dialog-actions"
1153
+ }, /* @__PURE__ */ React.createElement(Busy, {
1154
+ onClick: () => answer(invite.k, false).finally(done)
1155
+ }, t("notNow")), /* @__PURE__ */ React.createElement(Busy, {
1156
+ primary: true,
1157
+ onClick: () => answer(invite.k, true).finally(done)
1158
+ }, t("join")))));
1159
+ });
1160
+ }
1161
+
1154
1162
  // web-src/style.ts
1155
1163
  var STYLE = `
1156
1164
  .tnb-ellipsis { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1157
1165
  .tnb-quiet { color: var(--ta-muted); }
1158
1166
  .tnb-page { flex: 1; min-height: 0; height: 100%; overflow-y: auto; overscroll-behavior: none; }
1159
- .tnb-body { display: flex; flex-direction: column; gap: 18px; max-width: 560px; margin: 0 auto; padding: 12px 16px calc(28px + env(safe-area-inset-bottom)); box-sizing: border-box; }
1167
+ .tnb-body { display: flex; flex-direction: column; gap: 18px; max-width: var(--ta-page-width); margin: 0 auto; padding: 12px 16px calc(28px + env(safe-area-inset-bottom)); box-sizing: border-box; }
1160
1168
  .tnb-section h3 { margin: 0 0 6px; padding: 0 4px; font-size: calc(12px * var(--ta-font-scale)); font-weight: 500; color: var(--ta-muted); }
1161
1169
  .tnb-card { margin: 0; padding: 2px 10px; list-style: none; border-radius: 14px; background: var(--ta-raised); }
1162
1170
  .tnb-invite { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px 0; }
@@ -1244,7 +1252,7 @@ function activate(pi2) {
1244
1252
  bind(pi2.React);
1245
1253
  bindPage(pi2);
1246
1254
  const removeStyle = injectStyle();
1247
- pi2.registerView("nearby", { title: () => t("title"), icon: icon("Radar"), render: NearbyPage, discover: true, order: 82 });
1255
+ pi2.registerView("nearby", { title: () => t("title"), icon: icon("Radar"), render: NearbyPage, group: "people", order: 82 });
1248
1256
  pi2.registerSettings(nearbySettings());
1249
1257
  const home = new NearbyHome;
1250
1258
  const stopHome = home.start();