Function restoreGlobalState

Restores the global state of the document from imported data. It validates and provides defaults for missing or invalid properties.