/*! Capacitor: https://capacitor.ionicframework.com/ - MIT License */ var capacitorExports=function(e){"use strict";var t,r,n,i,o,s,a,u,c,l,d,p,h,f;(t=e.CameraSource||(e.CameraSource={})).Prompt="PROMPT",t.Camera="CAMERA",t.Photos="PHOTOS",(r=e.CameraDirection||(e.CameraDirection={})).Rear="REAR",r.Front="FRONT",(n=e.CameraResultType||(e.CameraResultType={})).Uri="uri",n.Base64="base64",n.DataUrl="dataUrl",(i=e.FilesystemDirectory||(e.FilesystemDirectory={})).Documents="DOCUMENTS",i.Data="DATA",i.Cache="CACHE",i.External="EXTERNAL",i.ExternalStorage="EXTERNAL_STORAGE",(o=e.FilesystemEncoding||(e.FilesystemEncoding={})).UTF8="utf8",o.ASCII="ascii",o.UTF16="utf16",(s=e.HapticsImpactStyle||(e.HapticsImpactStyle={})).Heavy="HEAVY",s.Medium="MEDIUM",s.Light="LIGHT",(a=e.HapticsNotificationType||(e.HapticsNotificationType={})).SUCCESS="SUCCESS",a.WARNING="WARNING",a.ERROR="ERROR",(u=e.KeyboardStyle||(e.KeyboardStyle={})).Dark="DARK",u.Light="LIGHT",(c=e.KeyboardResize||(e.KeyboardResize={})).Body="body",c.Ionic="ionic",c.Native="native",c.None="none",(l=e.ActionSheetOptionStyle||(e.ActionSheetOptionStyle={})).Default="DEFAULT",l.Destructive="DESTRUCTIVE",l.Cancel="CANCEL",(d=e.PermissionType||(e.PermissionType={})).Camera="camera",d.Photos="photos",d.Geolocation="geolocation",d.Notifications="notifications",d.ClipboardRead="clipboard-read",d.ClipboardWrite="clipboard-write",d.Microphone="microphone",(p=e.PhotosAlbumType||(e.PhotosAlbumType={})).Smart="smart",p.Shared="shared",p.User="user",(h=e.StatusBarStyle||(e.StatusBarStyle={})).Dark="DARK",h.Light="LIGHT",(f=e.StatusBarAnimation||(e.StatusBarAnimation={})).None="NONE",f.Slide="SLIDE",f.Fade="FADE";var m,v=function(){function e(){var e=this;this.platform="web",this.isNative=!1,this.Plugins={},"undefined"!=typeof Proxy&&(this.Plugins=new Proxy(this.Plugins,{get:function(t,r){if(void 0===t[r]){var n=e;return new Proxy({},{get:function(e,t){return void 0===e[t]?n.pluginMethodNoop.bind(n,e,t,r):e[t]}})}return t[r]}}))}return e.prototype.pluginMethodNoop=function(e,t,r){return Promise.reject(r+" does not have web implementation.")},e.prototype.getPlatform=function(){return this.platform},e.prototype.isPluginAvailable=function(e){return this.Plugins.hasOwnProperty(e)},e.prototype.convertFileSrc=function(e){return e},e.prototype.handleError=function(e){console.error(e)},e}(),y=(m="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).Capacitor=m.Capacitor||new v,g=y.Plugins,w=function(){function e(){this.plugins={},this.loadedPlugins={}}return e.prototype.addPlugin=function(e){this.plugins[e.config.name]=e},e.prototype.getPlugin=function(e){return this.plugins[e]},e.prototype.loadPlugin=function(e){var t=this.getPlugin(e);t?t.load():console.error("Unable to load web plugin "+e+", no such plugin found.")},e.prototype.getPlugins=function(){var e=[];for(var t in this.plugins)e.push(this.plugins[t]);return e},e}(),b=new w,P=function(){function e(e,t){this.config=e,this.loaded=!1,this.listeners={},this.windowListeners={},t?t.addPlugin(this):b.addPlugin(this)}return e.prototype.addWindowListener=function(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0},e.prototype.removeWindowListener=function(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)},e.prototype.addListener=function(e,t){var r=this;this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t);var n=this.windowListeners[e];return n&&!n.registered&&this.addWindowListener(n),{remove:function(){r.removeListener(e,t)}}},e.prototype.removeListener=function(e,t){var r=this.listeners[e];if(r){var n=r.indexOf(t);this.listeners[e].splice(n,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}},e.prototype.removeAllListeners=function(){for(var e in this.listeners={},this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}},e.prototype.notifyListeners=function(e,t){var r=this.listeners[e];r&&r.forEach((function(e){return e(t)}))},e.prototype.hasListeners=function(e){return!!this.listeners[e].length},e.prototype.registerWindowListener=function(e,t){var r=this;this.windowListeners[t]={registered:!1,windowEventName:e,pluginEventName:t,handler:function(e){r.notifyListeners(t,e)}}},e.prototype.requestPermissions=function(){return Capacitor.isNative?Capacitor.nativePromise(this.config.name,"requestPermissions",{}):Promise.resolve({results:[]})},e.prototype.load=function(){this.loaded=!0},e}(),S=function(e){for(var t=0,r=b.getPlugins();t=0}(t)||(e[t.config.name]=t)},x=function(e,t){return(x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function R(e,t){function r(){this.constructor=e}x(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function C(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}function T(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0?r.split(",")[1]:r},[4,this.dbRequest("put",[l])];case 5:return d.sent(),[2,{uri:l.path}]}}))}))},r.prototype.appendFile=function(e){return C(this,void 0,void 0,(function(){var t,r,n,i,o,s,a,u,c;return T(this,(function(l){switch(l.label){case 0:return t=this.getPath(e.directory,e.path),r=e.data,n=t.substr(0,t.lastIndexOf("/")),i=Date.now(),o=i,[4,this.dbRequest("get",[t])];case 1:if((s=l.sent())&&"directory"===s.type)throw"The supplied path is a directory.";return[4,this.dbRequest("get",[n])];case 2:return void 0!==l.sent()||-1===(a=n.indexOf("/",1))?[3,4]:(u=n.substr(a),[4,this.mkdir({path:u,directory:e.directory,recursive:!0})]);case 3:l.sent(),l.label=4;case 4:return void 0!==s&&(r=s.content+r,o=s.ctime),c={path:t,folder:n,type:"file",size:r.length,ctime:o,mtime:i,content:r},[4,this.dbRequest("put",[c])];case 5:return l.sent(),[2,{}]}}))}))},r.prototype.deleteFile=function(e){return C(this,void 0,void 0,(function(){var t;return T(this,(function(r){switch(r.label){case 0:return t=this.getPath(e.directory,e.path),[4,this.dbRequest("get",[t])];case 1:if(void 0===r.sent())throw Error("File does not exist.");return[4,this.dbIndexRequest("by_folder","getAllKeys",[IDBKeyRange.only(t)])];case 2:if(0!==r.sent().length)throw Error("Folder is not empty.");return[4,this.dbRequest("delete",[t])];case 3:return r.sent(),[2,{}]}}))}))},r.prototype.mkdir=function(e){return C(this,void 0,void 0,(function(){var t,r,n,i,o,s,a,u,c;return T(this,(function(l){switch(l.label){case 0:return t=this.getPath(e.directory,e.path),r=e.recursive,n=t.substr(0,t.lastIndexOf("/")),i=(t.match(/\//g)||[]).length,[4,this.dbRequest("get",[n])];case 1:return o=l.sent(),[4,this.dbRequest("get",[t])];case 2:if(s=l.sent(),1===i)throw Error("Cannot create Root directory");if(void 0!==s)throw Error("Current directory does already exist.");if(!r&&2!==i&&void 0===o)throw Error("Parent directory must exist");return r&&2!==i&&void 0===o?(a=n.substr(n.indexOf("/",1)),[4,this.mkdir({path:a,directory:e.directory,recursive:r})]):[3,4];case 3:l.sent(),l.label=4;case 4:return u=Date.now(),c={path:t,folder:n,type:"directory",size:0,ctime:u,mtime:u},[4,this.dbRequest("put",[c])];case 5:return l.sent(),[2,{}]}}))}))},r.prototype.rmdir=function(e){return C(this,void 0,void 0,(function(){var t,r,n,i,o,s,a,u,c,l;return T(this,(function(d){switch(d.label){case 0:return t=e.path,r=e.directory,n=e.recursive,i=this.getPath(r,t),[4,this.dbRequest("get",[i])];case 1:if(void 0===(o=d.sent()))throw Error("Folder does not exist.");if("directory"!==o.type)throw Error("Requested path is not a directory");return[4,this.readdir({path:t,directory:r})];case 2:if(0!==(s=d.sent()).files.length&&!n)throw Error("Folder is not empty");a=0,u=s.files,d.label=3;case 3:return a0?[4,this.stat({path:l,directory:o})]:[3,5];case 4:if("directory"!==w.sent().type)throw new Error("Parent directory of the to path is a file");w.label=5;case 5:return[3,6];case 6:if(u&&"directory"===u.type)throw new Error("Cannot overwrite a directory with a file");return[4,this.stat({path:n,directory:i})];case 7:switch(d=w.sent(),p=function(e,t,r){return C(g,void 0,void 0,(function(){var n,i;return T(this,(function(s){switch(s.label){case 0:return n=this.getPath(o,e),[4,this.dbRequest("get",[n])];case 1:return(i=s.sent()).ctime=t,i.mtime=r,[4,this.dbRequest("put",[i])];case 2:return s.sent(),[2]}}))}))},d.type){case"file":return[3,8];case"directory":return[3,15]}return[3,28];case 8:return[4,this.readFile({path:n,directory:i})];case 9:return h=w.sent(),t?[4,this.deleteFile({path:n,directory:i})]:[3,11];case 10:w.sent(),w.label=11;case 11:return[4,this.writeFile({path:r,directory:o,data:h.data})];case 12:return w.sent(),t?[4,p(r,d.ctime,d.mtime)]:[3,14];case 13:w.sent(),w.label=14;case 14:return[2,{}];case 15:if(u)throw Error("Cannot move a directory over an existing object");w.label=16;case 16:return w.trys.push([16,20,,21]),[4,this.mkdir({path:r,directory:o,recursive:!1})];case 17:return w.sent(),t?[4,p(r,d.ctime,d.mtime)]:[3,19];case 18:w.sent(),w.label=19;case 19:return[3,21];case 20:return w.sent(),[3,21];case 21:return[4,this.readdir({path:n,directory:i})];case 22:f=w.sent().files,m=0,v=f,w.label=23;case 23:return m