"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../node_modules/@rematch/core/dist/core.esm.js"),r=require("../models/index.js"),t=require("../node_modules/@rematch/immer/dist/immer.esm.js"),o=require("../node_modules/@rematch/select/dist/select.esm.js"),n=require("../node_modules/immer/dist/immer.esm.mjs.js"),s=require("../package.json.js");n.setAutoFreeze(!1);var a=e.init({models:r.models,plugins:[t.default(),o.default()]}),i=function(){var e=a.getState(),r={timestamp:(new Date).toISOString(),version:s.default.version,appName:s.default.name,description:s.default.description,stores:{}},t=function(e){if(!e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map((function(e){return t(e)}));var r={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var n=e[o];if(n instanceof HTMLElement||n instanceof Node||"function"==typeof n)r[o]="[DOM Element]";else if(!o.startsWith("__react")&&!o.startsWith("_react"))try{JSON.stringify({test:n}),r[o]=t(n)}catch(e){n instanceof Error?r[o]={errorName:n.name,errorMessage:n.message,errorStack:n.stack}:n instanceof Date?r[o]=n.toISOString():r[o]="object"==typeof n&&null!==n?"[Circular Reference]":"[Unserializable: ".concat(typeof n,"]")}}return r};for(var o in e)try{r.stores[o]=t(e[o])}catch(e){console.error("Error ".concat(o,":"),e),r.stores[o]={error:"Failed to sanitize: ".concat(e instanceof Error?e.message:"Unknown error")}}return JSON.stringify(r,(function(e,r){return void 0===r?"[Undefined]":r===1/0?"[Infinity]":Number.isNaN(r)?"[NaN]":r}),2)};exports.downloadStoresAsJSON=function(){try{var e=i(),r=(new Date).toISOString().replace(/[:.]/g,"-"),t="phone-island-stores-".concat(r,".json"),o=new Blob([e],{type:"application/json"}),n=URL.createObjectURL(o),s=document.createElement("a");s.href=n,s.download=t,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(n)}catch(e){}},exports.exportAllStoresAsJSON=i,exports.store=a;
//# sourceMappingURL=index.js.map
