@onlyworlds/sdk 4.111.0 → 4.113.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.
@@ -0,0 +1,1982 @@
1
+ // src/options.ts
2
+ function unknownKey(opts, keys) {
3
+ if (!opts || typeof opts !== "object") return void 0;
4
+ for (const k of Object.keys(opts)) if (!keys.includes(k)) return k;
5
+ return void 0;
6
+ }
7
+ function refuseUnknownOptions(fn, opts, keys, after = "") {
8
+ const k = unknownKey(opts, keys);
9
+ if (k !== void 0) {
10
+ throw new TypeError(`${fn}: unknown option '${k}'. The keys are ${keys.join(", ")}.${after ? ` ${after}` : ""}`);
11
+ }
12
+ }
13
+
14
+ // src/v2/types.generated.ts
15
+ var ELEMENT_TYPES = ["ability", "character", "collective", "construct", "creature", "event", "family", "institution", "language", "law", "location", "map", "marker", "narrative", "object", "phenomenon", "pin", "relation", "species", "title", "trait", "zone"];
16
+ var ONLYWORLDS_VERSION = "00.33.00";
17
+ var ELEMENT_GROUPS = {
18
+ ability: "amber",
19
+ character: "blue",
20
+ collective: "blue",
21
+ construct: "pink",
22
+ creature: "blue",
23
+ event: "amber",
24
+ family: "blue",
25
+ institution: "blue",
26
+ language: "pink",
27
+ law: "pink",
28
+ location: "green",
29
+ map: "green",
30
+ marker: "green",
31
+ narrative: "amber",
32
+ object: "green",
33
+ phenomenon: "amber",
34
+ pin: "green",
35
+ relation: "amber",
36
+ species: "blue",
37
+ title: "pink",
38
+ trait: "pink",
39
+ zone: "green"
40
+ };
41
+ var GROUP_ORDER = ["blue", "green", "pink", "amber"];
42
+ var GROUP_COLORS = {
43
+ blue: { light: "#2a78d6", dark: "#3987e5" },
44
+ green: { light: "#008300", dark: "#008300" },
45
+ pink: { light: "#e87ba4", dark: "#d55181" },
46
+ amber: { light: "#eda100", dark: "#c98500" }
47
+ };
48
+ var ELEMENT_ICONS = {
49
+ ability: "auto_fix_normal",
50
+ character: "person",
51
+ collective: "groups_3",
52
+ construct: "api",
53
+ creature: "bug_report",
54
+ event: "saved_search",
55
+ family: "supervisor_account",
56
+ institution: "account_balance",
57
+ language: "edit_road",
58
+ law: "gpp_bad",
59
+ location: "castle",
60
+ map: "map",
61
+ marker: "polyline",
62
+ narrative: "menu_book",
63
+ object: "webhook",
64
+ phenomenon: "thunderstorm",
65
+ pin: "push_pin",
66
+ relation: "link",
67
+ species: "crib",
68
+ title: "military_tech",
69
+ trait: "flaky",
70
+ zone: "pentagon"
71
+ };
72
+ var PUBLIC_FIELDS = {
73
+ ability: [],
74
+ character: ["physicality", "height", "weight", "species", "reputation"],
75
+ collective: [],
76
+ construct: [],
77
+ creature: [],
78
+ event: [],
79
+ family: [],
80
+ institution: [],
81
+ language: [],
82
+ law: [],
83
+ location: [],
84
+ map: [],
85
+ marker: [],
86
+ narrative: [],
87
+ object: [],
88
+ phenomenon: [],
89
+ pin: [],
90
+ relation: [],
91
+ species: [],
92
+ title: [],
93
+ trait: [],
94
+ zone: []
95
+ };
96
+ var ELEMENT_SECTIONS = {
97
+ ability: [
98
+ { name: "Mechanics", order: 1, fields: ["activation", "duration", "potency", "range", "effects", "challenges", "talents", "requisites"] },
99
+ { name: "World", order: 2, fields: ["prevalence", "tradition", "source", "locus", "instruments", "systems"] }
100
+ ],
101
+ character: [
102
+ { name: "Constitution", order: 1, fields: ["physicality", "mentality", "height", "weight", "species", "traits", "abilities"] },
103
+ { name: "Origins", order: 2, fields: ["background", "motivations", "birth_date", "birthplace", "languages"] },
104
+ { name: "World", order: 3, fields: ["reputation", "location", "objects", "institutions"] },
105
+ { name: "Personality", order: 4, fields: ["charisma", "coercion", "competence", "compassion", "creativity", "courage"] },
106
+ { name: "Social", order: 5, fields: ["family", "friends", "rivals"] },
107
+ { name: "TTRPG", order: 6, fields: ["level", "hit_points", "STR", "DEX", "CON", "INT", "WIS", "CHA"] }
108
+ ],
109
+ collective: [
110
+ { name: "Formation", order: 1, fields: ["composition", "count", "formation_date", "operator", "equipment"] },
111
+ { name: "Dynamics", order: 2, fields: ["activity", "disposition", "state", "abilities", "symbolism"] },
112
+ { name: "World", order: 3, fields: ["species", "characters", "creatures", "phenomena"] }
113
+ ],
114
+ construct: [
115
+ { name: "Nature", order: 1, fields: ["rationale", "history", "status", "reach", "start_date", "end_date", "founder", "custodian"] },
116
+ { name: "Involves", order: 2, fields: ["characters", "objects", "locations", "species", "creatures", "institutions", "traits", "collectives", "zones", "abilities", "phenomena", "languages", "families", "relations", "titles", "constructs", "events", "narratives"] }
117
+ ],
118
+ creature: [
119
+ { name: "Biology", order: 1, fields: ["appearance", "weight", "height", "species"] },
120
+ { name: "Behavior", order: 2, fields: ["habits", "demeanor", "traits", "abilities", "languages"] },
121
+ { name: "World", order: 3, fields: ["status", "birth_date", "location", "zone"] },
122
+ { name: "TTRPG", order: 4, fields: ["challenge_rating", "hit_points", "armor_class", "speed", "actions"] }
123
+ ],
124
+ event: [
125
+ { name: "Nature", order: 1, fields: ["history", "challenges", "consequences", "start_date", "end_date", "triggers"] },
126
+ { name: "Involves", order: 2, fields: ["characters", "objects", "locations", "species", "creatures", "institutions", "traits", "collectives", "zones", "abilities", "phenomena", "languages", "families", "relations", "titles", "constructs"] }
127
+ ],
128
+ family: [
129
+ { name: "Identity", order: 1, fields: ["spirit", "history", "traditions", "traits", "abilities", "languages", "ancestors"] },
130
+ { name: "World", order: 2, fields: ["reputation", "estates", "governs", "heirlooms", "creatures"] }
131
+ ],
132
+ institution: [
133
+ { name: "Foundation", order: 1, fields: ["doctrine", "founding_date", "parent_institution"] },
134
+ { name: "Claims", order: 2, fields: ["zones", "objects", "creatures"] },
135
+ { name: "World", order: 3, fields: ["status", "allies", "adversaries", "constructs"] }
136
+ ],
137
+ language: [
138
+ { name: "Structure", order: 1, fields: ["phonology", "grammar", "lexicon", "writing", "classification"] },
139
+ { name: "World", order: 2, fields: ["status", "spread", "dialects"] }
140
+ ],
141
+ law: [
142
+ { name: "Code", order: 1, fields: ["declaration", "purpose", "date", "parent_law", "penalties"] },
143
+ { name: "World", order: 2, fields: ["author", "locations", "zones", "prohibitions", "adjudicators", "enforcers"] }
144
+ ],
145
+ location: [
146
+ { name: "Setting", order: 1, fields: ["form", "function", "founding_date", "parent_location", "populations"] },
147
+ { name: "Politics", order: 2, fields: ["political_climate", "primary_power", "governing_title", "secondary_powers", "zone", "rival", "partner"] },
148
+ { name: "World", order: 3, fields: ["customs", "founders", "cults", "delicacies"] },
149
+ { name: "Production", order: 4, fields: ["extraction_methods", "extraction_goods", "industry_methods", "industry_goods"] },
150
+ { name: "Commerce", order: 5, fields: ["infrastructure", "extraction_markets", "industry_markets", "currencies"] },
151
+ { name: "Construction", order: 6, fields: ["architecture", "buildings", "building_methods"] },
152
+ { name: "Defense", order: 7, fields: ["defensibility", "elevation", "fighters", "defensive_objects"] }
153
+ ],
154
+ map: [
155
+ { name: "Details", order: 1, fields: ["background_color", "hierarchy", "width", "height", "depth", "parent_map", "location"] }
156
+ ],
157
+ marker: [
158
+ { name: "Details", order: 1, fields: ["map", "zone", "x", "y", "z", "order"] }
159
+ ],
160
+ narrative: [
161
+ { name: "Context", order: 1, fields: ["story", "consequences", "start_date", "end_date", "order", "parent_narrative", "protagonist", "antagonist", "narrator", "conservator"] },
162
+ { name: "Involves", order: 2, fields: ["events", "characters", "objects", "locations", "species", "creatures", "institutions", "traits", "collectives", "zones", "abilities", "phenomena", "languages", "families", "relations", "titles", "constructs", "laws"] }
163
+ ],
164
+ object: [
165
+ { name: "Form", order: 1, fields: ["aesthetics", "weight", "amount", "parent_object", "materials", "technology"] },
166
+ { name: "Function", order: 2, fields: ["utility", "effects", "abilities", "consumes"] },
167
+ { name: "World", order: 3, fields: ["origins", "location", "language", "affinities"] }
168
+ ],
169
+ phenomenon: [
170
+ { name: "Mechanics", order: 1, fields: ["expression", "effects", "duration", "catalysts", "empowerments"] },
171
+ { name: "World", order: 2, fields: ["mythology", "system", "triggers", "wielders", "environments"] }
172
+ ],
173
+ pin: [
174
+ { name: "Details", order: 1, fields: ["map", "element", "x", "y", "z"] }
175
+ ],
176
+ relation: [
177
+ { name: "Nature", order: 1, fields: ["background", "start_date", "end_date", "intensity", "actor", "events"] },
178
+ { name: "Involves", order: 2, fields: ["characters", "objects", "locations", "species", "creatures", "institutions", "traits", "collectives", "zones", "abilities", "phenomena", "languages", "families", "titles", "constructs", "narratives"] }
179
+ ],
180
+ species: [
181
+ { name: "Biology", order: 1, fields: ["appearance", "life_span", "weight", "nourishment", "reproduction", "adaptations"] },
182
+ { name: "Psychology", order: 2, fields: ["instincts", "sociality", "temperament", "communication", "aggression", "traits"] },
183
+ { name: "World", order: 3, fields: ["role", "parent_species", "locations", "zones", "affinities"] }
184
+ ],
185
+ title: [
186
+ { name: "Mandate", order: 1, fields: ["authority", "eligibility", "grant_date", "revoke_date", "issuer", "body", "superior_title", "holders", "symbols"] },
187
+ { name: "World", order: 2, fields: ["status", "history", "characters", "institutions", "families", "zones", "locations", "objects", "constructs", "laws", "collectives", "creatures", "phenomena", "species", "languages"] }
188
+ ],
189
+ trait: [
190
+ { name: "Qualitative", order: 1, fields: ["social_effects", "physical_effects", "functional_effects", "personality_effects", "behaviour_effects"] },
191
+ { name: "Quantitative", order: 2, fields: ["charisma", "coercion", "competence", "compassion", "creativity", "courage"] },
192
+ { name: "World", order: 3, fields: ["significance", "anti_trait", "empowered_abilities"] }
193
+ ],
194
+ zone: [
195
+ { name: "Scope", order: 1, fields: ["role", "shape", "start_date", "end_date", "phenomena", "linked_zones"] },
196
+ { name: "World", order: 2, fields: ["context", "populations", "titles", "principles"] }
197
+ ]
198
+ };
199
+ var ROOM_PAIRS = [
200
+ { type: "narrative", supertype: "Message" },
201
+ { type: "narrative", supertype: "Board" },
202
+ { type: "relation", supertype: "Work item" },
203
+ { type: "construct", supertype: "Spec" },
204
+ { type: "relation", supertype: "Heart" },
205
+ { type: "relation", supertype: "Take" },
206
+ { type: "relation", supertype: "Vote" },
207
+ { type: "event", supertype: "Sitting" },
208
+ { type: "character", supertype: "Member" }
209
+ ];
210
+ var ROOM_MARK = "x_room_of";
211
+ var READING_AID_PAIRS = [
212
+ { type: "law", supertype: "charter" },
213
+ { type: "construct", supertype: "guide" },
214
+ { type: "construct", supertype: "domain" }
215
+ ];
216
+ var READING_AID_MARK = "x_charter_of";
217
+ var CHARTER_PAIRS = [
218
+ { type: "law", supertype: "Charter", aid: "charter" },
219
+ { type: "construct", supertype: "Guide", aid: "guide" },
220
+ { type: "construct", supertype: "Domain", aid: "domain" }
221
+ ];
222
+ var REVIEW_PROPOSED_LABEL = "proposed, not yet reviewed";
223
+ var MESSAGE_PAIR = { type: "narrative", supertype: "Message" };
224
+ var MESSAGE_READ_MARK = {
225
+ type: "relation",
226
+ supertype: "Read",
227
+ readerField: "actor",
228
+ messagesField: "narratives"
229
+ };
230
+ var NOTE_PAIR = { type: "narrative", supertype: "Note" };
231
+ var FIELD_SCHEMA = {
232
+ ability: {
233
+ // Base fields (shared by all elements)
234
+ name: { type: "text", required: true },
235
+ description: { type: "text", required: false },
236
+ supertype: { type: "text", required: false },
237
+ subtype: { type: "text", required: false },
238
+ image_url: { type: "text", required: false },
239
+ // Mechanics
240
+ activation: { type: "text" },
241
+ duration: { type: "integer" },
242
+ potency: { type: "integer" },
243
+ range: { type: "integer" },
244
+ effects: { type: "multi_link", target: "phenomenon" },
245
+ challenges: { type: "text" },
246
+ talents: { type: "multi_link", target: "trait" },
247
+ requisites: { type: "multi_link", target: "construct" },
248
+ // World
249
+ prevalence: { type: "text" },
250
+ tradition: { type: "single_link", target: "construct" },
251
+ source: { type: "single_link", target: "phenomenon" },
252
+ locus: { type: "single_link", target: "location" },
253
+ instruments: { type: "multi_link", target: "object" },
254
+ systems: { type: "multi_link", target: "construct" }
255
+ },
256
+ character: {
257
+ // Base fields (shared by all elements)
258
+ name: { type: "text", required: true },
259
+ description: { type: "text", required: false },
260
+ supertype: { type: "text", required: false },
261
+ subtype: { type: "text", required: false },
262
+ image_url: { type: "text", required: false },
263
+ // Constitution
264
+ physicality: { type: "text" },
265
+ mentality: { type: "text" },
266
+ height: { type: "integer" },
267
+ weight: { type: "integer" },
268
+ species: { type: "multi_link", target: "species" },
269
+ traits: { type: "multi_link", target: "trait" },
270
+ abilities: { type: "multi_link", target: "ability" },
271
+ // Origins
272
+ background: { type: "text" },
273
+ motivations: { type: "text" },
274
+ birth_date: { type: "integer" },
275
+ birthplace: { type: "single_link", target: "location" },
276
+ languages: { type: "multi_link", target: "language" },
277
+ // World
278
+ reputation: { type: "text" },
279
+ location: { type: "single_link", target: "location" },
280
+ objects: { type: "multi_link", target: "object" },
281
+ institutions: { type: "multi_link", target: "institution" },
282
+ // Personality
283
+ charisma: { type: "integer" },
284
+ coercion: { type: "integer" },
285
+ competence: { type: "integer" },
286
+ compassion: { type: "integer" },
287
+ creativity: { type: "integer" },
288
+ courage: { type: "integer" },
289
+ // Social
290
+ family: { type: "multi_link", target: "family" },
291
+ friends: { type: "multi_link", target: "character" },
292
+ rivals: { type: "multi_link", target: "character" },
293
+ // TTRPG
294
+ level: { type: "integer" },
295
+ hit_points: { type: "integer" },
296
+ STR: { type: "integer" },
297
+ DEX: { type: "integer" },
298
+ CON: { type: "integer" },
299
+ INT: { type: "integer" },
300
+ WIS: { type: "integer" },
301
+ CHA: { type: "integer" }
302
+ },
303
+ collective: {
304
+ // Base fields (shared by all elements)
305
+ name: { type: "text", required: true },
306
+ description: { type: "text", required: false },
307
+ supertype: { type: "text", required: false },
308
+ subtype: { type: "text", required: false },
309
+ image_url: { type: "text", required: false },
310
+ // Formation
311
+ composition: { type: "text" },
312
+ count: { type: "integer" },
313
+ formation_date: { type: "integer" },
314
+ operator: { type: "single_link", target: "institution" },
315
+ equipment: { type: "multi_link", target: "object" },
316
+ // Dynamics
317
+ activity: { type: "text" },
318
+ disposition: { type: "text" },
319
+ state: { type: "text" },
320
+ abilities: { type: "multi_link", target: "ability" },
321
+ symbolism: { type: "multi_link", target: "construct" },
322
+ // World
323
+ species: { type: "multi_link", target: "species" },
324
+ characters: { type: "multi_link", target: "character" },
325
+ creatures: { type: "multi_link", target: "creature" },
326
+ phenomena: { type: "multi_link", target: "phenomenon" }
327
+ },
328
+ construct: {
329
+ // Base fields (shared by all elements)
330
+ name: { type: "text", required: true },
331
+ description: { type: "text", required: false },
332
+ supertype: { type: "text", required: false },
333
+ subtype: { type: "text", required: false },
334
+ image_url: { type: "text", required: false },
335
+ // Nature
336
+ rationale: { type: "text" },
337
+ history: { type: "text" },
338
+ status: { type: "text" },
339
+ reach: { type: "text" },
340
+ start_date: { type: "integer" },
341
+ end_date: { type: "integer" },
342
+ founder: { type: "single_link", target: "character" },
343
+ custodian: { type: "single_link", target: "institution" },
344
+ // Involves
345
+ characters: { type: "multi_link", target: "character" },
346
+ objects: { type: "multi_link", target: "object" },
347
+ locations: { type: "multi_link", target: "location" },
348
+ species: { type: "multi_link", target: "species" },
349
+ creatures: { type: "multi_link", target: "creature" },
350
+ institutions: { type: "multi_link", target: "institution" },
351
+ traits: { type: "multi_link", target: "trait" },
352
+ collectives: { type: "multi_link", target: "collective" },
353
+ zones: { type: "multi_link", target: "zone" },
354
+ abilities: { type: "multi_link", target: "ability" },
355
+ phenomena: { type: "multi_link", target: "phenomenon" },
356
+ languages: { type: "multi_link", target: "language" },
357
+ families: { type: "multi_link", target: "family" },
358
+ relations: { type: "multi_link", target: "relation" },
359
+ titles: { type: "multi_link", target: "title" },
360
+ constructs: { type: "multi_link", target: "construct" },
361
+ events: { type: "multi_link", target: "event" },
362
+ narratives: { type: "multi_link", target: "narrative" }
363
+ },
364
+ creature: {
365
+ // Base fields (shared by all elements)
366
+ name: { type: "text", required: true },
367
+ description: { type: "text", required: false },
368
+ supertype: { type: "text", required: false },
369
+ subtype: { type: "text", required: false },
370
+ image_url: { type: "text", required: false },
371
+ // Biology
372
+ appearance: { type: "text" },
373
+ weight: { type: "integer" },
374
+ height: { type: "integer" },
375
+ species: { type: "multi_link", target: "species" },
376
+ // Behavior
377
+ habits: { type: "text" },
378
+ demeanor: { type: "text" },
379
+ traits: { type: "multi_link", target: "trait" },
380
+ abilities: { type: "multi_link", target: "ability" },
381
+ languages: { type: "multi_link", target: "language" },
382
+ // World
383
+ status: { type: "text" },
384
+ birth_date: { type: "integer" },
385
+ location: { type: "single_link", target: "location" },
386
+ zone: { type: "single_link", target: "zone" },
387
+ // TTRPG
388
+ challenge_rating: { type: "integer" },
389
+ hit_points: { type: "integer" },
390
+ armor_class: { type: "integer" },
391
+ speed: { type: "integer" },
392
+ actions: { type: "multi_link", target: "ability" }
393
+ },
394
+ event: {
395
+ // Base fields (shared by all elements)
396
+ name: { type: "text", required: true },
397
+ description: { type: "text", required: false },
398
+ supertype: { type: "text", required: false },
399
+ subtype: { type: "text", required: false },
400
+ image_url: { type: "text", required: false },
401
+ // Nature
402
+ history: { type: "text" },
403
+ challenges: { type: "text" },
404
+ consequences: { type: "text" },
405
+ start_date: { type: "integer" },
406
+ end_date: { type: "integer" },
407
+ triggers: { type: "multi_link", target: "event" },
408
+ // Involves
409
+ characters: { type: "multi_link", target: "character" },
410
+ objects: { type: "multi_link", target: "object" },
411
+ locations: { type: "multi_link", target: "location" },
412
+ species: { type: "multi_link", target: "species" },
413
+ creatures: { type: "multi_link", target: "creature" },
414
+ institutions: { type: "multi_link", target: "institution" },
415
+ traits: { type: "multi_link", target: "trait" },
416
+ collectives: { type: "multi_link", target: "collective" },
417
+ zones: { type: "multi_link", target: "zone" },
418
+ abilities: { type: "multi_link", target: "ability" },
419
+ phenomena: { type: "multi_link", target: "phenomenon" },
420
+ languages: { type: "multi_link", target: "language" },
421
+ families: { type: "multi_link", target: "family" },
422
+ relations: { type: "multi_link", target: "relation" },
423
+ titles: { type: "multi_link", target: "title" },
424
+ constructs: { type: "multi_link", target: "construct" }
425
+ },
426
+ family: {
427
+ // Base fields (shared by all elements)
428
+ name: { type: "text", required: true },
429
+ description: { type: "text", required: false },
430
+ supertype: { type: "text", required: false },
431
+ subtype: { type: "text", required: false },
432
+ image_url: { type: "text", required: false },
433
+ // Identity
434
+ spirit: { type: "text" },
435
+ history: { type: "text" },
436
+ traditions: { type: "multi_link", target: "construct" },
437
+ traits: { type: "multi_link", target: "trait" },
438
+ abilities: { type: "multi_link", target: "ability" },
439
+ languages: { type: "multi_link", target: "language" },
440
+ ancestors: { type: "multi_link", target: "character" },
441
+ // World
442
+ reputation: { type: "text" },
443
+ estates: { type: "multi_link", target: "location" },
444
+ governs: { type: "multi_link", target: "institution" },
445
+ heirlooms: { type: "multi_link", target: "object" },
446
+ creatures: { type: "multi_link", target: "creature" }
447
+ },
448
+ institution: {
449
+ // Base fields (shared by all elements)
450
+ name: { type: "text", required: true },
451
+ description: { type: "text", required: false },
452
+ supertype: { type: "text", required: false },
453
+ subtype: { type: "text", required: false },
454
+ image_url: { type: "text", required: false },
455
+ // Foundation
456
+ doctrine: { type: "text" },
457
+ founding_date: { type: "integer" },
458
+ parent_institution: { type: "single_link", target: "institution" },
459
+ // Claims
460
+ zones: { type: "multi_link", target: "zone" },
461
+ objects: { type: "multi_link", target: "object" },
462
+ creatures: { type: "multi_link", target: "creature" },
463
+ // World
464
+ status: { type: "text" },
465
+ allies: { type: "multi_link", target: "institution" },
466
+ adversaries: { type: "multi_link", target: "institution" },
467
+ constructs: { type: "multi_link", target: "construct" }
468
+ },
469
+ language: {
470
+ // Base fields (shared by all elements)
471
+ name: { type: "text", required: true },
472
+ description: { type: "text", required: false },
473
+ supertype: { type: "text", required: false },
474
+ subtype: { type: "text", required: false },
475
+ image_url: { type: "text", required: false },
476
+ // Structure
477
+ phonology: { type: "text" },
478
+ grammar: { type: "text" },
479
+ lexicon: { type: "text" },
480
+ writing: { type: "text" },
481
+ classification: { type: "single_link", target: "construct" },
482
+ // World
483
+ status: { type: "text" },
484
+ spread: { type: "multi_link", target: "location" },
485
+ dialects: { type: "multi_link", target: "language" }
486
+ },
487
+ law: {
488
+ // Base fields (shared by all elements)
489
+ name: { type: "text", required: true },
490
+ description: { type: "text", required: false },
491
+ supertype: { type: "text", required: false },
492
+ subtype: { type: "text", required: false },
493
+ image_url: { type: "text", required: false },
494
+ // Code
495
+ declaration: { type: "text" },
496
+ purpose: { type: "text" },
497
+ date: { type: "integer" },
498
+ parent_law: { type: "single_link", target: "law" },
499
+ penalties: { type: "multi_link", target: "construct" },
500
+ // World
501
+ author: { type: "single_link", target: "institution" },
502
+ locations: { type: "multi_link", target: "location" },
503
+ zones: { type: "multi_link", target: "zone" },
504
+ prohibitions: { type: "multi_link", target: "construct" },
505
+ adjudicators: { type: "multi_link", target: "title" },
506
+ enforcers: { type: "multi_link", target: "title" }
507
+ },
508
+ location: {
509
+ // Base fields (shared by all elements)
510
+ name: { type: "text", required: true },
511
+ description: { type: "text", required: false },
512
+ supertype: { type: "text", required: false },
513
+ subtype: { type: "text", required: false },
514
+ image_url: { type: "text", required: false },
515
+ // Setting
516
+ form: { type: "text" },
517
+ function: { type: "text" },
518
+ founding_date: { type: "integer" },
519
+ parent_location: { type: "single_link", target: "location" },
520
+ populations: { type: "multi_link", target: "collective" },
521
+ // Politics
522
+ political_climate: { type: "text" },
523
+ primary_power: { type: "single_link", target: "institution" },
524
+ governing_title: { type: "single_link", target: "title" },
525
+ secondary_powers: { type: "multi_link", target: "institution" },
526
+ zone: { type: "single_link", target: "zone" },
527
+ rival: { type: "single_link", target: "location" },
528
+ partner: { type: "single_link", target: "location" },
529
+ // World
530
+ customs: { type: "text" },
531
+ founders: { type: "multi_link", target: "character" },
532
+ cults: { type: "multi_link", target: "construct" },
533
+ delicacies: { type: "multi_link", target: "species" },
534
+ // Production
535
+ extraction_methods: { type: "multi_link", target: "construct" },
536
+ extraction_goods: { type: "multi_link", target: "construct" },
537
+ industry_methods: { type: "multi_link", target: "construct" },
538
+ industry_goods: { type: "multi_link", target: "construct" },
539
+ // Commerce
540
+ infrastructure: { type: "text" },
541
+ extraction_markets: { type: "multi_link", target: "location" },
542
+ industry_markets: { type: "multi_link", target: "location" },
543
+ currencies: { type: "multi_link", target: "construct" },
544
+ // Construction
545
+ architecture: { type: "text" },
546
+ buildings: { type: "multi_link", target: "object" },
547
+ building_methods: { type: "multi_link", target: "construct" },
548
+ // Defense
549
+ defensibility: { type: "text" },
550
+ elevation: { type: "integer" },
551
+ fighters: { type: "multi_link", target: "construct" },
552
+ defensive_objects: { type: "multi_link", target: "object" }
553
+ },
554
+ map: {
555
+ // Base fields (shared by all elements)
556
+ name: { type: "text", required: true },
557
+ description: { type: "text", required: false },
558
+ supertype: { type: "text", required: false },
559
+ subtype: { type: "text", required: false },
560
+ image_url: { type: "text", required: false },
561
+ // Details
562
+ background_color: { type: "text" },
563
+ hierarchy: { type: "integer" },
564
+ width: { type: "integer" },
565
+ height: { type: "integer" },
566
+ depth: { type: "integer" },
567
+ parent_map: { type: "single_link", target: "map" },
568
+ location: { type: "single_link", target: "location" }
569
+ },
570
+ marker: {
571
+ // Base fields (shared by all elements)
572
+ name: { type: "text", required: true },
573
+ description: { type: "text", required: false },
574
+ supertype: { type: "text", required: false },
575
+ subtype: { type: "text", required: false },
576
+ image_url: { type: "text", required: false },
577
+ // Details
578
+ map: { type: "single_link", target: "map" },
579
+ zone: { type: "single_link", target: "zone" },
580
+ x: { type: "integer" },
581
+ y: { type: "integer" },
582
+ z: { type: "integer" },
583
+ order: { type: "integer" }
584
+ },
585
+ narrative: {
586
+ // Base fields (shared by all elements)
587
+ name: { type: "text", required: true },
588
+ description: { type: "text", required: false },
589
+ supertype: { type: "text", required: false },
590
+ subtype: { type: "text", required: false },
591
+ image_url: { type: "text", required: false },
592
+ // Context
593
+ story: { type: "text" },
594
+ consequences: { type: "text" },
595
+ start_date: { type: "integer" },
596
+ end_date: { type: "integer" },
597
+ order: { type: "integer" },
598
+ parent_narrative: { type: "single_link", target: "narrative" },
599
+ protagonist: { type: "single_link", target: "character" },
600
+ antagonist: { type: "single_link", target: "character" },
601
+ narrator: { type: "single_link", target: "character" },
602
+ conservator: { type: "single_link", target: "institution" },
603
+ // Involves
604
+ events: { type: "multi_link", target: "event" },
605
+ characters: { type: "multi_link", target: "character" },
606
+ objects: { type: "multi_link", target: "object" },
607
+ locations: { type: "multi_link", target: "location" },
608
+ species: { type: "multi_link", target: "species" },
609
+ creatures: { type: "multi_link", target: "creature" },
610
+ institutions: { type: "multi_link", target: "institution" },
611
+ traits: { type: "multi_link", target: "trait" },
612
+ collectives: { type: "multi_link", target: "collective" },
613
+ zones: { type: "multi_link", target: "zone" },
614
+ abilities: { type: "multi_link", target: "ability" },
615
+ phenomena: { type: "multi_link", target: "phenomenon" },
616
+ languages: { type: "multi_link", target: "language" },
617
+ families: { type: "multi_link", target: "family" },
618
+ relations: { type: "multi_link", target: "relation" },
619
+ titles: { type: "multi_link", target: "title" },
620
+ constructs: { type: "multi_link", target: "construct" },
621
+ laws: { type: "multi_link", target: "law" }
622
+ },
623
+ object: {
624
+ // Base fields (shared by all elements)
625
+ name: { type: "text", required: true },
626
+ description: { type: "text", required: false },
627
+ supertype: { type: "text", required: false },
628
+ subtype: { type: "text", required: false },
629
+ image_url: { type: "text", required: false },
630
+ // Form
631
+ aesthetics: { type: "text" },
632
+ weight: { type: "integer" },
633
+ amount: { type: "integer" },
634
+ parent_object: { type: "single_link", target: "object" },
635
+ materials: { type: "multi_link", target: "construct" },
636
+ technology: { type: "multi_link", target: "construct" },
637
+ // Function
638
+ utility: { type: "text" },
639
+ effects: { type: "multi_link", target: "phenomenon" },
640
+ abilities: { type: "multi_link", target: "ability" },
641
+ consumes: { type: "multi_link", target: "construct" },
642
+ // World
643
+ origins: { type: "text" },
644
+ location: { type: "single_link", target: "location" },
645
+ language: { type: "single_link", target: "language" },
646
+ affinities: { type: "multi_link", target: "trait" }
647
+ },
648
+ phenomenon: {
649
+ // Base fields (shared by all elements)
650
+ name: { type: "text", required: true },
651
+ description: { type: "text", required: false },
652
+ supertype: { type: "text", required: false },
653
+ subtype: { type: "text", required: false },
654
+ image_url: { type: "text", required: false },
655
+ // Mechanics
656
+ expression: { type: "text" },
657
+ effects: { type: "text" },
658
+ duration: { type: "integer" },
659
+ catalysts: { type: "multi_link", target: "object" },
660
+ empowerments: { type: "multi_link", target: "ability" },
661
+ // World
662
+ mythology: { type: "text" },
663
+ system: { type: "single_link", target: "phenomenon" },
664
+ triggers: { type: "multi_link", target: "construct" },
665
+ wielders: { type: "multi_link", target: "character" },
666
+ environments: { type: "multi_link", target: "location" }
667
+ },
668
+ pin: {
669
+ // Base fields (shared by all elements)
670
+ name: { type: "text", required: true },
671
+ description: { type: "text", required: false },
672
+ supertype: { type: "text", required: false },
673
+ subtype: { type: "text", required: false },
674
+ image_url: { type: "text", required: false },
675
+ // Details
676
+ map: { type: "single_link", target: "map" },
677
+ element_type: { type: "text" },
678
+ element_id: { type: "single_link", target: "any" },
679
+ x: { type: "integer" },
680
+ y: { type: "integer" },
681
+ z: { type: "integer" }
682
+ },
683
+ relation: {
684
+ // Base fields (shared by all elements)
685
+ name: { type: "text", required: true },
686
+ description: { type: "text", required: false },
687
+ supertype: { type: "text", required: false },
688
+ subtype: { type: "text", required: false },
689
+ image_url: { type: "text", required: false },
690
+ // Nature
691
+ background: { type: "text" },
692
+ start_date: { type: "integer" },
693
+ end_date: { type: "integer" },
694
+ intensity: { type: "integer" },
695
+ actor: { type: "single_link", target: "character" },
696
+ events: { type: "multi_link", target: "event" },
697
+ // Involves
698
+ characters: { type: "multi_link", target: "character" },
699
+ objects: { type: "multi_link", target: "object" },
700
+ locations: { type: "multi_link", target: "location" },
701
+ species: { type: "multi_link", target: "species" },
702
+ creatures: { type: "multi_link", target: "creature" },
703
+ institutions: { type: "multi_link", target: "institution" },
704
+ traits: { type: "multi_link", target: "trait" },
705
+ collectives: { type: "multi_link", target: "collective" },
706
+ zones: { type: "multi_link", target: "zone" },
707
+ abilities: { type: "multi_link", target: "ability" },
708
+ phenomena: { type: "multi_link", target: "phenomenon" },
709
+ languages: { type: "multi_link", target: "language" },
710
+ families: { type: "multi_link", target: "family" },
711
+ titles: { type: "multi_link", target: "title" },
712
+ constructs: { type: "multi_link", target: "construct" },
713
+ narratives: { type: "multi_link", target: "narrative" }
714
+ },
715
+ species: {
716
+ // Base fields (shared by all elements)
717
+ name: { type: "text", required: true },
718
+ description: { type: "text", required: false },
719
+ supertype: { type: "text", required: false },
720
+ subtype: { type: "text", required: false },
721
+ image_url: { type: "text", required: false },
722
+ // Biology
723
+ appearance: { type: "text" },
724
+ life_span: { type: "integer" },
725
+ weight: { type: "integer" },
726
+ nourishment: { type: "multi_link", target: "species" },
727
+ reproduction: { type: "multi_link", target: "construct" },
728
+ adaptations: { type: "multi_link", target: "ability" },
729
+ // Psychology
730
+ instincts: { type: "text" },
731
+ sociality: { type: "text" },
732
+ temperament: { type: "text" },
733
+ communication: { type: "text" },
734
+ aggression: { type: "integer" },
735
+ traits: { type: "multi_link", target: "trait" },
736
+ // World
737
+ role: { type: "text" },
738
+ parent_species: { type: "single_link", target: "species" },
739
+ locations: { type: "multi_link", target: "location" },
740
+ zones: { type: "multi_link", target: "zone" },
741
+ affinities: { type: "multi_link", target: "phenomenon" }
742
+ },
743
+ title: {
744
+ // Base fields (shared by all elements)
745
+ name: { type: "text", required: true },
746
+ description: { type: "text", required: false },
747
+ supertype: { type: "text", required: false },
748
+ subtype: { type: "text", required: false },
749
+ image_url: { type: "text", required: false },
750
+ // Mandate
751
+ authority: { type: "text" },
752
+ eligibility: { type: "text" },
753
+ grant_date: { type: "integer" },
754
+ revoke_date: { type: "integer" },
755
+ issuer: { type: "single_link", target: "institution" },
756
+ body: { type: "single_link", target: "institution" },
757
+ superior_title: { type: "single_link", target: "title" },
758
+ holders: { type: "multi_link", target: "character" },
759
+ symbols: { type: "multi_link", target: "object" },
760
+ // World
761
+ status: { type: "text" },
762
+ history: { type: "text" },
763
+ characters: { type: "multi_link", target: "character" },
764
+ institutions: { type: "multi_link", target: "institution" },
765
+ families: { type: "multi_link", target: "family" },
766
+ zones: { type: "multi_link", target: "zone" },
767
+ locations: { type: "multi_link", target: "location" },
768
+ objects: { type: "multi_link", target: "object" },
769
+ constructs: { type: "multi_link", target: "construct" },
770
+ laws: { type: "multi_link", target: "law" },
771
+ collectives: { type: "multi_link", target: "collective" },
772
+ creatures: { type: "multi_link", target: "creature" },
773
+ phenomena: { type: "multi_link", target: "phenomenon" },
774
+ species: { type: "multi_link", target: "species" },
775
+ languages: { type: "multi_link", target: "language" }
776
+ },
777
+ trait: {
778
+ // Base fields (shared by all elements)
779
+ name: { type: "text", required: true },
780
+ description: { type: "text", required: false },
781
+ supertype: { type: "text", required: false },
782
+ subtype: { type: "text", required: false },
783
+ image_url: { type: "text", required: false },
784
+ // Qualitative
785
+ social_effects: { type: "text" },
786
+ physical_effects: { type: "text" },
787
+ functional_effects: { type: "text" },
788
+ personality_effects: { type: "text" },
789
+ behaviour_effects: { type: "text" },
790
+ // Quantitative
791
+ charisma: { type: "integer" },
792
+ coercion: { type: "integer" },
793
+ competence: { type: "integer" },
794
+ compassion: { type: "integer" },
795
+ creativity: { type: "integer" },
796
+ courage: { type: "integer" },
797
+ // World
798
+ significance: { type: "text" },
799
+ anti_trait: { type: "single_link", target: "trait" },
800
+ empowered_abilities: { type: "multi_link", target: "ability" }
801
+ },
802
+ zone: {
803
+ // Base fields (shared by all elements)
804
+ name: { type: "text", required: true },
805
+ description: { type: "text", required: false },
806
+ supertype: { type: "text", required: false },
807
+ subtype: { type: "text", required: false },
808
+ image_url: { type: "text", required: false },
809
+ // Scope
810
+ role: { type: "text" },
811
+ shape: { type: "text" },
812
+ start_date: { type: "integer" },
813
+ end_date: { type: "integer" },
814
+ phenomena: { type: "multi_link", target: "phenomenon" },
815
+ linked_zones: { type: "multi_link", target: "zone" },
816
+ // World
817
+ context: { type: "text" },
818
+ populations: { type: "multi_link", target: "collective" },
819
+ titles: { type: "multi_link", target: "title" },
820
+ principles: { type: "multi_link", target: "construct" }
821
+ }
822
+ };
823
+
824
+ // src/v2/types.ts
825
+ var SPATIAL_TYPES = ["map", "pin", "marker", "zone"];
826
+ var AGENT_DOORS = ["seat", "mcp", "declared"];
827
+ function isAgentDoor(door) {
828
+ return door != null && AGENT_DOORS.includes(door);
829
+ }
830
+ function isKnownOf(element) {
831
+ return element != null && element.known_of === true;
832
+ }
833
+
834
+ // src/nfc-tables.generated.ts
835
+ var NFC_CLASS_RUNS = "lc.l.6e,lx..6g,ly.4.64,m2..6g,m3..60,m4.5.64,m9.2.5m,mb.4.64,mf.2.5m,mh.b.64,ms.5.1,mx.4.64,n1.8.6e,n9..6o,na..6e,nb.3.64,ne.3.6e,nh.2.64,nk.3.6e,nn.4.64,nr..6e,ns..6g,nt.2.64,nv..6e,nw..6h,nx.2.6i,nz..6h,o0.2.6i,o2..6h,o3.d.6e,w3.5.6e,13l..64,13m.4.6e,13q..64,13r.3.6e,13u..66,13v..64,13w.6.6e,142.6.64,148.2.6e,14a..64,14b.2.6e,14d..66,14e..6c,14f..6e,14g..a,14h..b,14i..c,14j..d,14k..e,14l..f,14m..g,14n..h,14o..i,14p.2.j,14r..k,14s..l,14t..m,14v..n,14x..o,14y..p,150..6e,151..64,153..i,174.8.6e,17c..u,17d..v,17e..w,18r..r,18s..s,18t..t,18u..u,18v..v,18w..w,18x..x,18y..y,18z.2.6e,191.2.64,193.5.6e,198..64,199.2.6e,19b..64,19s..z,1cm.7.6e,1cv.4.6e,1cz..64,1d0..6e,1d3.2.6e,1d6..64,1d7.2.6e,1d9..64,1e9..10,1f4..6e,1f5..64,1f6.2.6e,1f8..64,1f9.2.6e,1fb.3.64,1fe..6e,1ff.2.64,1fh..6e,1fi..64,1fj.3.6e,1fm..64,1fn..6e,1fo..64,1fp..6e,1fq..64,1fr..6e,1fs..64,1ft.2.6e,1kb.7.6e,1ki..64,1kj..6e,1kt..64,1li.4.6e,1ln.9.6e,1lx.3.6e,1m1.5.6e,1nd.3.64,1p4..6e,1p5.3.64,1p8.4.6e,1qi.5.6e,1qn.5.64,1qs.e.6e,1r7..64,1r8.2.6e,1ra..64,1rb.2.6e,1rd..64,1re.3.6e,1rh.3.64,1rk..r,1rl..s,1rm..t,1rn.3.6e,1rq..64,1rr.2.6e,1rt.2.64,1rv.5.6e,1to..7,1u5..9,1u9..6e,1ua..64,1ub.2.6e,1x8..7,1xp..9,1z2..6e,20s..7,219..9,24c..7,24t..9,27w..7,28d..9,2bx..9,2f0..7,2fh..9,2fp..2c,2fq..2j,2ik..7,2j1..9,2m3.2.9,2ml..9,2q2..9,2t4.2.2v,2t6..9,2tk.4.2z,2wo.2.3a,2wq..9,2x4.4.3e,2zc.2.64,305..64,307..64,309..60,31t..3l,31u..3m,31w..3o,322.4.3m,328..3m,32a.2.6e,32c..9,32e.2.6e,346..64,37b..7,37d.2.9,39p..64,3tp.3.6e,4k4.2.9,4l0..9,4pe..9,4pp..6e,4vd..6c,4zd..66,4ze..6e,4zf..64,55j..6e,55k..64,57k..9,585.8.6e,58f..64,59s.5.6e,59x.6.64,5a3.2.6e,5a5..64,5a7.2.64,5a9.2.6e,5ab.2.64,5ad.5.6e,5ai..64,5aj.4.6e,5dg..7,5dw..9,5ez..6e,5f0..64,5f1.7.6e,5gq.2.9,5ie..7,5iq.2.9,5kn..7,5ow.3.6e,5p0..1,5p1.5.64,5p6.2.6e,5p8.4.64,5pc..6e,5pe.7.1,5pp..64,5pw..6e,5q0.2.6e,5vk.2.6e,5vm..64,5vn.7.6e,5vu..64,5vv.2.6e,5vx..6i,5vy..5y,5vz..64,5w0..5m,5w1.11.6e,5x2..6g,5x3.2.6c,5x5..64,5x6..62,5x7..6e,5x8..6h,5x9..64,5xa..6e,5xb..64,6hc.2.6e,6he.2.1,6hg.4.6e,6hk.3.1,6hn.2.6e,6ht..6e,6hx.2.1,6hz..6e,6i0..64,6i1..6e,6i2.2.1,6i4.4.64,6i8..6e,8vj.3.6e,8zj..9,928.w.6e,9ii..62,9ij..6c,9ik..6g,9il..66,9im.2.68,9ll.2.8,wvj..6e,wvo.a.6e,wwu.2.6e,wz4.2.6e,x6u..9,x7w..9,xc4..9,xcw.i.6e,xez.3.64,xg3..9,xir..7,xj4..9,xps..6e,xpu.2.6e,xpw..64,xpz.2.6e,xq6.2.6e,xq9..6e,xrq..9,xyl..9,1dlq..q,1e74.7.6e,1e7b.7.64,1e7i.2.6e,1eyl..64,1f4w..64,1f92.5.6e,1gjx..64,1gjz..6e,1gl4..6e,1gl5..1,1gl6..64,1glb..9,1gpx..6e,1gpy..64,1h5w.4.6e,1hgr.2.6e,1hj1.3.64,1hl2.2.64,1hl4.3.6e,1hl7..64,1hl8..6e,1hl9.4.64,1hmq..6e,1hmr..64,1hms..6e,1hmt..64,1hs6..9,1htc..9,1htr..9,1hvd..9,1hve..7,1hxc.3.6e,1hyr.2.9,1i0j..7,1i2o..9,1i2y..7,1i5x..9,1i5y..7,1iax..7,1iay..9,1id7.2.7,1idp..9,1iee.7.6e,1ieo.5.6e,1iki..9,1ikm..7,1ila..6e,1io2..9,1io3..7,1iv3..9,1iv4..7,1iyn..9,1j1y..9,1j1z..7,1j57..9,1jcp..9,1jcq..7,1jjx.2.9,1jk3..7,1jog..9,1jqs..9,1jrb..9,1jtl..9,1k5b..9,1kci..7,1kck.2.9,1kev..9,1kqp.2.9,1zow.5.1,1zqo.7.6e,20og.2.6,2ftq..1,2jxh.2.60,2jxj.3.1,2jxp..6a,2jxq.5.60,2jy3.8.64,2jyd.5.6e,2jyi.2.64,2jze.4.6e,2k3m.3.6e,2mtc.7.6e,2mtk.h.6e,2mu3.7.6e,2mub.2.6e,2mue.5.6e,2mxb..6e,2n1s.7.6e,2nce..6e,2ne4.4.6e,2nsc.2.6g,2nse..64,2nsf..6e,2ok0.7.64,2on8.6.6e,2one..7";
836
+ var NFC_DECOMP = "5c.1t.lc,1.1t.ld,1.1t.le,1.1t.lf,1.1t.lk,1.1t.lm,2.1v.mf,1.1x.lc,1.1x.ld,1.1x.le,1.1x.lk,1.21.lc,1.21.ld,1.21.le,1.21.lk,2.26.lf,1.27.lc,1.27.ld,1.27.le,1.27.lf,1.27.lk,3.2d.lc,1.2d.ld,1.2d.le,1.2d.lk,1.2h.ld,3.2p.lc,1.2p.ld,1.2p.le,1.2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,1.sw.lk,1.ts.lk,3.t1.li,1.tx.li,3.yg.lk,1.yh.lk,1.t2.lk,1.ty.lk,1.t3.lk,1.tz.lk,3.t4.lg,1.u0.lg,1.t4.lk,1.u0.lk,1.ta.lk,1.u6.lk,3.yw.lk,1.yx.lk,1.tp.lk,1.ul.lk,1.tf.lg,1.ub.lg,1.tf.lk,1.ub.lk,1.tf.ln,1.ub.ln,1.tj.lk,1.uf.lk,3.tn.lk,1.uj.lk,89.17r.18z,1.17r.190,1.18o.190,1.17r.191,1.18q.190,4a.1cl.190,2.1c1.190,h.1ci.190,gm.1t4.1to,8.1tc.1to,3.1tf.1to,10.1sl.1to,1.1sm.1to,1.1sn.1to,1.1ss.1to,1.1sx.1to,1.1sy.1to,1.1t7.1to,1.1tb.1to,30.1xj.1xa,1.1xj.1xz,g.1wh.1x8,1.1wi.1x8,2.1wv.1x8,2c.20i.20s,3.20o.20s,z.1zq.20s,1.1zr.20s,1.1zw.20s,3.20b.20s,6i.287.28m,3.287.27y,1.287.28n,g.275.27w,1.276.27w,1j.2aa.2c7,1i.2bq.2bi,1.2br.2bi,1.2bq.2c7,3g.2fa.2fq,3c.2in.2j9,7.2iu.2j9,1.2iu.2ja,2.2iu.2iq,1.2iy.2j9,3j.2me.2m6,1.2mf.2m6,1.2me.2mv,3y.2qh.2q2,2.2qh.2q7,1.2qk.2q2,1.2qh.2qn,9x.30i.33r,a.30s.33r,5.30x.33r,5.312.33r,5.317.33r,d.30g.33p,a.31t.31u,2.31t.31w,1.33m.328,2.33n.328,9.31t.328,i.32q.33r,a.330.33r,5.335.33r,5.33a.33r,5.33f.33r,d.32o.33p,31.36t.372,25c.5c5.5dh,2.5c7.5dh,2.5c9.5dh,2.5cb.5dh,2.5cd.5dh,4.5ch.5dh,15.5dm.5dh,2.5do.5dh,3.5dq.5dh,1.5dr.5dh,2.5du.5dh,jh.1t.md,1.2p.md,1.1u.lj,1.2q.lj,1.1u.mb,1.2q.mb,1.1u.mp,1.2q.mp,1.5j.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1.65c.lc,1.65d.lc,1.65c.ld,1.65d.ld,1.65c.n6,1.65d.n6,1.pj.lv,1.pj.lw,1.65k.lc,1.65l.lc,1.65k.ld,1.65l.ld,1.65k.n6,1.65l.n6,1.qh.lv,1.qh.lw,1.65s.lc,1.65t.lc,1.65s.ld,1.65t.ld,1.65s.n6,1.65t.n6,1.pl.lv,1.pl.lw,1.660.lc,1.661.lc,1.660.ld,1.661.ld,1.660.n6,1.661.n6,1.qn.lv,1.qn.lw,1.668.lc,1.669.lc,1.668.ld,1.669.ld,3.pr.lv,1.pr.lw,1.66g.lc,1.66h.lc,1.66g.ld,1.66h.ld,3.qt.lv,1.qt.lw,1.66o.lc,1.66p.lc,1.66o.ld,1.66p.ld,1.66o.n6,1.66p.n6,2.px.lw,2.66x.lc,2.66x.ld,2.66x.n6,1.qx.lv,1.qx.lw,1.674.lc,1.675.lc,1.674.ld,1.675.ld,1.674.n6,1.675.n6,1.q1.lv,1.q1.lw,1.67c.lc,1.67d.lc,1.67c.ld,1.67d.ld,1.67c.n6,1.67d.n6,1.q9.lc,1.q4,1.qd.lc,1.q5,1.qf.lc,1.q6,1.qh.lc,1.q7,1.qn.lc,1.r0,1.qt.lc,1.r1,1.qx.lc,1.r2,3.64g.n9,1.64h.n9,1.64i.n9,1.64j.n9,1.64k.n9,1.64l.n9,1.64m.n9,1.64n.n9,1.64o.n9,1.64p.n9,1.64q.n9,1.64r.n9,1.64s.n9,1.64t.n9,1.64u.n9,1.64v.n9,1.65c.n9,1.65d.n9,1.65e.n9,1.65f.n9,1.65g.n9,1.65h.n9,1.65i.n9,1.65j.n9,1.65k.n9,1.65l.n9,1.65m.n9,1.65n.n9,1.65o.n9,1.65p.n9,1.65q.n9,1.65r.n9,1.674.n9,1.675.n9,1.676.n9,1.677.n9,1.678.n9,1.679.n9,1.67a.n9,1.67b.n9,1.67c.n9,1.67d.n9,1.67e.n9,1.67f.n9,1.67g.n9,1.67h.n9,1.67i.n9,1.67j.n9,1.q9.li,1.q9.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39e1,1.3bgw,1.3i6r,1.vgj,1.vim,1w.15l.14k,2.16a.14n,b.161.14x,1.161.14y,1.1dmx.14x,1.1dmx.14y,1.15c.14n,1.15c.14o,1.15c.14s,1.15d.14s,1.15e.14s,1.15f.14s,1.15g.14s,1.15h.14s,1.15i.14s,2.15k.14s,1.15l.14s,1.15m.14s,1.15n.14s,1.15o.14s,2.15q.14s,2.15s.14s,1.15t.14s,2.15v.14s,1.15w.14s,2.15y.14s,1.15z.14s,1.160.14s,1.161.14s,1.162.14s,1.15h.14p,1.15d.14v,1.15n.14v,1.15w.14v,47g.1huh.1hve,2.1huj.1hve,f.1hut.1hve,3n.1hyp.1hyf,1.1hyq.1hyf,f0.1idj.1ida,1.1idj.1idz,a7.1int.1inu,1.1int.1ink,2.1int.1inx,70.1iuw.1iun,1.1iux.1iun,ot.1jjp.1jjk,10di.2jx3.2jxh,1.2jx4.2jxh,1.2jxb.2jxq,1.2jxb.2jxr,1.2jxb.2jxs,1.2jxb.2jxt,1.2jxb.2jxu,2f.2jzt.2jxh,1.2jzu.2jxh,1.2jzv.2jxq,1.2jzw.2jxq,1.2jzv.2jxr,1.2jzw.2jxr,1m4g.fgd,1.fg8,1.fgh,1.2tcy,1.fog,1.fqm,1.fqz,1.fsy,1.fwa,1.fx5,1.fzb,1.fyn,1.ae6,1.2ud6,1.g25,1.g2c,1.g2s,1.g3b,1.2u58,1.aex,1.g2v,1.g3x,1.2u6j,1.g47,1.g4k,1.fkc,1.g4s,1.g51,1.3ly7,1.g6t,1.g77,1.afz,1.g8r,1.g92,1.gaa,1.gaf,1.ahh,1.gcn,1.gcp,1.gdg,1.ge2,1.ged,1.gee,1.gev,1.gg9,1.ggh,1.ggq,1.ghf,1.ghp,1.ghr,1.ghr,1.ghr,1.2v58,1.m7k,1.gju,1.gkf,1.2vdv,1.gkr,1.gkx,1.gli,1.gpq,1.gmw,1.gnc,1.go8,1.gpu,1.gs6,1.gsw,1.gur,1.gv7,1.gw4,1.gw4,1.gwp,1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,2k00";
838
+
839
+ // src/nfc.ts
840
+ var S_BASE = 44032;
841
+ var L_BASE = 4352;
842
+ var V_BASE = 4449;
843
+ var T_BASE = 4519;
844
+ var L_COUNT = 19;
845
+ var V_COUNT = 21;
846
+ var T_COUNT = 28;
847
+ var N_COUNT = V_COUNT * T_COUNT;
848
+ var S_COUNT = L_COUNT * N_COUNT;
849
+ var tables = null;
850
+ function load() {
851
+ const ccc = /* @__PURE__ */ new Map();
852
+ for (const run of NFC_CLASS_RUNS.split(",")) {
853
+ const [start, count, cls] = run.split(".");
854
+ const s = parseInt(start, 36);
855
+ const n = count ? parseInt(count, 36) : 1;
856
+ const c = parseInt(cls, 36);
857
+ for (let k = 0; k < n; k++) ccc.set(s + k, c);
858
+ }
859
+ const raw = /* @__PURE__ */ new Map();
860
+ let cp = 0;
861
+ for (const entry of NFC_DECOMP.split(",")) {
862
+ const [gap, ...to] = entry.split(".");
863
+ cp += parseInt(gap, 36);
864
+ raw.set(cp, to.map((t) => parseInt(t, 36)));
865
+ }
866
+ const excluded = new Set(NFC_EXCLUDED.split(",").map((t) => parseInt(t, 36)));
867
+ const compose = /* @__PURE__ */ new Map();
868
+ for (const [c, to] of raw) {
869
+ if (to.length !== 2 || excluded.has(c) || ccc.has(c) || ccc.has(to[0])) continue;
870
+ compose.set(to[0] * 1114112 + to[1], c);
871
+ }
872
+ const decomp = /* @__PURE__ */ new Map();
873
+ const full = (c) => {
874
+ const done = decomp.get(c);
875
+ if (done) return done;
876
+ const to = raw.get(c);
877
+ if (!to) return [c];
878
+ const out = to.flatMap(full);
879
+ decomp.set(c, out);
880
+ return out;
881
+ };
882
+ for (const c of raw.keys()) full(c);
883
+ return { ccc, decomp, compose };
884
+ }
885
+ function nfc(text) {
886
+ let plain = true;
887
+ for (let i = 0; i < text.length; i++) if (text.charCodeAt(i) >= 192) {
888
+ plain = false;
889
+ break;
890
+ }
891
+ if (plain) return text;
892
+ const t = tables ?? (tables = load());
893
+ const cls = (c) => t.ccc.get(c) ?? 0;
894
+ const cps = [];
895
+ for (const ch of text) {
896
+ const c = ch.codePointAt(0);
897
+ const s = c - S_BASE;
898
+ if (s >= 0 && s < S_COUNT) {
899
+ cps.push(L_BASE + Math.floor(s / N_COUNT), V_BASE + Math.floor(s % N_COUNT / T_COUNT));
900
+ if (s % T_COUNT) cps.push(T_BASE + s % T_COUNT);
901
+ } else {
902
+ const d = t.decomp.get(c);
903
+ if (d) cps.push(...d);
904
+ else cps.push(c);
905
+ }
906
+ }
907
+ for (let i = 1; i < cps.length; i++) {
908
+ const c = cps[i];
909
+ const k = cls(c);
910
+ if (!k) continue;
911
+ let j = i;
912
+ while (j > 0 && cls(cps[j - 1]) > k) {
913
+ cps[j] = cps[j - 1];
914
+ j--;
915
+ }
916
+ cps[j] = c;
917
+ }
918
+ const out = [];
919
+ let starter = -1;
920
+ let last = 0;
921
+ for (const c of cps) {
922
+ const k = cls(c);
923
+ if (starter >= 0 && (out.length - 1 === starter || last !== 0 && last < k)) {
924
+ const a = out[starter];
925
+ let composed;
926
+ const l = a - L_BASE, v = c - V_BASE, s = a - S_BASE, tt = c - T_BASE;
927
+ if (l >= 0 && l < L_COUNT && v >= 0 && v < V_COUNT) composed = S_BASE + (l * V_COUNT + v) * T_COUNT;
928
+ else if (s >= 0 && s < S_COUNT && s % T_COUNT === 0 && tt > 0 && tt < T_COUNT) composed = a + tt;
929
+ else composed = t.compose.get(a * 1114112 + c);
930
+ if (composed !== void 0) {
931
+ out[starter] = composed;
932
+ continue;
933
+ }
934
+ }
935
+ if (k === 0) starter = out.length;
936
+ last = k;
937
+ out.push(c);
938
+ }
939
+ let r = "";
940
+ for (const c of out) r += String.fromCodePoint(c);
941
+ return r;
942
+ }
943
+
944
+ // src/world-file.ts
945
+ import { Inflate, inflateSync, zipSync } from "fflate";
946
+ var WORLD_FILE = "world.json";
947
+ var MARKER_NAME = "mimetype";
948
+ var WORLD_FILE_MEDIA_TYPE = "application/vnd.onlyworlds.world+zip";
949
+ var WORLD_FILE_MAX_BYTES = 2 * 1024 ** 3;
950
+ var WORLD_FILE_MAX_ENTRIES = 5e5;
951
+ var MESSAGES = {
952
+ unsafe_path: "The world file holds a path that cannot be written safely.",
953
+ too_big: "The world file is bigger than the budget allows, or a file in it is bigger than it says.",
954
+ too_many: "The world file holds more files than the budget allows.",
955
+ not_a_world: "The file is not a world: it has no readable world.json with an id.",
956
+ more_than_one: "The file holds more than one world.",
957
+ not_openable: "The file is not a zip that can be read.",
958
+ duplicate: "The world file holds two entries with the same name.",
959
+ collision: "The world file holds two names that differ only in case or in how an accent is written.",
960
+ link: "The world file holds a link or a special file.",
961
+ method: "The world file holds an encrypted entry, or one compressed other than stored or deflate.",
962
+ name: "The world file holds a name that some disk cannot hold.",
963
+ marker: "The world file's mimetype entry is not the OnlyWorlds media type."
964
+ };
965
+ var OwWorldFileError = class extends Error {
966
+ constructor(reason, message = MESSAGES[reason]) {
967
+ super(message);
968
+ this.name = "OwWorldFileError";
969
+ this.reason = reason;
970
+ }
971
+ };
972
+ var READ_OPTION_KEYS = ["maxBytes", "maxEntries", "skip"];
973
+ var refuse = (reason, message) => {
974
+ throw new OwWorldFileError(reason, message);
975
+ };
976
+ function pathFault(name) {
977
+ if (name.includes("\\")) return "holds a backslash";
978
+ if (name.startsWith("/")) return "is absolute";
979
+ if (/^[A-Za-z]:/.test(name)) return "names a drive";
980
+ if (name.split("/").some((seg) => seg === "" || seg === "." || seg === "..")) return "has an empty, . or .. segment";
981
+ return null;
982
+ }
983
+ var RESERVED = /* @__PURE__ */ new Set([
984
+ "CON",
985
+ "PRN",
986
+ "AUX",
987
+ "NUL",
988
+ ...[1, 2, 3, 4, 5, 6, 7, 8, 9].flatMap((i) => [`COM${i}`, `LPT${i}`])
989
+ ]);
990
+ var BAD_CHAR = /[<>:"|?*\p{Cc}]/u;
991
+ function nameFault(name) {
992
+ for (const seg of name.split("/")) {
993
+ if (BAD_CHAR.test(seg)) return `segment ${JSON.stringify(seg)} holds a reserved or control character`;
994
+ if (seg.endsWith(".") || seg.endsWith(" ")) return `segment ${JSON.stringify(seg)} ends in a dot or a space`;
995
+ if (RESERVED.has(seg.split(".")[0].toUpperCase())) return `segment ${JSON.stringify(seg)} is a Windows device name`;
996
+ }
997
+ return null;
998
+ }
999
+ function isJunk(path) {
1000
+ return path.split("/").some((seg) => seg === "__MACOSX" || seg === ".DS_Store" || seg === "Thumbs.db");
1001
+ }
1002
+ var FOLD_RUNS = "1t.q..w,51...lj,5c.n..w,60.7..w,74.o.2.1,8i.3.2.1,8p.8.2.1,96.n.2.1,ag...-3d,ah.3.2.1,an...-7g,ap...5u,aq.2.2.1,au...5q,av...1,ax.2..5p,az...1,b2...27,b3...5m,b4...5n,b5...1,b7...5p,b8...5r,ba...5v,bb...5t,bc...1,bg...5v,bh...5x,bj...5y,bk.3.2.1,bq...62,br...1,bt...62,bw...1,by...62,bz...1,c1.2..61,c3.2.2.1,c7...63,c8...1,cc...1,ck...2,cl...1,cn...2,co...1,cq...2,cr.9.2.1,da.9.2.1,dt...2,du.2.2.1,dy...-2p,dz...-1k,e0.k.2.1,f4...-3m,f6.9.2.1,fu...8bv,fv...1,fx...-4j,fy...8bs,g1...1,g3...-5f,g4...1x,g5...1z,g6.5.2.1,n9...38,og.2.2.1,om...1,ov...38,p2...12,p4.3..11,p8...1s,pa.2..1r,pd.h..w,pv.9..w,qq...1,r3...8,r4...-u,r5...-p,r9...-f,ra...-m,rc.c.2.1,s0...-1i,s1...-1c,s4...-1o,s5...-1s,s7...1,s9...-7,sa...1,sd.3..-3m,sg.g..28,sw.w..w,v4.h.2.1,wa.r.2.1,xs...f,xt.7.2.1,y8.1c.2.1,10x.12..1c,3a8.12..5ls,3bb...5ls,3bh...5ls,3y0.6..-8,5mo...-4su,5mp...-4st,5mq...-4sk,5mr.2..-4si,5mt...-4sj,5mu...-4sc,5mv...-4ro,5mw...r7n,5n4.17..-2bk,5od.3..-2bk,5xc.23.2.1,61n...-1m,61q...-5vj,61s.1c.2.1,64o.8..-8,654.6..-8,65k.8..-8,660.8..-8,66g.6..-8,66x.4.2.-8,67c.8..-8,688.8..-8,68o.8..-8,694.8..-8,69k.2..-8,69m.2..-22,69o...-9,69q...-5j9,6a0.4..-2e,6a4...-9,6ab...-5kz,6ag.2..-8,6ai.2..-2s,6ar...-5kj,6aw.2..-8,6ay.2..-34,6b0...-7,6bc.2..-3k,6be.2..-3i,6bg...-9,6jq...-5st,6ju...-6gv,6jv...-6di,6k2...s,6lc.g..g,6mb...1,792.q..q,8ow.1c..1c,8rk...1,8rm...-8af,8rn...-2xy,8ro...-89z,8rr.3.2.1,8rx...-8bg,8ry...-8al,8rz...-8bj,8s0...-8bi,8s2...1,8s5...1,8se.2..-8cf,8sg.1e.2.1,8vf.2.2.1,8vm...1,wu8.n.2.1,ww0.e.2.1,x0i.7.2.1,x0y.v.2.1,x2x.2.2.1,x31...-r9g,x32.5.2.1,x3f...1,x3h...-wmg,x3k.2.2.1,x3q.a.2.1,x4a...-wn8,x4b...-wnj,x4c...-wnf,x4d...-wn5,x4e...-wn8,x4g...-wlu,x4h...-wmi,x4i...-wlx,x4j...ps,x4k.8.2.1,x50...-1c,x51...-wn7,x52...-raw,x53.2.2.1,x5c...1,x5i.2.2.1,x6d...1,xv4.28..-tzk,1dl1...1,1ee9.q..w,1fcw.14..14,1fhs.10..14,1fn4.b..13,1fng.f..13,1fnw.7..13,1fo4.2..13,1h1c.1f..1s,1jfk.w..w,20cg.w..w,2olc.y..y";
1003
+ var foldTable = null;
1004
+ function simpleCaseFold(text) {
1005
+ if (!foldTable) {
1006
+ foldTable = /* @__PURE__ */ new Map();
1007
+ for (const run of FOLD_RUNS.split(",")) {
1008
+ const [start, count, stride, delta] = run.split(".");
1009
+ const s = parseInt(start, 36);
1010
+ const n = count ? parseInt(count, 36) : 1;
1011
+ const step = stride ? parseInt(stride, 36) : 1;
1012
+ const d = parseInt(delta, 36);
1013
+ for (let k = 0; k < n; k++) foldTable.set(s + k * step, s + k * step + d);
1014
+ }
1015
+ }
1016
+ let out = "";
1017
+ for (const c of text) {
1018
+ const to = foldTable.get(c.codePointAt(0));
1019
+ out += to === void 0 ? c : String.fromCodePoint(to);
1020
+ }
1021
+ return out;
1022
+ }
1023
+ function foldName(name) {
1024
+ return simpleCaseFold(nfc(name));
1025
+ }
1026
+ function byCodePoint(a, b) {
1027
+ const n = Math.min(a.length, b.length);
1028
+ for (let i = 0; i < n; i++) {
1029
+ const x = a.codePointAt(i);
1030
+ const y = b.codePointAt(i);
1031
+ if (x !== y) return x - y;
1032
+ if (x > 65535) i++;
1033
+ }
1034
+ return a.length - b.length;
1035
+ }
1036
+ var u16 = (b, o) => b[o] | b[o + 1] << 8;
1037
+ var u32 = (b, o) => (b[o] | b[o + 1] << 8 | b[o + 2] << 16) + b[o + 3] * 16777216;
1038
+ var u64 = (b, o) => u32(b, o) + u32(b, o + 4) * 4294967296;
1039
+ var SIG_LOCAL = 67324752;
1040
+ var SIG_CENTRAL = 33639248;
1041
+ var SIG_END = 101010256;
1042
+ var SIG_END64 = 101075792;
1043
+ var SIG_LOCATOR64 = 117853008;
1044
+ var MAX32 = 4294967295;
1045
+ var utf8 = new TextDecoder("utf-8", { fatal: true });
1046
+ var latin1 = (b) => {
1047
+ let s = "";
1048
+ for (const x of b) s += String.fromCharCode(x);
1049
+ return s;
1050
+ };
1051
+ function centralDirectory(bytes) {
1052
+ const len = bytes.length;
1053
+ let end = -1;
1054
+ for (let i = len - 22; i >= Math.max(0, len - 22 - 65535); i--) {
1055
+ if (u32(bytes, i) === SIG_END) {
1056
+ end = i;
1057
+ break;
1058
+ }
1059
+ }
1060
+ if (end < 0) refuse("not_openable", "The file is not a zip: it has no end of central directory.");
1061
+ const thisDisk = u16(bytes, end + 4);
1062
+ const cdDisk = u16(bytes, end + 6);
1063
+ if (!(thisDisk === 0 && cdDisk === 0 || thisDisk === 65535 && cdDisk === 65535)) {
1064
+ refuse("not_openable", `The zip spans disks (its end record says disk ${thisDisk}, the directory on disk ${cdDisk}).`);
1065
+ }
1066
+ let cdSize = u32(bytes, end + 12);
1067
+ let cdOffset = u32(bytes, end + 16);
1068
+ const loc = end - 20;
1069
+ if (loc >= 0 && u32(bytes, loc) === SIG_LOCATOR64) {
1070
+ if (u32(bytes, loc + 4) !== 0 || u32(bytes, loc + 16) > 1) refuse("not_openable", "The zip spans disks (zip64).");
1071
+ const rec = u64(bytes, loc + 8);
1072
+ if (rec + 56 > len || u32(bytes, rec) !== SIG_END64) refuse("not_openable", "The zip64 end record is missing.");
1073
+ if (u32(bytes, rec + 16) !== 0 || u32(bytes, rec + 20) !== 0) refuse("not_openable", "The zip spans disks (zip64).");
1074
+ cdSize = u64(bytes, rec + 40);
1075
+ cdOffset = u64(bytes, rec + 48);
1076
+ }
1077
+ const cdEnd = cdOffset + cdSize;
1078
+ if (cdEnd > len) refuse("not_openable", "The central directory lies past the end of the file.");
1079
+ const out = [];
1080
+ let p = cdOffset;
1081
+ while (p < cdEnd) {
1082
+ if (p + 46 > cdEnd || u32(bytes, p) !== SIG_CENTRAL) refuse("not_openable", "The central directory is broken.");
1083
+ const flags = u16(bytes, p + 8);
1084
+ const nlen = u16(bytes, p + 28);
1085
+ const elen = u16(bytes, p + 30);
1086
+ const clen = u16(bytes, p + 32);
1087
+ const nameBytes = bytes.subarray(p + 46, p + 46 + nlen);
1088
+ const extra = bytes.subarray(p + 46 + nlen, p + 46 + nlen + elen);
1089
+ let usize = u32(bytes, p + 24);
1090
+ let csize = u32(bytes, p + 20);
1091
+ let offset = u32(bytes, p + 42);
1092
+ if (usize === MAX32 || csize === MAX32 || offset === MAX32) {
1093
+ for (let q = 0; q + 4 <= extra.length; q += 4 + u16(extra, q + 2)) {
1094
+ if (u16(extra, q) !== 1) continue;
1095
+ let r = q + 4;
1096
+ const stop = r + u16(extra, q + 2);
1097
+ const next = () => {
1098
+ if (r + 8 > stop) refuse("not_openable", "A zip64 extra field is short.");
1099
+ const v = u64(extra, r);
1100
+ r += 8;
1101
+ return v;
1102
+ };
1103
+ if (usize === MAX32) usize = next();
1104
+ if (csize === MAX32) csize = next();
1105
+ if (offset === MAX32) offset = next();
1106
+ break;
1107
+ }
1108
+ }
1109
+ const nonAscii = nameBytes.some((x) => x > 127);
1110
+ let name;
1111
+ let badUtf8 = false;
1112
+ if (flags & 2048) {
1113
+ try {
1114
+ name = utf8.decode(nameBytes);
1115
+ } catch {
1116
+ name = latin1(nameBytes);
1117
+ badUtf8 = true;
1118
+ }
1119
+ } else {
1120
+ name = latin1(nameBytes);
1121
+ }
1122
+ out.push({
1123
+ name,
1124
+ flags,
1125
+ method: u16(bytes, p + 10),
1126
+ crc: u32(bytes, p + 16),
1127
+ csize,
1128
+ usize,
1129
+ offset,
1130
+ external: u32(bytes, p + 38),
1131
+ nonAscii,
1132
+ badUtf8
1133
+ });
1134
+ p += 46 + nlen + elen + clen;
1135
+ }
1136
+ if (p !== cdEnd) refuse("not_openable", "The central directory is broken.");
1137
+ return out;
1138
+ }
1139
+ var crcTable = null;
1140
+ function crc32(data) {
1141
+ if (!crcTable) {
1142
+ crcTable = new Int32Array(256);
1143
+ for (let n = 0; n < 256; n++) {
1144
+ let c2 = n;
1145
+ for (let k = 0; k < 8; k++) c2 = c2 & 1 ? 3988292384 ^ c2 >>> 1 : c2 >>> 1;
1146
+ crcTable[n] = c2;
1147
+ }
1148
+ }
1149
+ let c = -1;
1150
+ for (let i = 0; i < data.length; i++) c = crcTable[(c ^ data[i]) & 255] ^ c >>> 8;
1151
+ return (c ^ -1) >>> 0;
1152
+ }
1153
+ var CHUNK = 64 * 1024;
1154
+ function endsEarly(payload) {
1155
+ const short = payload.subarray(0, payload.length - 1);
1156
+ try {
1157
+ if (short.length <= CHUNK) {
1158
+ inflateSync(short);
1159
+ } else {
1160
+ const inf = new Inflate(() => {
1161
+ });
1162
+ for (let i = 0; i < short.length; i += CHUNK) {
1163
+ const stop = Math.min(i + CHUNK, short.length);
1164
+ inf.push(short.subarray(i, stop), stop === short.length);
1165
+ }
1166
+ }
1167
+ } catch {
1168
+ return false;
1169
+ }
1170
+ return true;
1171
+ }
1172
+ function inflateEntry(bytes, e) {
1173
+ const off = e.offset;
1174
+ if (off + 30 > bytes.length || u32(bytes, off) !== SIG_LOCAL) refuse("not_openable", `${e.name}: no local header at its offset.`);
1175
+ const start = off + 30 + u16(bytes, off + 26) + u16(bytes, off + 28);
1176
+ const payload = bytes.subarray(start, start + e.csize);
1177
+ let data;
1178
+ if (e.method === 0) {
1179
+ data = payload;
1180
+ } else if (payload.length <= CHUNK) {
1181
+ try {
1182
+ data = inflateSync(payload);
1183
+ } catch {
1184
+ return refuse("not_openable", `${e.name}: its deflate stream is broken.`);
1185
+ }
1186
+ } else {
1187
+ const out = new Uint8Array(e.usize);
1188
+ let n = 0;
1189
+ let over = false;
1190
+ const inf = new Inflate((chunk) => {
1191
+ if (n + chunk.length > e.usize) {
1192
+ over = true;
1193
+ throw new Error("past its size");
1194
+ }
1195
+ out.set(chunk, n);
1196
+ n += chunk.length;
1197
+ });
1198
+ try {
1199
+ for (let i = 0; i < payload.length; i += CHUNK) {
1200
+ const stop = Math.min(i + CHUNK, payload.length);
1201
+ inf.push(payload.subarray(i, stop), stop === payload.length);
1202
+ }
1203
+ } catch {
1204
+ if (!over) refuse("not_openable", `${e.name}: its deflate stream is broken.`);
1205
+ }
1206
+ data = over ? new Uint8Array(e.usize + 1) : out.subarray(0, n);
1207
+ }
1208
+ if (data.length > e.usize) refuse("too_big", `${e.name} holds more than the ${e.usize} bytes it declares.`);
1209
+ if (data.length !== e.usize) refuse("not_openable", `${e.name} holds ${data.length} bytes and declares ${e.usize}.`);
1210
+ if (e.method !== 0 && payload.length > 0 && endsEarly(payload)) {
1211
+ refuse("not_openable", `${e.name}: its deflate stream ends before its declared compressed size.`);
1212
+ }
1213
+ if (crc32(data) !== e.crc) refuse("not_openable", `${e.name} fails its CRC.`);
1214
+ return e.method === 0 ? data.slice() : data;
1215
+ }
1216
+ function parseWorld(data) {
1217
+ let meta;
1218
+ try {
1219
+ meta = JSON.parse(new TextDecoder().decode(data));
1220
+ } catch {
1221
+ throw new OwWorldFileError("not_a_world");
1222
+ }
1223
+ if (!meta || typeof meta !== "object" || Array.isArray(meta)) throw new OwWorldFileError("not_a_world");
1224
+ const id = meta.id;
1225
+ if (typeof id !== "string" || !id.trim()) throw new OwWorldFileError("not_a_world");
1226
+ return meta;
1227
+ }
1228
+ function withoutLink(data, meta) {
1229
+ if (!("api" in meta)) return { data, world: meta };
1230
+ const { api: _link, ...rest } = meta;
1231
+ return { data: new TextEncoder().encode(JSON.stringify(rest, null, 2) + "\n"), world: rest };
1232
+ }
1233
+ function checkCollisions(names) {
1234
+ const byFold = /* @__PURE__ */ new Map();
1235
+ const segFold = /* @__PURE__ */ new Map();
1236
+ const done = /* @__PURE__ */ new Set();
1237
+ for (const raw of names) {
1238
+ const segs = (raw.endsWith("/") ? raw.slice(0, -1) : raw).split("/");
1239
+ let prefix = "";
1240
+ let folded = "";
1241
+ for (let i = 0; i < segs.length; i++) {
1242
+ let f = segFold.get(segs[i]);
1243
+ if (f === void 0) {
1244
+ f = foldName(segs[i]);
1245
+ segFold.set(segs[i], f);
1246
+ }
1247
+ prefix = i ? `${prefix}/${segs[i]}` : segs[i];
1248
+ folded = i ? `${folded}/${f}` : f;
1249
+ if (done.has(prefix)) continue;
1250
+ done.add(prefix);
1251
+ const other = byFold.get(folded);
1252
+ if (other !== void 0) {
1253
+ refuse("collision", `The names ${JSON.stringify(other)} and ${JSON.stringify(prefix)} are one name after NFC and case folding.`);
1254
+ }
1255
+ byFold.set(folded, prefix);
1256
+ }
1257
+ }
1258
+ }
1259
+ function checkFileAndFolder(files) {
1260
+ const seen = /* @__PURE__ */ new Set();
1261
+ for (const n of files) {
1262
+ const segs = n.split("/");
1263
+ let prefix = "";
1264
+ for (let i = 0; i < segs.length - 1; i++) {
1265
+ prefix = i ? `${prefix}/${segs[i]}` : segs[i];
1266
+ if (seen.has(prefix)) continue;
1267
+ seen.add(prefix);
1268
+ if (files.has(prefix)) refuse("unsafe_path", `${JSON.stringify(prefix)} is a file and a folder.`);
1269
+ }
1270
+ }
1271
+ }
1272
+ function readWorldFile(bytes, opts = {}) {
1273
+ refuseUnknownOptions("readWorldFile", opts, READ_OPTION_KEYS, "Nothing was read.");
1274
+ const maxBytes = opts.maxBytes ?? WORLD_FILE_MAX_BYTES;
1275
+ const maxEntries = opts.maxEntries ?? WORLD_FILE_MAX_ENTRIES;
1276
+ const entries = centralDirectory(bytes);
1277
+ const seen = /* @__PURE__ */ new Set();
1278
+ const files = [];
1279
+ let declared = 0;
1280
+ for (const e of entries) {
1281
+ const name2 = e.name;
1282
+ const isDir = name2.endsWith("/");
1283
+ const bare = isDir ? name2.slice(0, -1) : name2;
1284
+ const quoted = JSON.stringify(name2);
1285
+ const fault = pathFault(bare);
1286
+ if (fault) refuse("unsafe_path", `The entry ${quoted} ${fault}.`);
1287
+ const kind = e.external >>> 16 & 61440;
1288
+ if (kind !== 0 && kind !== 32768 && kind !== 16384) refuse("link", `The entry ${quoted} is a link or a special file.`);
1289
+ if (e.flags & 65) refuse("method", `The entry ${quoted} is encrypted.`);
1290
+ if (e.method !== 0 && e.method !== 8) refuse("method", `The entry ${quoted} uses method ${e.method} (only stored and deflate).`);
1291
+ if (e.badUtf8) refuse("name", `The entry ${quoted} is flagged UTF-8 and is not.`);
1292
+ if (e.nonAscii && !(e.flags & 2048)) refuse("name", `The entry ${quoted} is not ASCII and lacks the UTF-8 flag.`);
1293
+ const bad = nameFault(bare);
1294
+ if (bad) refuse("name", `The entry ${quoted}: ${bad}.`);
1295
+ if (seen.has(name2)) refuse("duplicate", `The entry ${quoted} appears twice.`);
1296
+ seen.add(name2);
1297
+ if (isDir) continue;
1298
+ files.push(e);
1299
+ if (files.length > maxEntries) refuse("too_many", `The world file holds more than ${maxEntries} files.`);
1300
+ declared += e.usize;
1301
+ if (declared > maxBytes) refuse("too_big", `The world file declares more than ${maxBytes} bytes.`);
1302
+ }
1303
+ checkCollisions(seen);
1304
+ const names = new Set(files.map((e) => e.name));
1305
+ checkFileAndFolder(names);
1306
+ const marker = files.find((e) => e.name === MARKER_NAME);
1307
+ if (marker && new TextDecoder("utf-8", { ignoreBOM: true }).decode(inflateEntry(bytes, marker)) !== WORLD_FILE_MEDIA_TYPE) {
1308
+ refuse("marker", "The mimetype entry holds other bytes than the OnlyWorlds media type.");
1309
+ }
1310
+ const candidates = [...names].filter((n) => n !== MARKER_NAME && !isJunk(n));
1311
+ let prefix;
1312
+ if (candidates.includes(WORLD_FILE)) {
1313
+ prefix = "";
1314
+ } else {
1315
+ const roots = new Set(candidates.filter((n) => n.split("/").length === 2 && n.endsWith(`/${WORLD_FILE}`) && !n.startsWith(".")).map((n) => n.slice(0, -WORLD_FILE.length)));
1316
+ if (roots.size === 0) refuse("not_a_world", "There is no world.json at the root or in one top-level folder.");
1317
+ if (roots.size > 1) refuse("more_than_one", `The file holds worlds in ${[...roots].join(", ")}.`);
1318
+ prefix = [...roots][0];
1319
+ }
1320
+ const inside = new Set(candidates.filter((n) => n.startsWith(prefix)));
1321
+ for (const n of inside) {
1322
+ const rel = n.slice(prefix.length);
1323
+ if (rel !== WORLD_FILE && rel.endsWith(`/${WORLD_FILE}`) && !rel.startsWith("records/")) {
1324
+ refuse("more_than_one", `A second world.json sits inside the world: ${n}.`);
1325
+ }
1326
+ }
1327
+ const content = /* @__PURE__ */ new Map();
1328
+ for (const e of files) {
1329
+ const data = inflateEntry(bytes, e);
1330
+ if (inside.has(e.name)) content.set(e.name, data);
1331
+ }
1332
+ const worldName = `${prefix}${WORLD_FILE}`;
1333
+ const parsed = withoutLink(content.get(worldName), parseWorld(content.get(worldName)));
1334
+ const out = [];
1335
+ for (const [n, data] of content) {
1336
+ const path = n.slice(prefix.length);
1337
+ if (opts.skip?.(path)) continue;
1338
+ out.push({ path, data: n === worldName ? parsed.data : data });
1339
+ }
1340
+ out.sort((a, b) => byCodePoint(a.path, b.path));
1341
+ const name = parsed.world.name;
1342
+ return {
1343
+ worldId: parsed.world.id,
1344
+ name: typeof name === "string" ? name : "",
1345
+ world: parsed.world,
1346
+ files: out
1347
+ };
1348
+ }
1349
+ var PARTS = /* @__PURE__ */ new Set(["elements", "spatial", "media", "records"]);
1350
+ function carried(path) {
1351
+ if (path === WORLD_FILE) return true;
1352
+ const segs = path.split("/");
1353
+ if (segs.length < 2) return false;
1354
+ if (segs[0].startsWith(".")) return true;
1355
+ if (!PARTS.has(segs[0])) return false;
1356
+ if (segs[0] === "records") return true;
1357
+ return !segs.some((s) => s.startsWith(".")) && !path.endsWith(".meta");
1358
+ }
1359
+ var STAMP = new Date(1980, 0, 1, 0, 0, 0);
1360
+ var WRITE_OPTION_KEYS = ["includePrivateRecords", "includeHidden", "includeAuthorFields", "report"];
1361
+ var RECORDS_MANIFEST = "records/RECORDS.json";
1362
+ var AUTHOR_FIELDS = ["created_by", "changed_by", "changed_via", "changed_client", "doors"];
1363
+ function writeOptions(opts) {
1364
+ if (opts === void 0 || opts === null) return { includePrivate: false, includeHidden: true, includeAuthorFields: false };
1365
+ if (typeof opts !== "object") throw new TypeError(`writeWorldFile: options must be an object, such as { includePrivateRecords: true }. Nothing was written.`);
1366
+ refuseUnknownOptions("writeWorldFile", opts, WRITE_OPTION_KEYS, "Nothing was written.");
1367
+ const o = opts;
1368
+ for (const key of ["includePrivateRecords", "includeHidden", "includeAuthorFields"]) {
1369
+ const asked = o[key];
1370
+ if (asked !== void 0 && typeof asked !== "boolean") {
1371
+ throw new TypeError(`writeWorldFile: ${key} must be true or false; got ${JSON.stringify(asked) ?? String(asked)}. Nothing was written.`);
1372
+ }
1373
+ }
1374
+ if (o.report !== void 0 && typeof o.report !== "function") {
1375
+ throw new TypeError(`writeWorldFile: report must be a function; got ${JSON.stringify(o.report) ?? String(o.report)}. Nothing was written.`);
1376
+ }
1377
+ return {
1378
+ includePrivate: o.includePrivateRecords === true,
1379
+ includeHidden: o.includeHidden !== false,
1380
+ includeAuthorFields: o.includeAuthorFields === true,
1381
+ report: o.report
1382
+ };
1383
+ }
1384
+ function elementObject(f) {
1385
+ const segs = f.path.split("/");
1386
+ if (segs.length !== 3 || segs[0] !== "elements" && segs[0] !== "spatial" || !/\.json$/i.test(segs[2])) return null;
1387
+ let doc;
1388
+ try {
1389
+ doc = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(f.data));
1390
+ } catch {
1391
+ return null;
1392
+ }
1393
+ if (doc === null || typeof doc !== "object" || Array.isArray(doc)) return null;
1394
+ return doc;
1395
+ }
1396
+ function isHiddenElement(f) {
1397
+ const doc = elementObject(f);
1398
+ if (!doc) return false;
1399
+ const mark = doc.hidden;
1400
+ return mark !== void 0 && mark !== null && mark !== false;
1401
+ }
1402
+ function withoutAuthorFields(f) {
1403
+ const doc = elementObject(f);
1404
+ if (!doc) return null;
1405
+ const present = AUTHOR_FIELDS.filter((k) => k in doc);
1406
+ if (!present.length) return null;
1407
+ for (const k of present) delete doc[k];
1408
+ return new TextEncoder().encode(JSON.stringify(doc, null, 2) + "\n");
1409
+ }
1410
+ function privateProducers(files) {
1411
+ const manifest = files.find((f) => f.path === RECORDS_MANIFEST);
1412
+ if (!manifest) return [];
1413
+ const unreadable = (why) => {
1414
+ throw new TypeError(`writeWorldFile: ${RECORDS_MANIFEST} ${why}, so which records are private cannot be read and none is left out by guess (spec \xA74.7, OW-8). Fix the manifest, or pass { includePrivateRecords: true } to carry every record. Nothing was written.`);
1415
+ };
1416
+ let doc;
1417
+ try {
1418
+ doc = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(manifest.data));
1419
+ } catch {
1420
+ unreadable("is not JSON");
1421
+ }
1422
+ if (!Array.isArray(doc)) unreadable("is not a JSON array of entries");
1423
+ const out = [];
1424
+ for (const entry of doc) {
1425
+ if (entry === null || typeof entry !== "object" || Array.isArray(entry)) unreadable("holds an entry that is not an object");
1426
+ const { producer, private: isPrivate } = entry;
1427
+ if (isPrivate !== true) continue;
1428
+ if (typeof producer !== "string" || producer === "") unreadable("marks an entry private without a producer name");
1429
+ out.push(producer);
1430
+ }
1431
+ return out;
1432
+ }
1433
+ function writeWorldFile(files, topDir, opts = {}) {
1434
+ const { includePrivate, includeHidden, includeAuthorFields, report } = writeOptions(opts);
1435
+ if (pathFault(topDir) || topDir.includes("/")) throw new OwWorldFileError("unsafe_path");
1436
+ const seen = /* @__PURE__ */ new Set();
1437
+ for (const f of files) {
1438
+ if (pathFault(f.path)) throw new OwWorldFileError("unsafe_path");
1439
+ if (seen.has(f.path)) throw new OwWorldFileError("unsafe_path", `The path ${f.path} is listed twice.`);
1440
+ seen.add(f.path);
1441
+ }
1442
+ const left = new Set(includePrivate ? [] : privateProducers(files).map(foldName));
1443
+ const inPrivate = (path) => {
1444
+ const segs = path.split("/");
1445
+ return segs.length > 2 && segs[0] === "records" && left.has(foldName(segs[1]));
1446
+ };
1447
+ let hiddenLeftOut = 0;
1448
+ const kept = files.filter((f) => {
1449
+ if (!carried(f.path) || inPrivate(f.path)) return false;
1450
+ if (!includeHidden && isHiddenElement(f)) {
1451
+ hiddenLeftOut++;
1452
+ return false;
1453
+ }
1454
+ return true;
1455
+ });
1456
+ if (!kept.some((f) => f.path === WORLD_FILE)) throw new OwWorldFileError("not_a_world");
1457
+ const keys = kept.map((f) => `${topDir}/${f.path}`);
1458
+ for (const key of keys) {
1459
+ const bad = nameFault(key);
1460
+ if (bad) throw new OwWorldFileError("name", `The path ${key}: ${bad}.`);
1461
+ }
1462
+ checkCollisions([MARKER_NAME, ...keys]);
1463
+ checkFileAndFolder(/* @__PURE__ */ new Set([MARKER_NAME, ...keys]));
1464
+ const input = {
1465
+ [MARKER_NAME]: [new TextEncoder().encode(WORLD_FILE_MEDIA_TYPE), { level: 0, mtime: STAMP }]
1466
+ };
1467
+ let authorFieldsLeftOut = 0;
1468
+ for (const f of [...kept].sort((a, b) => byCodePoint(a.path, b.path))) {
1469
+ let data = f.data;
1470
+ if (f.path === WORLD_FILE) {
1471
+ data = withoutLink(data, parseWorld(data)).data;
1472
+ } else if (!includeAuthorFields) {
1473
+ const bare = withoutAuthorFields(f);
1474
+ if (bare) {
1475
+ data = bare;
1476
+ authorFieldsLeftOut++;
1477
+ }
1478
+ }
1479
+ input[`${topDir}/${f.path}`] = [data, { level: /\.json$/i.test(f.path) ? 6 : 0, mtime: STAMP }];
1480
+ }
1481
+ const zip = zipSync(input);
1482
+ report?.({ hiddenLeftOut, authorFieldsLeftOut });
1483
+ return zip;
1484
+ }
1485
+
1486
+ // src/room.ts
1487
+ var WHITE_SPACE = /* @__PURE__ */ new Set([
1488
+ 9,
1489
+ 10,
1490
+ 11,
1491
+ 12,
1492
+ 13,
1493
+ 32,
1494
+ 133,
1495
+ 160,
1496
+ 5760,
1497
+ 8192,
1498
+ 8193,
1499
+ 8194,
1500
+ 8195,
1501
+ 8196,
1502
+ 8197,
1503
+ 8198,
1504
+ 8199,
1505
+ 8200,
1506
+ 8201,
1507
+ 8202,
1508
+ 8232,
1509
+ 8233,
1510
+ 8239,
1511
+ 8287,
1512
+ 12288
1513
+ ]);
1514
+ function trimWhiteSpace(text) {
1515
+ let start = 0;
1516
+ let end = text.length;
1517
+ while (start < end && WHITE_SPACE.has(text.charCodeAt(start))) start++;
1518
+ while (end > start && WHITE_SPACE.has(text.charCodeAt(end - 1))) end--;
1519
+ return text.slice(start, end);
1520
+ }
1521
+ var fold = (text) => simpleCaseFold(trimWhiteSpace(text));
1522
+ function hasMark(el, field) {
1523
+ const mark = Object.prototype.hasOwnProperty.call(el, field) ? el[field] : void 0;
1524
+ if (mark === void 0 || mark === null) return false;
1525
+ return typeof mark !== "string" || trimWhiteSpace(mark) !== "";
1526
+ }
1527
+ function isRoomElement(el) {
1528
+ if (el == null || typeof el !== "object" || typeof el.type !== "string" || typeof el.supertype !== "string") return false;
1529
+ if (!hasMark(el, ROOM_MARK)) return false;
1530
+ const type = fold(el.type);
1531
+ const supertype = fold(el.supertype);
1532
+ return ROOM_PAIRS.some((p) => fold(p.type) === type && fold(p.supertype) === supertype);
1533
+ }
1534
+ var READING_AID_KEYS = new Set(READING_AID_PAIRS.map((p) => `${fold(p.type)}/${fold(p.supertype)}`));
1535
+ function readingAidKey(element) {
1536
+ if (element === null || typeof element !== "object" || Array.isArray(element)) return null;
1537
+ const el = element;
1538
+ if (typeof el.type !== "string" || typeof el.supertype !== "string") return null;
1539
+ const key = `${fold(el.type)}/${fold(el.supertype)}`;
1540
+ if (!READING_AID_KEYS.has(key)) return null;
1541
+ return hasMark(el, READING_AID_MARK) ? key : null;
1542
+ }
1543
+ function isCharterElement(element) {
1544
+ return readingAidKey(element) !== null;
1545
+ }
1546
+ var AID_BY_KEY = new Map(
1547
+ CHARTER_PAIRS.map((p) => [`${fold(p.type)}/${fold(p.supertype)}`, p.aid])
1548
+ );
1549
+ function readingAidOf(element) {
1550
+ if (element === null || typeof element !== "object" || Array.isArray(element)) return null;
1551
+ const el = element;
1552
+ if (typeof el.type !== "string" || typeof el.supertype !== "string") return null;
1553
+ return AID_BY_KEY.get(`${fold(el.type)}/${fold(el.supertype)}`) ?? null;
1554
+ }
1555
+
1556
+ // src/names.ts
1557
+ var SLUGS = new Set(ELEMENT_TYPES);
1558
+ var OPTION_KEYS = ["supertype", "many"];
1559
+ var isObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
1560
+ function word(pair, many) {
1561
+ if (!isObject(pair) || typeof pair.one !== "string") return null;
1562
+ const one = trimWhiteSpace(pair.one);
1563
+ if (one === "") return null;
1564
+ if (!many) return one;
1565
+ const plural = typeof pair.many === "string" ? trimWhiteSpace(pair.many) : "";
1566
+ return plural === "" ? one : plural;
1567
+ }
1568
+ function typeWord(world, type, opts = {}) {
1569
+ refuseUnknownOptions("typeWord", opts, OPTION_KEYS);
1570
+ const map = world?.x_names;
1571
+ if (!isObject(map) || map.version !== 1) return null;
1572
+ const { types, supertypes } = map;
1573
+ if (types !== void 0 && !isObject(types)) return null;
1574
+ if (supertypes !== void 0) {
1575
+ if (!isObject(supertypes)) return null;
1576
+ for (const inner of Object.values(supertypes)) if (!isObject(inner)) return null;
1577
+ }
1578
+ if (!SLUGS.has(type)) return null;
1579
+ const many = opts.many === true;
1580
+ const supertype = typeof opts.supertype === "string" ? fold(opts.supertype) : "";
1581
+ if (supertype !== "" && isObject(supertypes) && isObject(supertypes[type])) {
1582
+ for (const [key, pair] of Object.entries(supertypes[type])) {
1583
+ if (fold(key) !== supertype) continue;
1584
+ const w = word(pair, many);
1585
+ if (w !== null) return w;
1586
+ }
1587
+ }
1588
+ return isObject(types) ? word(types[type], many) : null;
1589
+ }
1590
+
1591
+ // src/address.ts
1592
+ var MESSAGES2 = {
1593
+ not_an_address: "not an address: it starts with neither https://www.onlyworlds.com/w/ nor ow://",
1594
+ uppercase: "an address is written in lowercase: the prefix or the type word is in another case",
1595
+ segments: "the wrong number of path segments, or an empty one: a type needs an id and an id a type",
1596
+ bad_world: "the world is not an id (or, in the site's address only, a slug)",
1597
+ unknown_type: "the type word is not one of the 22",
1598
+ bad_id: "the element id is not a UUID in the hyphenated 8-4-4-4-12 form",
1599
+ bad_moment: "the moment is not a whole step in decimal within the 32-bit range",
1600
+ bad_lens: "the lens is not one lowercase lens key holding an id",
1601
+ no_world: "this address needs a world",
1602
+ bad_form: "the form is neither human nor text"
1603
+ };
1604
+ var OwAddressError = class extends Error {
1605
+ constructor(reason, message = MESSAGES2[reason]) {
1606
+ super(message);
1607
+ this.name = "OwAddressError";
1608
+ this.reason = reason;
1609
+ }
1610
+ };
1611
+ var refuse2 = (reason) => {
1612
+ throw new OwAddressError(reason);
1613
+ };
1614
+ var HUMAN_PREFIX = "https://www.onlyworlds.com/w/";
1615
+ var TEXT_PREFIX = "ow://";
1616
+ var TYPES = new Set(ELEMENT_TYPES);
1617
+ var UUID = /^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/;
1618
+ var SLUG = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
1619
+ var STEP = /^(?:0|-?[1-9][0-9]*)$/;
1620
+ var STEP_MIN = -2147483648;
1621
+ var STEP_MAX = 2147483647;
1622
+ var ADDRESS_KEYS = ["form", "world", "type", "id", "lens", "moment", "worldIsSlug", "canonical"];
1623
+ var asciiLower = (s) => s.replace(/[A-Z]/g, (c) => String.fromCharCode(c.charCodeAt(0) + 32));
1624
+ var isUuid = (s) => UUID.test(s);
1625
+ var isSlug = (s) => s.length >= 3 && s.length <= 40 && SLUG.test(s);
1626
+ function checkType(word2) {
1627
+ if (TYPES.has(word2)) return word2;
1628
+ return refuse2(TYPES.has(asciiLower(word2)) ? "uppercase" : "unknown_type");
1629
+ }
1630
+ function write(form, world, type, id, moment, lens) {
1631
+ const parts = [];
1632
+ if (world !== null) parts.push(world);
1633
+ if (type !== null && id !== null) parts.push(type, id);
1634
+ let out = (form === "human" ? HUMAN_PREFIX : TEXT_PREFIX) + parts.join("/");
1635
+ if (moment !== null) out += `@${moment}`;
1636
+ if (lens !== null) out += `?lens=${lens}`;
1637
+ return out;
1638
+ }
1639
+ var given = (v) => v !== void 0 && v !== null;
1640
+ function elementAddress(address) {
1641
+ if (address === null || typeof address !== "object" || Array.isArray(address)) {
1642
+ throw new TypeError("elementAddress: the address is an object ({ form, world, type, id, lens, moment })");
1643
+ }
1644
+ refuseUnknownOptions("elementAddress", address, ADDRESS_KEYS);
1645
+ const a = address;
1646
+ const form = a.form;
1647
+ if (form !== "human" && form !== "text") return refuse2("bad_form");
1648
+ const hasType = given(a.type);
1649
+ const hasId = given(a.id);
1650
+ if (hasType !== hasId) return refuse2("segments");
1651
+ const hasWorld = given(a.world);
1652
+ if (!hasWorld && (form === "human" || !hasType)) return refuse2("no_world");
1653
+ let world = null;
1654
+ if (hasWorld) {
1655
+ if (typeof a.world !== "string" || !isUuid(a.world)) return refuse2("bad_world");
1656
+ world = a.world.toLowerCase();
1657
+ }
1658
+ let type = null;
1659
+ let id = null;
1660
+ if (hasType) {
1661
+ type = typeof a.type === "string" ? checkType(a.type) : refuse2("unknown_type");
1662
+ if (typeof a.id !== "string" || !isUuid(a.id)) return refuse2("bad_id");
1663
+ id = a.id.toLowerCase();
1664
+ }
1665
+ let moment = null;
1666
+ if (given(a.moment)) {
1667
+ const m = a.moment;
1668
+ if (typeof m !== "number" || !Number.isInteger(m) || m < STEP_MIN || m > STEP_MAX) return refuse2("bad_moment");
1669
+ moment = m === 0 ? 0 : m;
1670
+ }
1671
+ let lens = null;
1672
+ if (given(a.lens)) {
1673
+ if (typeof a.lens !== "string" || !isUuid(a.lens)) return refuse2("bad_lens");
1674
+ lens = a.lens.toLowerCase();
1675
+ }
1676
+ return write(form, world, type, id, moment, lens);
1677
+ }
1678
+ function readLens(query) {
1679
+ let lens = null;
1680
+ let seen = false;
1681
+ for (const part of query.split("&")) {
1682
+ const eq = part.indexOf("=");
1683
+ const key = eq === -1 ? part : part.slice(0, eq);
1684
+ if (asciiLower(key) !== "lens") continue;
1685
+ if (key !== "lens" || seen) return refuse2("bad_lens");
1686
+ seen = true;
1687
+ const value = eq === -1 ? "" : part.slice(eq + 1);
1688
+ if (!isUuid(value)) return refuse2("bad_lens");
1689
+ lens = value.toLowerCase();
1690
+ }
1691
+ return lens;
1692
+ }
1693
+ function parseOwLink(text) {
1694
+ if (typeof text !== "string") return refuse2("not_an_address");
1695
+ const s = trimWhiteSpace(text);
1696
+ let form;
1697
+ let rest;
1698
+ if (s.startsWith(HUMAN_PREFIX)) {
1699
+ form = "human";
1700
+ rest = s.slice(HUMAN_PREFIX.length);
1701
+ } else if (s.startsWith(TEXT_PREFIX)) {
1702
+ form = "text";
1703
+ rest = s.slice(TEXT_PREFIX.length);
1704
+ } else {
1705
+ const lowered = asciiLower(s);
1706
+ return refuse2(lowered.startsWith(HUMAN_PREFIX) || lowered.startsWith(TEXT_PREFIX) ? "uppercase" : "not_an_address");
1707
+ }
1708
+ const hash = rest.indexOf("#");
1709
+ if (hash !== -1) rest = rest.slice(0, hash);
1710
+ const q = rest.indexOf("?");
1711
+ const query = q === -1 ? null : rest.slice(q + 1);
1712
+ const segments = (q === -1 ? rest : rest.slice(0, q)).split("/");
1713
+ const last = segments[segments.length - 1];
1714
+ const at = last.indexOf("@");
1715
+ const step = at === -1 ? null : last.slice(at + 1);
1716
+ if (at !== -1) segments[segments.length - 1] = last.slice(0, at);
1717
+ const n = segments.length;
1718
+ if (form === "human" ? n !== 1 && n !== 3 : n < 1 || n > 3) return refuse2("segments");
1719
+ if (segments.some((seg) => seg === "")) return refuse2("segments");
1720
+ if (n === 1 && TYPES.has(segments[0])) return refuse2("segments");
1721
+ let world = null;
1722
+ let worldIsSlug = false;
1723
+ if (n !== 2) {
1724
+ const w = segments[0];
1725
+ if (isUuid(w)) world = w.toLowerCase();
1726
+ else if (form === "human" && isSlug(w) && !TYPES.has(w)) {
1727
+ world = w;
1728
+ worldIsSlug = true;
1729
+ } else return refuse2("bad_world");
1730
+ }
1731
+ let type = null;
1732
+ let id = null;
1733
+ if (n !== 1) {
1734
+ type = checkType(segments[n - 2]);
1735
+ if (!isUuid(segments[n - 1])) return refuse2("bad_id");
1736
+ id = segments[n - 1].toLowerCase();
1737
+ }
1738
+ let moment = null;
1739
+ if (step !== null) {
1740
+ if (!STEP.test(step) || step.length > 11) return refuse2("bad_moment");
1741
+ const m = Number(step);
1742
+ if (m < STEP_MIN || m > STEP_MAX) return refuse2("bad_moment");
1743
+ moment = m;
1744
+ }
1745
+ const lens = query === null ? null : readLens(query);
1746
+ const canonical = !worldIsSlug && text === write(form, world, type, id, moment, lens);
1747
+ return { form, world, worldIsSlug, type, id, lens, moment, canonical };
1748
+ }
1749
+
1750
+ // src/openers.ts
1751
+ var SURFACE_KEYS = ["tool", "audience", "signedIn", "browser", "phone"];
1752
+ var NEEDS = ["account", "device", null];
1753
+ var PLACEHOLDER = /\{(world|type|id)\}/g;
1754
+ var fail = (what) => {
1755
+ throw new TypeError(`openersFor: ${what}`);
1756
+ };
1757
+ function templateOf(row, key, v) {
1758
+ if (v === void 0 || v === null) return null;
1759
+ return typeof v === "string" ? v : fail(`tool ${row}: open.${key} is a link template or null`);
1760
+ }
1761
+ function openersFor(tools, kind, address, surface) {
1762
+ if (!Array.isArray(tools)) fail("tools is the tools list's rows, an array");
1763
+ if (kind !== "world" && kind !== "element") fail(`kind is 'world' or 'element'; got ${JSON.stringify(kind)}`);
1764
+ if (address === null || typeof address !== "object" || Array.isArray(address)) {
1765
+ fail("the address is an object ({ form, world, type, id }), as parseOwLink reads it");
1766
+ }
1767
+ refuseUnknownOptions("openersFor", address, ADDRESS_KEYS);
1768
+ const a = address;
1769
+ elementAddress({ ...a, form: a.form ?? "human" });
1770
+ const page = elementAddress({ form: "human", world: a.world, type: a.type, id: a.id });
1771
+ const world = a.world.toLowerCase();
1772
+ const hasElement = a.type !== void 0 && a.type !== null;
1773
+ if (kind === "element" && !hasElement) fail("an element's openers need an address with its type and id");
1774
+ const type = hasElement ? a.type : "";
1775
+ const id = hasElement ? a.id.toLowerCase() : "";
1776
+ if (surface === null || typeof surface !== "object" || Array.isArray(surface)) fail("the surface is an object ({ audience, ... })");
1777
+ refuseUnknownOptions("openersFor", surface, SURFACE_KEYS);
1778
+ const { tool = null, audience, signedIn = null, browser = true, phone = false } = surface;
1779
+ if (audience !== "member" && audience !== "public") fail(`surface.audience is 'member' or 'public'; got ${JSON.stringify(audience)}`);
1780
+ if (tool !== null && typeof tool !== "string") fail("surface.tool is a client name or null");
1781
+ if (signedIn !== null && typeof signedIn !== "boolean") fail("surface.signedIn is true, false or null");
1782
+ if (typeof browser !== "boolean") fail("surface.browser is a boolean");
1783
+ if (typeof phone !== "boolean") fail("surface.phone is a boolean");
1784
+ const values = { world, type, id };
1785
+ const fill = (template) => template.replace(PLACEHOLDER, (_, n) => values[n]);
1786
+ const rows = [
1787
+ { id: "onlyworlds", name: "onlyworlds.com", href: kind === "element" ? page : elementAddress({ form: "human", world }), state: null }
1788
+ ];
1789
+ for (const r of tools) {
1790
+ if (r === null || typeof r !== "object" || typeof r.id !== "string" || typeof r.name !== "string") {
1791
+ fail("each tools row is an object with an id and a name");
1792
+ }
1793
+ const open = r.open;
1794
+ if (open === null || open === void 0) continue;
1795
+ if (typeof open !== "object" || Array.isArray(open)) fail(`tool ${r.id}: open is an object or null`);
1796
+ const o = open;
1797
+ const worldDoor = templateOf(r.id, "world", o.world);
1798
+ const elementDoor = templateOf(r.id, "element", o.element);
1799
+ const needs = o.needs === void 0 ? null : o.needs;
1800
+ if (!NEEDS.includes(needs)) fail(`tool ${r.id}: open.needs is 'account', 'device' or null; got ${JSON.stringify(needs)}`);
1801
+ if (r.rung !== "listed") continue;
1802
+ if (audience === "public" && needs !== null) continue;
1803
+ const template = kind === "element" ? elementDoor ?? worldDoor : worldDoor;
1804
+ if (template === null) continue;
1805
+ let state = null;
1806
+ if (tool !== null && r.client === tool) state = "You are here";
1807
+ else if (needs === "account" && !browser) state = "Opens in your browser";
1808
+ else if (needs === "account" && signedIn === false) state = `Sign in to ${r.name} first`;
1809
+ else if (needs === "device" && phone) state = "Needs the world on this phone";
1810
+ else if (kind === "element" && elementDoor === null) state = "Opens the world";
1811
+ rows.push({ id: r.id, name: r.name, href: fill(template), state });
1812
+ }
1813
+ return rows;
1814
+ }
1815
+
1816
+ // src/tools.generated.ts
1817
+ var TOOLS = [
1818
+ {
1819
+ "id": "atlas",
1820
+ "name": "Atlas",
1821
+ "url": "https://atlas.onlyworlds.com",
1822
+ "client": "atlas",
1823
+ "rung": "listed",
1824
+ "open": {
1825
+ "world": "https://atlas.onlyworlds.com/#/open/{world}",
1826
+ "element": "https://atlas.onlyworlds.com/#/open/{world}/element/{id}",
1827
+ "needs": "account"
1828
+ }
1829
+ },
1830
+ {
1831
+ "id": "lantern",
1832
+ "name": "Lantern",
1833
+ "url": "https://lantern.onlyworlds.com",
1834
+ "client": "lantern",
1835
+ "rung": "listed",
1836
+ "open": {
1837
+ "world": "https://lantern.onlyworlds.com/#/open/{world}",
1838
+ "element": "https://lantern.onlyworlds.com/#/open/{world}/element/{id}",
1839
+ "needs": "account"
1840
+ }
1841
+ }
1842
+ ];
1843
+
1844
+ // src/doors.ts
1845
+ var TIME = /^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.([0-9]+))?(Z|([+-])([0-9]{2}):([0-9]{2}))$/;
1846
+ var MONTH_DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
1847
+ var fail2 = (what) => {
1848
+ throw new TypeError(`doorsOf: ${what}`);
1849
+ };
1850
+ function daysFromCivil(year, month, day) {
1851
+ const y = month <= 2 ? year - 1 : year;
1852
+ const era = Math.floor(y / 400);
1853
+ const yoe = y - era * 400;
1854
+ const doy = Math.floor((153 * (month > 2 ? month - 3 : month + 9) + 2) / 5) + day - 1;
1855
+ const doe = yoe * 365 + Math.floor(yoe / 4) - Math.floor(yoe / 100) + doy;
1856
+ return era * 146097 + doe - 719468;
1857
+ }
1858
+ function instantOf(value) {
1859
+ if (typeof value !== "string") return null;
1860
+ const m = TIME.exec(value);
1861
+ if (m === null) return null;
1862
+ const [year, month, day, hour, minute, second] = m.slice(1, 7).map(Number);
1863
+ if (month < 1 || month > 12) return null;
1864
+ const leap = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
1865
+ if (day < 1 || day > (month === 2 && leap ? 29 : MONTH_DAYS[month - 1])) return null;
1866
+ if (hour > 23 || minute > 59 || second > 59) return null;
1867
+ let offset = 0;
1868
+ if (m[8] !== "Z") {
1869
+ const oh = Number(m[10]);
1870
+ const om = Number(m[11]);
1871
+ if (oh > 23 || om > 59) return null;
1872
+ offset = (m[9] === "-" ? -1 : 1) * (oh * 3600 + om * 60);
1873
+ }
1874
+ const seconds = daysFromCivil(year, month, day) * 86400 + hour * 3600 + minute * 60 + second - offset;
1875
+ return { seconds, fraction: (m[7] ?? "").replace(/0+$/, "") };
1876
+ }
1877
+ function compareInstants(a, b) {
1878
+ if (a.seconds !== b.seconds) return a.seconds < b.seconds ? -1 : 1;
1879
+ const width = Math.max(a.fraction.length, b.fraction.length);
1880
+ const fa = a.fraction.padEnd(width, "0");
1881
+ const fb = b.fraction.padEnd(width, "0");
1882
+ return fa === fb ? 0 : fa < fb ? -1 : 1;
1883
+ }
1884
+ function compareCodePoints(a, b) {
1885
+ const ca = Array.from(a, (c) => c.codePointAt(0));
1886
+ const cb = Array.from(b, (c) => c.codePointAt(0));
1887
+ for (let i = 0; i < Math.min(ca.length, cb.length); i++) {
1888
+ if (ca[i] !== cb[i]) return ca[i] < cb[i] ? -1 : 1;
1889
+ }
1890
+ return ca.length - cb.length;
1891
+ }
1892
+ var nonEmpty = (v) => typeof v === "string" && v.length > 0;
1893
+ function doorsOf(element, tools = TOOLS) {
1894
+ if (element === null || typeof element !== "object" || Array.isArray(element)) fail2("the element is an object, as the API serves it");
1895
+ if (!Array.isArray(tools)) fail2("tools is the tools list's rows, an array");
1896
+ const e = element;
1897
+ const toolOf = (door) => {
1898
+ const row = tools.find((r) => r !== null && typeof r === "object" && r.client === door);
1899
+ return row === void 0 ? null : { id: row.id, name: row.name };
1900
+ };
1901
+ const found = [];
1902
+ const doors = e.doors;
1903
+ if (doors !== null && typeof doors === "object" && !Array.isArray(doors)) {
1904
+ for (const [door, at] of Object.entries(doors)) {
1905
+ const instant = instantOf(at);
1906
+ if (door.length > 0 && instant !== null) found.push({ door, at, instant });
1907
+ }
1908
+ }
1909
+ const updated = instantOf(e.updated_at);
1910
+ if (found.length === 0) {
1911
+ const door = nonEmpty(e.changed_client) ? e.changed_client : nonEmpty(e.changed_via) ? e.changed_via : null;
1912
+ if (door === null || updated === null) return [];
1913
+ return [{ door, at: e.updated_at, tool: toolOf(door), last: true, from: "last-write" }];
1914
+ }
1915
+ found.sort((a, b) => compareInstants(b.instant, a.instant) || compareCodePoints(a.door, b.door));
1916
+ let lastSeen = false;
1917
+ return found.map(({ door, at, instant }) => {
1918
+ const last = !lastSeen && updated !== null && compareInstants(instant, updated) === 0;
1919
+ if (last) lastSeen = true;
1920
+ return { door, at, tool: toolOf(door), last, from: "doors" };
1921
+ });
1922
+ }
1923
+ function doorWhere(door) {
1924
+ if (door === null || typeof door !== "object" || Array.isArray(door)) throw new TypeError("doorWhere: the door is an entry of doorsOf, an object");
1925
+ if (typeof door.door !== "string") throw new TypeError("doorWhere: the entry's door is a string");
1926
+ const tool = door.tool;
1927
+ if (tool != null) {
1928
+ if (typeof tool !== "object" || typeof tool.name !== "string") throw new TypeError("doorWhere: the entry's tool is null or { id, name }");
1929
+ return `in ${tool.name}`;
1930
+ }
1931
+ if (door.door === "site") return "on onlyworlds.com";
1932
+ if (isAgentDoor(door.door)) return "with an AI";
1933
+ if (door.door === "server") return "by OnlyWorlds";
1934
+ return "in code";
1935
+ }
1936
+
1937
+ export {
1938
+ unknownKey,
1939
+ refuseUnknownOptions,
1940
+ ELEMENT_TYPES,
1941
+ ONLYWORLDS_VERSION,
1942
+ ELEMENT_GROUPS,
1943
+ GROUP_ORDER,
1944
+ GROUP_COLORS,
1945
+ ELEMENT_ICONS,
1946
+ PUBLIC_FIELDS,
1947
+ ELEMENT_SECTIONS,
1948
+ ROOM_PAIRS,
1949
+ CHARTER_PAIRS,
1950
+ REVIEW_PROPOSED_LABEL,
1951
+ MESSAGE_PAIR,
1952
+ MESSAGE_READ_MARK,
1953
+ NOTE_PAIR,
1954
+ FIELD_SCHEMA,
1955
+ SPATIAL_TYPES,
1956
+ AGENT_DOORS,
1957
+ isAgentDoor,
1958
+ isKnownOf,
1959
+ nfc,
1960
+ WORLD_FILE_MEDIA_TYPE,
1961
+ WORLD_FILE_MAX_BYTES,
1962
+ WORLD_FILE_MAX_ENTRIES,
1963
+ OwWorldFileError,
1964
+ simpleCaseFold,
1965
+ readWorldFile,
1966
+ writeWorldFile,
1967
+ trimWhiteSpace,
1968
+ fold,
1969
+ isRoomElement,
1970
+ READING_AID_KEYS,
1971
+ readingAidKey,
1972
+ isCharterElement,
1973
+ readingAidOf,
1974
+ typeWord,
1975
+ OwAddressError,
1976
+ elementAddress,
1977
+ parseOwLink,
1978
+ openersFor,
1979
+ TOOLS,
1980
+ doorsOf,
1981
+ doorWhere
1982
+ };