// packages/block-editor/src/utils/block-bindings.ts
var DEFAULT_ATTRIBUTE = "__default";
var PATTERN_OVERRIDES_SOURCE = "core/pattern-overrides";
function hasPatternOverridesDefaultBinding(bindings) {
  return bindings?.[DEFAULT_ATTRIBUTE]?.source === PATTERN_OVERRIDES_SOURCE;
}
function replacePatternOverridesDefaultBinding(bindings, supportedAttributes) {
  if (!hasPatternOverridesDefaultBinding(bindings)) {
    return bindings;
  }
  const bindingsWithDefaults = {};
  for (const attributeName of supportedAttributes) {
    const bindingSource = bindings[attributeName] ? bindings[attributeName] : { source: PATTERN_OVERRIDES_SOURCE };
    bindingsWithDefaults[attributeName] = bindingSource;
  }
  return bindingsWithDefaults;
}
export {
  hasPatternOverridesDefaultBinding,
  replacePatternOverridesDefaultBinding
};
//# sourceMappingURL=block-bindings.mjs.map
