lingo.dev 0.116.1 → 0.116.2

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/build/cli.cjs CHANGED
@@ -4054,6 +4054,11 @@ function createXcodeXcstringsLoader(defaultLocale) {
4054
4054
  if (langTranslationEntity) {
4055
4055
  if ("stringUnit" in langTranslationEntity) {
4056
4056
  resultData[translationKey] = langTranslationEntity.stringUnit.value;
4057
+ } else if ("stringSet" in langTranslationEntity) {
4058
+ const values = langTranslationEntity.stringSet.values;
4059
+ if (Array.isArray(values) && values.length > 0) {
4060
+ resultData[translationKey] = values;
4061
+ }
4057
4062
  } else if ("variations" in langTranslationEntity) {
4058
4063
  if ("plural" in langTranslationEntity.variations) {
4059
4064
  resultData[translationKey] = {};
@@ -4098,6 +4103,21 @@ function createXcodeXcstringsLoader(defaultLocale) {
4098
4103
  if (hasDoNotTranslateFlag) {
4099
4104
  langDataToMerge.strings[key].shouldTranslate = false;
4100
4105
  }
4106
+ } else if (Array.isArray(value)) {
4107
+ langDataToMerge.strings[key] = {
4108
+ extractionState: _optionalChain([originalInput, 'optionalAccess', _182 => _182.strings, 'optionalAccess', _183 => _183[key], 'optionalAccess', _184 => _184.extractionState]),
4109
+ localizations: {
4110
+ [locale]: {
4111
+ stringSet: {
4112
+ state: "translated",
4113
+ values: value
4114
+ }
4115
+ }
4116
+ }
4117
+ };
4118
+ if (hasDoNotTranslateFlag) {
4119
+ langDataToMerge.strings[key].shouldTranslate = false;
4120
+ }
4101
4121
  } else {
4102
4122
  const updatedVariations = {};
4103
4123
  for (const form in value) {
@@ -4143,7 +4163,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
4143
4163
  for (const [locale, localization] of Object.entries(
4144
4164
  entity.localizations
4145
4165
  )) {
4146
- if (_optionalChain([localization, 'access', _182 => _182.variations, 'optionalAccess', _183 => _183.plural])) {
4166
+ if (_optionalChain([localization, 'access', _185 => _185.variations, 'optionalAccess', _186 => _186.plural])) {
4147
4167
  const pluralForms = localization.variations.plural;
4148
4168
  for (const form in pluralForms) {
4149
4169
  const pluralKey = `${translationKey}/${form}`;
@@ -4163,7 +4183,7 @@ function _removeLocale(input2, locale) {
4163
4183
  const { strings } = input2;
4164
4184
  const newStrings = _lodash2.default.cloneDeep(strings);
4165
4185
  for (const [key, value] of Object.entries(newStrings)) {
4166
- if (_optionalChain([value, 'access', _184 => _184.localizations, 'optionalAccess', _185 => _185[locale]])) {
4186
+ if (_optionalChain([value, 'access', _187 => _187.localizations, 'optionalAccess', _188 => _188[locale]])) {
4167
4187
  delete value.localizations[locale];
4168
4188
  }
4169
4189
  }
@@ -4355,14 +4375,14 @@ function pluralWithMetaToXcstrings(data) {
4355
4375
  if (element.type === "literal") {
4356
4376
  text += element.value;
4357
4377
  } else if (element.type === "pound") {
4358
- const pluralVar = Object.entries(_optionalChain([data, 'access', _186 => _186._meta, 'optionalAccess', _187 => _187.variables]) || {}).find(
4378
+ const pluralVar = Object.entries(_optionalChain([data, 'access', _189 => _189._meta, 'optionalAccess', _190 => _190.variables]) || {}).find(
4359
4379
  ([_36, meta]) => meta.role === "plural"
4360
4380
  );
4361
- text += _optionalChain([pluralVar, 'optionalAccess', _188 => _188[1], 'access', _189 => _189.format]) || "%lld";
4381
+ text += _optionalChain([pluralVar, 'optionalAccess', _191 => _191[1], 'access', _192 => _192.format]) || "%lld";
4362
4382
  } else if (element.type === "argument") {
4363
4383
  const varName = element.value;
4364
- const varMeta = _optionalChain([data, 'access', _190 => _190._meta, 'optionalAccess', _191 => _191.variables, 'optionalAccess', _192 => _192[varName]]);
4365
- text += _optionalChain([varMeta, 'optionalAccess', _193 => _193.format]) || "%@";
4384
+ const varMeta = _optionalChain([data, 'access', _193 => _193._meta, 'optionalAccess', _194 => _194.variables, 'optionalAccess', _195 => _195[varName]]);
4385
+ text += _optionalChain([varMeta, 'optionalAccess', _196 => _196.format]) || "%@";
4366
4386
  }
4367
4387
  }
4368
4388
  let xcstringsFormName = form;
@@ -4740,8 +4760,8 @@ async function formatDataWithBiome(data, filePath, options) {
4740
4760
  });
4741
4761
  return formatted.content;
4742
4762
  } catch (error) {
4743
- const errorMessage = error instanceof Error ? error.message || _optionalChain([error, 'access', _194 => _194.stackTrace, 'optionalAccess', _195 => _195.toString, 'call', _196 => _196(), 'access', _197 => _197.split, 'call', _198 => _198("\n"), 'access', _199 => _199[0]]) : "";
4744
- if (_optionalChain([errorMessage, 'optionalAccess', _200 => _200.includes, 'call', _201 => _201("does not exist in the workspace")])) {
4763
+ const errorMessage = error instanceof Error ? error.message || _optionalChain([error, 'access', _197 => _197.stackTrace, 'optionalAccess', _198 => _198.toString, 'call', _199 => _199(), 'access', _200 => _200.split, 'call', _201 => _201("\n"), 'access', _202 => _202[0]]) : "";
4764
+ if (_optionalChain([errorMessage, 'optionalAccess', _203 => _203.includes, 'call', _204 => _204("does not exist in the workspace")])) {
4745
4765
  } else {
4746
4766
  console.log(`\u26A0\uFE0F Biome skipped ${path14.default.basename(filePath)}`);
4747
4767
  if (errorMessage) {
@@ -4788,7 +4808,7 @@ function createPoDataLoader(params) {
4788
4808
  Object.entries(entries).forEach(([msgid, entry]) => {
4789
4809
  if (msgid && entry.msgid) {
4790
4810
  const context = entry.msgctxt || "";
4791
- const fullEntry = _optionalChain([parsedPo, 'access', _202 => _202.translations, 'access', _203 => _203[context], 'optionalAccess', _204 => _204[msgid]]);
4811
+ const fullEntry = _optionalChain([parsedPo, 'access', _205 => _205.translations, 'access', _206 => _206[context], 'optionalAccess', _207 => _207[msgid]]);
4792
4812
  if (fullEntry) {
4793
4813
  result[msgid] = fullEntry;
4794
4814
  }
@@ -4798,8 +4818,8 @@ function createPoDataLoader(params) {
4798
4818
  return result;
4799
4819
  },
4800
4820
  async push(locale, data, originalInput, originalLocale, pullInput) {
4801
- const currentSections = _optionalChain([pullInput, 'optionalAccess', _205 => _205.split, 'call', _206 => _206("\n\n"), 'access', _207 => _207.filter, 'call', _208 => _208(Boolean)]) || [];
4802
- const originalSections = _optionalChain([originalInput, 'optionalAccess', _209 => _209.split, 'call', _210 => _210("\n\n"), 'access', _211 => _211.filter, 'call', _212 => _212(Boolean)]) || [];
4821
+ const currentSections = _optionalChain([pullInput, 'optionalAccess', _208 => _208.split, 'call', _209 => _209("\n\n"), 'access', _210 => _210.filter, 'call', _211 => _211(Boolean)]) || [];
4822
+ const originalSections = _optionalChain([originalInput, 'optionalAccess', _212 => _212.split, 'call', _213 => _213("\n\n"), 'access', _214 => _214.filter, 'call', _215 => _215(Boolean)]) || [];
4803
4823
  const result = originalSections.map((section) => {
4804
4824
  const sectionPo = _gettextparser2.default.po.parse(section);
4805
4825
  if (Object.keys(sectionPo.translations).length === 0) {
@@ -4868,8 +4888,8 @@ function createPoContentLoader() {
4868
4888
  {
4869
4889
  ...entry,
4870
4890
  msgstr: [
4871
- _optionalChain([data, 'access', _213 => _213[entry.msgid], 'optionalAccess', _214 => _214.singular]),
4872
- _optionalChain([data, 'access', _215 => _215[entry.msgid], 'optionalAccess', _216 => _216.plural]) || null
4891
+ _optionalChain([data, 'access', _216 => _216[entry.msgid], 'optionalAccess', _217 => _217.singular]),
4892
+ _optionalChain([data, 'access', _218 => _218[entry.msgid], 'optionalAccess', _219 => _219.plural]) || null
4873
4893
  ].filter(Boolean)
4874
4894
  }
4875
4895
  ]).fromPairs().value();
@@ -4991,7 +5011,7 @@ function pullV1(xliffElement, locale, originalLocale) {
4991
5011
  let key = getTransUnitKey(unit);
4992
5012
  if (!key) return;
4993
5013
  if (seenKeys.has(key)) {
4994
- const id = _optionalChain([unit, 'access', _217 => _217.getAttribute, 'call', _218 => _218("id"), 'optionalAccess', _219 => _219.trim, 'call', _220 => _220()]);
5014
+ const id = _optionalChain([unit, 'access', _220 => _220.getAttribute, 'call', _221 => _221("id"), 'optionalAccess', _222 => _222.trim, 'call', _223 => _223()]);
4995
5015
  if (id) {
4996
5016
  key = `${key}#${id}`;
4997
5017
  } else {
@@ -5039,7 +5059,7 @@ function pushV1(dom, xliffElement, locale, translations, originalLocale, origina
5039
5059
  let key = getTransUnitKey(unit);
5040
5060
  if (!key) return;
5041
5061
  if (seenKeys.has(key)) {
5042
- const id = _optionalChain([unit, 'access', _221 => _221.getAttribute, 'call', _222 => _222("id"), 'optionalAccess', _223 => _223.trim, 'call', _224 => _224()]);
5062
+ const id = _optionalChain([unit, 'access', _224 => _224.getAttribute, 'call', _225 => _225("id"), 'optionalAccess', _226 => _226.trim, 'call', _227 => _227()]);
5043
5063
  if (id) {
5044
5064
  key = `${key}#${id}`;
5045
5065
  } else {
@@ -5081,7 +5101,7 @@ function pushV1(dom, xliffElement, locale, translations, originalLocale, origina
5081
5101
  const translationKeys = new Set(Object.keys(translations));
5082
5102
  existingUnits.forEach((unit, key) => {
5083
5103
  if (!translationKeys.has(key)) {
5084
- _optionalChain([unit, 'access', _225 => _225.parentNode, 'optionalAccess', _226 => _226.removeChild, 'call', _227 => _227(unit)]);
5104
+ _optionalChain([unit, 'access', _228 => _228.parentNode, 'optionalAccess', _229 => _229.removeChild, 'call', _230 => _230(unit)]);
5085
5105
  }
5086
5106
  });
5087
5107
  return serializeWithDeclaration(
@@ -5124,18 +5144,18 @@ function traverseUnitsV2(container, fileId, currentPath, result) {
5124
5144
  Array.from(container.children).forEach((child) => {
5125
5145
  const tagName = child.tagName;
5126
5146
  if (tagName === "unit") {
5127
- const unitId = _optionalChain([child, 'access', _228 => _228.getAttribute, 'call', _229 => _229("id"), 'optionalAccess', _230 => _230.trim, 'call', _231 => _231()]);
5147
+ const unitId = _optionalChain([child, 'access', _231 => _231.getAttribute, 'call', _232 => _232("id"), 'optionalAccess', _233 => _233.trim, 'call', _234 => _234()]);
5128
5148
  if (!unitId) return;
5129
5149
  const key = `resources/${fileId}/${currentPath}${unitId}/source`;
5130
5150
  const segment = child.querySelector("segment");
5131
- const source = _optionalChain([segment, 'optionalAccess', _232 => _232.querySelector, 'call', _233 => _233("source")]);
5151
+ const source = _optionalChain([segment, 'optionalAccess', _235 => _235.querySelector, 'call', _236 => _236("source")]);
5132
5152
  if (source) {
5133
5153
  result[key] = extractTextContent(source);
5134
5154
  } else {
5135
5155
  result[key] = unitId;
5136
5156
  }
5137
5157
  } else if (tagName === "group") {
5138
- const groupId = _optionalChain([child, 'access', _234 => _234.getAttribute, 'call', _235 => _235("id"), 'optionalAccess', _236 => _236.trim, 'call', _237 => _237()]);
5158
+ const groupId = _optionalChain([child, 'access', _237 => _237.getAttribute, 'call', _238 => _238("id"), 'optionalAccess', _239 => _239.trim, 'call', _240 => _240()]);
5139
5159
  const newPath = groupId ? `${currentPath}${groupId}/groupUnits/` : currentPath;
5140
5160
  traverseUnitsV2(child, fileId, newPath, result);
5141
5161
  }
@@ -5171,12 +5191,12 @@ function indexUnitsV2(container, fileId, currentPath, index) {
5171
5191
  Array.from(container.children).forEach((child) => {
5172
5192
  const tagName = child.tagName;
5173
5193
  if (tagName === "unit") {
5174
- const unitId = _optionalChain([child, 'access', _238 => _238.getAttribute, 'call', _239 => _239("id"), 'optionalAccess', _240 => _240.trim, 'call', _241 => _241()]);
5194
+ const unitId = _optionalChain([child, 'access', _241 => _241.getAttribute, 'call', _242 => _242("id"), 'optionalAccess', _243 => _243.trim, 'call', _244 => _244()]);
5175
5195
  if (!unitId) return;
5176
5196
  const key = `resources/${fileId}/${currentPath}${unitId}/source`;
5177
5197
  index.set(key, child);
5178
5198
  } else if (tagName === "group") {
5179
- const groupId = _optionalChain([child, 'access', _242 => _242.getAttribute, 'call', _243 => _243("id"), 'optionalAccess', _244 => _244.trim, 'call', _245 => _245()]);
5199
+ const groupId = _optionalChain([child, 'access', _245 => _245.getAttribute, 'call', _246 => _246("id"), 'optionalAccess', _247 => _247.trim, 'call', _248 => _248()]);
5180
5200
  const newPath = groupId ? `${currentPath}${groupId}/groupUnits/` : currentPath;
5181
5201
  indexUnitsV2(child, fileId, newPath, index);
5182
5202
  }
@@ -5197,9 +5217,9 @@ function updateUnitV2(unit, value) {
5197
5217
  setTextContent(source, value);
5198
5218
  }
5199
5219
  function getTransUnitKey(transUnit) {
5200
- const resname = _optionalChain([transUnit, 'access', _246 => _246.getAttribute, 'call', _247 => _247("resname"), 'optionalAccess', _248 => _248.trim, 'call', _249 => _249()]);
5220
+ const resname = _optionalChain([transUnit, 'access', _249 => _249.getAttribute, 'call', _250 => _250("resname"), 'optionalAccess', _251 => _251.trim, 'call', _252 => _252()]);
5201
5221
  if (resname) return resname;
5202
- const id = _optionalChain([transUnit, 'access', _250 => _250.getAttribute, 'call', _251 => _251("id"), 'optionalAccess', _252 => _252.trim, 'call', _253 => _253()]);
5222
+ const id = _optionalChain([transUnit, 'access', _253 => _253.getAttribute, 'call', _254 => _254("id"), 'optionalAccess', _255 => _255.trim, 'call', _256 => _256()]);
5203
5223
  if (id) return id;
5204
5224
  const sourceElement = transUnit.querySelector("source");
5205
5225
  if (sourceElement) {
@@ -5256,7 +5276,7 @@ function formatXml(xml) {
5256
5276
  if (cdataNode) {
5257
5277
  return `${indent2}${openTag}<![CDATA[${cdataNode.nodeValue}]]></${tagName}>`;
5258
5278
  }
5259
- const textContent = _optionalChain([element, 'access', _254 => _254.textContent, 'optionalAccess', _255 => _255.trim, 'call', _256 => _256()]) || "";
5279
+ const textContent = _optionalChain([element, 'access', _257 => _257.textContent, 'optionalAccess', _258 => _258.trim, 'call', _259 => _259()]) || "";
5260
5280
  const hasOnlyText = element.childNodes.length === 1 && element.childNodes[0].nodeType === 3;
5261
5281
  if (hasOnlyText && textContent) {
5262
5282
  return `${indent2}${openTag}${textContent}</${tagName}>`;
@@ -5549,7 +5569,7 @@ function createDatoClient(params) {
5549
5569
  ids: !records.length ? void 0 : records.join(",")
5550
5570
  }
5551
5571
  }).catch(
5552
- (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _257 => _257.response, 'optionalAccess', _258 => _258.body, 'optionalAccess', _259 => _259.data, 'optionalAccess', _260 => _260[0]]) || error)
5572
+ (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _260 => _260.response, 'optionalAccess', _261 => _261.body, 'optionalAccess', _262 => _262.data, 'optionalAccess', _263 => _263[0]]) || error)
5553
5573
  );
5554
5574
  },
5555
5575
  findRecordsForModel: async (modelId, records) => {
@@ -5560,10 +5580,10 @@ function createDatoClient(params) {
5560
5580
  filter: {
5561
5581
  type: modelId,
5562
5582
  only_valid: "true",
5563
- ids: !_optionalChain([records, 'optionalAccess', _261 => _261.length]) ? void 0 : records.join(",")
5583
+ ids: !_optionalChain([records, 'optionalAccess', _264 => _264.length]) ? void 0 : records.join(",")
5564
5584
  }
5565
5585
  }).catch(
5566
- (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _262 => _262.response, 'optionalAccess', _263 => _263.body, 'optionalAccess', _264 => _264.data, 'optionalAccess', _265 => _265[0]]) || error)
5586
+ (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _265 => _265.response, 'optionalAccess', _266 => _266.body, 'optionalAccess', _267 => _267.data, 'optionalAccess', _268 => _268[0]]) || error)
5567
5587
  );
5568
5588
  return result;
5569
5589
  } catch (_error) {
@@ -5579,10 +5599,10 @@ function createDatoClient(params) {
5579
5599
  updateRecord: async (id, payload) => {
5580
5600
  try {
5581
5601
  await dato.items.update(id, payload).catch(
5582
- (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _266 => _266.response, 'optionalAccess', _267 => _267.body, 'optionalAccess', _268 => _268.data, 'optionalAccess', _269 => _269[0]]) || error)
5602
+ (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _269 => _269.response, 'optionalAccess', _270 => _270.body, 'optionalAccess', _271 => _271.data, 'optionalAccess', _272 => _272[0]]) || error)
5583
5603
  );
5584
5604
  } catch (_error) {
5585
- if (_optionalChain([_error, 'optionalAccess', _270 => _270.attributes, 'optionalAccess', _271 => _271.details, 'optionalAccess', _272 => _272.message])) {
5605
+ if (_optionalChain([_error, 'optionalAccess', _273 => _273.attributes, 'optionalAccess', _274 => _274.details, 'optionalAccess', _275 => _275.message])) {
5586
5606
  throw new Error(
5587
5607
  [
5588
5608
  `${_error.attributes.details.message}`,
@@ -5604,10 +5624,10 @@ function createDatoClient(params) {
5604
5624
  enableFieldLocalization: async (args) => {
5605
5625
  try {
5606
5626
  await dato.fields.update(`${args.modelId}::${args.fieldId}`, { localized: true }).catch(
5607
- (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _273 => _273.response, 'optionalAccess', _274 => _274.body, 'optionalAccess', _275 => _275.data, 'optionalAccess', _276 => _276[0]]) || error)
5627
+ (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _276 => _276.response, 'optionalAccess', _277 => _277.body, 'optionalAccess', _278 => _278.data, 'optionalAccess', _279 => _279[0]]) || error)
5608
5628
  );
5609
5629
  } catch (_error) {
5610
- if (_optionalChain([_error, 'optionalAccess', _277 => _277.attributes, 'optionalAccess', _278 => _278.code]) === "NOT_FOUND") {
5630
+ if (_optionalChain([_error, 'optionalAccess', _280 => _280.attributes, 'optionalAccess', _281 => _281.code]) === "NOT_FOUND") {
5611
5631
  throw new Error(
5612
5632
  [
5613
5633
  `Field "${args.fieldId}" not found in model "${args.modelId}".`,
@@ -5615,7 +5635,7 @@ function createDatoClient(params) {
5615
5635
  ].join("\n\n")
5616
5636
  );
5617
5637
  }
5618
- if (_optionalChain([_error, 'optionalAccess', _279 => _279.attributes, 'optionalAccess', _280 => _280.details, 'optionalAccess', _281 => _281.message])) {
5638
+ if (_optionalChain([_error, 'optionalAccess', _282 => _282.attributes, 'optionalAccess', _283 => _283.details, 'optionalAccess', _284 => _284.message])) {
5619
5639
  throw new Error(
5620
5640
  [
5621
5641
  `${_error.attributes.details.message}`,
@@ -5693,7 +5713,7 @@ function createDatoApiLoader(config, onConfigUpdate) {
5693
5713
  const records = await dato.findRecordsForModel(modelId);
5694
5714
  const recordChoices = createRecordChoices(
5695
5715
  records,
5696
- _optionalChain([config, 'access', _282 => _282.models, 'access', _283 => _283[modelId], 'optionalAccess', _284 => _284.records]) || [],
5716
+ _optionalChain([config, 'access', _285 => _285.models, 'access', _286 => _286[modelId], 'optionalAccess', _287 => _287.records]) || [],
5697
5717
  project
5698
5718
  );
5699
5719
  const selectedRecords = await promptRecordSelection(
@@ -5712,14 +5732,14 @@ function createDatoApiLoader(config, onConfigUpdate) {
5712
5732
  },
5713
5733
  async pull(locale, input2, initCtx) {
5714
5734
  const result = {};
5715
- for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess', _285 => _285.models]) || {})) {
5716
- let records = _optionalChain([initCtx, 'optionalAccess', _286 => _286.models, 'access', _287 => _287[modelId], 'access', _288 => _288.records]) || [];
5735
+ for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess', _288 => _288.models]) || {})) {
5736
+ let records = _optionalChain([initCtx, 'optionalAccess', _289 => _289.models, 'access', _290 => _290[modelId], 'access', _291 => _291.records]) || [];
5717
5737
  const recordIds = records.map((record) => record.id);
5718
5738
  records = await dato.findRecords(recordIds);
5719
5739
  console.log(`Fetched ${records.length} records for model ${modelId}`);
5720
5740
  if (records.length > 0) {
5721
5741
  result[modelId] = {
5722
- fields: _optionalChain([initCtx, 'optionalAccess', _289 => _289.models, 'optionalAccess', _290 => _290[modelId], 'optionalAccess', _291 => _291.fields]) || [],
5742
+ fields: _optionalChain([initCtx, 'optionalAccess', _292 => _292.models, 'optionalAccess', _293 => _293[modelId], 'optionalAccess', _294 => _294.fields]) || [],
5723
5743
  records
5724
5744
  };
5725
5745
  }
@@ -5782,7 +5802,7 @@ function createRecordChoices(records, selectedIds = [], project) {
5782
5802
  return records.map((record) => ({
5783
5803
  name: `${record.id} - https://${project.internal_domain}/editor/item_types/${record.item_type.id}/items/${record.id}`,
5784
5804
  value: record.id,
5785
- checked: _optionalChain([selectedIds, 'optionalAccess', _292 => _292.includes, 'call', _293 => _293(record.id)])
5805
+ checked: _optionalChain([selectedIds, 'optionalAccess', _295 => _295.includes, 'call', _296 => _296(record.id)])
5786
5806
  }));
5787
5807
  }
5788
5808
  async function promptRecordSelection(modelName, choices) {
@@ -6101,7 +6121,7 @@ function createVttLoader() {
6101
6121
  if (!input2) {
6102
6122
  return "";
6103
6123
  }
6104
- const vtt = _optionalChain([_nodewebvtt2.default, 'access', _294 => _294.parse, 'call', _295 => _295(input2), 'optionalAccess', _296 => _296.cues]);
6124
+ const vtt = _optionalChain([_nodewebvtt2.default, 'access', _297 => _297.parse, 'call', _298 => _298(input2), 'optionalAccess', _299 => _299.cues]);
6105
6125
  if (Object.keys(vtt).length === 0) {
6106
6126
  return {};
6107
6127
  } else {
@@ -6164,7 +6184,7 @@ function variableExtractLoader(params) {
6164
6184
  for (let i = 0; i < matches.length; i++) {
6165
6185
  const match2 = matches[i];
6166
6186
  const currentValue = result[key].value;
6167
- const newValue = _optionalChain([currentValue, 'optionalAccess', _297 => _297.replace, 'call', _298 => _298(match2, `{variable:${i}}`)]);
6187
+ const newValue = _optionalChain([currentValue, 'optionalAccess', _300 => _300.replace, 'call', _301 => _301(match2, `{variable:${i}}`)]);
6168
6188
  result[key].value = newValue;
6169
6189
  result[key].variables[i] = match2;
6170
6190
  }
@@ -6177,7 +6197,7 @@ function variableExtractLoader(params) {
6177
6197
  result[key] = valueObj.value;
6178
6198
  const resultValue = result[key];
6179
6199
  if (isICUPluralObject(resultValue)) {
6180
- const originalValue = _optionalChain([originalInput, 'optionalAccess', _299 => _299[key]]);
6200
+ const originalValue = _optionalChain([originalInput, 'optionalAccess', _302 => _302[key]]);
6181
6201
  if (isICUPluralObject(originalValue) && originalValue._meta) {
6182
6202
  resultValue._meta = originalValue._meta;
6183
6203
  resultValue[Symbol.for("@lingo.dev/icu-plural-object")] = true;
@@ -6187,7 +6207,7 @@ function variableExtractLoader(params) {
6187
6207
  const variable = valueObj.variables[i];
6188
6208
  const currentValue = result[key];
6189
6209
  if (typeof currentValue === "string") {
6190
- const newValue = _optionalChain([currentValue, 'optionalAccess', _300 => _300.replace, 'call', _301 => _301(`{variable:${i}}`, variable)]);
6210
+ const newValue = _optionalChain([currentValue, 'optionalAccess', _303 => _303.replace, 'call', _304 => _304(`{variable:${i}}`, variable)]);
6191
6211
  result[key] = newValue;
6192
6212
  }
6193
6213
  }
@@ -6388,7 +6408,7 @@ function createVueJsonLoader() {
6388
6408
  return createLoader({
6389
6409
  pull: async (locale, input2, ctx) => {
6390
6410
  const parsed = parseVueFile(input2);
6391
- return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess', _302 => _302.i18n, 'optionalAccess', _303 => _303[locale]]), () => ( {}));
6411
+ return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess', _305 => _305.i18n, 'optionalAccess', _306 => _306[locale]]), () => ( {}));
6392
6412
  },
6393
6413
  push: async (locale, data, originalInput) => {
6394
6414
  const parsed = parseVueFile(_nullishCoalesce(originalInput, () => ( "")));
@@ -6573,7 +6593,7 @@ function updateStringsInObjectExpression(objectExpression, data) {
6573
6593
  objectExpression.properties.forEach((prop) => {
6574
6594
  if (!t.isObjectProperty(prop)) return;
6575
6595
  const key = getPropertyKey(prop);
6576
- const incomingVal = _optionalChain([data, 'optionalAccess', _304 => _304[key]]);
6596
+ const incomingVal = _optionalChain([data, 'optionalAccess', _307 => _307[key]]);
6577
6597
  if (incomingVal === void 0) {
6578
6598
  return;
6579
6599
  }
@@ -6609,7 +6629,7 @@ function updateStringsInArrayExpression(arrayExpression, incoming) {
6609
6629
  let modified = false;
6610
6630
  arrayExpression.elements.forEach((element, index) => {
6611
6631
  if (!element) return;
6612
- const incomingVal = _optionalChain([incoming, 'optionalAccess', _305 => _305[index]]);
6632
+ const incomingVal = _optionalChain([incoming, 'optionalAccess', _308 => _308[index]]);
6613
6633
  if (incomingVal === void 0) return;
6614
6634
  if (t.isStringLiteral(element) && typeof incomingVal === "string") {
6615
6635
  if (element.value !== incomingVal) {
@@ -7100,7 +7120,7 @@ var AST = class _AST {
7100
7120
  const ret = this.type === null ? this.#parts.slice().map((p) => typeof p === "string" ? p : p.toJSON()) : [this.type, ...this.#parts.map((p) => p.toJSON())];
7101
7121
  if (this.isStart() && !this.type)
7102
7122
  ret.unshift([]);
7103
- if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && _optionalChain([this, 'access', _306 => _306.#parent, 'optionalAccess', _307 => _307.type]) === "!")) {
7123
+ if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && _optionalChain([this, 'access', _309 => _309.#parent, 'optionalAccess', _310 => _310.type]) === "!")) {
7104
7124
  ret.push({});
7105
7125
  }
7106
7126
  return ret;
@@ -7108,7 +7128,7 @@ var AST = class _AST {
7108
7128
  isStart() {
7109
7129
  if (this.#root === this)
7110
7130
  return true;
7111
- if (!_optionalChain([this, 'access', _308 => _308.#parent, 'optionalAccess', _309 => _309.isStart, 'call', _310 => _310()]))
7131
+ if (!_optionalChain([this, 'access', _311 => _311.#parent, 'optionalAccess', _312 => _312.isStart, 'call', _313 => _313()]))
7112
7132
  return false;
7113
7133
  if (this.#parentIndex === 0)
7114
7134
  return true;
@@ -7124,12 +7144,12 @@ var AST = class _AST {
7124
7144
  isEnd() {
7125
7145
  if (this.#root === this)
7126
7146
  return true;
7127
- if (_optionalChain([this, 'access', _311 => _311.#parent, 'optionalAccess', _312 => _312.type]) === "!")
7147
+ if (_optionalChain([this, 'access', _314 => _314.#parent, 'optionalAccess', _315 => _315.type]) === "!")
7128
7148
  return true;
7129
- if (!_optionalChain([this, 'access', _313 => _313.#parent, 'optionalAccess', _314 => _314.isEnd, 'call', _315 => _315()]))
7149
+ if (!_optionalChain([this, 'access', _316 => _316.#parent, 'optionalAccess', _317 => _317.isEnd, 'call', _318 => _318()]))
7130
7150
  return false;
7131
7151
  if (!this.type)
7132
- return _optionalChain([this, 'access', _316 => _316.#parent, 'optionalAccess', _317 => _317.isEnd, 'call', _318 => _318()]);
7152
+ return _optionalChain([this, 'access', _319 => _319.#parent, 'optionalAccess', _320 => _320.isEnd, 'call', _321 => _321()]);
7133
7153
  const pl = this.#parent ? this.#parent.#parts.length : 0;
7134
7154
  return this.#parentIndex === pl - 1;
7135
7155
  }
@@ -7374,7 +7394,7 @@ var AST = class _AST {
7374
7394
  }
7375
7395
  }
7376
7396
  let end = "";
7377
- if (this.isEnd() && this.#root.#filledNegs && _optionalChain([this, 'access', _319 => _319.#parent, 'optionalAccess', _320 => _320.type]) === "!") {
7397
+ if (this.isEnd() && this.#root.#filledNegs && _optionalChain([this, 'access', _322 => _322.#parent, 'optionalAccess', _323 => _323.type]) === "!") {
7378
7398
  end = "(?:$|\\/)";
7379
7399
  }
7380
7400
  const final2 = start2 + src + end;
@@ -8464,7 +8484,7 @@ function createMdxSectionsSplit2Loader() {
8464
8484
  const content = _lodash2.default.chain(data.sections).values().join("\n\n").value();
8465
8485
  const result = {
8466
8486
  frontmatter: data.frontmatter,
8467
- codePlaceholders: _optionalChain([pullInput, 'optionalAccess', _321 => _321.codePlaceholders]) || {},
8487
+ codePlaceholders: _optionalChain([pullInput, 'optionalAccess', _324 => _324.codePlaceholders]) || {},
8468
8488
  content
8469
8489
  };
8470
8490
  return result;
@@ -9565,7 +9585,7 @@ function createBasicTranslator(model, systemPrompt, settings = {}) {
9565
9585
  ]
9566
9586
  });
9567
9587
  const result = JSON.parse(response.text);
9568
- return _optionalChain([result, 'optionalAccess', _322 => _322.data]) || {};
9588
+ return _optionalChain([result, 'optionalAccess', _325 => _325.data]) || {};
9569
9589
  }
9570
9590
  }
9571
9591
  function extractPayloadChunks(payload) {
@@ -9648,7 +9668,7 @@ function getPureModelProvider(provider) {
9648
9668
 
9649
9669
  ${_chalk2.default.hex(colors.blue)("Docs: https://lingo.dev/go/docs")}
9650
9670
  `;
9651
- switch (_optionalChain([provider, 'optionalAccess', _323 => _323.id])) {
9671
+ switch (_optionalChain([provider, 'optionalAccess', _326 => _326.id])) {
9652
9672
  case "openai": {
9653
9673
  if (!process.env.OPENAI_API_KEY) {
9654
9674
  throw new Error(
@@ -9706,7 +9726,7 @@ function getPureModelProvider(provider) {
9706
9726
  })(provider.model);
9707
9727
  }
9708
9728
  default: {
9709
- throw new Error(createUnsupportedProviderErrorMessage(_optionalChain([provider, 'optionalAccess', _324 => _324.id])));
9729
+ throw new Error(createUnsupportedProviderErrorMessage(_optionalChain([provider, 'optionalAccess', _327 => _327.id])));
9710
9730
  }
9711
9731
  }
9712
9732
  }
@@ -9992,7 +10012,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
9992
10012
  validateParams(i18nConfig, flags);
9993
10013
  ora.succeed("Localization configuration is valid");
9994
10014
  ora.start("Connecting to Lingo.dev Localization Engine...");
9995
- const isByokMode = !!_optionalChain([i18nConfig, 'optionalAccess', _325 => _325.provider]);
10015
+ const isByokMode = !!_optionalChain([i18nConfig, 'optionalAccess', _328 => _328.provider]);
9996
10016
  if (isByokMode) {
9997
10017
  authId = null;
9998
10018
  ora.succeed("Using external provider (BYOK mode)");
@@ -10006,16 +10026,16 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
10006
10026
  flags
10007
10027
  });
10008
10028
  let buckets = getBuckets(i18nConfig);
10009
- if (_optionalChain([flags, 'access', _326 => _326.bucket, 'optionalAccess', _327 => _327.length])) {
10029
+ if (_optionalChain([flags, 'access', _329 => _329.bucket, 'optionalAccess', _330 => _330.length])) {
10010
10030
  buckets = buckets.filter(
10011
10031
  (bucket) => flags.bucket.includes(bucket.type)
10012
10032
  );
10013
10033
  }
10014
10034
  ora.succeed("Buckets retrieved");
10015
- if (_optionalChain([flags, 'access', _328 => _328.file, 'optionalAccess', _329 => _329.length])) {
10035
+ if (_optionalChain([flags, 'access', _331 => _331.file, 'optionalAccess', _332 => _332.length])) {
10016
10036
  buckets = buckets.map((bucket) => {
10017
10037
  const paths = bucket.paths.filter(
10018
- (path19) => flags.file.find((file) => _optionalChain([path19, 'access', _330 => _330.pathPattern, 'optionalAccess', _331 => _331.includes, 'call', _332 => _332(file)]))
10038
+ (path19) => flags.file.find((file) => _optionalChain([path19, 'access', _333 => _333.pathPattern, 'optionalAccess', _334 => _334.includes, 'call', _335 => _335(file)]))
10019
10039
  );
10020
10040
  return { ...bucket, paths };
10021
10041
  }).filter((bucket) => bucket.paths.length > 0);
@@ -10036,7 +10056,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
10036
10056
  });
10037
10057
  }
10038
10058
  }
10039
- const targetLocales = _optionalChain([flags, 'access', _333 => _333.locale, 'optionalAccess', _334 => _334.length]) ? flags.locale : i18nConfig.locale.targets;
10059
+ const targetLocales = _optionalChain([flags, 'access', _336 => _336.locale, 'optionalAccess', _337 => _337.length]) ? flags.locale : i18nConfig.locale.targets;
10040
10060
  ora.start("Setting up localization cache...");
10041
10061
  const checkLockfileProcessor = createDeltaProcessor("");
10042
10062
  const lockfileExists = await checkLockfileProcessor.checkIfLockExists();
@@ -10324,7 +10344,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
10324
10344
  }
10325
10345
  const deltaProcessor = createDeltaProcessor(bucketPath.pathPattern);
10326
10346
  const checksums = await deltaProcessor.createChecksums(sourceData);
10327
- if (!_optionalChain([flags, 'access', _335 => _335.locale, 'optionalAccess', _336 => _336.length])) {
10347
+ if (!_optionalChain([flags, 'access', _338 => _338.locale, 'optionalAccess', _339 => _339.length])) {
10328
10348
  await deltaProcessor.saveChecksums(checksums);
10329
10349
  }
10330
10350
  }
@@ -10448,12 +10468,12 @@ function validateParams(i18nConfig, flags) {
10448
10468
  message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
10449
10469
  docUrl: "bucketNotFound"
10450
10470
  });
10451
- } else if (_optionalChain([flags, 'access', _337 => _337.locale, 'optionalAccess', _338 => _338.some, 'call', _339 => _339((locale) => !i18nConfig.locale.targets.includes(locale))])) {
10471
+ } else if (_optionalChain([flags, 'access', _340 => _340.locale, 'optionalAccess', _341 => _341.some, 'call', _342 => _342((locale) => !i18nConfig.locale.targets.includes(locale))])) {
10452
10472
  throw new ValidationError({
10453
10473
  message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
10454
10474
  docUrl: "localeTargetNotFound"
10455
10475
  });
10456
- } else if (_optionalChain([flags, 'access', _340 => _340.bucket, 'optionalAccess', _341 => _341.some, 'call', _342 => _342(
10476
+ } else if (_optionalChain([flags, 'access', _343 => _343.bucket, 'optionalAccess', _344 => _344.some, 'call', _345 => _345(
10457
10477
  (bucket) => !i18nConfig.buckets[bucket]
10458
10478
  )])) {
10459
10479
  throw new ValidationError({
@@ -10987,7 +11007,7 @@ function createLingoDotDevLocalizer(explicitApiKey) {
10987
11007
  const response = await engine.whoami();
10988
11008
  return {
10989
11009
  authenticated: !!response,
10990
- username: _optionalChain([response, 'optionalAccess', _343 => _343.email])
11010
+ username: _optionalChain([response, 'optionalAccess', _346 => _346.email])
10991
11011
  };
10992
11012
  } catch (error) {
10993
11013
  const errorMessage = error instanceof Error ? error.message : String(error);
@@ -11103,7 +11123,7 @@ function createExplicitLocalizer(provider) {
11103
11123
  }
11104
11124
  function createAiSdkLocalizer(params) {
11105
11125
  const skipAuth = params.skipAuth === true;
11106
- const apiKey = process.env[_nullishCoalesce(_optionalChain([params, 'optionalAccess', _344 => _344.apiKeyName]), () => ( ""))];
11126
+ const apiKey = process.env[_nullishCoalesce(_optionalChain([params, 'optionalAccess', _347 => _347.apiKeyName]), () => ( ""))];
11107
11127
  if (!skipAuth && !apiKey || !params.apiKeyName) {
11108
11128
  throw new Error(
11109
11129
  _dedent2.default`
@@ -11237,8 +11257,8 @@ async function setup(input2) {
11237
11257
  throw new Error(
11238
11258
  "No buckets found in i18n.json. Please add at least one bucket containing i18n content."
11239
11259
  );
11240
- } else if (_optionalChain([ctx, 'access', _345 => _345.flags, 'access', _346 => _346.bucket, 'optionalAccess', _347 => _347.some, 'call', _348 => _348(
11241
- (bucket) => !_optionalChain([ctx, 'access', _349 => _349.config, 'optionalAccess', _350 => _350.buckets, 'access', _351 => _351[bucket]])
11260
+ } else if (_optionalChain([ctx, 'access', _348 => _348.flags, 'access', _349 => _349.bucket, 'optionalAccess', _350 => _350.some, 'call', _351 => _351(
11261
+ (bucket) => !_optionalChain([ctx, 'access', _352 => _352.config, 'optionalAccess', _353 => _353.buckets, 'access', _354 => _354[bucket]])
11242
11262
  )])) {
11243
11263
  throw new Error(
11244
11264
  `One or more specified buckets do not exist in i18n.json. Please add them to the list first and try again.`
@@ -11251,7 +11271,7 @@ async function setup(input2) {
11251
11271
  title: "Selecting localization provider",
11252
11272
  task: async (ctx, task) => {
11253
11273
  ctx.localizer = createLocalizer(
11254
- _optionalChain([ctx, 'access', _352 => _352.config, 'optionalAccess', _353 => _353.provider]),
11274
+ _optionalChain([ctx, 'access', _355 => _355.config, 'optionalAccess', _356 => _356.provider]),
11255
11275
  ctx.flags.apiKey
11256
11276
  );
11257
11277
  if (!ctx.localizer) {
@@ -11264,7 +11284,7 @@ async function setup(input2) {
11264
11284
  },
11265
11285
  {
11266
11286
  title: "Checking authentication",
11267
- enabled: (ctx) => _optionalChain([ctx, 'access', _354 => _354.localizer, 'optionalAccess', _355 => _355.id]) === "Lingo.dev",
11287
+ enabled: (ctx) => _optionalChain([ctx, 'access', _357 => _357.localizer, 'optionalAccess', _358 => _358.id]) === "Lingo.dev",
11268
11288
  task: async (ctx, task) => {
11269
11289
  const authStatus = await ctx.localizer.checkAuth();
11270
11290
  if (!authStatus.authenticated) {
@@ -11277,7 +11297,7 @@ async function setup(input2) {
11277
11297
  },
11278
11298
  {
11279
11299
  title: "Validating configuration",
11280
- enabled: (ctx) => _optionalChain([ctx, 'access', _356 => _356.localizer, 'optionalAccess', _357 => _357.id]) !== "Lingo.dev",
11300
+ enabled: (ctx) => _optionalChain([ctx, 'access', _359 => _359.localizer, 'optionalAccess', _360 => _360.id]) !== "Lingo.dev",
11281
11301
  task: async (ctx, task) => {
11282
11302
  const validationStatus = await ctx.localizer.validateSettings();
11283
11303
  if (!validationStatus.valid) {
@@ -11608,7 +11628,7 @@ function createWorkerTask(args) {
11608
11628
  const processableData = _lodash2.default.chain(sourceData).entries().filter(
11609
11629
  ([key, value]) => delta.added.includes(key) || delta.updated.includes(key) || !!args.ctx.flags.force
11610
11630
  ).filter(
11611
- ([key]) => !assignedTask.onlyKeys.length || _optionalChain([assignedTask, 'access', _358 => _358.onlyKeys, 'optionalAccess', _359 => _359.some, 'call', _360 => _360(
11631
+ ([key]) => !assignedTask.onlyKeys.length || _optionalChain([assignedTask, 'access', _361 => _361.onlyKeys, 'optionalAccess', _362 => _362.some, 'call', _363 => _363(
11612
11632
  (pattern) => minimatch(key, pattern)
11613
11633
  )])
11614
11634
  ).fromPairs().value();
@@ -11676,7 +11696,7 @@ function createWorkerTask(args) {
11676
11696
  finalRenamedTargetData
11677
11697
  );
11678
11698
  const checksums = await deltaProcessor.createChecksums(sourceData);
11679
- if (!_optionalChain([args, 'access', _361 => _361.ctx, 'access', _362 => _362.flags, 'access', _363 => _363.targetLocale, 'optionalAccess', _364 => _364.length])) {
11699
+ if (!_optionalChain([args, 'access', _364 => _364.ctx, 'access', _365 => _365.flags, 'access', _366 => _366.targetLocale, 'optionalAccess', _367 => _367.length])) {
11680
11700
  await deltaProcessor.saveChecksums(checksums);
11681
11701
  }
11682
11702
  });
@@ -11881,10 +11901,10 @@ var flagsSchema2 = _zod.z.object({
11881
11901
  async function frozen(input2) {
11882
11902
  console.log(_chalk2.default.hex(colors.orange)("[Frozen]"));
11883
11903
  let buckets = getBuckets(input2.config);
11884
- if (_optionalChain([input2, 'access', _365 => _365.flags, 'access', _366 => _366.bucket, 'optionalAccess', _367 => _367.length])) {
11904
+ if (_optionalChain([input2, 'access', _368 => _368.flags, 'access', _369 => _369.bucket, 'optionalAccess', _370 => _370.length])) {
11885
11905
  buckets = buckets.filter((b) => input2.flags.bucket.includes(b.type));
11886
11906
  }
11887
- if (_optionalChain([input2, 'access', _368 => _368.flags, 'access', _369 => _369.file, 'optionalAccess', _370 => _370.length])) {
11907
+ if (_optionalChain([input2, 'access', _371 => _371.flags, 'access', _372 => _372.file, 'optionalAccess', _373 => _373.length])) {
11888
11908
  buckets = buckets.map((bucket) => {
11889
11909
  const paths = bucket.paths.filter(
11890
11910
  (p) => input2.flags.file.some(
@@ -12021,13 +12041,13 @@ async function frozen(input2) {
12021
12041
 
12022
12042
  // src/cli/cmd/run/_utils.ts
12023
12043
  async function determineAuthId(ctx) {
12024
- const isByokMode = !!_optionalChain([ctx, 'access', _371 => _371.config, 'optionalAccess', _372 => _372.provider]);
12044
+ const isByokMode = !!_optionalChain([ctx, 'access', _374 => _374.config, 'optionalAccess', _375 => _375.provider]);
12025
12045
  if (isByokMode) {
12026
12046
  return null;
12027
12047
  } else {
12028
12048
  try {
12029
- const authStatus = await _optionalChain([ctx, 'access', _373 => _373.localizer, 'optionalAccess', _374 => _374.checkAuth, 'call', _375 => _375()]);
12030
- return _optionalChain([authStatus, 'optionalAccess', _376 => _376.username]) || null;
12049
+ const authStatus = await _optionalChain([ctx, 'access', _376 => _376.localizer, 'optionalAccess', _377 => _377.checkAuth, 'call', _378 => _378()]);
12050
+ return _optionalChain([authStatus, 'optionalAccess', _379 => _379.username]) || null;
12031
12051
  } catch (e3) {
12032
12052
  return null;
12033
12053
  }
@@ -12225,7 +12245,7 @@ var InBranchFlow = class extends IntegrationFlow {
12225
12245
  _child_process.execSync.call(void 0, `git config --global safe.directory ${process.cwd()}`);
12226
12246
  _child_process.execSync.call(void 0, `git config user.name "${gitConfig.userName}"`);
12227
12247
  _child_process.execSync.call(void 0, `git config user.email "${gitConfig.userEmail}"`);
12228
- _optionalChain([this, 'access', _377 => _377.platformKit, 'optionalAccess', _378 => _378.gitConfig, 'call', _379 => _379()]);
12248
+ _optionalChain([this, 'access', _380 => _380.platformKit, 'optionalAccess', _381 => _381.gitConfig, 'call', _382 => _382()]);
12229
12249
  _child_process.execSync.call(void 0, `git fetch origin ${baseBranchName}`, { stdio: "inherit" });
12230
12250
  _child_process.execSync.call(void 0, `git checkout ${baseBranchName} --`, { stdio: "inherit" });
12231
12251
  if (!processOwnCommits) {
@@ -12257,7 +12277,7 @@ var InBranchFlow = class extends IntegrationFlow {
12257
12277
  // src/cli/cmd/ci/flows/pull-request.ts
12258
12278
  var PullRequestFlow = class extends InBranchFlow {
12259
12279
  async preRun() {
12260
- const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall', _380 => _380()]);
12280
+ const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall', _383 => _383()]);
12261
12281
  if (!canContinue) {
12262
12282
  return false;
12263
12283
  }
@@ -12524,10 +12544,10 @@ var BitbucketPlatformKit = class extends PlatformKit {
12524
12544
  repo_slug: this.platformConfig.repositoryName,
12525
12545
  state: "OPEN"
12526
12546
  }).then(({ data: { values } }) => {
12527
- return _optionalChain([values, 'optionalAccess', _381 => _381.find, 'call', _382 => _382(
12528
- ({ source, destination }) => _optionalChain([source, 'optionalAccess', _383 => _383.branch, 'optionalAccess', _384 => _384.name]) === branch && _optionalChain([destination, 'optionalAccess', _385 => _385.branch, 'optionalAccess', _386 => _386.name]) === this.platformConfig.baseBranchName
12547
+ return _optionalChain([values, 'optionalAccess', _384 => _384.find, 'call', _385 => _385(
12548
+ ({ source, destination }) => _optionalChain([source, 'optionalAccess', _386 => _386.branch, 'optionalAccess', _387 => _387.name]) === branch && _optionalChain([destination, 'optionalAccess', _388 => _388.branch, 'optionalAccess', _389 => _389.name]) === this.platformConfig.baseBranchName
12529
12549
  )]);
12530
- }).then((pr) => _optionalChain([pr, 'optionalAccess', _387 => _387.id]));
12550
+ }).then((pr) => _optionalChain([pr, 'optionalAccess', _390 => _390.id]));
12531
12551
  }
12532
12552
  async closePullRequest({ pullRequestNumber }) {
12533
12553
  await this.bb.repositories.declinePullRequest({
@@ -12623,7 +12643,7 @@ var GitHubPlatformKit = class extends PlatformKit {
12623
12643
  repo: this.platformConfig.repositoryName,
12624
12644
  base: this.platformConfig.baseBranchName,
12625
12645
  state: "open"
12626
- }).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess', _388 => _388.number]));
12646
+ }).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess', _391 => _391.number]));
12627
12647
  }
12628
12648
  async closePullRequest({ pullRequestNumber }) {
12629
12649
  await this.octokit.rest.pulls.update({
@@ -12750,7 +12770,7 @@ var GitlabPlatformKit = class extends PlatformKit {
12750
12770
  sourceBranch: branch,
12751
12771
  state: "opened"
12752
12772
  });
12753
- return _optionalChain([mergeRequests, 'access', _389 => _389[0], 'optionalAccess', _390 => _390.iid]);
12773
+ return _optionalChain([mergeRequests, 'access', _392 => _392[0], 'optionalAccess', _393 => _393.iid]);
12754
12774
  }
12755
12775
  async closePullRequest({
12756
12776
  pullRequestNumber
@@ -12862,7 +12882,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
12862
12882
  }
12863
12883
  const env = {
12864
12884
  LINGODOTDEV_API_KEY: settings.auth.apiKey,
12865
- LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access', _391 => _391.pullRequest, 'optionalAccess', _392 => _392.toString, 'call', _393 => _393()]) || "false",
12885
+ LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access', _394 => _394.pullRequest, 'optionalAccess', _395 => _395.toString, 'call', _396 => _396()]) || "false",
12866
12886
  ...options.commitMessage && {
12867
12887
  LINGODOTDEV_COMMIT_MESSAGE: options.commitMessage
12868
12888
  },
@@ -12888,7 +12908,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
12888
12908
  const { isPullRequestMode } = platformKit.config;
12889
12909
  ora.info(`Pull request mode: ${isPullRequestMode ? "on" : "off"}`);
12890
12910
  const flow = isPullRequestMode ? new PullRequestFlow(ora, platformKit) : new InBranchFlow(ora, platformKit);
12891
- const canRun = await _optionalChain([flow, 'access', _394 => _394.preRun, 'optionalCall', _395 => _395()]);
12911
+ const canRun = await _optionalChain([flow, 'access', _397 => _397.preRun, 'optionalCall', _398 => _398()]);
12892
12912
  if (canRun === false) {
12893
12913
  return;
12894
12914
  }
@@ -12898,7 +12918,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
12898
12918
  if (!hasChanges) {
12899
12919
  return;
12900
12920
  }
12901
- await _optionalChain([flow, 'access', _396 => _396.postRun, 'optionalCall', _397 => _397()]);
12921
+ await _optionalChain([flow, 'access', _399 => _399.postRun, 'optionalCall', _400 => _400()]);
12902
12922
  });
12903
12923
  function parseBooleanArg(val) {
12904
12924
  if (val === true) return true;
@@ -12935,8 +12955,8 @@ function exitGracefully(elapsedMs = 0) {
12935
12955
  }
12936
12956
  }
12937
12957
  function checkForPendingOperations() {
12938
- const activeHandles = _optionalChain([process, 'access', _398 => _398._getActiveHandles, 'optionalCall', _399 => _399()]) || [];
12939
- const activeRequests = _optionalChain([process, 'access', _400 => _400._getActiveRequests, 'optionalCall', _401 => _401()]) || [];
12958
+ const activeHandles = _optionalChain([process, 'access', _401 => _401._getActiveHandles, 'optionalCall', _402 => _402()]) || [];
12959
+ const activeRequests = _optionalChain([process, 'access', _403 => _403._getActiveRequests, 'optionalCall', _404 => _404()]) || [];
12940
12960
  const nonStandardHandles = activeHandles.filter((handle) => {
12941
12961
  if (handle === process.stdin || handle === process.stdout || handle === process.stderr) {
12942
12962
  return false;
@@ -13005,17 +13025,17 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
13005
13025
  flags
13006
13026
  });
13007
13027
  let buckets = getBuckets(i18nConfig);
13008
- if (_optionalChain([flags, 'access', _402 => _402.bucket, 'optionalAccess', _403 => _403.length])) {
13028
+ if (_optionalChain([flags, 'access', _405 => _405.bucket, 'optionalAccess', _406 => _406.length])) {
13009
13029
  buckets = buckets.filter(
13010
13030
  (bucket) => flags.bucket.includes(bucket.type)
13011
13031
  );
13012
13032
  }
13013
13033
  ora.succeed("Buckets retrieved");
13014
- if (_optionalChain([flags, 'access', _404 => _404.file, 'optionalAccess', _405 => _405.length])) {
13034
+ if (_optionalChain([flags, 'access', _407 => _407.file, 'optionalAccess', _408 => _408.length])) {
13015
13035
  buckets = buckets.map((bucket) => {
13016
13036
  const paths = bucket.paths.filter(
13017
13037
  (path19) => flags.file.find(
13018
- (file) => _optionalChain([path19, 'access', _406 => _406.pathPattern, 'optionalAccess', _407 => _407.includes, 'call', _408 => _408(file)]) || _optionalChain([path19, 'access', _409 => _409.pathPattern, 'optionalAccess', _410 => _410.match, 'call', _411 => _411(file)]) || minimatch(path19.pathPattern, file)
13038
+ (file) => _optionalChain([path19, 'access', _409 => _409.pathPattern, 'optionalAccess', _410 => _410.includes, 'call', _411 => _411(file)]) || _optionalChain([path19, 'access', _412 => _412.pathPattern, 'optionalAccess', _413 => _413.match, 'call', _414 => _414(file)]) || minimatch(path19.pathPattern, file)
13019
13039
  )
13020
13040
  );
13021
13041
  return { ...bucket, paths };
@@ -13035,7 +13055,7 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
13035
13055
  });
13036
13056
  }
13037
13057
  }
13038
- const targetLocales = _optionalChain([flags, 'access', _412 => _412.locale, 'optionalAccess', _413 => _413.length]) ? flags.locale : i18nConfig.locale.targets;
13058
+ const targetLocales = _optionalChain([flags, 'access', _415 => _415.locale, 'optionalAccess', _416 => _416.length]) ? flags.locale : i18nConfig.locale.targets;
13039
13059
  let totalSourceKeyCount = 0;
13040
13060
  let uniqueKeysToTranslate = 0;
13041
13061
  let totalExistingTranslations = 0;
@@ -13443,12 +13463,12 @@ function validateParams2(i18nConfig, flags) {
13443
13463
  message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
13444
13464
  docUrl: "bucketNotFound"
13445
13465
  });
13446
- } else if (_optionalChain([flags, 'access', _414 => _414.locale, 'optionalAccess', _415 => _415.some, 'call', _416 => _416((locale) => !i18nConfig.locale.targets.includes(locale))])) {
13466
+ } else if (_optionalChain([flags, 'access', _417 => _417.locale, 'optionalAccess', _418 => _418.some, 'call', _419 => _419((locale) => !i18nConfig.locale.targets.includes(locale))])) {
13447
13467
  throw new CLIError({
13448
13468
  message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
13449
13469
  docUrl: "localeTargetNotFound"
13450
13470
  });
13451
- } else if (_optionalChain([flags, 'access', _417 => _417.bucket, 'optionalAccess', _418 => _418.some, 'call', _419 => _419(
13471
+ } else if (_optionalChain([flags, 'access', _420 => _420.bucket, 'optionalAccess', _421 => _421.some, 'call', _422 => _422(
13452
13472
  (bucket) => !i18nConfig.buckets[bucket]
13453
13473
  )])) {
13454
13474
  throw new CLIError({
@@ -13540,7 +13560,7 @@ async function renderHero2() {
13540
13560
  // package.json
13541
13561
  var package_default = {
13542
13562
  name: "lingo.dev",
13543
- version: "0.116.1",
13563
+ version: "0.116.2",
13544
13564
  description: "Lingo.dev CLI",
13545
13565
  private: false,
13546
13566
  publishConfig: {
@@ -13832,7 +13852,7 @@ var purge_default = new (0, _interactivecommander.Command)().command("purge").de
13832
13852
  if (options.file && options.file.length) {
13833
13853
  buckets = buckets.map((bucket) => {
13834
13854
  const paths = bucket.paths.filter(
13835
- (bucketPath) => _optionalChain([options, 'access', _420 => _420.file, 'optionalAccess', _421 => _421.some, 'call', _422 => _422((f) => bucketPath.pathPattern.includes(f))])
13855
+ (bucketPath) => _optionalChain([options, 'access', _423 => _423.file, 'optionalAccess', _424 => _424.some, 'call', _425 => _425((f) => bucketPath.pathPattern.includes(f))])
13836
13856
  );
13837
13857
  return { ...bucket, paths };
13838
13858
  }).filter((bucket) => bucket.paths.length > 0);