joyful 1.1.3 → 1.2.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/README.md CHANGED
@@ -1,45 +1,178 @@
1
1
  # joyful
2
2
 
3
- Generate delightful, random word combinations for your app — perfect for project names, usernames, or unique identifiers.
3
+ Generate friendly, safe-for-work word combinations for project names, usernames, labels, demo data, and unique-looking identifiers.
4
4
 
5
- ## Installation
5
+ <div>
6
+ <img src="https://img.shields.io/npm/dy/joyful" alt="" />
7
+ <img src="https://img.shields.io/npm/v/joyful" alt="" />
8
+ <img src="https://img.shields.io/github/license/kayleewillimams/joyful" alt="" />
9
+ </div>
10
+
11
+ ## Quick Start
6
12
 
7
13
  ```bash
8
- pnpm add joyful
14
+ bun add joyful
9
15
  ```
10
16
 
11
- ## Usage
12
-
13
17
  ```ts
14
18
  import { joyful } from "joyful";
15
19
 
16
20
  joyful(); // "amber-fox"
17
21
  joyful({ segments: 3 }); // "golden-marble-cathedral"
18
- joyful({ segments: 3, separator: "_" }); // "swift_northern_lights"
22
+ joyful({ separator: "_" }); // "swift_otter"
23
+ ```
24
+
25
+ You can also use the CLI:
26
+
27
+ ```bash
28
+ joyful
29
+ joyful --segments 3
30
+ joyful --pattern color,nature,animal
31
+ ```
32
+
33
+ ## Generate Names
34
+
35
+ By default, `joyful()` returns two lowercase words joined with `-`. The first word is a friendly prefix, either an adjective or a color. Later words come from the broader word lists.
36
+
37
+ ```ts
38
+ import { joyful } from "joyful";
39
+
40
+ joyful(); // "bright-dolphin"
41
+ joyful({ segments: 4 }); // "kind-river-cello-baker"
42
+ joyful({ separator: "_" }); // "golden_panda"
19
43
  joyful({ maxLength: 8 }); // "tan-elk"
20
44
  ```
21
45
 
46
+ `maxLength` filters word choices so the final string fits within the requested limit. If the limit is too short to produce a valid name, `joyful()` throws.
47
+
48
+ ## Pattern-Based Names
49
+
50
+ Use `pattern` when you want each word to come from a specific category.
51
+
52
+ ```ts
53
+ joyful({ pattern: ["adjective", "animal"] }); // "happy-dolphin"
54
+ joyful({ pattern: ["color", "nature", "animal"] }); // "amber-river-otter"
55
+ joyful({ pattern: ["city", "nature", "space"] }); // "kyoto-river-orbit"
56
+ ```
57
+
58
+ Pattern rules:
59
+
60
+ - Category names are singular, such as `animal`, `color`, `city`, and `nature`.
61
+ - The pattern length controls the number of words.
62
+ - `pattern` takes precedence over `segments`.
63
+ - `separator` and `maxLength` still apply to generated names.
64
+ - Unknown categories throw an error with the supported category names.
65
+
66
+ ## CLI
67
+
68
+ The CLI supports the same core generation options:
69
+
70
+ ```bash
71
+ joyful
72
+ joyful --segments 3
73
+ joyful --separator _
74
+ joyful --max-length 12
75
+ joyful --pattern adjective,animal
76
+ joyful --pattern city,nature,space --separator _
77
+ ```
78
+
79
+ Short flags are available for common generation options:
80
+
81
+ ```bash
82
+ joyful -s 3
83
+ joyful -p _
84
+ joyful -m 12
85
+ joyful -t color,nature,animal
86
+ ```
87
+
88
+ ## Count Permutations
89
+
90
+ Use `permutations()` to count possible unbounded combinations without generating a name.
91
+
92
+ ```ts
93
+ import { permutations } from "joyful";
94
+
95
+ permutations(); // 997425
96
+ permutations({ segments: 3 }); // 2917468125
97
+ permutations({ pattern: ["adjective", "animal"] }); // 46081
98
+ permutations({ pattern: ["color", "nature", "animal"] }); // 4674684
99
+ ```
100
+
101
+ The CLI can print the same counts:
102
+
103
+ ```bash
104
+ joyful --permutations
105
+ joyful --permutations --segments 3
106
+ joyful --permutations --pattern color,nature,animal
107
+ ```
108
+
109
+ For automation, add `--json`:
110
+
111
+ ```bash
112
+ joyful --permutations --pattern color,nature,animal --json
113
+ ```
114
+
115
+ ```json
116
+ {
117
+ "pattern": ["color", "nature", "animal"],
118
+ "permutations": 4674684
119
+ }
120
+ ```
121
+
122
+ Permutation counts do not account for `maxLength`, because bounded generation depends on word lengths and fitting constraints.
123
+
22
124
  ## API
23
125
 
24
126
  ### `joyful(options?)`
25
127
 
26
- | Option | Type | Default | Description |
27
- | ----------- | -------- | ------- | ------------------------------------- |
28
- | `segments` | `number` | `2` | Number of words to generate |
29
- | `separator` | `string` | `"-"` | Character(s) between words |
30
- | `maxLength` | `number` | — | Maximum length of the returned string |
128
+ Returns a generated name as a `string`.
31
129
 
32
- Returns a `string` of random words joined by the separator.
130
+ | Option | Type | Default | Description |
131
+ | ----------- | ------------------ | ------- | ------------------------------------- |
132
+ | `segments` | `number` | `2` | Number of words to generate |
133
+ | `pattern` | `JoyfulCategory[]` | none | Category pattern for each word |
134
+ | `separator` | `string` | `"-"` | Character(s) between words |
135
+ | `maxLength` | `number` | none | Maximum length of the returned string |
33
136
 
34
- When `maxLength` is set, words are filtered to fit within the constraint. Throws if the limit is too short to produce a valid result.
137
+ ### `permutations(options?)`
35
138
 
36
- ## SFW Guarantee
139
+ Returns the number of possible unbounded combinations as a `number`.
37
140
 
