@payloadcms/db-postgres 0.3.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -162,6 +162,14 @@ async function parseParams({ adapter, fields, joinAliases, joins, locale, select
162
162
  NULL`);
163
163
  break;
164
164
  }
165
+ if (operator === 'equals' && queryValue === null) {
166
+ constraints.push((0, _drizzleorm.isNull)(rawColumn || table[columnName]));
167
+ break;
168
+ }
169
+ if (operator === 'not_equals' && queryValue === null) {
170
+ constraints.push((0, _drizzleorm.isNotNull)(rawColumn || table[columnName]));
171
+ break;
172
+ }
165
173
  constraints.push(_operatorMap.operatorMap[queryOperator](rawColumn || table[columnName], queryValue));
166
174
  }
167
175
  }
@@ -183,4 +191,4 @@ async function parseParams({ adapter, fields, joinAliases, joins, locale, select
183
191
  return result;
184
192
  }
185
193
 
186
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9xdWVyaWVzL3BhcnNlUGFyYW1zLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIG5vLWF3YWl0LWluLWxvb3AgKi9cbmltcG9ydCB0eXBlIHsgU1FMIH0gZnJvbSAnZHJpenpsZS1vcm0nXG5pbXBvcnQgdHlwZSB7IEZpZWxkLCBPcGVyYXRvciwgV2hlcmUgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgeyBhbmQsIGlsaWtlLCBpc05vdE51bGwsIGlzTnVsbCwgbmUsIG5vdEluQXJyYXksIG9yLCBzcWwgfSBmcm9tICdkcml6emxlLW9ybSdcbmltcG9ydCB7IFF1ZXJ5RXJyb3IgfSBmcm9tICdwYXlsb2FkL2Vycm9ycydcbmltcG9ydCB7IHZhbGlkT3BlcmF0b3JzIH0gZnJvbSAncGF5bG9hZC90eXBlcydcblxuaW1wb3J0IHR5cGUgeyBHZW5lcmljQ29sdW1uLCBQb3N0Z3Jlc0FkYXB0ZXIgfSBmcm9tICcuLi90eXBl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ICAgICAgICAgIGpvaW5zLFxuICAgICAgICAgICAgbG9jYWxlLFxuICAgICAgICAgICAgc2VsZWN0RmllbGRzLFxuICAgICAgICAgICAgdGFibGVOYW1lLFxuICAgICAgICAgICAgd2hlcmU6IGNvbmRpdGlvbixcbiAgICAgICAgICB9KVxuICAgICAgICAgIGlmIChidWlsdENvbmRpdGlvbnMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgaWYgKHJlc3VsdCkge1xuICAgICAgICAgICAgICByZXN1bHQgPSBvcGVyYXRvck1hcFtjb25kaXRpb25PcGVyYXRvcl0ocmVzdWx0LCAuLi5idWlsdENvbmRpdGlvbnMpXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByZXN1bHQgPSBvcGVyYXRvck1hcFtjb25kaXRpb25PcGVyYXRvcl0oLi4uYnVpbHRDb25kaXRpb25zKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAvLyBJdCdzIGEgcGF0aCAtIGFuZCB0aGVyZSBjYW4gYmUgbXVsdGlwbGUgY29tcGFyaXNvbnMgb24gYSBzaW5nbGUgcGF0aC5cbiAgICAgICAgICAvLyBGb3IgZXhhbXBsZSAtIHRpdGxlIGxpa2UgJ3Rlc3QnIGFuZCB0aXRsZSBub3QgZXF1YWwgdG8gJ3Rlc3RlcidcbiAgICAgICAgICAvLyBTbyB3ZSBuZWVkIHRvIGxvb3Agb24ga2V5cyBhZ2FpbiBoZXJlIHRvIGhhbmRsZSBlYWNoIG9wZXJhdG9yIGluZGVwZW5kZW50bHlcbiAgICAgICAgICBjb25zdCBwYXRoT3BlcmF0b3JzID0gd2hlcmVbcmVsYXRpb25PclBhdGhdXG4gICAgICAgICAgaWYgKHR5cGVvZiBwYXRoT3BlcmF0b3JzID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgZm9yIChjb25zdCBvcGVyYXRvciBvZiBPYmplY3Qua2V5cyhwYXRoT3BlcmF0b3JzKSkge1xuICAgICAgICAgICAgICBpZiAodmFsaWRPcGVyYXRvcnMuaW5jbHVkZXMob3BlcmF0b3IgYXMgT3BlcmF0b3IpKSB7XG4gICAgICAgICAgICAgICAgY29uc3Qge1xuICAgICAgICAgICAgICAgICAgY29sdW1uTmFtZSxcbiAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRzOiBxdWVyeUNvbnN0cmFpbnRzLFxuICAgICAgICAgICAgICAgICAgZmllbGQsXG4gICAgICAgICAgICAgICAgICBnZXROb3ROdWxsQ29sdW1uQnlWYWx1ZSxcbiAgICAgICAgICAgICAgICAgIHBhdGhTZWdtZW50cyxcbiAgICAgICAgICAgICAgICAgIHJhd0NvbHVtbixcbiAgICAgICAgICAgICAgICAgIHRhYmxlLFxuICAgICAgICAgICAgICAgIH0gPSBnZXRUYWJsZUNvbHVtbkZyb21QYXRoKHtcbiAgICAgICAgICAgICAgICAgIGFkYXB0ZXIsXG4gICAgICAgICAgICAgICAgICBjb2xsZWN0aW9uUGF0aDogcmVsYXRpb25PclBhdGgsXG4gICAgICAgICAgICAgICAgICBmaWVsZHMsXG4gICAgICAgICAgICAgICAgICBqb2luQWxpYXNlcyxcbiAgICAgICAgICAgICAgICAgIGpvaW5zLFxuICAgICAgICAgICAgICAgICAgbG9jYWxlLFxuICAgICAgICAgICAgICAgICAgcGF0aFNlZ21lbnRzOiByZWxhdGlvbk9yUGF0aC5yZXBsYWNlKC9fXy9nLCAnLicpLnNwbGl0KCcuJyksXG4gICAgICAgICAgICAgICAgICBzZWxlY3RGaWVsZHMsXG4gICAgICAgICAgICAgICAgICB0YWJsZU5hbWUsXG4gICAgICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgICAgIGNvbnN0IHZhbCA9IHdoZXJlW3JlbGF0aW9uT3JQYXRoXVtvcGVyYXRvcl1cblxuICAgICAgICAgICAgICAgIHF1ZXJ5Q29uc3RyYWludHMuZm9yRWFjaCgoeyBjb2x1bW5OYW1lOiBjb2wsIHRhYmxlOiBjb25zdHJhaW50VGFibGUsIHZhbHVlIH0pID0+IHtcbiAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdmFsdWUgPT09ICdzdHJpbmcnICYmIHZhbHVlLmluZGV4T2YoJyUnKSA+IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRzLnB1c2gob3BlcmF0b3JNYXAubGlrZShjb25zdHJhaW50VGFibGVbY29sXSwgdmFsdWUpKVxuICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChvcGVyYXRvck1hcC5lcXVhbHMoY29uc3RyYWludFRhYmxlW2NvbF0sIHZhbHVlKSlcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgWydqc29uJywgJ3JpY2hUZXh0J10uaW5jbHVkZXMoZmllbGQudHlwZSkgJiZcbiAgICAgICAgICAgICAgICAgIEFycmF5LmlzQXJyYXkocGF0aFNlZ21lbnRzKSAmJlxuICAgICAgICAgICAgICAgICAgcGF0aFNlZ21lbnRzLmxlbmd0aCA+IDFcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgIGNvbnN0IHNlZ21lbnRzID0gcGF0aFNlZ21lbnRzLnNsaWNlKDEpXG4gICAgICAgICAgICAgICAgICBzZWdtZW50cy51bnNoaWZ0KHRhYmxlW2NvbHVtbk5hbWVdLm5hbWUpXG5cbiAgICAgICAgICAgICAgICAgIGlmIChmaWVsZC50eXBlID09PSAncmljaFRleHQnKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGpzb25RdWVyeSA9IGNyZWF0ZUpTT05RdWVyeSh7XG4gICAgICAgICAgICAgICAgICAgICAgb3BlcmF0b3IsXG4gICAgICAgICAgICAgICAgICAgICAgcGF0aFNlZ21lbnRzOiBzZWdtZW50cyxcbiAgICAgICAgICAgICAgICAgICAgICB0cmVhdEFzQXJyYXk6IFsnY2hpbGRyZW4nXSxcbiAgICAgICAgICAgICAgICAgICAgICB0cmVhdFJvb3RBc0FycmF5OiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiB2YWwsXG4gICAgICAgICAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChzcWwucmF3KGpzb25RdWVyeSkpXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgIGNvbnN0IGpzb25RdWVyeSA9IGNvbnZlcnRQYXRoVG9KU09OVHJhdmVyc2FsKHBhdGhTZWdtZW50cylcbiAgICAgICAgICAgICAgICAgIGNvbnN0IG9wZXJhdG9yS2V5cyA9IHtcbiAgICAgICAgICAgICAgICAgICAgY29udGFpbnM6IHsgb3BlcmF0b3I6ICdpbGlrZScsIHdpbGRjYXJkOiAnJScgfSxcbiAgICAgICAgICAgICAgICAgICAgZXF1YWxzOiB7IG9wZXJhdG9yOiAnPScsIHdpbGRjYXJkOiAnJyB9LFxuICAgICAgICAgICAgICAgICAgICBleGlzdHM6IHsgb3BlcmF0b3I6IHZhbCA9PT0gdHJ1ZSA/ICdpcyBub3QgbnVsbCcgOiAnaXMgbnVsbCcgfSxcbiAgICAgICAgICAgICAgICAgICAgbGlrZTogeyBvcGVyYXRvcjogJ2xpa2UnLCB3aWxkY2FyZDogJyUnIH0sXG4gICAgICAgICAgICAgICAgICAgIG5vdF9lcXVhbHM6IHsgb3BlcmF0b3I6ICc8PicsIHdpbGRjYXJkOiAnJyB9LFxuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgbGV0IGZvcm1hdHRlZFZhbHVlID0gYCcke29wZXJhdG9yS2V5c1tvcGVyYXRvcl0ud2lsZGNhcmR9JHt2YWx9JHtvcGVyYXRvcktleXNbb3BlcmF0b3JdLndpbGRjYXJkfSdgXG5cbiAgICAgICAgICAgICAgICAgIGlmIChvcGVyYXRvciA9PT0gJ2V4aXN0cycpIHtcbiAgICAgICAgICAgICAgICAgICAgZm9ybWF0dGVkVmFsdWUgPSAnJ1xuICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICBjb25zdHJhaW50cy5wdXNoKFxuICAgICAgICAgICAgICAgICAgICBzcWwucmF3KFxuICAgICAgICAgICAgICAgICAgICAgIGAke3RhYmxlW2NvbHVtbk5hbWVdLm5hbWV9JHtqc29uUXVlcnl9ICR7b3BlcmF0b3JLZXlzW29wZXJhdG9yXS5vcGVyYXRvcn0gJHtmb3JtYXR0ZWRWYWx1ZX1gLFxuICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgKVxuXG4gICAgICAgICAgICAgICAgICBicmVha1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChnZXROb3ROdWxsQ29sdW1uQnlWYWx1ZSkge1xuICAgICAgICAgICAgICAgICAgY29uc3QgY29sdW1uTmFtZSA9IGdldE5vdE51bGxDb2x1bW5CeVZhbHVlKHZhbClcbiAgICAgICAgICAgICAgICAgIGlmIChjb2x1bW5OYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRzLnB1c2goaXNOb3ROdWxsKHRhYmxlW2NvbHVtbk5hbWVdKSlcbiAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBRdWVyeUVycm9yKFt7IHBhdGg6IHJlbGF0aW9uT3JQYXRoIH1dKVxuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAob3BlcmF0b3IgPT09ICdsaWtlJykge1xuICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChcbiAgICAgICAgICAgICAgICAgICAgYW5kKC4uLnZhbC5zcGxpdCgnICcpLm1hcCgod29yZCkgPT4gaWxpa2UodGFibGVbY29sdW1uTmFtZV0sIGAlJHt3b3JkfSVgKSkpLFxuICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBjb25zdCBzYW5pdGl6ZWRRdWVyeVZhbHVlID0gc2FuaXRpemVRdWVyeVZhbHVlKHtcbiAgICAgICAgICAgICAgICAgIGZpZWxkLFxuICAgICAgICAgICAgICAgICAgb3BlcmF0b3IsXG4gICAgICAgICAgICAgICAgICByZWxhdGlvbk9yUGF0aCxcbiAgICAgICAgICAgICAgICAgIHZhbCxcbiAgICAgICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAgICAgaWYgKHNhbml0aXplZFF1ZXJ5VmFsdWUgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgY29uc3QgeyBvcGVyYXRvcjogcXVlcnlPcGVyYXRvciwgdmFsdWU6IHF1ZXJ5VmFsdWUgfSA9IHNhbml0aXplZFF1ZXJ5VmFsdWVcblxuICAgICAgICAgICAgICAgIGlmIChxdWVyeU9wZXJhdG9yID09PSAnbm90X2VxdWFscycgJiYgcXVlcnlWYWx1ZSAhPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChcbiAgICAgICAgICAgICAgICAgICAgb3IoXG4gICAgICAgICAgICAgICAgICAgICAgaXNOdWxsKHJhd0NvbHVtbiB8fCB0YWJsZVtjb2x1bW5OYW1lXSksXG4gICAgICAgICAgICAgICAgICAgICAgLyogZXNsaW50LWRpc2FibGUgQHR5cGVzY3JpcHQtZXNsaW50L25vLWV4cGxpY2l0LWFueSAqL1xuICAgICAgICAgICAgICAgICAgICAgIG5lPGFueT4ocmF3Q29sdW1uIHx8IHRhYmxlW2NvbHVtbk5hbWVdLCBxdWVyeVZhbHVlKSxcbiAgICAgICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgKGZpZWxkLnR5cGUgPT09ICdyZWxhdGlvbnNoaXAnIHx8IGZpZWxkLnR5cGUgPT09ICd1cGxvYWQnKSAmJlxuICAgICAgICAgICAgICAgICAgQXJyYXkuaXNBcnJheShxdWVyeVZhbHVlKSAmJlxuICAgICAgICAgICAgICAgICAgb3BlcmF0b3IgPT09ICdub3RfaW4nXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICBjb25zdHJhaW50cy5wdXNoKFxuICAgICAgICAgICAgICAgICAgICBzcWxgJHtub3RJbkFycmF5KHRhYmxlW2NvbHVtbk5hbWVdLCBxdWVyeVZhbHVlKX0gT1JcbiAgICAgICAgICAgICAgICAgICAgJHt0YWJsZVtjb2x1bW5OYW1lXX1cbiAgICAgICAgICAgICAgICAgICAgSVNcbiAgICAgICAgICAgICAgICAgICAgTlVMTGAsXG4gICAgICAgICAgICAgICAgICApXG5cbiAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChcbiAgICAgICAgICAgICAgICAgIG9wZXJhdG9yTWFwW3F1ZXJ5T3BlcmF0b3JdKHJhd0NvbHVtbiB8fCB0YWJsZVtjb2x1bW5OYW1lXSwgcXVlcnlWYWx1ZSksXG4gICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG4gIGlmIChjb25zdHJhaW50cy5sZW5ndGggPiAwKSB7XG4gICAgaWYgKHJlc3VsdCkge1xuICAgIC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VsYXRpb25PclBhdGhdXG4gICAgICAgIGxldCBjb25kaXRpb25PcGVyYXRvcjogJ2FuZCcgfCAnb3InXG4gICAgICAgIGlmIChyZWxhdGlvbk9yUGF0aC50b0xvd2VyQ2FzZSgpID09PSAnYW5kJykge1xuICAgICAgICAgIGNvbmRpdGlvbk9wZXJhdG9yID0gJ2FuZCdcbiAgICAgICAgfSBlbHNlIGlmIChyZWxhdGlvbk9yUGF0aC50b0xvd2VyQ2FzZSgpID09PSAnb3InKSB7XG4gICAgICAgICAgY29uZGl0aW9uT3BlcmF0b3IgPSAnb3InXG4gICAgICAgIH1cbiAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoY29uZGl0aW9uKSkge1xuICAgICAgICAgIGNvbnN0IGJ1aWx0Q29uZGl0aW9ucyA9IGF3YWl0IGJ1aWxkQW5kT3JDb25kaXRpb25zKHtcbiAgICAgICAgICAgIGFkYXB0ZXIsXG4gICAgICAgICAgICBmaWVsZHMsXG4gICAgICAgICAgICBqb2luQWxpYXNlcyxcbiAgICAgICAgICAgIGpvaW5zLFxuICAgICAgICAgICAgbG9jYWxlLFxuICAgICAgICAgICAgc2VsZWN0RmllbGRzLFxuICAgICAgICAgICAgdGFibGVOYW1lLFxuICAgICAgICAgICAgd2hlcmU6IGNvbmRpdGlvbixcbiAgICAgICAgICB9KVxuICAgICAgICAgIGlmIChidWlsdENvbmRpdGlvbnMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgaWYgKHJlc3VsdCkge1xuICAgICAgICAgICAgICByZXN1bHQgPSBvcGVyYXRvck1hcFtjb25kaXRpb25PcGVyYXRvcl0ocmVzdWx0LCAuLi5idWlsdENvbmRpdGlvbnMpXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByZXN1bHQgPSBvcGVyYXRvck1hcFtjb25kaXRpb25PcGVyYXRvcl0oLi4uYnVpbHRDb25kaXRpb25zKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgf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4gICAgICAgICAgICAgICAgICBjb2xsZWN0aW9uUGF0aDogcmVsYXRpb25PclBhdGgsXG4gICAgICAgICAgICAgICAgICBmaWVsZHMsXG4gICAgICAgICAgICAgICAgICBqb2luQWxpYXNlcyxcbiAgICAgICAgICAgICAgICAgIGpvaW5zLFxuICAgICAgICAgICAgICAgICAgbG9jYWxlLFxuICAgICAgICAgICAgICAgICAgcGF0aFNlZ21lbnRzOiByZWxhdGlvbk9yUGF0aC5yZXBsYWNlKC9fXy9nLCAnLicpLnNwbGl0KCcuJyksXG4gICAgICAgICAgICAgICAgICBzZWxlY3RGaWVsZHMsXG4gICAgICAgICAgICAgICAgICB0YWJsZU5hbWUsXG4gICAgICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgICAgIGNvbnN0IHZhbCA9IHdoZXJlW3JlbGF0aW9uT3JQYXRoXVtvcGVyYXRvcl1cblxuICAgICAgICAgICAgICAgIHF1ZXJ5Q29uc3RyYWludHMuZm9yRWFjaCgoeyBjb2x1bW5OYW1lOiBjb2wsIHRhYmxlOiBjb25zdHJhaW50VGFibGUsIHZhbHVlIH0pID0+IHtcbiAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdmFsdWUgPT09ICdzdHJpbmcnICYmIHZhbHVlLmluZGV4T2YoJyUnKSA+IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRzLnB1c2gob3BlcmF0b3JNYXAubGlrZShjb25zdHJhaW50VGFibGVbY29sXSwgdmFsdWUpKVxuICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChvcGVyYXRvck1hcC5lcXVhbHMoY29uc3RyYWludFRhYmxlW2NvbF0sIHZhbHVlKSlcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgWydqc29uJywgJ3JpY2hUZXh0J10uaW5jbHVkZXMoZmllbGQudHlwZSkgJiZcbiAgICAgICAgICAgICAgICAgIEFycmF5LmlzQXJyYXkocGF0aFNlZ21lbnRzKSAmJlxuICAgICAgICAgICAgICAgICAgcGF0aFNlZ21lbnRzLmxlbmd0aCA+IDFcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgIGNvbnN0IHNlZ21lbnRzID0gcGF0aFNlZ21lbnRzLnNsaWNlKDEpXG4gICAgICAgICAgICAgICAgICBzZWdtZW50cy51bnNoaWZ0KHRhYmxlW2NvbHVtbk5hbWVdLm5hbWUpXG5cbiAgICAgICAgICAgICAgICAgIGlmIChmaWVsZC50eXBlID09PSAncmljaFRleHQnKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGpzb25RdWVyeSA9IGNyZWF0ZUpTT05RdWVyeSh7XG4gICAgICAgICAgICAgICAgICAgICAgb3BlcmF0b3IsXG4gICAgICAgICAgICAgICAgICAgICAgcGF0aFNlZ21lbnRzOiBzZWdtZW50cyxcbiAgICAgICAgICAgICAgICAgICAgICB0cmVhdEFzQXJyYXk6IFsnY2hpbGRyZW4nXSxcbiAgICAgICAgICAgICAgICAgICAgICB0cmVhdFJvb3RBc0FycmF5OiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiB2YWwsXG4gICAgICAgICAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChzcWwucmF3KGpzb25RdWVyeSkpXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgIGNvbnN0IGpzb25RdWVyeSA9IGNvbnZlcnRQYXRoVG9KU09OVHJhdmVyc2FsKHBhdGhTZWdtZW50cylcbiAgICAgICAgICAgICAgICAgIGNvbnN0IG9wZXJhdG9yS2V5cyA9IHtcbiAgICAgICAgICAgICAgICAgICAgY29udGFpbnM6IHsgb3BlcmF0b3I6ICdpbGlrZScsIHdpbGRjYXJkOiAnJScgfSxcbiAgICAgICAgICAgICAgICAgICAgZXF1YWxzOiB7IG9wZXJhdG9yOiAnPScsIHdpbGRjYXJkOiAnJyB9LFxuICAgICAgICAgICAgICAgICAgICBleGlzdHM6IHsgb3BlcmF0b3I6IHZhbCA9PT0gdHJ1ZSA/ICdpcyBub3QgbnVsbCcgOiAnaXMgbnVsbCcgfSxcbiAgICAgICAgICAgICAgICAgICAgbGlrZTogeyBvcGVyYXRvcjogJ2xpa2UnLCB3aWxkY2FyZDogJyUnIH0sXG4gICAgICAgICAgICAgICAgICAgIG5vdF9lcXVhbHM6IHsgb3BlcmF0b3I6ICc8PicsIHdpbGRjYXJkOiAnJyB9LFxuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgbGV0IGZvcm1hdHRlZFZhbHVlID0gYCcke29wZXJhdG9yS2V5c1tvcGVyYXRvcl0ud2lsZGNhcmR9JHt2YWx9JHtvcGVyYXRvcktleXNbb3BlcmF0b3JdLndpbGRjYXJkfSdgXG5cbiAgICAgICAgICAgICAgICAgIGlmIChvcGVyYXRvciA9PT0gJ2V4aXN0cycpIHtcbiAgICAgICAgICAgICAgICAgICAgZm9ybWF0dGVkVmFsdWUgPSAnJ1xuICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICBjb25zdHJhaW50cy5wdXNoKFxuICAgICAgICAgICAgICAgICAgICBzcWwucmF3KFxuICAgICAgICAgICAgICAgICAgICAgIGAke3RhYmxlW2NvbHVtbk5hbWVdLm5hbWV9JHtqc29uUXVlcnl9ICR7b3BlcmF0b3JLZXlzW29wZXJhdG9yXS5vcGVyYXRvcn0gJHtmb3JtYXR0ZWRWYWx1ZX1gLFxuICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgKVxuXG4gICAgICAgICAgICAgICAgICBicmVha1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChnZXROb3ROdWxsQ29sdW1uQnlWYWx1ZSkge1xuICAgICAgICAgICAgICAgICAgY29uc3QgY29sdW1uTmFtZSA9IGdldE5vdE51bGxDb2x1bW5CeVZhbHVlKHZhbClcbiAgICAgICAgICAgICAgICAgIGlmIChjb2x1bW5OYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRzLnB1c2goaXNOb3ROdWxsKHRhYmxlW2NvbHVtbk5hbWVdKSlcbiAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBRdWVyeUVycm9yKFt7IHBhdGg6IHJlbGF0aW9uT3JQYXRoIH1dKVxuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAob3BlcmF0b3IgPT09ICdsaWtlJykge1xuICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChcbiAgICAgICAgICAgICAgICAgICAgYW5kKC4uLnZhbC5zcGxpdCgnICcpLm1hcCgod29yZCkgPT4gaWxpa2UodGFibGVbY29sdW1uTmFtZV0sIGAlJHt3b3JkfSVgKSkpLFxuICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBjb25zdCBzYW5pdGl6ZWRRdWVyeVZhbHVlID0gc2FuaXRpemVRdWVyeVZhbHVlKHtcbiAgICAgICAgICAgICAgICAgIGZpZWxkLFxuICAgICAgICAgICAgICAgICAgb3BlcmF0b3IsXG4gICAgICAgICAgICAgICAgICByZWxhdGlvbk9yUGF0aCxcbiAgICAgICAgICAgICAgICAgIHZhbCxcbiAgICAgICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAgICAgaWYgKHNhbml0aXplZFF1ZXJ5VmFsdWUgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgY29uc3QgeyBvcGVyYXRvcjogcXVlcnlPcGVyYXRvciwgdmFsdWU6IHF1ZXJ5VmFsdWUgfSA9IHNhbml0aXplZFF1ZXJ5VmFsdWVcblxuICAgICAgICAgICAgICAgIGlmIChxdWVyeU9wZXJhdG9yID09PSAnbm90X2VxdWFscycgJiYgcXVlcnlWYWx1ZSAhPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChcbiAgICAgICAgICAgICAgICAgICAgb3IoXG4gICAgICAgICAgICAgICAgICAgICAgaXNOdWxsKHJhd0NvbHVtbiB8fCB0YWJsZVtjb2x1bW5OYW1lXSksXG4gICAgICAgICAgICAgICAgICAgICAgLyogZXNsaW50LWRpc2FibGUgQHR5cGVzY3JpcHQtZXNsaW50L25vLWV4cGxpY2l0LWFueSAqL1xuICAgICAgICAgICAgICAgICAgICAgIG5lPGFueT4ocmF3Q29sdW1uIHx8IHRhYmxlW2NvbHVtbk5hbWVdLCBxdWVyeVZhbHVlKSxcbiAgICAgICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgKGZpZWxkLnR5cGUgPT09ICdyZWxhdGlvbnNoaXAnIHx8IGZpZWxkLnR5cGUgPT09ICd1cGxvYWQnKSAmJlxuICAgICAgICAgICAgICAgICAgQXJyYXkuaXNBcnJheShxdWVyeVZhbHVlKSAmJlxuICAgICAgICAgICAgICAgICAgb3BlcmF0b3IgPT09ICdub3RfaW4nXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICBjb25zdHJhaW50cy5wdXNoKFxuICAgICAgICAgICAgICAgICAgICBzcWxgJHtub3RJbkFycmF5KHRhYmxlW2NvbHVtbk5hbWVdLCBxdWVyeVZhbHVlKX0gT1JcbiAgICAgICAgICAgICAgICAgICAgJHt0YWJsZVtjb2x1bW5OYW1lXX1cbiAgICAgICAgICAgICAgICAgICAgSVNcbiAgICAgICAgICAgICAgICAgICAgTlVMTGAsXG4gICAgICAgICAgICAgICAgICApXG5cbiAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKG9wZXJhdG9yID09PSAnZXF1YWxzJyAmJiBxdWVyeVZhbHVlID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICBjb25zdHJhaW50cy5wdXNoKGlzTnVsbChyYXdDb2x1bW4gfHwgdGFibGVbY29sdW1uTmFtZV0pKVxuICAgICAgICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAob3BlcmF0b3IgPT09ICdub3RfZXF1YWxzJyAmJiBxdWVyeVZhbHVlID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICBjb25zdHJhaW50cy5wdXNoKGlzTm90TnVsbChyYXdDb2x1bW4gfHwgdGFibGVbY29sdW1uTmFtZV0pKVxuICAgICAgICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBjb25zdHJhaW50cy5wdXNoKFxuICAgICAgICAgICAgICAgICAgb3BlcmF0b3JNYXBbcXVlcnlPcGVyYXRvcl0ocmF3Q29sdW1uIHx8IHRhYmxlW2NvbHVtbk5hbWVdLCBxdWVyeVZhbHVlKSxcbiAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gIH1cbiAgaWYgKGNvbnN0cmFpbnRzLmxlbmd0aCA+IDApIHtcbiAgICBpZiAocmVzdWx0KSB7XG4gICAgICByZXN1bHQgPSBhbmQocmVzdWx0LCAuLi5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QVMyRCxJQUFBQSxlQUFHLEtBQUkxRDtRQUNsQjtJQUNGO0lBQ0EsSUFBSUEsWUFBWUcsTUFBTSxLQUFLLEtBQUssQ0FBQ0osUUFBUTtRQUN0QyxDQUFDQSxPQUFPLEdBQUdDO0lBQ2Q7SUFFQSxPQUFPRDtBQUNUIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"validateExistingBlockIsIdentical.d.ts","sourceRoot":"","sources":["../../src/schema/validateExistingBlockIsIdentical.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAS,MAAM,eAAe,CAAA;AAKjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE5C,KAAK,IAAI,GAAG;IACV,KAAK,EAAE,KAAK,CAAA;IACZ,SAAS,EAAE,OAAO,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,YAAY,CAAA;CACpB,CAAA;AAsCD,eAAO,MAAM,gCAAgC,gDAK1C,IAAI,KAAG,IA0BT,CAAA"}
1
+ {"version":3,"file":"validateExistingBlockIsIdentical.d.ts","sourceRoot":"","sources":["../../src/schema/validateExistingBlockIsIdentical.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAS,MAAM,eAAe,CAAA;AAKjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE5C,KAAK,IAAI,GAAG;IACV,KAAK,EAAE,KAAK,CAAA;IACZ,SAAS,EAAE,OAAO,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,YAAY,CAAA;CACpB,CAAA;AAyCD,eAAO,MAAM,gCAAgC,gDAK1C,IAAI,KAAG,IAwBT,CAAA"}
@@ -13,7 +13,12 @@ const _types = require("payload/types");
13
13
  const getFlattenedFieldNames = (fields, prefix = '')=>{
14
14
  return fields.reduce((fieldsToUse, field)=>{
15
15
  let fieldPrefix = prefix;
16
- if (field.type === 'blocks') {
16
+ if ([
17
+ 'array',
18
+ 'blocks',
19
+ 'relationship',
20
+ 'upload'
21
+ ].includes(field.type) || 'hasMany' in field && field.hasMany === true) {
17
22
  return fieldsToUse;
18
23
  }
19
24
  if ((0, _types.fieldHasSubFields)(field)) {
@@ -50,28 +55,26 @@ const getFlattenedFieldNames = (fields, prefix = '')=>{
50
55
  }, []);
51
56
  };
52
57
  const validateExistingBlockIsIdentical = ({ block, localized, rootTableName, table })=>{
53
- if (table) {
54
- const fieldNames = getFlattenedFieldNames(block.fields);
55
- const missingField = // ensure every field from the config is in the matching table
56
- fieldNames.find((name)=>Object.keys(table).indexOf(name) === -1) || // ensure every table column is matched for every field from the config
57
- Object.keys(table).find((fieldName)=>{
58
- if (![
59
- '_locale',
60
- '_order',
61
- '_parentID',
62
- '_path',
63
- '_uuid'
64
- ].includes(fieldName)) {
65
- return fieldNames.indexOf(fieldName) === -1;
66
- }
67
- });
68
- if (missingField) {
69
- throw new _errors.InvalidConfiguration(`The table ${rootTableName} has multiple blocks with slug ${block.slug}, but the schemas do not match. One block includes the field ${missingField}, while the other block does not.`);
70
- }
71
- if (Boolean(localized) !== Boolean(table._locale)) {
72
- throw new _errors.InvalidConfiguration(`The table ${rootTableName} has multiple blocks with slug ${block.slug}, but the schemas do not match. One is localized, but another is not. Block schemas of the same name must match exactly.`);
58
+ const fieldNames = getFlattenedFieldNames(block.fields);
59
+ const missingField = // ensure every field from the config is in the matching table
60
+ fieldNames.find((name)=>Object.keys(table).indexOf(name) === -1) || // ensure every table column is matched for every field from the config
61
+ Object.keys(table).find((fieldName)=>{
62
+ if (![
63
+ '_locale',
64
+ '_order',
65
+ '_parentID',
66
+ '_path',
67
+ '_uuid'
68
+ ].includes(fieldName)) {
69
+ return fieldNames.indexOf(fieldName) === -1;
73
70
  }
71
+ });
72
+ if (missingField) {
73
+ throw new _errors.InvalidConfiguration(`The table ${rootTableName} has multiple blocks with slug ${block.slug}, but the schemas do not match. One block includes the field ${missingField}, while the other block does not.`);
74
+ }
75
+ if (Boolean(localized) !== Boolean(table._locale)) {
76
+ throw new _errors.InvalidConfiguration(`The table ${rootTableName} has multiple blocks with slug ${block.slug}, but the schemas do not match. One is localized, but another is not. Block schemas of the same name must match exactly.`);
74
77
  }
75
78
  };
76
79
 
77
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zY2hlbWEvdmFsaWRhdGVFeGlzdGluZ0Jsb2NrSXNJZGVudGljYWwudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBCbG9jaywgRmllbGQgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgeyBJbnZhbGlkQ29uZmlndXJhdGlvbiB9IGZyb20gJ3BheWxvYWQvZXJyb3JzJ1xuaW1wb3J0IHsgZmllbGRBZmZlY3RzRGF0YSwgZmllbGRIYXNTdWJGaWVsZHMsIHRhYkhhc05hbWUgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgdHlwZSB7IEdlbmVyaWNUYWJsZSB9IGZyb20gJy4uL3R5cGVzJ1xuXG50eXBlIEFyZ3MgPSB7XG4gIGJsb2NrOiBCbG9ja1xuICBsb2NhbGl6ZWQ6IGJvb2xlYW5cbiAgcm9vdFRhYmxlTmFtZTogc3RyaW5nXG4gIHRhYmxlOiBHZW5lcmljVGFibGVcbn1cblxuY29uc3QgZ2V0RmxhdHRlbmVkRmllbGROYW1lcyA9IChmaWVsZHM6IEZpZWxkW10sIHByZWZpeDogc3RyaW5nID0gJycpOiBzdHJpbmdbXSA9PiB7XG4gIHJldHVybiBmaWVsZHMucmVkdWNlKChmaWVsZHNUb1VzZSwgZmllbGQpID0+IHtcbiAgICBsZXQgZmllbGRQcmVmaXggPSBwcmVmaXhcblxuICAgIGlmIChmaWVsZC50eXBlID09PSAnYmxvY2tzJykge1xuICAgICAgcmV0dXJuIGZpZWxkc1RvVXNlXG4gICAgfVx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TyxHQUFHO1FBQ2pELE1BQU0sSUFBSUgsNEJBQW9CLENBQzVCLENBQUMsVUFBVSxFQUFFVCxjQUFjLCtCQUErQixFQUFFRixNQUFNWSxJQUFJLENBQUMsd0hBQXdILENBQUM7SUFFcE07QUFDRiJ9
@@ -26,10 +26,6 @@ type TraverseFieldsArgs = {
26
26
  * An array of Payload fields to traverse
27
27
  */
28
28
  fields: (Field | TabAsField)[];
29
- /**
30
- * All hasMany text fields, as returned by Drizzle, keyed on an object by field path
31
- */
32
- texts: Record<string, Record<string, unknown>[]>;
33
29
  /**
34
30
  * All hasMany number fields, as returned by Drizzle, keyed on an object by field path
35
31
  */
@@ -46,7 +42,11 @@ type TraverseFieldsArgs = {
46
42
  * Data structure representing the nearest table from db
47
43
  */
48
44
  table: Record<string, unknown>;
45
+ /**
46
+ * All hasMany text fields, as returned by Drizzle, keyed on an object by field path
47
+ */
48
+ texts: Record<string, Record<string, unknown>[]>;
49
49
  };
50
- export declare const traverseFields: <T extends Record<string, unknown>>({ blocks, config, dataRef, deletions, fieldPrefix, fields, texts, numbers, path, relationships, table, }: TraverseFieldsArgs) => T;
50
+ export declare const traverseFields: <T extends Record<string, unknown>>({ blocks, config, dataRef, deletions, fieldPrefix, fields, numbers, path, relationships, table, texts, }: TraverseFieldsArgs) => T;
51
51
  export {};
52
52
  //# sourceMappingURL=traverseFields.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"traverseFields.d.ts","sourceRoot":"","sources":["../../../src/transform/read/traverseFields.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAItD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAA;AAMhE,KAAK,kBAAkB,GAAG;IACxB;;OAEG;IACH,MAAM,EAAE,SAAS,CAAA;IACjB;;OAEG;IACH,MAAM,EAAE,eAAe,CAAA;IACvB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC;;OAEG;IACH,SAAS,EAAE,CAAC,MAAM,IAAI,CAAC,EAAE,CAAA;IACzB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,MAAM,EAAE,CAAC,KAAK,GAAG,UAAU,CAAC,EAAE,CAAA;IAC9B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAAA;IAChD;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAAA;IAClD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAAA;IACxD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC/B,CAAA;AAID,eAAO,MAAM,cAAc,gJAYxB,kBAAkB,MAkcpB,CAAA"}
1
+ {"version":3,"file":"traverseFields.d.ts","sourceRoot":"","sources":["../../../src/transform/read/traverseFields.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAItD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAA;AAMhE,KAAK,kBAAkB,GAAG;IACxB;;OAEG;IACH,MAAM,EAAE,SAAS,CAAA;IACjB;;OAEG;IACH,MAAM,EAAE,eAAe,CAAA;IACvB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC;;OAEG;IACH,SAAS,EAAE,CAAC,MAAM,IAAI,CAAC,EAAE,CAAA;IACzB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,MAAM,EAAE,CAAC,KAAK,GAAG,UAAU,CAAC,EAAE,CAAA;IAC9B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAAA;IAClD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAAA;IACxD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAAA;CACjD,CAAA;AAID,eAAO,MAAM,cAAc,gJAYxB,kBAAkB,MAsdpB,CAAA"}
@@ -10,9 +10,9 @@ Object.defineProperty(exports, "traverseFields", {
10
10
  });
11
11
  const _types = require("payload/types");
12
12
  const _hasManyNumber = require("./hasManyNumber");
13
- const _relationship = require("./relationship");
14
13
  const _hasManyText = require("./hasManyText");
15
- const traverseFields = ({ blocks, config, dataRef, deletions, fieldPrefix, fields, texts, numbers, path, relationships, table })=>{
14
+ const _relationship = require("./relationship");
15
+ const traverseFields = ({ blocks, config, dataRef, deletions, fieldPrefix, fields, numbers, path, relationships, table, texts })=>{
16
16
  const sanitizedPath = path ? `${path}.` : path;
17
17
  const formatted = fields.reduce((result, field)=>{
18
18
  if (field.type === 'tabs') {
@@ -26,11 +26,11 @@ const traverseFields = ({ blocks, config, dataRef, deletions, fieldPrefix, field
26
26
  ...tab,
27
27
  type: 'tab'
28
28
  })),
29
- texts,
30
29
  numbers,
31
30
  path,
32
31
  relationships,
33
- table
32
+ table,
33
+ texts
34
34
  });
35
35
  }
36
36
  if (field.type === 'collapsible' || field.type === 'row' || field.type === 'tab' && !('name' in field)) {
@@ -41,16 +41,19 @@ const traverseFields = ({ blocks, config, dataRef, deletions, fieldPrefix, field
41
41
  deletions,
42
42
  fieldPrefix,
43
43
  fields: field.fields,
44
- texts,
45
44
  numbers,
46
45
  path,
47
46
  relationships,
48
- table
47
+ table,
48
+ texts
49
49
  });
50
50
  }
51
51
  if ((0, _types.fieldAffectsData)(field)) {
52
52
  const fieldName = `${fieldPrefix || ''}${field.name}`;
53
53
  const fieldData = table[fieldName];
54
+ if (fieldPrefix) {
55
+ deletions.push(()=>delete table[fieldName]);
56
+ }
54
57
  if (field.type === 'array') {
55
58
  if (Array.isArray(fieldData)) {
56
59
  if (field.localized) {
@@ -71,12 +74,15 @@ const traverseFields = ({ blocks, config, dataRef, deletions, fieldPrefix, field
71
74
  deletions,
72
75
  fieldPrefix: '',
73
76
  fields: field.fields,
74
- texts,
75
77
  numbers,
76
78
  path: `${sanitizedPath}${field.name}.${row._order - 1}`,
77
79
  relationships,
78
- table: row
80
+ table: row,
81
+ texts
79
82
  });
83
+ if ('_order' in rowResult) {
84
+ delete rowResult._order;
85
+ }
80
86
  arrayResult[locale].push(rowResult);
81
87
  }
82
88
  return arrayResult;
@@ -87,6 +93,9 @@ const traverseFields = ({ blocks, config, dataRef, deletions, fieldPrefix, field
87
93
  row.id = row._uuid;
88
94
  delete row._uuid;
89
95
  }
96
+ if ('_order' in row) {
97
+ delete row._order;
98
+ }
90
99
  return traverseFields({
91
100
  blocks,
92
101
  config,
@@ -94,11 +103,11 @@ const traverseFields = ({ blocks, config, dataRef, deletions, fieldPrefix, field
94
103
  deletions,
95
104
  fieldPrefix: '',
96
105
  fields: field.fields,
97
- texts,
98
106
  numbers,
99
107
  path: `${sanitizedPath}${field.name}.${i}`,
100
108
  relationships,
101
- table: row
109
+ table: row,
110
+ texts
102
111
  });
103
112
  });
104
113
  }
@@ -132,11 +141,11 @@ const traverseFields = ({ blocks, config, dataRef, deletions, fieldPrefix, field
132
141
  deletions,
133
142
  fieldPrefix: '',
134
143
  fields: block.fields,
135
- texts,
136
144
  numbers,
137
145
  path: `${blockFieldPath}.${row._order - 1}`,
138
146
  relationships,
139
- table: row
147
+ table: row,
148
+ texts
140
149
  });
141
150
  delete blockResult._order;
142
151
  return blockResult;
@@ -160,11 +169,11 @@ const traverseFields = ({ blocks, config, dataRef, deletions, fieldPrefix, field
160
169
  deletions,
161
170
  fieldPrefix: '',
162
171
  fields: block.fields,
163
- texts,
164
172
  numbers,
165
173
  path: `${blockFieldPath}.${i}`,
166
174
  relationships,
167
- table: row
175
+ table: row,
176
+ texts
168
177
  });
169
178
  }
170
179
  return {};
@@ -229,15 +238,15 @@ const traverseFields = ({ blocks, config, dataRef, deletions, fieldPrefix, field
229
238
  (0, _hasManyText.transformHasManyText)({
230
239
  field,
231
240
  locale,
232
- textRows: texts,
233
- ref: result
241
+ ref: result,
242
+ textRows: texts
234
243
  });
235
244
  });
236
245
  } else {
237
246
  (0, _hasManyText.transformHasManyText)({
238
247
  field,
239
- textRows: textPathMatch,
240
- ref: result
248
+ ref: result,
249
+ textRows: textPathMatch
241
250
  });
242
251
  }
243
252
  return result;
@@ -323,13 +332,16 @@ const traverseFields = ({ blocks, config, dataRef, deletions, fieldPrefix, field
323
332
  deletions,
324
333
  fieldPrefix: groupFieldPrefix,
325
334
  fields: field.fields,
326
- texts,
327
335
  numbers,
328
336
  path: `${sanitizedPath}${field.name}`,
329
337
  relationships,
330
- table
338
+ table,
339
+ texts
331
340
  });
332
341
  });
342
+ if ('_order' in ref) {
343
+ delete ref._order;
344
+ }
333
345
  } else {
334
346
  const groupData = {};
335
347
  ref[field.name] = traverseFields({
@@ -339,12 +351,15 @@ const traverseFields = ({ blocks, config, dataRef, deletions, fieldPrefix, field
339
351
  deletions,
340
352
  fieldPrefix: groupFieldPrefix,
341
353
  fields: field.fields,
342
- texts,
343
354
  numbers,
344
355
  path: `${sanitizedPath}${field.name}`,
345
356
  relationships,
346
- table
357
+ table,
358
+ texts
347
359
  });
360
+ if ('_order' in ref) {
361
+ delete ref._order;
362
+ }
348
363
  }
349
364
  break;
350
365
  }
@@ -411,4 +426,4 @@ const traverseFields = ({ blocks, config, dataRef, deletions, fieldPrefix, field
411
426
  return formatted;
412
427
  };
413
428
 
414
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90cmFuc2Zvcm0vcmVhZC90cmF2ZXJzZUZpZWxkcy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKiBlc2xpbnQtZGlzYWJsZSBuby1wYXJhbS1yZWFzc2lnbiAqL1xuaW1wb3J0IHR5cGUgeyBTYW5pdGl6ZWRDb25maWcgfSBmcm9tICdwYXlsb2FkL2NvbmZpZydcbmltcG9ydCB0eXBlIHsgRmllbGQsIFRhYkFzRmllbGQgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgeyBmaWVsZEFmZmVjdHNEYXRhIH0gZnJvbSAncGF5bG9hZC90eXBlcydcblxuaW1wb3J0IHR5cGUgeyBCbG9ja3NNYXAgfSBmcm9tICcuLi8uLi91dGlsaXRpZXMvY3JlYXRlQmxvY2tzTWFwJ1xuXG5pbXBvcnQgeyB0cmFuc2Zvcm1IYXNNYW55TnVtYmVyIH0gZnJvbSAnLi9oYXNNYW55TnVtYmVyJ1xuaW1wb3J0IHsgdHJhbnNmb3JtUmVsYXRpb25zaGlwIH0gZnJvbSAnLi9yZWxhdGlvbnNoaXAnXG5pbXBvcnQgeyB0cmFuc2Zvcm1IYXNNYW55VGV4dCB9IGZyb20gJy4vaGFzTWFueVRleHQnXG5cbnR5cGUgVHJhdmVyc2VGaWVsZHNBcmdzID0ge1xuICAvKipcbiAgICogUHJlLWZvcm1hdHRlZCBibG9ja3MgbWFwXG4gICAqL1xuICBibG9ja3M6IEJsb2Nrc01hcFxuICAvKipcbi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UoKHJlc3VsdCwgZmllbGQpID0+IHtcbiAgICBpZiAoZmllbGQudHlwZSA9PT0gJ3RhYnMnKSB7XG4gICAgICB0cmF2ZXJzZUZpZWxkcyh7XG4gICAgICAgIGJsb2NrcyxcbiAgICAgICAgY29uZmlnLFxuICAgICAgICBkYXRhUmVmLFxuICAgICAgICBkZWxldGlvbnMsXG4gICAgICAgIGZpZWxkUHJlZml4LFxuICAgICAgICBmaWVsZHM6IGZpZWxkLnRhYnMubWFwKCh0YWIpID0+ICh7IC4uLnRhYiwgdHlwZTogJ3RhYicgfSkpLFxuICAgICAgICB0ZXh0cyxcbiAgICAgICAgbnVtYmVycyxcbiAgICAgICAgcGF0aCxcbiAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgdGFibGUsXG4gICAgICB9KVxuICAgIH1cblxuICAgIGlmIChcbiAgICAgIGZpZWxkLnR5cGUgPT09ICdjb2xsYXBzaWJsZScgfHxcbiAgICAgIGZpZWxkLnR5cGUgPT09ICdyb3cnIHx8XG4gICAgICAoZmllbGQudHlwZSA9PT0gJ3RhYicgJiYgISgnbmFtZScgaW4gZmllbGQpKVxuICAgICkge1xuICAgICAgdHJhdmVyc2VGaWVsZHMoe1xuICAgICAgICBibG9ja3MsXG4gICAgICAgIGNvbmZpZyxcbiAgICAgICAgZGF0YVJlZixcbiAgICAgICAgZGVsZXRpb25zLFxuICAgICAgICBmaWVsZFByZWZpeCxcbiAgICAgICAgZmllbGRzOiBmaWVsZC5maWVsZHMsXG4gICAgICAgIHRleHRzLFxuICAgICAgICBudW1iZXJzLFxuICAgICAgICBwYXRoLFxuICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICB0YWJsZSxcbiAgICAgIH0pXG4gICAgfVxuXG4gICAgaWYgKGZpZWxkQWZmZWN0c0RhdGEoZmllbGQpKSB7XG4gICAgICBjb25zdCBmaWVsZE5hbWUgPSBgJHtmaWVsZFByZWZpeCB8fCAnJ30ke2ZpZWxkLm5hbWV9YFxuICAgICAgY29uc3QgZmllbGREYXRhID0gdGFibGVbZmllbGROYW1lXVxuICAgICAgaWYgKGZpZWxkLnR5cGUgPT09ICdhcnJheScpIHtcbiAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoZmllbGREYXRhKSkge1xuICAgICAgICAgIGlmIChmaWVsZC5sb2NhbGl6ZWQpIHtcbiAgICAgICAgICAgIHJlc3VsdFtmaWVsZC5uYW1lXSA9IGZpZWxkRGF0YS5yZWR1Y2UoKGFycmF5UmVzdWx0LCByb3cpID0+IHtcbiAgICAgICAgICAgICAgaWYgKHR5cGVvZiByb3cuX2xvY2FsZSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICBpZiAoIWFycmF5UmVzdWx0W3Jvdy5fbG9jYWxlXSkgYXJyYXlSZXN1bHRbcm93Ll9sb2NhbGVdID0gW11cbiAgICAgICAgICAgICAgICBjb25zdCBsb2NhbGUgPSByb3cuX2xvY2FsZVxuICAgICAgICAgICAgICAgIGNvbnN0IGRhdGEgPSB7fVxuICAgICAgICAgICAgICAgIGRlbGV0ZSByb3cuX2xvY2FsZVxuICAgICAgICAgICAgICAgIGlmIChyb3cuX3V1aWQpIHtcbiAgICAgICAgICAgICAgICAgIHJvdy5pZCA9IHJvdy5fdXVpZFxuICAgICAgICAgICAgICAgICAgZGVsZXRlIHJvdy5fdXVpZFxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGNvbnN0IHJvd1Jlc3VsdCA9IHRyYXZlcnNlRmllbGRzPFQ+KHtcbiAgICAgICAgICAgICAgICAgIGJsb2NrcyxcbiAgICAgICAgICAgICAgICAgIGNvbmZpZyxcbiAgICAgICAgICAgICAgICAgIGRhdGFSZWY6IGRhdGEsXG4gICAgICAgICAgICAgICAgICBkZWxldGlvbnMsXG4gICAgICAgICAgICAgICAgICBmaWVsZFByZWZpeDogJycsXG4gICAgICAgICAgICAgICAgICBmaWVsZHM6IGZpZWxkLmZpZWxkcyxcbiAgICAgICAgICAgICAgICAgIHRleHRzLFxuICAgICAgICAgICAgICAgICAgbnVtYmVycyxcbiAgICAgICAgICAgICAgICAgIHBhdGg6IGAke3Nhbml0aXplZFBhdGh9JHtmaWVsZC5uYW1lfS4ke3Jvdy5fb3JkZXIgLSAxfWAsXG4gICAgICAgICAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICAgICAgICAgICAgdGFibGU6IHJvdyxcbiAgICAgICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAgICAgYXJyYXlSZXN1bHRbbG9jYWxlXS5wdXNoKHJvd1Jlc3VsdClcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHJldHVybiBhcnJheVJlc3VsdFxuICAgICAgICAgICAgfSwge30pXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlc3VsdFtmaWVsZC5uYW1lXSA9IGZpZWxkRGF0YS5tYXAoKHJvdywgaSkgPT4ge1xuICAgICAgICAgICAgICBpZiAocm93Ll91dWlkKSB7XG4gICAgICAgICAgICAgICAgcm93LmlkID0gcm93Ll91dWlkXG4gICAgICAgICAgICAgICAgZGVsZXRlIHJvdy5fdXVpZFxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHJldHVybiB0cmF2ZXJzZUZpZWxkczxUPih7XG4gICAgICAgICAgICAgICAgYmxvY2tzLFxuICAgICAgICAgICAgICAgIGNvbmZpZyxcbiAgICAgICAgICAgICAgICBkYXRhUmVmOiByb3csXG4gICAgICAgICAgICAgICAgZGVsZXRpb25zLFxuICAgICAgICAgICAgICAgIGZpZWxkUHJlZml4OiAnJyxcbiAgICAgICAgICAgICAgICBmaWVsZHM6IGZpZWxkLmZpZWxkcyxcbiAgICAgICAgICAgICAgICB0ZXh0cyxcbiAgICAgICAgICAgICAgICBudW1iZXJzLFxuICAgICAgICAgICAgICAgIHBhdGg6IGAke3Nhbml0aXplZFBhdGh9JHtmaWVsZC5uYW1lfS4ke2l9YCxcbiAgICAgICAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICAgICAgICAgIHRhYmxlOiByb3csXG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiByZXN1bHRcbiAgICAgIH1cblxuICAgICAgaWYgKGZpZWxkLnR5cGUgPT09ICdibG9ja3MnKSB7XG4gICAgICAgIGNvbnN0IGJsb2NrRmllbGRQYXRoID0gYCR7c2FuaXRpemVkUGF0aH0ke2ZpZWxkLm5hbWV9YFxuXG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KGJsb2Nrc1tibG9ja0ZpZWxkUGF0aF0pKSB7XG4gICAgICAgICAgaWYgKGZpZWxkLmxvY2FsaXplZCkge1xuICAgICAgICAgICAgcmVzdWx0W2ZpZWxkLm5hbWVdID0ge31cblxuICAgICAgICAgICAgYmxvY2tzW2Jsb2NrRmllbGRQYXRoXS5mb3JFYWNoKChyb3cpID0+IHtcbiAgICAgICAgICAgICAgaWYgKHJvdy5fdXVpZCkge1xuICAgICAgICAgICAgICAgIHJvdy5pZCA9IHJvdy5fdXVpZFxuICAgICAgICAgICAgICAgIGRlbGV0ZSByb3cuX3V1aWRcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAodHlwZW9mIHJvdy5fbG9jYWxlID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgIGlmICghcmVzdWx0W2ZpZWxkLm5hbWVdW3Jvdy5fbG9jYWxlXSkgcmVzdWx0W2ZpZWxkLm5hbWVdW3Jvdy5fbG9jYWxlXSA9IFtdXG4gICAgICAgICAgICAgICAgcmVzdWx0W2ZpZWxkLm5hbWVdW3Jvdy5fbG9jYWxlXS5wdXNoKHJvdylcbiAgICAgICAgICAgICAgICBkZWxldGUgcm93Ll9sb2NhbGVcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgT2JqZWN0LmVudHJpZXMocmVzdWx0W2ZpZWxkLm5hbWVdKS5mb3JFYWNoKChbbG9jYWxlLCBsb2NhbGl6ZWRCbG9ja3NdKSA9PiB7XG4gICAgICAgICAgICAgIHJlc3VsdFtmaWVsZC5uYW1lXVtsb2NhbGVdID0gbG9jYWxpemVkQmxvY2tzLm1hcCgocm93KSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgYmxvY2sgPSBmaWVsZC5ibG9ja3MuZmluZCgoeyBzbHVnIH0pID0+IHNsdWcgPT09IHJvdy5ibG9ja1R5cGUpXG5cbiAgICAgICAgICAgICAgICBpZiAoYmxvY2spIHtcbiAgICAgICAgICAgICAgICAgIGNvbnN0IGJsb2NrUmVzdWx0ID0gdHJhdmVyc2VGaWVsZHM8VD4oe1xuICAgICAgICAgICAgICAgICAgICBibG9ja3MsXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZyxcbiAgICAgICAgICAgICAgICAgICAgZGF0YVJlZjogcm93LFxuICAgICAgICAgICAgICAgICAgICBkZWxldGlvbnMsXG4gICAgICAgICAgICAgICAgICAgIGZpZWxkUHJlZml4OiAnJyxcbiAgICAgICAgICAgICAgICAgICAgZmllbGRzOiBibG9jay5maWVsZHMsXG4gICAgICAgICAgICAgICAgICAgIHRleHRzLFxuICAgICAgICAgICAgICAgICAgICBudW1iZXJzLFxuICAgICAgICAgICAgICAgICAgICBwYXRoOiBgJHtibG9ja0ZpZWxkUGF0aH0uJHtyb3cuX29yZGVyIC0gMX1gLFxuICAgICAgICAgICAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICAgICAgICAgICAgICB0YWJsZTogcm93LFxuICAgICAgICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgICAgICAgZGVsZXRlIGJsb2NrUmVzdWx0Ll9vcmRlclxuICAgICAgICAgICAgICAgICAgcmV0dXJuIGJsb2NrUmVzdWx0XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgcmV0dXJuIHt9XG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXN1bHRbZmllbGQubmFtZV0gPSBibG9ja3NbYmxvY2tGaWVsZFBhdGhdLm1hcCgocm93LCBpKSA9PiB7XG4gICAgICAgICAgICAgIGRlbGV0ZSByb3cuX29yZGVyXG4gICAgICAgICAgICAgIGlmIChyb3cuX3V1aWQpIHtcbiAgICAgICAgICAgICAgICByb3cuaWQgPSByb3cuX3V1aWRcbiAgICAgICAgICAgICAgICBkZWxldGUgcm93Ll91dWlkXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgY29uc3QgYmxvY2sgPSBmaWVsZC5ibG9ja3MuZmluZCgoeyBzbHVnIH0pID0+IHNsdWcgPT09IHJvdy5ibG9ja1R5cGUpXG5cbiAgICAgICAgICAgICAgaWYgKGJsb2NrKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRyYXZlcnNlRmllbGRzPFQ+KHtcbiAgICAgICAgICAgICAgICAgIGJsb2NrcyxcbiAgICAgICAgICAgICAgICAgIGNvbmZpZyxcbiAgICAgICAgICAgICAgICAgIGRhdGFSZWY6IHJvdyxcbiAgICAgICAgICAgICAgICAgIGRlbGV0aW9ucyxcbiAgICAgICAgICAgICAgICAgIGZpZWxkUHJlZml4OiAnJyxcbiAgICAgICAgICAgICAgICAgIGZpZWxkczogYmxvY2suZmllbGRzLFxuICAgICAgICAgICAgICAgICAgdGV4dHMsXG4gICAgICAgICAgICAgICAgICBudW1iZXJzLFxuICAgICAgICAgICAgICAgICAgcGF0aDogYCR7YmxvY2tGaWVsZFBhdGh9LiR7aX1gLFxuICAgICAgICAgICAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgICAgICAgICAgIHRhYmxlOiByb3csXG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHJldHVybiB7fVxuICAgICAgICAgICAgfSlcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcmVzdWx0XG4gICAgICB9XG5cbiAgICAgIGlmIChmaWVsZC50eXBlID09PSAncmVsYXRpb25zaGlwJyB8fCBmaWVsZC50eXBlID09PSAndXBsb2FkJykge1xuICAgICAgICBjb25zdCByZWxhdGlvblBhdGhNYXRjaCA9IHJlbGF0aW9uc2hpcHNbYCR7c2FuaXRpemVkUGF0aH0ke2ZpZWxkLm5hbWV9YF1cbiAgICAgICAgaWYgKCFyZWxhdGlvblBhdGhNYXRjaCkge1xuICAgICAgICAgIGlmICgnaGFzTWFueScgaW4gZmllbGQgJiYgZmllbGQuaGFzTWFueSkge1xuICAgICAgICAgICAgaWYgKGZpZWxkLmxvY2FsaXplZCAmJiBjb25maWcubG9jYWxpemF0aW9uICYmIGNvbmZpZy5sb2NhbGl6YXRpb24ubG9jYWxlcykge1xuICAgICAgICAgICAgICByZXN1bHRbZmllbGQubmFtZV0gPSB7XG4gICAgICAgICAgICAgICAgW2NvbmZpZy5sb2NhbGl6YXRpb24uZGVmYXVsdExvY2FsZV06IFtdLFxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByZXN1bHRbZmllbGQubmFtZV0gPSBbXVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybiByZXN1bHRcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChmaWVsZC5sb2NhbGl6ZWQpIHtcbiAgICAgICAgICByZXN1bHRbZmllbGQubmFtZV0gPSB7fVxuICAgICAgICAgIGNvbnN0IHJlbGF0aW9uc0J5TG9jYWxlOiBSZWNvcmQ8c3RyaW5nLCBSZWNvcmQ8c3RyaW5nLCB1bmtub3duPltdPiA9IHt9XG5cbiAgICAgICAgICByZWxhdGlvblBhdGhNYXRjaC5mb3JFYWNoKChyb3cpID0+IHtcbiAgICAgICAgICAgIGlmICh0eXBlb2Ygcm93LmxvY2FsZSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgaWYgKCFyZWxhdGlvbnNCeUxvY2FsZVtyb3cubG9jYWxlXSkgcmVsYXRpb25zQnlMb2NhbGVbcm93LmxvY2FsZV0gPSBbXVxuICAgICAgICAgICAgICByZWxhdGlvbnNCeUxvY2FsZVtyb3cubG9jYWxlXS5wdXNoKHJvdylcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgT2JqZWN0LmVudHJpZXMocmVsYXRpb25zQnlMb2NhbGUpLmZvckVhY2goKFtsb2NhbGUsIHJlbGF0aW9uc10pID0+IHtcbiAgICAgICAgICAgIHRyYW5zZm9ybVJlbGF0aW9uc2hpcCh7XG4gICAgICAgICAgICAgIGZpZWxkLFxuICAgICAgICAgICAgICBsb2NhbGUsXG4gICAgICAgICAgICAgIHJlZjogcmVzdWx0LFxuICAgICAgICAgICAgICByZWxhdGlvbnMsXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIH0pXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdHJhbnNmb3JtUmVsYXRpb25zaGlwKHtcbiAgICAgICAgICAgIGZpZWxkLFxuICAgICAgICAgICAgcmVmOiByZXN1bHQsXG4gICAgICAgICAgICByZWxhdGlvbnM6IHJlbGF0aW9uUGF0aE1hdGNoLFxuICAgICAgICAgIH0pXG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcmVzdWx0XG4gICAgICB9XG5cbiAgICAgIGlmIChmaWVsZC50eXBlID09PSAndGV4dCcgJiYgZmllbGQ/Lmhhc01hbnkpIHtcbiAgICAgICAgY29uc3QgdGV4dFBhdGhNYXRjaCA9IHRleHRzW2Ake3Nhbml0aXplZFBhdGh9JHtmaWVsZC5uYW1lfWBdXG4gICAgICAgIGlmICghdGV4dFBhdGhNYXRjaCkgcmV0dXJuIHJlc3VsdFxuXG4gICAgICAgIGlmIChmaWVsZC5sb2NhbGl6ZWQpIHtcbiAgICAgICAgICByZXN1bHRbZmllbGQubmFtZV0gPSB7fVxuICAgICAgICAgIGNvbnN0IHRleHRzQnlMb2NhbGU6IFJlY29yZDxzdHJpbmcsIFJlY29yZDxzdHJpbmcsIHVua25vd24+W10+ID0ge31cblxuICAgICAgICAgIHRleHRQYXRoTWF0Y2guZm9yRWFjaCgocm93KSA9PiB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHJvdy5sb2NhbGUgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgIGlmICghdGV4dHNCeUxvY2FsZVtyb3cubG9jYWxlXSkgdGV4dHNCeUxvY2FsZVtyb3cubG9jYWxlXSA9IFtdXG4gICAgICAgICAgICAgIHRleHRzQnlMb2NhbGVbcm93LmxvY2FsZV0ucHVzaChyb3cpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSlcblxuICAgICAgICAgIE9iamVjdC5lbnRyaWVzKHRleHRzQnlMb2NhbGUpLmZvckVhY2goKFtsb2NhbGUsIHRleHRzXSkgPT4ge1xuICAgICAgICAgICAgdHJhbnNmb3JtSGFzTWFueVRleHQoe1xuICAgICAgICAgICAgICBmaWVsZCxcbiAgICAgICAgICAgICAgbG9jYWxlLFxuICAgICAgICAgICAgICB0ZXh0Um93czogdGV4dHMsXG4gICAgICAgICAgICAgIHJlZjogcmVzdWx0LFxuICAgICAgICAgICAgfSlcbiAgICAgICAgICB9KVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRyYW5zZm9ybUhhc01hbnlUZXh0KHtcbiAgICAgICAgICAgIGZpZWxkLFxuICAgICAgICAgICAgdGV4dFJvd3M6IHRleHRQYXRoTWF0Y2gsXG4gICAgICAgICAgICByZWY6IHJlc3VsdCxcbiAgICAgICAgICB9KVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHJlc3VsdFxuICAgICAgfVxuXG4gICAgICBpZiAoZmllbGQudHlwZSA9PT0gJ251bWJlcicgJiYgZmllbGQuaGFzTWFueSkge1xuICAgICAgICBjb25zdCBudW1iZXJQYX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gdGFibGUuX2xvY2FsZVxuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgT2JqZWN0LmVudHJpZXMocmVmKS5mb3JFYWNoKChbZ3JvdXBMb2NhbGUsIGdyb3VwTG9jYWxlRGF0YV0pID0+IHtcbiAgICAgICAgICAgICAgICByZWZbZ3JvdXBMb2NhbGVdID0gdHJhdmVyc2VGaWVsZHM8UmVjb3JkPHN0cmluZywgdW5rbm93bj4+KHtcbiAgICAgICAgICAgICAgICAgIGJsb2NrcyxcbiAgICAgICAgICAgICAgICAgIGNvbmZpZyxcbiAgICAgICAgICAgICAgICAgIGRhdGFSZWY6IGdyb3VwTG9jYWxlRGF0YSBhcyBSZWNvcmQ8c3RyaW5nLCB1bmtub3duPixcbiAgICAgICAgICAgICAgICAgIGRlbGV0aW9ucyxcbiAgICAgICAgICAgICAgICAgIGZpZWxkUHJlZml4OiBncm91cEZpZWxkUHJlZml4LFxuICAgICAgICAgICAgICAgICAgZmllbGRzOiBmaWVsZC5maWVsZHMsXG4gICAgICAgICAgICAgICAgICB0ZXh0cyxcbiAgICAgICAgICAgICAgICAgIG51bWJlcnMsXG4gICAgICAgICAgICAgICAgICBwYXRoOiBgJHtzYW5pdGl6ZWRQYXRofSR7ZmllbGQubmFtZX1gLFxuICAgICAgICAgICAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgICAgICAgICAgIHRhYmxlLFxuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBjb25zdCBncm91cERhdGEgPSB7fVxuXG4gICAgICAgICAgICAgIHJlZltmaWVsZC5uYW1lXSA9IHRyYXZlcnNlRmllbGRzPFJlY29yZDxzdHJpbmcsIHVua25vd24+Pih7XG4gICAgICAgICAgICAgICAgYmxvY2tzLFxuICAgICAgICAgICAgICAgIGNvbmZpZyxcbiAgICAgICAgICAgICAgICBkYXRhUmVmOiBncm91cERhdGEgYXMgUmVjb3JkPHN0cmluZywgdW5rbm93bj4sXG4gICAgICAgICAgICAgICAgZGVsZXRpb25zLFxuICAgICAgICAgICAgICAgIGZpZWxkUHJlZml4OiBncm91cEZpZWxkUHJlZml4LFxuICAgICAgICAgICAgICAgIGZpZWxkczogZmllbGQuZmllbGRzLFxuICAgICAgICAgICAgICAgIHRleHRzLFxuICAgICAgICAgICAgICAgIG51bWJlcnMsXG4gICAgICAgICAgICAgICAgcGF0aDogYCR7c2FuaXRpemVkUGF0aH0ke2ZpZWxkLm5hbWV9YCxcbiAgICAgICAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICAgICAgICAgIHRhYmxlLFxuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBicmVha1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGNhc2UgJ3RleHQnOiB7XG4gICAgICAgICAgICBsZXQgdmFsID0gZmllbGREYXRhXG4gICAgICAgICAgICBpZiAodHlwZW9mIGZpZWxkRGF0YSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgdmFsID0gU3RyaW5nKGZpZWxkRGF0YSlcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHR5cGVvZiBsb2NhbGUgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgIHJlZltsb2NhbGVdID0gdmFsXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByZXN1bHRbZmllbGQubmFtZV0gPSB2YWxcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBjYXNlICdudW1iZXInOiB7XG4gICAgICAgICAgICBsZXQgdmFsID0gZmllbGREYXRhXG4gICAgICAgICAgICBpZiAodHlwZW9mIGZpZWxkRGF0YSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgdmFsID0gTnVtYmVyLnBhcnNlRmxvYXQoZmllbGREYXRhKVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodHlwZW9mIGxvY2FsZSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgcmVmW2xvY2FsZV0gPSB2YWxcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHJlc3VsdFtmaWVsZC5uYW1lXSA9IHZhbFxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBicmVha1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGNhc2UgJ2RhdGUnOiB7XG4gICAgICAgICAgICBsZXQgdmFsID0gZmllbGREYXRhXG5cbiAgICAgICAgICAgIGlmICh0eXBlb2YgZmllbGREYXRhID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICB2YWwgPSBuZXcgRGF0ZShmaWVsZERhdGEpLnRvSVNPU3RyaW5nKClcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHR5cGVvZiBsb2NhbGUgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgIHJlZltsb2NhbGVdID0gdmFsXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByZXN1bHRbZmllbGQubmFtZV0gPSB2YWxcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBkZWZhdWx0OiB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIGxvY2FsZSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgcmVmW2xvY2FsZV0gPSBmaWVsZERhdGFcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHJlc3VsdFtmaWVsZC5uYW1lXSA9IGZpZWxkRGF0YVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBicmVha1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSlcblxuICAgICAgaWYgKE9iamVjdC5rZXlzKGxvY2FsaXplZEZpZWxkRG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gPT09ICdyb3cnIHx8XG4gICAgICAoZmllbGQudHlwZSA9PT0gJ3RhYicgJiYgISgnbmFtZScgaW4gZmllbGQpKVxuICAgICkge1xuICAgICAgdHJhdmVyc2VGaWVsZHMoe1xuICAgICAgICBibG9ja3MsXG4gICAgICAgIGNvbmZpZyxcbiAgICAgICAgZGF0YVJlZixcbiAgICAgICAgZGVsZXRpb25zLFxuICAgICAgICBmaWVsZFByZWZpeCxcbiAgICAgICAgZmllbGRzOiBmaWVsZC5maWVsZHMsXG4gICAgICAgIG51bWJlcnMsXG4gICAgICAgIHBhdGgsXG4gICAgICAgIHJlbGF0aW9uc2hpcHMsXG4gICAgICAgIHRhYmxlLFxuICAgICAgICB0ZXh0cyxcbiAgICAgIH0pXG4gICAgfVxuXG4gICAgaWYgKGZpZWxkQWZmZWN0c0RhdGEoZmllbGQpKSB7XG4gICAgICBjb25zdCBmaWVsZE5hbWUgPSBgJHtmaWVsZFByZWZpeCB8fCAnJ30ke2ZpZWxkLm5hbWV9YFxuICAgICAgY29uc3QgZmllbGREYXRhID0gdGFibGVbZmllbGROYW1lXVxuXG4gICAgICBpZiAoZmllbGRQcmVmaXgpIHtcbiAgICAgICAgZGVsZXRpb25zLnB1c2goKCkgPT4gZGVsZXRlIHRhYmxlW2ZpZWxkTmFtZV0pXG4gICAgICB9XG5cbiAgICAgIGlmIChmaWVsZC50eXBlID09PSAnYXJyYXknKSB7XG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KGZpZWxkRGF0YSkpIHtcbiAgICAgICAgICBpZiAoZmllbGQubG9jYWxpemVkKSB7XG4gICAgICAgICAgICByZXN1bHRbZmllbGQubmFtZV0gPSBmaWVsZERhdGEucmVkdWNlKChhcnJheVJlc3VsdCwgcm93KSA9PiB7XG4gICAgICAgICAgICAgIGlmICh0eXBlb2Ygcm93Ll9sb2NhbGUgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFhcnJheVJlc3VsdFtyb3cuX2xvY2FsZV0pIGFycmF5UmVzdWx0W3Jvdy5fbG9jYWxlXSA9IFtdXG4gICAgICAgICAgICAgICAgY29uc3QgbG9jYWxlID0gcm93Ll9sb2NhbGVcbiAgICAgICAgICAgICAgICBjb25zdCBkYXRhID0ge31cbiAgICAgICAgICAgICAgICBkZWxldGUgcm93Ll9sb2NhbGVcbiAgICAgICAgICAgICAgICBpZiAocm93Ll91dWlkKSB7XG4gICAgICAgICAgICAgICAgICByb3cuaWQgPSByb3cuX3V1aWRcbiAgICAgICAgICAgICAgICAgIGRlbGV0ZSByb3cuX3V1aWRcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBjb25zdCByb3dSZXN1bHQgPSB0cmF2ZXJzZUZpZWxkczxUPih7XG4gICAgICAgICAgICAgICAgICBibG9ja3MsXG4gICAgICAgICAgICAgICAgICBjb25maWcsXG4gICAgICAgICAgICAgICAgICBkYXRhUmVmOiBkYXRhLFxuICAgICAgICAgICAgICAgICAgZGVsZXRpb25zLFxuICAgICAgICAgICAgICAgICAgZmllbGRQcmVmaXg6ICcnLFxuICAgICAgICAgICAgICAgICAgZmllbGRzOiBmaWVsZC5maWVsZHMsXG4gICAgICAgICAgICAgICAgICBudW1iZXJzLFxuICAgICAgICAgICAgICAgICAgcGF0aDogYCR7c2FuaXRpemVkUGF0aH0ke2ZpZWxkLm5hbWV9LiR7cm93Ll9vcmRlciAtIDF9YCxcbiAgICAgICAgICAgICAgICAgIHJlbGF0aW9uc2hpcHMsXG4gICAgICAgICAgICAgICAgICB0YWJsZTogcm93LFxuICAgICAgICAgICAgICAgICAgdGV4dHMsXG4gICAgICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgICAgIGlmICgnX29yZGVyJyBpbiByb3dSZXN1bHQpIHtcbiAgICAgICAgICAgICAgICAgIGRlbGV0ZSByb3dSZXN1bHQuX29yZGVyXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgYXJyYXlSZXN1bHRbbG9jYWxlXS5wdXNoKHJvd1Jlc3VsdClcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHJldHVybiBhcnJheVJlc3VsdFxuICAgICAgICAgICAgfSwge30pXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlc3VsdFtmaWVsZC5uYW1lXSA9IGZpZWxkRGF0YS5tYXAoKHJvdywgaSkgPT4ge1xuICAgICAgICAgICAgICBpZiAocm93Ll91dWlkKSB7XG4gICAgICAgICAgICAgICAgcm93LmlkID0gcm93Ll91dWlkXG4gICAgICAgICAgICAgICAgZGVsZXRlIHJvdy5fdXVpZFxuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgaWYgKCdfb3JkZXInIGluIHJvdykge1xuICAgICAgICAgICAgICAgIGRlbGV0ZSByb3cuX29yZGVyXG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICByZXR1cm4gdHJhdmVyc2VGaWVsZHM8VD4oe1xuICAgICAgICAgICAgICAgIGJsb2NrcyxcbiAgICAgICAgICAgICAgICBjb25maWcsXG4gICAgICAgICAgICAgICAgZGF0YVJlZjogcm93LFxuICAgICAgICAgICAgICAgIGRlbGV0aW9ucyxcbiAgICAgICAgICAgICAgICBmaWVsZFByZWZpeDogJycsXG4gICAgICAgICAgICAgICAgZmllbGRzOiBmaWVsZC5maWVsZHMsXG4gICAgICAgICAgICAgICAgbnVtYmVycyxcbiAgICAgICAgICAgICAgICBwYXRoOiBgJHtzYW5pdGl6ZWRQYXRofSR7ZmllbGQubmFtZX0uJHtpfWAsXG4gICAgICAgICAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgICAgICAgICB0YWJsZTogcm93LFxuICAgICAgICAgICAgICAgIHRleHRzLFxuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgfSlcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcmVzdWx0XG4gICAgICB9XG5cbiAgICAgIGlmIChmaWVsZC50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gIGNvbnN0IGJsb2NrID0gZmllbGQuYmxvY2tzLmZpbmQoKHsgc2x1ZyB9KSA9PiBzbHVnID09PSByb3cuYmxvY2tUeXBlKVxuXG4gICAgICAgICAgICAgICAgaWYgKGJsb2NrKSB7XG4gICAgICAgICAgICAgICAgICBjb25zdCBibG9ja1Jlc3VsdCA9IHRyYXZlcnNlRmllbGRzPFQ+KHtcbiAgICAgICAgICAgICAgICAgICAgYmxvY2tzLFxuICAgICAgICAgICAgICAgICAgICBjb25maWcsXG4gICAgICAgICAgICAgICAgICAgIGRhdGFSZWY6IHJvdyxcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRpb25zLFxuICAgICAgICAgICAgICAgICAgICBmaWVsZFByZWZpeDogJycsXG4gICAgICAgICAgICAgICAgICAgIGZpZWxkczogYmxvY2suZmllbGRzLFxuICAgICAgICAgICAgICAgICAgICBudW1iZXJzLFxuICAgICAgICAgICAgICAgICAgICBwYXRoOiBgJHtibG9ja0ZpZWxkUGF0aH0uJHtyb3cuX29yZGVyIC0gMX1gLFxuICAgICAgICAgICAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICAgICAgICAgICAgICB0YWJsZTogcm93LFxuICAgICAgICAgICAgICAgICAgICB0ZXh0cyxcbiAgICAgICAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgICAgICAgIGRlbGV0ZSBibG9ja1Jlc3VsdC5fb3JkZXJcbiAgICAgICAgICAgICAgICAgIHJldHVybiBibG9ja1Jlc3VsdFxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHJldHVybiB7fVxuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgfSlcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmVzdWx0W2ZpZWxkLm5hbWVdID0gYmxvY2tzW2Jsb2NrRmllbGRQYXRoXS5tYXAoKHJvdywgaSkgPT4ge1xuICAgICAgICAgICAgICBkZWxldGUgcm93Ll9vcmRlclxuICAgICAgICAgICAgICBpZiAocm93Ll91dWlkKSB7XG4gICAgICAgICAgICAgICAgcm93LmlkID0gcm93Ll91dWlkXG4gICAgICAgICAgICAgICAgZGVsZXRlIHJvdy5fdXVpZFxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGNvbnN0IGJsb2NrID0gZmllbGQuYmxvY2tzLmZpbmQoKHsgc2x1ZyB9KSA9PiBzbHVnID09PSByb3cuYmxvY2tUeXBlKVxuXG4gICAgICAgICAgICAgIGlmIChibG9jaykge1xuICAgICAgICAgICAgICAgIHJldHVybiB0cmF2ZXJzZUZpZWxkczxUPih7XG4gICAgICAgICAgICAgICAgICBibG9ja3MsXG4gICAgICAgICAgICAgICAgICBjb25maWcsXG4gICAgICAgICAgICAgICAgICBkYXRhUmVmOiByb3csXG4gICAgICAgICAgICAgICAgICBkZWxldGlvbnMsXG4gICAgICAgICAgICAgICAgICBmaWVsZFByZWZpeDogJycsXG4gICAgICAgICAgICAgICAgICBmaWVsZHM6IGJsb2NrLmZpZWxkcyxcbiAgICAgICAgICAgICAgICAgIG51bWJlcnMsXG4gICAgICAgICAgICAgICAgICBwYXRoOiBgJHtibG9ja0ZpZWxkUGF0aH0uJHtpfWAsXG4gICAgICAgICAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICAgICAgICAgICAgdGFibGU6IHJvdyxcbiAgICAgICAgICAgICAgICAgIHRleHRzLFxuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICByZXR1cm4ge31cbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHJlc3VsdFxuICAgICAgfVxuXG4gICAgICBpZiAoZmllbGQudHlwZSA9PT0gJ3JlbGF0aW9uc2hpcCcgfHwgZmllbGQudHlwZSA9PT0gJ3VwbG9hZCcpIHtcbiAgICAgICAgY29uc3QgcmVsYXRpb25QYXRoTWF0Y2ggPSByZWxhdGlvbnNoaXBzW2Ake3Nhbml0aXplZFBhdGh9JHtmaWVsZC5uYW1lfWBdXG4gICAgICAgIGlmICghcmVsYXRpb25QYXRoTWF0Y2gpIHtcbiAgICAgICAgICBpZiAoJ2hhc01hbnknIGluIGZpZWxkICYmIGZpZWxkLmhhc01hbnkpIHtcbiAgICAgICAgICAgIGlmIChmaWVsZC5sb2NhbGl6ZWQgJiYgY29uZmlnLmxvY2FsaXphdGlvbiAmJiBjb25maWcubG9jYWxpemF0aW9uLmxvY2FsZXMpIHtcbiAgICAgICAgICAgICAgcmVzdWx0W2ZpZWxkLm5hbWVdID0ge1xuICAgICAgICAgICAgICAgIFtjb25maWcubG9jYWxpemF0aW9uLmRlZmF1bHRMb2NhbGVdOiBbXSxcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcmVzdWx0W2ZpZWxkLm5hbWVdID0gW11cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICByZXR1cm4gcmVzdWx0XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoZmllbGQubG9jYWxpemVkKSB7XG4gICAgICAgICAgcmVzdWx0W2ZpZWxkLm5hbWVdID0ge31cbiAgICAgICAgICBjb25zdCByZWxhdGlvbnNCeUxvY2FsZTogUmVjb3JkPHN0cmluZywgUmVjb3JkPHN0cmluZywgdW5rbm93bj5bXT4gPSB7fVxuXG4gICAgICAgICAgcmVsYXRpb25QYXRoTWF0Y2guZm9yRWFjaCgocm93KSA9PiB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHJvdy5sb2NhbGUgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgIGlmICghcmVsYXRpb25zQnlMb2NhbGVbcm93LmxvY2FsZV0pIHJlbGF0aW9uc0J5TG9jYWxlW3Jvdy5sb2NhbGVdID0gW11cbiAgICAgICAgICAgICAgcmVsYXRpb25zQnlMb2NhbGVbcm93LmxvY2FsZV0ucHVzaChyb3cpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSlcblxuICAgICAgICAgIE9iamVjdC5lbnRyaWVzKHJlbGF0aW9uc0J5TG9jYWxlKS5mb3JFYWNoKChbbG9jYWxlLCByZWxhdGlvbnNdKSA9PiB7XG4gICAgICAgICAgICB0cmFuc2Zvcm1SZWxhdGlvbnNoaXAoe1xuICAgICAgICAgICAgICBmaWVsZCxcbiAgICAgICAgICAgICAgbG9jYWxlLFxuICAgICAgICAgICAgICByZWY6IHJlc3VsdCxcbiAgICAgICAgICAgICAgcmVsYXRpb25zLFxuICAgICAgICAgICAgfSlcbiAgICAgICAgICB9KVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRyYW5zZm9ybVJlbGF0aW9uc2hpcCh7XG4gICAgICAgICAgICBmaWVsZCxcbiAgICAgICAgICAgIHJlZjogcmVzdWx0LFxuICAgICAgICAgICAgcmVsYXRpb25zOiByZWxhdGlvblBhdGhNYXRjaCxcbiAgICAgICAgICB9KVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHJlc3VsdFxuICAgICAgfVxuXG4gICAgICBpZiAoZmllbGQudHlwZSA9PT0gJ3RleHQnICYmIGZpZWxkPy5oYXNNYW55KSB7XG4gICAgICAgIGNvbnN0IHRleHRQYXRoTWF0Y2ggPSB0ZXh0c1tgJHtzYW5pdGl6ZWRQYXRofSR7ZmllbGQubmFtZX1gXVxuICAgICAgICBpZiAoIXRleHRQYXRoTWF0Y2gpIHJldHVybiByZXN1bHRcblxuICAgICAgICBpZiAoZmllbGQubG9jYWxpemVkKSB7XG4gICAgICAgICAgcmVzdWx0W2ZpZWxkLm5hbWVdID0ge31cbiAgICAgICAgICBjb25zdCB0ZXh0c0J5TG9jYWxlOiBSZWNvcmQ8c3RyaW5nLCBSZWNvcmQ8c3RyaW5nLCB1bmtub3duPltdPiA9IHt9XG5cbiAgICAgICAgICB0ZXh0UGF0aE1hdGNoLmZvckVhY2goKHJvdykgPT4ge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiByb3cubG9jYWxlID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICBpZiAoIXRleHRzQnlMb2NhbGVbcm93LmxvY2FsZV0pIHRleHRzQnlMb2NhbGVbcm93LmxvY2FsZV0gPSBbXVxuICAgICAgICAgICAgICB0ZXh0c0J5TG9jYWxlW3Jvdy5sb2NhbGVdLnB1c2gocm93KVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG5cbiAgICAgICAgICBPYmplY3QuZW50cmllcyh0ZXh0c0J5TG9jYWxlKS5mb3JFYWNoKChbbG9jYWxlLCB0ZXh0c10pID0+IHtcbiAgICAgICAgICAgIHRyYW5zZm9ybUhhc01hbnlUZXh0KHtcbiAgICAgICAgICAgICAgZmllbGQsXG4gICAgICAgICAgICAgIGxvY2FsZSxcbiAgICAgICAgICAgICAgcmVmOiByZXN1bHQsXG4gICAgICAgICAgICAgIHRleHRSb3dzOiB0ZXh0cyxcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgfSlcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB0cmFuc2Zvcm1IYXNNYW55VGV4dCh7XG4gICAgICAgICAgICBmaWVsZCxcbiAgICAgICAgICAgIHJlZjogcmVzdWx0LFxuICAgICAgICAgICAgdGV4dFJvd3M6IHRleHRQYXRoTWF0Y2gsXG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiByZXN1bHRcbiAgICAgIH1cblxuICAgICAgaWYgKGZpZWxkLnR5cGUgPT09ICdudW1iZXInICYmIGZpZWxkLmhhc01hbnkpIHtcbiAgICAgICAgY29uc3QgbnVtYmVyUGF0aE1hdGNoID0gbnVtYmVyc1tgJHtzYW5pdGl6ZWRQYXRofSR7ZmllbGQubmFtZX1gXVxuICAgICAgICBpZiAoIW51bWJlclBhdGhNYXRjaCkgcmV0dXJuIHJlc3VsdFxuXG4gICAgICAgIGlmIChmaWVsZC5sb2NhbGl6ZWQpIHtcbiAgICAgICAgICByZXN1bHRbZmllbGQubmFtZV0gPSB7fVxuICAgICAgICAgIGNvbnN0IG51bWJlcnNCeUxvY2FsZTogUmVjb3JkPHN0cmluZywgUmVjb3JkPHN0cmluZywgdW5rbm93bj5bXT4gPSB7fVxuXG4gICAgICAgICAgbnVtYmVyUGF0aE1hdGNoLmZvckVhY2goKHJvdykgPT4ge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiByb3cubG9jYWxlID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICBpZiAoIW51bWJlcnNCeUxvY2FsZVtyb3cubG9jYWxlXSkgbnVtYmVyc0J5TG9jYWxlW3Jvdy5sb2NhbGVdID0gW11cbiAgICAgICAgICAgICAgbnVtYmVyc0J5TG9jYWxlW3Jvdy5sb2NhbGVdLnB1c2gocm93KVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG5cbiAgICAgICAgICBPYmplY3QuZW50cmllcyhudW1iZXJzQnlMb2NhbGUpLmZvckVhY2goKFtsb2NhbGUsIG51bWJlcnNdKSA9PiB7XG4gICAgICAgICAgICB0cmFuc2Zvcm1IYXNNYW55TnVtYmVyKHtcbiAgICAgICAgICAgICAgZmllbGQsXG4gICAgICAgICAgICAgIGxvY2FsZSxcbiAgICAgICAgICAgICAgbnVtYmVyUm93czogbnVtYmVycyxcbiAgICAgICAgICAgICAgcmVmOiByZXN1bHQsXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIH0pXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdHJhbnNmb3JtSGFzTWFueU51bWJlcih7XG4gICAgICAgICAgICBmaWVsZCxcbiAgICAgICAgICAgIG51bWJlclJvd3M6IG51bWJlclBhdGhNYXRjaCxcbiAgICAgICAgICAgIHJlZjogcmVzdWx0LFxuICAgICAgICAgIH0pXG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcmVzdWx0XG4gICAgICB9XG5cbiAgICAgIGlmIChmaWVsZC50eXBlID09PSAnc2VsZWN0JyAmJiBmaWVsZC5oYXNNYW55KSB7XG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KGZpZWxkRGF0YSkpIHtcbiAgICAgICAgICBpZiAoZmllbGQubG9jYWxpemVkKSB7XG4gICAgICAgICAgICByZXN1bHRbZmllbGQubmFtZV0gPSBmaWVsZERhdGEucmVkdWNlKChzZWxlY3RSZXN1bHQsIHJvdykgPT4ge1xuICAgICAgICAgICAgICBpZiAodHlwZW9mIHJvdy5sb2NhbGUgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFzZWxlY3RSZXN1bHRbcm93LmxvY2FsZV0pIHNlbGVjdFJlc3VsdFtyb3cubG9jYWxlXSA9IFtdXG4gICAgICAgICAgICAgICAgc2VsZWN0UmVzdWx0W3Jvdy5sb2NhbGVdLnB1c2gocm93LnZhbHVlKVxuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgcmV0dXJuIHNlbGVjdFJlc3VsdFxuICAgICAgICAgICAgfSwge30pXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlc3VsdFtmaWVsZC5uYW1lXSA9IGZpZWxkRGF0YS5tYXAoKHsgdmFsdWUgfSkgPT4gdmFsdWUpXG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHRcbiAgICAgIH1cblxuICAgICAgY29uc3QgbG9jYWxpemVkRmllbGREYXRhID0ge31cbiAgICAgIGNvbnN0IHZhbHVlc1RvVHJhbnNmb3JtOiB7XG4gICAgICAgIHJlZjogUmVjb3JkPHN0cmluZywgdW5rbm93bj5cbiAgICAgICAgdGFibGU6IFJlY29yZDxzdHJpbmcsIHVua25vd24+XG4gICAgICB9W10gPSBbXVxuXG4gICAgICBpZiAoZmllbGQubG9jYWxpemVkICYmIEFycmF5LmlzQXJyYXkodGFibGUuX2xvY2FsZXMpKSB7XG4gICAgICAgIHRhYmxlLl9sb2NhbGVzLmZvckVhY2goKGxvY2FsZVJvd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DxzdHJpbmcsIHVua25vd24+Pih7XG4gICAgICAgICAgICAgICAgICBibG9ja3MsXG4gICAgICAgICAgICAgICAgICBjb25maWcsXG4gICAgICAgICAgICAgICAgICBkYXRhUmVmOiBncm91cExvY2FsZURhdGEgYXMgUmVjb3JkPHN0cmluZywgdW5rbm93bj4sXG4gICAgICAgICAgICAgICAgICBkZWxldGlvbnMsXG4gICAgICAgICAgICAgICAgICBmaWVsZFByZWZpeDogZ3JvdXBGaWVsZFByZWZpeCxcbiAgICAgICAgICAgICAgICAgIGZpZWxkczogZmllbGQuZmllbGRzLFxuICAgICAgICAgICAgICAgICAgbnVtYmVycyxcbiAgICAgICAgICAgICAgICAgIHBhdGg6IGAke3Nhbml0aXplZFBhdGh9JHtmaWVsZC5uYW1lfWAsXG4gICAgICAgICAgICAgICAgICByZWxhdGlvbnNoaXBzLFxuICAgICAgICAgICAgICAgICAgdGFibGUsXG4gICAgICAgICAgICAgICAgICB0ZXh0cyxcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICBpZiAoJ19vcmRlcicgaW4gcmVmKSB7XG4gICAgICAgICAgICAgICAgZGVsZXRlIHJlZi5fb3JkZXJcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgY29uc3QgZ3JvdXBEYXRhID0ge31cblxuICAgICAgICAgICAgICByZWZbZmllbGQubmFtZV0gPSB0cmF2ZXJzZUZpZWxkczxSZWNvcmQ8c3RyaW5nLCB1bmtub3duPj4oe1xuICAgICAgICAgICAgICAgIGJsb2NrcyxcbiAgICAgICAgICAgICAgICBjb25maWcsXG4gICAgICAgICAgICAgICAgZGF0YVJlZjogZ3JvdXBEYXRhIGFzIFJlY29yZDxzdHJpbmcsIHVua25vd24+LFxuICAgICAgICAgICAgICAgIGRlbGV0aW9ucyxcbiAgICAgICAgICAgICAgICBmaWVsZFByZWZpeDogZ3JvdXBGaWVsZFByZWZpeCxcbiAgICAgICAgICAgICAgICBmaWVsZHM6IGZpZWxkLmZpZWxkcyxcbiAgICAgICAgICAgICAgICBudW1iZXJzLFxuICAgICAgICAgICAgICAgIHBhdGg6IGAke3Nhbml0aXplZFBhdGh9JHtmaWVsZC5uYW1lfWAsXG4gICAgICAgICAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgICAgICAgICB0YWJsZSxcbiAgICAgICAgICAgICAgICB0ZXh0cyxcbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgaWYgKCdfb3JkZXInIGluIHJlZikge1xuICAgICAgICAgICAgICAgIGRlbGV0ZSByZWYuX29yZGVyXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBjYXNlICd0ZXh0Jzoge1xuICAgICAgICAgICAgbGV0IHZhbCA9IGZpZWxkRGF0YVxuICAgICAgICAgICAgaWYgKHR5cGVvZiBmaWVsZERhdGEgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgIHZhbCA9IFN0cmluZyhmaWVsZERhdGEpXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICh0eXBlb2YgbG9jYWxlID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICByZWZbbG9jYWxlXSA9IHZhbFxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcmVzdWx0W2ZpZWxkLm5hbWVdID0gdmFsXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY2FzZSAnbnVtYmVyJzoge1xuICAgICAgICAgICAgbGV0IHZhbCA9IGZpZWxkRGF0YVxuICAgICAgICAgICAgaWYgKHR5cGVvZiBmaWVsZERhdGEgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgIHZhbCA9IE51bWJlci5wYXJzZUZsb2F0KGZpZWxkRGF0YSlcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHR5cGVvZiBsb2NhbGUgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgIHJlZltsb2NhbGVdID0gdmFsXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByZXN1bHRbZmllbGQubmFtZV0gPSB2YWxcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBjYXNlICdkYXRlJzoge1xuICAgICAgICAgICAgbGV0IHZhbCA9IGZpZWxkRGF0YVxuXG4gICAgICAgICAgICBpZiAodHlwZW9mIGZpZWxkRGF0YSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgdmFsID0gbmV3IERhdGUoZmllbGREYXRhKS50b0lTT1N0cmluZygpXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICh0eXBlb2YgbG9jYWxlID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICByZWZbbG9jYWxlXSA9IHZhbFxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcmVzdWx0W2ZpZWxkLm5hbWVdID0gdmFsXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgZGVmYXVsdDoge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBsb2NhbGUgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgIHJlZltsb2NhbGVdID0gZmllbGREYXRhXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByZXN1bHRbZmllbGQubmFtZV0gPSBmaWVsZERhdGFcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0pXG5cbiAgICAgIGlmIChPYmplY3Qua2V5cyhsb2NhbGl6ZWRGaWVsZER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