loredata 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +9 -0
- package/README.md +119 -0
- package/data/breaking-bad/addresses.json +37 -0
- package/data/breaking-bad/characters.json +120 -0
- package/data/breaking-bad/domains.json +6 -0
- package/data/breaking-bad/meta.json +4 -0
- package/data/fast-and-furious/addresses.json +28 -0
- package/data/fast-and-furious/characters.json +115 -0
- package/data/fast-and-furious/domains.json +6 -0
- package/data/fast-and-furious/meta.json +4 -0
- package/data/friends/addresses.json +34 -0
- package/data/friends/characters.json +176 -0
- package/data/friends/domains.json +6 -0
- package/data/friends/meta.json +1 -0
- package/data/game-of-thrones/addresses.json +37 -0
- package/data/game-of-thrones/characters.json +270 -0
- package/data/game-of-thrones/domains.json +6 -0
- package/data/game-of-thrones/meta.json +4 -0
- package/data/harry-potter/addresses.json +37 -0
- package/data/harry-potter/characters.json +125 -0
- package/data/harry-potter/domains.json +6 -0
- package/data/harry-potter/meta.json +4 -0
- package/data/house-md/addresses.json +32 -0
- package/data/house-md/characters.json +213 -0
- package/data/house-md/domains.json +6 -0
- package/data/house-md/meta.json +1 -0
- package/data/lost/addresses.json +31 -0
- package/data/lost/characters.json +204 -0
- package/data/lost/domains.json +6 -0
- package/data/lost/meta.json +1 -0
- package/data/matrix/addresses.json +6 -0
- package/data/matrix/characters.json +194 -0
- package/data/matrix/domains.json +6 -0
- package/data/matrix/meta.json +1 -0
- package/data/peaky-blinders/addresses.json +26 -0
- package/data/peaky-blinders/characters.json +198 -0
- package/data/peaky-blinders/domains.json +6 -0
- package/data/peaky-blinders/meta.json +1 -0
- package/data/sherlock/addresses.json +31 -0
- package/data/sherlock/characters.json +184 -0
- package/data/sherlock/domains.json +6 -0
- package/data/sherlock/meta.json +1 -0
- package/data/the-office/addresses.json +30 -0
- package/data/the-office/characters.json +244 -0
- package/data/the-office/domains.json +6 -0
- package/data/the-office/meta.json +4 -0
- package/dist/browser.cjs +321 -0
- package/dist/browser.cjs.map +1 -0
- package/dist/browser.d.cts +11 -0
- package/dist/browser.d.ts +11 -0
- package/dist/browser.js +288 -0
- package/dist/browser.js.map +1 -0
- package/dist/cli/cli.cjs +390 -0
- package/dist/cli/cli.cjs.map +1 -0
- package/dist/cli/cli.d.cts +1 -0
- package/dist/cli/cli.d.ts +1 -0
- package/dist/cli/cli.js +388 -0
- package/dist/cli/cli.js.map +1 -0
- package/dist/index.cjs +356 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +26 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +323 -0
- package/dist/index.js.map +1 -0
- package/dist/universe-store-DJrm7bP7.d.cts +98 -0
- package/dist/universe-store-DJrm7bP7.d.ts +98 -0
- package/package.json +77 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"emailDomains": ["221b.co.uk", "scotlandyard.gov.uk", "thescienceofdeduction.com", "diogenesclub.co.uk", "bakerstreet.co.uk", "barts.nhs.uk"],
|
|
3
|
+
"phonePrefixes": ["020", "207", "208"],
|
|
4
|
+
"phoneEasterEggs": [],
|
|
5
|
+
"passwordEasterEggs": ["the_game_is_on", "elementary", "vatican_cameos", "sherlock_is_dead", "i_am_sherlocked", "did_you_miss_me", "high_functioning_sociopath", "burning_the_heart"]
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id": "sherlock", "name": "Sherlock"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"street": "1725 Slough Ave",
|
|
4
|
+
"city": "Scranton",
|
|
5
|
+
"state": "PA",
|
|
6
|
+
"zip": "18540",
|
|
7
|
+
"country": "US"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"street": "Schrute Farms, Honesdale Road",
|
|
11
|
+
"city": "Honesdale",
|
|
12
|
+
"state": "PA",
|
|
13
|
+
"country": "US"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"city": "Scranton",
|
|
17
|
+
"state": "PA",
|
|
18
|
+
"country": "US"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"city": "Stamford",
|
|
22
|
+
"state": "CT",
|
|
23
|
+
"country": "US"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"city": "Tallahassee",
|
|
27
|
+
"state": "FL",
|
|
28
|
+
"country": "US"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "michael-scott",
|
|
4
|
+
"firstName": "Michael",
|
|
5
|
+
"lastName": "Scott",
|
|
6
|
+
"usernames": ["world_best_boss", "thats_what_she_said", "michael_g_scott"],
|
|
7
|
+
"profession": "regional manager",
|
|
8
|
+
"interests": ["improv comedy", "his employees", "Ryan Howard", "movie making"],
|
|
9
|
+
"quotes": [
|
|
10
|
+
"That's what she said.",
|
|
11
|
+
"Would I rather be feared or loved? Easy, both. I want people to be afraid of how much they love me.",
|
|
12
|
+
"Why are you the way that you are? Honestly, every time I try to do something fun or exciting, you make it not that way. I hate so much about the things that you choose to be.",
|
|
13
|
+
"I swore to myself that if I ever got to walk around the room as manager, people would laugh when they saw me coming and would applaud as I walked away.",
|
|
14
|
+
"I am Beyoncé, always."
|
|
15
|
+
],
|
|
16
|
+
"gender": "male",
|
|
17
|
+
"address": {"street": "1725 Slough Ave", "city": "Scranton", "state": "PA", "country": "US"}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": "dwight-schrute",
|
|
21
|
+
"firstName": "Dwight",
|
|
22
|
+
"lastName": "Schrute",
|
|
23
|
+
"usernames": ["assistant_regional_manager", "beet_farmer_mose", "schrute_farms"],
|
|
24
|
+
"profession": "assistant to the regional manager",
|
|
25
|
+
"interests": ["beet farming", "karate", "Battlestar Galactica", "volunteer sheriff"],
|
|
26
|
+
"quotes": [
|
|
27
|
+
"Identity theft is not a joke, Jim! Millions of families suffer every year!",
|
|
28
|
+
"I come from a long line of fighters. My maternal grandfather was the toughest guy I ever knew. World War Two veteran. Killed twenty men then spent the rest of the war in an Allied prison camp.",
|
|
29
|
+
"I have been Michael's number two guy for about 5 years, and we make a great team. We're like one of those classic famous teams. He's like Mozart and I'm like... Mozart's friend.",
|
|
30
|
+
"Women are like wolves. If you want a wolf, you have to trap it. Snare it. Then to keep it happy, you have to tame it.",
|
|
31
|
+
"Why tip someone for a job I'm capable of doing myself? I can deliver food. I can drive a taxi. I can, and do, cut my own hair."
|
|
32
|
+
],
|
|
33
|
+
"gender": "male",
|
|
34
|
+
"address": {"street": "Schrute Farms, Honesdale Road", "city": "Honesdale", "state": "PA", "country": "US"}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "jim-halpert",
|
|
38
|
+
"firstName": "Jim",
|
|
39
|
+
"lastName": "Halpert",
|
|
40
|
+
"usernames": ["big_tuna", "jello_stapler", "jim_from_sales"],
|
|
41
|
+
"profession": "sales representative",
|
|
42
|
+
"interests": ["pranking Dwight", "Pam Beesly", "sports", "beer"],
|
|
43
|
+
"quotes": [
|
|
44
|
+
"I am about to do something very bold in this job that I've never done before: try.",
|
|
45
|
+
"Fact. Bears eat beets. Bears. Beets. Battlestar Galactica.",
|
|
46
|
+
"Right now, this is just a job. If I advance any higher in this company, then this would be my career. And, well, if this were my career, I'd have to throw myself in front of a train.",
|
|
47
|
+
"I'm in love with you. I'm really sorry if that's weird for you to hear, but I needed you to hear it.",
|
|
48
|
+
"My roommate wants to meet everybody. Because I'm pretty sure he thinks I'm making Dwight up. He is very real."
|
|
49
|
+
],
|
|
50
|
+
"gender": "male"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"id": "pam-beesly",
|
|
54
|
+
"firstName": "Pam",
|
|
55
|
+
"lastName": "Beesly",
|
|
56
|
+
"usernames": ["reception_pam", "pamcasso", "pam_the_receptionist"],
|
|
57
|
+
"profession": "receptionist",
|
|
58
|
+
"interests": ["painting", "art", "Jim Halpert", "design"],
|
|
59
|
+
"quotes": [
|
|
60
|
+
"You know what they say about a car wreck, where it's so awful you can't look away? The Dundies are like a car wreck that you want to look away from but you have to stare at it because your boss is making you.",
|
|
61
|
+
"I didn't go to college, but if I did, I would've majored in communications with a minor in women's studies.",
|
|
62
|
+
"I have a lot of questions. Number one: how dare you?",
|
|
63
|
+
"I feel like all my kids grew up and then they married each other. It's every parent's dream.",
|
|
64
|
+
"There's a lot of beauty in ordinary things. Isn't that kind of the point?"
|
|
65
|
+
],
|
|
66
|
+
"gender": "female"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"id": "ryan-howard",
|
|
70
|
+
"firstName": "Ryan",
|
|
71
|
+
"lastName": "Howard",
|
|
72
|
+
"usernames": ["wunderkind_ryan", "ryan_started_fire", "temp_to_vp"],
|
|
73
|
+
"profession": "temp / VP of sales",
|
|
74
|
+
"interests": ["entrepreneurship", "his startup", "Kelly Kapoor", "being important"],
|
|
75
|
+
"quotes": [
|
|
76
|
+
"If I had to, I could clean out my desk in five seconds, and nobody would ever know that I'd ever been here. And I'd forget, too.",
|
|
77
|
+
"Yeah, I'm not a temp anymore. I got Jim's old job. Which means at my ten year high school reunion, it will not say 'Ryan Howard is a temp'.",
|
|
78
|
+
"I don't want to be married to Kelly Kapoor. I want to be the guy who almost married Kelly Kapoor.",
|
|
79
|
+
"I was in my mid-twenties and I was going through a lot of stuff. I think I never fully processed 9/11.",
|
|
80
|
+
"I just think that at this stage of my career, I need to be in a place where I can take meetings."
|
|
81
|
+
],
|
|
82
|
+
"gender": "male"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"id": "andy-bernard",
|
|
86
|
+
"firstName": "Andy",
|
|
87
|
+
"lastName": "Bernard",
|
|
88
|
+
"usernames": ["nard_dog", "cornell_andy", "here_comes_treble"],
|
|
89
|
+
"profession": "sales representative",
|
|
90
|
+
"interests": ["a cappella", "Cornell University", "banjo", "anger management"],
|
|
91
|
+
"quotes": [
|
|
92
|
+
"I am the Nard Dog, and I am on the prowl.",
|
|
93
|
+
"I wish there was a way to know you're in the good old days before you've actually left them.",
|
|
94
|
+
"I went to Cornell. Ever heard of it? I graduated in four years, I never studied once, I was drunk the whole time, and I sang in the a cappella group Here Comes Treble.",
|
|
95
|
+
"I do parkour.",
|
|
96
|
+
"The most romantic present you can give a woman is a clock. Because you're giving her your time."
|
|
97
|
+
],
|
|
98
|
+
"gender": "male"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"id": "angela-martin",
|
|
102
|
+
"firstName": "Angela",
|
|
103
|
+
"lastName": "Martin",
|
|
104
|
+
"usernames": ["cat_lady_angela", "head_of_accounting", "angela_the_strict"],
|
|
105
|
+
"profession": "head of accounting",
|
|
106
|
+
"interests": ["cats", "church", "judging coworkers", "Dwight Schrute"],
|
|
107
|
+
"quotes": [
|
|
108
|
+
"I actually look forward to performance reviews. I did the youth beauty pageant circuit, and I enjoyed that quite a bit. I really enjoy being judged.",
|
|
109
|
+
"I don't think it's appropriate to have this conversation in the workplace.",
|
|
110
|
+
"My cats can sense my emotions. They know when I'm sad.",
|
|
111
|
+
"I always imagined I'd have a traditional wedding. Nothing over the top. Maybe a church. Simple flowers. No clowns.",
|
|
112
|
+
"I don't gossip. But I do hear things."
|
|
113
|
+
],
|
|
114
|
+
"gender": "female"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"id": "kelly-kapoor",
|
|
118
|
+
"firstName": "Kelly",
|
|
119
|
+
"lastName": "Kapoor",
|
|
120
|
+
"usernames": ["kelly_talks_alot", "ryan_and_kelly", "customer_service_queen"],
|
|
121
|
+
"profession": "customer service representative",
|
|
122
|
+
"interests": ["Ryan Howard", "celebrity gossip", "fashion", "talking"],
|
|
123
|
+
"quotes": [
|
|
124
|
+
"I swallowed a tapeworm last night. It's going to grow up to three feet inside of me and it eats all my food so that I don't get fat.",
|
|
125
|
+
"Oh my God, that makes it even more romantic. This is like a modern day Enchanted.",
|
|
126
|
+
"Oh my God, I have so much to tell you.",
|
|
127
|
+
"Ryan used me as an object. But I actually fell for him. Woops!",
|
|
128
|
+
"I talk a lot. So I've learned to just tune myself out."
|
|
129
|
+
],
|
|
130
|
+
"gender": "female"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"id": "kevin-malone",
|
|
134
|
+
"firstName": "Kevin",
|
|
135
|
+
"lastName": "Malone",
|
|
136
|
+
"usernames": ["kevin_the_turtle", "big_kev_m", "chili_kevin"],
|
|
137
|
+
"profession": "accountant",
|
|
138
|
+
"interests": ["chili", "poker", "his band Scrantonicity", "food"],
|
|
139
|
+
"quotes": [
|
|
140
|
+
"Why waste time say lot word when few word do trick.",
|
|
141
|
+
"I have very little patience for stupidity.",
|
|
142
|
+
"Sometimes I'll start a sentence, and I don't even know where it's going. I just hope I find it along the way.",
|
|
143
|
+
"I am a great cook. My famous chili is a closely guarded secret.",
|
|
144
|
+
"Oscar is a great guy. I don't care what everyone says about him."
|
|
145
|
+
],
|
|
146
|
+
"gender": "male"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"id": "oscar-martinez",
|
|
150
|
+
"firstName": "Oscar",
|
|
151
|
+
"lastName": "Martinez",
|
|
152
|
+
"usernames": ["actually_oscar", "oscar_the_accountant", "sensible_oscar"],
|
|
153
|
+
"profession": "accountant",
|
|
154
|
+
"interests": ["politics", "art", "correcting people", "wine"],
|
|
155
|
+
"quotes": [
|
|
156
|
+
"That isn't ethics. Ethics is a real discussion of the competing conceptions of the good. This is just the corporate anti-shoplifting rules.",
|
|
157
|
+
"Actually, I have the highest IQ of anyone in this office.",
|
|
158
|
+
"I want to explain to you what I'm about to say. We're in a recession. And Angela sat here — right here, where I'm standing now — and told me that Pam's baby is ugly.",
|
|
159
|
+
"I am gay, and I want to say to anyone watching this who is also gay: it gets better.",
|
|
160
|
+
"I can't believe you let this happen. I am going to correct this. I am going to fix this."
|
|
161
|
+
],
|
|
162
|
+
"gender": "male"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"id": "darryl-philbin",
|
|
166
|
+
"firstName": "Darryl",
|
|
167
|
+
"lastName": "Philbin",
|
|
168
|
+
"usernames": ["warehouse_darryl", "darryl_philbin", "darryl_from_the_warehouse"],
|
|
169
|
+
"profession": "warehouse foreman",
|
|
170
|
+
"interests": ["music", "his daughter Jada", "basketball", "getting out of Scranton"],
|
|
171
|
+
"quotes": [
|
|
172
|
+
"I taught Mike some phrases to help with his business. Fluffy fingers, that's when a fellow is being extra sweet to someone. Pippity poppity, give me the zoppity. That means, please, sir, I'd like the report.",
|
|
173
|
+
"I used to be a member of the Finger Lakes Hiking Club. We'd go on these long hikes and I loved the camaraderie. Nobody there named their dog after a president.",
|
|
174
|
+
"Mike, you are my gift to this company.",
|
|
175
|
+
"I'm not going to beg to be taken seriously as a musician. I'm just going to keep making music and let it speak for itself.",
|
|
176
|
+
"The Foreman's grille: the foreman being me."
|
|
177
|
+
],
|
|
178
|
+
"gender": "male"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"id": "stanley-hudson",
|
|
182
|
+
"firstName": "Stanley",
|
|
183
|
+
"lastName": "Hudson",
|
|
184
|
+
"usernames": ["stanley_pretzel", "florida_stan", "did_i_stutter"],
|
|
185
|
+
"profession": "sales representative",
|
|
186
|
+
"interests": ["pretzel day", "Florida", "crossword puzzles", "retirement"],
|
|
187
|
+
"quotes": [
|
|
188
|
+
"Did I stutter?",
|
|
189
|
+
"I wake up every morning in a bed that's too small, drive my daughter to a school that's too expensive, and then I go to work to a job for which I get paid too little. But on Pretzel Day? Well, I like Pretzel Day.",
|
|
190
|
+
"Boy, have you lost your mind? Because I'll help you find it!",
|
|
191
|
+
"I do not apologize unless I think I'm wrong, and if you don't like it you can leave.",
|
|
192
|
+
"This is the worst thing that's ever happened to me, and I was on a Real Housewives episode."
|
|
193
|
+
],
|
|
194
|
+
"gender": "male"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"id": "creed-bratton",
|
|
198
|
+
"firstName": "Creed",
|
|
199
|
+
"lastName": "Bratton",
|
|
200
|
+
"usernames": ["nobody_steals_from_creed", "creed_thoughts", "quality_assurance"],
|
|
201
|
+
"profession": "quality assurance director",
|
|
202
|
+
"interests": ["his past", "schemes", "counterfeiting", "mung beans"],
|
|
203
|
+
"quotes": [
|
|
204
|
+
"Nobody steals from Creed Bratton and gets away with it. The last person to do this disappeared. His name: Creed Bratton.",
|
|
205
|
+
"Every week I'm supposed to do a quality check at the paper mill. And of course the one year I blow it off, this happens.",
|
|
206
|
+
"That wasn't a tapeworm.",
|
|
207
|
+
"I've been involved in a number of cults, both as a leader and a follower. You have more fun as a follower, but you make more money as a leader.",
|
|
208
|
+
"I already won the lottery. I was born in the US of A, baby."
|
|
209
|
+
],
|
|
210
|
+
"gender": "male"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"id": "toby-flenderson",
|
|
214
|
+
"firstName": "Toby",
|
|
215
|
+
"lastName": "Flenderson",
|
|
216
|
+
"usernames": ["hr_toby", "annex_dweller", "costa_rica_toby"],
|
|
217
|
+
"profession": "HR representative",
|
|
218
|
+
"interests": ["his daughter", "writing", "Costa Rica", "true crime"],
|
|
219
|
+
"quotes": [
|
|
220
|
+
"Well, I was in the seminary for a year and dropped out because I wanted to have sex with this girl Cathy. Followed her back to Scranton. Took the first job I could find in HR. Later she divorced me. So, no I wouldn't say I have a passion for HR.",
|
|
221
|
+
"Michael's like a movie on a plane. You know it's not great, but it's something to watch. And then when it's over, you're like, how much time is left on this flight?",
|
|
222
|
+
"I don't have a lot of contact with the rest of the office but I like to think of myself as a kind of backstop. If someone needs to talk, I'm here.",
|
|
223
|
+
"I'm not a part of this family. I'm HR, which means I work for corporate.",
|
|
224
|
+
"This meeting is a waste of time."
|
|
225
|
+
],
|
|
226
|
+
"gender": "male"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"id": "phyllis-vance",
|
|
230
|
+
"firstName": "Phyllis",
|
|
231
|
+
"lastName": "Vance",
|
|
232
|
+
"usernames": ["phyllis_from_sales", "vance_refrigeration", "bob_vances_wife"],
|
|
233
|
+
"profession": "sales representative",
|
|
234
|
+
"interests": ["knitting", "Bob Vance", "gossip", "Vance Refrigeration"],
|
|
235
|
+
"quotes": [
|
|
236
|
+
"I'm a pretty private person. I don't like to talk about my personal life.",
|
|
237
|
+
"I have a tiny bladder.",
|
|
238
|
+
"My mother always said you can tell a lot about a person by their shoes.",
|
|
239
|
+
"Bob Vance, Vance Refrigeration.",
|
|
240
|
+
"I feel like I've been here before in a past life."
|
|
241
|
+
],
|
|
242
|
+
"gender": "female"
|
|
243
|
+
}
|
|
244
|
+
]
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"emailDomains": ["dundermifflin.com", "schrute-farms.com", "vancerefrigeration.com", "michaelscottpaperco.com"],
|
|
3
|
+
"phonePrefixes": ["570", "484"],
|
|
4
|
+
"phoneEasterEggs": ["570-555-0177"],
|
|
5
|
+
"passwordEasterEggs": ["thats_what_she_said", "pretzel_day", "bears_beets_bsg", "nard_dog_2005"]
|
|
6
|
+
}
|
package/dist/browser.cjs
ADDED
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/browser.ts
|
|
21
|
+
var browser_exports = {};
|
|
22
|
+
__export(browser_exports, {
|
|
23
|
+
UniverseStore: () => UniverseStore,
|
|
24
|
+
getAvailableIds: () => getAvailableIds,
|
|
25
|
+
loadAllUniverses: () => loadAllUniverses,
|
|
26
|
+
loadUniverse: () => loadUniverse,
|
|
27
|
+
loadUniverses: () => loadUniverses,
|
|
28
|
+
personFromData: () => personFromData
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(browser_exports);
|
|
31
|
+
|
|
32
|
+
// src/generators/random.ts
|
|
33
|
+
function createRng(seed) {
|
|
34
|
+
if (seed === void 0) {
|
|
35
|
+
return Math.random;
|
|
36
|
+
}
|
|
37
|
+
let s = seed;
|
|
38
|
+
return function rng() {
|
|
39
|
+
s += 1831565813;
|
|
40
|
+
let z = s;
|
|
41
|
+
z = Math.imul(z ^ z >>> 15, z | 1);
|
|
42
|
+
z ^= z + Math.imul(z ^ z >>> 7, z | 61);
|
|
43
|
+
return ((z ^ z >>> 14) >>> 0) / 4294967296;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function pickRandom(array, rng) {
|
|
47
|
+
const index = Math.floor(rng() * array.length);
|
|
48
|
+
return array[index];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// src/generators/email.ts
|
|
52
|
+
var EmailGenerator = class {
|
|
53
|
+
static generate(firstName, lastName, domains, rng) {
|
|
54
|
+
const domain = pickRandom(domains.emailDomains, rng);
|
|
55
|
+
const first = firstName.toLowerCase();
|
|
56
|
+
const last = lastName.toLowerCase();
|
|
57
|
+
return `${first}.${last}@${domain}`;
|
|
58
|
+
}
|
|
59
|
+
static generateFromUsername(username, domains, rng) {
|
|
60
|
+
const domain = pickRandom(domains.emailDomains, rng);
|
|
61
|
+
return `${username}@${domain}`;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// src/generators/phone.ts
|
|
66
|
+
var PhoneGenerator = class {
|
|
67
|
+
static generate(domains, rng) {
|
|
68
|
+
if (domains.phoneEasterEggs && domains.phoneEasterEggs.length > 0 && rng() < 0.2) {
|
|
69
|
+
return pickRandom(domains.phoneEasterEggs, rng);
|
|
70
|
+
}
|
|
71
|
+
const prefix = pickRandom(domains.phonePrefixes, rng);
|
|
72
|
+
const suffix = this.randomDigits(7, rng);
|
|
73
|
+
return `${prefix}-${suffix.slice(0, 3)}-${suffix.slice(3)}`;
|
|
74
|
+
}
|
|
75
|
+
static randomDigits(count, rng) {
|
|
76
|
+
let result = "";
|
|
77
|
+
for (let i = 0; i < count; i++) {
|
|
78
|
+
result += Math.floor(rng() * 10).toString();
|
|
79
|
+
}
|
|
80
|
+
return result;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// src/generators/password.ts
|
|
85
|
+
var PasswordGenerator = class {
|
|
86
|
+
static generate(domains, rng) {
|
|
87
|
+
if (domains.passwordEasterEggs && domains.passwordEasterEggs.length > 0 && rng() < 0.3) {
|
|
88
|
+
return pickRandom(domains.passwordEasterEggs, rng);
|
|
89
|
+
}
|
|
90
|
+
return this.randomPassword(12, rng);
|
|
91
|
+
}
|
|
92
|
+
static randomPassword(length, rng) {
|
|
93
|
+
const chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$";
|
|
94
|
+
let result = "";
|
|
95
|
+
for (let i = 0; i < length; i++) {
|
|
96
|
+
result += chars[Math.floor(rng() * chars.length)];
|
|
97
|
+
}
|
|
98
|
+
return result;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// src/engine/person-factory.ts
|
|
103
|
+
var PersonFactory = class {
|
|
104
|
+
static build(universe, seed) {
|
|
105
|
+
const rng = createRng(seed);
|
|
106
|
+
const character = pickRandom(universe.characters, rng);
|
|
107
|
+
return this.buildFromCharacter(character, universe, rng);
|
|
108
|
+
}
|
|
109
|
+
static buildByCharacterId(characterId, universe, seed) {
|
|
110
|
+
const character = universe.characters.find((c) => c.id === characterId);
|
|
111
|
+
if (!character) {
|
|
112
|
+
throw new Error(`Character "${characterId}" not found in universe "${universe.id}"`);
|
|
113
|
+
}
|
|
114
|
+
const rng = createRng(seed);
|
|
115
|
+
return this.buildFromCharacter(character, universe, rng);
|
|
116
|
+
}
|
|
117
|
+
static buildFromCharacter(character, universe, rng) {
|
|
118
|
+
const address = character.address ?? pickRandom(universe.addresses, rng);
|
|
119
|
+
const username = pickRandom(character.usernames, rng);
|
|
120
|
+
const domains = character.emailDomain ? { ...universe.domains, emailDomains: [character.emailDomain] } : universe.domains;
|
|
121
|
+
const email = EmailGenerator.generateFromUsername(username, domains, rng);
|
|
122
|
+
const phone = PhoneGenerator.generate(universe.domains, rng);
|
|
123
|
+
const password = PasswordGenerator.generate(universe.domains, rng);
|
|
124
|
+
const quote = pickRandom(character.quotes, rng);
|
|
125
|
+
const avatarName = encodeURIComponent(`${character.firstName} ${character.lastName}`);
|
|
126
|
+
const avatar = `https://ui-avatars.com/api/?name=${avatarName}&background=random`;
|
|
127
|
+
const person = {
|
|
128
|
+
id: crypto.randomUUID(),
|
|
129
|
+
characterId: character.id,
|
|
130
|
+
firstName: character.firstName,
|
|
131
|
+
lastName: character.lastName,
|
|
132
|
+
username,
|
|
133
|
+
email,
|
|
134
|
+
password,
|
|
135
|
+
phone,
|
|
136
|
+
address: {
|
|
137
|
+
street: address.street,
|
|
138
|
+
city: address.city,
|
|
139
|
+
state: address.state ?? "",
|
|
140
|
+
zip: address.zip ?? "",
|
|
141
|
+
country: address.country
|
|
142
|
+
},
|
|
143
|
+
profession: character.profession,
|
|
144
|
+
interests: character.interests,
|
|
145
|
+
quote,
|
|
146
|
+
universe: universe.id,
|
|
147
|
+
universeName: universe.name,
|
|
148
|
+
avatar
|
|
149
|
+
};
|
|
150
|
+
return person;
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
// src/engine/universe-store.ts
|
|
155
|
+
var UniverseStore = class {
|
|
156
|
+
universes;
|
|
157
|
+
characterIndex;
|
|
158
|
+
constructor(universes) {
|
|
159
|
+
this.universes = universes;
|
|
160
|
+
this.characterIndex = this.buildIndex(universes);
|
|
161
|
+
}
|
|
162
|
+
get index() {
|
|
163
|
+
return this.characterIndex;
|
|
164
|
+
}
|
|
165
|
+
getInterests(universeIds) {
|
|
166
|
+
const entries = universeIds && universeIds.length > 0 ? this.characterIndex.filter((e) => universeIds.includes(e.universeId)) : this.characterIndex;
|
|
167
|
+
const interestSet = /* @__PURE__ */ new Set();
|
|
168
|
+
for (const entry of entries) {
|
|
169
|
+
for (const interest of entry.interests) {
|
|
170
|
+
interestSet.add(interest);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
const result = Array.from(interestSet).sort();
|
|
174
|
+
return result;
|
|
175
|
+
}
|
|
176
|
+
getUniverses() {
|
|
177
|
+
const result = this.universes.map((u) => ({
|
|
178
|
+
id: u.id,
|
|
179
|
+
name: u.name,
|
|
180
|
+
characterCount: u.characters.length
|
|
181
|
+
}));
|
|
182
|
+
return result;
|
|
183
|
+
}
|
|
184
|
+
findCharacters(query) {
|
|
185
|
+
let entries = this.characterIndex;
|
|
186
|
+
if (query.universes && query.universes.length > 0) {
|
|
187
|
+
entries = entries.filter((e) => query.universes.includes(e.universeId));
|
|
188
|
+
}
|
|
189
|
+
if (query.name && query.name.trim().length > 0) {
|
|
190
|
+
const needle = query.name.toLowerCase();
|
|
191
|
+
entries = entries.filter((e) => {
|
|
192
|
+
const fullName = `${e.firstName} ${e.lastName}`.toLowerCase();
|
|
193
|
+
return fullName.includes(needle);
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
if (query.interests && query.interests.length > 0) {
|
|
197
|
+
const mode = query.interestsMode ?? "or";
|
|
198
|
+
if (mode === "and") {
|
|
199
|
+
entries = entries.filter((e) => query.interests.every((interest) => e.interests.includes(interest)));
|
|
200
|
+
} else {
|
|
201
|
+
entries = entries.filter((e) => query.interests.some((interest) => e.interests.includes(interest)));
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return entries;
|
|
205
|
+
}
|
|
206
|
+
personByCharacterId(characterId, seed) {
|
|
207
|
+
const entry = this.characterIndex.find((e) => e.characterId === characterId);
|
|
208
|
+
if (!entry) {
|
|
209
|
+
throw new Error(`Character "${characterId}" not found in store`);
|
|
210
|
+
}
|
|
211
|
+
const universe = this.universes.find((u) => u.id === entry.universeId);
|
|
212
|
+
if (!universe) {
|
|
213
|
+
throw new Error(`Universe "${entry.universeId}" not found in store`);
|
|
214
|
+
}
|
|
215
|
+
return PersonFactory.buildByCharacterId(characterId, universe, seed);
|
|
216
|
+
}
|
|
217
|
+
generatePersonas(query, count, seed) {
|
|
218
|
+
const matching = this.findCharacters(query);
|
|
219
|
+
if (matching.length === 0) {
|
|
220
|
+
return [];
|
|
221
|
+
}
|
|
222
|
+
const rng = createRng(seed);
|
|
223
|
+
const actualCount = Math.min(count, matching.length);
|
|
224
|
+
const shuffled = [...matching].sort(() => rng() - 0.5);
|
|
225
|
+
const selected = shuffled.slice(0, actualCount);
|
|
226
|
+
const personas = [];
|
|
227
|
+
for (let i = 0; i < selected.length; i++) {
|
|
228
|
+
const entry = selected[i];
|
|
229
|
+
const universe = this.universes.find((u) => u.id === entry.universeId);
|
|
230
|
+
const personSeed = seed !== void 0 ? seed + i : void 0;
|
|
231
|
+
personas.push(PersonFactory.buildByCharacterId(entry.characterId, universe, personSeed));
|
|
232
|
+
}
|
|
233
|
+
return personas;
|
|
234
|
+
}
|
|
235
|
+
buildIndex(universes) {
|
|
236
|
+
const index = [];
|
|
237
|
+
for (const universe of universes) {
|
|
238
|
+
for (const character of universe.characters) {
|
|
239
|
+
const entry = {
|
|
240
|
+
characterId: character.id,
|
|
241
|
+
universeId: universe.id,
|
|
242
|
+
universeName: universe.name,
|
|
243
|
+
firstName: character.firstName,
|
|
244
|
+
lastName: character.lastName,
|
|
245
|
+
interests: character.interests,
|
|
246
|
+
profession: character.profession
|
|
247
|
+
};
|
|
248
|
+
index.push(entry);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return index;
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
// src/universes/browser-loader.ts
|
|
256
|
+
var import_meta = {};
|
|
257
|
+
var metaModules = import_meta.glob("../data/*/meta.json", { eager: false });
|
|
258
|
+
var characterModules = import_meta.glob("../data/*/characters.json", { eager: false });
|
|
259
|
+
var addressModules = import_meta.glob("../data/*/addresses.json", { eager: false });
|
|
260
|
+
var domainModules = import_meta.glob("../data/*/domains.json", { eager: false });
|
|
261
|
+
function extractId(path) {
|
|
262
|
+
const parts = path.split("/");
|
|
263
|
+
return parts[parts.length - 2];
|
|
264
|
+
}
|
|
265
|
+
function getAvailableIds() {
|
|
266
|
+
return Object.keys(metaModules).map(extractId);
|
|
267
|
+
}
|
|
268
|
+
async function loadUniverse(id) {
|
|
269
|
+
const metaPath = `../data/${id}/meta.json`;
|
|
270
|
+
const charactersPath = `../data/${id}/characters.json`;
|
|
271
|
+
const addressesPath = `../data/${id}/addresses.json`;
|
|
272
|
+
const domainsPath = `../data/${id}/domains.json`;
|
|
273
|
+
const metaLoader = metaModules[metaPath];
|
|
274
|
+
const charactersLoader = characterModules[charactersPath];
|
|
275
|
+
const addressesLoader = addressModules[addressesPath];
|
|
276
|
+
const domainsLoader = domainModules[domainsPath];
|
|
277
|
+
if (!metaLoader || !charactersLoader || !addressesLoader || !domainsLoader) {
|
|
278
|
+
throw new Error(`Universe "${id}" not found`);
|
|
279
|
+
}
|
|
280
|
+
const [metaModule, charactersModule, addressesModule, domainsModule] = await Promise.all([
|
|
281
|
+
metaLoader(),
|
|
282
|
+
charactersLoader(),
|
|
283
|
+
addressesLoader(),
|
|
284
|
+
domainsLoader()
|
|
285
|
+
]);
|
|
286
|
+
const meta = metaModule.default;
|
|
287
|
+
const characters = charactersModule.default;
|
|
288
|
+
const addresses = addressesModule.default;
|
|
289
|
+
const domains = domainsModule.default;
|
|
290
|
+
const universeData = {
|
|
291
|
+
id: meta.id,
|
|
292
|
+
name: meta.name,
|
|
293
|
+
characters,
|
|
294
|
+
addresses,
|
|
295
|
+
domains
|
|
296
|
+
};
|
|
297
|
+
return universeData;
|
|
298
|
+
}
|
|
299
|
+
async function loadUniverses(ids) {
|
|
300
|
+
const result = await Promise.all(ids.map((id) => loadUniverse(id)));
|
|
301
|
+
return result;
|
|
302
|
+
}
|
|
303
|
+
async function loadAllUniverses() {
|
|
304
|
+
const ids = getAvailableIds();
|
|
305
|
+
return loadUniverses(ids);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// src/browser.ts
|
|
309
|
+
function personFromData(universe, seed) {
|
|
310
|
+
return PersonFactory.build(universe, seed);
|
|
311
|
+
}
|
|
312
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
313
|
+
0 && (module.exports = {
|
|
314
|
+
UniverseStore,
|
|
315
|
+
getAvailableIds,
|
|
316
|
+
loadAllUniverses,
|
|
317
|
+
loadUniverse,
|
|
318
|
+
loadUniverses,
|
|
319
|
+
personFromData
|
|
320
|
+
});
|
|
321
|
+
//# sourceMappingURL=browser.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/browser.ts","../src/generators/random.ts","../src/generators/email.ts","../src/generators/phone.ts","../src/generators/password.ts","../src/engine/person-factory.ts","../src/engine/universe-store.ts","../src/universes/browser-loader.ts"],"sourcesContent":["import { PersonFactory } from '@/engine/person-factory';\nimport { UniverseStore } from '@/engine/universe-store';\n\nimport type { Person, UniverseData } from '@/types';\n\nexport { UniverseStore };\nexport { loadUniverse, loadUniverses, loadAllUniverses, getAvailableIds } from '@/universes/browser-loader';\n\nexport function personFromData(universe: UniverseData, seed?: number): Person {\n\treturn PersonFactory.build(universe, seed);\n}\n\nexport type { Person, UniverseInfo } from '@/types';\nexport type { Address, UniverseData, CharacterData, AddressData, DomainsData } from '@/types';\nexport type { CharacterEntry, CharacterQuery } from '@/types';\n","/**\n * Seeded pseudo-random number generator (mulberry32).\n * Returns a function that produces values in [0, 1).\n */\nexport function createRng(seed?: number): () => number {\n\tif (seed === undefined) {\n\t\treturn Math.random;\n\t}\n\n\tlet s = seed;\n\n\treturn function rng(): number {\n\t\ts += 0x6d2b79f5;\n\t\tlet z = s;\n\t\tz = Math.imul(z ^ (z >>> 15), z | 1);\n\t\tz ^= z + Math.imul(z ^ (z >>> 7), z | 61);\n\n\t\treturn ((z ^ (z >>> 14)) >>> 0) / 4294967296;\n\t};\n}\n\nexport function pickRandom<T>(array: T[], rng: () => number): T {\n\tconst index = Math.floor(rng() * array.length);\n\n\treturn array[index];\n}\n","import { pickRandom } from './random';\n\nimport type { DomainsData } from '@/types';\n\nexport class EmailGenerator {\n\tstatic generate(firstName: string, lastName: string, domains: DomainsData, rng: () => number): string {\n\t\tconst domain = pickRandom(domains.emailDomains, rng);\n\t\tconst first = firstName.toLowerCase();\n\t\tconst last = lastName.toLowerCase();\n\n\t\treturn `${first}.${last}@${domain}`;\n\t}\n\n\tstatic generateFromUsername(username: string, domains: DomainsData, rng: () => number): string {\n\t\tconst domain = pickRandom(domains.emailDomains, rng);\n\n\t\treturn `${username}@${domain}`;\n\t}\n}\n","import { pickRandom } from './random';\n\nimport type { DomainsData } from '@/types';\n\nexport class PhoneGenerator {\n\tstatic generate(domains: DomainsData, rng: () => number): string {\n\t\tif (domains.phoneEasterEggs && domains.phoneEasterEggs.length > 0 && rng() < 0.2) {\n\t\t\treturn pickRandom(domains.phoneEasterEggs, rng);\n\t\t}\n\n\t\tconst prefix = pickRandom(domains.phonePrefixes, rng);\n\t\tconst suffix = this.randomDigits(7, rng);\n\n\t\treturn `${prefix}-${suffix.slice(0, 3)}-${suffix.slice(3)}`;\n\t}\n\n\tprivate static randomDigits(count: number, rng: () => number): string {\n\t\tlet result = '';\n\n\t\tfor (let i = 0; i < count; i++) {\n\t\t\tresult += Math.floor(rng() * 10).toString();\n\t\t}\n\n\t\treturn result;\n\t}\n}\n","import { pickRandom } from './random';\n\nimport type { DomainsData } from '@/types';\n\nexport class PasswordGenerator {\n\tstatic generate(domains: DomainsData, rng: () => number): string {\n\t\tif (domains.passwordEasterEggs && domains.passwordEasterEggs.length > 0 && rng() < 0.3) {\n\t\t\treturn pickRandom(domains.passwordEasterEggs, rng);\n\t\t}\n\n\t\treturn this.randomPassword(12, rng);\n\t}\n\n\tprivate static randomPassword(length: number, rng: () => number): string {\n\t\tconst chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$';\n\t\tlet result = '';\n\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tresult += chars[Math.floor(rng() * chars.length)];\n\t\t}\n\n\t\treturn result;\n\t}\n}\n","import { createRng, pickRandom, EmailGenerator, PhoneGenerator, PasswordGenerator } from '@/generators';\n\nimport type { Person, UniverseData, CharacterData } from '@/types';\n\nexport class PersonFactory {\n\tstatic build(universe: UniverseData, seed?: number): Person {\n\t\tconst rng = createRng(seed);\n\n\t\tconst character = pickRandom(universe.characters, rng);\n\n\t\treturn this.buildFromCharacter(character, universe, rng);\n\t}\n\n\tstatic buildByCharacterId(characterId: string, universe: UniverseData, seed?: number): Person {\n\t\tconst character = universe.characters.find((c) => c.id === characterId);\n\n\t\tif (!character) {\n\t\t\tthrow new Error(`Character \"${characterId}\" not found in universe \"${universe.id}\"`);\n\t\t}\n\n\t\tconst rng = createRng(seed);\n\n\t\treturn this.buildFromCharacter(character, universe, rng);\n\t}\n\n\tprivate static buildFromCharacter(character: CharacterData, universe: UniverseData, rng: () => number): Person {\n\t\tconst address = character.address ?? pickRandom(universe.addresses, rng);\n\n\t\tconst username = pickRandom(character.usernames, rng);\n\n\t\tconst domains = character.emailDomain ? { ...universe.domains, emailDomains: [character.emailDomain] } : universe.domains;\n\n\t\tconst email = EmailGenerator.generateFromUsername(username, domains, rng);\n\t\tconst phone = PhoneGenerator.generate(universe.domains, rng);\n\t\tconst password = PasswordGenerator.generate(universe.domains, rng);\n\t\tconst quote = pickRandom(character.quotes, rng);\n\t\tconst avatarName = encodeURIComponent(`${character.firstName} ${character.lastName}`);\n\t\tconst avatar = `https://ui-avatars.com/api/?name=${avatarName}&background=random`;\n\n\t\tconst person: Person = {\n\t\t\tid: crypto.randomUUID(),\n\t\t\tcharacterId: character.id,\n\t\t\tfirstName: character.firstName,\n\t\t\tlastName: character.lastName,\n\t\t\tusername,\n\t\t\temail,\n\t\t\tpassword,\n\t\t\tphone,\n\t\t\taddress: {\n\t\t\t\tstreet: address.street,\n\t\t\t\tcity: address.city,\n\t\t\t\tstate: address.state ?? '',\n\t\t\t\tzip: address.zip ?? '',\n\t\t\t\tcountry: address.country\n\t\t\t},\n\t\t\tprofession: character.profession,\n\t\t\tinterests: character.interests,\n\t\t\tquote,\n\t\t\tuniverse: universe.id,\n\t\t\tuniverseName: universe.name,\n\t\t\tavatar\n\t\t};\n\n\t\treturn person;\n\t}\n}\n","import { createRng } from '@/generators';\n\nimport { PersonFactory } from './person-factory';\n\nimport type { UniverseData, Person, CharacterEntry, CharacterQuery } from '@/types';\n\nexport class UniverseStore {\n\tprivate universes: UniverseData[];\n\tprivate characterIndex: CharacterEntry[];\n\n\tconstructor(universes: UniverseData[]) {\n\t\tthis.universes = universes;\n\t\tthis.characterIndex = this.buildIndex(universes);\n\t}\n\n\tget index(): CharacterEntry[] {\n\t\treturn this.characterIndex;\n\t}\n\n\tgetInterests(universeIds?: string[]): string[] {\n\t\tconst entries =\n\t\t\tuniverseIds && universeIds.length > 0\n\t\t\t\t? this.characterIndex.filter((e) => universeIds.includes(e.universeId))\n\t\t\t\t: this.characterIndex;\n\n\t\tconst interestSet = new Set<string>();\n\n\t\tfor (const entry of entries) {\n\t\t\tfor (const interest of entry.interests) {\n\t\t\t\tinterestSet.add(interest);\n\t\t\t}\n\t\t}\n\n\t\tconst result = Array.from(interestSet).sort();\n\n\t\treturn result;\n\t}\n\n\tgetUniverses(): { id: string; name: string; characterCount: number }[] {\n\t\tconst result = this.universes.map((u) => ({\n\t\t\tid: u.id,\n\t\t\tname: u.name,\n\t\t\tcharacterCount: u.characters.length\n\t\t}));\n\n\t\treturn result;\n\t}\n\n\tfindCharacters(query: CharacterQuery): CharacterEntry[] {\n\t\tlet entries = this.characterIndex;\n\n\t\tif (query.universes && query.universes.length > 0) {\n\t\t\tentries = entries.filter((e) => query.universes!.includes(e.universeId));\n\t\t}\n\n\t\tif (query.name && query.name.trim().length > 0) {\n\t\t\tconst needle = query.name.toLowerCase();\n\n\t\t\tentries = entries.filter((e) => {\n\t\t\t\tconst fullName = `${e.firstName} ${e.lastName}`.toLowerCase();\n\n\t\t\t\treturn fullName.includes(needle);\n\t\t\t});\n\t\t}\n\n\t\tif (query.interests && query.interests.length > 0) {\n\t\t\tconst mode = query.interestsMode ?? 'or';\n\n\t\t\tif (mode === 'and') {\n\t\t\t\tentries = entries.filter((e) => query.interests!.every((interest) => e.interests.includes(interest)));\n\t\t\t} else {\n\t\t\t\tentries = entries.filter((e) => query.interests!.some((interest) => e.interests.includes(interest)));\n\t\t\t}\n\t\t}\n\n\t\treturn entries;\n\t}\n\n\tpersonByCharacterId(characterId: string, seed?: number): Person {\n\t\tconst entry = this.characterIndex.find((e) => e.characterId === characterId);\n\n\t\tif (!entry) {\n\t\t\tthrow new Error(`Character \"${characterId}\" not found in store`);\n\t\t}\n\n\t\tconst universe = this.universes.find((u) => u.id === entry.universeId);\n\n\t\tif (!universe) {\n\t\t\tthrow new Error(`Universe \"${entry.universeId}\" not found in store`);\n\t\t}\n\n\t\treturn PersonFactory.buildByCharacterId(characterId, universe, seed);\n\t}\n\n\tgeneratePersonas(query: CharacterQuery, count: number, seed?: number): Person[] {\n\t\tconst matching = this.findCharacters(query);\n\n\t\tif (matching.length === 0) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst rng = createRng(seed);\n\t\tconst actualCount = Math.min(count, matching.length);\n\n\t\tconst shuffled = [...matching].sort(() => rng() - 0.5);\n\t\tconst selected = shuffled.slice(0, actualCount);\n\t\tconst personas: Person[] = [];\n\n\t\tfor (let i = 0; i < selected.length; i++) {\n\t\t\tconst entry = selected[i];\n\t\t\tconst universe = this.universes.find((u) => u.id === entry.universeId)!;\n\t\t\tconst personSeed = seed !== undefined ? seed + i : undefined;\n\n\t\t\tpersonas.push(PersonFactory.buildByCharacterId(entry.characterId, universe, personSeed));\n\t\t}\n\n\t\treturn personas;\n\t}\n\n\tprivate buildIndex(universes: UniverseData[]): CharacterEntry[] {\n\t\tconst index: CharacterEntry[] = [];\n\n\t\tfor (const universe of universes) {\n\t\t\tfor (const character of universe.characters) {\n\t\t\t\tconst entry: CharacterEntry = {\n\t\t\t\t\tcharacterId: character.id,\n\t\t\t\t\tuniverseId: universe.id,\n\t\t\t\t\tuniverseName: universe.name,\n\t\t\t\t\tfirstName: character.firstName,\n\t\t\t\t\tlastName: character.lastName,\n\t\t\t\t\tinterests: character.interests,\n\t\t\t\t\tprofession: character.profession\n\t\t\t\t};\n\n\t\t\t\tindex.push(entry);\n\t\t\t}\n\t\t}\n\n\t\treturn index;\n\t}\n}\n","import type { UniverseData, CharacterData, AddressData, DomainsData } from '@/types';\n\ninterface MetaJson {\n\tid: string;\n\tname: string;\n}\n\nconst metaModules = import.meta.glob('../data/*/meta.json', { eager: false });\nconst characterModules = import.meta.glob('../data/*/characters.json', { eager: false });\nconst addressModules = import.meta.glob('../data/*/addresses.json', { eager: false });\nconst domainModules = import.meta.glob('../data/*/domains.json', { eager: false });\n\nfunction extractId(path: string): string {\n\tconst parts = path.split('/');\n\n\treturn parts[parts.length - 2];\n}\n\nexport function getAvailableIds(): string[] {\n\treturn Object.keys(metaModules).map(extractId);\n}\n\nexport async function loadUniverse(id: string): Promise<UniverseData> {\n\tconst metaPath = `../data/${id}/meta.json`;\n\tconst charactersPath = `../data/${id}/characters.json`;\n\tconst addressesPath = `../data/${id}/addresses.json`;\n\tconst domainsPath = `../data/${id}/domains.json`;\n\n\tconst metaLoader = metaModules[metaPath];\n\tconst charactersLoader = characterModules[charactersPath];\n\tconst addressesLoader = addressModules[addressesPath];\n\tconst domainsLoader = domainModules[domainsPath];\n\n\tif (!metaLoader || !charactersLoader || !addressesLoader || !domainsLoader) {\n\t\tthrow new Error(`Universe \"${id}\" not found`);\n\t}\n\n\tconst [metaModule, charactersModule, addressesModule, domainsModule] = await Promise.all([\n\t\tmetaLoader(),\n\t\tcharactersLoader(),\n\t\taddressesLoader(),\n\t\tdomainsLoader()\n\t]);\n\n\tconst meta = (metaModule as { default: MetaJson }).default;\n\tconst characters = (charactersModule as { default: CharacterData[] }).default;\n\tconst addresses = (addressesModule as { default: AddressData[] }).default;\n\tconst domains = (domainsModule as { default: DomainsData }).default;\n\n\tconst universeData: UniverseData = {\n\t\tid: meta.id,\n\t\tname: meta.name,\n\t\tcharacters,\n\t\taddresses,\n\t\tdomains\n\t};\n\n\treturn universeData;\n}\n\nexport async function loadUniverses(ids: string[]): Promise<UniverseData[]> {\n\tconst result = await Promise.all(ids.map((id) => loadUniverse(id)));\n\n\treturn result;\n}\n\nexport async function loadAllUniverses(): Promise<UniverseData[]> {\n\tconst ids = getAvailableIds();\n\n\treturn loadUniverses(ids);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACIO,SAAS,UAAU,MAA6B;AACtD,MAAI,SAAS,QAAW;AACvB,WAAO,KAAK;AAAA,EACb;AAEA,MAAI,IAAI;AAER,SAAO,SAAS,MAAc;AAC7B,SAAK;AACL,QAAI,IAAI;AACR,QAAI,KAAK,KAAK,IAAK,MAAM,IAAK,IAAI,CAAC;AACnC,SAAK,IAAI,KAAK,KAAK,IAA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