38
- All word lists are manually curated to be safe for work and family-friendly. Every category has been audited to exclude profanity, slurs, and negative or distressing terms. You can use joyful-generated names in any context without worry.
141
+ | Option | Type | Default | Description |
142
+ | ---------- | ------------------ | ------- | ------------------------------ |
143
+ | `segments` | `number` | `2` | Number of words to count |
144
+ | `pattern` | `JoyfulCategory[]` | none | Category pattern for each word |
145
+
146
+ ### `JoyfulCategory`
147
+
148
+ Supported pattern categories:
149
+
150
+ ```ts
151
+ type JoyfulCategory =
152
+ | "adjective"
153
+ | "animal"
154
+ | "architecture"
155
+ | "art"
156
+ | "city"
157
+ | "color"
158
+ | "emotion"
159
+ | "fashion"
160
+ | "food"
161
+ | "history"
162
+ | "literature"
163
+ | "music"
164
+ | "mythology"
165
+ | "nature"
166
+ | "profession"
167
+ | "science"
168
+ | "space"
169
+ | "sport"
170
+ | "transportation";
171
+ ```
39
172
 
40
- ## Word Categories
173
+ ## Word Lists
41
174
 
42
- The first word is always a prefix (adjective or color). Subsequent words are drawn from:
175
+ All words are lowercase, single-token, safe-for-work terms.
43
176
 
44
177
  | Category | Words |
45
178
  | -------------- | ----- |
@@ -47,6 +180,7 @@ The first word is always a prefix (adjective or color). Subsequent words are dra
47
180
  | Animals | 203 |
48
181
  | Architecture | 184 |
49
182
  | Art | 186 |
183
+ | Cities | 73 |
50
184
  | Colors | 114 |
51
185
  | Emotions | 89 |
52
186
  | Fashion | 169 |
@@ -62,17 +196,40 @@ The first word is always a prefix (adjective or color). Subsequent words are dra
62
196
  | Sports | 154 |
63
197
  | Transportation | 183 |
64
198
 
65
- ## Permutations
199
+ ## Default Permutations
200
+
201
+ Default generation starts with an adjective or color, then draws each later word from the non-prefix lists.
66
202
 
67
203
  | Segments | Combinations |
68
204
  | -------- | ---------------------- |
69
- | 2 | 673,282 |
70
- | 3 | 1,996,954,412 |
71
- | 4 | 5,922,966,785,992 |
72
- | 5 | 17,567,519,487,252,272 |
205
+ | 2 | 997,425 |
206
+ | 3 | 2,917,468,125 |
207
+ | 4 | 8,533,594,265,625 |
208
+ | 5 | 24,960,763,226,953,124 |
209
+
210
+ ## Errors And Constraints
211
+
212
+ - `segments` must be at least `2`.
213
+ - `separator` cannot be an empty string.
214
+ - `maxLength` must be a positive integer when provided.
215
+ - Unknown pattern categories throw an error.
216
+ - CLI `--json` is only supported with `--permutations`.
217
+ - CLI `--permutations` does not support `--max-length`.
218
+
219
+ ## SFW Guarantee
220
+
221
+ All word lists are manually curated to be safe for work and family-friendly. Every category has been audited to exclude profanity, slurs, and negative or distressing terms. You can use joyful-generated names in any context without worry.
222
+
223
+ ## Benchmarks
224
+
225
+ Run `bun run perf` to generate the runtime, startup, package size, and consumer
226
+ bundle size report. See [BENCHMARKS.md](./BENCHMARKS.md) for what the report
227
+ measures and how to interpret it.
73
228
 
74
229
  ## Credits
75
230
 
