@adminide-stack/yantra-mobile 12.0.93 → 12.0.94-alpha.1

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,193 @@
1
+ import {AIRPORT_CODES}from'./parseTravelIntent.js';import {AIRPORTS_SOURCE,AIRPORT_REGIONS_SOURCE,AIRPORT_COUNTRIES_SOURCE}from'./airportIndexData.js';const CITY_ALIASES = {
2
+ bombay: "BOM",
3
+ calcutta: "CCU",
4
+ goa: "GOI",
5
+ peking: "PEK",
6
+ saigon: "SGN",
7
+ "ho chi minh": "SGN",
8
+ ny: "JFK",
9
+ nyc: "JFK",
10
+ sf: "SFO",
11
+ la: "LAX",
12
+ dc: "DCA",
13
+ "washington dc": "DCA",
14
+ vegas: "LAS"
15
+ };
16
+ const SECONDARY_AIRPORTS = /* @__PURE__ */ new Set(["EWR", "IAD", "LGA", "LGW", "MDW", "STN"]);
17
+ const COUNTRY_ALIASES = {
18
+ us: "US",
19
+ usa: "US",
20
+ america: "US",
21
+ uk: "GB",
22
+ england: "GB",
23
+ uae: "AE"
24
+ };
25
+ const FILLER = /* @__PURE__ */ new Set(["airport", "airports", "international", "intl", "the"]);
26
+ const NAME_STOPWORDS = /* @__PURE__ */ new Set(["regional", "municipal", "county", "national", "airfield", "airstrip", "field", "island", "general", "memorial", "metropolitan", "executive", "north", "south", "santa", "saint", "airbase"]);
27
+ const SIZE_BONUS = {
28
+ typing: {
29
+ L: 35,
30
+ M: 12,
31
+ S: 0
32
+ },
33
+ whole: {
34
+ L: 6,
35
+ M: 3,
36
+ S: 0
37
+ }
38
+ };
39
+ function foldPlace(text) {
40
+ return text.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, " ").trim();
41
+ }
42
+ function table(source) {
43
+ const map = /* @__PURE__ */ new Map();
44
+ for (const line of source.split("\n")) {
45
+ const cut = line.indexOf("|");
46
+ if (cut > 0) map.set(line.slice(0, cut), line.slice(cut + 1));
47
+ }
48
+ return map;
49
+ }
50
+ let index = null;
51
+ function airportIndex() {
52
+ var _a, _b, _c, _d, _e;
53
+ if (index) return index;
54
+ const countries = table(AIRPORT_COUNTRIES_SOURCE);
55
+ const regions = table(AIRPORT_REGIONS_SOURCE);
56
+ const entries = [];
57
+ const byCode = /* @__PURE__ */ new Map();
58
+ const rows = AIRPORTS_SOURCE.split("\n").map((line) => line.split("|")).filter(([code, city]) => (code == null ? void 0 : code.length) === 3 && Boolean(city));
59
+ for (const [code, city, name, country, region, size, alternates] of rows) {
60
+ const airport = {
61
+ code,
62
+ city,
63
+ name,
64
+ country,
65
+ countryName: (_a = countries.get(country)) != null ? _a : country,
66
+ regionName: (_b = regions.get(region)) != null ? _b : "",
67
+ size: size || "S"
68
+ };
69
+ const aliasKeys = (alternates ? alternates.split(";") : []).map(foldPlace).filter(Boolean);
70
+ const cityKey = foldPlace(city);
71
+ const nameKey = foldPlace(name);
72
+ const preferredLabel = AIRPORT_CODES[code];
73
+ const entry = {
74
+ airport,
75
+ cityKey,
76
+ nameKey,
77
+ aliasKeys,
78
+ words: new Set([cityKey, nameKey, ...aliasKeys].join(" ").split(" ").filter(Boolean)),
79
+ nameWords: new Set(nameKey.split(" ").filter((word) => word.length >= 5 && !FILLER.has(word) && !NAME_STOPWORDS.has(word) && !cityKey.split(" ").includes(word))),
80
+ placeWords: new Set([foldPlace(airport.countryName), foldPlace(airport.regionName)].join(" ").split(" ").filter(Boolean)),
81
+ countryKey: foldPlace(airport.countryName),
82
+ regionKey: foldPlace(airport.regionName),
83
+ regionCode: foldPlace((_c = region.split("-")[1]) != null ? _c : ""),
84
+ primary: Boolean(preferredLabel) && !SECONDARY_AIRPORTS.has(code),
85
+ explicitAliases: [],
86
+ preferredCityKey: preferredLabel ? foldPlace((_d = preferredLabel.split(",")[0]) != null ? _d : "") : ""
87
+ };
88
+ entries.push(entry);
89
+ byCode.set(code, entry);
90
+ }
91
+ for (const [alias, code] of Object.entries(CITY_ALIASES)) (_e = byCode.get(code)) == null ? void 0 : _e.explicitAliases.push(alias);
92
+ index = {
93
+ entries,
94
+ byCode
95
+ };
96
+ return index;
97
+ }
98
+ function airportByCode(code) {
99
+ var _a;
100
+ return (_a = airportIndex().byCode.get(code.trim().toUpperCase())) == null ? void 0 : _a.airport;
101
+ }
102
+ function airportLabel(airport) {
103
+ return `${airport.city} (${airport.code})`;
104
+ }
105
+ function airportDetail(airport) {
106
+ const where = [airport.regionName, airport.countryName].filter(Boolean).join(", ");
107
+ return [airport.name !== airport.city ? airport.name : "", where].filter(Boolean).join(" \xB7 ");
108
+ }
109
+ function toQuery(text) {
110
+ const [first, ...rest] = text.split(",");
111
+ const placeWords = foldPlace(first != null ? first : "").split(" ").filter((word) => word && !FILLER.has(word));
112
+ if (!placeWords.length) return null;
113
+ return {
114
+ place: placeWords.join(" "),
115
+ placeWords,
116
+ hints: rest.map(foldPlace).filter(Boolean)
117
+ };
118
+ }
119
+ function placeScore(entry, query, prefixes) {
120
+ const {
121
+ place,
122
+ placeWords
123
+ } = query;
124
+ if (entry.preferredCityKey === place) return 105;
125
+ if (entry.cityKey === place) return 100;
126
+ if (entry.explicitAliases.includes(place)) return 98;
127
+ if (entry.aliasKeys.includes(place)) return 95;
128
+ if (place.length === 3 && entry.airport.code === place.toUpperCase()) return 90;
129
+ if (entry.nameKey === place) return 85;
130
+ const named = (word) => entry.words.has(word) || entry.placeWords.has(word);
131
+ if (placeWords.length === 1 ? entry.nameWords.has(place) : placeWords.some((word) => entry.words.has(word)) && placeWords.every(named)) {
132
+ return 75;
133
+ }
134
+ if (!prefixes || place.length < 2) return 0;
135
+ if (entry.cityKey.startsWith(place)) return 60;
136
+ if ([...entry.explicitAliases, ...entry.aliasKeys].some((alias) => alias.startsWith(place))) return 55;
137
+ if (entry.nameKey.startsWith(place)) return 50;
138
+ const last = placeWords[placeWords.length - 1];
139
+ const lead = placeWords.slice(0, -1);
140
+ if (lead.every((word) => entry.words.has(word)) && [...entry.words].some((word) => word.startsWith(last))) {
141
+ return 40;
142
+ }
143
+ return 0;
144
+ }
145
+ function hintScore(entry, query) {
146
+ let score = 0;
147
+ for (const hint of query.hints) {
148
+ if (hint === entry.countryKey || COUNTRY_ALIASES[hint] === entry.airport.country) score += 20;
149
+ else if (hint === entry.regionKey || hint === entry.regionCode) score += 30;
150
+ }
151
+ return score;
152
+ }
153
+ function ranked(text, prefixes, floor) {
154
+ const query = toQuery(text);
155
+ if (!query) return [];
156
+ const sizeBonus = prefixes ? SIZE_BONUS.typing : SIZE_BONUS.whole;
157
+ const scored = [];
158
+ for (const entry of airportIndex().entries) {
159
+ const match = placeScore(entry, query, prefixes);
160
+ if (match >= floor) {
161
+ const cityLead = entry.cityKey.startsWith(query.place) ? 3 : 0;
162
+ const primary = entry.primary ? 8 : 0;
163
+ const score = match + hintScore(entry, query) + sizeBonus[entry.airport.size] + primary + cityLead;
164
+ scored.push({
165
+ entry,
166
+ score
167
+ });
168
+ }
169
+ }
170
+ return scored.sort((a, b) => b.score - a.score || a.entry.airport.city.localeCompare(b.entry.airport.city) || a.entry.airport.code.localeCompare(b.entry.airport.code)).map((row) => row.entry);
171
+ }
172
+ function topCityFirst(entries) {
173
+ const [top] = entries;
174
+ if (!top) return entries;
175
+ const sameCity = (entry) => entry.cityKey === top.cityKey && entry.airport.country === top.airport.country;
176
+ return [...entries.filter(sameCity), ...entries.filter((entry) => !sameCity(entry))];
177
+ }
178
+ function searchAirports(text, limit = 6) {
179
+ const trimmed = text.trim();
180
+ if (trimmed.length < 2) return [];
181
+ const picked = trimmed.match(/\(([A-Za-z]{3})\)\s*$/);
182
+ if (picked) {
183
+ const airport = airportByCode(picked[1]);
184
+ return airport ? [airport] : [];
185
+ }
186
+ return topCityFirst(ranked(trimmed, true, 40)).slice(0, limit).map((entry) => entry.airport);
187
+ }
188
+ function resolveAirport(text) {
189
+ var _a;
190
+ const picked = text.match(/\(([A-Za-z]{3})\)/);
191
+ const byCode = picked ? airportByCode(picked[1]) : void 0;
192
+ return byCode != null ? byCode : (_a = ranked(text, false, 70)[0]) == null ? void 0 : _a.airport;
193
+ }export{airportByCode,airportDetail,airportLabel,foldPlace,resolveAirport,searchAirports};//# sourceMappingURL=airportIndex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"airportIndex.js","sources":["../../../src/features/travel/airportIndex.ts"],"sourcesContent":["/**\n * Every airport with scheduled passenger service, for the flight From / To fields:\n * suggestions as the person types, and the airport a typed or picked place means.\n *\n * The flight connector takes IATA codes only. The field used to offer street-level\n * place suggestions and then look the text up in a table of ~70 cities, so \"Hyd\" and\n * \"Hyderabad, Telangana, India\" both ended in \"Could not find an airport\".\n */\nimport { AIRPORT_CODES } from './parseTravelIntent';\nimport { AIRPORTS_SOURCE, AIRPORT_COUNTRIES_SOURCE, AIRPORT_REGIONS_SOURCE } from './airportIndexData';\n\nexport interface Airport {\n /** IATA code, e.g. HYD. */\n code: string;\n city: string;\n /** Airport name without a trailing \"Airport\", e.g. \"Rajiv Gandhi International\". */\n name: string;\n /** ISO country code. */\n country: string;\n countryName: string;\n regionName: string;\n size: 'L' | 'M' | 'S';\n}\n\ninterface Entry {\n airport: Airport;\n cityKey: string;\n nameKey: string;\n aliasKeys: string[];\n /** Words of the city, name and alternate names. */\n words: Set<string>;\n /** Words of the airport's own name, not its town's (\"heathrow\", \"gatwick\", \"kennedy\"). */\n nameWords: Set<string>;\n /** Words of its state and country, so \"Hyderabad India\" needs no comma. */\n placeWords: Set<string>;\n countryKey: string;\n regionKey: string;\n /** \"GA\" of US-GA - how \"Atlanta, GA, USA\" names the state. */\n regionCode: string;\n /** In the hand-kept city table as its city's main airport. */\n primary: boolean;\n /** Names that point straight at it (CITY_ALIASES: \"Bombay\", \"NYC\"). */\n explicitAliases: string[];\n /** That table's city (\"Dallas\" for DFW, \"Delhi\" for DEL), when it has the airport. */\n preferredCityKey: string;\n}\n\n/** Older, local and short names the source does not carry, or spreads over several airports. */\nconst CITY_ALIASES: Record<string, string> = {\n bombay: 'BOM',\n calcutta: 'CCU',\n goa: 'GOI',\n peking: 'PEK',\n saigon: 'SGN',\n 'ho chi minh': 'SGN',\n ny: 'JFK',\n nyc: 'JFK',\n sf: 'SFO',\n la: 'LAX',\n dc: 'DCA',\n 'washington dc': 'DCA',\n vegas: 'LAS',\n};\n\n/** In the hand-kept table, but not their city's main airport. */\nconst SECONDARY_AIRPORTS = new Set(['EWR', 'IAD', 'LGA', 'LGW', 'MDW', 'STN']);\n\n/** How place suggestions spell a country (\"Atlanta, GA, USA\"). */\nconst COUNTRY_ALIASES: Record<string, string> = {\n us: 'US',\n usa: 'US',\n america: 'US',\n uk: 'GB',\n england: 'GB',\n uae: 'AE',\n};\n\n/** Words that say \"airport\" without naming one (\"JFK Airport\", \"Heathrow intl\"). */\nconst FILLER = new Set(['airport', 'airports', 'international', 'intl', 'the']);\n\n/**\n * Airport-name words too common to name one airport: \"new\" is not Baghdad's\n * \"New Al Muthana\", \"santa\" no single field.\n */\nconst NAME_STOPWORDS = new Set([\n 'regional',\n 'municipal',\n 'county',\n 'national',\n 'airfield',\n 'airstrip',\n 'field',\n 'island',\n 'general',\n 'memorial',\n 'metropolitan',\n 'executive',\n 'north',\n 'south',\n 'santa',\n 'saint',\n 'airbase',\n]);\n\n/**\n * A small field that IS the town typed (\"Tok\", Alaska) is still a worse guess, while\n * typing, than the hub the letters begin (\"Tokyo\"); a whole name decides on the match.\n */\nconst SIZE_BONUS = {\n typing: { L: 35, M: 12, S: 0 },\n whole: { L: 6, M: 3, S: 0 },\n} as const;\n\n/** Lower-case ASCII words: accents folded, punctuation dropped. */\nexport function foldPlace(text: string): string {\n return text\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, ' ')\n .trim();\n}\n\nfunction table(source: string): Map<string, string> {\n const map = new Map<string, string>();\n for (const line of source.split('\\n')) {\n const cut = line.indexOf('|');\n if (cut > 0) map.set(line.slice(0, cut), line.slice(cut + 1));\n }\n return map;\n}\n\nlet index: { entries: Entry[]; byCode: Map<string, Entry> } | null = null;\n\nfunction airportIndex(): { entries: Entry[]; byCode: Map<string, Entry> } {\n if (index) return index;\n const countries = table(AIRPORT_COUNTRIES_SOURCE);\n const regions = table(AIRPORT_REGIONS_SOURCE);\n const entries: Entry[] = [];\n const byCode = new Map<string, Entry>();\n const rows = AIRPORTS_SOURCE.split('\\n')\n .map((line) => line.split('|'))\n .filter(([code, city]) => code?.length === 3 && Boolean(city));\n for (const [code, city, name, country, region, size, alternates] of rows) {\n const airport: Airport = {\n code,\n city,\n name,\n country,\n countryName: countries.get(country) ?? country,\n regionName: regions.get(region) ?? '',\n size: (size as Airport['size']) || 'S',\n };\n const aliasKeys = (alternates ? alternates.split(';') : []).map(foldPlace).filter(Boolean);\n const cityKey = foldPlace(city);\n const nameKey = foldPlace(name);\n const preferredLabel = AIRPORT_CODES[code];\n const entry: Entry = {\n airport,\n cityKey,\n nameKey,\n aliasKeys,\n words: new Set([cityKey, nameKey, ...aliasKeys].join(' ').split(' ').filter(Boolean)),\n nameWords: new Set(\n nameKey\n .split(' ')\n .filter(\n (word) =>\n word.length >= 5 &&\n !FILLER.has(word) &&\n !NAME_STOPWORDS.has(word) &&\n !cityKey.split(' ').includes(word),\n ),\n ),\n placeWords: new Set(\n [foldPlace(airport.countryName), foldPlace(airport.regionName)].join(' ').split(' ').filter(Boolean),\n ),\n countryKey: foldPlace(airport.countryName),\n regionKey: foldPlace(airport.regionName),\n regionCode: foldPlace(region.split('-')[1] ?? ''),\n primary: Boolean(preferredLabel) && !SECONDARY_AIRPORTS.has(code),\n explicitAliases: [],\n preferredCityKey: preferredLabel ? foldPlace(preferredLabel.split(',')[0] ?? '') : '',\n };\n entries.push(entry);\n byCode.set(code, entry);\n }\n for (const [alias, code] of Object.entries(CITY_ALIASES)) byCode.get(code)?.explicitAliases.push(alias);\n index = { entries, byCode };\n return index;\n}\n\nexport function airportByCode(code: string): Airport | undefined {\n return airportIndex().byCode.get(code.trim().toUpperCase())?.airport;\n}\n\n/** What a picked airport reads as in its field - and resolves back from: \"Hyderabad (HYD)\". */\nexport function airportLabel(airport: Pick<Airport, 'city' | 'code'>): string {\n return `${airport.city} (${airport.code})`;\n}\n\n/** \"Rajiv Gandhi International · Telangana, India\" */\nexport function airportDetail(airport: Airport): string {\n const where = [airport.regionName, airport.countryName].filter(Boolean).join(', ');\n return [airport.name !== airport.city ? airport.name : '', where].filter(Boolean).join(' · ');\n}\n\ninterface Query {\n /** The place itself: the first comma part, minus \"airport\" words. */\n place: string;\n placeWords: string[];\n /** The rest (\"GA, USA\", \"Telangana, India\"): which state or country is meant. */\n hints: string[];\n}\n\nfunction toQuery(text: string): Query | null {\n const [first, ...rest] = text.split(',');\n const placeWords = foldPlace(first ?? '')\n .split(' ')\n .filter((word) => word && !FILLER.has(word));\n if (!placeWords.length) return null;\n return { place: placeWords.join(' '), placeWords, hints: rest.map(foldPlace).filter(Boolean) };\n}\n\n/** How well an airport matches the place typed: 0 = not at all. */\nfunction placeScore(entry: Entry, query: Query, prefixes: boolean): number {\n const { place, placeWords } = query;\n if (entry.preferredCityKey === place) return 105;\n if (entry.cityKey === place) return 100;\n if (entry.explicitAliases.includes(place)) return 98;\n if (entry.aliasKeys.includes(place)) return 95;\n if (place.length === 3 && entry.airport.code === place.toUpperCase()) return 90;\n if (entry.nameKey === place) return 85;\n // One word names a city, a code or an airport (\"Heathrow\"); \"York\" is not New York.\n const named = (word: string) => entry.words.has(word) || entry.placeWords.has(word);\n if (\n placeWords.length === 1\n ? entry.nameWords.has(place)\n : placeWords.some((word) => entry.words.has(word)) && placeWords.every(named)\n ) {\n return 75;\n }\n if (!prefixes || place.length < 2) return 0;\n if (entry.cityKey.startsWith(place)) return 60;\n if ([...entry.explicitAliases, ...entry.aliasKeys].some((alias) => alias.startsWith(place))) return 55;\n if (entry.nameKey.startsWith(place)) return 50;\n const last = placeWords[placeWords.length - 1];\n const lead = placeWords.slice(0, -1);\n if (lead.every((word) => entry.words.has(word)) && [...entry.words].some((word) => word.startsWith(last))) {\n return 40;\n }\n return 0;\n}\n\n/**\n * The state or country named after the place picks between same-named cities - and\n * outweighs a city's usual airport: \"Portland, ME\" is Portland, Maine.\n */\nfunction hintScore(entry: Entry, query: Query): number {\n let score = 0;\n for (const hint of query.hints) {\n if (hint === entry.countryKey || COUNTRY_ALIASES[hint] === entry.airport.country) score += 20;\n else if (hint === entry.regionKey || hint === entry.regionCode) score += 30;\n }\n return score;\n}\n\nfunction ranked(text: string, prefixes: boolean, floor: number): Entry[] {\n const query = toQuery(text);\n if (!query) return [];\n const sizeBonus = prefixes ? SIZE_BONUS.typing : SIZE_BONUS.whole;\n const scored: Array<{ entry: Entry; score: number }> = [];\n for (const entry of airportIndex().entries) {\n const match = placeScore(entry, query, prefixes);\n if (match >= floor) {\n // The city itself begins with it: \"was\" is Washington before Baltimore/Washington.\n const cityLead = entry.cityKey.startsWith(query.place) ? 3 : 0;\n const primary = entry.primary ? 8 : 0;\n const score = match + hintScore(entry, query) + sizeBonus[entry.airport.size] + primary + cityLead;\n scored.push({ entry, score });\n }\n }\n return scored\n .sort(\n (a, b) =>\n b.score - a.score ||\n a.entry.airport.city.localeCompare(b.entry.airport.city) ||\n a.entry.airport.code.localeCompare(b.entry.airport.code),\n )\n .map((row) => row.entry);\n}\n\n/** The best match's city keeps its other airports next to it: Paris CDG, ORY, then Paramaribo. */\nfunction topCityFirst(entries: Entry[]): Entry[] {\n const [top] = entries;\n if (!top) return entries;\n const sameCity = (entry: Entry) => entry.cityKey === top.cityKey && entry.airport.country === top.airport.country;\n return [...entries.filter(sameCity), ...entries.filter((entry) => !sameCity(entry))];\n}\n\n/** Airports for what is typed so far, best first: \"hyd\" -> HYD, HDD, ... */\nexport function searchAirports(text: string, limit = 6): Airport[] {\n const trimmed = text.trim();\n if (trimmed.length < 2) return [];\n const picked = trimmed.match(/\\(([A-Za-z]{3})\\)\\s*$/);\n if (picked) {\n const airport = airportByCode(picked[1]);\n return airport ? [airport] : [];\n }\n return topCityFirst(ranked(trimmed, true, 40))\n .slice(0, limit)\n .map((entry) => entry.airport);\n}\n\n/**\n * The airport a whole place means: \"HYD\", \"Hyd\", \"Hyderabad\", \"Hyderabad, Telangana,\n * India\", \"Portland, ME, USA\", \"JFK Airport\". Not a prefix guess - \"Hyder\" is no airport.\n */\nexport function resolveAirport(text: string): Airport | undefined {\n const picked = text.match(/\\(([A-Za-z]{3})\\)/);\n const byCode = picked ? airportByCode(picked[1]) : undefined;\n return byCode ?? ranked(text, false, 70)[0]?.airport;\n}\n"],"names":[],"mappings":"uJA8CA,MAAM,YAAuC,GAAA;AAAA,EAC3C,MAAQ,EAAA,KAAA;AAAA,EACR,QAAU,EAAA,KAAA;AAAA,EACV,GAAK,EAAA,KAAA;AAAA,EACL,MAAQ,EAAA,KAAA;AAAA,EACR,MAAQ,EAAA,KAAA;AAAA,EACR,aAAe,EAAA,KAAA;AAAA,EACf,EAAI,EAAA,KAAA;AAAA,EACJ,GAAK,EAAA,KAAA;AAAA,EACL,EAAI,EAAA,KAAA;AAAA,EACJ,EAAI,EAAA,KAAA;AAAA,EACJ,EAAI,EAAA,KAAA;AAAA,EACJ,eAAiB,EAAA,KAAA;AAAA,EACjB,KAAO,EAAA;AACT,CAAA;AAGA,MAAM,kBAAA,mBAAyB,IAAA,GAAA,CAAI,CAAC,KAAA,EAAO,OAAO,KAAO,EAAA,KAAA,EAAO,KAAO,EAAA,KAAK,CAAC,CAAA;AAG7E,MAAM,eAA0C,GAAA;AAAA,EAC9C,EAAI,EAAA,IAAA;AAAA,EACJ,GAAK,EAAA,IAAA;AAAA,EACL,OAAS,EAAA,IAAA;AAAA,EACT,EAAI,EAAA,IAAA;AAAA,EACJ,OAAS,EAAA,IAAA;AAAA,EACT,GAAK,EAAA;AACP,CAAA;AAGA,MAAM,MAAA,uBAAa,GAAI,CAAA,CAAC,WAAW,UAAY,EAAA,eAAA,EAAiB,MAAQ,EAAA,KAAK,CAAC,CAAA;AAM9E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