{"version":3,"file":"default.mjs","names":[],"sources":["../../../../src/plugins/persistence/storage/default.ts"],"sourcesContent":["import type { StorageInterface } from '../../../types';\nimport objectStorage from './object';\n\nlet storage: StorageInterface & { removeItem?: ( key: string ) => void };\n\ntry {\n\t// Private Browsing in Safari 10 and earlier will throw an error when\n\t// attempting to set into localStorage. The test here is intentional in\n\t// causing a thrown error as condition for using fallback object storage.\n\tstorage = window.localStorage;\n\tstorage.setItem( '__wpDataTestLocalStorage', '' );\n\tstorage.removeItem!( '__wpDataTestLocalStorage' );\n} catch {\n\tstorage = objectStorage;\n}\n\nexport default storage;\n"],"mappings":";;AAGA,IAAI;AAEJ,IAAI;CAIH,UAAU,OAAO;CACjB,QAAQ,QAAS,4BAA4B,EAAG;CAChD,QAAQ,WAAa,0BAA2B;AACjD,QAAQ;CACP,UAAU;AACX;AAEA,IAAA,kBAAe"}