import { Node_Type } from "./../../ricos-schema/next-schema/index.js";
const fromPmAudioAnyState = (pmAudioNode) => {
  const { id, ...audioData } = pmAudioNode?.attrs || {};
  const audio = audioData.audio ? audioData.audio : audioData.tempData ? fallbackAudio : fallbackAudio;
  return {
    type: Node_Type.AUDIO,
    id,
    audioData: {
      ...audio ? { audio } : {},
      ...audioData.containerData ? { containerData: audioData.containerData } : {},
      ...audioData.disableDownload ? { disableDownload: audioData.disableDownload } : {},
      ...audioData.coverImage ? { coverImage: audioData.coverImage } : {},
      ...audioData.name ? { name: audioData.name } : {},
      ...audioData.authorName ? { authorName: audioData.authorName } : {},
      ...audioData.html ? { html: audioData.html } : {}
    }
  };
};
const fallbackAudio = {
  src: {
    id: "16f8d7_2ddc0cacfe7741b686d158405ad90527.mp3"
  }
};
export {
  fromPmAudioAnyState
};
//# sourceMappingURL=from-pm-audio-any-state.js.map