231
+ Originally created by [Hayden Bleasel](https://github.com/haydenbleasel).
232
+
76
233
  Based on [friendly-words](https://github.com/glitchdotcom/friendly-words) by Glitch, with curated word lists and additional categories.
77
234
 
78
235
  ## License
@@ -0,0 +1 @@
1
+ var d=["accommodating","admirable","adored","adventurous","affable","affectionate","agreeable","alluring","amiable","amicable","amusing","appreciable","appreciated","appreciative","attentive","authentic","balanced","beautiful","benevolent","blessed","blissful","bounteous","bountiful","bright","brilliant","bubbly","calm","caring","charitable","charming","cheerful","cheery","cherished","comforting","committed","compassionate","complimentary","confident","considerate","content","contented","cordial","courageous","creative","credible","dedicated","delighted","delightful","dependable","determined","devoted","diligent","dreamy","eager","earnest","easygoing","ebullient","elated","empowering","encouraging","endearing","energetic","engaging","enthusiastic","exciting","exquisite","extraordinary","exuberant","fabulous","faithful","fervent","festive","forgiving","friendly","funny","generous","gentle","genuine","giggling","giving","gleeful","glowing","good","graceful","gracious","grateful","gratified","gratifying","happy","harmonious","heartening","heartfelt","heartwarming","helpful","honest","honorable","hopeful","hospitable","humorous","illuminating","imaginative","impartial","inclusive","innocent","innovative","inspiring","invigorating","inviting","jolly","jovial","joyful","joyfully","joyous","jubilant","keen","kind","kindhearted","kindly","laughing","liberating","lighthearted","likeable","liked","lively","lovable","lovely","loving","loyal","lucid","luminous","magnanimous","mellow","merry","mindful","mirthful","modest","nice","noble","nourishing","nurturing","obliging","open","openhearted","openminded","optimistic","outgoing","passionate","patient","peaceful","personable","playful","pleasant","pleasing","polite","positive","productive","prosperous","radiant","reassuring","refreshing","rejoicing","relaxed","reliable","resilient","respectable","respectful","responsive","revered","reverent","satisfied","secure","sensational","sensitive","serene","sincere","smiling","sociable","soft","sparkling","spirited","stable","sunny","supportive","sweet","sympathetic","tactful","tenacious","thankful","thoughtful","tolerant","tranquil","true","trusting","trustworthy","truthful","understanding","unique","unselfish","untroubled","upbeat","uplifting","valuable","valued","versatile","vibrant","vigorous","virtuous","vital","vivacious","warm","warmhearted","welcoming","wholehearted","wholesome","willing","winsome","wise","witty","wonderful","xenial","yearning","youthful","yummy","zealous","zestful","zesty","zippy"];var g=["aardvark","albatross","ant","antelope","ape","armadillo","badger","bat","bear","bison","bumblebee","butterfly","camel","capybara","caribou","cassowary","cat","caterpillar","cheetah","chicken","chimpanzee","chinchilla","chipmunk","cougar","cow","coyote","crab","cricket","crow","deer","dingo","dog","dolphin","donkey","dove","duck","eagle","echidna","elephant","falcon","ferret","finch","fish","flamingo","fly","fox","frog","gazelle","gerbil","giraffe","goat","goldfish","goose","gorilla","grasshopper","hamster","hare","hedgehog","heron","hippopotamus","horse","hummingbird","hyena","iguana","impala","jackal","jaguar","jellyfish","kangaroo","kitten","koala","kudu","ladybug","leopard","lion","llama","lobster","locust","lynx","magpie","marten","meerkat","mink","mockingbird","mole","mongoose","monkey","moose","mouse","mynah","narwhal","newt","nuthatch","ocelot","octopus","opossum","orangutan","osprey","ostrich","otter","owl","ox","oyster","panda","pangolin","panther","parakeet","parrot","peacock","pelican","penguin","pheasant","pig","pigeon","pika","platypus","plover","polecat","porcupine","puffin","quail","quokka","rabbit","raccoon","ragdoll","ram","rat","raven","reindeer","rhea","rhinoceros","roo","rooster","saiga","salamander","sambar","sandpiper","sardine","scorpion","seahorse","seal","serval","sheep","shelduck","shrew","shrimp","siskin","skunk","sloth","snail","snapper","sora","sparrow","spoonbill","squirrel","starling","stingray","stork","swan","tadpole","tamarin","tanager","tapir","tarpon","tarsier","tetra","thrush","tiger","toad","toucan","toucanet","towhee","trogon","turaco","turtle","uakari","umbrellabird","urchin","vaquita","vicuna","vireo","vole","vulture","wagtail","wallaby","wallaroo","walrus","warthog","waxwing","whale","whippet","wilddog","wildebeest","wolf","wolverine","wombat","woodpecker","wrasse","xerus","yaffle","yak","zebra","zebu"];var h=["abacus","acroterion","aedicule","aisle","alcove","ambulatory","annex","antechamber","apse","arcade","arch","architrave","archivolt","archway","astragal","atrium","attic","balcony","baldachin","baluster","balustrade","bargeboard","baseboard","basilica","bay","bead","beam","belfry","belvedere","billet","blueprint","bracket","breezeway","brise","buttress","campanile","canopy","cantilever","capital","cartouche","caryatid","casement","casing","castellated","chamfer","chevron","chimney","cladding","clerestory","cloister","colonnade","column","console","coping","corbel","cornice","courtyard","crenellation","cresting","crown","cupola","curtain","cyma","dado","dais","dentil","dome","domed","doric","dormer","dripstone","eaves","echinus","elevation","ell","engaged","entablature","entresol","entryway","facade","fanlight","fascia","fenestration","finial","fluting","foundation","foyer","fresco","frieze","gable","gallery","gargoyle","grille","hall","hammerbeam","hearth","hip","hyphen","impost","inglenook","interior","ionic","jamb","joist","keystone","lancet","lantern","lintel","lobby","loggia","louver","lunette","mansard","metope","mezzanine","minaret","modillion","molding","mullion","muntins","narthex","nave","newel","niche","obelisk","oculus","ogee","oriel","parapet","pavilion","pedestal","pediment","pendentive","pilaster","pillar","pinnacle","plinth","porte","portico","quatrefoil","quoin","rafter","raking","reredos","reveal","ridge","riser","roof","rosette","rotunda","roundel","sash","sconce","sill","skylight","soffit","spandrel","spire","stanchion","steeple","stoa","stucco","stylobate","terrace","tracery","transept","transom","tread","trellis","triforium","triglyph","truss","turret","tympanum","undercroft","vault","veranda","vestibule","volute","voussoir","wainscot","wall","window","ziggurat"];var y=["abstract","acanthus","acrylic","adornment","aesthetic","airbrush","amphora","animation","antiquity","applique","aquarelle","arabesque","armature","artifact","artisan","artistry","artwork","assemblage","atelier","balance","baroque","batik","biennale","blending","bricolage","brushstroke","bust","calligraphy","cameo","canvas","carving","casting","ceramics","charcoal","chasing","chiaroscuro","chisel","chromatic","classical","cloisonne","collage","composition","connoisseur","contour","contrast","craftsmanship","crayon","creativity","critique","cubism","curator","dada","decorative","decoupage","design","diorama","diptych","drapery","drawing","easel","embellishment","embossing","enamel","encaustic","engraving","ensemble","etching","expressionism","fauvism","filigree","fine","finesse","firing","folio","foreshortening","form","gauche","gesso","gilding","glyptic","gouache","graffiti","harmony","hatching","hue","iconography","illustration","impasto","impressionism","ink","installation","intaglio","interpretation","kiln","kilnwork","kinetic","lacquer","landscape","linocut","lithography","luminism","lyrical","mannequin","marbling","masterpiece","medallion","medium","memento","miniature","miniaturist","mobile","modernism","mosaic","mural","museum","naturalism","neoclassicism","neon","nuance","oil","origami","ornament","painting","palette","pastel","patina","pencil","pentimento","perspective","photography","pictorial","pigment","plaster","pointillism","polychrome","portfolio","portrait","print","proportion","provenance","relief","renaissance","rendering","replica","representation","restoration","retrospective","rococo","romanticism","salon","sanguine","saturation","sculpture","sepia","serif","sfumato","sgraffito","shade","shadow","silhouette","simulacrum","sketch","stencil","stippling","stoneware","studio","study","surrealism","symmetry","tableau","technique","tempera","tessellation","texture","tint","triptych","typography","underpainting","varnish","vernissage","virtuoso","visionary","visual","watercolor","weaving","woodcut"];var b=["amsterdam","athens","atlanta","auckland","austin","barcelona","basel","bergen","berlin","bilbao","bogota","boston","bristol","brussels","budapest","cairo","calgary","canberra","cardiff","chicago","copenhagen","dakar","denver","dublin","edinburgh","florence","geneva","glasgow","helsinki","hobart","honolulu","istanbul","jakarta","kyoto","leipzig","lisbon","london","lucerne","madrid","malaga","melbourne","memphis","milan","montreal","munich","nairobi","naples","osaka","oslo","ottawa","palermo","porto","prague","quito","reykjavik","rotterdam","sapporo","savannah","seattle","seoul","stockholm","sydney","taipei","tallinn","tbilisi","toronto","toulouse","tunis","valencia","vienna","warsaw","zagreb","zurich"];var f=["alabaster","amber","aqua","auburn","azure","beige","bisque","black","blonde","blue","blush","bone","bordeaux","brick","brown","buff","burgundy","cadet","canary","cappuccino","cardinal","carmine","carnelian","celadon","cerulean","champagne","chartreuse","claret","cobalt","cognac","copper","cornflower","crimson","cyan","daffodil","ebony","ecru","eggshell","electric","espresso","fawn","flax","fuchsia","glaucous","gold","goldenrod","graphite","gray","green","gunmetal","heliotrope","hunter","indigo","ivory","jade","jasper","khaki","lapis","lava","magenta","mahogany","maize","malachite","mandarin","maroon","mauve","midnight","mocha","mulberry","navy","obsidian","ochre","onyx","paprika","pearl","periwinkle","pewter","pink","platinum","powder","puce","purple","red","rosewood","ruby","russet","rust","sable","saffron","sangria","scarlet","seafoam","sienna","silver","slate","smoke","snow","steel","tan","taupe","tawny","teal","terracotta","titanium","turquoise","ultramarine","umber","verdigris","vermilion","viridian","white","yellow","zinc","zircon"];var v=["acceptance","admiration","adoration","affection","amazement","amusement","anticipation","astonishment","awe","bashfulness","belonging","bewilderment","bliss","caution","cheerfulness","compassion","concern","confidence","confusion","contentment","courage","curiosity","delight","determination","distraction","eagerness","elation","empathy","enchantment","enjoyment","enlightenment","enthusiasm","euphoria","excitement","exhilaration","expectation","fascination","fondness","fulfillment","gladness","glee","gratification","gratitude","happiness","heartache","hesitation","homesickness","hope","infatuation","inspiration","interest","intoxication","joy","jubilation","kindness","longing","love","nervousness","optimism","overwhelm","patience","peace","pensiveness","perplexity","positivity","pride","puzzlement","rapture","reassurance","relaxation","reverence","satisfaction","security","serenity","shyness","solidarity","surprise","sympathy","tenderness","thankfulness","thrill","tranquility","triumph","valor","vigilance","warmth","wonder","zeal","zest"];var w=["accessory","apparel","asymmetrical","attire","ballet","bandana","beaded","belt","bespoke","blazer","blouse","bodysuit","boho","bolero","boots","boutique","bracelet","brocade","brooch","button","cape","capri","cardigan","cashmere","casual","chic","chiffon","classic","cloche","clutch","cocktail","collar","collection","corduroy","cotton","couture","cravat","cuff","culottes","dapper","denim","drape","dress","earrings","edgy","elegant","embroidery","empire","epaulette","eyelet","fabric","fashion","faux","fedora","fitted","flair","flannel","flapper","floral","formal","fringe","fur","garment","garter","glamorous","gloves","gown","halter","handbag","haute","headband","heel","hemline","iridescent","jacket","jewelry","jumpsuit","kaftan","kimono","knit","lace","lapel","leather","linen","loafers","luxurious","material","merino","moccasin","modern","mule","necklace","outfit","oxford","palazzo","pants","pashmina","patent","pattern","pearls","peplum","plaid","platform","pleat","pleated","pocket","poncho","preppy","puff","pumps","purse","quilted","retro","robe","ruched","ruffle","sandals","sartorial","satin","scarf","seamstress","sequin","shawl","sheath","shift","shirt","shoes","shorts","silk","skirt","sleek","sleeve","slippers","sneakers","socks","sophisticated","stiletto","stole","strappy","striped","stylish","suede","suit","sundress","sunglasses","sweater","taffeta","textile","tiara","tie","tote","trend","trim","trousers","tulle","tunic","turtleneck","tweed","uniform","velvet","vest","vintage","vogue","wardrobe","watch","wedge","wool","woven","wrap"];var k=["almond","apple","apricot","artichoke","asparagus","avocado","bacon","bagel","barley","basil","bean","beef","beet","berry","biscuit","blueberry","bread","broccoli","brusselsprout","bun","butter","cabbage","cake","candy","cantaloupe","caramel","carrot","cashew","cauliflower","caviar","celery","cheese","chickpea","chili","chocolate","chutney","cider","cinnamon","citrus","clam","cocoa","coconut","coffee","cookie","corn","cranberry","cupcake","currant","curry","date","dill","doughnut","egg","eggplant","endive","fennel","fig","flour","garlic","gelatin","ginger","grape","grapefruit","gravy","greenbean","guava","halibut","ham","hamburger","hazelnut","honey","honeydew","horseradish","iceberg","jalapeno","jam","jelly","kale","ketchup","kiwi","lamb","leek","lemon","lentil","lettuce","lime","lychee","macadamia","macaroni","mango","maple","margarine","mayonnaise","milk","mint","molasses","muffin","mushroom","mustard","nectarine","noodle","nutmeg","oat","olive","onion","orange","oregano","pancake","papaya","parsley","parsnip","pasta","peach","peanut","pear","pecan","pepper","persimmon","pickle","pie","pineapple","pistachio","plum","pomegranate","popcorn","pork","potato","pretzel","prune","pudding","pumpkin","quince","radicchio","radish","raisin","raspberry","ravioli","relish","rhubarb","rice","rosemary","rye","sage","salad","salami","salmon","salsa","salt","sandwich","scallop","seaweed","slaw","sorbet","soy","spaghetti","spinach","squash","steak","strawberry","sundae","sushi","taco","tangerine","tart","tea","thyme","toast","tomato","trout","tuna","turkey","turnip","vanilla","veal","venison","vinegar","waffle","walnut","watercress","watermelon","wheat","whipped","wine","yam","yogurt","zucchini"];var x=["academia","accomplishment","achievement","advancement","ancestor","ancient","anthropology","antiquarian","antique","archaeology","archive","aristocracy","bronze","bygone","calendar","cartography","castle","cathedral","century","ceremony","chronicle","chronographer","citadel","civilization","coins","commemoration","compilation","conquest","conservation","coronation","culture","cuneiform","customs","decade","decree","deeds","diplomacy","discovery","document","dynasty","edict","encyclopedia","eon","epoch","era","events","excavation","exhibit","expedition","exploration","feudal","fossil","founder","genealogy","generation","golden","governance","heraldry","heritage","hieratic","hieroglyphs","history","imperial","inscription","institute","invention","journal","kingdom","knowledge","landmark","legacy","lineage","lore","medieval","memorabilia","memorial","memories","methodology","migration","millennium","monarchy","monastery","monument","mummy","mythology","nation","nobility","nostalgia","origin","palace","paleography","paleontology","papyrus","parchment","past","patriarch","periodization","pharaoh","pilgrimage","prehistoric","preservation","primary","progeny","progress","pyramid","realm","reconstruction","record","reign","relic","remembrance","repository","research","revolution","royal","ruins","scholar","scroll","secondary","settlement","society","stone","storytelling","tapestry","temple","throne","timeline","tradition","treaty","university","vellum"];var j=["allegory","alliteration","allusion","almanac","analogy","anecdote","annotation","antagonist","anthology","antihero","aphorism","appendix","archetype","assonance","autobiography","ballad","bibliography","bildungsroman","biography","blurb","bookmark","canon","canto","caricature","catharsis","chapter","characterization","chronology","cliche","codex","comedy","commentary","conflict","connotation","consonance","couplet","dedication","denouement","deus","dialect","dialogue","diary","diction","didactic","drama","dramatis","dystopia","editorial","elegy","ellipsis","enigma","enjambment","epilogue","epiphany","epistolary","epitaph","epithet","essay","euphemism","excerpt","exposition","fable","fairytale","fantasy","farce","fiction","figurative","flashback","flashforward","foil","folklore","footnote","foreshadowing","foreword","frame","genre","glossary","haiku","hardcover","heroine","hubris","hyperbole","idiom","imagery","index","intertextuality","introduction","invective","irony","jargon","juxtaposition","legend","leitmotif","libretto","limerick","literary","literature","litotes","lyric","manuscript","memoir","metaphor","meter","metonymy","monograph","monologue","mood","motif","mystery","narration","narrative","narrator","nonfiction","novella","ode","omniscient","onomatopoeia","opus","oxymoron","parable","paradox","paragraph","parody","passage","pastiche","pastoral","pathetic","pentameter","persona","personification","plot","poem","poetics","poetry","point","postscript","preface","premise","prologue","propaganda","prose","protagonist","pseudonym","publisher","quatrain","quest","quotation","reader","realism","refrain","resolution","rhetoric","rhyme","rhythm","romance","saga","sarcasm","satire","scene","scribe","sequel","serial","setting","simile","soliloquy","sonnet","stanza","storyline","stream","structure","style","subplot","subtext","summary","suspense","symbol","symbolism","synopsis","syntax","tale","tanka","text","theme","thesis","thriller","title","tome","tone","tragedy","trope","understatement","utopia","verse","vignette","villain","voice","wordplay"];var z=["accordion","acoustic","adagio","allegro","alto","amplifier","andante","anthem","aria","arpeggio","arrangement","band","banjo","baritone","bass","bassoon","baton","beat","bell","blues","bongo","brass","cadence","cantata","capriccio","cello","chimes","chorale","chord","chorus","clarinet","clef","coda","composer","concert","concerto","conductor","counterpoint","crescendo","cymbal","decrescendo","ditty","drum","duet","dynamics","etude","euphonium","falsetto","fanfare","fermata","fiddler","flute","folk","forte","fortissimo","fretboard","fugue","glissando","glockenspiel","gospel","groove","guitar","harmonica","harmonics","harp","harpsichord","horn","hymn","improvisation","instrument","interlude","interval","jazz","jingle","key","keyboard","legato","lullaby","lute","madrigal","maestro","major","mandolin","march","measure","melody","metronome","microphone","minuet","musical","musicianship","nocturne","oboe","octave","opera","oratorio","orchestra","orchestration","organ","ostinato","overture","panpipes","percussion","piano","piccolo","pitch","pizzicato","polka","prelude","quartet","quintet","recital","recorder","requiem","rhapsody","riff","rondo","samba","scale","score","serenade","sharp","singer","solfege","solo","sonata","song","sonorous","soprano","staccato","staff","strings","suite","symphony","syncopation","tambourine","tango","tempo","tenor","timbre","tonality","treble","triad","trill","trio","trombone","trumpet","tune","tuner","ukulele","unison","variation","vibrato","viola","violin","vivace","vocalise","waltz","woodwind","xylophone","yodel","zither"];var q=["achilles","aeolus","aesculapius","aether","agamemnon","ajax","amalthea","ambrosia","amphitrite","andromeda","antaeus","antigone","apollo","aquilo","ares","argo","argus","ariadne","artemis","asclepius","athena","atlas","atropos","aurora","bacchus","bellerophon","bellona","boreas","briseis","cadmus","calliope","calypso","cassandra","cassiopeia","castor","centaurs","cerberus","ceres","chaos","charon","charybdis","chimera","clio","clotho","cupid","cybele","cynthia","daedalus","daphne","diana","dido","diomedes","dionysus","dryads","egeria","electra","elysium","endymion","eos","eris","europa","eurydice","euterpe","fates","faunus","flora","fortuna","gaea","galatea","ganymede","gorgons","graces","griffin","hector","helios","hephaestus","hera","hercules","hermes","hero","hestia","hydra","hyperion","icarus","io","iris","janus","jason","juno","jupiter","lachesis","leda","leto","liber","maenads","mars","medea","medusa","melampus","memnon","mercury","midas","minerva","minos","minotaur","moirae","momus","morpheus","muses","nemesis","neptune","nereus","nike","nymphs","odysseus","olympus","orion","orpheus","pallas","pan","pandora","paris","pegasus","penelope","persephone","perseus","phaedra","phaeton","phoebe","phoenix","pluto","pollux","polyphemus","poseidon","priam","prometheus","proserpina","proteus","psyche","pygmalion","python","romulus","saturn","scylla","selene","sibyl","silenus","sol","sphinx","styx","tartarus","terpsichore","theseus","thetis","thisbe","tiresias","titan","triton","troy","venus","vesta","vulcan","zephyr","zeus"];var C=["acacia","acorn","alder","alpine","amaryllis","amethyst","anemone","aquamarine","arboretum","aspen","autumn","avalanche","azalea","bamboo","banyan","baobab","bark","basalt","beach","beech","birch","blossom","bluff","bog","boulder","bracken","branch","breeze","briar","brook","buckeye","bud","butte","cactus","camellia","canyon","carnation","cascade","cave","cedar","chamomile","chestnut","chrysanthemum","citrine","cliff","cloud","clover","coast","conifer","coral","cove","creek","crystal","cypress","dahlia","dandelion","dawn","delta","desert","dew","driftwood","dune","earth","eclipse","ecosystem","elm","emerald","eucalyptus","everglades","evergreen","fern","firefly","fjord","flint","flower","fog","foothill","forest","galaxy","garden","geyser","ginkgo","glacier","glade","gorge","granite","grass","grotto","grove","harbor","harvest","haze","hazel","heath","heather","hemlock","hibiscus","hill","holly","honeysuckle","horizon","hyacinth","island","ivy","jasmine","jungle","juniper","kelp","lagoon","lake","lavender","leaf","lichen","lighthouse","lilac","lily","lotus","magnolia","mangrove","marigold","marsh","meadow","meteor","mimosa","mist","monsoon","moon","moonstone","moss","mountain","nest","oak","oasis","ocean","opal","orchard","orchid","palm","pampas","pebble","peony","petal","phlox","pine","planet","plateau","pond","poppy","prairie","primrose","quartz","rainbow","raindrop","rainforest","redwood","reef","rhododendron","river","rock","rose","sand","sapphire","savanna","sea","seashell","seed","sequoia","shore","sky","snapdragon","snowdrop","snowflake","spring","sprout","spruce","star","steppe","summit","sun","sunbeam","sunflower","sunrise","sunset","sycamore","taiga","thistle","tide","topaz","tree","tulip","tundra","valley","violet","volcano","waterfall","wave","willow","wind","wisteria","woodland","yucca","zinnia"];var J=["accountant","acrobat","actuary","administrator","advisor","advocate","agronomist","analyst","animator","anthropologist","appraiser","apprentice","arbitrator","archaeologist","architect","archivist","astronomer","attorney","auctioneer","auditor","author","baker","banker","barber","barista","bartender","biologist","blacksmith","blogger","bookkeeper","botanist","brewer","broadcaster","broker","builder","butcher","buyer","cabinetmaker","calligrapher","caregiver","carpenter","cartographer","cashier","caterer","chemist","chiropractor","cinematographer","clerk","cobbler","columnist","comedian","commissioner","consultant","contractor","copywriter","coroner","correspondent","counselor","courier","craftsman","critic","cryptographer","custodian","dancer","dealer","dentist","dermatologist","designer","detective","developer","dietitian","diplomat","director","dispatcher","diver","doctor","doorman","drafter","dramatist","driver","ecologist","economist","editor","educator","electrician","embalmer","engineer","engraver","entrepreneur","epidemiologist","essayist","estimator","ethnographer","evangelist","examiner","executive","explorer","exporter","fabricator","facilitator","farmer","financier","firefighter","fisherman","florist","foreman","forester","fundraiser","gamekeeper","gardener","gemologist","geneticist","geographer","geologist","glazier","goldsmith","governor","grocer","groundskeeper","guide","hairdresser","handyman","herbalist","historian","host","housekeeper","illustrator","importer","inspector","instructor","interpreter","interviewer","inventor","investigator","ironworker","jeweler","journalist","judge","laborer","landscaper","lawyer","lecturer","librarian","lifeguard","linguist","lithographer","lobbyist","locksmith","machinist","magician","magistrate","manager","manufacturer","marketer","mason","mathematician","mechanic","mediator","meteorologist","midwife","milliner","miner","minister","model","mortician","musician","nanny","navigator","negotiator","neurologist","notary","novelist","nurse","nutritionist","obstetrician","oceanographer","oncologist","operator","ophthalmologist","optician","optometrist","orator","ornithologist","orthodontist","painter","paleontologist","paralegal","paramedic","pathologist","pediatrician","perfumer","pharmacist","philosopher","photographer","physician","physicist","physiotherapist","pilot","plasterer","playwright","plumber","podiatrist","poet","politician","porter","potter","preacher","principal","printer","producer","professor","programmer","promoter","proofreader","prosecutor","prosthetist","psychiatrist","psychologist","publicist","puppeteer","rabbi","radiologist","rancher","realtor","receptionist","recruiter","registrar","reporter","researcher","retailer","roofer","sailor","salesperson","sanitarian","scientist","screenwriter","sculptor","secretary","senator","server","shepherd","sheriff","sociologist","soldier","sommelier","speechwriter","spokesperson","statistician","stockbroker","stonemason","strategist","stylist","superintendent","supervisor","supplier","surgeon","surveyor","tailor","taxidermist","teacher","technician","therapist","tiler","toxicologist","trader","translator","treasurer","tutor","typist","underwriter","upholsterer","urologist","usher","valet","vendor","veterinarian","videographer","vintner","virologist","volunteer","waiter","warden","weaver","welder","wholesaler","woodworker","writer","zoologist"];var P=["acceleration","acid","alkaline","allele","alloy","amoeba","amplitude","anatomy","antibiotic","antibody","antigen","antioxidant","aqueous","assay","atom","atomic","bacteria","barometer","base","beaker","biome","biopsy","biosynthesis","bond","botany","calibration","capillary","carbohydrate","carbon","catalyst","cathode","cell","cellular","centrifuge","chlorophyll","chromosome","circuit","coagulation","coefficient","colloid","combustion","compound","condensation","conductivity","covalent","cytoplasm","data","decay","decomposition","density","diffusion","dilution","dipole","dissection","dissolution","distillation","dna","electrode","electrolyte","electron","element","embryo","emission","endothermic","enzyme","equation","equilibrium","evaporation","evolution","exothermic","experiment","exponential","fermentation","filament","filtration","fission","flask","formula","frequency","friction","fungus","fusion","gamete","gas","gene","genome","geology","geothermal","germ","glucose","gradient","gravitational","halogen","heredity","hormone","hybrid","hydrogen","hydrolysis","hypothesis","immunity","induction","inertia","inoculation","insulation","ion","isomer","laboratory","laser","latent","lattice","lens","lipid","liquid","locus","magnet","magnetic","magnetism","mass","membrane","metabolism","metallurgy","microscope","mitochondria","mitosis","molecular","molecule","momentum","monomer","morphology","mutation","neuron","neutralization","nitrogen","nutrient","observation","optics","orbital","organic","oscillation","osmosis","oxidation","oxygen","ozone","parasite","particle","pathogen","peptide","periodic","permeability","petri","phenotype","phosphate","photosynthesis","physics","pipette","plankton","polymer","potential","precipitate","pressure","prism","prokaryote","protein","quantum","radioactive","reactant","reaction","reagent","receptor","recessive","reduction","reflection","refraction","replication","resistance","resonance","respiration","ribosome","rna","salinity","saturated","sediment","semiconductor","serum","solid","solubility","solute","solution","solvent","speciation","specimen","spectrometer","spore","stimulus","stoichiometry","substrate","suspension","symbiosis","synthesis","taxonomy","temperature","theorem","theory","thermal","thermodynamics","titration","tissue","toxin","transcription","translation","transmitter","ultraviolet","valence","vapor","variable","vector","velocity","virus","viscosity","voltage","volume","wavelength","zoology"];var E=["aperture","apogee","asterism","asteroid","astrology","astronaut","astronomy","atmosphere","axis","betelgeuse","bigbang","binary","bolide","canopus","capsule","celestial","centauri","centaurus","cepheid","cetus","chiron","cluster","comet","constellation","copernicus","corona","cosmic","cosmonaut","crater","cygnus","draco","dwarf","einstein","equinox","eridanus","exoplanet","fermi","galactic","galileo","gemini","gravity","hades","halley","heliocentric","hubble","hypernova","infrared","interstellar","isotope","jansky","kbo","kepler","kuiper","laplace","larissa","libration","lightyear","lunar","lyra","magnetar","messier","meteorite","meteoroid","milkyway","mimas","nadir","naiad","nebula","nereid","neutron","nix","nova","nucleus","oberon","occultation","oort","orbit","parsec","perigee","perihelion","perseid","phobos","photon","pioneer","plasma","polar","polaris","proton","puck","pulsar","quasar","radar","radiation","radioscope","retrograde","rocket","sagittarius","satellite","satyr","sideral","sirius","skylab","solar","solstice","space","spaceship","spectrum","starlight","starship","stellar","supernova","taurid","telescope","tethys","thule","titania","ufo","ulysses","umbra","universe","uranus","ursa","vacuum","vega","vernal","voyager","wormhole","xenon","yttrium","zenith","zodiac"];var N=["aerobics","archery","athlete","backstroke","badminton","baseball","basketball","bench","biathlon","billiards","birdie","bobsled","bocce","bogey","bowling","boxing","captain","champion","cheerleading","cleats","climbing","competition","court","crawl","croquet","curling","cycling","darts","decathlon","defense","diving","dodgeball","dribble","dugout","dunk","equestrian","fairway","fencing","field","fitness","football","freestyle","futsal","goal","goalie","goalkeeper","golf","gymnastics","halftime","handball","heptathlon","hiking","hockey","hurdles","javelin","jersey","jogging","judo","karate","kickball","kickboxing","lacrosse","league","luge","marathon","medal","medalist","medley","midfielder","netball","offense","olympics","overtime","paddleboarding","paintball","par","parkour","passing","penalty","pentathlon","pickleball","pilates","pingpong","playoff","podium","polo","qualifier","racket","racquetball","rally","rebounding","referee","relay","rink","rowing","rugby","running","sailing","scoreboard","scoring","scrimmage","serve","shot","sideline","skating","skeleton","skiing","slalom","sled","snooker","snowboarding","soccer","softball","sparring","speedskating","spike","sprint","stadium","steeplechase","striker","surfing","swimming","table","tackling","taekwondo","teammate","tennis","throwing","timeout","tournament","track","trainer","trampolining","triathlete","triathlon","trophy","tryout","tumbling","umpire","varsity","victory","volleyball","wakeboarding","walking","warmup","waterpolo","weightlifting","wicket","windsurfing","workout","wrestling","yoga","zone","zumba"];var O=["aircraft","airliner","airplane","airport","ambulance","amphibious","armored","autobus","automobile","aviation","balloon","barge","biplane","boat","boxcar","buggy","bullet","bus","cab","cable","caboose","camper","canoe","caravan","cargo","carriage","carrier","cart","catamaran","chairlift","chariot","chopper","clipper","coach","cockpit","commuter","convertible","coupe","cruiser","deckboat","delivery","diesel","dinghy","dirigible","dolly","draisine","dray","drifter","engine","express","ferry","flatbed","fleet","floatplane","flyover","freighter","fuselage","galleon","galley","glider","gondola","gunboat","gyrocopter","hangar","hatchback","hauler","hearse","helicopter","highway","hopper","houseboat","hovercraft","hydrofoil","hydroplane","icebreaker","inflatable","interstate","jet","jetliner","jetpack","jetski","jitney","junction","kayak","ketch","landau","landing","launch","lifeboat","limousine","liner","locomotive","maglev","metro","minibus","minivan","moped","monorail","mooring","motorbike","motorboat","motorcycle","motorhome","narrowboat","outboard","outrigger","paddleboat","parachute","parasail","passenger","patrol","pedalo","pickup","pier","pontoon","propeller","pullman","quadcopter","raft","railcar","railroad","railway","rickshaw","roadster","ropeway","rotorcraft","rowboat","runway","sailboat","schooner","scooter","seaplane","sedan","semitrailer","ship","shuttle","skateboard","skiff","sleigh","snowmobile","speedboat","station","steamboat","steamer","steamship","streetcar","submarine","subwaycar","tandem","tanker","taxi","taxicab","tender","terminal","tiller","toboggan","tractor","trailer","train","tram","tramcar","tramway","transport","trawler","tricycle","trolley","trolleybus","truck","tugboat","turboprop","ultralight","unicycle","van","vehicle","vessel","wagon","watercraft","wharf","wheelbarrow","windjammer","yacht","yawl","zeppelin"];var T=2,W=[...d,...f],l={adjective:d,animal:g,architecture:h,art:y,city:b,color:f,emotion:v,fashion:w,food:k,history:x,literature:j,music:z,mythology:q,nature:C,profession:J,science:P,space:E,sport:N,transportation:O},ie=Object.keys(l),ne=a=>Object.hasOwn(l,a),B=[g,h,y,b,v,w,k,x,j,z,q,C,J,P,E,N,O],M=B.flat(),se=M.length,s=a=>a[Math.floor(Math.random()*a.length)],U=a=>{if(a){for(let e of a)if(!ne(e))throw new Error(`Unknown pattern category "${e}". Expected one of: ${ie.join(", ")}`)}},I=a=>{if(a<2)throw new Error("Need at least 2 words")},le=(a,e,r,o)=>{var i;let t=(i=o==null?void 0:o.length)!=null?i:a;if(I(t),!e)throw new Error("Need a separator");if(r!==void 0&&(!Number.isInteger(r)||r<=0))throw new Error("maxLength must be a positive integer");U(o)},ce=a=>{I(a);let e=W.length;for(let r=1;r<a;r+=1)e*=se;return e},ue=a=>{I(a.length),U(a);let e=1;for(let r of a)e*=l[r].length;return e},u=(a,e)=>{let r=s(B),o=e===void 0?r:r.filter(i=>i.length<=e);if(o.length===0)return u(a,e);let t=s(o);return a.includes(t)?u(a,e):t},$=(a,e,r)=>{if(r===void 0){if(a.length>=e.length&&e.every(i=>a.includes(i)))return;let t=s(e);for(;a.includes(t);)t=s(e);return t}let o=e.filter(t=>!a.includes(t)&&t.length<=r);return o.length===0?void 0:s(o)},pe=(a,e)=>{let r=[s(W)];for(let o=1;o<a;o+=1)r.push(u(r));return r.join(e)},me=a=>{for(let e=0;e<a.length;e+=1)for(let r=e+1;r<a.length;r+=1)if(a[e]===a[r])return!0;return!1},de=(a,e)=>{let r=[];for(let o of a)r.push(s(l[o]));return r.join(e)},ge=(a,e)=>{if(!me(a))return de(a,e);let r=[];for(let o of a){let t=$(r,l[o]);if(!t)throw new Error(`Not enough unique words in pattern category "${o}"`);r.push(t)}return r.join(e)},p=(a,e,r)=>new Error(`maxLength ${a} is too short to generate ${e} segments with separator "${r}"`),he=(a,e)=>{let r=a-(e-1)*T,o=W.filter(t=>t.length<=r);return o.length===0?void 0:s(o)},ye=(a,e,r)=>{let o=e-r*T;return M.some(i=>i.length<=o)?u(a,o):void 0},be=(a,e,r,o,t)=>{let i=r;for(let n=1;n<e;n+=1){let c=ye(a,i,e-n-1);if(!c)throw p(o,e,t);a.push(c),i-=c.length}return i},fe=a=>{let e=Number.POSITIVE_INFINITY;for(let r of a)e=Math.min(e,r.length);return e},R=(a,e)=>{let r=0;for(let o=e;o<a.length;o+=1)r+=fe(a[o]);return r},ve=(a,e,r)=>{let o=r-(a-1)*e.length,t=he(o,a);if(!t)throw p(r,a,e);let i=[t];return be(i,a,o-t.length,r,e),i.join(e)},we=(a,e,r,o,t)=>{let i=r;for(let n=0;n<e.length;n+=1){let c=i-R(e,n+1),m=$(a,e[n],c);if(!m)throw p(o,e.length,t);a.push(m),i-=m.length}},ke=(a,e,r)=>{let o=a.map(n=>l[n]),t=r-(a.length-1)*e.length;if(t<R(o,0))throw p(r,a.length,e);let i=[];return we(i,o,t,r,e),i.join(e)},na=(a={})=>{let{maxLength:e,pattern:r,segments:o=2,separator:t="-"}=a;return le(o,t,e,r),r?e===void 0?ge(r,t):ke(r,t,e):e===void 0?pe(o,t):ve(o,t,e)},sa=(a={})=>{let{pattern:e,segments:r=2}=a;return e?ue(e):ce(r)};export{na as a,sa as b};