From 07fdc364344abe2fdcd9c74359a976cbf92668da Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Mon, 29 Aug 2022 12:12:02 -0300 Subject: [PATCH] Version 1.0.1 - Fixes to the authentication flow. --- android/app/build.gradle | 4 ++-- android/app/src/main/res/values/strings.xml | 2 +- ios/App/App/public/index.html | 2 +- ios/App/App/public/js/app.91c68aa3.js | 2 ++ ios/App/App/public/js/app.91c68aa3.js.map | 1 + ios/App/App/public/js/app.ba3e8dbe.js | 2 -- ios/App/App/public/js/app.ba3e8dbe.js.map | 1 - src/pages/LoginPage.vue | 2 +- src/store/storeWp.ts | 3 ++- 9 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 ios/App/App/public/js/app.91c68aa3.js create mode 100644 ios/App/App/public/js/app.91c68aa3.js.map delete mode 100644 ios/App/App/public/js/app.ba3e8dbe.js delete mode 100644 ios/App/App/public/js/app.ba3e8dbe.js.map diff --git a/android/app/build.gradle b/android/app/build.gradle index 1bf9682..55387ef 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "org.tainacan.mobileapp" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 1 - versionName "1.0" + versionCode 2 + versionName "1.0.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index d945243..cdbd9fb 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -1,7 +1,7 @@ Tainacan - tainacan-mobile + Tainacan Mobile org.tainacan.mobileapp org.tainacan.mobileapp diff --git a/ios/App/App/public/index.html b/ios/App/App/public/index.html index d874e49..22e7605 100644 --- a/ios/App/App/public/index.html +++ b/ios/App/App/public/index.html @@ -1 +1 @@ -Ionic App
\ No newline at end of file +Ionic App
\ No newline at end of file diff --git a/ios/App/App/public/js/app.91c68aa3.js b/ios/App/App/public/js/app.91c68aa3.js new file mode 100644 index 0000000..11beb0b --- /dev/null +++ b/ios/App/App/public/js/app.91c68aa3.js @@ -0,0 +1,2 @@ +(function(){var e={1993:function(e){function t(e){return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}))}t.keys=function(){return[]},t.resolve=t,t.id=1993,e.exports=t},1875:function(e){function t(e){return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}))}t.keys=function(){return[]},t.resolve=t,t.id=1875,e.exports=t},2057:function(e,t,o){"use strict";var n=o(9963),i=o(6252);function a(e,t,o,n,a,l){const s=(0,i.up)("ion-router-outlet"),r=(0,i.up)("ion-app");return(0,i.wg)(),(0,i.j4)(r,null,{default:(0,i.w5)((()=>[(0,i.Wm)(s)])),_:1})}o(6699);var l=o(9747),s=o(2406),r=(0,i.aZ)({name:"App",components:{IonApp:l.dr,IonRouterOutlet:l.jP},mounted(){const e=s.A;e.getLanguageCode().then((e=>{if(e.value.includes("-")){const t=e.value.split("-")[0];this.$i18n.locale=t}else this.$i18n.locale=e.value}))}}),c=o(3744);const u=(0,c.Z)(r,[["render",a]]);var d=u,p=o(3577);function m(e,t,o,n,a,l){const s=(0,i.up)("ion-back-button"),r=(0,i.up)("ion-buttons"),c=(0,i.up)("ion-img"),u=(0,i.up)("ion-icon"),d=(0,i.up)("ion-button"),m=(0,i.up)("ion-toolbar"),h=(0,i.up)("ion-title"),_=(0,i.up)("ion-header"),g=(0,i.up)("ion-content"),f=(0,i.up)("ion-toast"),w=(0,i.up)("ion-page");return(0,i.wg)(),(0,i.j4)(w,null,{default:(0,i.w5)((()=>[(0,i.Wm)(_,{collapse:"fade"},{default:(0,i.w5)((()=>[(0,i.Wm)(m,null,{default:(0,i.w5)((()=>[(0,i.Wm)(r,{slot:"start"},{default:(0,i.w5)((()=>[(0,i.Wm)(s,{"default-href":o.pageDefaultBackLink},null,8,["default-href"])])),_:1}),(0,i.Wm)(c,{src:n.tainacanLogo,class:"header__tainacan-logo"},null,8,["src"]),(0,i.Wm)(r,{slot:"end"},{default:(0,i.w5)((()=>[(0,i.Wm)(d,{onClick:l.logOff,"aria-label":"Sair"},{default:(0,i.w5)((()=>[(0,i.Wm)(u,{slot:"icon-only",icon:n.logOutOutline},null,8,["icon"])])),_:1},8,["onClick"])])),_:1})])),_:1}),o.pageTitle?((0,i.wg)(),(0,i.j4)(m,{key:0},{default:(0,i.w5)((()=>[(0,i.Wm)(h,null,{default:(0,i.w5)((()=>[(0,i.Uk)((0,p.zw)(o.pageTitle),1)])),_:1})])),_:1})):(0,i.kq)("",!0)])),_:1}),(0,i.Wm)(g,{fullscreen:"true"},{default:(0,i.w5)((()=>[(0,i.WI)(e.$slots,"default")])),_:3}),(0,i.Wm)(f,{"is-open":n.tainacanStore.errorStatus,message:e.$t(n.tainacanStore.errorMessage),duration:4e3,onDidDismiss:t[0]||(t[0]=t=>e.setOpen(!1)),color:"danger"},null,8,["is-open","message"])])),_:3})}var h=o(8903),_=o(8262),g=o(9669),f=o.n(g),w=o(3978),b=o(339);const I=new w.K,y=(0,_.Q_)("wp",{state(){return{userIsLoggedIn:!1,userSiteUrl:"",userLogin:"",userToken:"",authorizationURL:"",inAppBrowser:b.v}},actions:{async login(e,t,o){try{this.userIsLoggedIn=!0,this.userSiteUrl=e,this.userLogin=t,this.userToken=o,await I.set("userIsLoggedIn",!0),await I.set("userSiteUrl",e),await I.set("userLogin",t),await I.set("userToken",o)}catch(n){return this.userIsLoggedIn=!1,this.userSiteUrl="",this.userToken="",this.userLogin="",delete this.inAppBrowser,n}},async logoff(){try{this.userIsLoggedIn=!1,this.userSiteUrl="",this.userToken="",this.userToken="",delete this.inAppBrowser,await I.set("userIsLoggedIn",!1),await I.set("userSiteUrl",""),await I.set("userToken","")}catch(e){return this.userIsLoggedIn=!1,this.userSiteUrl="",this.userToken="",this.userToken="",this.inAppBrowser.close(),delete this.inAppBrowser,e}},async fetchApplicationAuthorization(e){try{const t=e+"?rest_route=/",o=await f().get(t);if(!(o.data&&o.data.authentication&&o.data.authentication["application-passwords"]&&o.data.authentication["application-passwords"].endpoints&&o.data.authentication["application-passwords"].endpoints.authorization))return!1;this.authorizationURL=o.data.authentication["application-passwords"].endpoints.authorization}catch(t){return t}},async checkUserLogin(){await I.create(),this.userIsLoggedIn=await I.get("userIsLoggedIn"),this.userSiteUrl=await I.get("userSiteUrl"),this.userLogin=await I.get("userLogin"),this.userToken=await I.get("userToken")},createInAppBrowser(e="",t="location=no,fullscreen=no,zoom=no,hardwareback=yes"){let o=this.userSiteUrl+"/wp-admin/admin.php"+e;!this.userIsLoggedIn&&this.authorizationURL&&(o=this.authorizationURL+"?app_name=TainacanMobileApp&success_url="+o);const n=b.i.create(o,"_blank",t);this.inAppBrowser=n},openInAppBrowser(e){this.inAppBrowser&&this.inAppBrowser.executeScript||this.createInAppBrowser(e,"hidden=yes,location=no,fullscreen=no,zoom=no,hardwareback=yes");const t=`\n try {\n window.history.replaceState(\n null,\n null,\n '${this.userSiteUrl}/wp-admin/admin.php?page=tainacan_mobile_app'\n );\n window.history.pushState(\n null,\n null,\n '${this.userSiteUrl}/wp-admin/admin.php${e}'\n );\n window.history.go(0);\n } catch(err){\n //console.log('catch', err);\n }`;this.inAppBrowser.executeScript({code:t}),this.inAppBrowser.show()},hideInAppBrowser(){this.inAppBrowser&&this.inAppBrowser.hide&&this.inAppBrowser.hide()},listenEventInAppBrowser(e){this.inAppBrowser.on("message").subscribe(e),this.inAppBrowser.on("exit").subscribe((()=>{delete this.inAppBrowser})),this.inAppBrowser.on("loadstop").subscribe((e=>{if(e.url&&"string"==typeof e.url&&e.url.split("?")&&e.url.split("?").length>=2){const t=e.url.split("?")[1];t.indexOf("tainacan_mobile_app")>=0&&this.inAppBrowser.hide()}}))}}});o(2801);const A=(0,_.Q_)("tainacan",{state(){return{homeCollections:[],totalHomeCollections:0,homeItems:[],totalHomeItems:0,collections:[],totalCollections:0,collectionItems:[],totalCollectionItems:0,nextItemsByCollectionPage:1,items:[],nextItemsPage:1,totalItems:0,errorMessage:"",errorStatus:!1}},actions:{async fetchCollections(e){try{const t=y();let o=`${t.userSiteUrl}/wp-json/tainacan/v2/collections?`;const n=t.userLogin&&t.userToken?"Basic "+btoa(t.userLogin+":"+t.userToken):null;e&&e.perPage&&(o+="&perpage="+e.perPage),e&&e.orderBy&&(o+="&orderby="+e.orderBy);const i=await f().get(o,n?{headers:{authorization:n}}:{});this.collections=i.data,this.totalCollections=i.headers["x-wp-total"]}catch(t){return this.collections=[],this.totalCollections=0,this.errorMessage="error_label_fetch_collections",this.errorStatus=!0,t}},async fetchHomeCollections(){try{const e=y(),t=`${e.userSiteUrl}/wp-json/tainacan/v2/collections?perpage=4&orderby=modified`,o=e.userLogin&&e.userToken?"Basic "+btoa(e.userLogin+":"+e.userToken):null,n=await f().get(t,o?{headers:{authorization:o}}:{});this.homeCollections=n.data,this.totalHomeCollections=n.headers["x-wp-total"]}catch(e){return this.homeCollections=[],this.totalHomeCollections=0,this.errorMessage="error_label_fetch_collections",this.errorStatus=!0,e}},async fetchItemsByCollection(e,t){try{const o=y();let n=`${o.userSiteUrl}/wp-json/tainacan/v2/collection/${e}/items?context=edit&fetch_only=id,title,thumbnail`;const i=o.userLogin&&o.userToken?"Basic "+btoa(o.userLogin+":"+o.userToken):null;t&&t.perPage?n+="&perpage="+t.perPage:n+="&perpage=12",t&&t.orderBy?n+="&orderby="+t.orderBy:n+="&orderby=modified",t&&t.search&&""!==t.search&&(n+="&search="+t.search),t.reset&&(this.collectionItems=[],this.nextItemsByCollectionPage=1),n+="&paged="+this.nextItemsByCollectionPage;const a=await f().get(n,i?{headers:{authorization:i}}:{});this.collectionItems.push(...a.data.items),this.totalCollectionItems=a.headers["x-wp-total"],this.totalCollectionItems&&"0"!==this.totalCollectionItems&&this.nextItemsByCollectionPage++}catch(o){return this.collectionItems=[],this.totalCollectionItems=0,this.nextItemsByCollectionPage=1,this.errorMessage="error_label_fetch_items_collections",this.errorStatus=!0,!1}},async fetchHomeItems(){try{const e=y(),t=`${e.userSiteUrl}/wp-json/tainacan/v2/items?context=edit&fetch_only=id,title,thumbnail&perpage=12&orderby=modified`,o=e.userLogin&&e.userToken?"Basic "+btoa(e.userLogin+":"+e.userToken):null,n=await f().get(t,o?{headers:{authorization:o}}:{});this.homeItems=n.data.items,this.totalHomeItems=n.headers["x-wp-total"]}catch(e){return this.homeItems=[],this.totalHomeItems=0,this.errorMessage="error_label_fetch_items_collections",this.errorStatus=!0,e}},async fetchItems(e){try{const t=y();let o=`${t.userSiteUrl}/wp-json/tainacan/v2/items?context=edit&fetch_only=id,title,thumbnail`;const n=t.userLogin&&t.userToken?"Basic "+btoa(t.userLogin+":"+t.userToken):null;e&&e.perPage&&(o+="&perpage="+e.perPage),e&&e.orderBy&&(o+="&orderby="+e.orderBy),e&&e.search&&""!==e.search&&(o+="&search="+e.search),e.reset&&(this.items=[],this.nextItemsPage=1),o+="&paged="+this.nextItemsPage;const i=await f().get(o,n?{headers:{authorization:n}}:{});this.items.push(...i.data.items),this.totalItems=i.headers["x-wp-total"],this.totalItems&&"0"!==this.totalItems&&this.nextItemsPage++}catch(t){return this.items=[],this.totalItems=0,this.nextItemsPage=1,this.errorMessage="error_label_fetch_items",this.errorStatus=!0,t}},async deleteItem(e){try{const t=y(),o=`${t.userSiteUrl}/wp-json/tainacan/v2/items/${e}`,n=t.userLogin&&t.userToken?"Basic "+btoa(t.userLogin+":"+t.userToken):null,i=await f()["delete"](o,n?{headers:{authorization:n}}:{});if(i.data&&i.data.id){const e=this.items.findIndex((e=>e.id==i.data.id));e>=0&&this.items.splice(e,1);const t=this.homeItems.findIndex((e=>e.id==i.data.id));t>=0&&this.homeItems.splice(t,1);const o=this.collectionItems.findIndex((e=>e.id==i.data.id));o>=0&&this.collectionItems.splice(o,1)}}catch(t){return this.errorMessage="error_delete_item",this.errorStatus=!0,t}}}});var S={props:["pageTitle","pageDefaultBackLink"],components:{IonPage:l._i,IonHeader:l.Gu,IonToolbar:l.sr,IonTitle:l.wd,IonContent:l.W2,IonIcon:l.gu,IonButton:l.YG,IonBackButton:l.oU,IonButtons:l.Sm,IonImg:l.Xz,IonToast:l.Px},setup(){const e=(0,i.Fl)((()=>o(6949)));let t=y(),n=A();return{tainacanLogo:e,wpStore:t,logOutOutline:h.euS,tainacanStore:n}},methods:{async logOff(){await this.wpStore.logoff(),this.$router.go()}}};const v=(0,c.Z)(S,[["render",m]]);var k=v;const C={key:0},L={key:1},B={key:2},U={key:0};function W(e,t,o,n,a,l){const s=(0,i.up)("ion-img"),r=(0,i.up)("ion-thumbnail"),c=(0,i.up)("ion-icon"),u=(0,i.up)("ion-label"),d=(0,i.up)("ion-radio"),m=(0,i.up)("ion-item");return(0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(e.collections,(t=>((0,i.wg)(),(0,i.j4)(m,{class:"collection-list-item",key:t.id,onClick:o=>e.isInSelectionMode?"":e.goToCollectionPage(t)},{default:(0,i.w5)((()=>[(0,i.Wm)(r,{slot:"start"},{default:(0,i.w5)((()=>[(0,i.Wm)(s,{src:t.thumbnail&&t.thumbnail.thumbnail&&t.thumbnail.thumbnail[0]?t.thumbnail.thumbnail[0]:e.thumbnailPlaceholder,alt:t.name?t.name:e.$("label_collection_without_name")},null,8,["src","alt"])])),_:2},1024),(0,i.Wm)(u,null,{default:(0,i.w5)((()=>[(0,i._)("h2",null,[(0,i.Uk)((0,p.zw)(t.name?t.name:e.$t("label_collection_without_name"))+"  ",1),"private"===t.status?((0,i.wg)(),(0,i.iD)("span",C,[(0,i.Wm)(c,{icon:e.lockClosedOutline},null,8,["icon"])])):"draft"===t.status?((0,i.wg)(),(0,i.iD)("span",L,[(0,i.Wm)(c,{icon:e.readerOutline},null,8,["icon"])])):"trash"===t.status?((0,i.wg)(),(0,i.iD)("span",B,[(0,i.Wm)(c,{icon:e.trashOutline},null,8,["icon"])])):(0,i.kq)("",!0)]),t.total_items?((0,i.wg)(),(0,i.iD)("p",U,(0,p.zw)(e.$t("total_of_published_items",[t.total_items.publish])),1)):(0,i.kq)("",!0)])),_:2},1024),e.isInSelectionMode?((0,i.wg)(),(0,i.j4)(d,{key:0,slot:"end",value:t.id},null,8,["value"])):(0,i.kq)("",!0)])),_:2},1032,["onClick"])))),128)}var T=o(2119),x=(0,i.aZ)({props:["collections","isSelectionMode"],components:{IonItem:l.Ie,IonImg:l.Xz,IonThumbnail:l.Bs,IonLabel:l.Q$,IonIcon:l.gu,IonRadio:l.B7},setup(e){const t=(0,i.Fl)((()=>e.isSelectionMode)),n=(0,i.Fl)((()=>o(6445))),a=(0,T.tv)(),l=e=>{a.push({name:"collection",params:{id:e.id}})};return{thumbnailPlaceholder:n,lockClosedOutline:h.hkI,readerOutline:h.$1v,trashOutline:h.gtu,goToCollectionPage:l,isInSelectionMode:t}}});const H=(0,c.Z)(x,[["render",W]]);var j=H;function P(e,t,o,n,a,l){const s=(0,i.up)("ion-img"),r=(0,i.up)("ion-card-title"),c=(0,i.up)("ion-card-header"),u=(0,i.up)("ion-card"),d=(0,i.up)("ion-col"),m=(0,i.up)("ion-row");return(0,i.wg)(),(0,i.j4)(m,{class:"items-list-container"},{default:(0,i.w5)((()=>[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(e.items,(t=>((0,i.wg)(),(0,i.j4)(d,{size:"4",key:t.id},{default:(0,i.w5)((()=>[(0,i.Wm)(u,{onClick:o=>e.openActionSheet(t),button:"",color:"light"},{default:(0,i.w5)((()=>[(0,i.Wm)(s,{src:t.thumbnail&&t.thumbnail["tainacan-medium"]&&t.thumbnail["tainacan-medium"][0]?t.thumbnail["tainacan-medium"][0]:e.thumbnailPlaceholder,alt:t.thumbnail_alt?t.thumbnail_alt:t.title?t.title:"Imagem de item sem título"},null,8,["src","alt"]),(0,i.Wm)(c,null,{default:(0,i.w5)((()=>[(0,i.Wm)(r,null,{default:(0,i.w5)((()=>[(0,i.Uk)((0,p.zw)(t.title?t.title:e.$t("label_item_without_title")),1)])),_:2},1024)])),_:2},1024)])),_:2},1032,["onClick"])])),_:2},1024)))),128))])),_:1})}var R=o(2262),D=(0,i.aZ)({props:["items"],components:{IonCardHeader:l.Zi,IonRow:l.Nd,IonCol:l.wI,IonCard:l.PM,IonImg:l.Xz,IonCardTitle:l.Dq},setup(){const e=y(),t=A(),n=(0,i.Fl)((()=>o(6445))),a=(0,R.iH)({header:"",button1:"",button2:"",cancel:""}),s=e=>a.value=e,r=async e=>{const t=e;if(t.current_user_can_edit||t.current_user_can_delete){let e=[];t.current_user_can_edit&&e.push({text:a.value.button1,icon:h.rI1,data:"edit-item",handler:()=>{u(t)}}),t.current_user_can_delete&&e.push({text:a.value.button2,icon:h.UQi,data:"delete-item",handler:()=>{c(t)}}),e.push({text:a.value.cancel,role:"cancel"});let o={header:a.value.header,cssClass:"item-creation-action-sheet",buttons:e};const n=await l.BO.create(o);await n.present()}},c=function(e){t.deleteItem(e.id)},u=function(t){e.openInAppBrowser("?page=tainacan_admin&mobileAppMode=true#/collections/"+t.collection_id+"/items/"+t.id+"/edit"),e.listenEventInAppBrowser((t=>{t&&t.data&&"item_updated"===t.data.type&&t.data.item&&"auto-draft"!==t.data.item.status&&e.hideInAppBrowser()}))};return{thumbnailPlaceholder:n,wpStore:e,openItemEdition:u,setActionSheetLabels:s,openActionSheet:r}},async created(){this.setActionSheetLabels({header:this.$t("label_item_actions"),button1:this.$t("label_option_edit_item"),button2:this.$t("label_option_delete_item"),cancel:this.$t("label_cancel")})}});const O=(0,c.Z)(D,[["render",P]]);var z=O,M=o(1089);function Q(e,t,o,n,a,l){const s=(0,i.up)("ion-refresher-content"),r=(0,i.up)("ion-refresher"),c=(0,i.up)("ion-loading"),u=(0,i.up)("ion-list-header"),d=(0,i.up)("collections-list"),m=(0,i.up)("ion-list"),h=(0,i.up)("ion-icon"),_=(0,i.up)("ion-button"),g=(0,i.up)("items-list"),f=(0,i.up)("base-layout");return(0,i.wg)(),(0,i.j4)(f,null,{default:(0,i.w5)((()=>[(0,i.Wm)(r,{slot:"fixed",onIonRefresh:t[0]||(t[0]=e=>n.doRefresh(e))},{default:(0,i.w5)((()=>[(0,i.Wm)(s)])),_:1}),(0,i.Wm)(c,{"is-open":n.isLoading,message:e.$t("label_loading")},null,8,["is-open","message"]),(0,i.Wm)(m,null,{default:(0,i.w5)((()=>[(0,i.Wm)(u,null,{default:(0,i.w5)((()=>[(0,i.Uk)((0,p.zw)(e.$t("label_last_modified_collections")),1)])),_:1}),(0,i.Wm)(d,{collections:n.tainacanStore.homeCollections},null,8,["collections"])])),_:1}),n.tainacanStore.homeCollections.length[(0,i.Uk)((0,p.zw)(e.$t("label_view_all_collections",[n.tainacanStore.totalHomeCollections]))+" ",1),(0,i.Wm)(h,{slot:"end",icon:n.arrowForwardOutline},null,8,["icon"])])),_:1})):(0,i.kq)("",!0),(0,i.Wm)(m,null,{default:(0,i.w5)((()=>[(0,i.Wm)(u,null,{default:(0,i.w5)((()=>[(0,i.Uk)((0,p.zw)(e.$t("label_last_modified_items")),1)])),_:1}),(0,i.Wm)(g,{items:n.tainacanStore.homeItems},null,8,["items"]),n.tainacanStore.homeItems.length[(0,i.Uk)((0,p.zw)(e.$t("label_view_all_items",[n.tainacanStore.totalHomeItems]))+" ",1),(0,i.Wm)(h,{slot:"end",icon:n.arrowForwardOutline},null,8,["icon"])])),_:1})):(0,i.kq)("",!0)])),_:1})])),_:1})}var E={components:{IonIcon:l.gu,CollectionsList:j,ItemsList:z,BaseLayout:k,IonList:l.q_,IonListHeader:l.yh,IonButton:l.YG,IonLoading:l.wh,IonRefresher:l.nJ,IonRefresherContent:l.Wo},setup(){const e=(0,R.iH)(!1),t=t=>e.value=t,o=async()=>{await i.fetchHomeCollections(),await i.fetchHomeItems()},n=async e=>{await o(),e&&e.target&&e.target.complete()};let i=A();return{arrowForwardOutline:h.QzP,tainacanStore:i,isLoading:e,setIsLoading:t,loadCollectionsAndItems:o,doRefresh:n}},async created(){this.setIsLoading(!0),await this.loadCollectionsAndItems(),this.setIsLoading(!1)}};const F=(0,c.Z)(E,[["render",Q]]);var V=F;const N=(0,i._)("br",null,null,-1);function Y(e,t,o,a,l,s){const r=(0,i.up)("ion-img"),c=(0,i.up)("ion-label"),u=(0,i.up)("ion-input"),d=(0,i.up)("ion-item"),m=(0,i.up)("ion-list"),h=(0,i.up)("ion-icon"),_=(0,i.up)("ion-button"),g=(0,i.up)("ion-col"),f=(0,i.up)("ion-row"),w=(0,i.up)("app-password-modal"),b=(0,i.up)("ion-content"),I=(0,i.up)("ion-page");return(0,i.wg)(),(0,i.j4)(I,null,{default:(0,i.w5)((()=>[(0,i.Wm)(b,{class:"login-form-content",fullscreen:""},{default:(0,i.w5)((()=>[(0,i.Wm)(f,{class:"ion-align-items-center ion-justify-content-center"},{default:(0,i.w5)((()=>[(0,i.Wm)(g,null,{default:(0,i.w5)((()=>[(0,i.Wm)(r,{class:"login-form-content__tainacan-logo",alt:"Logo Tainacan",src:a.image},null,8,["src"]),(0,i._)("form",{onSubmit:t[1]||(t[1]=(0,n.iM)(((...e)=>s.openLoginForm&&s.openLoginForm(...e)),["prevent"]))},[(0,i.Wm)(m,{class:"ion-no-margin",inset:""},{default:(0,i.w5)((()=>[(0,i.Wm)(d,null,{default:(0,i.w5)((()=>[(0,i.Wm)(c,{position:"floating"},{default:(0,i.w5)((()=>[(0,i.Uk)((0,p.zw)(e.$t("label_site_url")),1)])),_:1}),(0,i.Wm)(u,{placeholder:e.$t("placeholder_site_url"),autofocus:"true",id:"siteUrl",type:"url",name:"siteUrl",modelValue:l.siteUrl,"onUpdate:modelValue":t[0]||(t[0]=e=>l.siteUrl=e),modelModifiers:{trim:!0},required:"true",autocomplete:"url",enterkeyhint:"next"},null,8,["placeholder","modelValue"])])),_:1})])),_:1}),N,(0,i.Wm)(_,{type:"submit",fill:"clear"},{default:(0,i.w5)((()=>[(0,i.Uk)((0,p.zw)(e.$t("label_access_archive"))+" ",1),(0,i.Wm)(h,{slot:"end",icon:a.arrowForwardOutline},null,8,["icon"])])),_:1})],32)])),_:1})])),_:1}),(0,i.Wm)(w)])),_:1})])),_:1})}const q=(0,i._)("h1",null,"Application Passwords",-1),X=(0,i._)("p",null,[(0,i._)("em",null,"Application passwords"),(0,i.Uk)(" are a safe way to peform operations without using your actual website password. To generate one, you must: "),(0,i._)("ol",null,[(0,i._)("li",null,[(0,i.Uk)("Open a web browser and login do your website traditional login page (usually "),(0,i._)("em",null,'"https://your-website.com.br/wp-admin"'),(0,i.Uk)(").")]),(0,i._)("li",null,"Go to your profile page by clicking on your picture in the upper right corner."),(0,i._)("li",null,'Scroll down to the "Application passwords" section. There should be a text input labelled "New name to the application password".'),(0,i._)("li",null,'Fill in the text input with any value to identify this password (you can have multiple), for example: "Tainacan Mobile".'),(0,i._)("li",null,'Click on the "Add new application password" button.')])],-1),Z=(0,i._)("p",null,"With this steps completed, you will receive a code, that may look like this:",-1),J=(0,i._)("pre",null,[(0,i._)("code",null,"vlOh CdaH UqWw YV7X beou 6MFY")],-1),$=(0,i._)("p",null,[(0,i.Uk)("Copy this code and "),(0,i._)("strong",null,"keep it safe somewhere"),(0,i.Uk)(". You won't be able to access it later. Finally, paste it on this app login screen.")],-1),K=(0,i._)("p",null,"While it should be kept logged in, if you ever loose your access to the app, you can revogate the previous passwords and generate new ones in the same screen.",-1);function G(e,t,o,n,a,l){const s=(0,i.up)("ion-content"),r=(0,i.up)("ion-modal");return(0,i.wg)(),(0,i.j4)(r,{ref:"modal",trigger:"open-explanation-modal","initial-breakpoint":.9,breakpoints:[0,.5,.75,1]},{default:(0,i.w5)((()=>[(0,i.Wm)(s,{style:{"font-size":"0.9375rem",opacity:"0.85"},class:"ion-padding"},{default:(0,i.w5)((()=>[q,X,Z,J,$,K])),_:1})])),_:1},8,["initial-breakpoint","breakpoints"])}var ee={components:{IonModal:l.ki,IonContent:l.W2},setup(){return{}}};const te=(0,c.Z)(ee,[["render",G]]);var oe=te,ne={props:["pageTitle","pageDefaultBackLink"],components:{IonIcon:l.gu,IonImg:l.Xz,IonPage:l._i,IonList:l.q_,IonItem:l.Ie,IonButton:l.YG,IonInput:l.pK,IonLabel:l.Q$,IonRow:l.Nd,IonCol:l.wI,IonContent:l.W2,AppPasswordModal:oe},data(){return{siteUrl:""}},setup(){const e=(0,i.Fl)((()=>o(9980)));let t=A(),n=y();return{image:e,tainacanStore:t,wpStore:n,arrowForwardOutline:h.QzP}},methods:{async openLoginForm(){this.wpStore.userSiteUrl=this.siteUrl,await this.wpStore.fetchApplicationAuthorization(this.siteUrl),this.wpStore.authorizationURL&&(this.wpStore.createInAppBrowser("?page=tainacan_mobile_app"),this.wpStore.inAppBrowser.on("loadstop").subscribe(this.handleBrowserLoadStop))},async handleBrowserLoadStop(e){if(e.url&&"string"==typeof e.url&&e.url.split("?")&&e.url.split("?").length>=2){const t=new URLSearchParams(e.url.split("?")[1]);if("tainacan_mobile_app"===t.get("page")){const e=t.get("user_login");let o=t.get("password");"string"==typeof o&&o.indexOf("#")>=0&&(o=o.split("#")[0]),e&&o&&(await this.wpStore.login(this.siteUrl,e,o),this.$router.replace("/home")),this.wpStore.inAppBrowser.hide()}}},fakeLogin(){this.wpStore.login("https://rcteste.tainacan.org","",""),this.$router.push("/home")}}};const ie=(0,c.Z)(ne,[["render",Y]]);var ae=ie;const le={key:1,class:"results-not-found"};function se(e,t,o,n,a,l){const s=(0,i.up)("ion-refresher-content"),r=(0,i.up)("ion-refresher"),c=(0,i.up)("ion-searchbar"),u=(0,i.up)("ion-toolbar"),d=(0,i.up)("ion-loading"),m=(0,i.up)("ion-spinner"),h=(0,i.up)("items-list"),_=(0,i.up)("ion-infinite-scroll-content"),g=(0,i.up)("ion-infinite-scroll"),f=(0,i.up)("ion-icon"),w=(0,i.up)("ion-button"),b=(0,i.up)("base-layout");return(0,i.wg)(),(0,i.j4)(b,{"page-title":e.$t("label_collection_items_list"),"page-default-back-link":"/collections"},{default:(0,i.w5)((()=>[(0,i.Wm)(r,{slot:"fixed",onIonRefresh:t[0]||(t[0]=t=>e.doRefresh(t))},{default:(0,i.w5)((()=>[(0,i.Wm)(s)])),_:1}),(0,i.Wm)(u,null,{default:(0,i.w5)((()=>[(0,i.Wm)(c,{debounce:"500",placeholder:e.$t("label_search"),onIonChange:t[1]||(t[1]=t=>e.handleSearch(t))},null,8,["placeholder"])])),_:1}),(0,i.Wm)(d,{"is-open":e.isLoading,message:e.$t("label_loading")},null,8,["is-open","message"]),e.isSearching?((0,i.wg)(),(0,i.j4)(m,{key:0})):(0,i.kq)("",!0),e.isLoading||e.isSearching||e.tainacanStore.totalCollectionItems&&"0"!=e.tainacanStore.totalCollectionItems?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("div",le,[(0,i._)("span",null,(0,p.zw)(e.$t("label_no_results_found")),1)])),(0,i.Wm)(h,{items:e.tainacanStore.collectionItems},null,8,["items"]),(0,i.Wm)(g,{ref:"infiniteScroll",threshold:"5%",onIonInfinite:e.loadItemsByCollection},{default:(0,i.w5)((()=>[(0,i.Wm)(_)])),_:1},8,["onIonInfinite"]),(0,i.Wm)(w,{class:"add-items-button",color:"primary",onClick:t[2]||(t[2]=t=>e.openActionSheet())},{default:(0,i.w5)((()=>[(0,i.Wm)(f,{icon:e.add},null,8,["icon"]),(0,i.Uk)("  "+(0,p.zw)(e.$t("label_add_items")),1)])),_:1})])),_:1},8,["page-title"])}var re=(0,i.aZ)({components:{BaseLayout:k,ItemsList:z,IonLoading:l.wh,IonRefresher:l.nJ,IonRefresherContent:l.Wo,IonIcon:l.gu,IonButton:l.YG,IonInfiniteScroll:l.ju,IonToolbar:l.sr,IonSearchbar:l.VI,IonSpinner:l.PQ,IonInfiniteScrollContent:l.MB},props:{id:String},setup(e){const t=(0,R.iH)(!1),o=(0,R.iH)(!1),n=(0,R.iH)(),i=(0,R.iH)(),a=e=>t.value=e,s=e=>o.value=e,r=e=>n.value=e,c=async(t,o)=>{await w.fetchItemsByCollection(e.id+"",{perPage:"12",orderBy:"modified",reset:o,search:n.value});let a=w.totalCollectionItems&&0!==w.totalCollectionItems;t&&t.target&&t.target.complete(),a||(i.value.$el.disabled=!0)},u=async()=>{await c(null,!0)},d=async e=>{let t=e&&e.detail&&e.detail.value;r(t),s(!0),""!==t?await c(null,!0):await u(),s(!1)},p=async e=>{await c({},!0),e&&e.target&&(e.target.complete(),i.value.$el.disabled=!1)},m=y(),_=(0,R.iH)({header:"",button1:"",button2:"",button3:"",cancel:""}),g=e=>_.value=e,f=async()=>{const t=await l.BO.create({header:_.value.header,cssClass:"item-creation-action-sheet",buttons:[{text:_.value.button3,icon:h.Pf6,data:"single item",handler:()=>{m.openInAppBrowser("?page=tainacan_admin&mobileAppMode=true#/collections/"+e.id+"/items/new"),m.listenEventInAppBrowser((e=>{e&&e.data&&"item_updated"===e.data.type&&e.data.item&&"auto-draft"!==e.data.item.status&&(m.hideInAppBrowser(),c({},!0))}))}},{text:_.value.cancel,role:"cancel"}]});await t.present()};let w=A();return{isLoading:t,isSearching:o,tainacanStore:w,wpStore:m,setIsLoading:a,loadItemsByCollection:c,doRefresh:p,openActionSheet:f,add:h.IHx,actionSheetLabels:_,setActionSheetLabels:g,infiniteScroll:i,handleSearch:d}},async created(){this.setActionSheetLabels({header:this.$t("info_create_items"),button1:this.$t("label_option_multiple_items"),button2:this.$t("label_option_multiple_attachments"),button3:this.$t("label_option_single_item"),cancel:this.$t("label_cancel")}),this.setIsLoading(!0),await this.loadItemsByCollection({},!0),this.setIsLoading(!1)}});const ce=(0,c.Z)(re,[["render",se]]);var ue=ce;function de(e,t,o,n,a,l){const s=(0,i.up)("ion-loading"),r=(0,i.up)("ion-refresher-content"),c=(0,i.up)("ion-refresher"),u=(0,i.up)("collections-list"),d=(0,i.up)("ion-list"),p=(0,i.up)("base-layout");return(0,i.wg)(),(0,i.j4)(p,{"page-title":e.$t("label_collections_list"),"page-default-back-link":"/"},{default:(0,i.w5)((()=>[(0,i.Wm)(s,{"is-open":n.isLoading,message:e.$t("label_loading")},null,8,["is-open","message"]),(0,i.Wm)(c,{slot:"fixed",onIonRefresh:t[0]||(t[0]=e=>n.doRefresh(e))},{default:(0,i.w5)((()=>[(0,i.Wm)(r)])),_:1}),(0,i.Wm)(d,null,{default:(0,i.w5)((()=>[(0,i.Wm)(u,{collections:n.tainacanStore.collections,"is-selection-mode":!1},null,8,["collections"])])),_:1})])),_:1},8,["page-title"])}var pe={components:{CollectionsList:j,BaseLayout:k,IonLoading:l.wh,IonList:l.q_,IonRefresher:l.nJ,IonRefresherContent:l.Wo},setup(){const e=(0,R.iH)(!1),t=t=>e.value=t,o=async()=>{await i.fetchCollections({perPage:"24",orderBy:"modified"})},n=async e=>{await o(),e&&e.target&&e.target.complete()};let i=A();return{tainacanStore:i,isLoading:e,setIsLoading:t,doRefresh:n,loadCollections:o}},async created(){this.setIsLoading(!0),await this.loadCollections(),this.setIsLoading(!1)}};const me=(0,c.Z)(pe,[["render",de]]);var he=me;const _e={key:1,class:"results-not-found"};function ge(e,t,o,n,a,l){const s=(0,i.up)("ion-loading"),r=(0,i.up)("ion-searchbar"),c=(0,i.up)("ion-toolbar"),u=(0,i.up)("ion-refresher-content"),d=(0,i.up)("ion-refresher"),m=(0,i.up)("ion-spinner"),h=(0,i.up)("items-list"),_=(0,i.up)("ion-infinite-scroll-content"),g=(0,i.up)("ion-infinite-scroll"),f=(0,i.up)("base-layout");return(0,i.wg)(),(0,i.j4)(f,{"page-title":e.$t("label_items_list"),"page-default-back-link":"/collections"},{default:(0,i.w5)((()=>[(0,i.Wm)(s,{"is-open":n.isLoading,message:e.$t("label_loading")},null,8,["is-open","message"]),(0,i.Wm)(c,null,{default:(0,i.w5)((()=>[(0,i.Wm)(r,{debounce:"500",placeholder:e.$t("label_search"),onIonChange:t[0]||(t[0]=e=>n.handleSearch(e))},null,8,["placeholder"])])),_:1}),(0,i.Wm)(d,{slot:"fixed",onIonRefresh:t[1]||(t[1]=e=>n.doRefresh(e))},{default:(0,i.w5)((()=>[(0,i.Wm)(u)])),_:1}),n.isSearching?((0,i.wg)(),(0,i.j4)(m,{key:0})):(0,i.kq)("",!0),n.isLoading||n.isSearching||n.tainacanStore.totalItems&&"0"!=n.tainacanStore.totalItems?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("div",_e,[(0,i._)("span",null,(0,p.zw)(e.$t("label_no_results_found")),1)])),(0,i.Wm)(h,{items:n.tainacanStore.items},null,8,["items"]),(0,i.Wm)(g,{ref:"infiniteScroll",threshold:"5%",onIonInfinite:n.loadItems},{default:(0,i.w5)((()=>[(0,i.Wm)(_)])),_:1},8,["onIonInfinite"])])),_:1},8,["page-title"])}var fe={components:{IonLoading:l.wh,ItemsList:z,BaseLayout:k,IonRefresher:l.nJ,IonRefresherContent:l.Wo,IonInfiniteScroll:l.ju,IonToolbar:l.sr,IonSearchbar:l.VI,IonSpinner:l.PQ,IonInfiniteScrollContent:l.MB},setup(){const e=(0,R.iH)(!1),t=(0,R.iH)(!1),o=(0,R.iH)(),n=t=>e.value=t,i=e=>t.value=e,a=e=>o.value=e,l=(0,R.iH)(),s=async(e,t)=>{await d.fetchItems({perPage:"12",orderBy:"modified",reset:t,search:o.value});let n=d.totalItems&&0!==d.totalItems;e&&e.target&&e.target.complete(),n||(l.value.$el.disabled=!0)},r=async()=>{await s(null,!0)},c=async e=>{let t=e&&e.detail&&e.detail.value;a(t),i(!0),""!==t?(await s(null,!0),i(!1)):await r(),i(!1)},u=async e=>{await s({},!0),e&&e.target&&(e.target.complete(),l.value.$el.disabled=!1)};let d=A();return{isLoading:e,isSearching:t,setIsLoading:n,tainacanStore:d,doRefresh:u,loadItems:s,infiniteScroll:l,handleSearch:c}},async created(){this.setIsLoading(!0),await this.loadItems(),this.setIsLoading(!1)}};const we=(0,c.Z)(fe,[["render",ge],["__scopeId","data-v-5ba64bfe"]]);var be=we;const Ie=[{path:"/",redirect:"/home"},{path:"/home",component:V,name:"home"},{path:"/login",component:ae,name:"login"},{path:"/collections/:id",component:ue,name:"collection",props:!0},{path:"/collections",component:he,name:"collections"},{path:"/items",component:be,name:"items"}],ye=(0,M.p7)({history:(0,M.PO)("/"),routes:Ie});ye.beforeEach((async(e,t,o)=>{const n=y();await n.checkUserLogin(),"login"===e.name||n.userIsLoggedIn?o():o({name:"login"})}));var Ae=ye,Se=(o(8851),o(1292),o(1633),o(1045),o(6187),o(2299),o(3423),o(4687),o(9147),o(6250),o(3324));const ve={en:{collections:"Collections",label_view_all_collections:"View all {0} collections",items:"Items",label_view_all_items:"View all {0} items",label_loading:"Loading...",label_items_list:"Items list",label_collections_list:"Collections list",label_collection_items_list:"Collection items list",collection:"Collection",label_site_url:"Archive site URL",placeholder_site_url:"https://my-tainacan-archive.com",label_user_name:"User name",placeholder_user_name:"your user name",label_user_password:"User application password",placeholder_user_password:"your application password here",label_access_archive:"Access archive",label_item_without_title:"Item without title",label_collection_without_name:"Collection without name",total_of_published_items:"Total of {0} published items",label_last_modified_collections:"Last modified collections",label_last_modified_items:"Last modified itens",label_add_items:"Add items",info_create_items:"Create new items in this collection",label_option_multiple_items:"Multiple items from file selection",label_option_multiple_attachments:"Single item with document and attachments from file selection",label_option_single_item:"Single empty item",label_cancel:"Cancel",label_search:"Search",label_no_results_found:"No results found",info_application_password:"This password is not the same of your WordPress admin.",label_learn_more_here:"Learn more here",label_item_actions:"Item actions",label_option_edit_item:"Edit item",label_option_delete_item:"Send item to trash",error_label_fetch_collections:"Collections loading error",error_label_fetch_items_collections:"Items collections loading error",error_label_fetch_items:"Items loading error",error_delete_item:"Error while deleting item"},pt:{collections:"Coleções",label_view_all_collections:"Ver todas as {0} coleções",items:"Itens",label_view_all_items:"Ver todos os {0} itens",label_loading:"Carregando...",label_items_list:"Lista de itens",label_collections_list:"Lista de coleções",label_collection_items_list:"Lista de itens da coleção",collection:"Coleção",label_site_url:"URL do Site do Acervo",placeholder_site_url:"https://meu-acervo-tainacan.com",label_user_name:"Nome de usuário",placeholder_user_name:"seu nome de usuário aqui",label_user_password:"Senha do usuário da aplicação",placeholder_user_password:"sua senha de usuário da aplicação aqui",label_access_archive:"Acessar acervo",label_item_without_title:"Item sem título",label_collection_without_name:"Coleção sem nome",total_of_published_items:"Total de {0} itens públicos",label_last_modified_collections:"Coleções alteradas recentemente",label_last_modified_items:"Itens alterados recentemente",label_add_items:"Adicionar itens",info_create_items:"Crie novos itens nesta coleção",label_option_multiple_items:"Vários itens a partir de uma seleção de arquivos",label_option_multiple_attachments:"Um item com documento e anexos provenientes de ums seleção de aquivos",label_option_single_item:"Um item vazio",label_cancel:"Cancelar",label_search:"Buscar",label_no_results_found:"Nenhum resultado encontrado",info_application_password:"Esta senha não é a mesma do seu painel admin do WordPress.",label_learn_more_here:"Saiba mais aqui.",label_item_actions:"Ações para o item",label_option_edit_item:"Editar item",label_option_delete_item:"Enviar item para lixeira",error_label_fetch_collections:"Erro no carregamento das coleções",error_label_fetch_items_collections:"Erro no carregamento dos itens da coleção",error_label_fetch_items:"Erro no carregamento dos itens",error_delete_item:"Erro ao tentar remover item"}},ke=(0,Se.o)({locale:"en",fallbackLocale:"en",messages:ve}),Ce=(0,n.ri)(d).use(l.oX).use(Ae).use((0,_.WB)()).use(ke);Ce.component("base-layout",k),Ce.component("base-collectionlist",j),Ce.component("base-itemlist",z),Ae.isReady().then((()=>{Ce.mount("#app")}))},6949:function(e,t,o){"use strict";e.exports=o.p+"img/logo.c406a55a.png"},9980:function(e,t,o){"use strict";e.exports=o.p+"img/logo_square.e3a150ee.png"},6445:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAHEHpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjarVdtksMqDvzPKfYIICQEx5H5qHo32ONvCzuZSSYzmXm1cSU4GINQS90izP/+s8J/8CGJNbBoLa2UiA83bmS4qfH8tP2bIu/f/aHbs/TYH+4PCF0ZbT7/ql3jDf3y8cJ9nuOxP9R6X+mcKN0n3p/sK/v9+Gwk+unsT3xN1OZ5U1rVz6Ye10T9GrhNub78sb398f/hoUPhpSFYKBPNnHLcv/W0IJ9fQw/tX8G4lBX3knNAQ7ldk8EhD9u7tTF+dtCDk2934dn797sn55Nd/fnJl+XyEW5ePkjy1J/vy9DnhfPdInp80Mod4S9OXmvUtea5O+MCj5Yroraz020aDDzg8rxfK7gUX0QtWr8arhotdkA+Yo8Hrp5aIqCyQuI0kqWV5m576jCRaZKiJeqUd1/NSo16dpzYr7RIc8sjV4DVaYac0U13W9Jet+31eqpYeSQMpYTJHPZvr/DTw79cYa3uLkqx3n0Fu8jjGmY4cv6LUQAkrQs32Q6+XRf88VP8IFSBoGw3V2zQ4nFOcUj6iK28cc4YJ2jPFEpBxzUBXIS1BcakDARiQQ6kkqISaUrwYwVABsspMx1AIInQgJHEORcKSpV8bbyjaY8loULeDW4CEJIL8qkCIQNYzIL4Ua6IIZMsLCJFVGqQJlZy4SKlFC1OcqZZWUWLqlZtajVXrlJL1Vprq9aoZXCgtNK01daaGQXDQoa5DOMNPQcd+eBDjnLoUY92WEf4dO7SS9dee+s2aOQBmhhl6KijDZspTDDF5CmzTJ11tmkLsbby4iWrLF11tWV31C5Uv1x/QC1dqNFGysfpHTX0BtXbFMnpRBwzIEacgLg6AghocsxiTczkyDlmsRGSQghGimMTRnLEACHPRLLSHbsP5H6FW5D6K9zoHXLBoft/IBcA3VfcXqA2XOf6RuzMQvdpzMi+xcOoBnOFNI0T+mECJFzgBkticdH6dRt+HACwDNuBy3016a4yHVy2l4uw4TSjufaPSnBSSzpnxbC6H5or79nqSDwiz9IGIkb2Eq/a8N2D162KuUesAHXqoDE+3A6gCjnKzS3h2L+8zfVYirBRIVoDpjmnPQ0C4iND38PI1EQNJUK2p139oc2GiVrJ1BVwYn5kQUsd7msJoZu6EOQLkRwnodpwbYo0UAF0gOCOpqNbnDMtDlan9YwsyS1Vq8BoFPIaJpfbgsayjh22gMe9g43pHbKrDSYyD6SN8gURcgou/AMA3rKh0DJhEHV150apwKUJKpuGTBhUsfpkhNAr11jEkknJU4uD/+3NARE8Vg99HntY5wJ5LmTHkAb8hvjrpq+DN8SM5IYcQIThZFV5A1MDJYGJ+Cxe/RWjXNSCALVUkI4TO/XSYewSoiakgj3685s2IYqoQLIjiAnI+EyAFHRo7u45Vi8YhWIVfNVa9hQCaZmWNb3qA//BH3zDNnwxvyEYwIm78ah5xogMfGSKhuATRnocDdQB8ocTG6iPW2YwLch5D/RSm01+HeDhsy0rdSTh4SGJ1CtaPTlHQZF2xDXcHY2Yj5TLEOKKEQ0jQJJ1SOjTrRkC5mbqyF2YiReOVyCj/7RAhoGqUR344Dij8QrFIFnYJdbA/iN4Z+IJoONy+DEBWdVQKmIWQA6i+G6z4S9p3giFkvRDyrRYZ4Iq4WRQPcln+IgHVJTAUiCv8DUSnVC+4u0ye5qLy/6dZ+AcUQ8vh+IS0w1mC3AGLb5WxE7c+FKRx1gUrKFI4KMOp4LoRS4x4tTcN+hem8Y8vgqKUX/HPYHX3oTwQ3uAZrmiUiXWDMMAf5tPruj6Lim6AXgdwGNpFXbowncsYxB75EnPowA1l6al7hKwlySvruNNAQkJyiPQ+BwsZlCviQziQWcsIkyuaCSUCXBmiijbFdn2GGjhdlPyeMOE28aF4hRnRJeO9iAZ4W3wwCMJ4TDzlviYptME+MuLcWS2c2JcdQTOR5WMk4I0rhAUHAIZPMGAxQeClxa8tL63NNXlbfhB+WmHk2sDzkNLcv9J/MJrOo19H6qT13Hd47tfAmBebeHseioh8HObFDQUcu3Wtt4ZOrEhw97SPIa1hZTh5RKApHkXa+Fr0ClBAcrwkvHKgN9kdEA+ZQDakUZI4x+lETVrRpk/OjVkuKsZ5LcLT1QZFtpEDYuH9dTsTxnzNlPc+BULSHAXES5PIEsIvKf0a3tAjZ4vVvahzjeQt4bUjx2EX6h7yt1FypNDPTmyHSjpWxpQkgHB6N1qDVfVgDXX24rTiyocwjy8nNP2DuoxqJVn1FyENjMhdNKugP6VHF2tjX9jWrjbBroAffJCRVHBMa78Xmw6eY9fFNvhfTUu5W0YIFVCaV7z4hCyxU/Jy0OdXrntmuXX5X/4/TlBF04kLfwPtGOavRFNBa4AAAGDaUNDUElDQyBwcm9maWxlAAB4nH2RPUjDQBzFX1OlIpUOZhBxyFCdLIhfOGoVilAh1AqtOphc+gVNGpIUF0fBteDgx2LVwcVZVwdXQRD8AHFydFJ0kRL/lxRaxHpw3I939x537wChXma63TUG6IZjpRJxKZNdlUKvCCMCEVMQFGabc7KcRMfxdY8AX+9iPKvzuT9Hn5azGRCQiGeZaTnEG8TTm47JeZ9YZEVFIz4nHrXogsSPXFd9fuNc8FjgmaKVTs0Ti8RSoY3VNmZFSyeeJI5qukH5QsZnjfMWZ71cZc178heGc8bKMtdpDiGBRSxBhgQVVZRQhoMYrQYpNlK0H+/gH/T8MrlUcpXAyLGACnQonh/8D353a+cnxv2kcBzofnHdj2EgtAs0aq77fey6jRMg+AxcGS1/pQ7MfJJea2nRIyCyDVxctzR1D7jcAQaeTMVSPClIU8jngfcz+qYs0H8L9K75vTX3cfoApKmr5A1wcAiMFCh7vcO7e9p7+/dMs78faWFyo+T2bHcAAAAYUExURdXV1dDQ0M3Nzdzc3NjY2NDQ0Ovr69PT0/3gchwAAAABYktHRACIBR1IAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5AwPFDUdBoqroAAAAMZJREFUKM9t0EEKwyAQBdAUe4DYBrLWExQ+mHXQmxRcBxrw+lVjdMT5y5c/cXTSWtJoreQyDSjlPKVPJC/FYErCbl4wuGAvSOYttgF/AGReqeEcDQ/5TqjbcMzWo0COFASXy7DbjKr+MOWDitVgKq624TejJj3A+wtPDKhW14ZhIsoQ83Suw1Cwlj3Foqbi6XJKsUfX4eFuNQxazyE7Tk4PtUiWD+30fHeK9/od3hctSO4ZqwTb8xEEg5ZDMAgGLYMCIx5dEX8OPbO5edULYwAAAABJRU5ErkJggg=="}},t={};function o(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,o),a.exports}o.m=e,function(){var e=[];o.O=function(t,n,i,a){if(!n){var l=1/0;for(u=0;u=a)&&Object.keys(o.O).every((function(e){return o.O[e](n[r])}))?n.splice(r--,1):(s=!1,a0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[n,i,a]}}(),function(){o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,{a:t}),t}}(),function(){o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}}(),function(){o.f={},o.e=function(e){return Promise.all(Object.keys(o.f).reduce((function(t,n){return o.f[n](e,t),t}),[]))}}(),function(){o.u=function(e){return"js/"+e+"."+{78:"51f18a44",168:"c83a23ff",338:"fff3ebb3",544:"94817512",576:"a82798ee",753:"17d4d392",775:"c55644c6",880:"e288775e",961:"2fab5ec9",990:"cdf4956e"}[e]+".js"}}(),function(){o.miniCssF=function(e){}}(),function(){o.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){var e={},t="tainacan-mobile:";o.l=function(n,i,a,l){if(e[n])e[n].push(i);else{var s,r;if(void 0!==a)for(var c=document.getElementsByTagName("script"),u=0;u [\n _createVNode(_component_ion_router_outlet)\n ]),\n _: 1\n }))\n}","\nimport { IonApp, IonRouterOutlet } from \"@ionic/vue\";\nimport { defineComponent } from \"vue\";\nimport { Device, DevicePlugin } from \"@capacitor/device\";\n\nexport default defineComponent({\n name: \"App\",\n components: {\n IonApp,\n IonRouterOutlet,\n },\n mounted() {\n const device: DevicePlugin = Device;\n device.getLanguageCode().then((res) => {\n if (res.value.includes(\"-\")) {\n const language = res.value.split(\"-\")[0];\n this.$i18n.locale = language;\n } else {\n this.$i18n.locale = res.value;\n }\n });\n },\n});\n","import { render } from \"./App.vue?vue&type=template&id=0acec4fa&ts=true\"\nimport script from \"./App.vue?vue&type=script&lang=ts\"\nexport * from \"./App.vue?vue&type=script&lang=ts\"\n\nimport exportComponent from \"/home/mateus/tainacan-mobile/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, renderSlot as _renderSlot } from \"vue\"\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_ion_back_button = _resolveComponent(\"ion-back-button\")!\n const _component_ion_buttons = _resolveComponent(\"ion-buttons\")!\n const _component_ion_img = _resolveComponent(\"ion-img\")!\n const _component_ion_icon = _resolveComponent(\"ion-icon\")!\n const _component_ion_button = _resolveComponent(\"ion-button\")!\n const _component_ion_toolbar = _resolveComponent(\"ion-toolbar\")!\n const _component_ion_title = _resolveComponent(\"ion-title\")!\n const _component_ion_header = _resolveComponent(\"ion-header\")!\n const _component_ion_content = _resolveComponent(\"ion-content\")!\n const _component_ion_toast = _resolveComponent(\"ion-toast\")!\n const _component_ion_page = _resolveComponent(\"ion-page\")!\n\n return (_openBlock(), _createBlock(_component_ion_page, null, {\n default: _withCtx(() => [\n _createVNode(_component_ion_header, { collapse: \"fade\" }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_toolbar, null, {\n default: _withCtx(() => [\n _createVNode(_component_ion_buttons, { slot: \"start\" }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_back_button, { \"default-href\": $props.pageDefaultBackLink }, null, 8, [\"default-href\"])\n ]),\n _: 1\n }),\n _createVNode(_component_ion_img, {\n src: $setup.tainacanLogo,\n class: \"header__tainacan-logo\"\n }, null, 8, [\"src\"]),\n _createVNode(_component_ion_buttons, { slot: \"end\" }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_button, {\n onClick: $options.logOff,\n \"aria-label\": \"Sair\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_icon, {\n slot: \"icon-only\",\n icon: $setup.logOutOutline\n }, null, 8, [\"icon\"])\n ]),\n _: 1\n }, 8, [\"onClick\"])\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n ($props.pageTitle)\n ? (_openBlock(), _createBlock(_component_ion_toolbar, { key: 0 }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_title, null, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString($props.pageTitle), 1)\n ]),\n _: 1\n })\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true)\n ]),\n _: 1\n }),\n _createVNode(_component_ion_content, { fullscreen: \"true\" }, {\n default: _withCtx(() => [\n _renderSlot(_ctx.$slots, \"default\")\n ]),\n _: 3\n }),\n _createVNode(_component_ion_toast, {\n \"is-open\": $setup.tainacanStore.errorStatus,\n message: _ctx.$t($setup.tainacanStore.errorMessage),\n duration: 4000,\n onDidDismiss: _cache[0] || (_cache[0] = ($event: any) => (_ctx.setOpen(false))),\n color: \"danger\"\n }, null, 8, [\"is-open\", \"message\"])\n ]),\n _: 3\n }))\n}","import { defineStore } from \"pinia\";\nimport axios from \"axios\";\nimport { Storage } from \"@ionic/storage\";\nimport {\n InAppBrowser,\n InAppBrowserObject,\n} from \"@awesome-cordova-plugins/in-app-browser/index\";\n\nconst store = new Storage();\n\nconst useWpStore = defineStore(\"wp\", {\n state() {\n return {\n userIsLoggedIn: false,\n userSiteUrl: \"\",\n userLogin: \"\",\n userToken: \"\",\n authorizationURL: \"\",\n inAppBrowser: InAppBrowserObject,\n };\n },\n\n actions: {\n async login(userSiteUrl: string, userLogin: string, userToken: string) {\n try {\n this.userIsLoggedIn = true;\n this.userSiteUrl = userSiteUrl;\n this.userLogin = userLogin;\n this.userToken = userToken;\n await store.set(\"userIsLoggedIn\", true);\n await store.set(\"userSiteUrl\", userSiteUrl);\n await store.set(\"userLogin\", userLogin);\n await store.set(\"userToken\", userToken);\n } catch (err) {\n this.userIsLoggedIn = false;\n this.userSiteUrl = \"\";\n this.userToken = \"\";\n this.userLogin = \"\";\n delete this.inAppBrowser;\n //console.error(\"Erro no login:\", err);\n return err;\n }\n },\n async logoff() {\n try {\n this.userIsLoggedIn = false;\n this.userSiteUrl = \"\";\n this.userToken = \"\";\n this.userToken = \"\";\n delete this.inAppBrowser;\n await store.set(\"userIsLoggedIn\", false);\n await store.set(\"userSiteUrl\", \"\");\n await store.set(\"userToken\", \"\");\n } catch (err) {\n this.userIsLoggedIn = false;\n this.userSiteUrl = \"\";\n this.userToken = \"\";\n this.userToken = \"\";\n this.inAppBrowser.close();\n delete this.inAppBrowser;\n //console.error(\"Erro no logoff:\", err);\n return err;\n }\n },\n async fetchApplicationAuthorization(siteUrl: string) {\n try {\n const endpoint = siteUrl + \"?rest_route=/\";\n const response = await axios.get(endpoint);\n\n if (\n response.data &&\n response.data.authentication &&\n response.data.authentication[\"application-passwords\"] &&\n response.data.authentication[\"application-passwords\"].endpoints &&\n response.data.authentication[\"application-passwords\"].endpoints\n .authorization\n )\n this.authorizationURL =\n response.data.authentication[\n \"application-passwords\"\n ].endpoints.authorization;\n else return false;\n } catch (err) {\n //console.error(\"Error trying to fetch application authorization\");\n return err;\n }\n },\n async checkUserLogin() {\n await store.create();\n this.userIsLoggedIn = await store.get(\"userIsLoggedIn\");\n this.userSiteUrl = await store.get(\"userSiteUrl\");\n this.userLogin = await store.get(\"userLogin\");\n this.userToken = await store.get(\"userToken\");\n },\n createInAppBrowser(url = '',extraParams = 'location=no,fullscreen=no,zoom=no,hardwareback=yes') {\n let tainacanAdminUrl = this.userSiteUrl + \"/wp-admin/admin.php\" + url;\n if (!this.userIsLoggedIn && this.authorizationURL) \n tainacanAdminUrl = this.authorizationURL + \"?app_name=TainacanMobileApp&success_url=\" + tainacanAdminUrl;\n \n const anInAppBrowser = InAppBrowser.create(tainacanAdminUrl, '_blank', extraParams);\n this.inAppBrowser = anInAppBrowser;\n },\n openInAppBrowser(url: string) {\n\n if (!this.inAppBrowser || !this.inAppBrowser.executeScript)\n this.createInAppBrowser(url, 'hidden=yes,location=no,fullscreen=no,zoom=no,hardwareback=yes');\n\n const urlRedirectionScript = `\n try {\n window.history.replaceState(\n null,\n null,\n '${this.userSiteUrl}/wp-admin/admin.php?page=tainacan_mobile_app'\n );\n window.history.pushState(\n null,\n null,\n '${this.userSiteUrl}/wp-admin/admin.php${url}'\n );\n window.history.go(0);\n } catch(err){\n //console.log('catch', err);\n }`;\n this.inAppBrowser.executeScript({ code: urlRedirectionScript });\n \n this.inAppBrowser.show();\n },\n hideInAppBrowser() {\n if (this.inAppBrowser && this.inAppBrowser.hide)\n this.inAppBrowser.hide();\n },\n listenEventInAppBrowser(event: any) {\n this.inAppBrowser.on('message').subscribe(event);\n this.inAppBrowser.on('exit').subscribe(() => {\n delete this.inAppBrowser;\n });\n this.inAppBrowser.on(\"loadstop\").subscribe((event: any) => {\n if (\n event.url &&\n typeof event.url == \"string\" &&\n event.url.split(\"?\") &&\n event.url.split(\"?\").length >= 2\n ) {\n const params = event.url.split(\"?\")[1];\n if ( params.indexOf(\"tainacan_mobile_app\") >= 0)\n this.inAppBrowser.hide(); \n }\n });\n }\n },\n});\nexport { useWpStore };\n","import axios from \"axios\";\nimport { defineStore } from \"pinia\";\nimport { useWpStore } from \"./storeWp\";\n\nconst useTainacanStore = defineStore(\"tainacan\", {\n state() {\n return {\n homeCollections: [],\n totalHomeCollections: 0,\n homeItems: [],\n totalHomeItems: 0,\n collections: [],\n totalCollections: 0,\n collectionItems: [],\n totalCollectionItems: 0,\n nextItemsByCollectionPage: 1,\n items: [],\n nextItemsPage: 1,\n totalItems: 0,\n errorMessage: \"\",\n errorStatus: false\n };\n },\n\n actions: {\n async fetchCollections(params: { perPage: string, orderBy: string }) {\n try {\n const wpStore = useWpStore();\n\n let endpoint = `${wpStore.userSiteUrl}/wp-json/tainacan/v2/collections?`;\n const authorization = (wpStore.userLogin && wpStore.userToken) ? ('Basic ' + btoa(wpStore.userLogin + ':' + wpStore.userToken)) : null;\n\n if (params && params.perPage)\n endpoint += '&perpage=' + params.perPage;\n \n if (params && params.orderBy)\n endpoint += '&orderby=' + params.orderBy;\n\n const response = await axios.get(endpoint, authorization ? {\n headers: {\n authorization: authorization\n }\n } : {});\n\n this.collections = response.data;\n this.totalCollections = response.headers['x-wp-total'];\n\n } catch (err) {\n this.collections = [];\n this.totalCollections = 0;\n this.errorMessage = \"error_label_fetch_collections\";\n this.errorStatus = true;\n // console.error(\"Collections loading error: \", err);\n return err;\n }\n },\n\n async fetchHomeCollections() {\n try {\n const wpStore = useWpStore();\n\n const endpoint = `${wpStore.userSiteUrl}/wp-json/tainacan/v2/collections?perpage=4&orderby=modified`;\n const authorization = (wpStore.userLogin && wpStore.userToken) ? ('Basic ' + btoa(wpStore.userLogin + ':' + wpStore.userToken)) : null;\n\n const response = await axios.get(endpoint, authorization ? {\n headers: {\n authorization: authorization\n }\n } : {});\n\n this.homeCollections = response.data;\n this.totalHomeCollections = response.headers['x-wp-total'];\n\n } catch (err) {\n this.homeCollections = [];\n this.totalHomeCollections = 0;\n this.errorMessage = \"error_label_fetch_collections\";\n this.errorStatus = true;\n //console.error(\"Home collections loading error: \", err);\n return err;\n }\n },\n\n async fetchItemsByCollection(collectionId: string, params: { perPage: string, orderBy: string, reset?: boolean, search?: string }) {\n try {\n const wpStore = useWpStore();\n\n let endpoint = `${wpStore.userSiteUrl}/wp-json/tainacan/v2/collection/${collectionId}/items?context=edit&fetch_only=id,title,thumbnail`;\n const authorization = (wpStore.userLogin && wpStore.userToken) ? ('Basic ' + btoa(wpStore.userLogin + ':' + wpStore.userToken)) : null;\n\n if (params && params.perPage)\n endpoint += '&perpage=' + params.perPage;\n else\n endpoint += '&perpage=12';\n \n if (params && params.orderBy)\n endpoint += '&orderby=' + params.orderBy;\n else\n endpoint += '&orderby=modified';\n\n if (params && params.search && params.search !== '')\n endpoint += '&search=' + params.search\n \n if (params.reset) {\n this.collectionItems = [];\n this.nextItemsByCollectionPage = 1;\n }\n\n endpoint += '&paged=' + this.nextItemsByCollectionPage;\n \n const response = await axios.get(endpoint, authorization ? {\n headers: {\n authorization: authorization\n }\n } : {});\n\n this.collectionItems.push(...response.data.items);\n this.totalCollectionItems = response.headers['x-wp-total'];\n\n if (this.totalCollectionItems && this.totalCollectionItems !== \"0\") {\n this.nextItemsByCollectionPage++;\n } \n\n } catch (err) {\n this.collectionItems = [];\n this.totalCollectionItems = 0;\n this.nextItemsByCollectionPage = 1;\n this.errorMessage = \"error_label_fetch_items_collections\";\n this.errorStatus = true;\n //console.error(\"Items collections loading error: \", err);\n return false;\n }\n },\n\n async fetchHomeItems() {\n try {\n const wpStore = useWpStore();\n const endpoint = `${wpStore.userSiteUrl}/wp-json/tainacan/v2/items?context=edit&fetch_only=id,title,thumbnail&perpage=12&orderby=modified`;\n const authorization = (wpStore.userLogin && wpStore.userToken) ? ('Basic ' + btoa(wpStore.userLogin + ':' + wpStore.userToken)) : null;\n\n const response = await axios.get(endpoint, authorization ? {\n headers: {\n authorization: authorization\n }\n } : {});\n\n this.homeItems = response.data.items;\n this.totalHomeItems = response.headers['x-wp-total'];\n \n } catch (err) {\n this.homeItems = [];\n this.totalHomeItems = 0;\n this.errorMessage = \"error_label_fetch_items_collections\";\n this.errorStatus = true;\n //console.error(\"Items collections loading error: \", err);\n return err;\n }\n },\n\n async fetchItems(params: { perPage: string, orderBy: string, reset?: boolean, search?: string }) {\n try {\n const wpStore = useWpStore();\n \n let endpoint = `${wpStore.userSiteUrl}/wp-json/tainacan/v2/items?context=edit&fetch_only=id,title,thumbnail`;\n const authorization = (wpStore.userLogin && wpStore.userToken) ? ('Basic ' + btoa(wpStore.userLogin + ':' + wpStore.userToken)) : null;\n\n if (params && params.perPage)\n endpoint += '&perpage=' + params.perPage;\n\n if (params && params.orderBy)\n endpoint += '&orderby=' + params.orderBy;\n\n if (params && params.search && params.search !== '')\n endpoint += '&search=' + params.search\n \n if (params.reset) {\n this.items = [];\n this.nextItemsPage = 1;\n }\n\n endpoint += '&paged=' + this.nextItemsPage;\n\n const response = await axios.get(endpoint, authorization ? {\n headers: {\n authorization: authorization\n }\n } : {});\n \n this.items.push(...response.data.items);\n this.totalItems = response.headers['x-wp-total'];\n\n if (this.totalItems && this.totalItems !== \"0\") {\n this.nextItemsPage++;\n } \n\n } catch (err) {\n this.items = [];\n this.totalItems = 0;\n this.nextItemsPage = 1;\n this.errorMessage = \"error_label_fetch_items\";\n this.errorStatus = true;\n //console.error(\"Items loading error: \", err);\n return err;\n }\n },\n\n async deleteItem(itemId: string|number) {\n try {\n const wpStore = useWpStore();\n \n const endpoint = `${wpStore.userSiteUrl}/wp-json/tainacan/v2/items/${itemId}`;\n const authorization = (wpStore.userLogin && wpStore.userToken) ? ('Basic ' + btoa(wpStore.userLogin + ':' + wpStore.userToken)) : null;\n\n const response = await axios.delete(endpoint, authorization ? {\n headers: {\n authorization: authorization\n }\n } : {});\n \n if (response.data && response.data.id) {\n \n const existingItemIndex = this.items.findIndex((anItem: any) => anItem.id == response.data.id);\n if (existingItemIndex >= 0)\n this.items.splice(existingItemIndex, 1);\n\n const existingHomeItemIndex = this.homeItems.findIndex((anItem: any) => anItem.id == response.data.id);\n if (existingHomeItemIndex >= 0)\n this.homeItems.splice(existingHomeItemIndex, 1);\n\n const existingCollectionItemIndex = this.collectionItems.findIndex((anItem: any) => anItem.id == response.data.id);\n if (existingCollectionItemIndex >= 0)\n this.collectionItems.splice(existingCollectionItemIndex, 1);\n }\n\n } catch (err) {\n //console.error(\"Erro ao deletar item:\", err);\n this.errorMessage = \"error_delete_item\";\n this.errorStatus = true;\n\n return err;\n }\n }\n },\n});\nexport { useTainacanStore };","\nimport { logOutOutline } from \"ionicons/icons\";\nimport { \n useWpStore\n} from '../../store/storeWp';\n\nimport {\n IonPage,\n IonHeader,\n IonToolbar,\n IonTitle,\n IonContent,\n IonIcon,\n IonBackButton,\n IonButton,\n IonButtons,\n IonImg,\n IonToast\n} from '@ionic/vue';\nimport { computed } from 'vue';\nimport { useTainacanStore } from '@/store/storeTainacan';\n\nexport default {\n props: ['pageTitle', 'pageDefaultBackLink'],\n components: {\n IonPage,\n IonHeader,\n IonToolbar,\n IonTitle,\n IonContent,\n IonIcon,\n IonButton,\n IonBackButton,\n IonButtons,\n IonImg,\n IonToast\n },\n setup(){\n const tainacanLogo = computed (() => require('../../assets/logo.png'))\n let wpStore = useWpStore();\n let tainacanStore = useTainacanStore();\n\n return {\n tainacanLogo,\n wpStore,\n logOutOutline,\n tainacanStore\n } \n },\n methods: {\n async logOff(){\n await this.wpStore.logoff();\n this.$router.go();\n }\n }\n}\n","import { render } from \"./BaseLayout.vue?vue&type=template&id=ca314930&ts=true\"\nimport script from \"./BaseLayout.vue?vue&type=script&lang=ts\"\nexport * from \"./BaseLayout.vue?vue&type=script&lang=ts\"\n\nimport \"./BaseLayout.vue?vue&type=style&index=0&id=ca314930&lang=css\"\n\nimport exportComponent from \"/home/mateus/tainacan-mobile/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, toDisplayString as _toDisplayString, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, createElementVNode as _createElementVNode, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = { key: 0 }\nconst _hoisted_2 = { key: 1 }\nconst _hoisted_3 = { key: 2 }\nconst _hoisted_4 = { key: 0 }\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_ion_img = _resolveComponent(\"ion-img\")!\n const _component_ion_thumbnail = _resolveComponent(\"ion-thumbnail\")!\n const _component_ion_icon = _resolveComponent(\"ion-icon\")!\n const _component_ion_label = _resolveComponent(\"ion-label\")!\n const _component_ion_radio = _resolveComponent(\"ion-radio\")!\n const _component_ion_item = _resolveComponent(\"ion-item\")!\n\n return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.collections, (collection) => {\n return (_openBlock(), _createBlock(_component_ion_item, {\n class: \"collection-list-item\",\n key: collection.id,\n onClick: ($event: any) => (!_ctx.isInSelectionMode ? _ctx.goToCollectionPage(collection) : '')\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_thumbnail, { slot: \"start\" }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_img, {\n src: (collection.thumbnail && collection.thumbnail.thumbnail && collection.thumbnail.thumbnail[0]) ? collection.thumbnail.thumbnail[0] : _ctx.thumbnailPlaceholder,\n alt: collection.name ? collection.name : _ctx.$('label_collection_without_name')\n }, null, 8, [\"src\", \"alt\"])\n ]),\n _: 2\n }, 1024),\n _createVNode(_component_ion_label, null, {\n default: _withCtx(() => [\n _createElementVNode(\"h2\", null, [\n _createTextVNode(_toDisplayString(collection.name ? collection.name : _ctx.$t('label_collection_without_name')) + \"  \", 1),\n (collection.status === 'private')\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_1, [\n _createVNode(_component_ion_icon, { icon: _ctx.lockClosedOutline }, null, 8, [\"icon\"])\n ]))\n : (collection.status === 'draft')\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_2, [\n _createVNode(_component_ion_icon, { icon: _ctx.readerOutline }, null, 8, [\"icon\"])\n ]))\n : (collection.status === 'trash')\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_3, [\n _createVNode(_component_ion_icon, { icon: _ctx.trashOutline }, null, 8, [\"icon\"])\n ]))\n : _createCommentVNode(\"\", true)\n ]),\n (collection.total_items)\n ? (_openBlock(), _createElementBlock(\"p\", _hoisted_4, _toDisplayString(_ctx.$t('total_of_published_items', [collection.total_items.publish])), 1))\n : _createCommentVNode(\"\", true)\n ]),\n _: 2\n }, 1024),\n (_ctx.isInSelectionMode)\n ? (_openBlock(), _createBlock(_component_ion_radio, {\n key: 0,\n slot: \"end\",\n value: collection.id\n }, null, 8, [\"value\"]))\n : _createCommentVNode(\"\", true)\n ]),\n _: 2\n }, 1032, [\"onClick\"]))\n }), 128))\n}","\nimport {\n IonItem,\n IonImg,\n IonThumbnail,\n IonLabel,\n IonIcon,\n IonRadio\n} from '@ionic/vue';\nimport { useRouter } from \"vue-router\";\nimport { lockClosedOutline, readerOutline, trashOutline } from 'ionicons/icons';\nimport { computed, defineComponent } from 'vue';\n\nexport default defineComponent({\n props: [\n \"collections\",\n \"isSelectionMode\"\n ],\n components: {\n IonItem,\n IonImg,\n IonThumbnail,\n IonLabel,\n IonIcon,\n IonRadio\n },\n setup(props) {\n const isInSelectionMode = computed(() => props.isSelectionMode);\n const thumbnailPlaceholder = computed (() => require('../../assets/placeholder_square_small.png'))\n const router = useRouter();\n const goToCollectionPage = (collection: any) => {\n router.push({\n name: 'collection',\n params: {\n id: collection.id\n },\n });\n }\n return {\n thumbnailPlaceholder,\n lockClosedOutline,\n readerOutline,\n trashOutline,\n goToCollectionPage,\n isInSelectionMode\n }\n },\n})\n","import { render } from \"./CollectionsList.vue?vue&type=template&id=cb174d0e&ts=true\"\nimport script from \"./CollectionsList.vue?vue&type=script&lang=ts\"\nexport * from \"./CollectionsList.vue?vue&type=script&lang=ts\"\n\nimport \"./CollectionsList.vue?vue&type=style&index=0&id=cb174d0e&lang=css\"\n\nimport exportComponent from \"/home/mateus/tainacan-mobile/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent, createVNode as _createVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, withCtx as _withCtx, createBlock as _createBlock } from \"vue\"\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_ion_img = _resolveComponent(\"ion-img\")!\n const _component_ion_card_title = _resolveComponent(\"ion-card-title\")!\n const _component_ion_card_header = _resolveComponent(\"ion-card-header\")!\n const _component_ion_card = _resolveComponent(\"ion-card\")!\n const _component_ion_col = _resolveComponent(\"ion-col\")!\n const _component_ion_row = _resolveComponent(\"ion-row\")!\n\n return (_openBlock(), _createBlock(_component_ion_row, { class: \"items-list-container\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.items, (item) => {\n return (_openBlock(), _createBlock(_component_ion_col, {\n size: \"4\",\n key: item.id\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_card, {\n onClick: ($event: any) => (_ctx.openActionSheet(item)),\n button: \"\",\n color: \"light\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_img, {\n src: (item.thumbnail && item.thumbnail['tainacan-medium'] && item.thumbnail['tainacan-medium'][0]) ? item.thumbnail['tainacan-medium'][0] : _ctx.thumbnailPlaceholder,\n alt: (item.thumbnail_alt ? item.thumbnail_alt : (item.title ? item.title : 'Imagem de item sem título'))\n }, null, 8, [\"src\", \"alt\"]),\n _createVNode(_component_ion_card_header, null, {\n default: _withCtx(() => [\n _createVNode(_component_ion_card_title, null, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(item.title ? item.title : _ctx.$t('label_item_without_title')), 1)\n ]),\n _: 2\n }, 1024)\n ]),\n _: 2\n }, 1024)\n ]),\n _: 2\n }, 1032, [\"onClick\"])\n ]),\n _: 2\n }, 1024))\n }), 128))\n ]),\n _: 1\n }))\n}","\nimport {\n IonCardHeader,\n IonRow,\n IonCol,\n IonCard,\n IonImg,\n IonCardTitle,\n actionSheetController,\n ActionSheetButton\n} from '@ionic/vue';\nimport { pencil, trashBin } from \"ionicons/icons\";\nimport { computed, ref, defineComponent } from 'vue';\nimport { useWpStore } from '@/store/storeWp';\nimport { useTainacanStore } from '@/store/storeTainacan';\nimport { InAppBrowserEvent } from '@awesome-cordova-plugins/in-app-browser';\n\nexport default defineComponent({\n props: [\n \"items\"\n ],\n components: {\n IonCardHeader,\n IonRow,\n IonCol,\n IonCard,\n IonImg,\n IonCardTitle\n },\n setup() {\n const wpStore = useWpStore();\n const tainacanStore = useTainacanStore();\n const thumbnailPlaceholder = computed (() => require('../../assets/placeholder_square_small.png'));\n \n const actionSheetLabels = ref({\n header: '',\n button1: '',\n button2: '',\n cancel: ''\n });\n const setActionSheetLabels = (newLabels: any) => actionSheetLabels.value = newLabels;\n const openActionSheet = async (event: any) => {\n const item = event;\n \n if (item.current_user_can_edit || item.current_user_can_delete) {\n\n let actionSheetButtons: ActionSheetButton[] = [];\n\n if (item.current_user_can_edit)\n actionSheetButtons.push({\n text: actionSheetLabels.value.button1,\n icon: pencil,\n data: 'edit-item', \n handler: () => {\n openItemEdition(item);\n },\n });\n\n if (item.current_user_can_delete)\n actionSheetButtons.push({\n text: actionSheetLabels.value.button2,\n icon: trashBin,\n data: 'delete-item', \n handler: () => {\n deleteItem(item);\n }\n });\n\n actionSheetButtons.push({\n text: actionSheetLabels.value.cancel,\n role: 'cancel'\n });\n\n let actionSheetOptions = {\n header: actionSheetLabels.value.header,\n cssClass: 'item-creation-action-sheet',\n buttons: actionSheetButtons\n };\n\n const actionSheet = await actionSheetController.create(actionSheetOptions);\n await actionSheet.present();\n }\n }\n const deleteItem = function(item: any) {\n tainacanStore.deleteItem(item.id);\n }\n const openItemEdition = function(item: any) {\n wpStore.openInAppBrowser('?page=tainacan_admin&mobileAppMode=true#/collections/' + item.collection_id + '/items/' + item.id + '/edit');\n wpStore.listenEventInAppBrowser((event: InAppBrowserEvent) => {\n if (event &&\n event.data &&\n event.data.type === 'item_updated' &&\n event.data.item &&\n event.data.item.status !== 'auto-draft'\n ) {\n wpStore.hideInAppBrowser();\n }\n });\n }\n \n return { thumbnailPlaceholder, wpStore, openItemEdition, setActionSheetLabels, openActionSheet }\n },\n async created() {\n this.setActionSheetLabels({\n header: this.$t('label_item_actions'),\n button1: this.$t('label_option_edit_item'),\n button2: this.$t('label_option_delete_item'),\n cancel: this.$t('label_cancel')\n });\n }\n});\n","import { render } from \"./ItemsList.vue?vue&type=template&id=9ba821d8&ts=true\"\nimport script from \"./ItemsList.vue?vue&type=script&lang=ts\"\nexport * from \"./ItemsList.vue?vue&type=script&lang=ts\"\n\nimport \"./ItemsList.vue?vue&type=style&index=0&id=9ba821d8&lang=css\"\n\nimport exportComponent from \"/home/mateus/tainacan-mobile/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode } from \"vue\"\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_ion_refresher_content = _resolveComponent(\"ion-refresher-content\")!\n const _component_ion_refresher = _resolveComponent(\"ion-refresher\")!\n const _component_ion_loading = _resolveComponent(\"ion-loading\")!\n const _component_ion_list_header = _resolveComponent(\"ion-list-header\")!\n const _component_collections_list = _resolveComponent(\"collections-list\")!\n const _component_ion_list = _resolveComponent(\"ion-list\")!\n const _component_ion_icon = _resolveComponent(\"ion-icon\")!\n const _component_ion_button = _resolveComponent(\"ion-button\")!\n const _component_items_list = _resolveComponent(\"items-list\")!\n const _component_base_layout = _resolveComponent(\"base-layout\")!\n\n return (_openBlock(), _createBlock(_component_base_layout, null, {\n default: _withCtx(() => [\n _createVNode(_component_ion_refresher, {\n slot: \"fixed\",\n onIonRefresh: _cache[0] || (_cache[0] = ($event: any) => ($setup.doRefresh($event)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_refresher_content)\n ]),\n _: 1\n }),\n _createVNode(_component_ion_loading, {\n \"is-open\": $setup.isLoading,\n message: _ctx.$t('label_loading')\n }, null, 8, [\"is-open\", \"message\"]),\n _createVNode(_component_ion_list, null, {\n default: _withCtx(() => [\n _createVNode(_component_ion_list_header, null, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t('label_last_modified_collections')), 1)\n ]),\n _: 1\n }),\n _createVNode(_component_collections_list, {\n collections: $setup.tainacanStore.homeCollections\n }, null, 8, [\"collections\"])\n ]),\n _: 1\n }),\n ($setup.tainacanStore.homeCollections.length < $setup.tainacanStore.totalHomeCollections)\n ? (_openBlock(), _createBlock(_component_ion_button, {\n key: 0,\n fill: \"clear\",\n size: \"small\",\n routerLink: \"/collections\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t('label_view_all_collections', [$setup.tainacanStore.totalHomeCollections])) + \" \", 1),\n _createVNode(_component_ion_icon, {\n slot: \"end\",\n icon: $setup.arrowForwardOutline\n }, null, 8, [\"icon\"])\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n _createVNode(_component_ion_list, null, {\n default: _withCtx(() => [\n _createVNode(_component_ion_list_header, null, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t('label_last_modified_items')), 1)\n ]),\n _: 1\n }),\n _createVNode(_component_items_list, {\n items: $setup.tainacanStore.homeItems\n }, null, 8, [\"items\"]),\n ($setup.tainacanStore.homeItems.length < $setup.tainacanStore.totalHomeItems)\n ? (_openBlock(), _createBlock(_component_ion_button, {\n key: 0,\n fill: \"clear\",\n size: \"small\",\n routerLink: \"/items\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t('label_view_all_items', [$setup.tainacanStore.totalHomeItems])) + \" \", 1),\n _createVNode(_component_ion_icon, {\n slot: \"end\",\n icon: $setup.arrowForwardOutline\n }, null, 8, [\"icon\"])\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true)\n ]),\n _: 1\n })\n ]),\n _: 1\n }))\n}","\nimport {\n useTainacanStore\n} from '../store/storeTainacan';\nimport { ref } from 'vue';\n\nimport CollectionsList from '@/components/lists/CollectionsList.vue';\nimport ItemsList from '@/components/lists/ItemsList.vue';\nimport BaseLayout from '@/components/base/BaseLayout.vue';\nimport { arrowForwardOutline } from \"ionicons/icons\";\nimport {\n IonIcon,\n IonButton,\n IonLoading,\n IonList,\n IonListHeader,\n IonRefresher,\n IonRefresherContent\n} from '@ionic/vue';\n\nexport default {\n components: {\n IonIcon,\n CollectionsList,\n ItemsList,\n BaseLayout,\n IonList,\n IonListHeader,\n IonButton,\n IonLoading,\n IonRefresher,\n IonRefresherContent\n },\n setup() {\n const isLoading = ref(false);\n const setIsLoading = (state: boolean) => isLoading.value = state;\n const loadCollectionsAndItems = async () => {\n await tainacanStore.fetchHomeCollections();\n await tainacanStore.fetchHomeItems();\n }\n const doRefresh = async (event: any) => {\n await loadCollectionsAndItems();\n if (event && event.target)\n event.target.complete();\n }\n\n let tainacanStore = useTainacanStore();\n\n return {\n arrowForwardOutline,\n tainacanStore,\n isLoading,\n setIsLoading,\n loadCollectionsAndItems,\n doRefresh\n }\n },\n async created() {\n this.setIsLoading(true);\n await this.loadCollectionsAndItems();\n this.setIsLoading(false);\n }\n}\n\n","import { render } from \"./HomePage.vue?vue&type=template&id=34221c58&ts=true\"\nimport script from \"./HomePage.vue?vue&type=script&lang=ts\"\nexport * from \"./HomePage.vue?vue&type=script&lang=ts\"\n\nimport exportComponent from \"/home/mateus/tainacan-mobile/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { resolveComponent as _resolveComponent, createVNode as _createVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, withCtx as _withCtx, createElementVNode as _createElementVNode, withModifiers as _withModifiers, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = /*#__PURE__*/_createElementVNode(\"br\", null, null, -1)\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_ion_img = _resolveComponent(\"ion-img\")!\n const _component_ion_label = _resolveComponent(\"ion-label\")!\n const _component_ion_input = _resolveComponent(\"ion-input\")!\n const _component_ion_item = _resolveComponent(\"ion-item\")!\n const _component_ion_list = _resolveComponent(\"ion-list\")!\n const _component_ion_icon = _resolveComponent(\"ion-icon\")!\n const _component_ion_button = _resolveComponent(\"ion-button\")!\n const _component_ion_col = _resolveComponent(\"ion-col\")!\n const _component_ion_row = _resolveComponent(\"ion-row\")!\n const _component_app_password_modal = _resolveComponent(\"app-password-modal\")!\n const _component_ion_content = _resolveComponent(\"ion-content\")!\n const _component_ion_page = _resolveComponent(\"ion-page\")!\n\n return (_openBlock(), _createBlock(_component_ion_page, null, {\n default: _withCtx(() => [\n _createVNode(_component_ion_content, {\n class: \"login-form-content\",\n fullscreen: \"\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_row, { class: \"ion-align-items-center ion-justify-content-center\" }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_col, null, {\n default: _withCtx(() => [\n _createVNode(_component_ion_img, {\n class: \"login-form-content__tainacan-logo\",\n alt: \"Logo Tainacan\",\n src: $setup.image\n }, null, 8, [\"src\"]),\n _createElementVNode(\"form\", {\n onSubmit: _cache[1] || (_cache[1] = _withModifiers(\n//@ts-ignore\n(...args) => ($options.openLoginForm && $options.openLoginForm(...args)), [\"prevent\"]))\n }, [\n _createVNode(_component_ion_list, {\n class: \"ion-no-margin\",\n inset: \"\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_item, null, {\n default: _withCtx(() => [\n _createVNode(_component_ion_label, { position: \"floating\" }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t(\"label_site_url\")), 1)\n ]),\n _: 1\n }),\n _createVNode(_component_ion_input, {\n placeholder: _ctx.$t('placeholder_site_url'),\n autofocus: \"true\",\n id: \"siteUrl\",\n type: \"url\",\n name: \"siteUrl\",\n modelValue: $data.siteUrl,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => (($data.siteUrl) = $event)),\n modelModifiers: { trim: true },\n required: \"true\",\n autocomplete: \"url\",\n enterkeyhint: \"next\"\n }, null, 8, [\"placeholder\", \"modelValue\"])\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _hoisted_1,\n _createVNode(_component_ion_button, {\n type: \"submit\",\n fill: \"clear\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t(\"label_access_archive\")) + \" \", 1),\n _createVNode(_component_ion_icon, {\n slot: \"end\",\n icon: $setup.arrowForwardOutline\n }, null, 8, [\"icon\"])\n ]),\n _: 1\n })\n ], 32)\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _createVNode(_component_app_password_modal)\n ]),\n _: 1\n })\n ]),\n _: 1\n }))\n}","import { createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = /*#__PURE__*/_createElementVNode(\"h1\", null, \"Application Passwords\", -1)\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"p\", null, [\n /*#__PURE__*/_createElementVNode(\"em\", null, \"Application passwords\"),\n /*#__PURE__*/_createTextVNode(\" are a safe way to peform operations without using your actual website password. To generate one, you must: \"),\n /*#__PURE__*/_createElementVNode(\"ol\", null, [\n /*#__PURE__*/_createElementVNode(\"li\", null, [\n /*#__PURE__*/_createTextVNode(\"Open a web browser and login do your website traditional login page (usually \"),\n /*#__PURE__*/_createElementVNode(\"em\", null, \"\\\"https://your-website.com.br/wp-admin\\\"\"),\n /*#__PURE__*/_createTextVNode(\").\")\n ]),\n /*#__PURE__*/_createElementVNode(\"li\", null, \"Go to your profile page by clicking on your picture in the upper right corner.\"),\n /*#__PURE__*/_createElementVNode(\"li\", null, \"Scroll down to the \\\"Application passwords\\\" section. There should be a text input labelled \\\"New name to the application password\\\".\"),\n /*#__PURE__*/_createElementVNode(\"li\", null, \"Fill in the text input with any value to identify this password (you can have multiple), for example: \\\"Tainacan Mobile\\\".\"),\n /*#__PURE__*/_createElementVNode(\"li\", null, \"Click on the \\\"Add new application password\\\" button.\")\n ])\n], -1)\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"p\", null, \"With this steps completed, you will receive a code, that may look like this:\", -1)\nconst _hoisted_4 = /*#__PURE__*/_createElementVNode(\"pre\", null, [\n /*#__PURE__*/_createElementVNode(\"code\", null, \"vlOh CdaH UqWw YV7X beou 6MFY\")\n], -1)\nconst _hoisted_5 = /*#__PURE__*/_createElementVNode(\"p\", null, [\n /*#__PURE__*/_createTextVNode(\"Copy this code and \"),\n /*#__PURE__*/_createElementVNode(\"strong\", null, \"keep it safe somewhere\"),\n /*#__PURE__*/_createTextVNode(\". You won't be able to access it later. Finally, paste it on this app login screen.\")\n], -1)\nconst _hoisted_6 = /*#__PURE__*/_createElementVNode(\"p\", null, \"While it should be kept logged in, if you ever loose your access to the app, you can revogate the previous passwords and generate new ones in the same screen.\", -1)\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_ion_content = _resolveComponent(\"ion-content\")!\n const _component_ion_modal = _resolveComponent(\"ion-modal\")!\n\n return (_openBlock(), _createBlock(_component_ion_modal, {\n ref: \"modal\",\n trigger: \"open-explanation-modal\",\n \"initial-breakpoint\": 0.9,\n breakpoints: [0, 0.5, 0.75, 1.0]\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_content, {\n style: {\"font-size\":\"0.9375rem\",\"opacity\":\"0.85\"},\n class: \"ion-padding\"\n }, {\n default: _withCtx(() => [\n _hoisted_1,\n _hoisted_2,\n _hoisted_3,\n _hoisted_4,\n _hoisted_5,\n _hoisted_6\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"initial-breakpoint\", \"breakpoints\"]))\n}","\n\nimport {\n IonModal,\n IonContent\n} from '@ionic/vue';\nexport default {\n components: {\n IonModal,\n IonContent\n },\n setup() {\n return {}\n }\n}\n","import { render } from \"./AppPasswordModal.vue?vue&type=template&id=381ef17c&ts=true\"\nimport script from \"./AppPasswordModal.vue?vue&type=script&lang=ts\"\nexport * from \"./AppPasswordModal.vue?vue&type=script&lang=ts\"\n\nimport exportComponent from \"/home/mateus/tainacan-mobile/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","\nimport { useTainacanStore } from \"../store/storeTainacan\";\nimport { useWpStore } from \"../store/storeWp\";\nimport { arrowForwardOutline } from \"ionicons/icons\";\nimport AppPasswordModal from \"../components/modals/AppPasswordModal.vue\";\n\nimport {\n IonIcon,\n IonImg,\n IonPage,\n IonList,\n IonItem,\n IonButton,\n IonInput,\n IonLabel,\n IonRow,\n IonCol,\n IonContent,\n} from \"@ionic/vue\";\nimport { computed } from \"vue\";\nimport { InAppBrowserEvent } from \"@awesome-cordova-plugins/in-app-browser/index\";\n\nexport default {\n props: [\"pageTitle\", \"pageDefaultBackLink\"],\n components: {\n IonIcon,\n IonImg,\n IonPage,\n IonList,\n IonItem,\n IonButton,\n IonInput,\n IonLabel,\n IonRow,\n IonCol,\n IonContent,\n AppPasswordModal,\n },\n data() {\n return {\n siteUrl: \"\",\n };\n },\n setup() {\n const image = computed(() => require(\"../assets/logo_square.png\"));\n let tainacanStore = useTainacanStore();\n let wpStore = useWpStore();\n return { image, tainacanStore, wpStore, arrowForwardOutline };\n },\n methods: {\n async openLoginForm() {\n this.wpStore.userSiteUrl = this.siteUrl;\n await this.wpStore.fetchApplicationAuthorization(this.siteUrl);\n if (this.wpStore.authorizationURL) {\n this.wpStore.createInAppBrowser('?page=tainacan_mobile_app');\n this.wpStore.inAppBrowser\n .on(\"loadstop\")\n .subscribe(this.handleBrowserLoadStop);\n }\n },\n async handleBrowserLoadStop(event: InAppBrowserEvent) {\n // console.log(event)\n if (\n event.url &&\n typeof event.url == \"string\" &&\n event.url.split(\"?\") &&\n event.url.split(\"?\").length >= 2\n ) {\n const params = new URLSearchParams(event.url.split(\"?\")[1]);\n \n if ( params.get(\"page\") === \"tainacan_mobile_app\" ) {\n const userLogin = params.get(\"user_login\");\n let userToken = params.get(\"password\");\n\n if (\n typeof userToken == \"string\" &&\n userToken.indexOf(\"#\") >= 0\n )\n userToken = userToken.split(\"#\")[0];\n\n if (!!userLogin && !!userToken) {\n await this.wpStore.login(\n this.siteUrl,\n userLogin,\n userToken\n );\n this.$router.replace(\"/home\");\n }\n this.wpStore.inAppBrowser.hide();\n }\n }\n },\n fakeLogin() {\n this.wpStore.login(\n 'https://rcteste.tainacan.org',\n '',\n ''\n );\n this.$router.push(\"/home\");\n }\n },\n};\n","import { render } from \"./LoginPage.vue?vue&type=template&id=63c2aa1e&ts=true\"\nimport script from \"./LoginPage.vue?vue&type=script&lang=ts\"\nexport * from \"./LoginPage.vue?vue&type=script&lang=ts\"\n\nimport \"./LoginPage.vue?vue&type=style&index=0&id=63c2aa1e&lang=css\"\n\nimport exportComponent from \"/home/mateus/tainacan-mobile/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, createElementBlock as _createElementBlock, createTextVNode as _createTextVNode } from \"vue\"\n\nconst _hoisted_1 = {\n key: 1,\n class: \"results-not-found\"\n}\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_ion_refresher_content = _resolveComponent(\"ion-refresher-content\")!\n const _component_ion_refresher = _resolveComponent(\"ion-refresher\")!\n const _component_ion_searchbar = _resolveComponent(\"ion-searchbar\")!\n const _component_ion_toolbar = _resolveComponent(\"ion-toolbar\")!\n const _component_ion_loading = _resolveComponent(\"ion-loading\")!\n const _component_ion_spinner = _resolveComponent(\"ion-spinner\")!\n const _component_items_list = _resolveComponent(\"items-list\")!\n const _component_ion_infinite_scroll_content = _resolveComponent(\"ion-infinite-scroll-content\")!\n const _component_ion_infinite_scroll = _resolveComponent(\"ion-infinite-scroll\")!\n const _component_ion_icon = _resolveComponent(\"ion-icon\")!\n const _component_ion_button = _resolveComponent(\"ion-button\")!\n const _component_base_layout = _resolveComponent(\"base-layout\")!\n\n return (_openBlock(), _createBlock(_component_base_layout, {\n \"page-title\": _ctx.$t('label_collection_items_list'),\n \"page-default-back-link\": \"/collections\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_refresher, {\n slot: \"fixed\",\n onIonRefresh: _cache[0] || (_cache[0] = ($event: any) => (_ctx.doRefresh($event)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_refresher_content)\n ]),\n _: 1\n }),\n _createVNode(_component_ion_toolbar, null, {\n default: _withCtx(() => [\n _createVNode(_component_ion_searchbar, {\n debounce: \"500\",\n placeholder: _ctx.$t('label_search'),\n onIonChange: _cache[1] || (_cache[1] = ($event: any) => (_ctx.handleSearch($event)))\n }, null, 8, [\"placeholder\"])\n ]),\n _: 1\n }),\n _createVNode(_component_ion_loading, {\n \"is-open\": _ctx.isLoading,\n message: _ctx.$t('label_loading')\n }, null, 8, [\"is-open\", \"message\"]),\n (_ctx.isSearching)\n ? (_openBlock(), _createBlock(_component_ion_spinner, { key: 0 }))\n : _createCommentVNode(\"\", true),\n (!_ctx.isLoading && !_ctx.isSearching && (!_ctx.tainacanStore.totalCollectionItems || _ctx.tainacanStore.totalCollectionItems == '0'))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"span\", null, _toDisplayString(_ctx.$t('label_no_results_found')), 1)\n ]))\n : _createCommentVNode(\"\", true),\n _createVNode(_component_items_list, {\n items: _ctx.tainacanStore.collectionItems\n }, null, 8, [\"items\"]),\n _createVNode(_component_ion_infinite_scroll, {\n ref: \"infiniteScroll\",\n threshold: \"5%\",\n onIonInfinite: _ctx.loadItemsByCollection\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_infinite_scroll_content)\n ]),\n _: 1\n }, 8, [\"onIonInfinite\"]),\n _createVNode(_component_ion_button, {\n class: \"add-items-button\",\n color: \"primary\",\n onClick: _cache[2] || (_cache[2] = ($event: any) => (_ctx.openActionSheet()))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_icon, { icon: _ctx.add }, null, 8, [\"icon\"]),\n _createTextVNode(\"  \" + _toDisplayString(_ctx.$t('label_add_items')), 1)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"page-title\"]))\n}","\nimport {\n useTainacanStore\n} from '../store/storeTainacan';\nimport { useWpStore } from '../store/storeWp';\nimport { ref, defineComponent } from 'vue';\nimport { add, documentOutline } from \"ionicons/icons\";\nimport {\n IonLoading,\n IonRefresher,\n IonRefresherContent,\n IonIcon,\n IonButton,\n actionSheetController,\n IonInfiniteScroll,\n IonToolbar,\n IonSearchbar,\n IonSpinner,\n IonInfiniteScrollContent\n} from '@ionic/vue';\nimport BaseLayout from '@/components/base/BaseLayout.vue';\nimport ItemsList from '@/components/lists/ItemsList.vue';\nimport { InAppBrowserEvent } from '@awesome-cordova-plugins/in-app-browser';\n\nexport default defineComponent({\n components: {\n BaseLayout,\n ItemsList,\n IonLoading,\n IonRefresher,\n IonRefresherContent,\n IonIcon,\n IonButton,\n IonInfiniteScroll,\n IonToolbar,\n IonSearchbar,\n IonSpinner,\n IonInfiniteScrollContent\n },\n props: {\n id: String\n },\n setup(props) {\n const isLoading = ref(false);\n const isSearching = ref(false)\n const search = ref();\n const infiniteScroll = ref();\n const setIsLoading = (state: boolean) => isLoading.value = state;\n const setIsSearching = (state: boolean) => isSearching.value = state;\n const setSearch = (value: string) => search.value = value;\n const loadItemsByCollection = async (event: any, reset: boolean) => {\n await tainacanStore.fetchItemsByCollection(props.id + '', { perPage: '12', orderBy: 'modified', reset: reset, search: search.value});\n let hasMoreCollectionsItems = tainacanStore.totalCollectionItems && tainacanStore.totalCollectionItems !== 0;\n if (event && event.target)\n event.target.complete();\n if (!hasMoreCollectionsItems){\n infiniteScroll.value.$el.disabled = true;\n }\n } \n const cancelSearch = async () => {\n await loadItemsByCollection(null, true);\n }\n const handleSearch = async (event: any) => {\n let search = event && event.detail && event.detail.value;\n\n setSearch(search);\n setIsSearching(true);\n\n if(search !== '') { \n await loadItemsByCollection(null, true);\n } else {\n await cancelSearch();\n }\n setIsSearching(false);\n }\n const doRefresh = async (event: any) => {\n await loadItemsByCollection({}, true);\n if (event && event.target){\n event.target.complete();\n infiniteScroll.value.$el.disabled = false;\n }\n }\n\n const wpStore = useWpStore();\n const actionSheetLabels = ref({\n header: '',\n button1: '',\n button2: '',\n button3: '',\n cancel: ''\n });\n const setActionSheetLabels = (newLabels: any) => actionSheetLabels.value = newLabels;\n const openActionSheet = async () => {\n const actionSheet = await actionSheetController.create({\n header: actionSheetLabels.value.header,\n cssClass: 'item-creation-action-sheet',\n buttons: [\n // {\n // text: actionSheetLabels.value.button1,\n // icon: documentsOutline,\n // data: 'multiple-items', \n // handler: () => {\n // wpStore.openInAppBrowser('?page=tainacan_admin&mobileAppMode=true#/collections/' + props.id + '/bulk-add');\n // wpStore.listenEventInAppBrowser((event: InAppBrowserEvent) => {\n // if (event &&\n // event.data &&\n // (\n // (\n // event.data.type === 'item_updated' &&\n // event.data.item &&\n // event.data.item.status !== 'auto-draft'\n // )\n // || event.data.type === 'exited_from_navigation'\n // )\n // ) {\n // wpStore.hideInAppBrowser();\n // loadItemsByCollection({}, true);\n // }\n // });\n // },\n // },\n {\n text: actionSheetLabels.value.button3,\n icon: documentOutline,\n data: 'single item',\n handler: () => {\n wpStore.openInAppBrowser('?page=tainacan_admin&mobileAppMode=true#/collections/' + props.id + '/items/new');\n wpStore.listenEventInAppBrowser((event: InAppBrowserEvent) => {\n if (event &&\n event.data &&\n event.data.type === 'item_updated' &&\n event.data.item &&\n event.data.item.status !== 'auto-draft'\n ) {\n wpStore.hideInAppBrowser();\n loadItemsByCollection({}, true);\n }\n });\n },\n },\n {\n text: actionSheetLabels.value.cancel,\n role: 'cancel'\n },\n ],\n });\n await actionSheet.present();\n //const { role, data } = await actionSheet.onDidDismiss();\n // console.log('onDidDismiss resolved with role and data', role, data);\n }\n\n let tainacanStore = useTainacanStore();\n return {\n isLoading,\n isSearching,\n tainacanStore,\n wpStore,\n setIsLoading,\n loadItemsByCollection,\n doRefresh,\n openActionSheet,\n add,\n actionSheetLabels,\n setActionSheetLabels,\n infiniteScroll,\n handleSearch,\n }\n },\n async created() {\n \n this.setActionSheetLabels({\n header: this.$t('info_create_items'),\n button1: this.$t('label_option_multiple_items'),\n button2: this.$t('label_option_multiple_attachments'),\n button3: this.$t('label_option_single_item'),\n cancel: this.$t('label_cancel')\n });\n this.setIsLoading(true);\n await this.loadItemsByCollection({}, true);\n this.setIsLoading(false);\n },\n});\n","import { render } from \"./CollectionPage.vue?vue&type=template&id=48252aad&ts=true\"\nimport script from \"./CollectionPage.vue?vue&type=script&lang=ts\"\nexport * from \"./CollectionPage.vue?vue&type=script&lang=ts\"\n\nimport \"./CollectionPage.vue?vue&type=style&index=0&id=48252aad&lang=css\"\n\nimport exportComponent from \"/home/mateus/tainacan-mobile/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_ion_loading = _resolveComponent(\"ion-loading\")!\n const _component_ion_refresher_content = _resolveComponent(\"ion-refresher-content\")!\n const _component_ion_refresher = _resolveComponent(\"ion-refresher\")!\n const _component_collections_list = _resolveComponent(\"collections-list\")!\n const _component_ion_list = _resolveComponent(\"ion-list\")!\n const _component_base_layout = _resolveComponent(\"base-layout\")!\n\n return (_openBlock(), _createBlock(_component_base_layout, {\n \"page-title\": _ctx.$t('label_collections_list'),\n \"page-default-back-link\": \"/\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_loading, {\n \"is-open\": $setup.isLoading,\n message: _ctx.$t('label_loading')\n }, null, 8, [\"is-open\", \"message\"]),\n _createVNode(_component_ion_refresher, {\n slot: \"fixed\",\n onIonRefresh: _cache[0] || (_cache[0] = ($event: any) => ($setup.doRefresh($event)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_refresher_content)\n ]),\n _: 1\n }),\n _createVNode(_component_ion_list, null, {\n default: _withCtx(() => [\n _createVNode(_component_collections_list, {\n collections: $setup.tainacanStore.collections,\n \"is-selection-mode\": false\n }, null, 8, [\"collections\"])\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"page-title\"]))\n}","\nimport CollectionsList from '@/components/lists/CollectionsList.vue';\nimport BaseLayout from '@/components/base/BaseLayout.vue';\nimport {\n IonLoading,\n IonList,\n IonRefresher,\n IonRefresherContent\n} from '@ionic/vue';\n\nimport {\n useTainacanStore\n} from '../store/storeTainacan';\n\nimport { ref } from 'vue';\n\nexport default {\n components: {\n CollectionsList,\n BaseLayout,\n IonLoading,\n IonList,\n IonRefresher,\n IonRefresherContent\n },\n setup() {\n const isLoading = ref(false);\n const setIsLoading = (state: boolean) => isLoading.value = state;\n \n const loadCollections = async () => {\n await tainacanStore.fetchCollections({ perPage: '24', orderBy: 'modified'});\n }\n const doRefresh = async (event: any) => {\n await loadCollections();\n if (event && event.target)\n event.target.complete();\n }\n\n let tainacanStore = useTainacanStore();\n \n return {\n tainacanStore,\n isLoading,\n setIsLoading,\n doRefresh,\n loadCollections\n }\n },\n async created(){\n this.setIsLoading(true);\n await this.loadCollections();\n this.setIsLoading(false);\n },\n}\n\n","import { render } from \"./CollectionsPage.vue?vue&type=template&id=86b52ab4&ts=true\"\nimport script from \"./CollectionsPage.vue?vue&type=script&lang=ts\"\nexport * from \"./CollectionsPage.vue?vue&type=script&lang=ts\"\n\nimport exportComponent from \"/home/mateus/tainacan-mobile/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5ba64bfe\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = {\n key: 1,\n class: \"results-not-found\"\n}\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_ion_loading = _resolveComponent(\"ion-loading\")!\n const _component_ion_searchbar = _resolveComponent(\"ion-searchbar\")!\n const _component_ion_toolbar = _resolveComponent(\"ion-toolbar\")!\n const _component_ion_refresher_content = _resolveComponent(\"ion-refresher-content\")!\n const _component_ion_refresher = _resolveComponent(\"ion-refresher\")!\n const _component_ion_spinner = _resolveComponent(\"ion-spinner\")!\n const _component_items_list = _resolveComponent(\"items-list\")!\n const _component_ion_infinite_scroll_content = _resolveComponent(\"ion-infinite-scroll-content\")!\n const _component_ion_infinite_scroll = _resolveComponent(\"ion-infinite-scroll\")!\n const _component_base_layout = _resolveComponent(\"base-layout\")!\n\n return (_openBlock(), _createBlock(_component_base_layout, {\n \"page-title\": _ctx.$t('label_items_list'),\n \"page-default-back-link\": \"/collections\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_loading, {\n \"is-open\": $setup.isLoading,\n message: _ctx.$t('label_loading')\n }, null, 8, [\"is-open\", \"message\"]),\n _createVNode(_component_ion_toolbar, null, {\n default: _withCtx(() => [\n _createVNode(_component_ion_searchbar, {\n debounce: \"500\",\n placeholder: _ctx.$t('label_search'),\n onIonChange: _cache[0] || (_cache[0] = ($event: any) => ($setup.handleSearch($event)))\n }, null, 8, [\"placeholder\"])\n ]),\n _: 1\n }),\n _createVNode(_component_ion_refresher, {\n slot: \"fixed\",\n onIonRefresh: _cache[1] || (_cache[1] = ($event: any) => ($setup.doRefresh($event)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_refresher_content)\n ]),\n _: 1\n }),\n ($setup.isSearching)\n ? (_openBlock(), _createBlock(_component_ion_spinner, { key: 0 }))\n : _createCommentVNode(\"\", true),\n (!$setup.isLoading && !$setup.isSearching && (!$setup.tainacanStore.totalItems || $setup.tainacanStore.totalItems == '0'))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"span\", null, _toDisplayString(_ctx.$t('label_no_results_found')), 1)\n ]))\n : _createCommentVNode(\"\", true),\n _createVNode(_component_items_list, {\n items: $setup.tainacanStore.items\n }, null, 8, [\"items\"]),\n _createVNode(_component_ion_infinite_scroll, {\n ref: \"infiniteScroll\",\n threshold: \"5%\",\n onIonInfinite: $setup.loadItems\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_infinite_scroll_content)\n ]),\n _: 1\n }, 8, [\"onIonInfinite\"])\n ]),\n _: 1\n }, 8, [\"page-title\"]))\n}","\nimport {\n useTainacanStore\n} from '../store/storeTainacan';\nimport {\n IonLoading,\n IonRefresher,\n IonRefresherContent,\n IonInfiniteScroll,\n IonToolbar,\n IonSearchbar,\n IonSpinner,\n IonInfiniteScrollContent\n} from '@ionic/vue';\nimport BaseLayout from '@/components/base/BaseLayout.vue';\nimport { ref } from 'vue';\nimport ItemsList from '../components/lists/ItemsList.vue';\nexport default {\n components: {\n IonLoading,\n ItemsList,\n BaseLayout,\n IonRefresher,\n IonRefresherContent,\n IonInfiniteScroll,\n IonToolbar,\n IonSearchbar,\n IonSpinner, \n IonInfiniteScrollContent\n },\n setup() {\n const isLoading = ref(false);\n const isSearching = ref(false)\n const search = ref();\n const setIsLoading = (state: boolean) => isLoading.value = state;\n const setIsSearching = (state: boolean) => isSearching.value = state;\n const setSearch = (value: string) => search.value = value; \n const infiniteScroll = ref();\n const loadItems = async (event: any, reset: boolean) => {\n await tainacanStore.fetchItems({ perPage: '12', orderBy: 'modified', reset: reset, search: search.value});\n let hasMoreItems = tainacanStore.totalItems && tainacanStore.totalItems !== 0;\n if (event && event.target)\n event.target.complete();\n if (!hasMoreItems){\n infiniteScroll.value.$el.disabled = true;\n }\n } \n const cancelSearch = async () => {\n await loadItems(null, true);\n }\n const handleSearch = async (event: any) => {\n let search = event && event.detail && event.detail.value;\n \n setSearch(search);\n setIsSearching(true);\n\n if(search !== '') {\n await loadItems(null, true);\n setIsSearching(false);\n } else {\n await cancelSearch();\n }\n setIsSearching(false);\n }\n const doRefresh = async (event: any) => {\n await loadItems({}, true);\n if (event && event.target){\n event.target.complete();\n infiniteScroll.value.$el.disabled = false;\n }\n }\n let tainacanStore = useTainacanStore();\n return {\n isLoading,\n isSearching,\n setIsLoading,\n tainacanStore,\n doRefresh,\n loadItems,\n infiniteScroll,\n handleSearch\n }\n },\n async created(){\n this.setIsLoading(true)\n await this.loadItems();\n this.setIsLoading(false)\n },\n}\n","import { render } from \"./ItemsPage.vue?vue&type=template&id=5ba64bfe&scoped=true&ts=true\"\nimport script from \"./ItemsPage.vue?vue&type=script&lang=ts\"\nexport * from \"./ItemsPage.vue?vue&type=script&lang=ts\"\n\nimport \"./ItemsPage.vue?vue&type=style&index=0&id=5ba64bfe&scoped=true&lang=css\"\n\nimport exportComponent from \"/home/mateus/tainacan-mobile/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-5ba64bfe\"]])\n\nexport default __exports__","import { createRouter, createWebHistory } from '@ionic/vue-router';\nimport { RouteRecordRaw } from 'vue-router';\nimport { useWpStore } from '../store/storeWp'\n\nimport HomePage from '../pages/HomePage.vue';\nimport LoginPage from '../pages/LoginPage.vue';\nimport CollectionPage from '../pages/CollectionPage.vue';\nimport CollectionsPage from '../pages/CollectionsPage.vue';\nimport ItemsPage from '../pages/ItemsPage.vue';\n\nconst routes: Array = [\n {\n path: '/',\n redirect: '/home'\n },\n {\n path: '/home',\n component: HomePage,\n name: 'home'\n },\n {\n path: '/login',\n component: LoginPage,\n name: 'login'\n },\n {\n path: '/collections/:id',\n component: CollectionPage,\n name: 'collection',\n props: true\n },\n {\n path: '/collections',\n component: CollectionsPage,\n name: 'collections'\n },\n {\n path: '/items',\n component: ItemsPage,\n name: 'items'\n }\n]\n\nconst router = createRouter({\n history: createWebHistory(process.env.BASE_URL),\n routes\n})\n\nrouter.beforeEach(async(to, from, next) => {\n const wpStore = useWpStore();\n await wpStore.checkUserLogin();\n if (to.name !== 'login' && !wpStore.userIsLoggedIn) next({ name: 'login' })\n else next()\n})\n\nexport default router\n\n","export const translationStrings = {\n en: {\n collections: 'Collections',\n label_view_all_collections: 'View all {0} collections',\n items: 'Items',\n label_view_all_items: 'View all {0} items',\n label_loading: 'Loading...',\n label_items_list: 'Items list',\n label_collections_list: 'Collections list',\n label_collection_items_list: 'Collection items list',\n collection: 'Collection',\n label_site_url: 'Archive site URL',\n placeholder_site_url: 'https://my-tainacan-archive.com',\n label_user_name: 'User name',\n placeholder_user_name: 'your user name',\n label_user_password: 'User application password',\n placeholder_user_password: 'your application password here',\n label_access_archive: 'Access archive',\n label_item_without_title: 'Item without title',\n label_collection_without_name: 'Collection without name',\n total_of_published_items: 'Total of {0} published items',\n label_last_modified_collections: 'Last modified collections',\n label_last_modified_items: 'Last modified itens',\n label_add_items: 'Add items',\n info_create_items: 'Create new items in this collection',\n label_option_multiple_items: 'Multiple items from file selection',\n label_option_multiple_attachments: 'Single item with document and attachments from file selection',\n label_option_single_item: 'Single empty item',\n label_cancel: 'Cancel',\n label_search: 'Search',\n label_no_results_found: 'No results found',\n info_application_password: 'This password is not the same of your WordPress admin.',\n label_learn_more_here: 'Learn more here',\n label_item_actions: 'Item actions',\n label_option_edit_item: 'Edit item',\n label_option_delete_item: 'Send item to trash',\n error_label_fetch_collections: 'Collections loading error',\n error_label_fetch_items_collections: 'Items collections loading error',\n error_label_fetch_items: 'Items loading error',\n error_delete_item: 'Error while deleting item'\n },\n pt: {\n collections: \"Coleções\",\n label_view_all_collections: \"Ver todas as {0} coleções\",\n items: 'Itens',\n label_view_all_items: 'Ver todos os {0} itens',\n label_loading: 'Carregando...',\n label_items_list: 'Lista de itens',\n label_collections_list: 'Lista de coleções',\n label_collection_items_list: 'Lista de itens da coleção',\n collection: 'Coleção',\n label_site_url: 'URL do Site do Acervo',\n placeholder_site_url: 'https://meu-acervo-tainacan.com',\n label_user_name: 'Nome de usuário',\n placeholder_user_name: 'seu nome de usuário aqui',\n label_user_password: 'Senha do usuário da aplicação',\n placeholder_user_password: 'sua senha de usuário da aplicação aqui',\n label_access_archive: 'Acessar acervo',\n label_item_without_title: 'Item sem título',\n label_collection_without_name: 'Coleção sem nome',\n total_of_published_items: 'Total de {0} itens públicos',\n label_last_modified_collections: 'Coleções alteradas recentemente',\n label_last_modified_items: 'Itens alterados recentemente',\n label_add_items: 'Adicionar itens',\n info_create_items: 'Crie novos itens nesta coleção',\n label_option_multiple_items: 'Vários itens a partir de uma seleção de arquivos',\n label_option_multiple_attachments: 'Um item com documento e anexos provenientes de ums seleção de aquivos',\n label_option_single_item: 'Um item vazio',\n label_cancel: 'Cancelar',\n label_search: 'Buscar',\n label_no_results_found: 'Nenhum resultado encontrado',\n info_application_password: 'Esta senha não é a mesma do seu painel admin do WordPress.',\n label_learn_more_here: 'Saiba mais aqui.',\n label_item_actions: 'Ações para o item',\n label_option_edit_item: 'Editar item',\n label_option_delete_item: 'Enviar item para lixeira',\n error_label_fetch_collections: 'Erro no carregamento das coleções',\n error_label_fetch_items_collections: 'Erro no carregamento dos itens da coleção',\n error_label_fetch_items: 'Erro no carregamento dos itens',\n error_delete_item: 'Erro ao tentar remover item'\n }\n}","import { createApp } from 'vue'\n\nimport App from './App.vue'\nimport BaseLayout from './components/base/BaseLayout.vue';\nimport CollectionList from './components/lists/CollectionsList.vue';\nimport ItemList from './components/lists/ItemsList.vue';\nimport router from './router';\nimport { createPinia } from 'pinia';\n\nimport { IonicVue } from '@ionic/vue';\n\n/* Core CSS required for Ionic components to work properly */\nimport '@ionic/vue/css/core.css';\n\n/* Basic CSS for apps built with Ionic */\nimport '@ionic/vue/css/normalize.css';\nimport '@ionic/vue/css/structure.css';\nimport '@ionic/vue/css/typography.css';\n\n/* Optional CSS utils that can be commented out */\nimport '@ionic/vue/css/padding.css';\nimport '@ionic/vue/css/float-elements.css';\nimport '@ionic/vue/css/text-alignment.css';\nimport '@ionic/vue/css/text-transformation.css';\nimport '@ionic/vue/css/flex-utils.css';\nimport '@ionic/vue/css/display.css';\n\n/* Theme variables */\nimport './theme/variables.css';\nimport './theme/core.css'; //importei do arquivo criado\n\n/* Translation */\nimport { createI18n } from 'vue-i18n';\nimport { translationStrings } from './locales/translation-strings';\n\nconst i18n = createI18n({\n locale: 'en', // set locale\n fallbackLocale: 'en', // set fallback locale\n messages: translationStrings, // set locale messages\n })\n\nconst app = createApp(App)\n .use(IonicVue)\n .use(router)\n .use(createPinia())\n .use(i18n);\n\napp.component('base-layout', BaseLayout);\napp.component('base-collectionlist', CollectionList);\napp.component('base-itemlist', ItemList);\n \nrouter.isReady().then(() => {\n app.mount('#app');\n});","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = function(result, chunkIds, fn, priority) {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = function(chunkId) {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"js/\" + chunkId + \".\" + {\"78\":\"51f18a44\",\"168\":\"c83a23ff\",\"338\":\"fff3ebb3\",\"544\":\"94817512\",\"576\":\"a82798ee\",\"753\":\"17d4d392\",\"775\":\"c55644c6\",\"880\":\"e288775e\",\"961\":\"2fab5ec9\",\"990\":\"cdf4956e\"}[chunkId] + \".js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = function(chunkId) {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","var inProgress = {};\nvar dataWebpackPrefix = \"tainacan-mobile:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = function(url, done, key, chunkId) {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = function(prev, event) {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach(function(fn) { return fn(event); });\n\t\tif(prev) return prev(event);\n\t}\n\t;\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"/\";","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t143: 0\n};\n\n__webpack_require__.f.j = function(chunkId, promises) {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise(function(resolve, reject) { installedChunkData = installedChunks[chunkId] = [resolve, reject]; });\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = function(event) {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunktainacan_mobile\"] = self[\"webpackChunktainacan_mobile\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [998], function() { return __webpack_require__(2057); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["webpackEmptyAsyncContext","req","Promise","resolve","then","e","Error","code","keys","id","module","exports","render","_ctx","_cache","$props","$setup","$data","$options","_component_ion_router_outlet","_resolveComponent","_component_ion_app","_openBlock","_createBlock","default","_withCtx","_createVNode","_","defineComponent","name","components","IonApp","IonRouterOutlet","mounted","device","Device","getLanguageCode","res","value","includes","language","split","this","$i18n","locale","__exports__","_component_ion_back_button","_component_ion_buttons","_component_ion_img","_component_ion_icon","_component_ion_button","_component_ion_toolbar","_component_ion_title","_component_ion_header","_component_ion_content","_component_ion_toast","_component_ion_page","collapse","slot","pageDefaultBackLink","src","tainacanLogo","class","onClick","logOff","icon","logOutOutline","pageTitle","key","_createTextVNode","_toDisplayString","_createCommentVNode","fullscreen","_renderSlot","$slots","tainacanStore","errorStatus","message","$t","errorMessage","duration","onDidDismiss","$event","setOpen","color","store","Storage","useWpStore","defineStore","state","userIsLoggedIn","userSiteUrl","userLogin","userToken","authorizationURL","inAppBrowser","InAppBrowserObject","actions","async","set","err","close","siteUrl","endpoint","response","axios","data","authentication","endpoints","authorization","create","get","createInAppBrowser","url","extraParams","tainacanAdminUrl","anInAppBrowser","InAppBrowser","openInAppBrowser","executeScript","urlRedirectionScript","show","hideInAppBrowser","hide","listenEventInAppBrowser","event","on","subscribe","length","params","indexOf","useTainacanStore","homeCollections","totalHomeCollections","homeItems","totalHomeItems","collections","totalCollections","collectionItems","totalCollectionItems","nextItemsByCollectionPage","items","nextItemsPage","totalItems","wpStore","btoa","perPage","orderBy","headers","collectionId","search","reset","push","itemId","existingItemIndex","findIndex","anItem","splice","existingHomeItemIndex","existingCollectionItemIndex","props","IonPage","IonHeader","IonToolbar","IonTitle","IonContent","IonIcon","IonButton","IonBackButton","IonButtons","IonImg","IonToast","setup","computed","require","methods","logoff","$router","go","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_component_ion_thumbnail","_component_ion_label","_component_ion_radio","_component_ion_item","_createElementBlock","_Fragment","_renderList","collection","isInSelectionMode","goToCollectionPage","thumbnail","thumbnailPlaceholder","alt","$","_createElementVNode","status","lockClosedOutline","readerOutline","trashOutline","total_items","publish","IonItem","IonThumbnail","IonLabel","IonRadio","isSelectionMode","router","useRouter","_component_ion_card_title","_component_ion_card_header","_component_ion_card","_component_ion_col","_component_ion_row","item","size","openActionSheet","button","thumbnail_alt","title","IonCardHeader","IonRow","IonCol","IonCard","IonCardTitle","actionSheetLabels","ref","header","button1","button2","cancel","setActionSheetLabels","newLabels","current_user_can_edit","current_user_can_delete","actionSheetButtons","text","pencil","handler","openItemEdition","trashBin","deleteItem","role","actionSheetOptions","cssClass","buttons","actionSheet","actionSheetController","present","collection_id","type","_component_ion_refresher_content","_component_ion_refresher","_component_ion_loading","_component_ion_list_header","_component_collections_list","_component_ion_list","_component_items_list","_component_base_layout","onIonRefresh","doRefresh","isLoading","fill","routerLink","arrowForwardOutline","CollectionsList","ItemsList","BaseLayout","IonList","IonListHeader","IonLoading","IonRefresher","IonRefresherContent","setIsLoading","loadCollectionsAndItems","fetchHomeCollections","fetchHomeItems","target","complete","_component_ion_input","_component_app_password_modal","image","onSubmit","_withModifiers","args","openLoginForm","inset","position","placeholder","autofocus","modelValue","modelModifiers","trim","required","autocomplete","enterkeyhint","_hoisted_5","_hoisted_6","_component_ion_modal","trigger","breakpoints","style","IonModal","IonInput","AppPasswordModal","fetchApplicationAuthorization","handleBrowserLoadStop","URLSearchParams","login","replace","fakeLogin","_component_ion_searchbar","_component_ion_spinner","_component_ion_infinite_scroll_content","_component_ion_infinite_scroll","debounce","onIonChange","handleSearch","isSearching","threshold","onIonInfinite","loadItemsByCollection","add","IonInfiniteScroll","IonSearchbar","IonSpinner","IonInfiniteScrollContent","String","infiniteScroll","setIsSearching","setSearch","fetchItemsByCollection","hasMoreCollectionsItems","$el","disabled","cancelSearch","detail","button3","documentOutline","loadCollections","fetchCollections","loadItems","fetchItems","hasMoreItems","routes","path","redirect","component","HomePage","LoginPage","CollectionPage","CollectionsPage","ItemsPage","createRouter","history","createWebHistory","process","beforeEach","to","from","next","checkUserLogin","translationStrings","en","label_view_all_collections","label_view_all_items","label_loading","label_items_list","label_collections_list","label_collection_items_list","label_site_url","placeholder_site_url","label_user_name","placeholder_user_name","label_user_password","placeholder_user_password","label_access_archive","label_item_without_title","label_collection_without_name","total_of_published_items","label_last_modified_collections","label_last_modified_items","label_add_items","info_create_items","label_option_multiple_items","label_option_multiple_attachments","label_option_single_item","label_cancel","label_search","label_no_results_found","info_application_password","label_learn_more_here","label_item_actions","label_option_edit_item","label_option_delete_item","error_label_fetch_collections","error_label_fetch_items_collections","error_label_fetch_items","error_delete_item","pt","i18n","createI18n","fallbackLocale","messages","app","createApp","App","use","IonicVue","createPinia","CollectionList","ItemList","mount","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","m","deferred","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","fulfilled","j","Object","every","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","f","chunkId","all","reduce","promises","u","miniCssF","g","globalThis","Function","window","obj","prop","prototype","hasOwnProperty","call","inProgress","dataWebpackPrefix","l","done","script","needAttach","scripts","document","getElementsByTagName","s","getAttribute","createElement","charset","timeout","nc","setAttribute","onScriptComplete","prev","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","forEach","setTimeout","bind","head","appendChild","Symbol","toStringTag","p","installedChunks","installedChunkData","promise","reject","error","loadingEnded","errorType","realSrc","request","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","self","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/ios/App/App/public/js/app.ba3e8dbe.js b/ios/App/App/public/js/app.ba3e8dbe.js deleted file mode 100644 index fea9500..0000000 --- a/ios/App/App/public/js/app.ba3e8dbe.js +++ /dev/null @@ -1,2 +0,0 @@ -(function(){var e={1993:function(e){function t(e){return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}))}t.keys=function(){return[]},t.resolve=t,t.id=1993,e.exports=t},1875:function(e){function t(e){return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}))}t.keys=function(){return[]},t.resolve=t,t.id=1875,e.exports=t},6210:function(e,t,o){"use strict";var n=o(9963),i=o(6252);function a(e,t,o,n,a,l){const s=(0,i.up)("ion-router-outlet"),r=(0,i.up)("ion-app");return(0,i.wg)(),(0,i.j4)(r,null,{default:(0,i.w5)((()=>[(0,i.Wm)(s)])),_:1})}o(6699);var l=o(9747),s=o(2406),r=(0,i.aZ)({name:"App",components:{IonApp:l.dr,IonRouterOutlet:l.jP},mounted(){const e=s.A;e.getLanguageCode().then((e=>{if(e.value.includes("-")){const t=e.value.split("-")[0];this.$i18n.locale=t}else this.$i18n.locale=e.value}))}}),c=o(3744);const u=(0,c.Z)(r,[["render",a]]);var d=u,p=o(3577);function m(e,t,o,n,a,l){const s=(0,i.up)("ion-back-button"),r=(0,i.up)("ion-buttons"),c=(0,i.up)("ion-img"),u=(0,i.up)("ion-icon"),d=(0,i.up)("ion-button"),m=(0,i.up)("ion-toolbar"),h=(0,i.up)("ion-title"),_=(0,i.up)("ion-header"),g=(0,i.up)("ion-content"),f=(0,i.up)("ion-toast"),w=(0,i.up)("ion-page");return(0,i.wg)(),(0,i.j4)(w,null,{default:(0,i.w5)((()=>[(0,i.Wm)(_,{collapse:"fade"},{default:(0,i.w5)((()=>[(0,i.Wm)(m,null,{default:(0,i.w5)((()=>[(0,i.Wm)(r,{slot:"start"},{default:(0,i.w5)((()=>[(0,i.Wm)(s,{"default-href":o.pageDefaultBackLink},null,8,["default-href"])])),_:1}),(0,i.Wm)(c,{src:n.tainacanLogo,class:"header__tainacan-logo"},null,8,["src"]),(0,i.Wm)(r,{slot:"end"},{default:(0,i.w5)((()=>[(0,i.Wm)(d,{onClick:l.logOff,"aria-label":"Sair"},{default:(0,i.w5)((()=>[(0,i.Wm)(u,{slot:"icon-only",icon:n.logOutOutline},null,8,["icon"])])),_:1},8,["onClick"])])),_:1})])),_:1}),o.pageTitle?((0,i.wg)(),(0,i.j4)(m,{key:0},{default:(0,i.w5)((()=>[(0,i.Wm)(h,null,{default:(0,i.w5)((()=>[(0,i.Uk)((0,p.zw)(o.pageTitle),1)])),_:1})])),_:1})):(0,i.kq)("",!0)])),_:1}),(0,i.Wm)(g,{fullscreen:"true"},{default:(0,i.w5)((()=>[(0,i.WI)(e.$slots,"default")])),_:3}),(0,i.Wm)(f,{"is-open":n.tainacanStore.errorStatus,message:e.$t(n.tainacanStore.errorMessage),duration:4e3,onDidDismiss:t[0]||(t[0]=t=>e.setOpen(!1)),color:"danger"},null,8,["is-open","message"])])),_:3})}var h=o(8903),_=o(8262),g=o(9669),f=o.n(g),w=o(3978),b=o(339);const I=new w.K,y=(0,_.Q_)("wp",{state(){return{userIsLoggedIn:!1,userSiteUrl:"",userLogin:"",userToken:"",authorizationURL:"",inAppBrowser:b.v}},actions:{async login(e,t,o){try{this.userIsLoggedIn=!0,this.userSiteUrl=e,this.userLogin=t,this.userToken=o,await I.set("userIsLoggedIn",!0),await I.set("userSiteUrl",e),await I.set("userLogin",t),await I.set("userToken",o)}catch(n){return this.userIsLoggedIn=!1,this.userSiteUrl="",this.userToken="",this.userLogin="",delete this.inAppBrowser,n}},async logoff(){try{this.userIsLoggedIn=!1,this.userSiteUrl="",this.userToken="",this.userToken="",delete this.inAppBrowser,await I.set("userIsLoggedIn",!1),await I.set("userSiteUrl",""),await I.set("userToken","")}catch(e){return this.userIsLoggedIn=!1,this.userSiteUrl="",this.userToken="",this.userToken="",delete this.inAppBrowser,e}},async fetchApplicationAuthorization(e){try{const t=e+"?rest_route=/",o=await f().get(t);if(!(o.data&&o.data.authentication&&o.data.authentication["application-passwords"]&&o.data.authentication["application-passwords"].endpoints&&o.data.authentication["application-passwords"].endpoints.authorization))return!1;this.authorizationURL=o.data.authentication["application-passwords"].endpoints.authorization}catch(t){return t}},async checkUserLogin(){await I.create(),this.userIsLoggedIn=await I.get("userIsLoggedIn"),this.userSiteUrl=await I.get("userSiteUrl"),this.userLogin=await I.get("userLogin"),this.userToken=await I.get("userToken")},createInAppBrowser(e="",t="location=no,fullscreen=no,zoom=no,hardwareback=yes"){let o=this.userSiteUrl+"/wp-admin/admin.php"+e;!this.userIsLoggedIn&&this.authorizationURL&&(o=this.authorizationURL+"?app_name=TainacanMobileApp&success_url="+o);const n=b.i.create(o,"_blank",t);this.inAppBrowser=n},openInAppBrowser(e){this.inAppBrowser&&this.inAppBrowser.executeScript||this.createInAppBrowser(e,"hidden=yes,location=no,fullscreen=no,zoom=no,hardwareback=yes");const t=`\n try {\n window.history.replaceState(\n null,\n null,\n '${this.userSiteUrl}/wp-admin/admin.php?page=tainacan_mobile_app'\n );\n window.history.pushState(\n null,\n null,\n '${this.userSiteUrl}/wp-admin/admin.php${e}'\n );\n window.history.go(0);\n } catch(err){\n //console.log('catch', err);\n }`;this.inAppBrowser.executeScript({code:t}),this.inAppBrowser.show()},hideInAppBrowser(){this.inAppBrowser&&this.inAppBrowser.hide&&this.inAppBrowser.hide()},listenEventInAppBrowser(e){this.inAppBrowser.on("message").subscribe(e),this.inAppBrowser.on("exit").subscribe((()=>{delete this.inAppBrowser})),this.inAppBrowser.on("loadstop").subscribe((e=>{if(e.url&&"string"==typeof e.url&&e.url.split("?")&&e.url.split("?").length>=2){const t=e.url.split("?")[1];t.indexOf("tainacan_mobile_app")>=0&&this.inAppBrowser.hide()}}))}}});o(2801);const A=(0,_.Q_)("tainacan",{state(){return{homeCollections:[],totalHomeCollections:0,homeItems:[],totalHomeItems:0,collections:[],totalCollections:0,collectionItems:[],totalCollectionItems:0,nextItemsByCollectionPage:1,items:[],nextItemsPage:1,totalItems:0,errorMessage:"",errorStatus:!1}},actions:{async fetchCollections(e){try{const t=y();let o=`${t.userSiteUrl}/wp-json/tainacan/v2/collections?`;const n=t.userLogin&&t.userToken?"Basic "+btoa(t.userLogin+":"+t.userToken):null;e&&e.perPage&&(o+="&perpage="+e.perPage),e&&e.orderBy&&(o+="&orderby="+e.orderBy);const i=await f().get(o,n?{headers:{authorization:n}}:{});this.collections=i.data,this.totalCollections=i.headers["x-wp-total"]}catch(t){return this.collections=[],this.totalCollections=0,this.errorMessage="error_label_fetch_collections",this.errorStatus=!0,t}},async fetchHomeCollections(){try{const e=y(),t=`${e.userSiteUrl}/wp-json/tainacan/v2/collections?perpage=4&orderby=modified`,o=e.userLogin&&e.userToken?"Basic "+btoa(e.userLogin+":"+e.userToken):null,n=await f().get(t,o?{headers:{authorization:o}}:{});this.homeCollections=n.data,this.totalHomeCollections=n.headers["x-wp-total"]}catch(e){return this.homeCollections=[],this.totalHomeCollections=0,this.errorMessage="error_label_fetch_collections",this.errorStatus=!0,e}},async fetchItemsByCollection(e,t){try{const o=y();let n=`${o.userSiteUrl}/wp-json/tainacan/v2/collection/${e}/items?context=edit&fetch_only=id,title,thumbnail`;const i=o.userLogin&&o.userToken?"Basic "+btoa(o.userLogin+":"+o.userToken):null;t&&t.perPage?n+="&perpage="+t.perPage:n+="&perpage=12",t&&t.orderBy?n+="&orderby="+t.orderBy:n+="&orderby=modified",t&&t.search&&""!==t.search&&(n+="&search="+t.search),t.reset&&(this.collectionItems=[],this.nextItemsByCollectionPage=1),n+="&paged="+this.nextItemsByCollectionPage;const a=await f().get(n,i?{headers:{authorization:i}}:{});this.collectionItems.push(...a.data.items),this.totalCollectionItems=a.headers["x-wp-total"],this.totalCollectionItems&&"0"!==this.totalCollectionItems&&this.nextItemsByCollectionPage++}catch(o){return this.collectionItems=[],this.totalCollectionItems=0,this.nextItemsByCollectionPage=1,this.errorMessage="error_label_fetch_items_collections",this.errorStatus=!0,!1}},async fetchHomeItems(){try{const e=y(),t=`${e.userSiteUrl}/wp-json/tainacan/v2/items?context=edit&fetch_only=id,title,thumbnail&perpage=12&orderby=modified`,o=e.userLogin&&e.userToken?"Basic "+btoa(e.userLogin+":"+e.userToken):null,n=await f().get(t,o?{headers:{authorization:o}}:{});this.homeItems=n.data.items,this.totalHomeItems=n.headers["x-wp-total"]}catch(e){return this.homeItems=[],this.totalHomeItems=0,this.errorMessage="error_label_fetch_items_collections",this.errorStatus=!0,e}},async fetchItems(e){try{const t=y();let o=`${t.userSiteUrl}/wp-json/tainacan/v2/items?context=edit&fetch_only=id,title,thumbnail`;const n=t.userLogin&&t.userToken?"Basic "+btoa(t.userLogin+":"+t.userToken):null;e&&e.perPage&&(o+="&perpage="+e.perPage),e&&e.orderBy&&(o+="&orderby="+e.orderBy),e&&e.search&&""!==e.search&&(o+="&search="+e.search),e.reset&&(this.items=[],this.nextItemsPage=1),o+="&paged="+this.nextItemsPage;const i=await f().get(o,n?{headers:{authorization:n}}:{});this.items.push(...i.data.items),this.totalItems=i.headers["x-wp-total"],this.totalItems&&"0"!==this.totalItems&&this.nextItemsPage++}catch(t){return this.items=[],this.totalItems=0,this.nextItemsPage=1,this.errorMessage="error_label_fetch_items",this.errorStatus=!0,t}},async deleteItem(e){try{const t=y(),o=`${t.userSiteUrl}/wp-json/tainacan/v2/items/${e}`,n=t.userLogin&&t.userToken?"Basic "+btoa(t.userLogin+":"+t.userToken):null,i=await f()["delete"](o,n?{headers:{authorization:n}}:{});if(i.data&&i.data.id){const e=this.items.indexOf((e=>e.id==i.data.id));e>=0&&this.items.splice(e,1);const t=this.homeItems.indexOf((e=>e.id==i.data.id));t>=0&&this.items.splice(t,1);const o=this.collectionItems.indexOf((e=>e.id==i.data.id));o>=0&&this.items.splice(o,1)}}catch(t){return this.errorMessage="error_delete_item",this.errorStatus=!0,t}}}});var S={props:["pageTitle","pageDefaultBackLink"],components:{IonPage:l._i,IonHeader:l.Gu,IonToolbar:l.sr,IonTitle:l.wd,IonContent:l.W2,IonIcon:l.gu,IonButton:l.YG,IonBackButton:l.oU,IonButtons:l.Sm,IonImg:l.Xz,IonToast:l.Px},setup(){const e=(0,i.Fl)((()=>o(6949)));let t=y(),n=A();return{tainacanLogo:e,wpStore:t,logOutOutline:h.euS,tainacanStore:n}},methods:{async logOff(){await this.wpStore.logoff(),this.$router.go()}}};const v=(0,c.Z)(S,[["render",m]]);var k=v;const C={key:0},L={key:1},B={key:2},U={key:0};function W(e,t,o,n,a,l){const s=(0,i.up)("ion-img"),r=(0,i.up)("ion-thumbnail"),c=(0,i.up)("ion-icon"),u=(0,i.up)("ion-label"),d=(0,i.up)("ion-radio"),m=(0,i.up)("ion-item");return(0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(e.collections,(t=>((0,i.wg)(),(0,i.j4)(m,{class:"collection-list-item",key:t.id,onClick:o=>e.isInSelectionMode?"":e.goToCollectionPage(t)},{default:(0,i.w5)((()=>[(0,i.Wm)(r,{slot:"start"},{default:(0,i.w5)((()=>[(0,i.Wm)(s,{src:t.thumbnail&&t.thumbnail.thumbnail&&t.thumbnail.thumbnail[0]?t.thumbnail.thumbnail[0]:e.thumbnailPlaceholder,alt:t.name?t.name:e.$("label_collection_without_name")},null,8,["src","alt"])])),_:2},1024),(0,i.Wm)(u,null,{default:(0,i.w5)((()=>[(0,i._)("h2",null,[(0,i.Uk)((0,p.zw)(t.name?t.name:e.$t("label_collection_without_name"))+"  ",1),"private"===t.status?((0,i.wg)(),(0,i.iD)("span",C,[(0,i.Wm)(c,{icon:e.lockClosedOutline},null,8,["icon"])])):"draft"===t.status?((0,i.wg)(),(0,i.iD)("span",L,[(0,i.Wm)(c,{icon:e.readerOutline},null,8,["icon"])])):"trash"===t.status?((0,i.wg)(),(0,i.iD)("span",B,[(0,i.Wm)(c,{icon:e.trashOutline},null,8,["icon"])])):(0,i.kq)("",!0)]),t.total_items?((0,i.wg)(),(0,i.iD)("p",U,(0,p.zw)(e.$t("total_of_published_items",[t.total_items.publish])),1)):(0,i.kq)("",!0)])),_:2},1024),e.isInSelectionMode?((0,i.wg)(),(0,i.j4)(d,{key:0,slot:"end",value:t.id},null,8,["value"])):(0,i.kq)("",!0)])),_:2},1032,["onClick"])))),128)}var T=o(2119),x=(0,i.aZ)({props:["collections","isSelectionMode"],components:{IonItem:l.Ie,IonImg:l.Xz,IonThumbnail:l.Bs,IonLabel:l.Q$,IonIcon:l.gu,IonRadio:l.B7},setup(e){const t=(0,i.Fl)((()=>e.isSelectionMode)),n=(0,i.Fl)((()=>o(6445))),a=(0,T.tv)(),l=e=>{a.push({name:"collection",params:{id:e.id}})};return{thumbnailPlaceholder:n,lockClosedOutline:h.hkI,readerOutline:h.$1v,trashOutline:h.gtu,goToCollectionPage:l,isInSelectionMode:t}}});const H=(0,c.Z)(x,[["render",W]]);var j=H;function O(e,t,o,n,a,l){const s=(0,i.up)("ion-img"),r=(0,i.up)("ion-card-title"),c=(0,i.up)("ion-card-header"),u=(0,i.up)("ion-card"),d=(0,i.up)("ion-col"),m=(0,i.up)("ion-row");return(0,i.wg)(),(0,i.j4)(m,{class:"items-list-container"},{default:(0,i.w5)((()=>[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(e.items,(t=>((0,i.wg)(),(0,i.j4)(d,{size:"4",key:t.id},{default:(0,i.w5)((()=>[(0,i.Wm)(u,{onClick:o=>e.openActionSheet(t),button:"",color:"light"},{default:(0,i.w5)((()=>[(0,i.Wm)(s,{src:t.thumbnail&&t.thumbnail["tainacan-medium"]&&t.thumbnail["tainacan-medium"][0]?t.thumbnail["tainacan-medium"][0]:e.thumbnailPlaceholder,alt:t.thumbnail_alt?t.thumbnail_alt:t.title?t.title:"Imagem de item sem título"},null,8,["src","alt"]),(0,i.Wm)(c,null,{default:(0,i.w5)((()=>[(0,i.Wm)(r,null,{default:(0,i.w5)((()=>[(0,i.Uk)((0,p.zw)(t.title?t.title:e.$t("label_item_without_title")),1)])),_:2},1024)])),_:2},1024)])),_:2},1032,["onClick"])])),_:2},1024)))),128))])),_:1})}var P=o(2262),R=(0,i.aZ)({props:["items"],components:{IonCardHeader:l.Zi,IonRow:l.Nd,IonCol:l.wI,IonCard:l.PM,IonImg:l.Xz,IonCardTitle:l.Dq},setup(){const e=y(),t=A(),n=(0,i.Fl)((()=>o(6445))),a=(0,P.iH)({header:"",button1:"",button2:"",cancel:""}),s=e=>a.value=e,r=async e=>{const t=e;if(t.current_user_can_edit||t.current_user_can_delete){let e=[];t.current_user_can_edit&&e.push({text:a.value.button1,icon:h.rI1,data:"edit-item",handler:()=>{u(t)}}),t.current_user_can_delete&&e.push({text:a.value.button2,icon:h.UQi,data:"delete-item",handler:()=>{c(t)}}),e.push({text:a.value.cancel,role:"cancel"});let o={header:a.value.header,cssClass:"item-creation-action-sheet",buttons:e};const n=await l.BO.create(o);await n.present()}},c=function(e){t.deleteItem(e.id)},u=function(t){e.openInAppBrowser("?page=tainacan_admin&mobileAppMode=true#/collections/"+t.collection_id+"/items/"+t.id+"/edit"),e.listenEventInAppBrowser((t=>{t&&t.data&&"item_updated"===t.data.type&&t.data.item&&"auto-draft"!==t.data.item.status&&e.hideInAppBrowser()}))};return{thumbnailPlaceholder:n,wpStore:e,openItemEdition:u,setActionSheetLabels:s,openActionSheet:r}},async created(){this.setActionSheetLabels({header:this.$t("label_item_actions"),button1:this.$t("label_option_edit_item"),button2:this.$t("label_option_delete_item"),cancel:this.$t("label_cancel")})}});const D=(0,c.Z)(R,[["render",O]]);var z=D,M=o(1089);function Q(e,t,o,n,a,l){const s=(0,i.up)("ion-refresher-content"),r=(0,i.up)("ion-refresher"),c=(0,i.up)("ion-loading"),u=(0,i.up)("ion-list-header"),d=(0,i.up)("collections-list"),m=(0,i.up)("ion-list"),h=(0,i.up)("ion-icon"),_=(0,i.up)("ion-button"),g=(0,i.up)("items-list"),f=(0,i.up)("base-layout");return(0,i.wg)(),(0,i.j4)(f,null,{default:(0,i.w5)((()=>[(0,i.Wm)(r,{slot:"fixed",onIonRefresh:t[0]||(t[0]=e=>n.doRefresh(e))},{default:(0,i.w5)((()=>[(0,i.Wm)(s)])),_:1}),(0,i.Wm)(c,{"is-open":n.isLoading,message:e.$t("label_loading")},null,8,["is-open","message"]),(0,i.Wm)(m,null,{default:(0,i.w5)((()=>[(0,i.Wm)(u,null,{default:(0,i.w5)((()=>[(0,i.Uk)((0,p.zw)(e.$t("label_last_modified_collections")),1)])),_:1}),(0,i.Wm)(d,{collections:n.tainacanStore.homeCollections},null,8,["collections"])])),_:1}),n.tainacanStore.homeCollections.length[(0,i.Uk)((0,p.zw)(e.$t("label_view_all_collections",[n.tainacanStore.totalHomeCollections]))+" ",1),(0,i.Wm)(h,{slot:"end",icon:n.arrowForwardOutline},null,8,["icon"])])),_:1})):(0,i.kq)("",!0),(0,i.Wm)(m,null,{default:(0,i.w5)((()=>[(0,i.Wm)(u,null,{default:(0,i.w5)((()=>[(0,i.Uk)((0,p.zw)(e.$t("label_last_modified_items")),1)])),_:1}),(0,i.Wm)(g,{items:n.tainacanStore.homeItems},null,8,["items"]),n.tainacanStore.homeItems.length[(0,i.Uk)((0,p.zw)(e.$t("label_view_all_items",[n.tainacanStore.totalHomeItems]))+" ",1),(0,i.Wm)(h,{slot:"end",icon:n.arrowForwardOutline},null,8,["icon"])])),_:1})):(0,i.kq)("",!0)])),_:1})])),_:1})}var F={components:{IonIcon:l.gu,CollectionsList:j,ItemsList:z,BaseLayout:k,IonList:l.q_,IonListHeader:l.yh,IonButton:l.YG,IonLoading:l.wh,IonRefresher:l.nJ,IonRefresherContent:l.Wo},setup(){const e=(0,P.iH)(!1),t=t=>e.value=t,o=async()=>{await i.fetchHomeCollections(),await i.fetchHomeItems()},n=async e=>{await o(),e&&e.target&&e.target.complete()};let i=A();return{arrowForwardOutline:h.QzP,tainacanStore:i,isLoading:e,setIsLoading:t,loadCollectionsAndItems:o,doRefresh:n}},async created(){this.setIsLoading(!0),await this.loadCollectionsAndItems(),this.setIsLoading(!1)}};const E=(0,c.Z)(F,[["render",Q]]);var V=E;const N=(0,i._)("br",null,null,-1),Y=(0,i.Uk)(" Testes sem login ");function q(e,t,o,a,l,s){const r=(0,i.up)("ion-img"),c=(0,i.up)("ion-label"),u=(0,i.up)("ion-input"),d=(0,i.up)("ion-item"),m=(0,i.up)("ion-list"),h=(0,i.up)("ion-icon"),_=(0,i.up)("ion-button"),g=(0,i.up)("ion-col"),f=(0,i.up)("ion-row"),w=(0,i.up)("app-password-modal"),b=(0,i.up)("ion-content"),I=(0,i.up)("ion-page");return(0,i.wg)(),(0,i.j4)(I,null,{default:(0,i.w5)((()=>[(0,i.Wm)(b,{class:"login-form-content",fullscreen:""},{default:(0,i.w5)((()=>[(0,i.Wm)(f,{class:"ion-align-items-center ion-justify-content-center"},{default:(0,i.w5)((()=>[(0,i.Wm)(g,null,{default:(0,i.w5)((()=>[(0,i.Wm)(r,{class:"login-form-content__tainacan-logo",alt:"Logo Tainacan",src:a.image},null,8,["src"]),(0,i._)("form",{onSubmit:t[1]||(t[1]=(0,n.iM)(((...e)=>s.openLoginForm&&s.openLoginForm(...e)),["prevent"]))},[(0,i.Wm)(m,{class:"ion-no-margin",inset:""},{default:(0,i.w5)((()=>[(0,i.Wm)(d,null,{default:(0,i.w5)((()=>[(0,i.Wm)(c,{position:"floating"},{default:(0,i.w5)((()=>[(0,i.Uk)((0,p.zw)(e.$t("label_site_url")),1)])),_:1}),(0,i.Wm)(u,{placeholder:e.$t("placeholder_site_url"),autofocus:"true",id:"siteUrl",type:"url",name:"siteUrl",modelValue:l.siteUrl,"onUpdate:modelValue":t[0]||(t[0]=e=>l.siteUrl=e),modelModifiers:{trim:!0},required:"true",autocomplete:"url",enterkeyhint:"next"},null,8,["placeholder","modelValue"])])),_:1})])),_:1}),N,(0,i.Wm)(_,{type:"submit",fill:"clear"},{default:(0,i.w5)((()=>[(0,i.Uk)((0,p.zw)(e.$t("label_access_archive"))+" ",1),(0,i.Wm)(h,{slot:"end",icon:a.arrowForwardOutline},null,8,["icon"])])),_:1}),(0,i.Wm)(_,{onClick:s.fakeLogin,color:"danger",fill:"clear"},{default:(0,i.w5)((()=>[Y,(0,i.Wm)(h,{slot:"end",icon:a.arrowForwardOutline},null,8,["icon"])])),_:1},8,["onClick"])],32)])),_:1})])),_:1}),(0,i.Wm)(w)])),_:1})])),_:1})}const X=(0,i._)("h1",null,"Application Passwords",-1),Z=(0,i._)("p",null,[(0,i._)("em",null,"Application passwords"),(0,i.Uk)(" are a safe way to peform operations without using your actual website password. To generate one, you must: "),(0,i._)("ol",null,[(0,i._)("li",null,[(0,i.Uk)("Open a web browser and login do your website traditional login page (usually "),(0,i._)("em",null,'"https://your-website.com.br/wp-admin"'),(0,i.Uk)(").")]),(0,i._)("li",null,"Go to your profile page by clicking on your picture in the upper right corner."),(0,i._)("li",null,'Scroll down to the "Application passwords" section. There should be a text input labelled "New name to the application password".'),(0,i._)("li",null,'Fill in the text input with any value to identify this password (you can have multiple), for example: "Tainacan Mobile".'),(0,i._)("li",null,'Click on the "Add new application password" button.')])],-1),J=(0,i._)("p",null,"With this steps completed, you will receive a code, that may look like this:",-1),$=(0,i._)("pre",null,[(0,i._)("code",null,"vlOh CdaH UqWw YV7X beou 6MFY")],-1),K=(0,i._)("p",null,[(0,i.Uk)("Copy this code and "),(0,i._)("strong",null,"keep it safe somewhere"),(0,i.Uk)(". You won't be able to access it later. Finally, paste it on this app login screen.")],-1),G=(0,i._)("p",null,"While it should be kept logged in, if you ever loose your access to the app, you can revogate the previous passwords and generate new ones in the same screen.",-1);function ee(e,t,o,n,a,l){const s=(0,i.up)("ion-content"),r=(0,i.up)("ion-modal");return(0,i.wg)(),(0,i.j4)(r,{ref:"modal",trigger:"open-explanation-modal","initial-breakpoint":.9,breakpoints:[0,.5,.75,1]},{default:(0,i.w5)((()=>[(0,i.Wm)(s,{style:{"font-size":"0.9375rem",opacity:"0.85"},class:"ion-padding"},{default:(0,i.w5)((()=>[X,Z,J,$,K,G])),_:1})])),_:1},8,["initial-breakpoint","breakpoints"])}var te={components:{IonModal:l.ki,IonContent:l.W2},setup(){return{}}};const oe=(0,c.Z)(te,[["render",ee]]);var ne=oe,ie={props:["pageTitle","pageDefaultBackLink"],components:{IonIcon:l.gu,IonImg:l.Xz,IonPage:l._i,IonList:l.q_,IonItem:l.Ie,IonButton:l.YG,IonInput:l.pK,IonLabel:l.Q$,IonRow:l.Nd,IonCol:l.wI,IonContent:l.W2,AppPasswordModal:ne},data(){return{siteUrl:""}},setup(){const e=(0,i.Fl)((()=>o(9980)));let t=A(),n=y();return{image:e,tainacanStore:t,wpStore:n,arrowForwardOutline:h.QzP}},methods:{async openLoginForm(){this.wpStore.userSiteUrl=this.siteUrl,await this.wpStore.fetchApplicationAuthorization(this.siteUrl),this.wpStore.authorizationURL&&(this.wpStore.createInAppBrowser("?page=tainacan_mobile_app"),this.wpStore.inAppBrowser.on("loadstop").subscribe(this.handleBrowserLoadStop))},async handleBrowserLoadStop(e){if(e.url&&"string"==typeof e.url&&e.url.split("?")&&e.url.split("?").length>=2){const t=new URLSearchParams(e.url.split("?")[1]);if("tainacan_mobile_app"===t.get("page")){const e=t.get("user_login");let o=t.get("password");"string"==typeof o&&o.indexOf("#")>=0&&(o=o.split("#")[0]),e&&o&&(await this.wpStore.login(this.siteUrl,e,o),this.$router.push("/home")),this.wpStore.inAppBrowser.hide()}}},fakeLogin(){this.wpStore.login("https://rcteste.tainacan.org","",""),this.$router.push("/home")}}};const ae=(0,c.Z)(ie,[["render",q]]);var le=ae;const se={key:1,class:"results-not-found"};function re(e,t,o,n,a,l){const s=(0,i.up)("ion-refresher-content"),r=(0,i.up)("ion-refresher"),c=(0,i.up)("ion-searchbar"),u=(0,i.up)("ion-toolbar"),d=(0,i.up)("ion-loading"),m=(0,i.up)("ion-spinner"),h=(0,i.up)("items-list"),_=(0,i.up)("ion-infinite-scroll-content"),g=(0,i.up)("ion-infinite-scroll"),f=(0,i.up)("ion-icon"),w=(0,i.up)("ion-button"),b=(0,i.up)("base-layout");return(0,i.wg)(),(0,i.j4)(b,{"page-title":e.$t("label_collection_items_list"),"page-default-back-link":"/collections"},{default:(0,i.w5)((()=>[(0,i.Wm)(r,{slot:"fixed",onIonRefresh:t[0]||(t[0]=t=>e.doRefresh(t))},{default:(0,i.w5)((()=>[(0,i.Wm)(s)])),_:1}),(0,i.Wm)(u,null,{default:(0,i.w5)((()=>[(0,i.Wm)(c,{debounce:"500",placeholder:e.$t("label_search"),onIonChange:t[1]||(t[1]=t=>e.handleSearch(t))},null,8,["placeholder"])])),_:1}),(0,i.Wm)(d,{"is-open":e.isLoading,message:e.$t("label_loading")},null,8,["is-open","message"]),e.isSearching?((0,i.wg)(),(0,i.j4)(m,{key:0})):(0,i.kq)("",!0),e.isLoading||e.isSearching||e.tainacanStore.totalCollectionItems&&"0"!=e.tainacanStore.totalCollectionItems?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("div",se,[(0,i._)("span",null,(0,p.zw)(e.$t("label_no_results_found")),1)])),(0,i.Wm)(h,{items:e.tainacanStore.collectionItems},null,8,["items"]),(0,i.Wm)(g,{ref:"infiniteScroll",threshold:"5%",onIonInfinite:e.loadItemsByCollection},{default:(0,i.w5)((()=>[(0,i.Wm)(_)])),_:1},8,["onIonInfinite"]),(0,i.Wm)(w,{class:"add-items-button",color:"primary",onClick:t[2]||(t[2]=t=>e.openActionSheet())},{default:(0,i.w5)((()=>[(0,i.Wm)(f,{icon:e.add},null,8,["icon"]),(0,i.Uk)("  "+(0,p.zw)(e.$t("label_add_items")),1)])),_:1})])),_:1},8,["page-title"])}var ce=(0,i.aZ)({components:{BaseLayout:k,ItemsList:z,IonLoading:l.wh,IonRefresher:l.nJ,IonRefresherContent:l.Wo,IonIcon:l.gu,IonButton:l.YG,IonInfiniteScroll:l.ju,IonToolbar:l.sr,IonSearchbar:l.VI,IonSpinner:l.PQ,IonInfiniteScrollContent:l.MB},props:{id:String},setup(e){const t=(0,P.iH)(!1),o=(0,P.iH)(!1),n=(0,P.iH)(),i=(0,P.iH)(),a=e=>t.value=e,s=e=>o.value=e,r=e=>n.value=e,c=async(t,o)=>{await w.fetchItemsByCollection(e.id+"",{perPage:"12",orderBy:"modified",reset:o,search:n.value});let a=w.totalCollectionItems&&0!==w.totalCollectionItems;t&&t.target&&t.target.complete(),a||(i.value.$el.disabled=!0)},u=async()=>{await c(null,!0)},d=async e=>{let t=e&&e.detail&&e.detail.value;r(t),s(!0),""!==t?await c(null,!0):await u(),s(!1)},p=async e=>{await c({},!0),e&&e.target&&(e.target.complete(),i.value.$el.disabled=!1)},m=y(),_=(0,P.iH)({header:"",button1:"",button2:"",button3:"",cancel:""}),g=e=>_.value=e,f=async()=>{const t=await l.BO.create({header:_.value.header,cssClass:"item-creation-action-sheet",buttons:[{text:_.value.button3,icon:h.Pf6,data:"single item",handler:()=>{m.openInAppBrowser("?page=tainacan_admin&mobileAppMode=true#/collections/"+e.id+"/items/new"),m.listenEventInAppBrowser((e=>{e&&e.data&&"item_updated"===e.data.type&&e.data.item&&"auto-draft"!==e.data.item.status&&(m.hideInAppBrowser(),c({},!0))}))}},{text:_.value.cancel,role:"cancel"}]});await t.present()};let w=A();return{isLoading:t,isSearching:o,tainacanStore:w,wpStore:m,setIsLoading:a,loadItemsByCollection:c,doRefresh:p,openActionSheet:f,add:h.IHx,actionSheetLabels:_,setActionSheetLabels:g,infiniteScroll:i,handleSearch:d}},async created(){this.setActionSheetLabels({header:this.$t("info_create_items"),button1:this.$t("label_option_multiple_items"),button2:this.$t("label_option_multiple_attachments"),button3:this.$t("label_option_single_item"),cancel:this.$t("label_cancel")}),this.setIsLoading(!0),await this.loadItemsByCollection({},!0),this.setIsLoading(!1)}});const ue=(0,c.Z)(ce,[["render",re]]);var de=ue;function pe(e,t,o,n,a,l){const s=(0,i.up)("ion-loading"),r=(0,i.up)("ion-refresher-content"),c=(0,i.up)("ion-refresher"),u=(0,i.up)("collections-list"),d=(0,i.up)("ion-list"),p=(0,i.up)("base-layout");return(0,i.wg)(),(0,i.j4)(p,{"page-title":e.$t("label_collections_list"),"page-default-back-link":"/"},{default:(0,i.w5)((()=>[(0,i.Wm)(s,{"is-open":n.isLoading,message:e.$t("label_loading")},null,8,["is-open","message"]),(0,i.Wm)(c,{slot:"fixed",onIonRefresh:t[0]||(t[0]=e=>n.doRefresh(e))},{default:(0,i.w5)((()=>[(0,i.Wm)(r)])),_:1}),(0,i.Wm)(d,null,{default:(0,i.w5)((()=>[(0,i.Wm)(u,{collections:n.tainacanStore.collections,"is-selection-mode":!1},null,8,["collections"])])),_:1})])),_:1},8,["page-title"])}var me={components:{CollectionsList:j,BaseLayout:k,IonLoading:l.wh,IonList:l.q_,IonRefresher:l.nJ,IonRefresherContent:l.Wo},setup(){const e=(0,P.iH)(!1),t=t=>e.value=t,o=async()=>{await i.fetchCollections({perPage:"24",orderBy:"modified"})},n=async e=>{await o(),e&&e.target&&e.target.complete()};let i=A();return{tainacanStore:i,isLoading:e,setIsLoading:t,doRefresh:n,loadCollections:o}},async created(){this.setIsLoading(!0),await this.loadCollections(),this.setIsLoading(!1)}};const he=(0,c.Z)(me,[["render",pe]]);var _e=he;const ge={key:1,class:"results-not-found"};function fe(e,t,o,n,a,l){const s=(0,i.up)("ion-loading"),r=(0,i.up)("ion-searchbar"),c=(0,i.up)("ion-toolbar"),u=(0,i.up)("ion-refresher-content"),d=(0,i.up)("ion-refresher"),m=(0,i.up)("ion-spinner"),h=(0,i.up)("items-list"),_=(0,i.up)("ion-infinite-scroll-content"),g=(0,i.up)("ion-infinite-scroll"),f=(0,i.up)("base-layout");return(0,i.wg)(),(0,i.j4)(f,{"page-title":e.$t("label_items_list"),"page-default-back-link":"/collections"},{default:(0,i.w5)((()=>[(0,i.Wm)(s,{"is-open":n.isLoading,message:e.$t("label_loading")},null,8,["is-open","message"]),(0,i.Wm)(c,null,{default:(0,i.w5)((()=>[(0,i.Wm)(r,{debounce:"500",placeholder:e.$t("label_search"),onIonChange:t[0]||(t[0]=e=>n.handleSearch(e))},null,8,["placeholder"])])),_:1}),(0,i.Wm)(d,{slot:"fixed",onIonRefresh:t[1]||(t[1]=e=>n.doRefresh(e))},{default:(0,i.w5)((()=>[(0,i.Wm)(u)])),_:1}),n.isSearching?((0,i.wg)(),(0,i.j4)(m,{key:0})):(0,i.kq)("",!0),n.isLoading||n.isSearching||n.tainacanStore.totalItems&&"0"!=n.tainacanStore.totalItems?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("div",ge,[(0,i._)("span",null,(0,p.zw)(e.$t("label_no_results_found")),1)])),(0,i.Wm)(h,{items:n.tainacanStore.items},null,8,["items"]),(0,i.Wm)(g,{ref:"infiniteScroll",threshold:"5%",onIonInfinite:n.loadItems},{default:(0,i.w5)((()=>[(0,i.Wm)(_)])),_:1},8,["onIonInfinite"])])),_:1},8,["page-title"])}var we={components:{IonLoading:l.wh,ItemsList:z,BaseLayout:k,IonRefresher:l.nJ,IonRefresherContent:l.Wo,IonInfiniteScroll:l.ju,IonToolbar:l.sr,IonSearchbar:l.VI,IonSpinner:l.PQ,IonInfiniteScrollContent:l.MB},setup(){const e=(0,P.iH)(!1),t=(0,P.iH)(!1),o=(0,P.iH)(),n=t=>e.value=t,i=e=>t.value=e,a=e=>o.value=e,l=(0,P.iH)(),s=async(e,t)=>{await d.fetchItems({perPage:"12",orderBy:"modified",reset:t,search:o.value});let n=d.totalItems&&0!==d.totalItems;e&&e.target&&e.target.complete(),n||(l.value.$el.disabled=!0)},r=async()=>{await s(null,!0)},c=async e=>{let t=e&&e.detail&&e.detail.value;a(t),i(!0),""!==t?(await s(null,!0),i(!1)):await r(),i(!1)},u=async e=>{await s({},!0),e&&e.target&&(e.target.complete(),l.value.$el.disabled=!1)};let d=A();return{isLoading:e,isSearching:t,setIsLoading:n,tainacanStore:d,doRefresh:u,loadItems:s,infiniteScroll:l,handleSearch:c}},async created(){this.setIsLoading(!0),await this.loadItems(),this.setIsLoading(!1)}};const be=(0,c.Z)(we,[["render",fe],["__scopeId","data-v-5ba64bfe"]]);var Ie=be;const ye=[{path:"/",redirect:"/home"},{path:"/home",component:V,name:"home"},{path:"/login",component:le,name:"login"},{path:"/collections/:id",component:de,name:"collection",props:!0},{path:"/collections",component:_e,name:"collections"},{path:"/items",component:Ie,name:"items"}],Ae=(0,M.p7)({history:(0,M.PO)("/"),routes:ye});Ae.beforeEach((async(e,t,o)=>{const n=y();await n.checkUserLogin(),"login"===e.name||n.userIsLoggedIn?o():o({name:"login"})}));var Se=Ae,ve=(o(8851),o(1292),o(1633),o(1045),o(6187),o(2299),o(3423),o(4687),o(9147),o(6250),o(3324));const ke={en:{collections:"Collections",label_view_all_collections:"View all {0} collections",items:"Items",label_view_all_items:"View all {0} items",label_loading:"Loading...",label_items_list:"Items list",label_collections_list:"Collections list",label_collection_items_list:"Collection items list",collection:"Collection",label_site_url:"Archive site URL",placeholder_site_url:"https://my-tainacan-archive.com",label_user_name:"User name",placeholder_user_name:"your user name",label_user_password:"User application password",placeholder_user_password:"your application password here",label_access_archive:"Access archive",label_item_without_title:"Item without title",label_collection_without_name:"Collection without name",total_of_published_items:"Total of {0} published items",label_last_modified_collections:"Last modified collections",label_last_modified_items:"Last modified itens",label_add_items:"Add items",info_create_items:"Create new items in this collection",label_option_multiple_items:"Multiple items from file selection",label_option_multiple_attachments:"Single item with document and attachments from file selection",label_option_single_item:"Single empty item",label_cancel:"Cancel",label_search:"Search",label_no_results_found:"No results found",info_application_password:"This password is not the same of your WordPress admin.",label_learn_more_here:"Learn more here",label_item_actions:"Item actions",label_option_edit_item:"Edit item",label_option_delete_item:"Send item to trash",error_label_fetch_collections:"Collections loading error",error_label_fetch_items_collections:"Items collections loading error",error_label_fetch_items:"Items loading error",error_delete_item:"Error while deleting item"},pt:{collections:"Coleções",label_view_all_collections:"Ver todas as {0} coleções",items:"Itens",label_view_all_items:"Ver todos os {0} itens",label_loading:"Carregando...",label_items_list:"Lista de itens",label_collections_list:"Lista de coleções",label_collection_items_list:"Lista de itens da coleção",collection:"Coleção",label_site_url:"URL do Site do Acervo",placeholder_site_url:"https://meu-acervo-tainacan.com",label_user_name:"Nome de usuário",placeholder_user_name:"seu nome de usuário aqui",label_user_password:"Senha do usuário da aplicação",placeholder_user_password:"sua senha de usuário da aplicação aqui",label_access_archive:"Acessar acervo",label_item_without_title:"Item sem título",label_collection_without_name:"Coleção sem nome",total_of_published_items:"Total de {0} itens públicos",label_last_modified_collections:"Coleções alteradas recentemente",label_last_modified_items:"Itens alterados recentemente",label_add_items:"Adicionar itens",info_create_items:"Crie novos itens nesta coleção",label_option_multiple_items:"Vários itens a partir de uma seleção de arquivos",label_option_multiple_attachments:"Um item com documento e anexos provenientes de ums seleção de aquivos",label_option_single_item:"Um item vazio",label_cancel:"Cancelar",label_search:"Buscar",label_no_results_found:"Nenhum resultado encontrado",info_application_password:"Esta senha não é a mesma do seu painel admin do WordPress.",label_learn_more_here:"Saiba mais aqui.",label_item_actions:"Ações para o item",label_option_edit_item:"Editar item",label_option_delete_item:"Enviar item para lixeira",error_label_fetch_collections:"Erro no carregamento das coleções",error_label_fetch_items_collections:"Erro no carregamento dos itens da coleção",error_label_fetch_items:"Erro no carregamento dos itens",error_delete_item:"Erro ao tentar remover item"}},Ce=(0,ve.o)({locale:"en",fallbackLocale:"en",messages:ke}),Le=(0,n.ri)(d).use(l.oX).use(Se).use((0,_.WB)()).use(Ce);Le.component("base-layout",k),Le.component("base-collectionlist",j),Le.component("base-itemlist",z),Se.isReady().then((()=>{Le.mount("#app")}))},6949:function(e,t,o){"use strict";e.exports=o.p+"img/logo.c406a55a.png"},9980:function(e,t,o){"use strict";e.exports=o.p+"img/logo_square.e3a150ee.png"},6445:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAHEHpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjarVdtksMqDvzPKfYIICQEx5H5qHo32ONvCzuZSSYzmXm1cSU4GINQS90izP/+s8J/8CGJNbBoLa2UiA83bmS4qfH8tP2bIu/f/aHbs/TYH+4PCF0ZbT7/ql3jDf3y8cJ9nuOxP9R6X+mcKN0n3p/sK/v9+Gwk+unsT3xN1OZ5U1rVz6Ye10T9GrhNub78sb398f/hoUPhpSFYKBPNnHLcv/W0IJ9fQw/tX8G4lBX3knNAQ7ldk8EhD9u7tTF+dtCDk2934dn797sn55Nd/fnJl+XyEW5ePkjy1J/vy9DnhfPdInp80Mod4S9OXmvUtea5O+MCj5Yroraz020aDDzg8rxfK7gUX0QtWr8arhotdkA+Yo8Hrp5aIqCyQuI0kqWV5m576jCRaZKiJeqUd1/NSo16dpzYr7RIc8sjV4DVaYac0U13W9Jet+31eqpYeSQMpYTJHPZvr/DTw79cYa3uLkqx3n0Fu8jjGmY4cv6LUQAkrQs32Q6+XRf88VP8IFSBoGw3V2zQ4nFOcUj6iK28cc4YJ2jPFEpBxzUBXIS1BcakDARiQQ6kkqISaUrwYwVABsspMx1AIInQgJHEORcKSpV8bbyjaY8loULeDW4CEJIL8qkCIQNYzIL4Ua6IIZMsLCJFVGqQJlZy4SKlFC1OcqZZWUWLqlZtajVXrlJL1Vprq9aoZXCgtNK01daaGQXDQoa5DOMNPQcd+eBDjnLoUY92WEf4dO7SS9dee+s2aOQBmhhl6KijDZspTDDF5CmzTJ11tmkLsbby4iWrLF11tWV31C5Uv1x/QC1dqNFGysfpHTX0BtXbFMnpRBwzIEacgLg6AghocsxiTczkyDlmsRGSQghGimMTRnLEACHPRLLSHbsP5H6FW5D6K9zoHXLBoft/IBcA3VfcXqA2XOf6RuzMQvdpzMi+xcOoBnOFNI0T+mECJFzgBkticdH6dRt+HACwDNuBy3016a4yHVy2l4uw4TSjufaPSnBSSzpnxbC6H5or79nqSDwiz9IGIkb2Eq/a8N2D162KuUesAHXqoDE+3A6gCjnKzS3h2L+8zfVYirBRIVoDpjmnPQ0C4iND38PI1EQNJUK2p139oc2GiVrJ1BVwYn5kQUsd7msJoZu6EOQLkRwnodpwbYo0UAF0gOCOpqNbnDMtDlan9YwsyS1Vq8BoFPIaJpfbgsayjh22gMe9g43pHbKrDSYyD6SN8gURcgou/AMA3rKh0DJhEHV150apwKUJKpuGTBhUsfpkhNAr11jEkknJU4uD/+3NARE8Vg99HntY5wJ5LmTHkAb8hvjrpq+DN8SM5IYcQIThZFV5A1MDJYGJ+Cxe/RWjXNSCALVUkI4TO/XSYewSoiakgj3685s2IYqoQLIjiAnI+EyAFHRo7u45Vi8YhWIVfNVa9hQCaZmWNb3qA//BH3zDNnwxvyEYwIm78ah5xogMfGSKhuATRnocDdQB8ocTG6iPW2YwLch5D/RSm01+HeDhsy0rdSTh4SGJ1CtaPTlHQZF2xDXcHY2Yj5TLEOKKEQ0jQJJ1SOjTrRkC5mbqyF2YiReOVyCj/7RAhoGqUR344Dij8QrFIFnYJdbA/iN4Z+IJoONy+DEBWdVQKmIWQA6i+G6z4S9p3giFkvRDyrRYZ4Iq4WRQPcln+IgHVJTAUiCv8DUSnVC+4u0ye5qLy/6dZ+AcUQ8vh+IS0w1mC3AGLb5WxE7c+FKRx1gUrKFI4KMOp4LoRS4x4tTcN+hem8Y8vgqKUX/HPYHX3oTwQ3uAZrmiUiXWDMMAf5tPruj6Lim6AXgdwGNpFXbowncsYxB75EnPowA1l6al7hKwlySvruNNAQkJyiPQ+BwsZlCviQziQWcsIkyuaCSUCXBmiijbFdn2GGjhdlPyeMOE28aF4hRnRJeO9iAZ4W3wwCMJ4TDzlviYptME+MuLcWS2c2JcdQTOR5WMk4I0rhAUHAIZPMGAxQeClxa8tL63NNXlbfhB+WmHk2sDzkNLcv9J/MJrOo19H6qT13Hd47tfAmBebeHseioh8HObFDQUcu3Wtt4ZOrEhw97SPIa1hZTh5RKApHkXa+Fr0ClBAcrwkvHKgN9kdEA+ZQDakUZI4x+lETVrRpk/OjVkuKsZ5LcLT1QZFtpEDYuH9dTsTxnzNlPc+BULSHAXES5PIEsIvKf0a3tAjZ4vVvahzjeQt4bUjx2EX6h7yt1FypNDPTmyHSjpWxpQkgHB6N1qDVfVgDXX24rTiyocwjy8nNP2DuoxqJVn1FyENjMhdNKugP6VHF2tjX9jWrjbBroAffJCRVHBMa78Xmw6eY9fFNvhfTUu5W0YIFVCaV7z4hCyxU/Jy0OdXrntmuXX5X/4/TlBF04kLfwPtGOavRFNBa4AAAGDaUNDUElDQyBwcm9maWxlAAB4nH2RPUjDQBzFX1OlIpUOZhBxyFCdLIhfOGoVilAh1AqtOphc+gVNGpIUF0fBteDgx2LVwcVZVwdXQRD8AHFydFJ0kRL/lxRaxHpw3I939x537wChXma63TUG6IZjpRJxKZNdlUKvCCMCEVMQFGabc7KcRMfxdY8AX+9iPKvzuT9Hn5azGRCQiGeZaTnEG8TTm47JeZ9YZEVFIz4nHrXogsSPXFd9fuNc8FjgmaKVTs0Ti8RSoY3VNmZFSyeeJI5qukH5QsZnjfMWZ71cZc178heGc8bKMtdpDiGBRSxBhgQVVZRQhoMYrQYpNlK0H+/gH/T8MrlUcpXAyLGACnQonh/8D353a+cnxv2kcBzofnHdj2EgtAs0aq77fey6jRMg+AxcGS1/pQ7MfJJea2nRIyCyDVxctzR1D7jcAQaeTMVSPClIU8jngfcz+qYs0H8L9K75vTX3cfoApKmr5A1wcAiMFCh7vcO7e9p7+/dMs78faWFyo+T2bHcAAAAYUExURdXV1dDQ0M3Nzdzc3NjY2NDQ0Ovr69PT0/3gchwAAAABYktHRACIBR1IAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5AwPFDUdBoqroAAAAMZJREFUKM9t0EEKwyAQBdAUe4DYBrLWExQ+mHXQmxRcBxrw+lVjdMT5y5c/cXTSWtJoreQyDSjlPKVPJC/FYErCbl4wuGAvSOYttgF/AGReqeEcDQ/5TqjbcMzWo0COFASXy7DbjKr+MOWDitVgKq624TejJj3A+wtPDKhW14ZhIsoQ83Suw1Cwlj3Foqbi6XJKsUfX4eFuNQxazyE7Tk4PtUiWD+30fHeK9/od3hctSO4ZqwTb8xEEg5ZDMAgGLYMCIx5dEX8OPbO5edULYwAAAABJRU5ErkJggg=="}},t={};function o(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,o),a.exports}o.m=e,function(){var e=[];o.O=function(t,n,i,a){if(!n){var l=1/0;for(u=0;u=a)&&Object.keys(o.O).every((function(e){return o.O[e](n[r])}))?n.splice(r--,1):(s=!1,a0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[n,i,a]}}(),function(){o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,{a:t}),t}}(),function(){o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}}(),function(){o.f={},o.e=function(e){return Promise.all(Object.keys(o.f).reduce((function(t,n){return o.f[n](e,t),t}),[]))}}(),function(){o.u=function(e){return"js/"+e+"."+{78:"51f18a44",168:"c83a23ff",338:"fff3ebb3",544:"94817512",576:"a82798ee",753:"17d4d392",775:"c55644c6",880:"e288775e",961:"2fab5ec9",990:"cdf4956e"}[e]+".js"}}(),function(){o.miniCssF=function(e){}}(),function(){o.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){var e={},t="tainacan-mobile:";o.l=function(n,i,a,l){if(e[n])e[n].push(i);else{var s,r;if(void 0!==a)for(var c=document.getElementsByTagName("script"),u=0;u [\n _createVNode(_component_ion_router_outlet)\n ]),\n _: 1\n }))\n}","\nimport { IonApp, IonRouterOutlet } from \"@ionic/vue\";\nimport { defineComponent } from \"vue\";\nimport { Device, DevicePlugin } from \"@capacitor/device\";\n\nexport default defineComponent({\n name: \"App\",\n components: {\n IonApp,\n IonRouterOutlet,\n },\n mounted() {\n const device: DevicePlugin = Device;\n device.getLanguageCode().then((res) => {\n if (res.value.includes(\"-\")) {\n const language = res.value.split(\"-\")[0];\n this.$i18n.locale = language;\n } else {\n this.$i18n.locale = res.value;\n }\n });\n },\n});\n","import { render } from \"./App.vue?vue&type=template&id=0acec4fa&ts=true\"\nimport script from \"./App.vue?vue&type=script&lang=ts\"\nexport * from \"./App.vue?vue&type=script&lang=ts\"\n\nimport exportComponent from \"/home/mateus/tainacan-mobile/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, renderSlot as _renderSlot } from \"vue\"\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_ion_back_button = _resolveComponent(\"ion-back-button\")!\n const _component_ion_buttons = _resolveComponent(\"ion-buttons\")!\n const _component_ion_img = _resolveComponent(\"ion-img\")!\n const _component_ion_icon = _resolveComponent(\"ion-icon\")!\n const _component_ion_button = _resolveComponent(\"ion-button\")!\n const _component_ion_toolbar = _resolveComponent(\"ion-toolbar\")!\n const _component_ion_title = _resolveComponent(\"ion-title\")!\n const _component_ion_header = _resolveComponent(\"ion-header\")!\n const _component_ion_content = _resolveComponent(\"ion-content\")!\n const _component_ion_toast = _resolveComponent(\"ion-toast\")!\n const _component_ion_page = _resolveComponent(\"ion-page\")!\n\n return (_openBlock(), _createBlock(_component_ion_page, null, {\n default: _withCtx(() => [\n _createVNode(_component_ion_header, { collapse: \"fade\" }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_toolbar, null, {\n default: _withCtx(() => [\n _createVNode(_component_ion_buttons, { slot: \"start\" }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_back_button, { \"default-href\": $props.pageDefaultBackLink }, null, 8, [\"default-href\"])\n ]),\n _: 1\n }),\n _createVNode(_component_ion_img, {\n src: $setup.tainacanLogo,\n class: \"header__tainacan-logo\"\n }, null, 8, [\"src\"]),\n _createVNode(_component_ion_buttons, { slot: \"end\" }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_button, {\n onClick: $options.logOff,\n \"aria-label\": \"Sair\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_icon, {\n slot: \"icon-only\",\n icon: $setup.logOutOutline\n }, null, 8, [\"icon\"])\n ]),\n _: 1\n }, 8, [\"onClick\"])\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n ($props.pageTitle)\n ? (_openBlock(), _createBlock(_component_ion_toolbar, { key: 0 }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_title, null, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString($props.pageTitle), 1)\n ]),\n _: 1\n })\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true)\n ]),\n _: 1\n }),\n _createVNode(_component_ion_content, { fullscreen: \"true\" }, {\n default: _withCtx(() => [\n _renderSlot(_ctx.$slots, \"default\")\n ]),\n _: 3\n }),\n _createVNode(_component_ion_toast, {\n \"is-open\": $setup.tainacanStore.errorStatus,\n message: _ctx.$t($setup.tainacanStore.errorMessage),\n duration: 4000,\n onDidDismiss: _cache[0] || (_cache[0] = ($event: any) => (_ctx.setOpen(false))),\n color: \"danger\"\n }, null, 8, [\"is-open\", \"message\"])\n ]),\n _: 3\n }))\n}","import { defineStore } from \"pinia\";\nimport axios from \"axios\";\nimport { Storage } from \"@ionic/storage\";\nimport {\n InAppBrowser,\n InAppBrowserObject,\n} from \"@awesome-cordova-plugins/in-app-browser/index\";\n\nconst store = new Storage();\n\nconst useWpStore = defineStore(\"wp\", {\n state() {\n return {\n userIsLoggedIn: false,\n userSiteUrl: \"\",\n userLogin: \"\",\n userToken: \"\",\n authorizationURL: \"\",\n inAppBrowser: InAppBrowserObject,\n };\n },\n\n actions: {\n async login(userSiteUrl: string, userLogin: string, userToken: string) {\n try {\n this.userIsLoggedIn = true;\n this.userSiteUrl = userSiteUrl;\n this.userLogin = userLogin;\n this.userToken = userToken;\n await store.set(\"userIsLoggedIn\", true);\n await store.set(\"userSiteUrl\", userSiteUrl);\n await store.set(\"userLogin\", userLogin);\n await store.set(\"userToken\", userToken);\n } catch (err) {\n this.userIsLoggedIn = false;\n this.userSiteUrl = \"\";\n this.userToken = \"\";\n this.userLogin = \"\";\n delete this.inAppBrowser;\n //console.error(\"Erro no login:\", err);\n return err;\n }\n },\n async logoff() {\n try {\n this.userIsLoggedIn = false;\n this.userSiteUrl = \"\";\n this.userToken = \"\";\n this.userToken = \"\";\n delete this.inAppBrowser;\n await store.set(\"userIsLoggedIn\", false);\n await store.set(\"userSiteUrl\", \"\");\n await store.set(\"userToken\", \"\");\n } catch (err) {\n this.userIsLoggedIn = false;\n this.userSiteUrl = \"\";\n this.userToken = \"\";\n this.userToken = \"\";\n delete this.inAppBrowser;\n //console.error(\"Erro no logoff:\", err);\n return err;\n }\n },\n async fetchApplicationAuthorization(siteUrl: string) {\n try {\n const endpoint = siteUrl + \"?rest_route=/\";\n const response = await axios.get(endpoint);\n\n if (\n response.data &&\n response.data.authentication &&\n response.data.authentication[\"application-passwords\"] &&\n response.data.authentication[\"application-passwords\"].endpoints &&\n response.data.authentication[\"application-passwords\"].endpoints\n .authorization\n )\n this.authorizationURL =\n response.data.authentication[\n \"application-passwords\"\n ].endpoints.authorization;\n else return false;\n } catch (err) {\n //console.error(\"Error trying to fetch application authorization\");\n return err;\n }\n },\n async checkUserLogin() {\n await store.create();\n this.userIsLoggedIn = await store.get(\"userIsLoggedIn\");\n this.userSiteUrl = await store.get(\"userSiteUrl\");\n this.userLogin = await store.get(\"userLogin\");\n this.userToken = await store.get(\"userToken\");\n },\n createInAppBrowser(url = '',extraParams = 'location=no,fullscreen=no,zoom=no,hardwareback=yes') {\n let tainacanAdminUrl = this.userSiteUrl + \"/wp-admin/admin.php\" + url;\n if (!this.userIsLoggedIn && this.authorizationURL) \n tainacanAdminUrl = this.authorizationURL + \"?app_name=TainacanMobileApp&success_url=\" + tainacanAdminUrl;\n \n const anInAppBrowser = InAppBrowser.create(tainacanAdminUrl, '_blank', extraParams);\n this.inAppBrowser = anInAppBrowser;\n },\n openInAppBrowser(url: string) {\n\n if (!this.inAppBrowser || !this.inAppBrowser.executeScript)\n this.createInAppBrowser(url, 'hidden=yes,location=no,fullscreen=no,zoom=no,hardwareback=yes');\n\n const urlRedirectionScript = `\n try {\n window.history.replaceState(\n null,\n null,\n '${this.userSiteUrl}/wp-admin/admin.php?page=tainacan_mobile_app'\n );\n window.history.pushState(\n null,\n null,\n '${this.userSiteUrl}/wp-admin/admin.php${url}'\n );\n window.history.go(0);\n } catch(err){\n //console.log('catch', err);\n }`;\n this.inAppBrowser.executeScript({ code: urlRedirectionScript });\n \n this.inAppBrowser.show();\n },\n hideInAppBrowser() {\n if (this.inAppBrowser && this.inAppBrowser.hide)\n this.inAppBrowser.hide();\n },\n listenEventInAppBrowser(event: any) {\n this.inAppBrowser.on('message').subscribe(event);\n this.inAppBrowser.on('exit').subscribe(() => {\n delete this.inAppBrowser;\n });\n this.inAppBrowser.on(\"loadstop\").subscribe((event: any) => {\n if (\n event.url &&\n typeof event.url == \"string\" &&\n event.url.split(\"?\") &&\n event.url.split(\"?\").length >= 2\n ) {\n const params = event.url.split(\"?\")[1];\n if ( params.indexOf(\"tainacan_mobile_app\") >= 0)\n this.inAppBrowser.hide(); \n }\n });\n }\n },\n});\nexport { useWpStore };\n","import axios from \"axios\";\nimport { defineStore } from \"pinia\";\nimport { useWpStore } from \"./storeWp\";\n\nconst useTainacanStore = defineStore(\"tainacan\", {\n state() {\n return {\n homeCollections: [],\n totalHomeCollections: 0,\n homeItems: [],\n totalHomeItems: 0,\n collections: [],\n totalCollections: 0,\n collectionItems: [],\n totalCollectionItems: 0,\n nextItemsByCollectionPage: 1,\n items: [],\n nextItemsPage: 1,\n totalItems: 0,\n errorMessage: \"\",\n errorStatus: false\n };\n },\n\n actions: {\n async fetchCollections(params: { perPage: string, orderBy: string }) {\n try {\n const wpStore = useWpStore();\n\n let endpoint = `${wpStore.userSiteUrl}/wp-json/tainacan/v2/collections?`;\n const authorization = (wpStore.userLogin && wpStore.userToken) ? ('Basic ' + btoa(wpStore.userLogin + ':' + wpStore.userToken)) : null;\n\n if (params && params.perPage)\n endpoint += '&perpage=' + params.perPage;\n \n if (params && params.orderBy)\n endpoint += '&orderby=' + params.orderBy;\n\n const response = await axios.get(endpoint, authorization ? {\n headers: {\n authorization: authorization\n }\n } : {});\n\n this.collections = response.data;\n this.totalCollections = response.headers['x-wp-total'];\n\n } catch (err) {\n this.collections = [];\n this.totalCollections = 0;\n this.errorMessage = \"error_label_fetch_collections\";\n this.errorStatus = true;\n // console.error(\"Collections loading error: \", err);\n return err;\n }\n },\n\n async fetchHomeCollections() {\n try {\n const wpStore = useWpStore();\n\n const endpoint = `${wpStore.userSiteUrl}/wp-json/tainacan/v2/collections?perpage=4&orderby=modified`;\n const authorization = (wpStore.userLogin && wpStore.userToken) ? ('Basic ' + btoa(wpStore.userLogin + ':' + wpStore.userToken)) : null;\n\n const response = await axios.get(endpoint, authorization ? {\n headers: {\n authorization: authorization\n }\n } : {});\n\n this.homeCollections = response.data;\n this.totalHomeCollections = response.headers['x-wp-total'];\n\n } catch (err) {\n this.homeCollections = [];\n this.totalHomeCollections = 0;\n this.errorMessage = \"error_label_fetch_collections\";\n this.errorStatus = true;\n //console.error(\"Home collections loading error: \", err);\n return err;\n }\n },\n\n async fetchItemsByCollection(collectionId: string, params: { perPage: string, orderBy: string, reset?: boolean, search?: string }) {\n try {\n const wpStore = useWpStore();\n\n let endpoint = `${wpStore.userSiteUrl}/wp-json/tainacan/v2/collection/${collectionId}/items?context=edit&fetch_only=id,title,thumbnail`;\n const authorization = (wpStore.userLogin && wpStore.userToken) ? ('Basic ' + btoa(wpStore.userLogin + ':' + wpStore.userToken)) : null;\n\n if (params && params.perPage)\n endpoint += '&perpage=' + params.perPage;\n else\n endpoint += '&perpage=12';\n \n if (params && params.orderBy)\n endpoint += '&orderby=' + params.orderBy;\n else\n endpoint += '&orderby=modified';\n\n if (params && params.search && params.search !== '')\n endpoint += '&search=' + params.search\n \n if (params.reset) {\n this.collectionItems = [];\n this.nextItemsByCollectionPage = 1;\n }\n\n endpoint += '&paged=' + this.nextItemsByCollectionPage;\n \n const response = await axios.get(endpoint, authorization ? {\n headers: {\n authorization: authorization\n }\n } : {});\n\n this.collectionItems.push(...response.data.items);\n this.totalCollectionItems = response.headers['x-wp-total'];\n\n if (this.totalCollectionItems && this.totalCollectionItems !== \"0\") {\n this.nextItemsByCollectionPage++;\n } \n\n } catch (err) {\n this.collectionItems = [];\n this.totalCollectionItems = 0;\n this.nextItemsByCollectionPage = 1;\n this.errorMessage = \"error_label_fetch_items_collections\";\n this.errorStatus = true;\n //console.error(\"Items collections loading error: \", err);\n return false;\n }\n },\n\n async fetchHomeItems() {\n try {\n const wpStore = useWpStore();\n const endpoint = `${wpStore.userSiteUrl}/wp-json/tainacan/v2/items?context=edit&fetch_only=id,title,thumbnail&perpage=12&orderby=modified`;\n const authorization = (wpStore.userLogin && wpStore.userToken) ? ('Basic ' + btoa(wpStore.userLogin + ':' + wpStore.userToken)) : null;\n\n const response = await axios.get(endpoint, authorization ? {\n headers: {\n authorization: authorization\n }\n } : {});\n\n this.homeItems = response.data.items;\n this.totalHomeItems = response.headers['x-wp-total'];\n \n } catch (err) {\n this.homeItems = [];\n this.totalHomeItems = 0;\n this.errorMessage = \"error_label_fetch_items_collections\";\n this.errorStatus = true;\n //console.error(\"Items collections loading error: \", err);\n return err;\n }\n },\n\n async fetchItems(params: { perPage: string, orderBy: string, reset?: boolean, search?: string }) {\n try {\n const wpStore = useWpStore();\n \n let endpoint = `${wpStore.userSiteUrl}/wp-json/tainacan/v2/items?context=edit&fetch_only=id,title,thumbnail`;\n const authorization = (wpStore.userLogin && wpStore.userToken) ? ('Basic ' + btoa(wpStore.userLogin + ':' + wpStore.userToken)) : null;\n\n if (params && params.perPage)\n endpoint += '&perpage=' + params.perPage;\n\n if (params && params.orderBy)\n endpoint += '&orderby=' + params.orderBy;\n\n if (params && params.search && params.search !== '')\n endpoint += '&search=' + params.search\n \n if (params.reset) {\n this.items = [];\n this.nextItemsPage = 1;\n }\n\n endpoint += '&paged=' + this.nextItemsPage;\n\n const response = await axios.get(endpoint, authorization ? {\n headers: {\n authorization: authorization\n }\n } : {});\n \n this.items.push(...response.data.items);\n this.totalItems = response.headers['x-wp-total'];\n\n if (this.totalItems && this.totalItems !== \"0\") {\n this.nextItemsPage++;\n } \n\n } catch (err) {\n this.items = [];\n this.totalItems = 0;\n this.nextItemsPage = 1;\n this.errorMessage = \"error_label_fetch_items\";\n this.errorStatus = true;\n //console.error(\"Items loading error: \", err);\n return err;\n }\n },\n\n async deleteItem(itemId: string|number) {\n try {\n const wpStore = useWpStore();\n \n const endpoint = `${wpStore.userSiteUrl}/wp-json/tainacan/v2/items/${itemId}`;\n const authorization = (wpStore.userLogin && wpStore.userToken) ? ('Basic ' + btoa(wpStore.userLogin + ':' + wpStore.userToken)) : null;\n\n const response = await axios.delete(endpoint, authorization ? {\n headers: {\n authorization: authorization\n }\n } : {});\n \n if (response.data && response.data.id) {\n const existingItemIndex = this.items.indexOf((anItem: any) => anItem.id == response.data.id);\n if (existingItemIndex >= 0)\n this.items.splice(existingItemIndex, 1);\n\n const existingHomeItemIndex = this.homeItems.indexOf((anItem: any) => anItem.id == response.data.id);\n if (existingHomeItemIndex >= 0)\n this.items.splice(existingHomeItemIndex, 1);\n\n const existingCollectionItemIndex = this.collectionItems.indexOf((anItem: any) => anItem.id == response.data.id);\n if (existingCollectionItemIndex >= 0)\n this.items.splice(existingCollectionItemIndex, 1);\n }\n\n } catch (err) {\n //console.error(\"Erro ao deletar item:\", err);\n this.errorMessage = \"error_delete_item\";\n this.errorStatus = true;\n\n return err;\n }\n }\n },\n});\nexport { useTainacanStore };","\nimport { logOutOutline } from \"ionicons/icons\";\nimport { \n useWpStore\n} from '../../store/storeWp';\n\nimport {\n IonPage,\n IonHeader,\n IonToolbar,\n IonTitle,\n IonContent,\n IonIcon,\n IonBackButton,\n IonButton,\n IonButtons,\n IonImg,\n IonToast\n} from '@ionic/vue';\nimport { computed } from 'vue';\nimport { useTainacanStore } from '@/store/storeTainacan';\n\nexport default {\n props: ['pageTitle', 'pageDefaultBackLink'],\n components: {\n IonPage,\n IonHeader,\n IonToolbar,\n IonTitle,\n IonContent,\n IonIcon,\n IonButton,\n IonBackButton,\n IonButtons,\n IonImg,\n IonToast\n },\n setup(){\n const tainacanLogo = computed (() => require('../../assets/logo.png'))\n let wpStore = useWpStore();\n let tainacanStore = useTainacanStore();\n\n return {\n tainacanLogo,\n wpStore,\n logOutOutline,\n tainacanStore\n } \n },\n methods: {\n async logOff(){\n await this.wpStore.logoff();\n this.$router.go();\n }\n }\n}\n","import { render } from \"./BaseLayout.vue?vue&type=template&id=ca314930&ts=true\"\nimport script from \"./BaseLayout.vue?vue&type=script&lang=ts\"\nexport * from \"./BaseLayout.vue?vue&type=script&lang=ts\"\n\nimport \"./BaseLayout.vue?vue&type=style&index=0&id=ca314930&lang=css\"\n\nimport exportComponent from \"/home/mateus/tainacan-mobile/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, toDisplayString as _toDisplayString, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, createElementVNode as _createElementVNode, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = { key: 0 }\nconst _hoisted_2 = { key: 1 }\nconst _hoisted_3 = { key: 2 }\nconst _hoisted_4 = { key: 0 }\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_ion_img = _resolveComponent(\"ion-img\")!\n const _component_ion_thumbnail = _resolveComponent(\"ion-thumbnail\")!\n const _component_ion_icon = _resolveComponent(\"ion-icon\")!\n const _component_ion_label = _resolveComponent(\"ion-label\")!\n const _component_ion_radio = _resolveComponent(\"ion-radio\")!\n const _component_ion_item = _resolveComponent(\"ion-item\")!\n\n return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.collections, (collection) => {\n return (_openBlock(), _createBlock(_component_ion_item, {\n class: \"collection-list-item\",\n key: collection.id,\n onClick: ($event: any) => (!_ctx.isInSelectionMode ? _ctx.goToCollectionPage(collection) : '')\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_thumbnail, { slot: \"start\" }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_img, {\n src: (collection.thumbnail && collection.thumbnail.thumbnail && collection.thumbnail.thumbnail[0]) ? collection.thumbnail.thumbnail[0] : _ctx.thumbnailPlaceholder,\n alt: collection.name ? collection.name : _ctx.$('label_collection_without_name')\n }, null, 8, [\"src\", \"alt\"])\n ]),\n _: 2\n }, 1024),\n _createVNode(_component_ion_label, null, {\n default: _withCtx(() => [\n _createElementVNode(\"h2\", null, [\n _createTextVNode(_toDisplayString(collection.name ? collection.name : _ctx.$t('label_collection_without_name')) + \"  \", 1),\n (collection.status === 'private')\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_1, [\n _createVNode(_component_ion_icon, { icon: _ctx.lockClosedOutline }, null, 8, [\"icon\"])\n ]))\n : (collection.status === 'draft')\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_2, [\n _createVNode(_component_ion_icon, { icon: _ctx.readerOutline }, null, 8, [\"icon\"])\n ]))\n : (collection.status === 'trash')\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_3, [\n _createVNode(_component_ion_icon, { icon: _ctx.trashOutline }, null, 8, [\"icon\"])\n ]))\n : _createCommentVNode(\"\", true)\n ]),\n (collection.total_items)\n ? (_openBlock(), _createElementBlock(\"p\", _hoisted_4, _toDisplayString(_ctx.$t('total_of_published_items', [collection.total_items.publish])), 1))\n : _createCommentVNode(\"\", true)\n ]),\n _: 2\n }, 1024),\n (_ctx.isInSelectionMode)\n ? (_openBlock(), _createBlock(_component_ion_radio, {\n key: 0,\n slot: \"end\",\n value: collection.id\n }, null, 8, [\"value\"]))\n : _createCommentVNode(\"\", true)\n ]),\n _: 2\n }, 1032, [\"onClick\"]))\n }), 128))\n}","\nimport {\n IonItem,\n IonImg,\n IonThumbnail,\n IonLabel,\n IonIcon,\n IonRadio\n} from '@ionic/vue';\nimport { useRouter } from \"vue-router\";\nimport { lockClosedOutline, readerOutline, trashOutline } from 'ionicons/icons';\nimport { computed, defineComponent } from 'vue';\n\nexport default defineComponent({\n props: [\n \"collections\",\n \"isSelectionMode\"\n ],\n components: {\n IonItem,\n IonImg,\n IonThumbnail,\n IonLabel,\n IonIcon,\n IonRadio\n },\n setup(props) {\n const isInSelectionMode = computed(() => props.isSelectionMode);\n const thumbnailPlaceholder = computed (() => require('../../assets/placeholder_square_small.png'))\n const router = useRouter();\n const goToCollectionPage = (collection: any) => {\n router.push({\n name: 'collection',\n params: {\n id: collection.id\n },\n });\n }\n return {\n thumbnailPlaceholder,\n lockClosedOutline,\n readerOutline,\n trashOutline,\n goToCollectionPage,\n isInSelectionMode\n }\n },\n})\n","import { render } from \"./CollectionsList.vue?vue&type=template&id=cb174d0e&ts=true\"\nimport script from \"./CollectionsList.vue?vue&type=script&lang=ts\"\nexport * from \"./CollectionsList.vue?vue&type=script&lang=ts\"\n\nimport \"./CollectionsList.vue?vue&type=style&index=0&id=cb174d0e&lang=css\"\n\nimport exportComponent from \"/home/mateus/tainacan-mobile/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent, createVNode as _createVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, withCtx as _withCtx, createBlock as _createBlock } from \"vue\"\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_ion_img = _resolveComponent(\"ion-img\")!\n const _component_ion_card_title = _resolveComponent(\"ion-card-title\")!\n const _component_ion_card_header = _resolveComponent(\"ion-card-header\")!\n const _component_ion_card = _resolveComponent(\"ion-card\")!\n const _component_ion_col = _resolveComponent(\"ion-col\")!\n const _component_ion_row = _resolveComponent(\"ion-row\")!\n\n return (_openBlock(), _createBlock(_component_ion_row, { class: \"items-list-container\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.items, (item) => {\n return (_openBlock(), _createBlock(_component_ion_col, {\n size: \"4\",\n key: item.id\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_card, {\n onClick: ($event: any) => (_ctx.openActionSheet(item)),\n button: \"\",\n color: \"light\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_img, {\n src: (item.thumbnail && item.thumbnail['tainacan-medium'] && item.thumbnail['tainacan-medium'][0]) ? item.thumbnail['tainacan-medium'][0] : _ctx.thumbnailPlaceholder,\n alt: (item.thumbnail_alt ? item.thumbnail_alt : (item.title ? item.title : 'Imagem de item sem título'))\n }, null, 8, [\"src\", \"alt\"]),\n _createVNode(_component_ion_card_header, null, {\n default: _withCtx(() => [\n _createVNode(_component_ion_card_title, null, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(item.title ? item.title : _ctx.$t('label_item_without_title')), 1)\n ]),\n _: 2\n }, 1024)\n ]),\n _: 2\n }, 1024)\n ]),\n _: 2\n }, 1032, [\"onClick\"])\n ]),\n _: 2\n }, 1024))\n }), 128))\n ]),\n _: 1\n }))\n}","\nimport {\n IonCardHeader,\n IonRow,\n IonCol,\n IonCard,\n IonImg,\n IonCardTitle,\n actionSheetController,\n ActionSheetButton\n} from '@ionic/vue';\nimport { pencil, trashBin } from \"ionicons/icons\";\nimport { computed, ref, defineComponent } from 'vue';\nimport { useWpStore } from '@/store/storeWp';\nimport { useTainacanStore } from '@/store/storeTainacan';\nimport { InAppBrowserEvent } from '@awesome-cordova-plugins/in-app-browser';\n\nexport default defineComponent({\n props: [\n \"items\"\n ],\n components: {\n IonCardHeader,\n IonRow,\n IonCol,\n IonCard,\n IonImg,\n IonCardTitle\n },\n setup() {\n const wpStore = useWpStore();\n const tainacanStore = useTainacanStore();\n const thumbnailPlaceholder = computed (() => require('../../assets/placeholder_square_small.png'));\n \n const actionSheetLabels = ref({\n header: '',\n button1: '',\n button2: '',\n cancel: ''\n });\n const setActionSheetLabels = (newLabels: any) => actionSheetLabels.value = newLabels;\n const openActionSheet = async (event: any) => {\n const item = event;\n \n if (item.current_user_can_edit || item.current_user_can_delete) {\n\n let actionSheetButtons: ActionSheetButton[] = [];\n\n if (item.current_user_can_edit)\n actionSheetButtons.push({\n text: actionSheetLabels.value.button1,\n icon: pencil,\n data: 'edit-item', \n handler: () => {\n openItemEdition(item);\n },\n });\n\n if (item.current_user_can_delete)\n actionSheetButtons.push({\n text: actionSheetLabels.value.button2,\n icon: trashBin,\n data: 'delete-item', \n handler: () => {\n deleteItem(item);\n }\n });\n\n actionSheetButtons.push({\n text: actionSheetLabels.value.cancel,\n role: 'cancel'\n });\n\n let actionSheetOptions = {\n header: actionSheetLabels.value.header,\n cssClass: 'item-creation-action-sheet',\n buttons: actionSheetButtons\n };\n\n const actionSheet = await actionSheetController.create(actionSheetOptions);\n await actionSheet.present();\n }\n }\n const deleteItem = function(item: any) {\n tainacanStore.deleteItem(item.id);\n }\n const openItemEdition = function(item: any) {\n wpStore.openInAppBrowser('?page=tainacan_admin&mobileAppMode=true#/collections/' + item.collection_id + '/items/' + item.id + '/edit');\n wpStore.listenEventInAppBrowser((event: InAppBrowserEvent) => {\n if (event &&\n event.data &&\n event.data.type === 'item_updated' &&\n event.data.item &&\n event.data.item.status !== 'auto-draft'\n ) {\n wpStore.hideInAppBrowser();\n }\n });\n }\n \n return { thumbnailPlaceholder, wpStore, openItemEdition, setActionSheetLabels, openActionSheet }\n },\n async created() {\n this.setActionSheetLabels({\n header: this.$t('label_item_actions'),\n button1: this.$t('label_option_edit_item'),\n button2: this.$t('label_option_delete_item'),\n cancel: this.$t('label_cancel')\n });\n }\n});\n","import { render } from \"./ItemsList.vue?vue&type=template&id=9ba821d8&ts=true\"\nimport script from \"./ItemsList.vue?vue&type=script&lang=ts\"\nexport * from \"./ItemsList.vue?vue&type=script&lang=ts\"\n\nimport \"./ItemsList.vue?vue&type=style&index=0&id=9ba821d8&lang=css\"\n\nimport exportComponent from \"/home/mateus/tainacan-mobile/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode } from \"vue\"\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_ion_refresher_content = _resolveComponent(\"ion-refresher-content\")!\n const _component_ion_refresher = _resolveComponent(\"ion-refresher\")!\n const _component_ion_loading = _resolveComponent(\"ion-loading\")!\n const _component_ion_list_header = _resolveComponent(\"ion-list-header\")!\n const _component_collections_list = _resolveComponent(\"collections-list\")!\n const _component_ion_list = _resolveComponent(\"ion-list\")!\n const _component_ion_icon = _resolveComponent(\"ion-icon\")!\n const _component_ion_button = _resolveComponent(\"ion-button\")!\n const _component_items_list = _resolveComponent(\"items-list\")!\n const _component_base_layout = _resolveComponent(\"base-layout\")!\n\n return (_openBlock(), _createBlock(_component_base_layout, null, {\n default: _withCtx(() => [\n _createVNode(_component_ion_refresher, {\n slot: \"fixed\",\n onIonRefresh: _cache[0] || (_cache[0] = ($event: any) => ($setup.doRefresh($event)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_refresher_content)\n ]),\n _: 1\n }),\n _createVNode(_component_ion_loading, {\n \"is-open\": $setup.isLoading,\n message: _ctx.$t('label_loading')\n }, null, 8, [\"is-open\", \"message\"]),\n _createVNode(_component_ion_list, null, {\n default: _withCtx(() => [\n _createVNode(_component_ion_list_header, null, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t('label_last_modified_collections')), 1)\n ]),\n _: 1\n }),\n _createVNode(_component_collections_list, {\n collections: $setup.tainacanStore.homeCollections\n }, null, 8, [\"collections\"])\n ]),\n _: 1\n }),\n ($setup.tainacanStore.homeCollections.length < $setup.tainacanStore.totalHomeCollections)\n ? (_openBlock(), _createBlock(_component_ion_button, {\n key: 0,\n fill: \"clear\",\n size: \"small\",\n routerLink: \"/collections\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t('label_view_all_collections', [$setup.tainacanStore.totalHomeCollections])) + \" \", 1),\n _createVNode(_component_ion_icon, {\n slot: \"end\",\n icon: $setup.arrowForwardOutline\n }, null, 8, [\"icon\"])\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n _createVNode(_component_ion_list, null, {\n default: _withCtx(() => [\n _createVNode(_component_ion_list_header, null, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t('label_last_modified_items')), 1)\n ]),\n _: 1\n }),\n _createVNode(_component_items_list, {\n items: $setup.tainacanStore.homeItems\n }, null, 8, [\"items\"]),\n ($setup.tainacanStore.homeItems.length < $setup.tainacanStore.totalHomeItems)\n ? (_openBlock(), _createBlock(_component_ion_button, {\n key: 0,\n fill: \"clear\",\n size: \"small\",\n routerLink: \"/items\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t('label_view_all_items', [$setup.tainacanStore.totalHomeItems])) + \" \", 1),\n _createVNode(_component_ion_icon, {\n slot: \"end\",\n icon: $setup.arrowForwardOutline\n }, null, 8, [\"icon\"])\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true)\n ]),\n _: 1\n })\n ]),\n _: 1\n }))\n}","\nimport {\n useTainacanStore\n} from '../store/storeTainacan';\nimport { ref } from 'vue';\n\nimport CollectionsList from '@/components/lists/CollectionsList.vue';\nimport ItemsList from '@/components/lists/ItemsList.vue';\nimport BaseLayout from '@/components/base/BaseLayout.vue';\nimport { arrowForwardOutline } from \"ionicons/icons\";\nimport {\n IonIcon,\n IonButton,\n IonLoading,\n IonList,\n IonListHeader,\n IonRefresher,\n IonRefresherContent\n} from '@ionic/vue';\n\nexport default {\n components: {\n IonIcon,\n CollectionsList,\n ItemsList,\n BaseLayout,\n IonList,\n IonListHeader,\n IonButton,\n IonLoading,\n IonRefresher,\n IonRefresherContent\n },\n setup() {\n const isLoading = ref(false);\n const setIsLoading = (state: boolean) => isLoading.value = state;\n const loadCollectionsAndItems = async () => {\n await tainacanStore.fetchHomeCollections();\n await tainacanStore.fetchHomeItems();\n }\n const doRefresh = async (event: any) => {\n await loadCollectionsAndItems();\n if (event && event.target)\n event.target.complete();\n }\n\n let tainacanStore = useTainacanStore();\n\n return {\n arrowForwardOutline,\n tainacanStore,\n isLoading,\n setIsLoading,\n loadCollectionsAndItems,\n doRefresh\n }\n },\n async created() {\n this.setIsLoading(true);\n await this.loadCollectionsAndItems();\n this.setIsLoading(false);\n }\n}\n\n","import { render } from \"./HomePage.vue?vue&type=template&id=34221c58&ts=true\"\nimport script from \"./HomePage.vue?vue&type=script&lang=ts\"\nexport * from \"./HomePage.vue?vue&type=script&lang=ts\"\n\nimport exportComponent from \"/home/mateus/tainacan-mobile/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { resolveComponent as _resolveComponent, createVNode as _createVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, withCtx as _withCtx, createElementVNode as _createElementVNode, withModifiers as _withModifiers, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = /*#__PURE__*/_createElementVNode(\"br\", null, null, -1)\nconst _hoisted_2 = /*#__PURE__*/_createTextVNode(\" Testes sem login \")\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_ion_img = _resolveComponent(\"ion-img\")!\n const _component_ion_label = _resolveComponent(\"ion-label\")!\n const _component_ion_input = _resolveComponent(\"ion-input\")!\n const _component_ion_item = _resolveComponent(\"ion-item\")!\n const _component_ion_list = _resolveComponent(\"ion-list\")!\n const _component_ion_icon = _resolveComponent(\"ion-icon\")!\n const _component_ion_button = _resolveComponent(\"ion-button\")!\n const _component_ion_col = _resolveComponent(\"ion-col\")!\n const _component_ion_row = _resolveComponent(\"ion-row\")!\n const _component_app_password_modal = _resolveComponent(\"app-password-modal\")!\n const _component_ion_content = _resolveComponent(\"ion-content\")!\n const _component_ion_page = _resolveComponent(\"ion-page\")!\n\n return (_openBlock(), _createBlock(_component_ion_page, null, {\n default: _withCtx(() => [\n _createVNode(_component_ion_content, {\n class: \"login-form-content\",\n fullscreen: \"\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_row, { class: \"ion-align-items-center ion-justify-content-center\" }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_col, null, {\n default: _withCtx(() => [\n _createVNode(_component_ion_img, {\n class: \"login-form-content__tainacan-logo\",\n alt: \"Logo Tainacan\",\n src: $setup.image\n }, null, 8, [\"src\"]),\n _createElementVNode(\"form\", {\n onSubmit: _cache[1] || (_cache[1] = _withModifiers(\n//@ts-ignore\n(...args) => ($options.openLoginForm && $options.openLoginForm(...args)), [\"prevent\"]))\n }, [\n _createVNode(_component_ion_list, {\n class: \"ion-no-margin\",\n inset: \"\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_item, null, {\n default: _withCtx(() => [\n _createVNode(_component_ion_label, { position: \"floating\" }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t(\"label_site_url\")), 1)\n ]),\n _: 1\n }),\n _createVNode(_component_ion_input, {\n placeholder: _ctx.$t('placeholder_site_url'),\n autofocus: \"true\",\n id: \"siteUrl\",\n type: \"url\",\n name: \"siteUrl\",\n modelValue: $data.siteUrl,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => (($data.siteUrl) = $event)),\n modelModifiers: { trim: true },\n required: \"true\",\n autocomplete: \"url\",\n enterkeyhint: \"next\"\n }, null, 8, [\"placeholder\", \"modelValue\"])\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _hoisted_1,\n _createVNode(_component_ion_button, {\n type: \"submit\",\n fill: \"clear\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t(\"label_access_archive\")) + \" \", 1),\n _createVNode(_component_ion_icon, {\n slot: \"end\",\n icon: $setup.arrowForwardOutline\n }, null, 8, [\"icon\"])\n ]),\n _: 1\n }),\n _createVNode(_component_ion_button, {\n onClick: $options.fakeLogin,\n color: \"danger\",\n fill: \"clear\"\n }, {\n default: _withCtx(() => [\n _hoisted_2,\n _createVNode(_component_ion_icon, {\n slot: \"end\",\n icon: $setup.arrowForwardOutline\n }, null, 8, [\"icon\"])\n ]),\n _: 1\n }, 8, [\"onClick\"])\n ], 32)\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _createVNode(_component_app_password_modal)\n ]),\n _: 1\n })\n ]),\n _: 1\n }))\n}","import { createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = /*#__PURE__*/_createElementVNode(\"h1\", null, \"Application Passwords\", -1)\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"p\", null, [\n /*#__PURE__*/_createElementVNode(\"em\", null, \"Application passwords\"),\n /*#__PURE__*/_createTextVNode(\" are a safe way to peform operations without using your actual website password. To generate one, you must: \"),\n /*#__PURE__*/_createElementVNode(\"ol\", null, [\n /*#__PURE__*/_createElementVNode(\"li\", null, [\n /*#__PURE__*/_createTextVNode(\"Open a web browser and login do your website traditional login page (usually \"),\n /*#__PURE__*/_createElementVNode(\"em\", null, \"\\\"https://your-website.com.br/wp-admin\\\"\"),\n /*#__PURE__*/_createTextVNode(\").\")\n ]),\n /*#__PURE__*/_createElementVNode(\"li\", null, \"Go to your profile page by clicking on your picture in the upper right corner.\"),\n /*#__PURE__*/_createElementVNode(\"li\", null, \"Scroll down to the \\\"Application passwords\\\" section. There should be a text input labelled \\\"New name to the application password\\\".\"),\n /*#__PURE__*/_createElementVNode(\"li\", null, \"Fill in the text input with any value to identify this password (you can have multiple), for example: \\\"Tainacan Mobile\\\".\"),\n /*#__PURE__*/_createElementVNode(\"li\", null, \"Click on the \\\"Add new application password\\\" button.\")\n ])\n], -1)\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"p\", null, \"With this steps completed, you will receive a code, that may look like this:\", -1)\nconst _hoisted_4 = /*#__PURE__*/_createElementVNode(\"pre\", null, [\n /*#__PURE__*/_createElementVNode(\"code\", null, \"vlOh CdaH UqWw YV7X beou 6MFY\")\n], -1)\nconst _hoisted_5 = /*#__PURE__*/_createElementVNode(\"p\", null, [\n /*#__PURE__*/_createTextVNode(\"Copy this code and \"),\n /*#__PURE__*/_createElementVNode(\"strong\", null, \"keep it safe somewhere\"),\n /*#__PURE__*/_createTextVNode(\". You won't be able to access it later. Finally, paste it on this app login screen.\")\n], -1)\nconst _hoisted_6 = /*#__PURE__*/_createElementVNode(\"p\", null, \"While it should be kept logged in, if you ever loose your access to the app, you can revogate the previous passwords and generate new ones in the same screen.\", -1)\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_ion_content = _resolveComponent(\"ion-content\")!\n const _component_ion_modal = _resolveComponent(\"ion-modal\")!\n\n return (_openBlock(), _createBlock(_component_ion_modal, {\n ref: \"modal\",\n trigger: \"open-explanation-modal\",\n \"initial-breakpoint\": 0.9,\n breakpoints: [0, 0.5, 0.75, 1.0]\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_content, {\n style: {\"font-size\":\"0.9375rem\",\"opacity\":\"0.85\"},\n class: \"ion-padding\"\n }, {\n default: _withCtx(() => [\n _hoisted_1,\n _hoisted_2,\n _hoisted_3,\n _hoisted_4,\n _hoisted_5,\n _hoisted_6\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"initial-breakpoint\", \"breakpoints\"]))\n}","\n\nimport {\n IonModal,\n IonContent\n} from '@ionic/vue';\nexport default {\n components: {\n IonModal,\n IonContent\n },\n setup() {\n return {}\n }\n}\n","import { render } from \"./AppPasswordModal.vue?vue&type=template&id=381ef17c&ts=true\"\nimport script from \"./AppPasswordModal.vue?vue&type=script&lang=ts\"\nexport * from \"./AppPasswordModal.vue?vue&type=script&lang=ts\"\n\nimport exportComponent from \"/home/mateus/tainacan-mobile/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","\nimport { useTainacanStore } from \"../store/storeTainacan\";\nimport { useWpStore } from \"../store/storeWp\";\nimport { arrowForwardOutline } from \"ionicons/icons\";\nimport AppPasswordModal from \"../components/modals/AppPasswordModal.vue\";\n\nimport {\n IonIcon,\n IonImg,\n IonPage,\n IonList,\n IonItem,\n IonButton,\n IonInput,\n IonLabel,\n IonRow,\n IonCol,\n IonContent,\n} from \"@ionic/vue\";\nimport { computed } from \"vue\";\nimport { InAppBrowserEvent } from \"@awesome-cordova-plugins/in-app-browser/index\";\n\nexport default {\n props: [\"pageTitle\", \"pageDefaultBackLink\"],\n components: {\n IonIcon,\n IonImg,\n IonPage,\n IonList,\n IonItem,\n IonButton,\n IonInput,\n IonLabel,\n IonRow,\n IonCol,\n IonContent,\n AppPasswordModal,\n },\n data() {\n return {\n siteUrl: \"\",\n };\n },\n setup() {\n const image = computed(() => require(\"../assets/logo_square.png\"));\n let tainacanStore = useTainacanStore();\n let wpStore = useWpStore();\n return { image, tainacanStore, wpStore, arrowForwardOutline };\n },\n methods: {\n async openLoginForm() {\n this.wpStore.userSiteUrl = this.siteUrl;\n await this.wpStore.fetchApplicationAuthorization(this.siteUrl);\n if (this.wpStore.authorizationURL) {\n this.wpStore.createInAppBrowser('?page=tainacan_mobile_app');\n this.wpStore.inAppBrowser\n .on(\"loadstop\")\n .subscribe(this.handleBrowserLoadStop);\n }\n },\n async handleBrowserLoadStop(event: InAppBrowserEvent) {\n // console.log(event)\n if (\n event.url &&\n typeof event.url == \"string\" &&\n event.url.split(\"?\") &&\n event.url.split(\"?\").length >= 2\n ) {\n const params = new URLSearchParams(event.url.split(\"?\")[1]);\n \n if ( params.get(\"page\") === \"tainacan_mobile_app\" ) {\n const userLogin = params.get(\"user_login\");\n let userToken = params.get(\"password\");\n\n if (\n typeof userToken == \"string\" &&\n userToken.indexOf(\"#\") >= 0\n )\n userToken = userToken.split(\"#\")[0];\n\n if (!!userLogin && !!userToken) {\n await this.wpStore.login(\n this.siteUrl,\n userLogin,\n userToken\n );\n this.$router.push(\"/home\");\n }\n this.wpStore.inAppBrowser.hide();\n }\n }\n },\n fakeLogin() {\n this.wpStore.login(\n 'https://rcteste.tainacan.org',\n '',\n ''\n );\n this.$router.push(\"/home\");\n }\n },\n};\n","import { render } from \"./LoginPage.vue?vue&type=template&id=cdfc6388&ts=true\"\nimport script from \"./LoginPage.vue?vue&type=script&lang=ts\"\nexport * from \"./LoginPage.vue?vue&type=script&lang=ts\"\n\nimport \"./LoginPage.vue?vue&type=style&index=0&id=cdfc6388&lang=css\"\n\nimport exportComponent from \"/home/mateus/tainacan-mobile/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, createElementBlock as _createElementBlock, createTextVNode as _createTextVNode } from \"vue\"\n\nconst _hoisted_1 = {\n key: 1,\n class: \"results-not-found\"\n}\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_ion_refresher_content = _resolveComponent(\"ion-refresher-content\")!\n const _component_ion_refresher = _resolveComponent(\"ion-refresher\")!\n const _component_ion_searchbar = _resolveComponent(\"ion-searchbar\")!\n const _component_ion_toolbar = _resolveComponent(\"ion-toolbar\")!\n const _component_ion_loading = _resolveComponent(\"ion-loading\")!\n const _component_ion_spinner = _resolveComponent(\"ion-spinner\")!\n const _component_items_list = _resolveComponent(\"items-list\")!\n const _component_ion_infinite_scroll_content = _resolveComponent(\"ion-infinite-scroll-content\")!\n const _component_ion_infinite_scroll = _resolveComponent(\"ion-infinite-scroll\")!\n const _component_ion_icon = _resolveComponent(\"ion-icon\")!\n const _component_ion_button = _resolveComponent(\"ion-button\")!\n const _component_base_layout = _resolveComponent(\"base-layout\")!\n\n return (_openBlock(), _createBlock(_component_base_layout, {\n \"page-title\": _ctx.$t('label_collection_items_list'),\n \"page-default-back-link\": \"/collections\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_refresher, {\n slot: \"fixed\",\n onIonRefresh: _cache[0] || (_cache[0] = ($event: any) => (_ctx.doRefresh($event)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_refresher_content)\n ]),\n _: 1\n }),\n _createVNode(_component_ion_toolbar, null, {\n default: _withCtx(() => [\n _createVNode(_component_ion_searchbar, {\n debounce: \"500\",\n placeholder: _ctx.$t('label_search'),\n onIonChange: _cache[1] || (_cache[1] = ($event: any) => (_ctx.handleSearch($event)))\n }, null, 8, [\"placeholder\"])\n ]),\n _: 1\n }),\n _createVNode(_component_ion_loading, {\n \"is-open\": _ctx.isLoading,\n message: _ctx.$t('label_loading')\n }, null, 8, [\"is-open\", \"message\"]),\n (_ctx.isSearching)\n ? (_openBlock(), _createBlock(_component_ion_spinner, { key: 0 }))\n : _createCommentVNode(\"\", true),\n (!_ctx.isLoading && !_ctx.isSearching && (!_ctx.tainacanStore.totalCollectionItems || _ctx.tainacanStore.totalCollectionItems == '0'))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"span\", null, _toDisplayString(_ctx.$t('label_no_results_found')), 1)\n ]))\n : _createCommentVNode(\"\", true),\n _createVNode(_component_items_list, {\n items: _ctx.tainacanStore.collectionItems\n }, null, 8, [\"items\"]),\n _createVNode(_component_ion_infinite_scroll, {\n ref: \"infiniteScroll\",\n threshold: \"5%\",\n onIonInfinite: _ctx.loadItemsByCollection\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_infinite_scroll_content)\n ]),\n _: 1\n }, 8, [\"onIonInfinite\"]),\n _createVNode(_component_ion_button, {\n class: \"add-items-button\",\n color: \"primary\",\n onClick: _cache[2] || (_cache[2] = ($event: any) => (_ctx.openActionSheet()))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_icon, { icon: _ctx.add }, null, 8, [\"icon\"]),\n _createTextVNode(\"  \" + _toDisplayString(_ctx.$t('label_add_items')), 1)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"page-title\"]))\n}","\nimport {\n useTainacanStore\n} from '../store/storeTainacan';\nimport { useWpStore } from '../store/storeWp';\nimport { ref, defineComponent } from 'vue';\nimport { add, documentOutline } from \"ionicons/icons\";\nimport {\n IonLoading,\n IonRefresher,\n IonRefresherContent,\n IonIcon,\n IonButton,\n actionSheetController,\n IonInfiniteScroll,\n IonToolbar,\n IonSearchbar,\n IonSpinner,\n IonInfiniteScrollContent\n} from '@ionic/vue';\nimport BaseLayout from '@/components/base/BaseLayout.vue';\nimport ItemsList from '@/components/lists/ItemsList.vue';\nimport { InAppBrowserEvent } from '@awesome-cordova-plugins/in-app-browser';\n\nexport default defineComponent({\n components: {\n BaseLayout,\n ItemsList,\n IonLoading,\n IonRefresher,\n IonRefresherContent,\n IonIcon,\n IonButton,\n IonInfiniteScroll,\n IonToolbar,\n IonSearchbar,\n IonSpinner,\n IonInfiniteScrollContent\n },\n props: {\n id: String\n },\n setup(props) {\n const isLoading = ref(false);\n const isSearching = ref(false)\n const search = ref();\n const infiniteScroll = ref();\n const setIsLoading = (state: boolean) => isLoading.value = state;\n const setIsSearching = (state: boolean) => isSearching.value = state;\n const setSearch = (value: string) => search.value = value;\n const loadItemsByCollection = async (event: any, reset: boolean) => {\n await tainacanStore.fetchItemsByCollection(props.id + '', { perPage: '12', orderBy: 'modified', reset: reset, search: search.value});\n let hasMoreCollectionsItems = tainacanStore.totalCollectionItems && tainacanStore.totalCollectionItems !== 0;\n if (event && event.target)\n event.target.complete();\n if (!hasMoreCollectionsItems){\n infiniteScroll.value.$el.disabled = true;\n }\n } \n const cancelSearch = async () => {\n await loadItemsByCollection(null, true);\n }\n const handleSearch = async (event: any) => {\n let search = event && event.detail && event.detail.value;\n\n setSearch(search);\n setIsSearching(true);\n\n if(search !== '') { \n await loadItemsByCollection(null, true);\n } else {\n await cancelSearch();\n }\n setIsSearching(false);\n }\n const doRefresh = async (event: any) => {\n await loadItemsByCollection({}, true);\n if (event && event.target){\n event.target.complete();\n infiniteScroll.value.$el.disabled = false;\n }\n }\n\n const wpStore = useWpStore();\n const actionSheetLabels = ref({\n header: '',\n button1: '',\n button2: '',\n button3: '',\n cancel: ''\n });\n const setActionSheetLabels = (newLabels: any) => actionSheetLabels.value = newLabels;\n const openActionSheet = async () => {\n const actionSheet = await actionSheetController.create({\n header: actionSheetLabels.value.header,\n cssClass: 'item-creation-action-sheet',\n buttons: [\n // {\n // text: actionSheetLabels.value.button1,\n // icon: documentsOutline,\n // data: 'multiple-items', \n // handler: () => {\n // wpStore.openInAppBrowser('?page=tainacan_admin&mobileAppMode=true#/collections/' + props.id + '/bulk-add');\n // wpStore.listenEventInAppBrowser((event: InAppBrowserEvent) => {\n // if (event &&\n // event.data &&\n // (\n // (\n // event.data.type === 'item_updated' &&\n // event.data.item &&\n // event.data.item.status !== 'auto-draft'\n // )\n // || event.data.type === 'exited_from_navigation'\n // )\n // ) {\n // wpStore.hideInAppBrowser();\n // loadItemsByCollection({}, true);\n // }\n // });\n // },\n // },\n {\n text: actionSheetLabels.value.button3,\n icon: documentOutline,\n data: 'single item',\n handler: () => {\n wpStore.openInAppBrowser('?page=tainacan_admin&mobileAppMode=true#/collections/' + props.id + '/items/new');\n wpStore.listenEventInAppBrowser((event: InAppBrowserEvent) => {\n if (event &&\n event.data &&\n event.data.type === 'item_updated' &&\n event.data.item &&\n event.data.item.status !== 'auto-draft'\n ) {\n wpStore.hideInAppBrowser();\n loadItemsByCollection({}, true);\n }\n });\n },\n },\n {\n text: actionSheetLabels.value.cancel,\n role: 'cancel'\n },\n ],\n });\n await actionSheet.present();\n //const { role, data } = await actionSheet.onDidDismiss();\n // console.log('onDidDismiss resolved with role and data', role, data);\n }\n\n let tainacanStore = useTainacanStore();\n return {\n isLoading,\n isSearching,\n tainacanStore,\n wpStore,\n setIsLoading,\n loadItemsByCollection,\n doRefresh,\n openActionSheet,\n add,\n actionSheetLabels,\n setActionSheetLabels,\n infiniteScroll,\n handleSearch,\n }\n },\n async created() {\n \n this.setActionSheetLabels({\n header: this.$t('info_create_items'),\n button1: this.$t('label_option_multiple_items'),\n button2: this.$t('label_option_multiple_attachments'),\n button3: this.$t('label_option_single_item'),\n cancel: this.$t('label_cancel')\n });\n this.setIsLoading(true);\n await this.loadItemsByCollection({}, true);\n this.setIsLoading(false);\n },\n});\n","import { render } from \"./CollectionPage.vue?vue&type=template&id=48252aad&ts=true\"\nimport script from \"./CollectionPage.vue?vue&type=script&lang=ts\"\nexport * from \"./CollectionPage.vue?vue&type=script&lang=ts\"\n\nimport \"./CollectionPage.vue?vue&type=style&index=0&id=48252aad&lang=css\"\n\nimport exportComponent from \"/home/mateus/tainacan-mobile/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_ion_loading = _resolveComponent(\"ion-loading\")!\n const _component_ion_refresher_content = _resolveComponent(\"ion-refresher-content\")!\n const _component_ion_refresher = _resolveComponent(\"ion-refresher\")!\n const _component_collections_list = _resolveComponent(\"collections-list\")!\n const _component_ion_list = _resolveComponent(\"ion-list\")!\n const _component_base_layout = _resolveComponent(\"base-layout\")!\n\n return (_openBlock(), _createBlock(_component_base_layout, {\n \"page-title\": _ctx.$t('label_collections_list'),\n \"page-default-back-link\": \"/\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_loading, {\n \"is-open\": $setup.isLoading,\n message: _ctx.$t('label_loading')\n }, null, 8, [\"is-open\", \"message\"]),\n _createVNode(_component_ion_refresher, {\n slot: \"fixed\",\n onIonRefresh: _cache[0] || (_cache[0] = ($event: any) => ($setup.doRefresh($event)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_refresher_content)\n ]),\n _: 1\n }),\n _createVNode(_component_ion_list, null, {\n default: _withCtx(() => [\n _createVNode(_component_collections_list, {\n collections: $setup.tainacanStore.collections,\n \"is-selection-mode\": false\n }, null, 8, [\"collections\"])\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"page-title\"]))\n}","\nimport CollectionsList from '@/components/lists/CollectionsList.vue';\nimport BaseLayout from '@/components/base/BaseLayout.vue';\nimport {\n IonLoading,\n IonList,\n IonRefresher,\n IonRefresherContent\n} from '@ionic/vue';\n\nimport {\n useTainacanStore\n} from '../store/storeTainacan';\n\nimport { ref } from 'vue';\n\nexport default {\n components: {\n CollectionsList,\n BaseLayout,\n IonLoading,\n IonList,\n IonRefresher,\n IonRefresherContent\n },\n setup() {\n const isLoading = ref(false);\n const setIsLoading = (state: boolean) => isLoading.value = state;\n \n const loadCollections = async () => {\n await tainacanStore.fetchCollections({ perPage: '24', orderBy: 'modified'});\n }\n const doRefresh = async (event: any) => {\n await loadCollections();\n if (event && event.target)\n event.target.complete();\n }\n\n let tainacanStore = useTainacanStore();\n \n return {\n tainacanStore,\n isLoading,\n setIsLoading,\n doRefresh,\n loadCollections\n }\n },\n async created(){\n this.setIsLoading(true);\n await this.loadCollections();\n this.setIsLoading(false);\n },\n}\n\n","import { render } from \"./CollectionsPage.vue?vue&type=template&id=86b52ab4&ts=true\"\nimport script from \"./CollectionsPage.vue?vue&type=script&lang=ts\"\nexport * from \"./CollectionsPage.vue?vue&type=script&lang=ts\"\n\nimport exportComponent from \"/home/mateus/tainacan-mobile/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5ba64bfe\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = {\n key: 1,\n class: \"results-not-found\"\n}\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_ion_loading = _resolveComponent(\"ion-loading\")!\n const _component_ion_searchbar = _resolveComponent(\"ion-searchbar\")!\n const _component_ion_toolbar = _resolveComponent(\"ion-toolbar\")!\n const _component_ion_refresher_content = _resolveComponent(\"ion-refresher-content\")!\n const _component_ion_refresher = _resolveComponent(\"ion-refresher\")!\n const _component_ion_spinner = _resolveComponent(\"ion-spinner\")!\n const _component_items_list = _resolveComponent(\"items-list\")!\n const _component_ion_infinite_scroll_content = _resolveComponent(\"ion-infinite-scroll-content\")!\n const _component_ion_infinite_scroll = _resolveComponent(\"ion-infinite-scroll\")!\n const _component_base_layout = _resolveComponent(\"base-layout\")!\n\n return (_openBlock(), _createBlock(_component_base_layout, {\n \"page-title\": _ctx.$t('label_items_list'),\n \"page-default-back-link\": \"/collections\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_loading, {\n \"is-open\": $setup.isLoading,\n message: _ctx.$t('label_loading')\n }, null, 8, [\"is-open\", \"message\"]),\n _createVNode(_component_ion_toolbar, null, {\n default: _withCtx(() => [\n _createVNode(_component_ion_searchbar, {\n debounce: \"500\",\n placeholder: _ctx.$t('label_search'),\n onIonChange: _cache[0] || (_cache[0] = ($event: any) => ($setup.handleSearch($event)))\n }, null, 8, [\"placeholder\"])\n ]),\n _: 1\n }),\n _createVNode(_component_ion_refresher, {\n slot: \"fixed\",\n onIonRefresh: _cache[1] || (_cache[1] = ($event: any) => ($setup.doRefresh($event)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_refresher_content)\n ]),\n _: 1\n }),\n ($setup.isSearching)\n ? (_openBlock(), _createBlock(_component_ion_spinner, { key: 0 }))\n : _createCommentVNode(\"\", true),\n (!$setup.isLoading && !$setup.isSearching && (!$setup.tainacanStore.totalItems || $setup.tainacanStore.totalItems == '0'))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"span\", null, _toDisplayString(_ctx.$t('label_no_results_found')), 1)\n ]))\n : _createCommentVNode(\"\", true),\n _createVNode(_component_items_list, {\n items: $setup.tainacanStore.items\n }, null, 8, [\"items\"]),\n _createVNode(_component_ion_infinite_scroll, {\n ref: \"infiniteScroll\",\n threshold: \"5%\",\n onIonInfinite: $setup.loadItems\n }, {\n default: _withCtx(() => [\n _createVNode(_component_ion_infinite_scroll_content)\n ]),\n _: 1\n }, 8, [\"onIonInfinite\"])\n ]),\n _: 1\n }, 8, [\"page-title\"]))\n}","\nimport {\n useTainacanStore\n} from '../store/storeTainacan';\nimport {\n IonLoading,\n IonRefresher,\n IonRefresherContent,\n IonInfiniteScroll,\n IonToolbar,\n IonSearchbar,\n IonSpinner,\n IonInfiniteScrollContent\n} from '@ionic/vue';\nimport BaseLayout from '@/components/base/BaseLayout.vue';\nimport { ref } from 'vue';\nimport ItemsList from '../components/lists/ItemsList.vue';\nexport default {\n components: {\n IonLoading,\n ItemsList,\n BaseLayout,\n IonRefresher,\n IonRefresherContent,\n IonInfiniteScroll,\n IonToolbar,\n IonSearchbar,\n IonSpinner, \n IonInfiniteScrollContent\n },\n setup() {\n const isLoading = ref(false);\n const isSearching = ref(false)\n const search = ref();\n const setIsLoading = (state: boolean) => isLoading.value = state;\n const setIsSearching = (state: boolean) => isSearching.value = state;\n const setSearch = (value: string) => search.value = value; \n const infiniteScroll = ref();\n const loadItems = async (event: any, reset: boolean) => {\n await tainacanStore.fetchItems({ perPage: '12', orderBy: 'modified', reset: reset, search: search.value});\n let hasMoreItems = tainacanStore.totalItems && tainacanStore.totalItems !== 0;\n if (event && event.target)\n event.target.complete();\n if (!hasMoreItems){\n infiniteScroll.value.$el.disabled = true;\n }\n } \n const cancelSearch = async () => {\n await loadItems(null, true);\n }\n const handleSearch = async (event: any) => {\n let search = event && event.detail && event.detail.value;\n \n setSearch(search);\n setIsSearching(true);\n\n if(search !== '') {\n await loadItems(null, true);\n setIsSearching(false);\n } else {\n await cancelSearch();\n }\n setIsSearching(false);\n }\n const doRefresh = async (event: any) => {\n await loadItems({}, true);\n if (event && event.target){\n event.target.complete();\n infiniteScroll.value.$el.disabled = false;\n }\n }\n let tainacanStore = useTainacanStore();\n return {\n isLoading,\n isSearching,\n setIsLoading,\n tainacanStore,\n doRefresh,\n loadItems,\n infiniteScroll,\n handleSearch\n }\n },\n async created(){\n this.setIsLoading(true)\n await this.loadItems();\n this.setIsLoading(false)\n },\n}\n","import { render } from \"./ItemsPage.vue?vue&type=template&id=5ba64bfe&scoped=true&ts=true\"\nimport script from \"./ItemsPage.vue?vue&type=script&lang=ts\"\nexport * from \"./ItemsPage.vue?vue&type=script&lang=ts\"\n\nimport \"./ItemsPage.vue?vue&type=style&index=0&id=5ba64bfe&scoped=true&lang=css\"\n\nimport exportComponent from \"/home/mateus/tainacan-mobile/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-5ba64bfe\"]])\n\nexport default __exports__","import { createRouter, createWebHistory } from '@ionic/vue-router';\nimport { RouteRecordRaw } from 'vue-router';\nimport { useWpStore } from '../store/storeWp'\n\nimport HomePage from '../pages/HomePage.vue';\nimport LoginPage from '../pages/LoginPage.vue';\nimport CollectionPage from '../pages/CollectionPage.vue';\nimport CollectionsPage from '../pages/CollectionsPage.vue';\nimport ItemsPage from '../pages/ItemsPage.vue';\n\nconst routes: Array = [\n {\n path: '/',\n redirect: '/home'\n },\n {\n path: '/home',\n component: HomePage,\n name: 'home'\n },\n {\n path: '/login',\n component: LoginPage,\n name: 'login'\n },\n {\n path: '/collections/:id',\n component: CollectionPage,\n name: 'collection',\n props: true\n },\n {\n path: '/collections',\n component: CollectionsPage,\n name: 'collections'\n },\n {\n path: '/items',\n component: ItemsPage,\n name: 'items'\n }\n]\n\nconst router = createRouter({\n history: createWebHistory(process.env.BASE_URL),\n routes\n})\n\nrouter.beforeEach(async(to, from, next) => {\n const wpStore = useWpStore();\n await wpStore.checkUserLogin();\n if (to.name !== 'login' && !wpStore.userIsLoggedIn) next({ name: 'login' })\n else next()\n})\n\nexport default router\n\n","export const translationStrings = {\n en: {\n collections: 'Collections',\n label_view_all_collections: 'View all {0} collections',\n items: 'Items',\n label_view_all_items: 'View all {0} items',\n label_loading: 'Loading...',\n label_items_list: 'Items list',\n label_collections_list: 'Collections list',\n label_collection_items_list: 'Collection items list',\n collection: 'Collection',\n label_site_url: 'Archive site URL',\n placeholder_site_url: 'https://my-tainacan-archive.com',\n label_user_name: 'User name',\n placeholder_user_name: 'your user name',\n label_user_password: 'User application password',\n placeholder_user_password: 'your application password here',\n label_access_archive: 'Access archive',\n label_item_without_title: 'Item without title',\n label_collection_without_name: 'Collection without name',\n total_of_published_items: 'Total of {0} published items',\n label_last_modified_collections: 'Last modified collections',\n label_last_modified_items: 'Last modified itens',\n label_add_items: 'Add items',\n info_create_items: 'Create new items in this collection',\n label_option_multiple_items: 'Multiple items from file selection',\n label_option_multiple_attachments: 'Single item with document and attachments from file selection',\n label_option_single_item: 'Single empty item',\n label_cancel: 'Cancel',\n label_search: 'Search',\n label_no_results_found: 'No results found',\n info_application_password: 'This password is not the same of your WordPress admin.',\n label_learn_more_here: 'Learn more here',\n label_item_actions: 'Item actions',\n label_option_edit_item: 'Edit item',\n label_option_delete_item: 'Send item to trash',\n error_label_fetch_collections: 'Collections loading error',\n error_label_fetch_items_collections: 'Items collections loading error',\n error_label_fetch_items: 'Items loading error',\n error_delete_item: 'Error while deleting item'\n },\n pt: {\n collections: \"Coleções\",\n label_view_all_collections: \"Ver todas as {0} coleções\",\n items: 'Itens',\n label_view_all_items: 'Ver todos os {0} itens',\n label_loading: 'Carregando...',\n label_items_list: 'Lista de itens',\n label_collections_list: 'Lista de coleções',\n label_collection_items_list: 'Lista de itens da coleção',\n collection: 'Coleção',\n label_site_url: 'URL do Site do Acervo',\n placeholder_site_url: 'https://meu-acervo-tainacan.com',\n label_user_name: 'Nome de usuário',\n placeholder_user_name: 'seu nome de usuário aqui',\n label_user_password: 'Senha do usuário da aplicação',\n placeholder_user_password: 'sua senha de usuário da aplicação aqui',\n label_access_archive: 'Acessar acervo',\n label_item_without_title: 'Item sem título',\n label_collection_without_name: 'Coleção sem nome',\n total_of_published_items: 'Total de {0} itens públicos',\n label_last_modified_collections: 'Coleções alteradas recentemente',\n label_last_modified_items: 'Itens alterados recentemente',\n label_add_items: 'Adicionar itens',\n info_create_items: 'Crie novos itens nesta coleção',\n label_option_multiple_items: 'Vários itens a partir de uma seleção de arquivos',\n label_option_multiple_attachments: 'Um item com documento e anexos provenientes de ums seleção de aquivos',\n label_option_single_item: 'Um item vazio',\n label_cancel: 'Cancelar',\n label_search: 'Buscar',\n label_no_results_found: 'Nenhum resultado encontrado',\n info_application_password: 'Esta senha não é a mesma do seu painel admin do WordPress.',\n label_learn_more_here: 'Saiba mais aqui.',\n label_item_actions: 'Ações para o item',\n label_option_edit_item: 'Editar item',\n label_option_delete_item: 'Enviar item para lixeira',\n error_label_fetch_collections: 'Erro no carregamento das coleções',\n error_label_fetch_items_collections: 'Erro no carregamento dos itens da coleção',\n error_label_fetch_items: 'Erro no carregamento dos itens',\n error_delete_item: 'Erro ao tentar remover item'\n }\n}","import { createApp } from 'vue'\n\nimport App from './App.vue'\nimport BaseLayout from './components/base/BaseLayout.vue';\nimport CollectionList from './components/lists/CollectionsList.vue';\nimport ItemList from './components/lists/ItemsList.vue';\nimport router from './router';\nimport { createPinia } from 'pinia';\n\nimport { IonicVue } from '@ionic/vue';\n\n/* Core CSS required for Ionic components to work properly */\nimport '@ionic/vue/css/core.css';\n\n/* Basic CSS for apps built with Ionic */\nimport '@ionic/vue/css/normalize.css';\nimport '@ionic/vue/css/structure.css';\nimport '@ionic/vue/css/typography.css';\n\n/* Optional CSS utils that can be commented out */\nimport '@ionic/vue/css/padding.css';\nimport '@ionic/vue/css/float-elements.css';\nimport '@ionic/vue/css/text-alignment.css';\nimport '@ionic/vue/css/text-transformation.css';\nimport '@ionic/vue/css/flex-utils.css';\nimport '@ionic/vue/css/display.css';\n\n/* Theme variables */\nimport './theme/variables.css';\nimport './theme/core.css'; //importei do arquivo criado\n\n/* Translation */\nimport { createI18n } from 'vue-i18n';\nimport { translationStrings } from './locales/translation-strings';\n\nconst i18n = createI18n({\n locale: 'en', // set locale\n fallbackLocale: 'en', // set fallback locale\n messages: translationStrings, // set locale messages\n })\n\nconst app = createApp(App)\n .use(IonicVue)\n .use(router)\n .use(createPinia())\n .use(i18n);\n\napp.component('base-layout', BaseLayout);\napp.component('base-collectionlist', CollectionList);\napp.component('base-itemlist', ItemList);\n \nrouter.isReady().then(() => {\n app.mount('#app');\n});","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = function(result, chunkIds, fn, priority) {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = function(chunkId) {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"js/\" + chunkId + \".\" + {\"78\":\"51f18a44\",\"168\":\"c83a23ff\",\"338\":\"fff3ebb3\",\"544\":\"94817512\",\"576\":\"a82798ee\",\"753\":\"17d4d392\",\"775\":\"c55644c6\",\"880\":\"e288775e\",\"961\":\"2fab5ec9\",\"990\":\"cdf4956e\"}[chunkId] + \".js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = function(chunkId) {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","var inProgress = {};\nvar dataWebpackPrefix = \"tainacan-mobile:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = function(url, done, key, chunkId) {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = function(prev, event) {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach(function(fn) { return fn(event); });\n\t\tif(prev) return prev(event);\n\t}\n\t;\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"/\";","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t143: 0\n};\n\n__webpack_require__.f.j = function(chunkId, promises) {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise(function(resolve, reject) { installedChunkData = installedChunks[chunkId] = [resolve, reject]; });\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = function(event) {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunktainacan_mobile\"] = self[\"webpackChunktainacan_mobile\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [998], function() { return __webpack_require__(6210); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["webpackEmptyAsyncContext","req","Promise","resolve","then","e","Error","code","keys","id","module","exports","render","_ctx","_cache","$props","$setup","$data","$options","_component_ion_router_outlet","_resolveComponent","_component_ion_app","_openBlock","_createBlock","default","_withCtx","_createVNode","_","defineComponent","name","components","IonApp","IonRouterOutlet","mounted","device","Device","getLanguageCode","res","value","includes","language","split","this","$i18n","locale","__exports__","_component_ion_back_button","_component_ion_buttons","_component_ion_img","_component_ion_icon","_component_ion_button","_component_ion_toolbar","_component_ion_title","_component_ion_header","_component_ion_content","_component_ion_toast","_component_ion_page","collapse","slot","pageDefaultBackLink","src","tainacanLogo","class","onClick","logOff","icon","logOutOutline","pageTitle","key","_createTextVNode","_toDisplayString","_createCommentVNode","fullscreen","_renderSlot","$slots","tainacanStore","errorStatus","message","$t","errorMessage","duration","onDidDismiss","$event","setOpen","color","store","Storage","useWpStore","defineStore","state","userIsLoggedIn","userSiteUrl","userLogin","userToken","authorizationURL","inAppBrowser","InAppBrowserObject","actions","async","set","err","siteUrl","endpoint","response","axios","data","authentication","endpoints","authorization","create","get","createInAppBrowser","url","extraParams","tainacanAdminUrl","anInAppBrowser","InAppBrowser","openInAppBrowser","executeScript","urlRedirectionScript","show","hideInAppBrowser","hide","listenEventInAppBrowser","event","on","subscribe","length","params","indexOf","useTainacanStore","homeCollections","totalHomeCollections","homeItems","totalHomeItems","collections","totalCollections","collectionItems","totalCollectionItems","nextItemsByCollectionPage","items","nextItemsPage","totalItems","wpStore","btoa","perPage","orderBy","headers","collectionId","search","reset","push","itemId","existingItemIndex","anItem","splice","existingHomeItemIndex","existingCollectionItemIndex","props","IonPage","IonHeader","IonToolbar","IonTitle","IonContent","IonIcon","IonButton","IonBackButton","IonButtons","IonImg","IonToast","setup","computed","require","methods","logoff","$router","go","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_component_ion_thumbnail","_component_ion_label","_component_ion_radio","_component_ion_item","_createElementBlock","_Fragment","_renderList","collection","isInSelectionMode","goToCollectionPage","thumbnail","thumbnailPlaceholder","alt","$","_createElementVNode","status","lockClosedOutline","readerOutline","trashOutline","total_items","publish","IonItem","IonThumbnail","IonLabel","IonRadio","isSelectionMode","router","useRouter","_component_ion_card_title","_component_ion_card_header","_component_ion_card","_component_ion_col","_component_ion_row","item","size","openActionSheet","button","thumbnail_alt","title","IonCardHeader","IonRow","IonCol","IonCard","IonCardTitle","actionSheetLabels","ref","header","button1","button2","cancel","setActionSheetLabels","newLabels","current_user_can_edit","current_user_can_delete","actionSheetButtons","text","pencil","handler","openItemEdition","trashBin","deleteItem","role","actionSheetOptions","cssClass","buttons","actionSheet","actionSheetController","present","collection_id","type","_component_ion_refresher_content","_component_ion_refresher","_component_ion_loading","_component_ion_list_header","_component_collections_list","_component_ion_list","_component_items_list","_component_base_layout","onIonRefresh","doRefresh","isLoading","fill","routerLink","arrowForwardOutline","CollectionsList","ItemsList","BaseLayout","IonList","IonListHeader","IonLoading","IonRefresher","IonRefresherContent","setIsLoading","loadCollectionsAndItems","fetchHomeCollections","fetchHomeItems","target","complete","_component_ion_input","_component_app_password_modal","image","onSubmit","_withModifiers","args","openLoginForm","inset","position","placeholder","autofocus","modelValue","modelModifiers","trim","required","autocomplete","enterkeyhint","fakeLogin","_hoisted_5","_hoisted_6","_component_ion_modal","trigger","breakpoints","style","IonModal","IonInput","AppPasswordModal","fetchApplicationAuthorization","handleBrowserLoadStop","URLSearchParams","login","_component_ion_searchbar","_component_ion_spinner","_component_ion_infinite_scroll_content","_component_ion_infinite_scroll","debounce","onIonChange","handleSearch","isSearching","threshold","onIonInfinite","loadItemsByCollection","add","IonInfiniteScroll","IonSearchbar","IonSpinner","IonInfiniteScrollContent","String","infiniteScroll","setIsSearching","setSearch","fetchItemsByCollection","hasMoreCollectionsItems","$el","disabled","cancelSearch","detail","button3","documentOutline","loadCollections","fetchCollections","loadItems","fetchItems","hasMoreItems","routes","path","redirect","component","HomePage","LoginPage","CollectionPage","CollectionsPage","ItemsPage","createRouter","history","createWebHistory","process","beforeEach","to","from","next","checkUserLogin","translationStrings","en","label_view_all_collections","label_view_all_items","label_loading","label_items_list","label_collections_list","label_collection_items_list","label_site_url","placeholder_site_url","label_user_name","placeholder_user_name","label_user_password","placeholder_user_password","label_access_archive","label_item_without_title","label_collection_without_name","total_of_published_items","label_last_modified_collections","label_last_modified_items","label_add_items","info_create_items","label_option_multiple_items","label_option_multiple_attachments","label_option_single_item","label_cancel","label_search","label_no_results_found","info_application_password","label_learn_more_here","label_item_actions","label_option_edit_item","label_option_delete_item","error_label_fetch_collections","error_label_fetch_items_collections","error_label_fetch_items","error_delete_item","pt","i18n","createI18n","fallbackLocale","messages","app","createApp","App","use","IonicVue","createPinia","CollectionList","ItemList","mount","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","m","deferred","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","fulfilled","j","Object","every","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","f","chunkId","all","reduce","promises","u","miniCssF","g","globalThis","Function","window","obj","prop","prototype","hasOwnProperty","call","inProgress","dataWebpackPrefix","l","done","script","needAttach","scripts","document","getElementsByTagName","s","getAttribute","createElement","charset","timeout","nc","setAttribute","onScriptComplete","prev","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","forEach","setTimeout","bind","head","appendChild","Symbol","toStringTag","p","installedChunks","installedChunkData","promise","reject","error","loadingEnded","errorType","realSrc","request","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","self","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/src/pages/LoginPage.vue b/src/pages/LoginPage.vue index e82672d..b3b9df9 100644 --- a/src/pages/LoginPage.vue +++ b/src/pages/LoginPage.vue @@ -137,7 +137,7 @@ export default { userLogin, userToken ); - this.$router.push("/home"); + this.$router.replace("/home"); } this.wpStore.inAppBrowser.hide(); } diff --git a/src/store/storeWp.ts b/src/store/storeWp.ts index b2f801b..b16599a 100644 --- a/src/store/storeWp.ts +++ b/src/store/storeWp.ts @@ -56,6 +56,7 @@ const useWpStore = defineStore("wp", { this.userSiteUrl = ""; this.userToken = ""; this.userToken = ""; + this.inAppBrowser.close(); delete this.inAppBrowser; //console.error("Erro no logoff:", err); return err; @@ -95,7 +96,7 @@ const useWpStore = defineStore("wp", { let tainacanAdminUrl = this.userSiteUrl + "/wp-admin/admin.php" + url; if (!this.userIsLoggedIn && this.authorizationURL) tainacanAdminUrl = this.authorizationURL + "?app_name=TainacanMobileApp&success_url=" + tainacanAdminUrl; - + const anInAppBrowser = InAppBrowser.create(tainacanAdminUrl, '_blank', extraParams); this.inAppBrowser = anInAppBrowser; },